Commit 2dbb8146df0e115ee76d5ba5637c93c557f6e9b2
1 parent
bfd56bed
fix: DEFECT-938 open history trend again not show charts
Showing
2 changed files
with
5 additions
and
1 deletions
| ... | ... | @@ -62,6 +62,7 @@ export function useECharts( |
| 62 | 62 | } |
| 63 | 63 | nextTick(() => { |
| 64 | 64 | useTimeoutFn(() => { |
| 65 | + console.log(chartInstance); | |
| 65 | 66 | if (!chartInstance) { |
| 66 | 67 | initCharts(getDarkMode.value as 'default'); |
| 67 | 68 | |
| ... | ... | @@ -70,6 +71,7 @@ export function useECharts( |
| 70 | 71 | clear && chartInstance?.clear(); |
| 71 | 72 | |
| 72 | 73 | chartInstance?.setOption(unref(getOptions)); |
| 74 | + chartInstance = null; | |
| 73 | 75 | }, 30); |
| 74 | 76 | }); |
| 75 | 77 | } | ... | ... |
| ... | ... | @@ -6,6 +6,7 @@ import { HistoryData } from '/@/api/alarm/position/model'; |
| 6 | 6 | import { getDeviceAttributes } from '/@/api/dataBoard'; |
| 7 | 7 | import { DeviceAttributeRecord } from '/@/api/dataBoard/model'; |
| 8 | 8 | import { dateUtil } from '/@/utils/dateUtil'; |
| 9 | +import { isArray } from '/@/utils/is'; | |
| 9 | 10 | import { QueryWay } from '/@/views/report/config/config.data'; |
| 10 | 11 | import { SchemaFiled } from '/@/views/visual/board/detail/config/historyTrend.config'; |
| 11 | 12 | import { DEFAULT_DATE_FORMAT } from '/@/views/visual/board/detail/config/util'; |
| ... | ... | @@ -24,7 +25,8 @@ export function useHistoryData() { |
| 24 | 25 | const getDeviceAttribute = async (record: DeviceOption) => { |
| 25 | 26 | try { |
| 26 | 27 | const { deviceProfileId } = record; |
| 27 | - deviceAttrs.value = (await getDeviceAttributes({ deviceProfileId })) || []; | |
| 28 | + const list = (await getDeviceAttributes({ deviceProfileId })) || []; | |
| 29 | + deviceAttrs.value = isArray(list) ? list : []; | |
| 28 | 30 | } catch (error) { |
| 29 | 31 | throw error; |
| 30 | 32 | } | ... | ... |