[baozhangchao] 3 gadus atpakaļ
vecāks
revīzija
2b66db0f1d

+ 1
- 0
src/components/ScreenBox/TitleBox/style.less Parādīt failu

@@ -4,6 +4,7 @@
4 4
   align-items: center;
5 5
   padding: 11px 11px 9px 11px;
6 6
   border-radius: 4px;
7
+
7 8
   box-shadow: 0px 0px 10px 0px #3d81f0 inset;
8 9
 
9 10
   .TitleBox-ListBox {

+ 0
- 45
src/pages/MonitoringScreen/DateCommponets.jsx Parādīt failu

@@ -1,45 +0,0 @@
1
-
2
-
3
-
4
-import SquareBox from '@/components/ScreenBox/SquareBox'
5
-import TitleBox from '@/components/ScreenBox/TitleBox'
6
-import { Bar } from '@ant-design/plots';
7
-// import ba from './a.png'
8
-
9
-export default (props) => {
10
-
11
-  const data = [
12
-    {
13
-      year: '收割机',
14
-      value: 200,
15
-    },
16
-    {
17
-      year: '播种机',
18
-      value: 150,
19
-    },
20
-    {
21
-      year: '农药机',
22
-      value: 50,
23
-    },
24
-  ];
25
-  const config = {
26
-    data,
27
-    xField: 'value',
28
-    yField: 'year',
29
-    seriesField: 'year',
30
-
31
-    legend: {
32
-      position: 'top-left',
33
-    },
34
-    color: [' #FB9900', '#23E8AE', '#E63404'],
35
-  };
36
-
37
-  return (
38
-    <div  >
39
-      <TitleBox value='农机类型统计' />
40
-      <SquareBox>
41
-        <Bar  {...config} />
42
-      </SquareBox>
43
-    </div>
44
-  )
45
-}

+ 121
- 0
src/pages/MonitoringScreen/DateCommponetsBottomLeft.jsx Parādīt failu

@@ -0,0 +1,121 @@
1
+
2
+
3
+
4
+import SquareBox from '@/components/ScreenBox/SquareBox'
5
+import TitleBox from '@/components/ScreenBox/TitleBox'
6
+import { Column } from '@ant-design/plots';
7
+// import ba from './a.png'
8
+
9
+export default (props) => {
10
+
11
+
12
+  const style = {
13
+    bgd: {
14
+      width: '25vw',
15
+      display: 'inline-block',
16
+    }
17
+  }
18
+  const data = [
19
+    {
20
+      name: '预约',
21
+      NongType: '预约.',
22
+      sum: 18,
23
+    },
24
+    {
25
+      name: '作业',
26
+      NongType: '作业.',
27
+      sum: 28,
28
+    },
29
+    {
30
+      name: '闲置',
31
+      NongType: '闲置.',
32
+      sum: 100,
33
+    },
34
+    {
35
+      name: '离线',
36
+      NongType: '离线',
37
+      sum: 181,
38
+    },
39
+    {
40
+      name: '维修',
41
+      NongType: '维修',
42
+      sum: 147,
43
+    },
44
+
45
+  ];
46
+  const config = {
47
+    data,
48
+    isGroup: true,
49
+    xField: 'NongType',
50
+    yField: 'sum',
51
+    seriesField: 'name',
52
+    color: ['#F5CC5C', '#44F68B', '#51D4FF', '#B8B2A9', '#F55226'],
53
+    minColumnWidth: 26,
54
+    columnStyle: {
55
+      // fill: 'l(270) 0:rgba(225,225,225,0.0) 1:#FB9900',
56
+    },
57
+    color: ({ name }) => {
58
+      if (name == '预约') {
59
+
60
+        return `l(270) 0:rgba(225,225,225,0.0) 1:#F5CC5C`;
61
+
62
+
63
+      }
64
+      if (name == '作业') {
65
+
66
+        return `l(270) 0:rgba(225,225,225,0.0) 1:#44F68B`;
67
+
68
+
69
+      }
70
+      if (name == '闲置') {
71
+
72
+        return `l(270) 0:rgba(225,225,225,0.0) 1:#51D4FF`;
73
+
74
+
75
+      }
76
+      if (name == '离线') {
77
+
78
+        return `l(270) 0:rgba(225,225,225,0.0) 1:#B8B2A9`;
79
+
80
+
81
+      }
82
+      if (name == '维修') {
83
+
84
+        return `l(270) 0:rgba(225,225,225,0.0) 1:#F55226`;
85
+
86
+
87
+      }
88
+    },
89
+    /** 设置间距 */
90
+    // marginRatio: 0.1,
91
+    label: {
92
+      // 'top', 'middle', 'bottom'
93
+      // 可配置附加的布局方法
94
+      layout: [
95
+        // 柱形图数据标签位置自动调整
96
+        {
97
+          // type: 'interval-adjust-position',
98
+        }, // 数据标签防遮挡
99
+        {
100
+          // type: 'interval-hide-overlap',
101
+        }, // 数据标签文颜色自动调整
102
+        {
103
+          // type: 'adjust-color',
104
+        },
105
+      ],
106
+    },
107
+  };
108
+
109
+  return (
110
+    <div style={{ width: '100vw' }}>
111
+      <div style={style.bgd} >
112
+        <TitleBox value='农机状态统计' />
113
+        <SquareBox>
114
+          <Column  {...config} />
115
+        </SquareBox>
116
+      </div>
117
+
118
+    </div>
119
+
120
+  )
121
+}

+ 85
- 0
src/pages/MonitoringScreen/DateCommponetsBottomRight.jsx Parādīt failu

@@ -0,0 +1,85 @@
1
+
2
+
3
+
4
+import SquareBox from '@/components/ScreenBox/SquareBox'
5
+import TitleBox from '@/components/ScreenBox/TitleBox'
6
+import { Pie, G2 } from '@ant-design/plots';
7
+// import ba from './a.png'
8
+
9
+export default (props) => {
10
+
11
+  const G = G2.getEngine('canvas');
12
+  const style = {
13
+    bgd: {
14
+      width: '30vw',
15
+      display: 'inline-block',
16
+    }
17
+  }
18
+  const data = [
19
+    {
20
+      type: '收割机',
21
+      value: 27,
22
+    },
23
+    {
24
+      type: '播种机',
25
+      value: 25,
26
+    },
27
+    {
28
+      type: '农药机',
29
+      value: 18,
30
+    },
31
+    {
32
+      type: '其他',
33
+      value: 70,
34
+    }
35
+  ];
36
+  const config = {
37
+    color: ['#FB9900', '#355C9C', '#23E8AE', '#E63404'],
38
+    pieStyle: {
39
+      strokeOpacity: 0,
40
+      lineWidth: 0,
41
+    },
42
+    statistic: {
43
+      title: false,
44
+      content: {
45
+        style: {
46
+          whiteSpace: 'pre-wrap',
47
+          overflow: 'hidden',
48
+          textOverflow: 'ellipsis',
49
+        },
50
+        content: ' ',
51
+      },
52
+    },
53
+    appendPadding: 10,
54
+    data,
55
+    angleField: 'value',
56
+    colorField: 'type',
57
+    innerRadius: 0.8,
58
+    radius: 0.75,
59
+    label: {
60
+      type: 'spider',
61
+      labelHeight: 28,
62
+      content: '{name}\n{percentage}',
63
+    },
64
+    interactions: [
65
+      {
66
+        type: 'element-selected',
67
+      },
68
+      {
69
+        type: 'element-active',
70
+      },
71
+    ],
72
+  };
73
+  return (
74
+    <div style={{ width: '100vw' }}>
75
+      <div style={style.bgd} >
76
+        <TitleBox value='农机类型统计' />
77
+        <SquareBox>
78
+          <Pie  {...config} />
79
+        </SquareBox>
80
+      </div>
81
+
82
+    </div>
83
+
84
+  )
85
+}

+ 92
- 0
src/pages/MonitoringScreen/DateCommponetsLeft.jsx Parādīt failu

@@ -0,0 +1,92 @@
1
+
2
+
3
+
4
+import SquareBox from '@/components/ScreenBox/SquareBox'
5
+import TitleBox from '@/components/ScreenBox/TitleBox'
6
+import { Bar } from '@ant-design/plots';
7
+
8
+export default (props) => {
9
+
10
+
11
+  const style = {
12
+    bgd: {
13
+      width: '25vw',
14
+      display: 'inline-block',
15
+    }
16
+  }
17
+  const data = [
18
+    {
19
+      year: '收割机',
20
+      value: 200,
21
+    },
22
+    {
23
+      year: '播种机',
24
+      value: 150,
25
+    },
26
+    {
27
+      year: '农药机',
28
+      value: 50,
29
+    },
30
+  ];
31
+
32
+  const config = {
33
+    maxBarWidth: 20,
34
+    data,
35
+    xField: 'value',
36
+    yField: 'year',
37
+    seriesField: 'year',
38
+
39
+    // color: [' #FB9900', '#23E8AE', '#E63404'],
40
+    color: ({ type, year }) => {
41
+      if (year == '收割机') {
42
+
43
+        return `l(0) 0:rgba(225,225,225,0.0) 1:#FB9900`;
44
+
45
+
46
+      }
47
+      if (year == '播种机') {
48
+
49
+        return `l(0) 0:rgba(225,225,225,0.0) 1:#23E8AE`;
50
+
51
+
52
+      }
53
+      if (year == '农药机') {
54
+
55
+        return `l(0) 0:rgba(225,225,225,0.0) 1:#E63404`;
56
+
57
+
58
+      }
59
+    },
60
+    barStyle: {
61
+      // fill: `l(0) 0:rgba(225,225,225,0.0) 1:#FB9900`,
62
+    },
63
+    legend: {
64
+      position: 'top-left',
65
+
66
+    },
67
+    statistic: {
68
+      style: {
69
+        // fill: '#FB9900',
70
+        // fill: '#23E8AE',
71
+        // fill: '#E63404',
72
+        fontSize: 10,
73
+        fontWeight: 60,
74
+        textAlign: 'center',
75
+        textBaseline: 'middle',
76
+      }
77
+    }
78
+  };
79
+
80
+  return (
81
+    <div style={{ width: '100vw' }}>
82
+      <div style={style.bgd} >
83
+        <TitleBox value='农机类型统计' />
84
+        <SquareBox>
85
+          <Bar  {...config} />
86
+        </SquareBox>
87
+      </div>
88
+
89
+    </div>
90
+
91
+  )
92
+}

+ 8
- 4
src/pages/MonitoringScreen/index.jsx Parādīt failu

@@ -6,7 +6,9 @@ import { PageHeaderWrapper } from '@ant-design/pro-layout';
6 6
 import { FullscreenOutlined } from '@ant-design/icons';
7 7
 import { Button } from 'antd';
8 8
 import { useFullScreen } from './hook';
9
-import DateCommponets from './DateCommponets';
9
+import DateCommponetsLeft from './DateCommponetsLeft';
10
+import DateCommponetsBottomRight from './DateCommponetsBottomRight';
11
+import DateCommponetsBottomLeft from './DateCommponetsBottomLeft';
10 12
 import Styles from './style.less';
11 13
 import SquareBox from '@/components/ScreenBox/SquareBox';
12 14
 
@@ -29,13 +31,15 @@ export default (props) => {
29 31
       >
30 32
         <div className={Styles['grail-layout']}>
31 33
           <div className={Styles['grail-header']}>
32
-            <SquareBox>asdfasdf</SquareBox>
34
+            {/* <SquareBox>asdfasdf</SquareBox> */}
33 35
           </div>
34 36
           <div className={Styles['grail-container']}>
35 37
             <div className={Styles['grail-left']}></div>
36
-            <div className={Styles['grail-content']}>
38
+            <div className={Styles['grail-content']} >
37 39
 
38
-              <DateCommponets />
40
+              <DateCommponetsLeft />
41
+              <DateCommponetsBottomRight />
42
+              <DateCommponetsBottomLeft />
39 43
             </div>
40 44
             <div className={Styles['grail-right']}></div>
41 45
           </div>