Yansen 2 anni fa
parent
commit
c2d8fd6a39

+ 21
- 4
src/pages/Machinery/JobList/index.jsx Vedi File

26
       key: 'deviceNo',
26
       key: 'deviceNo',
27
       width: 340,
27
       width: 340,
28
     },
28
     },
29
+    {
30
+      title: '绑定农机',
31
+      dataIndex: 'machineryName',
32
+      key: 'machineryName',
33
+      search: false,
34
+    },
29
     {
35
     {
30
       title: '作业面积(亩)',
36
       title: '作业面积(亩)',
31
       dataIndex: 'jobArea',
37
       dataIndex: 'jobArea',
32
       key: 'jobArea',
38
       key: 'jobArea',
33
       search: false,
39
       search: false,
34
     },
40
     },
41
+    {
42
+      title: '耕深(厘米)',
43
+      dataIndex: 'depth',
44
+      key: 'depth',
45
+      render: (t) => t || '-',
46
+    },
47
+    {
48
+      title: '平均喷量(升/亩)',
49
+      dataIndex: 'traffic',
50
+      key: 'traffic',
51
+      render: (t) => t || '-',
52
+    },
35
     {
53
     {
36
       title: '作业时间',
54
       title: '作业时间',
37
       dataIndex: 'jobDate',
55
       dataIndex: 'jobDate',
39
       search: false,
57
       search: false,
40
     },
58
     },
41
     {
59
     {
42
-      title: '绑定农机',
43
-      dataIndex: 'machineryName',
44
-      key: 'machineryName',
45
-      search: false,
60
+      title: '作业地点',
61
+      dataIndex: 'address',
62
+      key: 'address',
46
     },
63
     },
47
   ];
64
   ];
48
 
65
 

+ 42
- 21
src/pages/Machinery/Machinery/index.jsx Vedi File

4
 import { PlusOutlined } from '@ant-design/icons';
4
 import { PlusOutlined } from '@ant-design/icons';
5
 import { PageHeaderWrapper } from '@ant-design/pro-layout';
5
 import { PageHeaderWrapper } from '@ant-design/pro-layout';
6
 import PageTable from '@/components/PageTable';
6
 import PageTable from '@/components/PageTable';
7
-import { getMachineryList, deleteMachinery, updateMachinery, updateRepair } from '@/services/machinery';
7
+import {
8
+  getMachineryList,
9
+  deleteMachinery,
10
+  updateMachinery,
11
+  updateRepair,
12
+} from '@/services/machinery';
8
 import { getMachineryTypeList } from '@/services/machineryType';
13
 import { getMachineryTypeList } from '@/services/machineryType';
9
 import { getCooperativeList } from '@/services/cooperative';
14
 import { getCooperativeList } from '@/services/cooperative';
10
 
15
 
20
     history.push(`./machinery/Edit${queryStr}`);
25
     history.push(`./machinery/Edit${queryStr}`);
21
   };
26
   };
22
   const handleDelete = (id) => {
27
   const handleDelete = (id) => {
23
-    deleteMachinery(id).then(() => {
24
-      message.success('删除成功');
25
-      actionRef.current.reload();
26
-    }).catch((err) => {
27
-      console.log(err.message)
28
-    });
28
+    deleteMachinery(id)
29
+      .then(() => {
30
+        message.success('删除成功');
31
+        actionRef.current.reload();
32
+      })
33
+      .catch((err) => {
34
+        console.log(err.message);
35
+      });
29
   };
36
   };
30
   //列表切换农机状态方法
37
   //列表切换农机状态方法
31
   const handleOK = (record, data) => {
38
   const handleOK = (record, data) => {
43
             actionRef.current.reload();
50
             actionRef.current.reload();
44
           })
51
           })
45
           .catch((err) => {
52
           .catch((err) => {
46
-            console.log(err.message)
53
+            console.log(err.message);
47
           });
54
           });
48
       },
55
       },
49
     });
56
     });
50
   };
57
   };
