李志伟 пре 3 година
родитељ
комит
9c03af19e4

+ 1
- 6
config/routes.js Прегледај датотеку

@@ -46,13 +46,8 @@ export default [
46 46
     path: '/MonitoringScreen',
47 47
     name: '农机作业监控大屏',
48 48
     icon: 'DesktopOutlined',
49
-    component: '../layouts/BasicLayout',
49
+    component: './MonitoringScreen',
50 50
     routes: [
51
-      {
52
-        path: '/MonitoringScreen/index.jsx',
53
-        name: '数据大屏',
54
-        component: './MonitoringScreen',
55
-      },
56 51
       {
57 52
         path: '/MonitoringScreen/detail.jsx',
58 53
         name: '农机轨迹',

+ 30
- 35
src/pages/ContentManagementSystem/InformationClassification/InformationClassificationEdit/index.jsx Прегледај датотеку

@@ -1,18 +1,17 @@
1
-import { Input, Card, Select, Button, message } from "antd"
2
-import { useEffect, useState } from 'react'
3
-import { Form } from "antd";
1
+import { Input, Card, Select, Button, message } from 'antd';
2
+import { useEffect, useState } from 'react';
3
+import { Form } from 'antd';
4 4
 import { history } from 'umi';
5
-import ProCard from '@ant-design/pro-card'
5
+import ProCard from '@ant-design/pro-card';
6 6
 
7
-const { Option } = Select
7
+const { Option } = Select;
8 8
 const goBack = () => {
9
-  history.goBack()
10
-}
11
-const FormItem = Form.Item
9
+  history.goBack();
10
+};
11
+const FormItem = Form.Item;
12 12
 export default (props) => {
13
-
14
-  const [form] = Form.useForm()
15
-  const [loading, setLoading] = useState(false)
13
+  const [form] = Form.useForm();
14
+  const [loading, setLoading] = useState(false);
16 15
 
17 16
   const formItemLayout = {
18 17
     //布局
@@ -20,38 +19,34 @@ export default (props) => {
20 19
     wrapperCol: { span: 14 },
21 20
   };
22 21
 
23
-  const Submit = values => {
24
-    console.log("🚀 ~ file: index.jsx ~ line 21 ~ values", values)
25
-
22
+  const Submit = (values) => {
23
+    console.log('🚀 ~ file: index.jsx ~ line 21 ~ values', values);
26 24
   };
27 25
 
28 26
   return (
29
-    <Card >
30
-      <ProCard tabs={{ type: 'card' }} style={{ marginTop: '16px' }}
31
-      >
27
+    <Card>
28
+      <ProCard tabs={{ type: 'card' }} style={{ marginTop: '16px' }}>
32 29
         <ProCard.TabPane key={1} tab="资讯管理">
33
-          <Form {...formItemLayout} onFinish={Submit} form={form} >
34
-            <FormItem label="资讯分类" name="user" rules={[{ required: true, message: '请选择' }]}>
35
-              <Select
36
-                placeholder="请选择"
37
-                // onChange={onGenderChange}
38
-                allowClear
39
-                style={{ width: '350px' }}
40
-              >
41
-                <Option value="nongji">一分类</Option>
42
-                <Option value="nonghu">二分类</Option>
43
-              </Select>
44
-            </FormItem>
45
-            <FormItem label="资讯分类名称" name="shopName" rules={[{ required: true, message: '请输入' }]}>
30
+          <Form {...formItemLayout} onFinish={Submit} form={form}>
31
+            <FormItem label="分类名" name="name" rules={[{ required: true, message: '请输入' }]}>
46 32
               <Input placeholder="请输入" style={{ width: '350px' }} />
47 33
             </FormItem>
48
-            <FormItem label=" " colon={false} >
49
-              <Button type='default' onClick={() => goBack()} >返回</Button>
50
-              <Button type='primary' loading={loading} htmlType="Submit" style={{ marginLeft: '4em' }}>保存</Button>
34
+            <FormItem label=" " colon={false}>
35
+              <Button type="default" onClick={() => goBack()}>
36
+                返回
37
+              </Button>
38
+              <Button
39
+                type="primary"
40
+                loading={loading}
41
+                htmlType="Submit"
42
+                style={{ marginLeft: '4em' }}
43
+              >
44
+                保存
45
+              </Button>
51 46
             </FormItem>
52 47
           </Form>
53 48
         </ProCard.TabPane>
54 49
       </ProCard>
55 50
     </Card>
56
-  )
57
-}
51
+  );
52
+};

+ 27
- 32
src/pages/ContentManagementSystem/InformationClassification/index.jsx Прегледај датотеку

@@ -5,7 +5,6 @@ import { PlusOutlined, QuestionCircleOutlined } from '@ant-design/icons';
5 5
 import { PageHeaderWrapper } from '@ant-design/pro-layout';
6 6
 import ProTable, { TableDropdown } from '@ant-design/pro-table';
7 7
 
8
-
9 8
 export default (props) => {
10 9
   const dataSource = [
11 10
     {
@@ -15,52 +14,46 @@ export default (props) => {
15 14
       age: 32,
16 15
       zz: '西湖区湖底公园1号',
17 16
     },
18
-
19 17
   ];
20 18
 
21
-
22 19
   // 测试内容👆-------------------------
23 20
 
24 21
   const actionRef = useRef();
25 22
   const gotoDetail = (id) => {
26
-    history.push(`InformationClassification/InformationClassificationEdit`)
27
-  }
28
-
23
+    history.push(`InformationClassification/InformationClassificationEdit`);
24
+  };
29 25
 
30 26
   const handleDelete = (e) => {
31
-    deleteNote(e.noteId).then(res => {
27
+    deleteNote(e.noteId).then((res) => {
32 28
       message.success('删除成功');
33 29
       actionRef.current.reload();
34
-    })
35
-  }
30
+    });
31
+  };
36 32
 
37 33
   const handleOK = (record, data) => {
38
-    const titleCourse = record.status ? '您确定要禁用该用户吗? 禁用后该用户不能在后台登陆!' : '您确定要启用该用户吗? 启用后该用户将允许在后台登陆!';
34
+    const titleCourse = record.status
35
+      ? '您确定要禁用该用户吗? 禁用后该用户不能在后台登陆!'
36
+      : '您确定要启用该用户吗? 启用后该用户将允许在后台登陆!';
39 37
     Modal.confirm({
40 38
       title: titleCourse,
41 39
       okText: '确认',
42 40
       cancelText: '取消',
43
-      onOk () {
44
-        publishNote(record.noteId, record.status ? 'off' : 'on').then(res => {
41
+      onOk() {
42
+        publishNote(record.noteId, record.status ? 'off' : 'on').then((res) => {
45 43
           message.success('操作成功');
46
-          actionRef.current.reload()
47
-        })
44
+          actionRef.current.reload();
45
+        });
48 46
       },
49 47
     });
50
-  }
48
+  };
51 49
   const actions = () => [
52
-    <Button key='add' type="primary" icon={<PlusOutlined />} onClick={() => gotoDetail()}>新增</Button>,
53
-  ]
50
+    <Button key="add" type="primary" icon={<PlusOutlined />} onClick={() => gotoDetail()}>
51
+      新增
52
+    </Button>,
53
+  ];
54 54
   const columns = [
55 55
     {
56
-      title: '资讯分类',
57
-      key: 'zz',
58
-      dataIndex: 'zz',
59
-      search: false,
60
-
61
-    },
62
-    {
63
-      title: '资讯分类名称',
56
+      title: '分类名',
64 57
       dataIndex: 'name',
65 58
       key: 'name',
66 59
       search: false,
@@ -82,7 +75,7 @@ export default (props) => {
82 75
       dataIndex: 'createdAt',
83 76
       valueType: 'date',
84 77
       // render: (t) => formatterTime(t),
85
-      sorter: (a, b) => a.createdAt - b.createdAt,//时间排序
78
+      sorter: (a, b) => a.createdAt - b.createdAt, //时间排序
86 79
     },
87 80
     {
88 81
       title: '操作',
@@ -91,7 +84,9 @@ export default (props) => {
91 84
       ellipsis: true,
92 85
       width: 200,
93 86
       render: (_, record) => [
94
-        <Link key={2} to={`InformationClassification/InformationClassificationEdit`}>编辑</Link>,
87
+        <Link key={2} to={`InformationClassification/InformationClassificationEdit`}>
88
+          编辑
89
+        </Link>,
95 90
         <Popconfirm
96 91
           key={3}
97 92
           title="您是否确认删除 ?"
@@ -99,11 +94,11 @@ export default (props) => {
99 94
           okText="确定"
100 95
           cancelText="取消"
101 96
         >
102
-          <a href="#"  >删除</a>
97
+          <a href="#">删除</a>
103 98
         </Popconfirm>,
104
-      ]
99
+      ],
105 100
     },
106
-  ]
101
+  ];
107 102
 
108 103
   return (
109 104
     <PageHeaderWrapper>
@@ -118,5 +113,5 @@ export default (props) => {
118 113
         actionRef={actionRef}
119 114
       />
120 115
     </PageHeaderWrapper>
121
-  )
122
-}
116
+  );
117
+};

