地图绘制代码调整
This commit is contained in:
parent
acd3e5c6ff
commit
dc1ccfe699
@ -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];
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user