Commit a9228dc3ed15352dc64a0ae4ade2ea865cee8fb4
Committed by
xp.Huang
1 parent
c835e78b
perf(src/views): 告警轮播组件选择不适应的接口,进行提示
Showing
1 changed file
with
3 additions
and
1 deletions
@@ -351,8 +351,9 @@ useChartDataFetch(props.chartConfig, useChartEditStore, async (resData: any[], r | @@ -351,8 +351,9 @@ useChartDataFetch(props.chartConfig, useChartEditStore, async (resData: any[], r | ||
351 | const { requestParams } = res | 351 | const { requestParams } = res |
352 | if (!requestParams) return | 352 | if (!requestParams) return |
353 | const { Params } = requestParams | 353 | const { Params } = requestParams |
354 | - if (!Params) return | 354 | + if (!Params) return |
355 | const { entityId } = Params | 355 | const { entityId } = Params |
356 | + if(!entityId) return window['$message'].warning('您选择的公共接口不适合此组件,请选择匹配此组件的公共接口') | ||
356 | const thingsModel = await handleDeviceProfileAttributes(entityId) | 357 | const thingsModel = await handleDeviceProfileAttributes(entityId) |
357 | const { attribute } = thingsModel as any | 358 | const { attribute } = thingsModel as any |
358 | const resDataFormat = resData.reduce((acc, curr) => { | 359 | const resDataFormat = resData.reduce((acc, curr) => { |
@@ -373,6 +374,7 @@ onUnmounted(() => { | @@ -373,6 +374,7 @@ onUnmounted(() => { | ||
373 | }) | 374 | }) |
374 | 375 | ||
375 | const handleDeviceProfileAttributes = async (entityId: string) => { | 376 | const handleDeviceProfileAttributes = async (entityId: string) => { |
377 | + if(!entityId) return window['$message'].warning('您选择的公共接口不适合此组件,请选择匹配此组件的公共接口') | ||
376 | const deviceDetailRes = await getDeviceDetail(entityId) | 378 | const deviceDetailRes = await getDeviceDetail(entityId) |
377 | const { deviceProfileId } = deviceDetailRes | 379 | const { deviceProfileId } = deviceDetailRes |
378 | if (!deviceProfileId) return | 380 | if (!deviceProfileId) return |