修改设置故障测试框选问题

This commit is contained in:
dong 2023-09-22 09:44:00 +08:00
parent 3a8e48b06f
commit ff8a4f1c07
2 changed files with 8 additions and 4 deletions

View File

@ -159,8 +159,10 @@ watch(
selectGraphic.push(...deviceFilter);
}
selectGraphic = Array.from(new Set(selectGraphic));
lineStore.getLineApp().updateSelected(...selectGraphic);
setAlartTextData.value.deviceCodes = selectGraphic.map((g) => g.code);
selectGraphic.forEach((g) => {
g.updateSelected(true);
});
}
}
);
@ -203,9 +205,9 @@ function removeSelect(code: string) {
const removeIndex = setAlartTextData.value.deviceCodes.findIndex(
(item) => item == code
);
selectGraphic[removeIndex].updateSelected(false);
selectGraphic.splice(removeIndex, 1);
setAlartTextData.value.deviceCodes.splice(removeIndex, 1);
lineStore.getLineApp().updateSelected(...selectGraphic);
}
function clearSelect() {
@ -220,5 +222,6 @@ function onReset() {
alertType: '',
deviceCodes: [],
};
selectGraphic = [];
}
</script>

View File

@ -174,9 +174,9 @@ watch(
selectGraphic = [deviceFilter[0]];
}
selectGraphic = Array.from(new Set(selectGraphic));
lineStore.getLineApp().updateSelected(...selectGraphic);
setAlartTextData.value.deviceInfos = [];
selectGraphic.forEach((g) => {
g.updateSelected(true);
setAlartTextData.value.deviceInfos.push({
deviceName: g.code,
deviceType: (DeviceType as never)[g.type + ''],
@ -227,9 +227,9 @@ function removeSelect(code: { deviceName: string; deviceType: string }) {
const removeIndex = setAlartTextData.value.deviceInfos.findIndex(
(item) => item == code
);
selectGraphic[removeIndex].updateSelected(false);
selectGraphic.splice(removeIndex, 1);
setAlartTextData.value.deviceInfos.splice(removeIndex, 1);
lineStore.getLineApp().updateSelected(...selectGraphic);
}
function clearSelect() {
@ -247,5 +247,6 @@ function onReset() {
status: '',
groupId: '',
};
selectGraphic = [];
}
</script>