[baozhangchao] 3 anos atrás
pai
commit
ed93e28f9e

+ 19
- 0
config/routes.js Ver arquivo

@@ -192,6 +192,25 @@ 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: '系统管理',

+ 1
- 1
src/pages/ContentManagementSystem/BannerClassification/BannerClassificationEdit/index.jsx Ver arquivo

@@ -31,7 +31,7 @@ export default (props) => {
31 31
     <Card >
32 32
       <ProCard tabs={{ type: 'card' }} style={{ marginTop: '16px' }}
33 33
       >
34
-        <ProCard.TabPane key={1} tab="人员管理">
34
+        <ProCard.TabPane key={1} tab="资讯管理">
35 35
           <Form {...formItemLayout} onFinish={Submit} form={form} >
36 36
             <FormItem label="Banner图集" name="user" rules={[{ required: true, message: '请选择' }]}>
37 37
               <Upload {...props}>

+ 0
- 1
src/pages/ContentManagementSystem/BannerClassification/index.jsx Ver arquivo

@@ -71,7 +71,6 @@ export default (props) => {
71 71
       dataIndex: 'status',
72 72
       key: 'status',
73 73
       render: (t, record) => record.noteType === 1 ? '已发布' : '未发布',
74
-      initialValue: 'Success',
75 74
       valueEnum: {
76 75
         online: { text: '已发布', status: 'Success' },
77 76
         error: { text: '未发布', status: 'Error' },

+ 1
- 1
src/pages/ContentManagementSystem/InformationClassification/InformationClassificationEdit/index.jsx Ver arquivo

@@ -29,7 +29,7 @@ export default (props) => {
29 29
     <Card >
30 30
       <ProCard tabs={{ type: 'card' }} style={{ marginTop: '16px' }}
31 31
       >
32
-        <ProCard.TabPane key={1} tab="人员管理">
32
+        <ProCard.TabPane key={1} tab="资讯管理">
33 33
           <Form {...formItemLayout} onFinish={Submit} form={form} >
34 34
             <FormItem label="资讯分类" name="user" rules={[{ required: true, message: '请选择' }]}>
35 35
               <Select

+ 2
- 3
src/pages/ContentManagementSystem/InformationList/InformationListEdit/index.jsx Ver arquivo

@@ -27,9 +27,8 @@ export default (props) => {
27 27
 
28 28
   return (
29 29
     <Card >
30
-      <ProCard tabs={{ type: 'card' }} style={{ marginTop: '16px' }}
31
-      >
32
-        <ProCard.TabPane key={1} tab="人员管理">
30
+      <ProCard tabs={{ type: 'card' }} style={{ marginTop: '16px' }}>
31
+        <ProCard.TabPane key={1} tab="资讯管理">
33 32
           <Form {...formItemLayout} onFinish={Submit} form={form} >
34 33
             <FormItem label="资讯分类" name="user" rules={[{ required: true, message: '请选择' }]}>
35 34
               <Select

+ 0
- 1
src/pages/ContentManagementSystem/InformationList/index.jsx Ver arquivo

@@ -92,7 +92,6 @@ export default (props) => {
92 92
       dataIndex: 'status',
93 93
       key: 'status',
94 94
       render: (t, record) => record.noteType === 1 ? '已发布' : '未发布',
95
-      initialValue: 'Success',
96 95
       valueEnum: {
97 96
         online: { text: '已发布', status: 'Success' },
98 97
         error: { text: '未发布', status: 'Error' },

+ 49
- 0
src/pages/GPSDevice/GPS/GPSEdit/index.jsx Ver arquivo

@@ -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 Ver arquivo

@@ -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 Ver arquivo

@@ -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' },