|
@@ -8,6 +8,7 @@ import Selector from '../../../components/AXTableSelector/Selector';
|
|
import AXDragSortTable from '../../../components/AXDragSortTable';
|
|
import AXDragSortTable from '../../../components/AXDragSortTable';
|
|
import FooterToolbar from '../../../components/FooterToolbar';
|
|
import FooterToolbar from '../../../components/FooterToolbar';
|
|
import { renderStatus, statusToBool, boolToStatus, renderProductType } from '../../../utils/utils';
|
|
import { renderStatus, statusToBool, boolToStatus, renderProductType } from '../../../utils/utils';
|
|
|
|
+import { Hotax } from '../../../utils/config';
|
|
import styles from './PersonalizeEdit.less';
|
|
import styles from './PersonalizeEdit.less';
|
|
|
|
|
|
const formItemLayout = {
|
|
const formItemLayout = {
|
|
@@ -29,6 +30,7 @@ const formItemLayout = {
|
|
shelves,
|
|
shelves,
|
|
terminal,
|
|
terminal,
|
|
tagType,
|
|
tagType,
|
|
|
|
+ loading,
|
|
sLoading: loading.models.shelves,
|
|
sLoading: loading.models.shelves,
|
|
tLoading: loading.models.tagType,
|
|
tLoading: loading.models.tagType,
|
|
mtLoading: loading.models.tag,
|
|
mtLoading: loading.models.tag,
|
|
@@ -62,6 +64,11 @@ export default class PersonalizeEditPage extends Component {
|
|
type: 'terminal/fetchTerminalRecommendCourse',
|
|
type: 'terminal/fetchTerminalRecommendCourse',
|
|
payload: { uid: this.state.uid },
|
|
payload: { uid: this.state.uid },
|
|
});
|
|
});
|
|
|
|
+ // 加载全部
|
|
|
|
+ this.props.dispatch({
|
|
|
|
+ type: 'tagType/fetchTagTypeList',
|
|
|
|
+ payload: { pageSize: 1000 },
|
|
|
|
+ });
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -238,7 +245,7 @@ export default class PersonalizeEditPage extends Component {
|
|
handleUserTagSubmit = () => {
|
|
handleUserTagSubmit = () => {
|
|
this.props.form.validateFieldsAndScroll((err, values) => {
|
|
this.props.form.validateFieldsAndScroll((err, values) => {
|
|
if (!err) {
|
|
if (!err) {
|
|
- const { name, status } = values;
|
|
|
|
|
|
+ const { sort, name, status } = values;
|
|
const { uid } = this.state;
|
|
const { uid } = this.state;
|
|
const { terminal } = this.props;
|
|
const { terminal } = this.props;
|
|
const { currentUserTagItem } = terminal;
|
|
const { currentUserTagItem } = terminal;
|
|
@@ -248,12 +255,12 @@ export default class PersonalizeEditPage extends Component {
|
|
if (!id) {
|
|
if (!id) {
|
|
this.props.dispatch({
|
|
this.props.dispatch({
|
|
type: 'terminal/createTerminalTagItem',
|
|
type: 'terminal/createTerminalTagItem',
|
|
- payload: { uid, name, typeCode, status: newStatus, productList: pidList },
|
|
|
|
|
|
+ payload: { sort, uid, name, typeCode, status: newStatus, productList: pidList },
|
|
});
|
|
});
|
|
} else {
|
|
} else {
|
|
this.props.dispatch({
|
|
this.props.dispatch({
|
|
type: 'terminal/updateTerminalTagItem',
|
|
type: 'terminal/updateTerminalTagItem',
|
|
- payload: { id, uid, name, typeCode, status: newStatus, productList: pidList },
|
|
|
|
|
|
+ payload: { id, sort, uid, name, typeCode, status: newStatus, productList: pidList },
|
|
});
|
|
});
|
|
}
|
|
}
|
|
this.setState({ tagModalDestroy: true });
|
|
this.setState({ tagModalDestroy: true });
|
|
@@ -295,32 +302,44 @@ export default class PersonalizeEditPage extends Component {
|
|
recModalDestroy,
|
|
recModalDestroy,
|
|
merchantTagModalDestroy,
|
|
merchantTagModalDestroy,
|
|
} = this.state;
|
|
} = this.state;
|
|
- const { sLoading, tLoading, mtLoading, terminal, shelves, tagType, tag, form } = this.props;
|
|
|
|
|
|
+ const {
|
|
|
|
+ sLoading, tLoading, mtLoading, loading, terminal, shelves, tagType, tag, form,
|
|
|
|
+ } = this.props;
|
|
const { getFieldDecorator } = form;
|
|
const { getFieldDecorator } = form;
|
|
const { userTagList, userRecCourse, currentUserTagItem } = terminal;
|
|
const { userTagList, userRecCourse, currentUserTagItem } = terminal;
|
|
- const { name, status, productList, typeCode, typeName } = currentUserTagItem;
|
|
|
|
|
|
+ const { sort, name, status, productList, typeCode, typeName } = currentUserTagItem;
|
|
|
|
|
|
// 用户标签列表表头
|
|
// 用户标签列表表头
|
|
const tagColumns = [{
|
|
const tagColumns = [{
|
|
|
|
+ title: '标签位置',
|
|
|
|
+ dataIndex: 'sort',
|
|
|
|
+ width: '10%',
|
|
|
|
+ }, {
|
|
title: '标签名称',
|
|
title: '标签名称',
|
|
dataIndex: 'name',
|
|
dataIndex: 'name',
|
|
- key: 1,
|
|
|
|
- width: '30%',
|
|
|
|
|
|
+ width: '25%',
|
|
}, {
|
|
}, {
|
|
title: '标签类型',
|
|
title: '标签类型',
|
|
dataIndex: 'typeCode',
|
|
dataIndex: 'typeCode',
|
|
- key: 2,
|
|
|
|
- width: '30%',
|
|
|
|
|
|
+ width: '25%',
|
|
|
|
+ filters: (tagType.list || []).map(item => ({ text: item.name, value: item.code })),
|
|
|
|
+ onFilter: (value, record) => record.typeCode.indexOf(value) === 0,
|
|
}, {
|
|
}, {
|
|
title: '标签状态',
|
|
title: '标签状态',
|
|
dataIndex: 'status',
|
|
dataIndex: 'status',
|
|
- key: 3,
|
|
|
|
width: '15%',
|
|
width: '15%',
|
|
render: text => renderStatus(text),
|
|
render: text => renderStatus(text),
|
|
|
|
+ filters: [{
|
|
|
|
+ text: '正常',
|
|
|
|
+ value: Hotax.STATUS_NORMAL,
|
|
|
|
+ }, {
|
|
|
|
+ text: '删除',
|
|
|
|
+ value: Hotax.STATUS_DELETE,
|
|
|
|
+ }],
|
|
|
|
+ onFilter: (value, record) => record.status === value,
|
|
align: 'center',
|
|
align: 'center',
|
|
}, {
|
|
}, {
|
|
title: '操作',
|
|
title: '操作',
|
|
- key: 4,
|
|
|
|
width: '25%',
|
|
width: '25%',
|
|
align: 'right',
|
|
align: 'right',
|
|
render: (_, record) => (
|
|
render: (_, record) => (
|
|
@@ -411,6 +430,7 @@ export default class PersonalizeEditPage extends Component {
|
|
dataSource={tagTypeData}
|
|
dataSource={tagTypeData}
|
|
columns={tagTypeColumns}
|
|
columns={tagTypeColumns}
|
|
className={styles.tagTable}
|
|
className={styles.tagTable}
|
|
|
|
+ onChange={this.handleUserTagTableChange}
|
|
/>
|
|
/>
|
|
</Card>
|
|
</Card>
|
|
);
|
|
);
|
|
@@ -476,6 +496,13 @@ export default class PersonalizeEditPage extends Component {
|
|
<Input placeholder="请输入" />
|
|
<Input placeholder="请输入" />
|
|
)}
|
|
)}
|
|
</Form.Item>
|
|
</Form.Item>
|
|
|
|
+ <Form.Item hasFeedback label="标签位置" {...formItemLayout}>
|
|
|
|
+ {getFieldDecorator('sort', {
|
|
|
|
+ initialValue: sort,
|
|
|
|
+ })(
|
|
|
|
+ <Input placeholder="请输入" />
|
|
|
|
+ )}
|
|
|
|
+ </Form.Item>
|
|
<Form.Item label="标签类型" {...formItemLayout}>
|
|
<Form.Item label="标签类型" {...formItemLayout}>
|
|
<Button
|
|
<Button
|
|
disabled={tagTypeSelecting}
|
|
disabled={tagTypeSelecting}
|
|
@@ -620,11 +647,12 @@ export default class PersonalizeEditPage extends Component {
|
|
<Button onClick={() => this.handleUserTagModalShow()} style={{ float: 'right' }} type="primary">新建标签</Button>
|
|
<Button onClick={() => this.handleUserTagModalShow()} style={{ float: 'right' }} type="primary">新建标签</Button>
|
|
</div>
|
|
</div>
|
|
}
|
|
}
|
|
|
|
+ loading={loading.effects['terminal/fetchTerminalTagList']}
|
|
style={{ marginBottom: 16 }}
|
|
style={{ marginBottom: 16 }}
|
|
className={styles.tagCard}
|
|
className={styles.tagCard}
|
|
>
|
|
>
|
|
<Table
|
|
<Table
|
|
- pagination={false}
|
|
|
|
|
|
+ pagination={{ pageSize: 15 }}
|
|
dataSource={userTagList}
|
|
dataSource={userTagList}
|
|
columns={tagColumns}
|
|
columns={tagColumns}
|
|
rowKey={record => record.id}
|
|
rowKey={record => record.id}
|
|
@@ -640,6 +668,7 @@ export default class PersonalizeEditPage extends Component {
|
|
<Button onClick={this.handleUserRecModalShow} style={{ float: 'right' }} type="primary">更换课程</Button>
|
|
<Button onClick={this.handleUserRecModalShow} style={{ float: 'right' }} type="primary">更换课程</Button>
|
|
</div>
|
|
</div>
|
|
}
|
|
}
|
|
|
|
+ loading={loading.effects['terminal/fetchTerminalRecommendCourse']}
|
|
style={{ marginBottom: 70 }}
|
|
style={{ marginBottom: 70 }}
|
|
className={styles.tagCard}
|
|
className={styles.tagCard}
|
|
>
|
|
>
|