Commit d4ecf3cd by 陈羽

update: bug修复

parent f4a7b505
......@@ -109,7 +109,7 @@
</div>
</div>
<el-form-item label="定向人群:" :prop="`popupMemberGroupList_${elIndex}`">
<vue-gic-member-group :defaltSelected="pop.popupMemberGroupList" :projectName="projectName" :headerList="headerList" :readonly="pop.activeStatus == 2" @handleDataTransferred="data => handleDataTransferred(data, elIndex)" @handleDataLeft="handleDataLeft"></vue-gic-member-group>
<vue-gic-member-group :defaltSelected="pop.popupMemberGroupList" :projectName="projectName" :headerList="headerList" :readonly="pop.activeStatus == 2" @handleDataTransferred="data => handleDataTransferred(data, elIndex)" @handleDataLeft="(selectedData, selectionToRemove) => handleDataLeft(selectedData, selectionToRemove, elIndex)"></vue-gic-member-group>
</el-form-item>
<div class="sort">
<el-popover placement="bottom" width="400" trigger="click" popper-class="pop_sort_popover" :disabled="pop.activeStatus == 2">
......@@ -362,7 +362,8 @@ export default {
groupPlan.dateTime = [new Date(groupPlan.beginTime), new Date(groupPlan.endTime)];
groupPlan.scene = typeof groupPlan.scene == 'string' ? groupPlan.scene.split(',') : [];
if (Array.isArray(groupPlan.popupList)) {
groupPlan.popupList = groupPlan.popupList.map(item => {
groupPlan.popupList = groupPlan.popupList.map((item, index) => {
this.addrules(index);
if (item.putonType == 1) {
item.linkToolsVisible = false;
item.popupImageDetails.link = JSON.parse(item.popupImageDetails.link || '{}');
......@@ -423,6 +424,18 @@ export default {
}),
addPop() {
const index = this.group.popupList.length;
this.addrules(index);
// let sortNum = 0;
for (const key in this.popSort) {
if (!this.popSort[key]) {
const pop = JSON.parse(JSON.stringify(defaultPop));
this.popSort[`${key}`] = true;
this.group.popupList.push(Object.assign({}, pop, { sortNum: key, fileList: [] }));
return;
}
}
},
addrules(index) {
// 投放内容
this.rules[`content_${index}`] = [
{
......@@ -451,6 +464,9 @@ export default {
if (item.popupMemberGroupList && !item.popupMemberGroupList.length) {
callback(new Error('请选择定向人群'));
}
if (item.popupMemberGroupList && item.popupMemberGroupList.length > 3) {
callback(new Error('会员分组数量不能超过3个'));
}
callback();
},
trigger: 'change'
......@@ -481,8 +497,8 @@ export default {
if (this.group.dateTime[0] && this.group.dateTime[1]) {
const startTime = this.group.dateTime[0].getTime();
const endTime = this.group.dateTime[1].getTime();
const popStartTime = item.dateTime[0].getTime();
const popEndTime = item.dateTime[1].getTime();
const popStartTime = item.dateTime && item.dateTime[0].getTime();
const popEndTime = item.dateTime && item.dateTime[1].getTime();
if (!item.dateTime) {
callback(new Error('请选择投放时间'));
} else if (popStartTime < startTime || popEndTime > endTime) {
......@@ -526,15 +542,6 @@ export default {
trigger: 'blur'
}
];
// let sortNum = 0;
for (const key in this.popSort) {
if (!this.popSort[key]) {
const pop = JSON.parse(JSON.stringify(defaultPop));
this.popSort[`${key}`] = true;
this.group.popupList.push(Object.assign({}, pop, { sortNum: key, fileList: [] }));
return;
}
}
},
resetField(field) {
this.$refs.form.validateField(field);
......@@ -664,13 +671,14 @@ export default {
},
// 定向人群筛选
handleDataTransferred(data, elIndex) {
console.log('transfer', data);
let item = this.group.popupList[elIndex];
item.popupMemberGroupList = [...data];
this.resetField(`popupMemberGroupList_${elIndex}`);
},
handleDataLeft(selectedData, selectionToRemove) {
// console.log(selectedData, selectionToRemove);
handleDataLeft(selectedData, selectionToRemove, elIndex) {
let item = this.group.popupList[elIndex];
item.popupMemberGroupList = [...selectedData];
this.resetField(`popupMemberGroupList_${elIndex}`);
},
setImgLink(pop) {
if (pop.activeStatus != 2) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment