[baozhangchao] 3 yıl önce
ebeveyn
işleme
a04a7e996a

+ 1
- 1
config/config.js Dosyayı Görüntüle

@@ -13,7 +13,7 @@ export default defineConfig({
13 13
   },
14 14
   layout: {
15 15
     // https://umijs.org/zh-CN/plugins/plugin-layout
16
-    locale: true,
16
+    locale: false,
17 17
     siderWidth: 208,
18 18
     ...defaultSettings,
19 19
   },

+ 59
- 0
config/routes.js Dosyayı Görüntüle

@@ -42,6 +42,65 @@ export default [
42 42
       },
43 43
     ],
44 44
   },
45
+  {
46
+    path: '/',
47
+    name: '消息管理',
48
+    icon: 'crown',
49
+    component: '../layouts/BasicLayout',
50
+    routes: [
51
+      {
52
+        path: '/PlatformMessageManagement/MessageManageList',
53
+        name: '平台消息管理',
54
+        icon: 'smile',
55
+        component: './PlatformMessageManagement/MessageManageList',
56
+      },
57
+      {
58
+        path: '/PlatformMessageManagement/MessageEdit',
59
+        name: '消息查看',
60
+        component: './PlatformMessageManagement/MessageEdit',
61
+        hideInMenu: true
62
+      },
63
+
64
+    ],
65
+  },
66
+  {
67
+    path: '/SystemManagement',
68
+    name: '系统管理',
69
+    icon: 'crown',
70
+    component: '../layouts/BasicLayout',
71
+    routes: [
72
+      {
73
+        path: '/SystemManagement/Administrator',
74
+        name: '管理员',
75
+        icon: 'smile',
76
+        component: './SystemManagement/Administrator',
77
+      },
78
+      {
79
+        path: '/SystemManagement/UserRights',
80
+        name: '角色权限',
81
+        component: './SystemManagement/UserRights',
82
+      },
83
+      {
84
+        path: '/SystemManagement/BasicParameters',
85
+        name: '基本参数',
86
+        component: './SystemManagement/BasicParameters',
87
+      },
88
+      {
89
+        path: '/SystemManagement/MapExtent',
90
+        name: '区域设置',
91
+        component: './SystemManagement/MapExtent',
92
+        // hideInMenu: true
93
+      },
94
+      {
95
+        path: '/SystemManagement/Agreement',
96
+        name: '协议对接',
97
+        component: './SystemManagement/Agreement',
98
+        // hideInMenu: true
99
+      },
100
+
101
+    ],
102
+  },
103
+
45 104
   {
46 105
     name: 'list.table-list',
47 106
     icon: 'table',

+ 15
- 4
package.json Dosyayı Görüntüle

@@ -37,11 +37,18 @@
37 37
   "lint-staged": {
38 38
     "**/*.less": "stylelint --syntax less",
39 39
     "**/*.{js,jsx,ts,tsx}": "npm run lint-staged:js",
40
-    "**/*.{js,jsx,tsx,ts,less,md,json}": ["prettier --write"]
40
+    "**/*.{js,jsx,tsx,ts,less,md,json}": [
41
+      "prettier --write"
42
+    ]
41 43
   },
42
-  "browserslist": ["> 1%", "last 2 versions", "not ie <= 10"],
44
+  "browserslist": [
45
+    "> 1%",
46
+    "last 2 versions",
47
+    "not ie <= 10"
48
+  ],
43 49
   "dependencies": {
44 50
     "@ant-design/icons": "^4.7.0",
51
+    "@ant-design/pro-card": "^1.18.34",
45 52
     "@ant-design/pro-descriptions": "^1.10.0",
46 53
     "@ant-design/pro-form": "^1.52.0",
47 54
     "@ant-design/pro-layout": "^6.32.0",
@@ -97,6 +104,10 @@
97 104
     "typescript": "^4.5.0",
98 105
     "umi-serve": "^1.9.10"
99 106
   },
100
-  "engines": { "node": ">=10.0.0" },
101
-  "gitHooks": { "commit-msg": "fabric verify-commit" }
107
+  "engines": {
108
+    "node": ">=10.0.0"
109
+  },
110
+  "gitHooks": {
111
+    "commit-msg": "fabric verify-commit"
112
+  }
102 113
 }

+ 1
- 0
src/layouts/BasicLayout.jsx Dosyayı Görüntüle

@@ -0,0 +1 @@
1
+export default props => props.children

+ 52
- 0
src/pages/PlatformMessageManagement/MessageEdit/index.jsx Dosyayı Görüntüle

@@ -0,0 +1,52 @@
1
+import { Input, Card, InputNumber, 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
+
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="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="推送方式" name="phone" >
41
+              <Input placeholder="请输入" style={{ width: '350px' }} />
42
+            </FormItem>
43
+            <FormItem label=" " colon={false} >
44
+              <Button type='default' onClick={() => goBack()} >返回</Button>
45
+              <Button type='primary' loading={loading} htmlType="Submit" style={{ marginLeft: '4em' }}>保存</Button>
46
+            </FormItem>
47
+          </Form>
48
+        </ProCard.TabPane>
49
+      </ProCard>
50
+    </Card>
51
+  )
52
+}

+ 119
- 0
src/pages/PlatformMessageManagement/MessageManageList/index.jsx Dosyayı Görüntüle

