From 0cec0db90a0467546498425e3e87493b963d8b7c Mon Sep 17 00:00:00 2001 From: joylink_zhaoerwei Date: Fri, 22 Dec 2023 16:10:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=80=E7=BA=A7=E8=81=94=E9=94=81=E9=9B=86?= =?UTF-8?q?=E4=B8=AD=E7=AB=99=E5=A4=9A=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/ConfigApi.ts | 2 +- src/components/rangeConfigApp/RangeConfig.vue | 12 ++++-------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/api/ConfigApi.ts b/src/api/ConfigApi.ts index 82aeb7f..02d144f 100644 --- a/src/api/ConfigApi.ts +++ b/src/api/ConfigApi.ts @@ -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); diff --git a/src/components/rangeConfigApp/RangeConfig.vue b/src/components/rangeConfigApp/RangeConfig.vue index a801c10..c92c2b1 100644 --- a/src/components/rangeConfigApp/RangeConfig.vue +++ b/src/components/rangeConfigApp/RangeConfig.vue @@ -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);