许静 5 years ago
parent
commit
bd49e54eb3

+ 1
- 1
src/components/SelectButton/NewTypeSelect.jsx View File

30
   }
30
   }
31
 
31
 
32
   return (
32
   return (
33
-      <Select value={props.value} style={{ width: '180px' }} placeholder="请选择讯类型" onChange={props.onChange}>
33
+      <Select value={props.value} style={{ width: '180px' }} placeholder="请选择讯类型" onChange={props.onChange}>
34
           {data.map(type => (
34
           {data.map(type => (
35
             <Option key={type.newsTypeId}>{type.newsTypeName}</Option>
35
             <Option key={type.newsTypeId}>{type.newsTypeName}</Option>
36
           ))}
36
           ))}

+ 20
- 13
src/pages/indexEcharts/components/UserConversion.jsx View File

18
     UserConversionRate({ conversion: 'authorization_phone' })
18
     UserConversionRate({ conversion: 'authorization_phone' })
19
   }, [])
19
   }, [])
20
 
20
 
21
-  function UserConversionRate (params) {
21
+  function UserConversionRate(params) {
22
 
22
 
23
     request({
23
     request({
24
       ...apis.indexEcharts.userConversion,
24
       ...apis.indexEcharts.userConversion,
25
       params,
25
       params,
26
-    }).then(data => {  
27
-      console.log(data.data_count.registeredCount/data.data_count.pvNum,'1241234')
26
+    }).then(data => {
27
+      console.log(data.data_count.registeredCount / data.data_count.pvNum, '1241234')
28
       setDataset(data, params.conversion)
28
       setDataset(data, params.conversion)
29
     })
29
     })
30
   }
30
   }
31
 
31
 
32
-  function setDataset (data, theStatis) {
32
+  function setDataset(data, theStatis) {
33
     const { pvNum, ...other } = data.data_count
33
     const { pvNum, ...other } = data.data_count
34
 
34
 
35
     // 获取第一个值
35
     // 获取第一个值
43
       setTheCurrent([])
43
       setTheCurrent([])
44
     } else {
44
     } else {
45
 
45
 
46
-      setConversionRate(num/pvNum)
46
+      setConversionRate(num / pvNum)
47
       setTheCurrent([
47
       setTheCurrent([
48
         { name: getStatisName(theStatis), value: num },
48
         { name: getStatisName(theStatis), value: num },
49
         { name: '其余', value: pvNum - num },
49
         { name: '其余', value: pvNum - num },
51
     }
51
     }
52
   }
52
   }
53
 
53
 
54
-  function getStatisName (theStatis) {
54
+  function getStatisName(theStatis) {
55
     const statisTypes = [
55
     const statisTypes = [
56
       { label: '授权手机', value: 'authorization_phone' },
56
       { label: '授权手机', value: 'authorization_phone' },
57
       { label: '项目收藏', value: 'building_save' },
57
       { label: '项目收藏', value: 'building_save' },
75
       name: '转化率',
75
       name: '转化率',
76
       radius: ['34%', '52%'],
76
       radius: ['34%', '52%'],
77
       avoidLabelOverlap: false,
77
       avoidLabelOverlap: false,
78
-      label: { 
79
-        normal: { 
80
-          show: true,
78
+      label: {
79
+        normal: {
80
+          show: false,
81
           position: 'center',
81
           position: 'center',
82
           color: '#666666',
82
           color: '#666666',
83
-          fontSize: 24,
84
-          fontWeight: 'bold',
85
-          formatter: `${(conversionRate*100).toFixed(2) === 'NaN' ? 0 : (conversionRate*100).toFixed(2) }%`, // {b}:数据名; {c}:数据值; {d}:百分比,可以自定义显示内容,
83
+          fontSize: 22,
84
+          formatter: '{d}%'
85
+        },
86
+        emphasis: {
87
+          show: true,
88
+          formatter: '{d}%',
89
+          textStyle: {
90
+            fontSize: '22',
91
+            fontWeight: 'bold'
92
+          }
86
         }
93
         }
87
       },
94
       },
88
       labelLine: {
95
       labelLine: {
95
     },
102
     },
96
   }
103
   }
97
 
104
 
98
-  function onChange (e) {
105
+  function onChange(e) {
99
     UserConversionRate({ conversion: e })
106
     UserConversionRate({ conversion: e })
100
   }
107
   }
101
   const piestyles = {
108
   const piestyles = {

+ 18
- 0
src/pages/indexEcharts/components/UserSourcepie.jsx View File

56
         type: 'pie',
56
         type: 'pie',
57
         center: ['40%', '65%'],
57
         center: ['40%', '65%'],
58
         radius: ['34%', '52%'],
58
         radius: ['34%', '52%'],
59
+        label: {
60
+          normal: {
61
+            show: false,
62
+            position: 'center',
63
+            color: '#666666',
64
+            fontSize: 22,
65
+            formatter: '{d}%'
66
+          },
67
+          emphasis: {
68
+            show: true,
69
+            formatter: '{d}%',
70
+            textStyle: {
71
+              fontSize: '22',
72
+              fontWeight: 'bold'
73
+            }
74
+          }
75
+        },
59
       },
76
       },
77
+
60
     ],
78
     ],
61
 
79
 
62
     dataset: {
80
     dataset: {

+ 7
- 7
src/pages/news/list/NewsList.jsx View File

195
             whiteSpace: 'nowrap',
195
             whiteSpace: 'nowrap',
196
             width: '300px',
196
             width: '300px',
197
           }}>{data.newsName}</p>
197
           }}>{data.newsName}</p>
