Преглед на файлове

Merge branch 'master' of http://git.ycjcjy.com/nanyang/machinery-admin

李志伟 преди 3 години
родител
ревизия
bb164dcb34

+ 1
- 1
config/defaultSettings.js Целия файл

@@ -10,6 +10,6 @@ const Settings = {
10 10
   title: 'Ant Design Pro',
11 11
   pwa: false,
12 12
   logo: 'https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg',
13
-  iconfontUrl: '',
13
+  // iconfontUrl: '//at.alicdn.com/t/font_3221810_t3g0tvsigf.js',
14 14
 };
15 15
 export default Settings;

+ 69
- 8
config/routes.js Целия файл

@@ -45,7 +45,7 @@ export default [
45 45
   {
46 46
     path: '/PlatformMessageManagement',
47 47
     name: '消息管理',
48
-    icon: 'crown',
48
+    icon: 'MailOutlined',
49 49
     component: '../layouts/BasicLayout',
50 50
     routes: [
51 51
       {
@@ -66,7 +66,7 @@ export default [
66 66
   {
67 67
     path: '/Machinery',
68 68
     name: '农机管理',
69
-    icon: 'InsertRowLeftOutlined',
69
+    icon: 'CarOutlined',
70 70
     component: '../layouts/BasicLayout',
71 71
     routes: [
72 72
       {
@@ -96,7 +96,7 @@ export default [
96 96
   {
97 97
     path: '/MonitoringScreen',
98 98
     name: '农机监控大屏',
99
-    icon: 'InsertRowLeftOutlined',
99
+    icon: 'DesktopOutlined',
100 100
     component: '../layouts/BasicLayout',
101 101
     routes: [
102 102
       {
@@ -128,7 +128,7 @@ export default [
128 128
   {
129 129
     path: '/OrderManage',
130 130
     name: '订单调度',
131
-    icon: 'InsertRowLeftOutlined',
131
+    icon: 'PhoneOutlined',
132 132
     component: '../layouts/BasicLayout',
133 133
     routes: [
134 134
       {
@@ -141,7 +141,7 @@ export default [
141 141
   {
142 142
     path: '/JobWarning',
143 143
     name: '作业预警',
144
-    icon: 'InsertRowLeftOutlined',
144
+    icon: 'AlertOutlined',
145 145
     component: '../layouts/BasicLayout',
146 146
     routes: [
147 147
       {
@@ -154,7 +154,7 @@ export default [
154 154
   {
155 155
     path: '/JobStatistics',
156 156
     name: '作业统计',
157
-    icon: 'InsertRowLeftOutlined',
157
+    icon: 'ScheduleOutlined',
158 158
     component: '../layouts/BasicLayout',
159 159
     routes: [
160 160
       {
@@ -177,7 +177,7 @@ export default [
177 177
   {
178 178
     path: '/Finance',
179 179
     name: '财务管理',
180
-    icon: 'InsertRowLeftOutlined',
180
+    icon: 'DollarOutlined',
181 181
     component: '../layouts/BasicLayout',
182 182
     routes: [
183 183
       {
@@ -192,10 +192,29 @@ export default [
192 192
       },
193 193
     ],
194 194
   },
195
+  {
196
+    path: '/GPSDevice',
197
+    name: 'GPS设备管理',
198
+    icon: 'CompassOutlined',
199
+    component: '../layouts/BasicLayout',
200
+    routes: [
201
+      {
202
+        path: '/GPSDevice/GPS',
203
+        name: 'GPS管理',
204
+        component: './GPSDevice/GPS',
205
+      },
206
+      {
207
+        path: '/GPSDevice/GPS/GPSEdit',
208
+        name: '新增设备',
209
+        component: './GPSDevice/GPS/GPSEdit',
210
+        hideInMenu: true
211
+      },
212
+    ],
213
+  },
195 214
   {
196 215
     path: '/SystemManagement',
197 216
     name: '系统管理',
198
-    icon: 'crown',
217
+    icon: 'SettingOutlined',
199 218
     component: '../layouts/BasicLayout',
200 219
     routes: [
201 220
       {
@@ -235,6 +254,48 @@ export default [
235 254
       },
236 255
     ],
237 256
   },
257
+  {
258
+    path: '/ContentManagementSystem',
259
+    name: 'CMS管理',
260
+    icon: 'MediumOutlined',
261
+    component: '../layouts/BasicLayout',
262
+    routes: [
263
+      {
264
+        path: '/ContentManagementSystem/InformationClassification',
265
+        name: '资讯分类',
266
+        component: './ContentManagementSystem/InformationClassification',
267
+      },
268
+      {
269
+        path: '/ContentManagementSystem/InformationClassification/InformationClassificationEdit',
270
+        name: '资讯分类编辑',
271
+        component: './ContentManagementSystem/InformationClassification/InformationClassificationEdit',
272
+        hideInMenu: true
273
+      },
274
+      {
275
+        path: '/ContentManagementSystem/InformationList',
276
+        name: '资讯列表',
277
+        component: './ContentManagementSystem/InformationList',
278
+      },
279
+      {
280
+        path: '/ContentManagementSystem/InformationList/InformationListEdit',
281
+        name: '资讯列表编辑',
282
+        component: './ContentManagementSystem/InformationList/InformationListEdit',
283
+        hideInMenu: true
284
+
285
+      },
286
+      {
287
+        path: '/ContentManagementSystem/BannerClassification',
288
+        name: 'Banner资讯',
289
+        component: './ContentManagementSystem/BannerClassification',
290
+      }, {
291
+        path: '/ContentManagementSystem/BannerClassification/BannerClassificationEdit',
292
+        name: 'Banner资讯编辑',
293
+        component: './ContentManagementSystem/BannerClassification/BannerClassificationEdit',
294
+        hideInMenu: true
295
+
296
+      },
297
+    ],
298
+  },
238 299
   {
239 300
     path: '/',
240 301
     redirect: '/welcome',

+ 21
- 21
src/components/Footer/index.jsx Целия файл

@@ -6,32 +6,32 @@ const Footer = () => {
6 6
   const intl = useIntl();
7 7
   const defaultMessage = intl.formatMessage({
8 8
     id: 'app.copyright.produced',
9
-    defaultMessage: '蚂蚁集团体验技术部出品',
9
+    defaultMessage: '云致科技',
10 10
   });
11 11
   const currentYear = new Date().getFullYear();
12 12
   return (
13 13
     <DefaultFooter
14 14
       copyright={`${currentYear} ${defaultMessage}`}
15
-      links={[
16
-        {
17
-          key: 'Ant Design Pro',
18
-          title: 'Ant Design Pro',
19
-          href: 'https://pro.ant.design',
20
-          blankTarget: true,
21
-        },
22
-        {
23
-          key: 'github',
24
-          title: <GithubOutlined />,
25
-          href: 'https://github.com/ant-design/ant-design-pro',
26
-          blankTarget: true,
27
-        },
28
-        {
29
-          key: 'Ant Design',
30
-          title: 'Ant Design',
31
-          href: 'https://ant.design',
32
-          blankTarget: true,
33
-        },
34
-      ]}
15
+    // links={[
16
+    //   {
17
+    //     key: 'Ant Design Pro',
18
+    //     title: 'Ant Design Pro',
19
+    //     href: 'https://pro.ant.design',
20
+    //     blankTarget: true,
21
+    //   },
22
+    //   {
23
+    //     key: 'github',
24
+    //     title: <GithubOutlined />,
25
+    //     href: 'https://github.com/ant-design/ant-design-pro',
26
+    //     blankTarget: true,
27
+    //   },
28
+    //   {
29
+    //     key: 'Ant Design',
30
+    //     title: 'Ant Design',
31
+    //     href: 'https://ant.design',
32
+    //     blankTarget: true,
33
+    //   },
34
+    // ]}
35 35
     />
36 36
   );
37 37
 };

+ 1
- 1
src/locales/bn-BD.js Целия файл

@@ -10,7 +10,7 @@ export default {
10 10
   'layout.user.link.help': 'সহায়তা',
11 11
   'layout.user.link.privacy': 'গোপনীয়তা',
12 12
   'layout.user.link.terms': 'শর্তাদি',
13
-  'app.copyright.produced': 'প্রযোজনা করেছেন অ্যান্ট ফিনান্সিয়াল এক্সপেরিয়েন্স ডিপার্টমেন্ট',
13
+  'app.copyright.produced': 'YunZhiKeJi',
14 14
   'app.preview.down.block': 'আপনার স্থানীয় প্রকল্পে এই পৃষ্ঠাটি ডাউনলোড করুন',
15 15
   'app.welcome.link.fetch-blocks': 'সমস্ত ব্লক পান',
16 16
   'app.welcome.link.block-list':

+ 1
- 1
src/locales/en-US.js Целия файл

@@ -10,7 +10,7 @@ export default {
10 10
   'layout.user.link.help': 'Help',
11 11
   'layout.user.link.privacy': 'Privacy',
12 12
   'layout.user.link.terms': 'Terms',
13
-  'app.copyright.produced': 'Produced by Ant Financial Experience Department',
13
+  'app.copyright.produced': 'YunZhiKeJi',
14 14
   'app.preview.down.block': 'Download this page to your local project',
15 15
   'app.welcome.link.fetch-blocks': 'Get all block',
16 16
   'app.welcome.link.block-list': 'Quickly build standard, pages based on `block` development',

+ 1
- 1
src/locales/zh-CN.js Целия файл

@@ -10,7 +10,7 @@ export default {
10 10
   'layout.user.link.help': '帮助',
11 11
   'layout.user.link.privacy': '隐私',
12 12
   'layout.user.link.terms': '条款',
13
-  'app.copyright.produced': '蚂蚁集团体验技术部出品',
13
+  'app.copyright.produced': '云致科技',
14 14
   'app.preview.down.block': '下载此页面到本地项目',
15 15
   'app.welcome.link.fetch-blocks': '获取全部区块',
16 16
   'app.welcome.link.block-list': '基于 block 开发,快速构建标准页面',

+ 56
- 0
src/pages/ContentManagementSystem/BannerClassification/BannerClassificationEdit/index.jsx Целия файл

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

+ 133
- 0
src/pages/ContentManagementSystem/BannerClassification/index.jsx Целия файл

@@ -0,0 +1,133 @@
1
+import { history, Link } from 'umi';
2
+import { useRef } from 'react';
3
+import { Button, Modal, message, Popconfirm, Tooltip } from 'antd';
4
+import { PlusOutlined, QuestionCircleOutlined } from '@ant-design/icons';
5
+import { PageHeaderWrapper } from '@ant-design/pro-layout';
6
+import ProTable, { TableDropdown } from '@ant-design/pro-table';
7
+
8
+
9
+export default (props) => {
10
+  const dataSource = [
11
+    {
12
+      id: 9,
13
+      key: '1',
14
+      name: '胡彦斌',
15
+      age: 32,
16
+      zz: '西湖区湖底公园1号',
17
+    },
18
+
19
+  ];
20
+
21
+
22
+  // 测试内容👆-------------------------
23
+
24
+  const actionRef = useRef();
25
+  const gotoDetail = (id) => {
26
+    history.push(`BannerClassification/BannerClassificationEdit`)
27
+  }
28
+
29
+
30
+  const handleDelete = (e) => {
31
+    deleteNote(e.noteId).then(res => {
32
+      message.success('删除成功');
33
+      actionRef.current.reload();
34
+    })
35
+  }
36
+
37
+  const handleOK = (record, data) => {
38
+    const titleCourse = record.status ? '您确定要禁用该用户吗? 禁用后该用户不能在后台登陆!' : '您确定要启用该用户吗? 启用后该用户将允许在后台登陆!';
39
+    Modal.confirm({
40
+      title: titleCourse,
41
+      okText: '确认',
42
+      cancelText: '取消',
43
+      onOk () {
44
+        publishNote(record.noteId, record.status ? 'off' : 'on').then(res => {
45
+          message.success('操作成功');
46
+          actionRef.current.reload()
47
+        })
48
+      },
49
+    });
50
+  }
51
+  const actions = () => [
52
+    <Button key='add' type="primary" icon={<PlusOutlined />} onClick={() => gotoDetail()}>新增</Button>,
53
+  ]
54
+  const columns = [
55
+    {
56
+      title: 'Banner图片',
57
+      key: 'zz',
58
+      dataIndex: 'zz',
59
+      search: false,
60
+      render: (t) => <img width={110} src={t} alt="" />,
61
+
62
+    },
63
+    {
64
+      title: '资讯详情',
65
+      dataIndex: 'name',
66
+      key: 'name',
67
+      search: false,
68
+    },
69
+    {
70
+      title: '发布状态',
71
+      dataIndex: 'status',
72
+      key: 'status',
73
+      render: (t, record) => record.noteType === 1 ? '已发布' : '未发布',
74
+      valueEnum: {
75
+        online: { text: '已发布', status: 'Success' },
76
+        error: { text: '未发布', status: 'Error' },
77
+      }
78
+    },
79
+
80
+    {
81
+      title: (
82
+        <>
83
+          创建时间
84
+          <Tooltip placement="top">
85
+            <QuestionCircleOutlined style={{ marginLeft: 4 }} />
86
+          </Tooltip>
87
+        </>
88
+      ),
89
+      // hideInTable: true,
90
+      search: false,
91
+
92
+      key: 'createdAt',
93
+      dataIndex: 'createdAt',
94
+      valueType: 'date',
95
+      // render: (t) => formatterTime(t),
96
+      sorter: (a, b) => a.createdAt - b.createdAt,//时间排序
97
+    },
98
+    {
99
+      title: '操作',
100
+      valueType: 'option',
101
+      key: 'option',
102
+      ellipsis: true,
103
+      width: 200,
104
+      render: (_, record) => [
105
+        <Link key={2} to={`BannerClassification/BannerClassificationEdit`}>编辑</Link>,
106
+        <Popconfirm
107
+          key={3}
108
+          title="您是否确认删除 ?"
109
+          onConfirm={() => handleDelete(record)}
110
+          okText="确定"
111
+          cancelText="取消"
112
+        >
113
+          <a href="#"  >删除</a>
114
+        </Popconfirm>,
115
+      ]
116
+    },
117
+  ]
118
+
119
+  return (
120
+    <PageHeaderWrapper>
121
+      <ProTable
122
+        dataSource={dataSource}
123
+        columns={columns}
124
+        // request={getNoteList} 请求
125
+        // rowKey="noteId"
126
+        search={false}
127
+        options={false}
128
+        toolBarRender={actions}
129
+        actionRef={actionRef}
130
+      />
131
+    </PageHeaderWrapper>
132
+  )
133
+}

+ 57
- 0
src/pages/ContentManagementSystem/InformationClassification/InformationClassificationEdit/index.jsx Целия файл

@@ -0,0 +1,57 @@
1
+import { Input, Card, Select, Button, message } from "antd"
2
+import { useEffect, useState } from 'react'
3
+import { Form } from "antd";
4
+import { history } from 'umi';
5
+import ProCard from '@ant-design/pro-card'
6
+
7
+const { Option } = Select
8
+const goBack = () => {
9
+  history.goBack()
10
+}
11
+const FormItem = Form.Item
12
+export default (props) => {
13
+
14
+  const [form] = Form.useForm()
15
+  const [loading, setLoading] = useState(false)
16
+
17
+  const formItemLayout = {
18
+    //布局
19
+    labelCol: { span: 6 },
20
+    wrapperCol: { span: 14 },
21
+  };
22
+
23
+  const Submit = values => {
24
+    console.log("🚀 ~ file: index.jsx ~ line 21 ~ values", values)
25
+
26
+  };
27
+
28
+  return (
29
+    <Card >
30
+      <ProCard tabs={{ type: 'card' }} style={{ marginTop: '16px' }}
31
+      >
32
+        <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: '请输入' }]}>
46
+              <Input placeholder="请输入" style={{ width: '350px' }} />
47
+            </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>
51
+            </FormItem>
52
+          </Form>
53
+        </ProCard.TabPane>
54
+      </ProCard>
55
+    </Card>
56
+  )
57
+}

+ 122
- 0
src/pages/ContentManagementSystem/InformationClassification/index.jsx Целия файл

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

+ 70
- 0
src/pages/ContentManagementSystem/InformationList/InformationListEdit/index.jsx Целия файл

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

+ 136
- 0
src/pages/ContentManagementSystem/InformationList/index.jsx Целия файл

@@ -0,0 +1,136 @@
1
+import { history, Link } from 'umi';
2
+import { useRef } from 'react';
3
+import { Button, Modal, message, Popconfirm, Tooltip } from 'antd';
4
+import { PlusOutlined, QuestionCircleOutlined } from '@ant-design/icons';
5
+import { PageHeaderWrapper } from '@ant-design/pro-layout';
6
+import ProTable, { TableDropdown } from '@ant-design/pro-table';
7
+
8
+
9
+export default (props) => {
10
+  const dataSource = [
11
+    {
12
+      id: 9,
13
+      key: '1',
14
+      name: '胡彦斌',
15
+      age: 32,
16
+      zz: '西湖区湖底公园1号',
17
+    },
18
+
19
+  ];
20
+
21
+
22
+  // 测试内容👆-------------------------
23
+
24
+  const actionRef = useRef();
25
+  const gotoDetail = (id) => {
26
+    history.push(`InformationList/InformationListEdit`)
27
+  }
28
+
29
+
30
+  const handleDelete = (e) => {
31
+    deleteNote(e.noteId).then(res => {
32
+      message.success('删除成功');
33
+      actionRef.current.reload();
34
+    })
35
+  }
36
+
37
+  const handleOK = (record, data) => {
38
+    const titleCourse = record.status ? '您确定要禁用该用户吗? 禁用后该用户不能在后台登陆!' : '您确定要启用该用户吗? 启用后该用户将允许在后台登陆!';
39
+    Modal.confirm({
40
+      title: titleCourse,
41
+      okText: '确认',
42
+      cancelText: '取消',
43
+      onOk () {
44
+        publishNote(record.noteId, record.status ? 'off' : 'on').then(res => {
45
+          message.success('操作成功');
46
+          actionRef.current.reload()
47
+        })
48
+      },
49
+    });
50
+  }
51
+  const actions = () => [
52
+    <Button key='add' type="primary" icon={<PlusOutlined />} onClick={() => gotoDetail()}>新增</Button>,
53
+  ]
54
+  const columns = [
55
+    {
56
+      title: '资讯分类',
57
+      key: 'zz',
58
+      dataIndex: 'zz',
59
+      search: false,
60
+
61
+    },
62
+    {
63
+      title: '资讯名称',
64
+      dataIndex: 'name',
65
+      key: 'name',
66
+      search: false,
67
+    }, {
68
+      title: '资讯内容',
69
+      dataIndex: 'name',
70
+      key: 'name',
71
+      search: false,
72
+    },
73
+    {
74
+      title: (
75
+        <>
76
+          创建时间
77
+          <Tooltip placement="top">
78
+            <QuestionCircleOutlined style={{ marginLeft: 4 }} />
79
+          </Tooltip>
80
+        </>
81
+      ),
82
+      // hideInTable: true,
83
+      search: false,
84
+      key: 'createdAt',
85
+      dataIndex: 'createdAt',
86
+      valueType: 'date',
87
+      // render: (t) => formatterTime(t),
88
+      sorter: (a, b) => a.createdAt - b.createdAt,//时间排序
89
+    },
90
+    {
91
+      title: '发布状态',
92
+      dataIndex: 'status',
93
+      key: 'status',
94
+      render: (t, record) => record.noteType === 1 ? '已发布' : '未发布',
95
+      valueEnum: {
96
+        online: { text: '已发布', status: 'Success' },
97
+        error: { text: '未发布', status: 'Error' },
98
+      }
99
+    },
100
+
101
+    {
102
+      title: '操作',
103
+      valueType: 'option',
104
+      key: 'option',
105
+      ellipsis: true,
106
+      width: 200,
107
+      render: (_, record) => [
108
+        <Link key={2} to={`InformationList/InformationListEdit`}>编辑</Link>,
109
+        <Popconfirm
110
+          key={3}
111
+          title="您是否确认删除 ?"
112
+          onConfirm={() => handleDelete(record)}
113
+          okText="确定"
114
+          cancelText="取消"
115
+        >
116
+          <a href="#"  >删除</a>
117
+        </Popconfirm>,
118
+      ]
119
+    },
120
+  ]
121
+
122
+  return (
123
+    <PageHeaderWrapper>
124
+      <ProTable
125
+        dataSource={dataSource}
126
+        columns={columns}
127
+        // request={getNoteList} 请求
128
+        // rowKey="noteId"
129
+        search={false}
130
+        options={false}
131
+        toolBarRender={actions}
132
+        actionRef={actionRef}
133
+      />
134
+    </PageHeaderWrapper>
135
+  )
136
+}

+ 49
- 0
src/pages/GPSDevice/GPS/GPSEdit/index.jsx Целия файл

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

+ 111
- 0
src/pages/GPSDevice/GPS/index.jsx Целия файл

@@ -0,0 +1,111 @@
1
+import { history, Link } from 'umi';
2
+import { useRef } from 'react';
3
+import { Button, Modal, message, Popconfirm, Tooltip } from 'antd';
4
+import { PlusOutlined, QuestionCircleOutlined } from '@ant-design/icons';
5
+import { PageHeaderWrapper } from '@ant-design/pro-layout';
6
+import ProTable, { TableDropdown } from '@ant-design/pro-table';
7
+
8
+
9
+export default (props) => {
10
+  const dataSource = [
11
+    {
12
+      id: 9,
13
+      key: '1',
14
+      name: '胡彦斌',
15
+      age: 32,
16
+      zz: '西湖区湖底公园1号',
17
+    },
18
+
19
+  ];
20
+
21
+
22
+  // 测试内容👆-------------------------
23
+
24
+  const actionRef = useRef();
25
+  const gotoDetail = (id) => {
26
+    history.push(`./GPS/GPSEdit`)
27
+  }
28
+
29
+
30
+  const handleDelete = (e) => {
31
+    deleteNote(e.noteId).then(res => {
32
+      message.success('删除成功');
33
+      actionRef.current.reload();
34
+    })
35
+  }
36
+
37
+  const handleOK = (record, data) => {
38
+    const titleCourse = record.status ? '您确定要禁用该用户吗? 禁用后该用户不能在后台登陆!' : '您确定要启用该用户吗? 启用后该用户将允许在后台登陆!';
39
+    Modal.confirm({
40
+      title: titleCourse,
41
+      okText: '确认',
42
+      cancelText: '取消',
43
+      onOk () {
44
+        publishNote(record.noteId, record.status ? 'off' : 'on').then(res => {
45
+          message.success('操作成功');
46
+          actionRef.current.reload()
47
+        })
48
+      },
49
+    });
50
+  }
51
+  const actions = () => [
52
+    <Button key='add' type="primary" icon={<PlusOutlined />} onClick={() => gotoDetail()}>新增</Button>,
53
+  ]
54
+  const columns = [
55
+    {
56
+      title: 'ID',
57
+      key: 'zz',
58
+      dataIndex: 'zz',
59
+    },
60
+    {
61
+      title: '设备号',
62
+      dataIndex: 'name',
63
+      key: 'name',
64
+    },
65
+    {
66
+      title: '状态',
67
+      dataIndex: 'status',
68
+      key: 'status',
69
+      render: (t, record) => record.noteType === 1 ? '已启用' : '已禁用',
70
+      valueEnum: {
71
+        online: { text: '已启用', status: 'Success' },
72
+        error: { text: '已禁用', status: 'Error' },
73
+      }
74
+    },
75
+
76
+
77
+    {
78
+      title: '操作',
79
+      valueType: 'option',
80
+      key: 'option',
81
+      ellipsis: true,
82
+      width: 200,
83
+      render: (_, record) => [
84
+        <Link key={2} to={`./GPS/GPSEdit`}>编辑</Link>,
85
+        <Popconfirm
86
+          key={3}
87
+          title="您是否确认删除 ?"
88
+          onConfirm={() => handleDelete(record)}
89
+          okText="确定"
90
+          cancelText="取消"
91
+        >
92
+          <a href="#"  >删除</a>
93
+        </Popconfirm>,
94
+      ]
95
+    },
96
+  ]
97
+
98
+  return (
99
+    <PageHeaderWrapper>
100
+      <ProTable
101
+        dataSource={dataSource}
102
+        columns={columns}
103
+        // request={getNoteList} 请求
104
+        // rowKey="noteId"
105
+        options={false}
106
+        toolBarRender={actions}
107
+        actionRef={actionRef}
108
+      />
109
+    </PageHeaderWrapper>
110
+  )
111
+}

+ 0
- 1
src/pages/SystemManagement/Administrator/index.jsx Целия файл

@@ -87,7 +87,6 @@ export default (props) => {
87 87
       dataIndex: 'status',
88 88
       key: 'status',
89 89
       render: (t, record) => record.noteType === 1 ? '已启用' : '已禁用',
90
-      initialValue: 'Success',
91 90
       valueEnum: {
92 91
         online: { text: '已启用', status: 'Success' },
93 92
         error: { text: '已禁用', status: 'Error' },