|
@@ -23,23 +23,20 @@ const formItemLayout = {
|
|
},
|
|
},
|
|
};
|
|
};
|
|
|
|
|
|
-@connect(({ loading, tag, tagGroup, shelves, tagType, merchant }) => ({
|
|
|
|
|
|
+@connect(({ loading, tag, shelves, tagType, merchant }) => ({
|
|
tag,
|
|
tag,
|
|
shelves,
|
|
shelves,
|
|
- tagGroup,
|
|
|
|
tagType,
|
|
tagType,
|
|
merchant,
|
|
merchant,
|
|
submitting: loading.models.tag,
|
|
submitting: loading.models.tag,
|
|
sLoading: loading.models.shelves,
|
|
sLoading: loading.models.shelves,
|
|
mLoading: loading.models.merchant,
|
|
mLoading: loading.models.merchant,
|
|
- tLoading: loading.models.tagGroup,
|
|
|
|
ttLoading: loading.models.tagType,
|
|
ttLoading: loading.models.tagType,
|
|
}))
|
|
}))
|
|
@Form.create()
|
|
@Form.create()
|
|
export default class TagCreatePage extends Component {
|
|
export default class TagCreatePage extends Component {
|
|
state = {
|
|
state = {
|
|
tagTypeSelectorDestroy: true,
|
|
tagTypeSelectorDestroy: true,
|
|
- tagGroupSelectorDestroy: true,
|
|
|
|
merchantSelectorDestroy: true,
|
|
merchantSelectorDestroy: true,
|
|
shelvesSelectorDestroy: true,
|
|
shelvesSelectorDestroy: true,
|
|
productType: 'Course',
|
|
productType: 'Course',
|
|
@@ -85,12 +82,6 @@ export default class TagCreatePage extends Component {
|
|
payload: params,
|
|
payload: params,
|
|
});
|
|
});
|
|
break;
|
|
break;
|
|
- case 'tagGroup':
|
|
|
|
- this.props.dispatch({
|
|
|
|
- type: 'tagGroup/fetchTagGroupList',
|
|
|
|
- payload: params,
|
|
|
|
- });
|
|
|
|
- break;
|
|
|
|
case 'tagType':
|
|
case 'tagType':
|
|
this.props.dispatch({
|
|
this.props.dispatch({
|
|
type: 'tagType/fetchTagTypeList',
|
|
type: 'tagType/fetchTagTypeList',
|
|
@@ -130,9 +121,6 @@ export default class TagCreatePage extends Component {
|
|
}
|
|
}
|
|
let payload;
|
|
let payload;
|
|
switch (flag) {
|
|
switch (flag) {
|
|
- case 'tagGroup':
|
|
|
|
- payload = { groupId: rows[0].id, groupName: rows[0].name };
|
|
|
|
- break;
|
|
|
|
case 'tagType':
|
|
case 'tagType':
|
|
payload = { typeCode: rows[0].code };
|
|
payload = { typeCode: rows[0].code };
|
|
break;
|
|
break;
|
|
@@ -203,7 +191,7 @@ export default class TagCreatePage extends Component {
|
|
const { name, status } = values;
|
|
const { name, status } = values;
|
|
const { tag } = this.props;
|
|
const { tag } = this.props;
|
|
const { currentItem } = tag;
|
|
const { currentItem } = tag;
|
|
- const { productList = [], groupId, typeCode } = currentItem;
|
|
|
|
|
|
+ const { productList = [], groupId, merchantId, typeCode } = currentItem;
|
|
const id = this.isEdit();
|
|
const id = this.isEdit();
|
|
if (id) {
|
|
if (id) {
|
|
this.props.dispatch({
|
|
this.props.dispatch({
|
|
@@ -211,8 +199,8 @@ export default class TagCreatePage extends Component {
|
|
payload: {
|
|
payload: {
|
|
id,
|
|
id,
|
|
name,
|
|
name,
|
|
- groupId,
|
|
|
|
typeCode,
|
|
typeCode,
|
|
|
|
+ merchantId,
|
|
status: boolToStatus(status),
|
|
status: boolToStatus(status),
|
|
productList: productList.map(item => item.pid),
|
|
productList: productList.map(item => item.pid),
|
|
},
|
|
},
|
|
@@ -225,6 +213,7 @@ export default class TagCreatePage extends Component {
|
|
name,
|
|
name,
|
|
groupId,
|
|
groupId,
|
|
typeCode,
|
|
typeCode,
|
|
|
|
+ merchantId,
|
|
status: boolToStatus(status),
|
|
status: boolToStatus(status),
|
|
productList: productList.map(item => item.pid),
|
|
productList: productList.map(item => item.pid),
|
|
},
|
|
},
|
|
@@ -237,15 +226,15 @@ export default class TagCreatePage extends Component {
|
|
|
|
|
|
render() {
|
|
render() {
|
|
const {
|
|
const {
|
|
- form, submitting, mLoading, tLoading, ttLoading,
|
|
|
|
- sLoading, shelves, tag, tagGroup, tagType, merchant,
|
|
|
|
|
|
+ form, submitting, mLoading, ttLoading,
|
|
|
|
+ sLoading, shelves, tag, tagType, merchant,
|
|
} = this.props;
|
|
} = this.props;
|
|
const {
|
|
const {
|
|
- shelvesSelectorDestroy, tagGroupSelectorDestroy,
|
|
|
|
- merchantSelectorDestroy, tagTypeSelectorDestroy, productType,
|
|
|
|
|
|
+ shelvesSelectorDestroy, merchantSelectorDestroy,
|
|
|
|
+ tagTypeSelectorDestroy, productType,
|
|
} = this.state;
|
|
} = this.state;
|
|
const { currentItem } = tag;
|
|
const { currentItem } = tag;
|
|
- const { status, typeCode, name, groupName, merchantName, productList = [] } = currentItem;
|
|
|
|
|
|
+ const { status, typeCode, name, merchantName, productList = [] } = currentItem;
|
|
const { getFieldDecorator } = form;
|
|
const { getFieldDecorator } = form;
|
|
|
|
|
|
const tagMetaData = [{
|
|
const tagMetaData = [{
|
|
@@ -253,10 +242,6 @@ export default class TagCreatePage extends Component {
|
|
value: typeCode,
|
|
value: typeCode,
|
|
key: 'tagType',
|
|
key: 'tagType',
|
|
}, {
|
|
}, {
|
|
- fieldName: '所属标签组:',
|
|
|
|
- value: groupName,
|
|
|
|
- key: 'tagGroup',
|
|
|
|
- }, {
|
|
|
|
fieldName: '所属渠道:',
|
|
fieldName: '所属渠道:',
|
|
value: merchantName,
|
|
value: merchantName,
|
|
key: 'merchant',
|
|
key: 'merchant',
|
|
@@ -327,31 +312,6 @@ export default class TagCreatePage extends Component {
|
|
</Modal>
|
|
</Modal>
|
|
);
|
|
);
|
|
};
|
|
};
|
|
- const getTagGroupModal = () => {
|
|
|
|
- return (
|
|
|
|
- <Modal
|
|
|
|
- width={1100}
|
|
|
|
- footer={null}
|
|
|
|
- visible
|
|
|
|
- title="标签组"
|
|
|
|
- maskClosable={false}
|
|
|
|
- onCancel={() => this.handleTagMetaInfoSelectorCancel('tagGroup')}
|
|
|
|
- >
|
|
|
|
- <Selector
|
|
|
|
- multiple={false}
|
|
|
|
- loading={tLoading}
|
|
|
|
- selectorName="TagGroup"
|
|
|
|
- list={tagGroup.list}
|
|
|
|
- pageNo={tagGroup.pageNo}
|
|
|
|
- pageSize={tagGroup.pageSize}
|
|
|
|
- totalSize={tagGroup.totalSize}
|
|
|
|
- onCancel={() => this.handleTagMetaInfoSelectorCancel('tagGroup')}
|
|
|
|
- onChange={data => this.handleTagMetaInfoSelectorChange('tagGroup', data)}
|
|
|
|
- onFinish={data => this.handleTagMetaInfoSelectorFinish('tagGroup', data)}
|
|
|
|
- />
|
|
|
|
- </Modal>
|
|
|
|
- );
|
|
|
|
- };
|
|
|
|
const getMerchantModal = () => {
|
|
const getMerchantModal = () => {
|
|
return (
|
|
return (
|
|
<Modal
|
|
<Modal
|
|
@@ -440,7 +400,6 @@ export default class TagCreatePage extends Component {
|
|
columns={tagMetaColumns}
|
|
columns={tagMetaColumns}
|
|
dataSource={tagMetaData}
|
|
dataSource={tagMetaData}
|
|
/>
|
|
/>
|
|
- {!tagGroupSelectorDestroy && getTagGroupModal()}
|
|
|
|
{!tagTypeSelectorDestroy && getTagTypeModal()}
|
|
{!tagTypeSelectorDestroy && getTagTypeModal()}
|
|
{!merchantSelectorDestroy && getMerchantModal()}
|
|
{!merchantSelectorDestroy && getMerchantModal()}
|
|
</Card>
|
|
</Card>
|