@@ -0,0 +1,119 @@
1
+import { history, Link } from 'umi';
2
+import { useRef, useState, useEffect } from 'react';
3
+import { Button, Popconfirm, message, Tooltip } from 'antd';
4
+import { PlusOutlined, QuestionCircleOutlined, DownOutlined } from '@ant-design/icons';
5
+import { PageHeaderWrapper } from '@ant-design/pro-layout';
6
+import ProTable from '@ant-design/pro-table';
7
+
8
+
9
+
10
+export default (props) => {
11
+  const dataSource = [
12
+    {
13
+      key: '1',
14
+      name: '胡彦斌',
15
+      age: 32,
16
+      address: '西湖区湖底公园1号',
17
+    },
18
+    {
19
+      key: '2',
20
+      name: '胡彦祖',
21
+      age: 42,
22
+      address: '西湖区湖底公园1号',
23
+    },
24
+  ];
25
+
26
+  const actions = () => [
27
+    <Button key='add' type="primary" icon={<PlusOutlined />} onClick={() => gotoDetail()}>新增商户</Button>,
28
+  ]
29
+  const columns = [
30
+    {
31
+      title: '消息ID',
32
+
33
+      key: 'id',
34
+      dataIndex: 'id',
35
+      search: false,
36
+
37
+      render: (t, record) => <Link key={1} to={`./edit?id=${record.shopId}`}>{record.shopName}</Link>,
38
+
39
+    },
40
+
41
+    {
42
+      title: '消息标题',
43
+      dataIndex: 'packageNum',
44
+      render: (t, record) => <Link key={1} to={`./package?shopId=${record.shopId}`}>{record?.packageNum}</Link>,
45
+    },
46
+
47
+    {
48
+      title: '推送对象',
49
+      search: false,
50
+      dataIndex: 'packageNum',
51
+      render: (t, record) => record.status === 1 ? '农机手' : '农户',
52
+
53
+    },
54
+
55
+
56
+    {
57
+      title: '推送方式',
58
+      key: 'status',
59
+      dataIndex: 'status',
60
+      // render: (t, record) => record.status === 1 ? '发布' : '未发布',
61
+      formItemProps: { label: '推送方式' },
62
+      valueType: 'select',
63
+      valueEnum: {
64
+        0: { text: '通知栏推送', },
65
+        1: { text: 'APP内消息中心推送', },
66
+        2: { text: '短信推送', },
67
+      }
68
+    },
69
+
70
+    {
71
+      title: (
72
+        <>
73
+          创建时间
74
+          <Tooltip placement="top" >
75
+            <QuestionCircleOutlined style={{ marginLeft: 4 }} />
76
+          </Tooltip>
77
+        </>
78
+      ),
79
+      width: 140,
80
+      key: 'since',
81
+      dataIndex: 'createdAt',
82
+      valueType: 'date',
83
+      // render: (t) => formatterTime(t),
84
+      sorter: (a, b) => a.createdAt - b.createdAt,
85
+    },
86
+
87
+    {
88
+      title: '操作',
89
+      valueType: 'option',
90
+      width: '300px',
91
+      render: (_, record) => [
92
+        <Link key={2} to={`./MessageEdit`}>查看</Link>,
93
+        <Popconfirm
94
+          key={3}
95
+          title="您是否确认删除 ?"
96
+          onConfirm={() => handleDelete(record.noticeId)}
97
+          okText="确定"
98
+          cancelText="取消"
99
+        >
100
+          <a href="#">删除</a>
101
+        </Popconfirm>,
102
+      ]
103
+    },
104
+  ]
105
+
106
+  return (
107
+    <PageHeaderWrapper>
108
+      <ProTable
109
+        dataSource={dataSource}
110
+        columns={columns}
111
+        // request={getList}
112
+        rowKey="shopId"
113
+        options={false}
114
+        toolBarRender={actions}
115
+        scroll={{ x: 1000 }}
116
+      />
117
+    </PageHeaderWrapper>
118
+  )
119
+}

+ 0
- 0
src/pages/PlatformMessageManagement/MessageManageList/index.less Dosyayı Görüntüle


+ 52
- 0
src/pages/SystemManagement/Administrator/index.jsx Dosyayı Görüntüle

@@ -0,0 +1,52 @@
1
+import { Input, Card, InputNumber, 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
+
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="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="推送方式" name="phone" >
41
+              <Input placeholder="请输入" style={{ width: '350px' }} />
42
+            </FormItem>
43
+            <FormItem label=" " colon={false} >
44
+              <Button type='default' onClick={() => goBack()} >返回</Button>
45
+              <Button type='primary' loading={loading} htmlType="Submit" style={{ marginLeft: '4em' }}>保存</Button>
46
+            </FormItem>
47
+          </Form>
48
+        </ProCard.TabPane>
49
+      </ProCard>
50
+    </Card>
51
+  )
52
+}

+ 5
- 0
src/pages/SystemManagement/Agreement/index.jsx Dosyayı Görüntüle

@@ -0,0 +1,5 @@
1
+export default (props) => {
2
+  return (
3
+    <div>协议对接</div>
4
+  )
5
+}

+ 5
- 0
src/pages/SystemManagement/BasicParameters/index.jsx Dosyayı Görüntüle

@@ -0,0 +1,5 @@
1
+export default (props) => {
2
+  return (
3
+    <div>基本参数</div>
4
+  )
5
+}

+ 7
- 0
src/pages/SystemManagement/MapExtent/index.jsx Dosyayı Görüntüle

@@ -0,0 +1,7 @@
1
+
2
+
3
+export default (props) => {
4
+  return (
5
+    <div>区域范围</div>
6
+  )
7
+}

+ 7
- 0
src/pages/SystemManagement/UserRights/index.jsx Dosyayı Görüntüle

@@ -0,0 +1,7 @@
1
+
2
+
3
+export default (props) => {
4
+  return (
5
+    <div>用户权限</div>
6
+  )
7
+}