zhoulisen 5 лет назад
Родитель
Сommit
3ca6ce5d13

+ 7
- 0
src/pages/activity/dataRecord/table/visitNum.jsx Просмотреть файл

35
     })
35
     })
36
   }
36
   }
37
 
37
 
38
+  const format = data =>{    
39
+  return <div dangerouslySetInnerHTML={{__html:data.replace(/,/g,",<br/>")}}>{}</div>
40
+  }
38
 
41
 
39
   let columns = [
42
   let columns = [
40
     {
43
     {
66
       title: '置业顾问',
69
       title: '置业顾问',
67
       dataIndex: 'realtyConsultant',
70
       dataIndex: 'realtyConsultant',
68
       key: 'realtyConsultant',
71
       key: 'realtyConsultant',
72
+      render: (x, row) => <>{row.realtyConsultant?format(row.realtyConsultant):''}</>,
73
+      width:180
69
     },
74
     },
70
     {
75
     {
71
       title: '置业顾问电话',
76
       title: '置业顾问电话',
72
       dataIndex: 'realtyConsultantPhone',
77
       dataIndex: 'realtyConsultantPhone',
73
       key: 'realtyConsultantPhone',
78
       key: 'realtyConsultantPhone',
79
+      render: (x, row) => <>{row.realtyConsultantPhone?format(row.realtyConsultantPhone):''}</>,
80
+      width:180
74
     },
81
     },
75
     {
82
     {
76
       title: '分享者',
83
       title: '分享者',

+ 9
- 1
src/pages/activity/dataRecord/table/visitors.jsx Просмотреть файл

47
   //     this.setState({ tableData: data.records, total: data.total})
47
   //     this.setState({ tableData: data.records, total: data.total})
48
   //   }).catch()
48
   //   }).catch()
49
   // }
49
   // }
50
-
50
+  const format = data =>{
51
+    console.log(data.replace(/,/g,'\n'))
52
+    
53
+  return <div dangerouslySetInnerHTML={{__html:data.replace(/,/g,",<br/>")}}>{}</div>
54
+  }
51
   const columns = [
55
   const columns = [
52
     {
56
     {
53
       title: '姓名',
57
       title: '姓名',
78
       title: '置业顾问',
82
       title: '置业顾问',
79
       dataIndex: 'realtyConsultant',
83
       dataIndex: 'realtyConsultant',
80
       key: 'realtyConsultant',
84
       key: 'realtyConsultant',
85
+      render: (x, row) => <>{row.realtyConsultant?format(row.realtyConsultant):''}</>,
86
+      width:180
81
     },
87
     },
82
     {
88
     {
83
       title: '置业顾问电话',
89
       title: '置业顾问电话',
84
       dataIndex: 'realtyConsultantPhone',
90
       dataIndex: 'realtyConsultantPhone',
85
       key: 'realtyConsultantPhone',
91
       key: 'realtyConsultantPhone',
92
+      render: (x, row) => <>{row.realtyConsultantPhone?format(row.realtyConsultantPhone):''}</>,
93
+      width:180
86
     },
94
     },
87
     {
95
     {
88
       title: '推广人',
96
       title: '推广人',