51
   useEffect(() => {
58
   useEffect(() => {
52
-    getCooperativeList({ pageSize: 999 }).then((res) => {
53
-      setCooperativeList(res.records);
54
-    }).catch((err) => {
55
-      console.log(err.message)
56
-    });
57
-    getMachineryTypeList({ pageSize: 999 }).then((res) => {
58
-      setMachineryTypeList(res.records);
59
-    }).catch((err) => {
60
-      console.log(err.message)
61
-    });
59
+    getCooperativeList({ pageSize: 999 })
60
+      .then((res) => {
61
+        setCooperativeList(res.records);
62
+      })
63
+      .catch((err) => {
64
+        console.log(err.message);
65
+      });
66
+    getMachineryTypeList({ pageSize: 999 })
67
+      .then((res) => {
68
+        setMachineryTypeList(res.records);
69
+      })
70
+      .catch((err) => {
71
+        console.log(err.message);
72
+      });
62
   }, []);
73
   }, []);
63
   const actions = () => [
74
   const actions = () => [
64
     <Button key="add" type="primary" icon={<PlusOutlined />} onClick={() => gotoEdit()}>
75
     <Button key="add" type="primary" icon={<PlusOutlined />} onClick={() => gotoEdit()}>
80
               </Option>
91
               </Option>
81
             ))}
92
             ))}
82
           </Select>
93
           </Select>
83
-        )
84
-      }
94
+        );
95
+      },
85
     },
96
     },
86
     {
97
     {
87
       title: '名称',
98
       title: '名称',
92
       title: '合作社',
103
       title: '合作社',
93
       dataIndex: 'orgName',
104
       dataIndex: 'orgName',
94
       key: 'orgName',
105
       key: 'orgName',
95
-      search: false
106
+      search: false,
96
     },
107
     },
97
     {
108
     {
98
       title: '农机类型',
109
       title: '农机类型',
182
             删除
193
             删除
183
           </Button>
194
           </Button>
184
         </Popconfirm>,
195
         </Popconfirm>,
196
+        <Button
197
+          style={{ padding: 0 }}
198
+          type="link"
199
+          key={4}
200
+          onClick={() =>
201
+            history.push(`/iot/OperationStatistics/detail?machineryId=${record.machineryId}`)
202
+          }
203
+        >
204
+          作业
205
+        </Button>,
185
       ],
206
       ],
186
     },
207
     },
187
   ];
208
   ];

+ 2
- 0
src/pages/Machinery/OperationStatistics/components/MaJob.jsx Vedi File

26
       title: '耕深(厘米)',
26
       title: '耕深(厘米)',
27
       dataIndex: 'depth',
27
       dataIndex: 'depth',
28
       key: 'depth',
28
       key: 'depth',
29
+      render: (t) => t || '-',
29
     },
30
     },
30
     {
31
     {
31
       title: '平均喷量(升/亩)',
32
       title: '平均喷量(升/亩)',
32
       dataIndex: 'traffic',
33
       dataIndex: 'traffic',
33
       key: 'traffic',
34
       key: 'traffic',
35
+      render: (t) => t || '-',
34
     },
36
     },
35
     {
37
     {
36
       title: '作业时间',
38
       title: '作业时间',

+ 0
- 6
src/pages/Machinery/Sensing/components/List.jsx Vedi File

64
       valueType: 'option',
64
       valueType: 'option',
65
       width: 280,
65
       width: 280,
66
       render: (_, record) => [
66
       render: (_, record) => [
67
-        <Link
68
-          to={`/Machinery/OperationStatistics?deviceType=${record.deviceType}&deviceNo=${record.deviceNo}`}
69
-          key={1}
70
-        >
71
-          作业
72
-        </Link>,
73
         record.machineryId === null ? (
67
         record.machineryId === null ? (
74
           <Button key={2} type="link" onClick={() => onOperate(record, 'bind')}>
68
           <Button key={2} type="link" onClick={() => onOperate(record, 'bind')}>
75
             绑定
69
             绑定