地图绘制代码调整

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]; const list = state.map[lstName];
if (list && list instanceof Array) { if (list && list instanceof Array) {
const i = list.findIndex(elem => elem.code == model.code ); const i = list.findIndex(elem => elem.code == model.code );
if (list[i] < 0) { if (i < 0) {
list.push(deepClone(model)); // 新增 list.push(deepClone(model)); // 新增
} else { } else {
if (model._dispose) { if (model._dispose) {
list.splice(i, 1); list.splice(i, 1);
} else { } else {
list.splice(i, 1, deepClone(model)); list.splice(i, 1, deepClone(model));
} }
} }
state.map[lstName] = [...list]; state.map[lstName] = [...list];
} else { } else {
state.map[lstName] = [model]; state.map[lstName] = [model];
} }