调整logicSectionCodeList赋值增加校验

This commit is contained in:
fan 2019-12-24 18:05:56 +08:00
parent 6d82f466a6
commit 52eddbaa3d

View File

@ -91,7 +91,7 @@ export default {
counts += parseInt(ele.num);
});
if (count === 0 || allNotZeros) {
const logicSectionCodeList = [];
let logicSectionCodeList = [];
models.forEach(item=> {
logicSectionCodeList.push(item.code);
});
@ -102,10 +102,12 @@ export default {
});
if (count === 0) {
logicSectionNumList = [];
logicSectionCodeList = [];
}
this.editModel.logicSectionNum = [...logicSectionNumList];
this.editModel.logicSectionCodeList = logicSectionCodeList;
models.push(this.editModel);
const model = deepAssign(this.editModel, {_type: 'Section'});
model.logicSectionNum = [...logicSectionNumList];
model.logicSectionCodeList = [...logicSectionCodeList];
models.push(model);
this.$emit('updateMapModel', models);
} else {
this.$messageBox('逻辑区段在个折线上数量要均为0或均不为0');