瀏覽代碼

CMS管理

[baozhangchao] 3 年之前
父節點
當前提交
a80f1d5808

+ 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;

+ 50
- 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
       {
@@ -85,7 +85,7 @@ export default [
85 85
   {
86 86
     path: '/MonitoringScreen',
87 87
     name: '农机监控大屏',
88
-    icon: 'InsertRowLeftOutlined',
88
+    icon: 'DesktopOutlined',
89 89
     component: '../layouts/BasicLayout',
90 90
     routes: [
91 91
       {
@@ -117,7 +117,7 @@ export default [
117 117
   {
118 118
     path: '/OrderManage',
119 119
     name: '订单调度',
120
-    icon: 'InsertRowLeftOutlined',
120
+    icon: 'PhoneOutlined',
121 121
     component: '../layouts/BasicLayout',
122 122
     routes: [
123 123
       {
@@ -130,7 +130,7 @@ export default [
130 130
   {
131 131
     path: '/JobWarning',
132 132
     name: '作业预警',
133
-    icon: 'InsertRowLeftOutlined',
133
+    icon: 'AlertOutlined',
134 134
     component: '../layouts/BasicLayout',
135 135
     routes: [
136 136
       {
@@ -143,7 +143,7 @@ export default [
143 143
   {
144 144
     path: '/JobStatistics',
145 145
     name: '作业统计',
146
-    icon: 'InsertRowLeftOutlined',
146
+    icon: 'ScheduleOutlined',
147 147
     component: '../layouts/BasicLayout',
148 148
     routes: [
149 149
       {
@@ -166,7 +166,7 @@ export default [
166 166
   {
167 167
     path: '/Finance',
168 168
     name: '财务管理',
169
-    icon: 'InsertRowLeftOutlined',
169
+    icon: 'DollarOutlined',
170 170
     component: '../layouts/BasicLayout',
171 171
     routes: [
172 172
       {
@@ -184,7 +184,7 @@ export default [
184 184
   {
185 185
     path: '/SystemManagement',
186 186
     name: '系统管理',
187
-    icon: 'crown',
187
+    icon: 'SettingOutlined',
188 188
     component: '../layouts/BasicLayout',
189 189
     routes: [
190 190
       {
@@ -225,6 +225,48 @@ export default [
225 225
       },
226 226
     ],
227 227
   },
228
+  {
229
+    path: '/ContentManagementSystem',
230
+    name: 'CMS管理',
231
+    icon: 'MediumOutlined',
232
+    component: '../layouts/BasicLayout',
233
+    routes: [
234
+      {
235
+        path: '/ContentManagementSystem/InformationClassification',
236
+        name: '资讯分类',
237
+        component: './ContentManagementSystem/InformationClassification',
238
+      },
239
+      {
240
+        path: '/ContentManagementSystem/InformationClassification/InformationClassificationEdit',
241
+        name: '资讯分类编辑',
242
+        component: './ContentManagementSystem/InformationClassification/InformationClassificationEdit',
243
+        hideInMenu: true
244
+      },
245
+      {
246
+        path: '/ContentManagementSystem/InformationList',
247
+        name: '资讯列表',
248
+        component: './ContentManagementSystem/InformationList',
249
+      },
250
+      {
251
+        path: '/ContentManagementSystem/InformationList/InformationListEdit',
252
+        name: '资讯列表编辑',
253
+        component: './ContentManagementSystem/InformationList/InformationListEdit',
254
+        hideInMenu: true
255
+
256
+      },
257
+      {
258
+        path: '/ContentManagementSystem/BannerClassification',
259
+        name: 'Banner资讯',
260
+        component: './ContentManagementSystem/BannerClassification',
261
+      }, {
262
+        path: '/ContentManagementSystem/BannerClassification/BannerClassificationEdit',
263
+        name: 'Banner资讯编辑',
264
+        component: './ContentManagementSystem/BannerClassification/BannerClassificationEdit',
265
+        hideInMenu: true
266
+
267
+      },
268
+    ],
269
+  },
228 270
   {
229 271
     path: '/',
230 272
     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
+}

+ 134
- 0
src/pages/ContentManagementSystem/BannerClassification/index.jsx 查看文件

@@ -0,0 +1,134 @@
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
+      initialValue: 'Success',
75
+      valueEnum: {
76
+        online: { text: '已发布', status: 'Success' },
77
+        error: { text: '未发布', status: 'Error' },
78
+      }
79
+    },
80
+
81
+    {
82
+      title: (
83
+        <>
84
+          创建时间
85
+          <Tooltip placement="top">
86
+            <QuestionCircleOutlined style={{ marginLeft: 4 }} />
87
+          </Tooltip>
88
+        </>
89
+      ),
90
+      // hideInTable: true,
91
+      search: false,
92
+
93
+      key: 'createdAt',
94
+      dataIndex: 'createdAt',
95
+      valueType: 'date',
96
+      // render: (t) => formatterTime(t),
97
+      sorter: (a, b) => a.createdAt - b.createdAt,//时间排序
98
+    },
99
+    {
100
+      title: '操作',
101
+      valueType: 'option',
102
+      key: 'option',
103
+      ellipsis: true,
104
+      width: 200,
105
+      render: (_, record) => [
106
+        <Link key={2} to={`BannerClassification/BannerClassificationEdit`}>编辑</Link>,
107
+        <Popconfirm
108
+          key={3}
109
+          title="您是否确认删除 ?"
110
+          onConfirm={() => handleDelete(record)}
111
+          okText="确定"
112
+          cancelText="取消"
113
+        >
114
+          <a href="#"  >删除</a>
115
+        </Popconfirm>,
116
+      ]
117
+    },
118
+  ]
119
+
120
+  return (
121
+    <PageHeaderWrapper>
122
+      <ProTable
123
+        dataSource={dataSource}
124
+        columns={columns}
125
+        // request={getNoteList} 请求
126
+        // rowKey="noteId"
127
+        search={false}
128
+        options={false}
129
+        toolBarRender={actions}
130
+        actionRef={actionRef}
131
+      />
132
+    </PageHeaderWrapper>
133
+  )
134
+}

+ 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
+}

+ 71
- 0
src/pages/ContentManagementSystem/InformationList/InformationListEdit/index.jsx 查看文件

@@ -0,0 +1,71 @@
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="资讯内容" name="shaopName" rules={[{ required: true, message: '请输入' }]}>
49
+              <Input placeholder="请输入" style={{ width: '350px' }} />
50
+            </FormItem>
51
+            <FormItem label="发布状态" name="usser" rules={[{ required: true, message: '请选择' }]}>
52
+              <Select
53
+                placeholder="请选择"
54
+                // onChange={onGenderChange}
55
+                allowClear
56
+                style={{ width: '350px' }}
57
+              >
58
+                <Option value="nongji">发布</Option>
59
+                <Option value="nonghu">未发布</Option>
60
+              </Select>
61
+            </FormItem>
62
+            <FormItem label=" " colon={false} >
63
+              <Button type='default' onClick={() => goBack()} >返回</Button>
64
+              <Button type='primary' loading={loading} htmlType="Submit" style={{ marginLeft: '4em' }}>保存</Button>
65
+            </FormItem>
66
+          </Form>
67
+        </ProCard.TabPane>
68
+      </ProCard>
69
+    </Card>
70
+  )
71
+}

+ 137
- 0
src/pages/ContentManagementSystem/InformationList/index.jsx 查看文件

@@ -0,0 +1,137 @@
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
+      initialValue: 'Success',
96
+      valueEnum: {
97
+        online: { text: '已发布', status: 'Success' },
98
+        error: { text: '未发布', status: 'Error' },
99
+      }
100
+    },
101
+
102
+    {
103
+      title: '操作',
104
+      valueType: 'option',
105
+      key: 'option',
106
+      ellipsis: true,
107
+      width: 200,
108
+      render: (_, record) => [
109
+        <Link key={2} to={`InformationList/InformationListEdit`}>编辑</Link>,
110
+        <Popconfirm
111
+          key={3}
112
+          title="您是否确认删除 ?"
113
+          onConfirm={() => handleDelete(record)}
114
+          okText="确定"
115
+          cancelText="取消"
116
+        >
117
+          <a href="#"  >删除</a>
118
+        </Popconfirm>,
119
+      ]
120
+    },
121
+  ]
122
+
123
+  return (
124
+    <PageHeaderWrapper>
125
+      <ProTable
126
+        dataSource={dataSource}
127
+        columns={columns}
128
+        // request={getNoteList} 请求
129
+        // rowKey="noteId"
130
+        search={false}
131
+        options={false}
132
+        toolBarRender={actions}
133
+        actionRef={actionRef}
134
+      />
135
+    </PageHeaderWrapper>
136
+  )
137
+}