Yansen 2 年前
父节点
当前提交
1711ac479b
共有 3 个文件被更改,包括 173 次插入2 次删除
  1. 82
    0
      src/pages/message/index.jsx
  2. 86
    2
      src/pages/user/Edit.jsx
  3. 5
    0
      src/services/message.js

+ 82
- 0
src/pages/message/index.jsx 查看文件

@@ -0,0 +1,82 @@
1
+import React from 'react';
2
+import { useNavigate } from 'react-router-dom';
3
+import { queryTable } from '@/utils/request';
4
+import { ProTable } from '@ant-design/pro-components';
5
+import { Button, message, Popconfirm } from 'antd';
6
+import { getMessageList } from '@/services/message';
7
+
8
+const queryMessage = queryTable(getMessageList);
9
+
10
+export default (props) => {
11
+  const columns = [
12
+    {
13
+      title: 'id',
14
+      dataIndex: 'id',
15
+      search: false,
16
+    },
17
+    {
18
+      title: '时间',
19
+      dataIndex: 'createDate',
20
+      valueType: 'date',
21
+      search: false,
22
+    },
23
+    {
24
+      title: '时间',
25
+      dataIndex: 'createDate',
26
+      valueType: 'dateRange',
27
+      hideInTable: true,
28
+      search: {
29
+        transform: (value) => {
30
+          return {
31
+            startDate: value[0],
32
+            endDate: value[1],
33
+          };
34
+        },
35
+      },
36
+    },
37
+    {
38
+      title: '内容',
39
+      dataIndex: 'message',
40
+    },
41
+    {
42
+      title: '状态',
43
+      dataIndex: 'isReaded',
44
+      search: false,
45
+      valueEnum: {
46
+        1: {
47
+          text: '已读',
48
+          status: 'Processing',
49
+        },
50
+        0: {
51
+          text: '未读',
52
+          status: 'Error',
53
+        },
54
+      },
55
+    },
56
+    {
57
+      title: '操作',
58
+      valueType: 'option',
59
+      width: 200,
60
+      render: (_, record) => [
61
+        <Button
62
+          key={2}
63
+          style={{ padding: 0 }}
64
+          type="link"
65
+          onClick={() => {
66
+            navigate(`/system/message/detail?id=${record.id}`);
67
+          }}
68
+        >
69
+          详情
70
+        </Button>,
71
+      ],
72
+    },
73
+  ]
74
+
75
+  return (
76
+    <ProTable
77
+      rowKey="id"
78
+      request={queryMessage}
79
+      columns={columns}
80
+    />
81
+  )
82
+}

+ 86
- 2
src/pages/user/Edit.jsx 查看文件

@@ -105,12 +105,96 @@ export default (props) => {
105 105
         >
106 106
           <Input />
107 107
         </Form.Item>
108
-        <Form.Item label="账号">
108
+        <Form.Item
109
+          name="sex"
110
+          label="性别"
111
+        >
112
+          <Select
113
+            style={{ width: '100%' }}
114
+            placeholder="请选择性别"
115
+          >
116
+            <Option key={1}>男</Option>
117
+            <Option key={2}>女</Option>
118
+            <Option key={9}>未知</Option>
119
+          </Select>
120
+        </Form.Item>
121
+        <Form.Item
122
+          name="ethnic"
123
+          label="民族"
124
+        >
125
+          <Input />
126
+        </Form.Item>
127
+        <Form.Item
128
+          name="bloodType"
129
+          label="血型"
130
+        >
131
+          <Select
132
+            style={{ width: '100%' }}
133
+            placeholder="请选择血型"
134
+          >
135
+            <Option key="A">A型</Option>
136
+            <Option key="B">B型</Option>
137
+            <Option key="O">O型</Option>
138
+            <Option key="AB">AB型</Option>
139
+          </Select>
140
+        </Form.Item>
141
+        <Form.Item
142
+          name="idNo"
143
+          label="身份证号"
144
+        >
145
+          <Input />
146
+        </Form.Item>
147
+        <Form.Item
148
+          name="education"
149
+          label="文化程度"
150
+        >
151
+          <Select
152
+            style={{ width: '100%' }}
153
+            placeholder="请选择文化程度"
154
+          >
155
+            <Option value="半文盲">半文盲</Option>
156
+            <Option value="文盲">文盲</Option>
157
+            <Option value="小学">小学</Option>
158
+            <Option value="初中">初中</Option>
159
+            <Option value="高中">高中</Option>
160
+            <Option value="中专">中专</Option>
161
+            <Option value="大专">大专</Option>
162
+            <Option value="本科">本科</Option>
163
+            <Option value="硕士">硕士</Option>
164
+            <Option value="博士">博士</Option>
165
+            <Option value="博士后">博士后</Option>
166
+          </Select>
167
+        </Form.Item>
168
+        <Form.Item
169
+          name="politicalStatus"
170
+          label="政治面貌"
171
+        >
172
+          <Input />
173
+        </Form.Item>
174
+        <Form.Item
175
+          name="position"
176
+          label="工作岗位"
177
+        >
178
+          <Input />
179
+        </Form.Item>
180
+        <Form.Item
181
+          name="budgetedPosts"
182
+          label="编制性质"
183
+        >
184
+          <Input />
185
+        </Form.Item>
186
+        <Form.Item
187
+          name="politicalLevel"
188
+          label="行政级别"
189
+        >
190
+          <Input />
191
+        </Form.Item>
192
+        <Form.Item label="系统账号">
109 193
           系统账号与手机号相同
110 194
         </Form.Item>
111 195
         <Form.Item
112 196
           name="password"
113
-          label="密码"
197
+          label="密 码"
114 198
           extra={id ? '填写密码意味着重置该账户密码' : '默认密码 123456'}
115 199
           hasFeedback
116 200
         >

+ 5
- 0
src/services/message.js 查看文件

@@ -0,0 +1,5 @@
1
+import { restful } from '@/utils/request';
2
+
3
+const [
4
+  getMessageList,
5
+] = restful("/noticeMessage");