一级联锁集中站多选

This commit is contained in:
joylink_zhaoerwei 2023-12-22 16:10:04 +08:00
parent 3b6da014ed
commit 0cec0db90a
2 changed files with 5 additions and 9 deletions

View File

@ -45,7 +45,7 @@ export interface IAreaConfigItem {
areaName: string;
deviceType: string;
alertTypes: string[];
data: string[];
data: number[];
}
export function deviceRangeSet(data: IAreaConfigItem) {
return api.post('/api/config/device/area/save', data);

View File

@ -94,7 +94,7 @@ const showRangeConfig = ref(true);
const rangeConfig = reactive<{
areaName: string;
deviceType: `${DeviceType}` | '';
device: string[];
device: number[];
alertTypes: string[];
}>({
areaName: '',
@ -184,15 +184,11 @@ watch(
}
return select;
}) as JlGraphic[];
if (rangeConfig.alertTypes[0] !== '一级联锁') {
selectGraphic.push(...deviceFilter);
} else if (deviceFilter.length) {
selectGraphic = [deviceFilter[0]];
}
selectGraphic.push(...deviceFilter);
selectGraphic = Array.from(new Set(selectGraphic));
getRangeConfigApp().updateSelected(...selectGraphic);
device.value = selectGraphic.map((g) => g.code) as string[];
rangeConfig.device = selectGraphic.map((g) => g.id) as string[];
rangeConfig.device = selectGraphic.map((g) => g.id) as number[];
}
}
);
@ -267,7 +263,7 @@ async function searchById(id: number) {
(type) => (showAlertTypeData as never)[type + '']
);
const select: JlGraphic[] = [];
response.data.data.forEach((id: string) => {
response.data.data.forEach((id: number) => {
const g = getRangeConfigApp().queryStore.queryById(id);
select.push(g);
device.value.push(g.code);