+ 41
- 34
src/pages/ContentManagementSystem/InformationList/InformationListEdit/index.jsx Прегледај датотеку

@@ -1,18 +1,18 @@
1
-import { Input, Card, Select, Button, message } from "antd"
2
-import { useEffect, useState } from 'react'
3
-import { Form } from "antd";
1
+import { Input, Card, Select, Button, message } from 'antd';
2
+import { useEffect, useState } from 'react';
3
+import { Form } from 'antd';
4 4
 import { history } from 'umi';
5
-import ProCard from '@ant-design/pro-card'
5
+import ProCard from '@ant-design/pro-card';
6
+// import ModalImage from './Modalimage';
6 7
 
7
-const { Option } = Select
8
+const { Option } = Select;
8 9
 const goBack = () => {
9
-  history.goBack()
10
-}
11
-const FormItem = Form.Item
10
+  history.goBack();
11
+};
12
+const FormItem = Form.Item;
12 13
 export default (props) => {
13
-
14
-  const [form] = Form.useForm()
15
-  const [loading, setLoading] = useState(false)
14
+  const [form] = Form.useForm();
15
+  const [loading, setLoading] = useState(false);
16 16
 
17 17
   const formItemLayout = {
18 18
     //布局
@@ -20,16 +20,15 @@ export default (props) => {
20 20
     wrapperCol: { span: 14 },
21 21
   };
22 22
 
23
-  const Submit = values => {
24
-    console.log("🚀 ~ file: index.jsx ~ line 21 ~ values", values)
25
-
23
+  const Submit = (values) => {
24
+    console.log('🚀 ~ file: index.jsx ~ line 21 ~ values', values);
26 25
   };
27 26
 
28 27
   return (
29
-    <Card >
28
+    <Card>
30 29
       <ProCard tabs={{ type: 'card' }} style={{ marginTop: '16px' }}>
31 30
         <ProCard.TabPane key={1} tab="资讯管理">
32
-          <Form {...formItemLayout} onFinish={Submit} form={form} >
31
+          <Form {...formItemLayout} onFinish={Submit} form={form}>
33 32
             <FormItem label="资讯分类" name="user" rules={[{ required: true, message: '请选择' }]}>
34 33
               <Select
35 34
                 placeholder="请选择"
@@ -41,30 +40,38 @@ export default (props) => {
41 40
                 <Option value="nonghu">二分类</Option>
42 41
               </Select>
43 42
             </FormItem>
44
-            <FormItem label="资讯名称" name="shopName" rules={[{ required: true, message: '请输入' }]}>
43
+            <FormItem
44
+              label="资讯名称"
45
+              name="shopName"
46
+              rules={[{ required: true, message: '请输入' }]}
47
+            >
45 48
               <Input placeholder="请输入" style={{ width: '350px' }} />
46 49
             </FormItem>
47
-            <FormItem label="资讯内容" name="shaopName" rules={[{ required: true, message: '请输入' }]}>
48
-              <Input placeholder="请输入" style={{ width: '350px' }} />
50
+            <FormItem label="资讯封面" name="thumb" rules={[{ required: true, message: '请输入' }]}>
51
+              {/* <ModalImage
52
+                sortVale={sortVale}
53
+                visible={visible}
54
+                value={content}
55
+                onChange={handleChange}
56
+                onCancel={handleClose}
57
+              /> */}
49 58
             </FormItem>
50
-            <FormItem label="发布状态" name="usser" rules={[{ required: true, message: '请选择' }]}>
51
-              <Select
52
-                placeholder="请选择"
53
-                // onChange={onGenderChange}
54
-                allowClear
55
-                style={{ width: '350px' }}
59
+            <FormItem label=" " colon={false}>
60
+              <Button type="default" onClick={() => goBack()}>
61
+                返回
62
+              </Button>
63
+              <Button
64
+                type="primary"
65
+                loading={loading}
66
+                htmlType="Submit"
67
+                style={{ marginLeft: '4em' }}
56 68
               >
57
-                <Option value="nongji">发布</Option>
58
-                <Option value="nonghu">未发布</Option>
59
-              </Select>
60
-            </FormItem>
61
-            <FormItem label=" " colon={false} >
62
-              <Button type='default' onClick={() => goBack()} >返回</Button>
63
-              <Button type='primary' loading={loading} htmlType="Submit" style={{ marginLeft: '4em' }}>保存</Button>
69
+                保存
70
+              </Button>
64 71
             </FormItem>
65 72
           </Form>
66 73
         </ProCard.TabPane>
67 74
       </ProCard>
68 75
     </Card>
69
-  )
70
-}
76
+  );
77
+};

+ 31
- 35
src/pages/ContentManagementSystem/InformationList/index.jsx Прегледај датотеку

@@ -5,7 +5,6 @@ import { PlusOutlined, QuestionCircleOutlined } from '@ant-design/icons';
5 5
 import { PageHeaderWrapper } from '@ant-design/pro-layout';
6 6
 import ProTable, { TableDropdown } from '@ant-design/pro-table';
7 7
 
8
-
9 8
 export default (props) => {
10 9
   const dataSource = [
11 10
     {
@@ -15,52 +14,47 @@ export default (props) => {
15 14
       age: 32,
16 15
       zz: '西湖区湖底公园1号',
17 16
     },
18
-
19 17
   ];
20 18
 
21
-
22 19
   // 测试内容👆-------------------------
23 20
 
24 21
   const actionRef = useRef();
25 22
   const gotoDetail = (id) => {
26
-    history.push(`InformationList/InformationListEdit`)
27
-  }
28
-
23
+    history.push(`InformationList/InformationListEdit`);
24
+  };
29 25
 
30 26
   const handleDelete = (e) => {
31
-    deleteNote(e.noteId).then(res => {
27
+    deleteNote(e.noteId).then((res) => {
32 28
       message.success('删除成功');
33 29
       actionRef.current.reload();
34
-    })
35
-  }
36
-
30
+    });
31
+  };
37 32
 
38 33
   const actions = () => [
39
-    <Button key='add' type="primary" icon={<PlusOutlined />} onClick={() => gotoDetail()}>新增</Button>,
40
-  ]
41
-
42
-
43
-
44
-
34
+    <Button key="add" type="primary" icon={<PlusOutlined />} onClick={() => gotoDetail()}>
35
+      新增
36
+    </Button>,
37
+  ];
45 38
 
