|
@@ -0,0 +1,237 @@
|
|
1
|
+import React, { useState, useEffect } from 'react';
|
|
2
|
+import { Form, Input, Button, Icon, Select, message, Table, Divider, Tag, Pagination, Modal, DatePicker } from 'antd';
|
|
3
|
+import router from 'umi/router';
|
|
4
|
+import { FormattedMessage } from 'umi-plugin-react/locale';
|
|
5
|
+import styles from '../../style/GoodsList.less';
|
|
6
|
+
|
|
7
|
+const changeNewsListStatus = (newsId) => () => {
|
|
8
|
+ Modal.confirm({
|
|
9
|
+ title: '确认删除该引流?',
|
|
10
|
+ okText: '确认',
|
|
11
|
+ cancelText: '取消',
|
|
12
|
+ onOk() {
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+ }
|
|
16
|
+ });
|
|
17
|
+}
|
|
18
|
+
|
|
19
|
+const toEditList = (newsId) => () => {
|
|
20
|
+ router.push({
|
|
21
|
+ pathname: '/activity/drainage/Detail',
|
|
22
|
+ // query: {
|
|
23
|
+ // newsId
|
|
24
|
+ // },
|
|
25
|
+ });
|
|
26
|
+}
|
|
27
|
+
|
|
28
|
+const columns = [
|
|
29
|
+ {
|
|
30
|
+ title: 'H5项目编号',
|
|
31
|
+ dataIndex: 'Id',
|
|
32
|
+ key: 'Id',
|
|
33
|
+
|
|
34
|
+ },
|
|
35
|
+ {
|
|
36
|
+ title: 'H5项目名称',
|
|
37
|
+ dataIndex: 'name',
|
|
38
|
+ key: 'name',
|
|
39
|
+ },
|
|
40
|
+ {
|
|
41
|
+ title: '字段1',
|
|
42
|
+ dataIndex: 'field1',
|
|
43
|
+ key: 'field1',
|
|
44
|
+ },
|
|
45
|
+ {
|
|
46
|
+ title: '字段2',
|
|
47
|
+ dataIndex: 'field2',
|
|
48
|
+ key: 'field2',
|
|
49
|
+ },
|
|
50
|
+ {
|
|
51
|
+ title: '新建时间',
|
|
52
|
+ dataIndex: 'StartTime',
|
|
53
|
+ key: 'StartTime',
|
|
54
|
+ // render:
|
|
55
|
+ },
|
|
56
|
+ {
|
|
57
|
+ title: '截止时间',
|
|
58
|
+ dataIndex: 'EndTime',
|
|
59
|
+ key: 'EndTime',
|
|
60
|
+ // render:
|
|
61
|
+ },
|
|
62
|
+ {
|
|
63
|
+ title: '参与数',
|
|
64
|
+ dataIndex: 'number',
|
|
65
|
+ key: 'number',
|
|
66
|
+ // render:
|
|
67
|
+ },
|
|
68
|
+ {
|
|
69
|
+ title: '操作',
|
|
70
|
+ key: 'action',
|
|
71
|
+ render: (text, record) => (
|
|
72
|
+ <>
|
|
73
|
+ <span style={{ right: '20px', top: '20px', fontSize: ' 0.106rem',zIndex:1, color: '#FF7E48', cursor: 'pointer' }} onClick={toEditList()}>
|
|
74
|
+ 查看详情
|
|
75
|
+ </span>
|
|
76
|
+
|
|
77
|
+ <span style={{ right: '20px', bottom: ' 10px', fontSize: ' 0.106rem', color: '#FF7E48', cursor: 'pointer', marginLeft:20}} onClick={changeNewsListStatus()}>
|
|
78
|
+ 删除
|
|
79
|
+ </span>
|
|
80
|
+ </>
|
|
81
|
+ ),
|
|
82
|
+ },
|
|
83
|
+];
|
|
84
|
+
|
|
85
|
+const data = [
|
|
86
|
+
|
|
87
|
+ {
|
|
88
|
+ Id:'1',
|
|
89
|
+ name:'zls',
|
|
90
|
+ // StartTime:'',
|
|
91
|
+ // EndTime:'',
|
|
92
|
+ number: 33,
|
|
93
|
+ }
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+];
|
|
97
|
+
|
|
98
|
+const header = (props) => {
|
|
99
|
+ // const [data, setData] = useState({ data: [] })
|
|
100
|
+ const [ date, setDate ] = useState({})
|
|
101
|
+ // const [page, changePage] = useState({})
|
|
102
|
+ useEffect(() => {
|
|
103
|
+ setDate({
|
|
104
|
+ ModalText: 'Content of the modal',
|
|
105
|
+ visible: false,
|
|
106
|
+ confirmLoading: false,
|
|
107
|
+ })
|
|
108
|
+ },[])
|
|
109
|
+
|
|
110
|
+ const handleSubmit = (e, props) => {
|
|
111
|
+ e.preventDefault();
|
|
112
|
+ props.form.validateFields((err, values) => {
|
|
113
|
+ // if (!err) {
|
|
114
|
+ // console.log('提交数据: ', values)
|
|
115
|
+ // getList({ pageNum: 1, pageSize: 10, ...values })
|
|
116
|
+ // }
|
|
117
|
+ });
|
|
118
|
+ }
|
|
119
|
+
|
|
120
|
+ //重置搜索
|
|
121
|
+ function handleReset() {
|
|
122
|
+ props.form.resetFields();
|
|
123
|
+ }
|
|
124
|
+
|
|
125
|
+const toEditGoods = (dynamicId) => () => {
|
|
126
|
+ // router.push({
|
|
127
|
+ // pathname: '/activity/editActivity',
|
|
128
|
+ // query: {
|
|
129
|
+ // dynamicId
|
|
130
|
+ // },
|
|
131
|
+ // });
|
|
132
|
+}
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+function showModal () {
|
|
136
|
+ setDate({
|
|
137
|
+ visible: true,
|
|
138
|
+ });
|
|
139
|
+};
|
|
140
|
+
|
|
141
|
+function handleOk () {
|
|
142
|
+ setDate({
|
|
143
|
+ ModalText: 'The modal will be closed after two seconds',
|
|
144
|
+ confirmLoading: true,
|
|
145
|
+ });
|
|
146
|
+ function setTimeout() {
|
|
147
|
+ setDate({
|
|
148
|
+ visible: false,
|
|
149
|
+ confirmLoading: false,
|
|
150
|
+ });
|
|
151
|
+ };
|
|
152
|
+};
|
|
153
|
+
|
|
154
|
+function handleCancel (){
|
|
155
|
+ console.log('Clicked cancel button');
|
|
156
|
+ setDate({
|
|
157
|
+ visible: false,
|
|
158
|
+ });
|
|
159
|
+};
|
|
160
|
+
|
|
161
|
+ const { getFieldDecorator } = props.form
|
|
162
|
+ const { visible, confirmLoading, ModalText } = date;
|
|
163
|
+ return (
|
|
164
|
+ <>
|
|
165
|
+ <div>
|
|
166
|
+ <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
|
|
167
|
+ <Form.Item>
|
|
168
|
+ {getFieldDecorator('Id')(
|
|
169
|
+ <Input
|
|
170
|
+ // prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
|
|
171
|
+ placeholder="H5项目编号"
|
|
172
|
+ />,
|
|
173
|
+ )}
|
|
174
|
+ </Form.Item>
|
|
175
|
+ <Form.Item>
|
|
176
|
+ {getFieldDecorator('name')(
|
|
177
|
+ <Input
|
|
178
|
+ // prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
|
|
179
|
+ placeholder="H5项目名称"
|
|
180
|
+ />,
|
|
181
|
+ )}
|
|
182
|
+ </Form.Item>
|
|
183
|
+ <Form.Item>
|
|
184
|
+ <Button type="primary" htmlType="submit" className={styles.searchBtn}>
|
|
185
|
+ 搜索
|
|
186
|
+ </Button>
|
|
187
|
+ <Button style={{ marginLeft: 8 }} onClick={handleReset}>
|
|
188
|
+ 重置
|
|
189
|
+ </Button>
|
|
190
|
+ </Form.Item>
|
|
191
|
+ </Form>
|
|
192
|
+ {/* <AuthButton name="admin.buildingDynamic.add.post" noRight={null}> */}
|
|
193
|
+ <Button type="danger" className={styles.addBtn} onClick={showModal}>新增</Button>
|
|
194
|
+
|
|
195
|
+ <Modal
|
|
196
|
+ title="新建H5项目"
|
|
197
|
+ visible={visible}
|
|
198
|
+ onOk={handleOk}
|
|
199
|
+ confirmLoading={confirmLoading}
|
|
200
|
+ onCancel={handleCancel}
|
|
201
|
+ >
|
|
202
|
+ <Form>
|
|
203
|
+ <Form.Item>
|
|
204
|
+ {getFieldDecorator('name')(
|
|
205
|
+ <Input
|
|
206
|
+ // prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
|
|
207
|
+ placeholder="H5项目名称"
|
|
208
|
+ />,
|
|
209
|
+ )}
|
|
210
|
+ </Form.Item>
|
|
211
|
+ <Form.Item>
|
|
212
|
+ {getFieldDecorator('endtime')(
|
|
213
|
+ <Input
|
|
214
|
+ // prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
|
|
215
|
+ placeholder="截止时间"
|
|
216
|
+ />,
|
|
217
|
+ )}
|
|
218
|
+ </Form.Item>
|
|
219
|
+ </Form>
|
|
220
|
+ </Modal>
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+ {/* </AuthButton> */}
|
|
225
|
+ {/* <Table dataSource={data.list} columns={columns} pagination={false} rowKey="activityList"/> */}
|
|
226
|
+ <Table columns={columns} dataSource={data} pagination={false} />
|
|
227
|
+ {/* <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
|
|
228
|
+ <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} />
|
|
229
|
+ </div> */}
|
|
230
|
+
|
|
231
|
+ </div>
|
|
232
|
+ </>
|
|
233
|
+ )
|
|
234
|
+}
|
|
235
|
+const WrappedHeader = Form.create({ name: 'header' })(header);
|
|
236
|
+
|
|
237
|
+export default WrappedHeader
|