Yansen 2 년 전
부모
커밋
a408c8166d
4개의 변경된 파일16개의 추가작업 그리고 253개의 파일을 삭제
  1. 4
    37
      src/components/Bar/index.jsx
  2. 6
    52
      src/components/BarPerson/index.jsx
  3. 5
    5
      src/components/WelcomeCard/style.less
  4. 1
    159
      src/pages/Welcome.jsx

+ 4
- 37
src/components/Bar/index.jsx 파일 보기

@@ -54,7 +54,6 @@ export default (props) => {
54 54
         type: 'category',
55 55
         data: dataX,
56 56
         axisLabel: { interval: 0, rotate: 40 },
57
-        name: '合作社',
58 57
         nameTextStyle: {
59 58
           padding: [0, 20],
60 59
         },
@@ -62,49 +61,22 @@ export default (props) => {
62 61
       yAxis: [
63 62
         {
64 63
           type: 'value',
65
-          name: '',
64
+          name: '设备数量',
66 65
           position: 'left',
67 66
           alignTicks: true,
68 67
           axisLine: {
69 68
             show: true,
70
-            lineStyle: {
71
-              color: colors[0],
72
-            },
73
-          },
74
-          axisLabel: {
75
-            formatter: '{value} 台',
76 69
           },
77 70
         },
78 71
         {
79 72
           type: 'value',
80
-          name: '亩',
73
+          name: '作业面积(亩)',
81 74
           position: 'right',
82 75
           alignTicks: true,
83 76
           axisLine: {
84 77
             show: true,
85
-            lineStyle: {
86
-              color: colors[1],
87
-            },
88
-          },
89
-          axisLabel: {
90
-            formatter: '{value} 亩',
91 78
           },
92 79
         },
93
-        // {
94
-        //   type: 'value',
95
-        //   name: '流量',
96
-        //   position: 'right',
97
-        //   alignTicks: true,
98
-        //   axisLine: {
99
-        //     show: true,
100
-        //     lineStyle: {
101
-        //       color: colors[2],
102
-        //     },
103
-        //   },
104
-        // axisLabel: {
105
-        //   formatter: '{value} ',
106
-        // },
107
-        // },
108 80
       ],
109 81
       dataZoom: {
110 82
         show: true,
@@ -116,21 +88,16 @@ export default (props) => {
116 88
       },
117 89
       series: [
118 90
         {
119
-          name: '设备',
91
+          name: '设备数量',
120 92
           data: dataLs,
121 93
           type: 'line',
122 94
         },
123 95
         {
124
-          name: '作业',
96
+          name: '作业面积',
125 97
           data: dataVal,
126 98
           type: 'bar',
127 99
           yAxisIndex: 1,
128 100
         },
129
-        // {
130
-        //   data: dataVal,
131
-        //   type: 'bar',
132
-        //   yAxisIndex: 2,
133
-        // },
134 101
       ],
135 102
     }),
136 103
     [dataLs, dataVal, dataX],

+ 6
- 52
src/components/BarPerson/index.jsx 파일 보기

@@ -13,6 +13,7 @@ const labelOption = {
13 13
   },
14 14
 };
15 15
 
