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