Browse Source

Merge branch 'master' of http://g

[baozhangchao] 3 years ago
parent
commit
fffca9dd05

+ 4
- 9
config/routes.js View File

44
   },
44
   },
45
   {
45
   {
46
     path: '/MonitoringScreen',
46
     path: '/MonitoringScreen',
47
-    name: '农机作业监控大屏',
47
+    name: '数据大屏',
48
     icon: 'DesktopOutlined',
48
     icon: 'DesktopOutlined',
49
     component: './MonitoringScreen',
49
     component: './MonitoringScreen',
50
     routes: [
50
     routes: [
99
     ],
99
     ],
100
   },
100
   },
101
   {
101
   {
102
-    path: '/GPSDevice',
103
-    name: 'GPS设备管理',
102
+    path: '/GPSDevice/GPS',
103
+    name: '设备管理',
104
     icon: 'CompassOutlined',
104
     icon: 'CompassOutlined',
105
-    component: '../layouts/BasicLayout',
105
+    component: './GPSDevice/GPS',
106
     routes: [
106
     routes: [
107
-      {
108
-        path: '/GPSDevice/GPS',
109
-        name: 'GPS管理',
110
-        component: './GPSDevice/GPS',
111
-      },
112
       {
107
       {
113
         path: '/GPSDevice/GPS/GPSEdit',
108
         path: '/GPSDevice/GPS/GPSEdit',
114
         name: '新增设备',
109
         name: '新增设备',

+ 48
- 32
src/pages/ContentManagementSystem/BannerClassification/BannerClassificationEdit/index.jsx View File

1
-import { Input, Card, Select, Button, message, Upload, Modal } from "antd"
2
-import { useEffect, useState } from 'react'
3
-import { Form } from "antd";
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';
4
 import { history } from 'umi';
5
-import ProCard from '@ant-design/pro-card'
6
-import { UploadOutlined } from '@ant-design/icons';
5
+import ProCard from '@ant-design/pro-card';
6
+import { UploadImage } from '@/components/Upload';
7
+import ExtendContent from '@/components/ExtendContent';
7
 
8
 
8
-const { Option } = Select
9
+const { Option } = Select;
9
 const goBack = () => {
10
 const goBack = () => {
10
-  history.goBack()
11
-}
12
-const FormItem = Form.Item
11
+  history.goBack();
12
+};
13
+const FormItem = Form.Item;
13
 export default (props) => {
14
 export default (props) => {
14
-
15
-  const [form] = Form.useForm()
16
-  const [loading, setLoading] = useState(false)
15
+  const [form] = Form.useForm();
16
+  const [loading, setLoading] = useState(false);
17
+  const [image, setImage] = useState();
17
 
18
 
18
   const formItemLayout = {
19
   const formItemLayout = {
19
     //布局
20
     //布局
21
     wrapperCol: { span: 14 },
22
     wrapperCol: { span: 14 },
22
   };
23
   };
23
 
24
 
24
-  const Submit = values => {
25
+  const Submit = (values) => {
25
     message.success(`成功成功成功`);
26
     message.success(`成功成功成功`);
26
-    console.log("🚀 ~ file: index.jsx ~ line 21 ~ values", values)
27
-
27
+    console.log('🚀 ~ file: index.jsx ~ line 21 ~ values', values);
28
   };
28
   };
29
 
29
 
30
   return (
30
   return (
31
-    <Card >
32
-      <ProCard tabs={{ type: 'card' }} style={{ marginTop: '16px' }}
33
-      >
31
+    <Card>
32
+      <ProCard tabs={{ type: 'card' }} style={{ marginTop: '16px' }}>
34
         <ProCard.TabPane key={1} tab="资讯管理">
33
         <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: '请输入' }]}>
34
+          <Form {...formItemLayout} onFinish={Submit} form={form}>
35
+            <FormItem label="名称" name="title" rules={[{ required: true, message: '请输入' }]}>
42
               <Input placeholder="请输入" style={{ width: '350px' }} />
36
               <Input placeholder="请输入" style={{ width: '350px' }} />
43
             </FormItem>
37
             </FormItem>
44
-            <FormItem label="资讯内容" name="s1hopName" rules={[{ required: true, message: '请输入' }]}>
45
-              <Input placeholder="请输入" style={{ width: '350px' }} />
38
+            <FormItem label="图片" name="thumb" rules={[{ required: true, message: '请选择' }]}>
39
+              <UploadImage value={image} onChange={setImage} />
40
+            </FormItem>
41
+            <FormItem label="位置" name="position" rules={[{ required: true, message: '请选择' }]}>
42
+              <Select>
43
+                <Option value="index">首屏</Option>
44
+                <Option value="banner">banner页面</Option>
45
+              </Select>
46
+            </FormItem>
47
+            <FormItem label="详细信息" colon={false}>
48
+              <ExtendContent
49
+                targetType="tourist"
50
+                targetId={'66'}
51
+                onCancel={() => history.goBack()}
52
+              />
46
             </FormItem>
53
             </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>
54
+            <FormItem label=" " colon={false}>
55
+              <Button type="default" onClick={() => goBack()}>
56
+                返回
57
+              </Button>
58
+              <Button
59
+                type="primary"
60
+                loading={loading}
61
+                htmlType="Submit"
62
+                style={{ marginLeft: '4em' }}
63
+              >
64
+                保存
65
+              </Button>
50
             </FormItem>
66
             </FormItem>
51
           </Form>
67
           </Form>
52
         </ProCard.TabPane>
68
         </ProCard.TabPane>
53
       </ProCard>
69
       </ProCard>
54
     </Card>
70
     </Card>
55
-  )
56
-}
71
+  );
72
+};

+ 38
- 31
src/pages/ContentManagementSystem/BannerClassification/index.jsx View File

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

+ 12
- 10
src/pages/ContentManagementSystem/InformationList/InformationListEdit/index.jsx View File

1
-import { Input, Card, Select, Button, message } from 'antd';
1
+import { Input, Card, Select, Button, Form, message } from 'antd';
2
 import { useEffect, useState } from 'react';
2
 import { useEffect, useState } from 'react';
3
-import { Form } from 'antd';
4
 import { history } from 'umi';
3
 import { history } from 'umi';
5
 import ProCard from '@ant-design/pro-card';
4
 import ProCard from '@ant-design/pro-card';
6
-// import ModalImage from './Modalimage';
5
+import ExtendContent from '@/components/ExtendContent';
6
+import { UploadImage } from '@/components/Upload';
7
 
7
 
8
 const { Option } = Select;
8
 const { Option } = Select;
9
 const goBack = () => {
9
 const goBack = () => {
13
 export default (props) => {
13
 export default (props) => {
14
   const [form] = Form.useForm();
14
   const [form] = Form.useForm();
15
   const [loading, setLoading] = useState(false);
15
   const [loading, setLoading] = useState(false);
16
+  const [image, setImage] = useState();
16
 
17
 
17
   const formItemLayout = {
18
   const formItemLayout = {
18
     //布局
19
     //布局
48
               <Input placeholder="请输入" style={{ width: '350px' }} />
49
               <Input placeholder="请输入" style={{ width: '350px' }} />
49
             </FormItem>
50
             </FormItem>
50
             <FormItem label="资讯封面" name="thumb" rules={[{ required: true, message: '请输入' }]}>
51
             <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
-              /> */}
52
+              <UploadImage value={image} onChange={setImage} />
53
+            </FormItem>
54
+            <FormItem label="详细信息" colon={false}>
55
+              <ExtendContent
56
+                targetType="tourist"
57
+                targetId={'66'}
58
+                onCancel={() => history.goBack()}
59
+              />
58
             </FormItem>
60
             </FormItem>
59
             <FormItem label=" " colon={false}>
61
             <FormItem label=" " colon={false}>
60
               <Button type="default" onClick={() => goBack()}>
62
               <Button type="default" onClick={() => goBack()}>