16
+const colors = ['#E94F05', '#5470C6', '#91CC75'];
16 17
 export default (props) => {
17 18
   const { opt, optP, title, h } = props;
18 19
   const dataL = [];
@@ -33,12 +34,10 @@ export default (props) => {
33 34
   // 亩
34 35
   const dataX = opt.map((it) => it.name);
35 36
   const dataVal = opt.map((it) => it.value);
36
-  // 人
37
-  const colors = ['#E94F05', '#5470C6', '#91CC75'];
38 37
 
39 38
   const option = useMemo(
40 39
     () => ({
41
-      color: colors,
40
+      colors,
42 41
       title: {
43 42
         text: title,
44 43
         left: 'center',
@@ -54,7 +53,6 @@ export default (props) => {
54 53
         type: 'category',
55 54
         data: dataX,
56 55
         axisLabel: { interval: 0, rotate: 40 },
57
-        name: '合作社',
58 56
         nameTextStyle: {
59 57
           padding: [0, 20],
60 58
         },
@@ -62,84 +60,40 @@ export default (props) => {
62 60
       yAxis: [
63 61
         {
64 62
           type: 'value',
65
-          name: '',
63
+          name: '设备数量(台)',
66 64
           position: 'left',
67 65
           alignTicks: true,
68 66
           axisLine: {
69 67
             show: true,
70
-            lineStyle: {
71
-              color: colors[0],
72
-            },
73
-          },
74
-          axisLabel: {
75
-            formatter: '{value} 人',
76 68
           },
77 69
         },
78 70
         {
79 71
           type: 'value',
80
-          name: '亩',
72
+          name: '作业面积(亩)',
81 73
           position: 'right',
82 74
           alignTicks: true,
83 75
           axisLine: {
84 76
             show: true,
85
-            lineStyle: {
86
-              color: colors[1],
87
-            },
88
-          },
89
-          axisLabel: {
90
-            formatter: '{value} 亩',
91 77
           },
92 78
         },
93
-        // {
94
-        //   type: 'value',
95
-        //   name: '流量',
96
-        //   position: 'right',
97
-        //   alignTicks: true,
98
-        //   axisLine: {
99
-        //     show: true,
100
-        //     lineStyle: {
101
-        //       color: colors[2],
102
-        //     },
103
-        //   },
104
-        // axisLabel: {
105
-        //   formatter: '{value} ',
106
-        // },
107
-        // },
108 79
       ],
109 80
       dataZoom: {
110 81
         show: true,
111 82
         start: 0,
112 83
         end: 100,
113 84
       },
114
-      grid: {
115
-        height: '55%',
116
-      },
117 85
       series: [
118 86
         {
119
-          name: '',
87
+          name: '设备数量',
120 88
           data: dataPerson,
121 89
           type: 'line',
122
-          showBackground: true,
123 90
         },
124 91
         {
125
-          name: '作业',
92
+          name: '作业面积',
126 93
           data: dataVal,
127 94
           type: 'bar',
128 95
           yAxisIndex: 1,
129
-          showBackground: true,
130
-          backgroundStyle: {
131
-            color: '#FFFF',
132
-          },
133 96
         },
134
-        // {
135
-        //   data: dataVal,
136
-        //   type: 'bar',
137
-        //   yAxisIndex: 2,
138
-        //   showBackground: true,
139
-        //   backgroundStyle: {
140
-        //     color: '#EE6666',
141
-        //   },
142
-        // },
143 97
       ],
144 98
     }),
145 99
     [dataPerson, dataVal, dataX],

+ 5
- 5
src/components/WelcomeCard/style.less 파일 보기

@@ -1,18 +1,18 @@
1 1
 .wcard {
2 2
   display: flex;
3 3
   align-items: center;
4
+  justify-content: space-between;
5
+  width: 320px;
4 6
   padding: 16px 32px;
5 7
   background: #fff;
6
-  width: 320px;
7 8
 
8 9
   .wImg {
9 10
     width: 65px;
10 11
     height: 65px;
11
-    margin-right: 64px;
12 12
 
13 13
     svg {
14 14
       width: 100%;
15
-      height: 100%
15
+      height: 100%;
16 16
     }
17 17
   }
18 18
 
@@ -22,9 +22,9 @@
22 22
     // .title {}
23 23
 
24 24
     .value {
25
+      margin: 16px 0;
25 26
       color: rgb(26, 182, 202);
26 27
       font-size: 25px;
27
-      margin: 16px 0;
28 28
     }
29 29
 
30 30
     .percentage {
@@ -36,4 +36,4 @@
36 36
       }
37 37
     }
38 38
   }
39
-}
39
+}

+ 1
- 159
src/pages/Welcome.jsx 파일 보기

@@ -23,111 +23,13 @@ import './Welcome.less';
23 23
 
24 24
 const Welcome = () => {
25 25
   const intl = useIntl();
26
-  const [topData, setTopData] = useState([
27
-    // {
28
-    //   icon: 'icon-show_gongsiguanli_fill',
29
-    //   color: '#8dc63f',
30
-    //   title: '合作社',
31
-    //   value: 2017 + '个',
32
-    //   // percentage: 5.6,
33
-    // },
34
-    // {
35
-    //   icon: 'icon-icon',
36
-    //   color: '#1cbbb4',
37
-    //   title: '人员',
38
-    //   value: 580239 + '个',
39
-    //   // percentage: 32.6,
40
-    // },
41
-    // {
42
-    //   icon: 'icon-tuolaji',
43
-    //   color: '#a5673f',
44
-    //   title: '设备',
45
-    //   value: 2000 + '台',
46
-    //   // percentage: 42.6,
47
-    // },
48
-    // {
49
-    //   icon: 'icon-dingdanguanli',
50
-    //   color: '#8799a3',
51
-    //   title: '作业',
52
-    //   value: 2075994 + '亩',
53
-    //   // percentage: -1.6,
54
-    // },
55
-  ]);
26
+  const [topData, setTopData] = useState([]);
56 27
 
57 28
   const [categoryData, setCategoryData] = useState([]);
58 29
   const [lineData, setLineData] = useState([]);
59 30
   const [personData, setPersonData] = useState([]);
60 31
   const [persondData, setPersDonData] = useState([]);
61
-  const centerData = [
62
-    {
63
-      title: '预约订单',
64
-      color: '#70d4d4',
65
-      keyList: [
66
-        '一月',
67
-        '二月',
68
-        '三月',
69
-        '四月',
70
-        '五月',
71
-        '六月',
72
-        '七月',
73
-        '八月',
74
-        '九月',
75
-        '十月',
76
-        '十一月',
77
-        '十二月',
78
-      ],
79
-      valueList: [320, 332, 301, 334, 390, 88, 320, 332, 301, 334, 390, 88],
80
-    },
81
-    {
82
-      title: '完成订单',
83
-      color: '#c3b6e6',
84
-      keyList: [
85
-        '一月',
86
-        '二月',
87
-        '三月',
88
-        '四月',
89
-        '五月',
90
-        '六月',
91
-        '七月',
92
-        '八月',
93
-        '九月',
94
-        '十月',
95
-        '十一月',
96
-        '十二月',
97
-      ],
98
-      valueList: [220, 182, 191, 234, 290, 256, 220, 182, 191, 234, 290, 356],
99
-    },
100
-  ];
101 32
 
102
-  const [machineryStatus, setMachineryStatus] = useState([
103
-    {
104
-      color: '#70d4d4',
105
-      keyList: ['预约', '作业', '闲置', '离线', '维修'],
106
-      valueList: [350, 900, 650, 180, 380],
107
-    },
108
-  ]);
109
-
110
-  const [workData, setWorkData] = useState([
111
-    { name: '收割机', value: 35 },
112
-    { name: '播种机', value: 35 },
113
-    { name: '农药机', value: 30 },
114
-    { name: '其他', value: 180 },
115
-  ]);
116
-  const [workAreaData, setWorkAreaData] = useState([
117
-    { name: '收割机', value: 350 },
118
-    { name: '播种机', value: 900 },
119
-    { name: '农药机', value: 650 },
120
-    { name: '其他', value: 180 },
121
-  ]);
122
-  const [dispatchList, setDispatchList] = useState([]);
123
-  const goDispatch = (val) => {
124
-    history.push(`../OrderManage/dispatch.jsx?id=${val.orderId}`);
125
-  };
126
-  useEffect(() => {
127
-    getDispatchList({ isWarn: true, pageSize: 500 }).then((res) => {
128
-      setDispatchList(res.records);
129
-    });
130
-  }, []);
131 33
   // 卡片展示
132 34
   useEffect(() => {
133 35
     getSummary2().then((res) => {
@@ -233,66 +135,6 @@ const Welcome = () => {
233 135
             </Card>
234 136
           </Col>
235 137
         </Row>
236
-        {/* <Row justify="space-between">
237
-          <Col span={16}>
238
-            <Card style={{ marginTop: '32px' }}>
239
-              <Bar h="500px" title="本年度预约订单数据概览" opt={centerData} />
240
-            </Card>
241
-          </Col>
242
-          <Col span={7}>
243
-            <Card title="待调度订单" style={{ marginTop: '32px', height: '548px' }}>
244
-              {dispatchList.length <= 8 ? (
245
-                <div style={{ height: '448px', width: '100%' }}>
246
-                  {dispatchList.map((item) => (
247
-                    <div
248
-                      style={{ height: '60px' }}
249
-                      key={item.orderId}
250
-                      onClick={() => goDispatch(item)}
251
-                    >
252
-                      {(item.personName || item.phone) +
253
-                        ' 于 ' +
254
-                        item.createDate +
255
-                        ' 下了一单请您尽快处理!'}
256
-                    </div>
257
-                  ))}
258
-                </div>
259
-              ) : (
260
-                <Swiper
261
-                  height={60}
262
-                  style={{ height: '448px' }}
263
-                  autoplay={{
264
-                    delay: 1500,
265
-                    disableOnInteraction: false,
266
-                  }}
267
-                  loop
268
-                  loopAdditionalSlides={8}
269
-                  modules={[Autoplay]}
270
-                  direction="vertical"
271
-                >
272
-                  {dispatchList.map((item) => (
273
-                    <SwiperSlide key={item.orderId} onClick={() => goDispatch(item)}>
274
-                      {(item.personName || item.phone) +
275
-                        ' 于 ' +
276
-                        item.createDate +
277
-                        ' 下了一单请您尽快处理!'}
278
-                    </SwiperSlide>
279
-                  ))}
280
-                </Swiper>
281
-              )}
282
-            </Card>
283
-          </Col>
284
-        </Row> */}
285
-        {/* <div className="flex bottom">
286
-          <Card className="flex-1 card">
287
-            <Bar h="300px" title="农机状态统计" opt={machineryStatus} />
288
-          </Card>
289
-          <Card className="flex-1 card">
290
-            <PieArea opt={workAreaData} />
291
-          </Card>
292
-          <Card className="flex-1 card">
293
-            <Pie opt={workData} />
294
-          </Card>
295
-        </div> */}
296 138
       </div>
297 139
     </PageContainer>
298 140
   );