198
-          <p style={{ fontSize: ' 0.11rem', color: '#555', marginBottom: '10px' }}>
199
-            <span style={{ display: 'inline-block', width: '190px' }}>咨询类型:{data.newsType.newsTypeName}</span>
198
+          <p style={{ fontSize: ' 0.11rem', color: '#555', marginBottom: '8px',display:'flex' }}>
199
+            <span style={{ display: 'inline-block', width: '180px',overflow: 'hidden',textOverflow: 'ellipsis',whiteSpace: 'nowrap' }}>资讯类型:{data.newsType.newsTypeName}</span>
200
             <span>状态:{data.newsStatus == 0 ? "已发布" : "未发布"}</span>
200
             <span>状态:{data.newsStatus == 0 ? "已发布" : "未发布"}</span>
201
           </p>
201
           </p>
202
 
202
 
203
-          <p style={{ fontSize: ' 0.11rem', color: '#555', marginBottom: '10px' }}>
204
-            <span style={{ display: 'inline-block', width: '190px' }}>阅读数量:{data.pvNum}</span>
203
+          <p style={{ fontSize: ' 0.11rem', color: '#555', marginBottom: '8px' }}>
204
+            <span style={{ display: 'inline-block', width: '180px',overflow: 'hidden',textOverflow: 'ellipsis',whiteSpace: 'nowrap' }}>阅读数量:{data.pvNum}</span>
205
             <span>转发数量:{data.shareNum}</span>
205
             <span>转发数量:{data.shareNum}</span>
206
           </p>
206
           </p>
207
 
207
 
208
-          <p style={{ fontSize: ' 0.11rem', color: '#555', marginBottom: '10px' }}>
209
-            <span style={{ display: 'inline-block', width: '190px' }}>点赞数量:{data.favorNum}</span>
208
+          <p style={{ fontSize: ' 0.11rem', color: '#555', marginBottom: '8px' }}>
209
+            <span style={{ display: 'inline-block', width: '180px',overflow: 'hidden',textOverflow: 'ellipsis',whiteSpace: 'nowrap' }}>点赞数量:{data.favorNum}</span>
210
             <span>收藏数量:{data.saveNum}</span>
210
             <span>收藏数量:{data.saveNum}</span>
211
           </p>
211
           </p>
212
 
212
 
213
-          <p style={{ fontSize: ' 0.11rem', color: '#999', marginBottom: '10px' }}>发布时间:{data.createDate}</p>
213
+          <p style={{ fontSize: ' 0.11rem', color: '#999', marginBottom: '8px' }}>发布时间:{data.createDate}</p>
214
         </div>
214
         </div>
215
       </Card>
215
       </Card>
216
     )
216
     )

+ 1
- 1
src/pages/news/type/editNews.jsx View File

55
       type: FieldTypes.Text,
55
       type: FieldTypes.Text,
56
       value: newsData.newsTypeName,
56
       value: newsData.newsTypeName,
57
       rules: [
57
       rules: [
58
-        {required: true, message: '请输入咨询名称'},
58
+        {required: true, message: '请输入资讯名称'},
59
       ]
59
       ]
60
     },
60
     },
61
   ]
61
   ]