|
@@ -0,0 +1,132 @@
|
|
1
|
+import React, { useState, useEffect } from 'react'
|
|
2
|
+import { Select, Spin, Table, Button, Form, Input } from 'antd'
|
|
3
|
+import NavLink from 'umi/navlink'
|
|
4
|
+import { fetchList, apis } from '@/utils/request'
|
|
5
|
+import Search from '../components/Search'
|
|
6
|
+import List from '../components/List'
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+const Condition = props => {
|
|
10
|
+ return (
|
|
11
|
+ <Search
|
|
12
|
+ onSearch={props.onSearch}
|
|
13
|
+ onReset={props.onReset}
|
|
14
|
+ render={form => {
|
|
15
|
+ const { getFieldDecorator, setFieldsValue } = form
|
|
16
|
+
|
|
17
|
+ return (
|
|
18
|
+ <>
|
|
19
|
+ <Form.Item label="公告编号">
|
|
20
|
+ {
|
|
21
|
+ getFieldDecorator('announcementNumber')(<Input placeholder="公告编号" />)
|
|
22
|
+ }
|
|
23
|
+ </Form.Item>
|
|
24
|
+ <Form.Item label="公告标题">
|
|
25
|
+ {
|
|
26
|
+ getFieldDecorator('announcementTitle')(<Input placeholder="公告标题" />)
|
|
27
|
+ }
|
|
28
|
+ </Form.Item>
|
|
29
|
+ </>
|
|
30
|
+ )
|
|
31
|
+ }}
|
|
32
|
+ />
|
|
33
|
+ )
|
|
34
|
+}
|
|
35
|
+
|
|
36
|
+const StatusDict = {
|
|
37
|
+ '0': '已作废',
|
|
38
|
+ '1': '已发布',
|
|
39
|
+ '2': '草稿'
|
|
40
|
+}
|
|
41
|
+
|
|
42
|
+export default props => {
|
|
43
|
+ const [loading, setLoading] = useState(false)
|
|
44
|
+ const [listData, setListData] = useState([])
|
|
45
|
+
|
|
46
|
+ const handleSearch = () => {
|
|
47
|
+
|
|
48
|
+ }
|
|
49
|
+
|
|
50
|
+ const handleDeleteRow = row => {
|
|
51
|
+
|
|
52
|
+ }
|
|
53
|
+
|
|
54
|
+ const handlePageChange = (pageNum, pageSize) => {
|
|
55
|
+
|
|
56
|
+ }
|
|
57
|
+
|
|
58
|
+ return (
|
|
59
|
+ <div>
|
|
60
|
+ <Condition onSearch={handleSearch} onReset={handleSearch} />
|
|
61
|
+ <div style={{ margin: '24px 0' }}>
|
|
62
|
+ <NavLink to={`/xxx`}>
|
|
63
|
+ <Button type="primary">添加</Button>
|
|
64
|
+ </NavLink>
|
|
65
|
+ <Button style={{ marginLeft: '24px' }}>修改</Button>
|
|
66
|
+ <Button type="danger" style={{ marginLeft: '24px' }}>修改</Button>
|
|
67
|
+ </div>
|
|
68
|
+ <Spin spinning={loading}>
|
|
69
|
+ <List dataSource={listData} onPageChange={handlePageChange} rowKey="id">
|
|
70
|
+ <Table.Column title="编号" dataIndex="id" key="id" />
|
|
71
|
+ <Table.Column
|
|
72
|
+ title="标题"
|
|
73
|
+ dataIndex="announcementTitle"
|
|
74
|
+ key="announcementTitle"
|
|
75
|
+ render={(_, row) => {
|
|
76
|
+ return (
|
|
77
|
+ <NavLink to={`/xxx?id=${row.id}`}>
|
|
78
|
+ <Button type="link">{row.announcementTitle}</Button>
|
|
79
|
+ </NavLink>
|
|
80
|
+ )
|
|
81
|
+ }}
|
|
82
|
+ />
|
|
83
|
+ <Table.Column title="查看数量" dataIndex="viewCount" key="viewCount" />
|
|
84
|
+ <Table.Column
|
|
85
|
+ title="状态"
|
|
86
|
+ dataIndex="status"
|
|
87
|
+ key="status"
|
|
88
|
+ render={(_, row) => {
|
|
89
|
+ if (row.status === '1' && (row.updateDate > row.createDate)) {
|
|
90
|
+ return '已修改'
|
|
91
|
+ }
|
|
92
|
+
|
|
93
|
+ return StatusDict[row.status]
|
|
94
|
+ }}
|
|
95
|
+ />
|
|
96
|
+ <Table.Column title="身份" dataIndex="roleName" key="roleName" />
|
|
97
|
+ <Table.Column
|
|
98
|
+ title="审核状态"
|
|
99
|
+ dataIndex="verifyStatus"
|
|
100
|
+ key="verifyStatus"
|
|
101
|
+ render={(_, row) => {
|
|
102
|
+ return (
|
|
103
|
+ <span>
|
|
104
|
+ {verifyStatusDict[row.verifyStatus] || ''}
|
|
105
|
+ </span>
|
|
106
|
+ )
|
|
107
|
+ }}
|
|
108
|
+ />
|
|
109
|
+ <Table.Column title="编辑人" dataIndex="updateName" key="updateName" />
|
|
110
|
+ <Table.Column title="编辑时间" dataIndex="createDate" key="createDate" />
|
|
111
|
+ <Table.Column
|
|
112
|
+ title="操作"
|
|
113
|
+ key="action"
|
|
114
|
+ render={(_, row) => {
|
|
115
|
+ return (
|
|
116
|
+ <Popconfirm
|
|
117
|
+ title="确认进行删除操作?"
|
|
118
|
+ onConfirm={() => handleDeleteRow(row)}
|
|
119
|
+ okText="删除"
|
|
120
|
+ cancelText="取消"
|
|
121
|
+ >
|
|
122
|
+ <Button type="link">删除</Button>
|
|
123
|
+ </Popconfirm>
|
|
124
|
+ )
|
|
125
|
+ }}
|
|
126
|
+ />
|
|
127
|
+ </List>
|
|
128
|
+ </Spin>
|
|
129
|
+
|
|
130
|
+ </div>
|
|
131
|
+ )
|
|
132
|
+}
|