|
@@ -1,25 +1,24 @@
|
1
|
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 { FormattedMessage } from 'umi-plugin-react/locale';
|
4
|
|
-import styles from '../../style/GoodsList.less';
|
|
2
|
+import { Form, Input, Button, Icon, Select, message, Table, Pagination, Modal, DatePicker } from 'antd';
|
5
|
3
|
import router from 'umi/router';
|
6
|
4
|
import moment from 'moment';
|
|
5
|
+import AuthButton from '@/components/AuthButton';
|
|
6
|
+import withActions from '@/components/ActionList';
|
|
7
|
+import EditIcon from '@/components/EditIcon';
|
|
8
|
+import Prompt from 'umi/prompt';
|
7
|
9
|
import SelectCity from '../../../components/SelectButton/CitySelect'
|
8
|
10
|
import BuildSelect from '../../../components/SelectButton/BuildSelect'
|
9
|
11
|
import apis from '../../../services/apis';
|
10
|
12
|
import request from '../../../utils/request';
|
11
|
|
-import AuthButton from '@/components/AuthButton';
|
12
|
|
-import Prompt from 'umi/prompt';
|
|
13
|
+import styles from '../../style/GoodsList.less';
|
13
|
14
|
|
14
|
15
|
const { Option } = Select;
|
15
|
|
-const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
|
16
|
16
|
|
17
|
17
|
const header = props => {
|
18
|
18
|
const [data, setData] = useState({})
|
19
|
19
|
// const [page, changePage] = useState({})
|
20
|
20
|
|
21
|
21
|
useEffect(() => {
|
22
|
|
-
|
23
|
22
|
if (localStorage.getItem("helpActivePageParams")) {
|
24
|
23
|
props.form.setFieldsValue(JSON.parse(localStorage.getItem("helpActivePageParams")));
|
25
|
24
|
// const { getFieldDecorator } = JSON.parse(localStorage.getItem("pageParams"))
|
|
@@ -128,32 +127,31 @@ const header = props => {
|
128
|
127
|
dataIndex: 'handle',
|
129
|
128
|
key: 'handle',
|
130
|
129
|
align: 'center',
|
131
|
|
- render: (x, row) => (
|
132
|
|
- <>
|
133
|
|
- {
|
134
|
|
- <AuthButton name="admin.help.publish" noRight={null}>
|
135
|
|
- <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={sendOrPublicDynamic.bind(this, row)}>{row.status === 1 ? '取消发布' : '发布'}<Icon type="close-circle" className={styles.edit} /></span>
|
136
|
|
- </AuthButton>
|
137
|
|
- }
|
138
|
|
- {row.activityStatus === 0 &&
|
139
|
|
- <AuthButton name="admin.help.finish" noRight={null}>
|
140
|
|
- <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={topDynamic(row, 2)}>结束活动<Icon type="poweroff" style={{ color: '#bebebe' }} className={styles.edit} /></span> </AuthButton>
|
141
|
|
- }
|
142
|
|
- {
|
143
|
|
- <AuthButton name="admin.help.tag" noRight={null}>
|
144
|
|
- <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={topDynamic(row, 0)}>{row.weight === 1 ? '取消标签' : '添加标签'}<Icon type="vertical-align-top" style={{ color: '#bebebe' }} className={styles.edit} /></span>
|
145
|
|
- </AuthButton>}{
|
146
|
|
- <AuthButton name="admin.help.top" noRight={null}>
|
147
|
|
- <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={topDynamic(row, 1)}>{row.isMain === true ? '取消推首页' : '推首页'}<Icon type="vertical-align-top" style={{ color: '#bebebe' }} className={styles.edit} /></span>
|
148
|
|
- </AuthButton>}
|
149
|
|
- {<span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={() => toDataReacord(row.helpActivityId)}>数据记录<Icon type="form" className={styles.edit} /></span>}
|
150
|
|
- {(row.activityStatus === 1 || row.activityStatus === 0) &&
|
|
130
|
+ render: withActions((x, row) => [
|
|
131
|
+ <AuthButton name="admin.help.publish" noRight={null}>
|
|
132
|
+ <EditIcon type={row.status === 1 ? 'cancel' : 'publish'} text={row.status === 1 ? '取消发布' : '发布'} onClick={sendOrPublicDynamic.bind(this, row)} />
|
|
133
|
+ </AuthButton>,
|
|
134
|
+
|
|
135
|
+ row.activityStatus === 0 ?
|
|
136
|
+ <AuthButton name="admin.help.finish" noRight={null}>
|
|
137
|
+ <EditIcon type="end" text="结束活动" onClick={topDynamic(row, 2)} />
|
|
138
|
+ </AuthButton> : null,
|
|
139
|
+
|
|
140
|
+ <AuthButton name="admin.help.tag" noRight={null}>
|
|
141
|
+ <EditIcon type={row.weight === 1 ? 'cancel' : 'add'} text={row.weight === 1 ? '取消标签' : '添加标签'} onClick={topDynamic(row, 0)} />
|
|
142
|
+ </AuthButton>,
|
|
143
|
+
|
|
144
|
+ <AuthButton name="admin.help.top" noRight={null}>
|
|
145
|
+ <EditIcon type={row.isMain === 1 ? 'cancel' : 'add'} color="#666" text={row.isMain === 1 ? '取消推首页' : '推首页'} onClick={topDynamic(row, 1)} />
|
|
146
|
+ </AuthButton>,
|
|
147
|
+
|
|
148
|
+ <EditIcon type="record" text="数据记录" color="#666" onClick={() => toDataReacord(row.helpActivityId)} />,
|
|
149
|
+
|
|
150
|
+ (row.activityStatus === 1 || row.activityStatus === 0) ?
|
151
|
151
|
<AuthButton name="admin.helpActivity.update.put" noRight={null}>
|
152
|
|
- <span style={{ color: '#FF925C', marginRight: '20px', cursor: 'pointer' }} onClick={toEditGoods(row.helpActivityId)}>编辑<Icon type="form" style={{ color: '#bebebe' }} className={styles.edit} /></span>
|
153
|
|
- </AuthButton>
|
154
|
|
- }
|
155
|
|
- </>
|
156
|
|
- ),
|
|
152
|
+ <EditIcon color="#666" type="edit" text="编辑" onClick={toEditGoods(row.helpActivityId)} />
|
|
153
|
+ </AuthButton> : null,
|
|
154
|
+ ]),
|
157
|
155
|
},
|
158
|
156
|
];
|
159
|
157
|
|