fangmingyue 2 년 전
부모
커밋
6b1c63525b
3개의 변경된 파일161개의 추가작업 그리고 0개의 파일을 삭제
  1. 10
    0
      config/routes.js
  2. 62
    0
      src/pages/Machinery/JobList/index.jsx
  3. 89
    0
      src/pages/Machinery/OperationStatistics/index.jsx

+ 10
- 0
config/routes.js 파일 보기

@@ -135,6 +135,16 @@ export default [
135 135
         component: './Machinery/GIS/detail.jsx',
136 136
         hideInMenu: true,
137 137
       },
138
+      {
139
+        path: '/Machinery/JobList',
140
+        name: '作业列表',
141
+        component: './Machinery/JobList',
142
+      },
143
+      {
144
+        path: '/Machinery/OperationStatistics',
145
+        name: '作业统计',
146
+        component: './Machinery/OperationStatistics',
147
+      },
138 148
     ],
139 149
   },
140 150
   {

+ 62
- 0
src/pages/Machinery/JobList/index.jsx 파일 보기

@@ -0,0 +1,62 @@
1
+import React, { useState, useEffect, useRef } from 'react';
2
+import { Button, Popconfirm, Modal, Form, Input, message } from 'antd';
3
+import { PageHeaderWrapper } from '@ant-design/pro-layout';
4
+import PageTable from '@/components/PageTable';
5
+
6
+export default (props) => {
7
+  const formItemLayout = { labelCol: { span: 6 }, wrapperCol: { span: 14 } };
8
+  const [form] = Form.useForm();
9
+  const [editModal, setEditModal] = useState(false);
10
+  const [loading, setLoading] = useState(false);
11
+  const [regionId, setRegionId] = useState();
12
+  const actionRef = useRef();
13
+
14
+  const columns = [
15
+    {
16
+      title: '名称',
17
+      dataIndex: 'name',
18
+      key: 'name',
19
+    },
20
+    {
21
+      title: '设备编号',
22
+      dataIndex: 'createDate',
23
+      key: 'createDate',
24
+      width: 340,
25
+    },
26
+    {
27
+      title: '设备类型',
28
+      dataIndex: 'status',
29
+      key: 'status',
30
+    },
31
+    {
32
+      title: '作业面积(亩)',
33
+      dataIndex: 'status',
34
+      key: 'status',
35
+      search: false,
36
+    },
37
+    {
38
+      title: '作业时间',
39
+      dataIndex: 'status',
40
+      key: 'status',
41
+      search: false,
42
+    },
43
+    {
44
+      title: '绑定农机',
45
+      dataIndex: 'status',
46
+      key: 'status',
47
+      search: false,
48
+    },
49
+  ];
50
+
51
+  return (
52
+    <PageHeaderWrapper>
53
+      <PageTable
54
+        columns={columns}
55
+        actionRef={actionRef}
56
+        options={false}
57
+        // toolBarRender={actions}
58
+        scroll={{ x: 1000 }}
59
+      />
60
+    </PageHeaderWrapper>
61
+  );
62
+};

+ 89
- 0
src/pages/Machinery/OperationStatistics/index.jsx 파일 보기

@@ -0,0 +1,89 @@
1
+import React, { useState, useEffect, useRef } from 'react';
2
+import { Button, Popconfirm, Modal, Form, Input, message, Descriptions } from 'antd';
3
+import { PageHeaderWrapper } from '@ant-design/pro-layout';
4
+import PageTable from '@/components/PageTable';
5
+
6
+export default (props) => {
7
+  const formItemLayout = { labelCol: { span: 6 }, wrapperCol: { span: 14 } };
8
+  const [form] = Form.useForm();
9
+  const [editModal, setEditModal] = useState(false);
10
+  const [loading, setLoading] = useState(false);
11
+  const [regionId, setRegionId] = useState();
12
+  const actionRef = useRef();
13
+
14
+  const exports = () => [
15
+    <Button key="add" type="primary">
16
+      导出
17
+    </Button>,
18
+  ];
19
+
20
+  const columns = [
21
+    {
22
+      title: '合作社名称',
23
+      dataIndex: 'name',
24
+      key: 'name',
25
+    },
26
+    {
27
+      title: '设备编号',
28
+      dataIndex: 'createDate',
29
+      key: 'createDate',
30
+      width: 340,
31
+    },
32
+    {
33
+      title: '设备类型',
34
+      dataIndex: 'status',
35
+      key: 'status',
36
+    },
37
+    {
38
+      title: '作业面积(亩)',
39
+      dataIndex: 'status',
40
+      key: 'status',
41
+      search: false,
42
+    },
43
+    {
44
+      title: '作业时间',
45
+      dataIndex: 'status',
46
+      key: 'status',
47
+      search: false,
48
+    },
49
+    {
50
+      title: '绑定农机',
51
+      dataIndex: 'status',
52
+      key: 'status',
53
+      search: false,
54
+    },
55
+    {
56
+      title: '时间选择',
57
+      dataIndex: 'created_at',
58
+      valueType: 'dateRange',
59
+      hideInTable: true,
60
+      search: {
61
+        transform: (value) => {
62
+          return {
63
+            startTime: value[0],
64
+            endTime: value[1],
65
+          };
66
+        },
67
+      },
68
+    },
69
+  ];
70
+
71
+  return (
72
+    <PageHeaderWrapper
73
+      content={
74
+        <Descriptions>
75
+          <Descriptions.Item label='总作业面积:'>亩</Descriptions.Item>
76
+        </Descriptions>
77
+      }
78
+    >
79
+      <PageTable
80
+        columns={columns}
81
+        actionRef={actionRef}
82
+        options={false}
83
+        toolBarRender={exports}
84
+        // toolBarRender={actions}
85
+        scroll={{ x: 1000 }}
86
+      />
87
+    </PageHeaderWrapper>
88
+  );
89
+};