46 39
   const columns = [
47 40
     {
48
-      title: '资讯分类',
49
-      key: 'zz',
50
-      dataIndex: 'zz',
41
+      title: '分类',
42
+      key: 'typeName',
43
+      dataIndex: 'typeName',
51 44
       search: false,
52
-
53 45
     },
54 46
     {
55
-      title: '资讯名称',
56
-      dataIndex: 'name',
57
-      key: 'name',
47
+      title: '资讯标题',
48
+      dataIndex: 'title',
49
+      key: 'title',
58 50
       search: false,
59
-    }, {
60
-      title: '资讯内容',
61
-      dataIndex: 'nam1e',
62
-      key: 'nam1e',
51
+    },
52
+    {
53
+      title: '封面',
54
+      key: 'thumb',
55
+      dataIndex: 'thumb',
63 56
       search: false,
57
+      render: (t) => <img src={t} alt="" width={110} />,
64 58
     },
65 59
     {
66 60
       title: (
@@ -77,7 +71,7 @@ export default (props) => {
77 71
       dataIndex: 'createdAt',
78 72
       valueType: 'date',
79 73
       // render: (t) => formatterTime(t),
80
-      sorter: (a, b) => a.createdAt - b.createdAt,//时间排序
74
+      sorter: (a, b) => a.createdAt - b.createdAt, //时间排序
81 75
     },
82 76
     {
83 77
       title: '状态',
@@ -87,7 +81,7 @@ export default (props) => {
87 81
       valueEnum: {
88 82
         0: { text: '已发布', status: 'Success' },
89 83
         1: { text: '未发布', status: 'Error' },
90
-      }
84
+      },
91 85
     },
92 86
 
93 87
     {
@@ -97,7 +91,9 @@ export default (props) => {
97 91
       ellipsis: true,
98 92
       width: 200,
99 93
       render: (_, record) => [
100
-        <Link key={2} to={`InformationList/InformationListEdit`}>编辑</Link>,
94
+        <Link key={2} to={`InformationList/InformationListEdit`}>
95
+          编辑
96
+        </Link>,
101 97
         <Popconfirm
102 98
           key={3}
103 99
           title="您是否确认删除 ?"
@@ -105,11 +101,11 @@ export default (props) => {
105 101
           okText="确定"
106 102
           cancelText="取消"
107 103
         >
108
-          <a href="#"  >删除</a>
104
+          <a href="#">删除</a>
109 105
         </Popconfirm>,
110
-      ]
106
+      ],
111 107
     },
112
-  ]
108
+  ];
113 109
 
114 110
   return (
115 111
     <PageHeaderWrapper>
@@ -124,5 +120,5 @@ export default (props) => {
124 120
         actionRef={actionRef}
125 121
       />
126 122
     </PageHeaderWrapper>
127
-  )
128
-}
123
+  );
124
+};