地图绘制代码调整

This commit is contained in:
joylink_cuiweidong 2020-11-23 13:41:19 +08:00
parent acd3e5c6ff
commit dc1ccfe699

View File

@ -259,16 +259,16 @@ export function updateForList(model, state, lstName) {
const list = state.map[lstName];
if (list && list instanceof Array) {
const i = list.findIndex(elem => elem.code == model.code );
if (list[i] < 0) {
if (i < 0) {
list.push(deepClone(model)); // 新增
} else {
if (model._dispose) {
list.splice(i, 1);
} else {
list.splice(i, 1, deepClone(model));
}
}
state.map[lstName] = [...list];
if (model._dispose) {
list.splice(i, 1);
} else {
list.splice(i, 1, deepClone(model));
}
}
state.map[lstName] = [...list];
} else {
state.map[lstName] = [model];
}