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);