许静 5 년 전
부모
커밋
bc0dcd53a4
3개의 변경된 파일35개의 추가작업 그리고 18개의 파일을 삭제
  1. 4
    1
      src/pages/indexEcharts/components/UserSex.jsx
  2. 20
    17
      src/pages/indexEcharts/components/UserSourcepie.jsx
  3. 11
    0
      src/pages/indexEcharts/userSource.jsx

+ 4
- 1
src/pages/indexEcharts/components/UserSex.jsx 파일 보기

42
     },
42
     },
43
     legend: {},
43
     legend: {},
44
     color: ['#FF7E48', '#dcdcdc'],
44
     color: ['#FF7E48', '#dcdcdc'],
45
-    tooltip: {},
45
+    tooltip: {
46
+      trigger: 'item',
47
+      formatter: "{b}: ({d}%)"
48
+    },
46
     series: {
49
     series: {
47
       type: 'pie',
50
       type: 'pie',
48
       name: '性别比例',
51
       name: '性别比例',

+ 20
- 17
src/pages/indexEcharts/components/UserSourcepie.jsx 파일 보기

19
 
19
 
20
   useEffect(() => {
20
   useEffect(() => {
21
     userResource(formatDate(props.startDate, props.endDate))
21
     userResource(formatDate(props.startDate, props.endDate))
22
-   }, [props.startDate, props.endDate])
23
- 
24
-   function userResource (params) {
25
-     request({
26
-       ...apis.indexEcharts.userResource,
27
-       params,
28
-     }).then((data) => {
29
-       setData(data)
30
-     })
31
-   }
32
-
33
-  function toEdit () {
22
+  }, [props.startDate, props.endDate])
23
+
24
+  function userResource(params) {
25
+    request({
26
+      ...apis.indexEcharts.userResource,
27
+      params,
28
+    }).then((data) => {
29
+      setData(data)
30
+    })
31
+  }
32
+
33
+  function toEdit() {
34
     router.push({
34
     router.push({
35
       pathname: '/indexEcharts/userSource',
35
       pathname: '/indexEcharts/userSource',
36
     });
36
     });
47
       x: 'left',
47
       x: 'left',
48
       data: ['来源置业顾问', '来源全民经纪人', '自主进入'],
48
       data: ['来源置业顾问', '来源全民经纪人', '自主进入'],
49
     },
49
     },
50
-    tooltip: {},
50
+    tooltip: {
51
+      // trigger: 'item',
52
+      // formatter: "{a} <br/>{b} : {c} ({d}%)"
53
+    },
51
     series: [
54
     series: [
52
       {
55
       {
53
         type: 'pie',
56
         type: 'pie',
55
         radius: ['34%', '52%'],
58
         radius: ['34%', '52%'],
56
       },
59
       },
57
     ],
60
     ],
61
+
58
     dataset: {
62
     dataset: {
59
       id: 'pie',
63
       id: 'pie',
60
       source: [
64
       source: [
61
-        { '用户来源': '来源置业顾问', value: person_realty_consultant,},
65
+        { '用户来源': '来源置业顾问', value: person_realty_consultant, },
62
         { '用户来源': '来源全民经纪人', value: person_estate_agent },
66
         { '用户来源': '来源全民经纪人', value: person_estate_agent },
63
         { '用户来源': '自主进入', value: person_null },
67
         { '用户来源': '自主进入', value: person_null },
64
       ]
68
       ]
65
     },
69
     },
66
   }
70
   }
67
- 
71
+
68
 
72
 
69
   const piestyles = {
73
   const piestyles = {
70
     width: '100%',
74
     width: '100%',
71
     height: '400px',
75
     height: '400px',
72
-    minWidth:'350px',
76
+    minWidth: '350px',
73
   }
77
   }
74
 
78
 
75
-
76
   return (
79
   return (
77
     <>
80
     <>
78
       <div>
81
       <div>

+ 11
- 0
src/pages/indexEcharts/userSource.jsx 파일 보기

17
 
17
 
18
 
18
 
19
 const header = props => {
19
 const header = props => {
20
+  
21
+  function userResource(params) {
22
+    request({
23
+      ...apis.indexEcharts.userResource,
24
+      params,
25
+    }).then((data) => {
26
+      setData(data)
27
+      console.log(data,"datadatadatadatavvvdatadatav")
28
+      props.onSuccess(data)
29
+    })
30
+  }
20
 
31
 
21
   const [tableData, setTableData] = useState([])
32
   const [tableData, setTableData] = useState([])
22
   const [userType, setuserType] = useState([])
33
   const [userType, setuserType] = useState([])