Commit 8c2d5f784d7308342d25d1e711e8d2151830c00d
1 parent
a12f394a
fix: DEFECT-678 first enter page search data over default setting value
Showing
1 changed file
with
4 additions
and
2 deletions
@@ -112,7 +112,7 @@ | @@ -112,7 +112,7 @@ | ||
112 | const wrapRef = ref<HTMLDivElement | null>(null); | 112 | const wrapRef = ref<HTMLDivElement | null>(null); |
113 | const chartRef = ref<HTMLDivElement | null>(null); | 113 | const chartRef = ref<HTMLDivElement | null>(null); |
114 | const deviceAttrs = ref<string[]>([]); | 114 | const deviceAttrs = ref<string[]>([]); |
115 | - const { setOptions, getInstance } = useECharts(chartRef as Ref<HTMLDivElement>); | 115 | + const { setOptions, getInstance, resize } = useECharts(chartRef as Ref<HTMLDivElement>); |
116 | const isNull = ref(true); | 116 | const isNull = ref(true); |
117 | const { toPromise } = useScript({ src: BAI_DU_MAP_URL }); | 117 | const { toPromise } = useScript({ src: BAI_DU_MAP_URL }); |
118 | const [registerDetailDrawer, { openDrawer }] = useDrawer(); | 118 | const [registerDetailDrawer, { openDrawer }] = useDrawer(); |
@@ -270,6 +270,7 @@ | @@ -270,6 +270,7 @@ | ||
270 | // 发送请求 | 270 | // 发送请求 |
271 | loading.value = true; | 271 | loading.value = true; |
272 | const res = await getDeviceHistoryInfo(searchParams); | 272 | const res = await getDeviceHistoryInfo(searchParams); |
273 | + loading.value = false; | ||
273 | // 判断数据对象是否为空 | 274 | // 判断数据对象是否为空 |
274 | if (!Object.keys(res).length) { | 275 | if (!Object.keys(res).length) { |
275 | isNull.value = false; | 276 | isNull.value = false; |
@@ -278,7 +279,6 @@ | @@ -278,7 +279,6 @@ | ||
278 | isNull.value = true; | 279 | isNull.value = true; |
279 | } | 280 | } |
280 | setChartOptions(res, value.keys); | 281 | setChartOptions(res, value.keys); |
281 | - loading.value = false; | ||
282 | }, | 282 | }, |
283 | }); | 283 | }); |
284 | 284 | ||
@@ -332,6 +332,7 @@ | @@ -332,6 +332,7 @@ | ||
332 | startTs: Date.now() - 1 * 24 * 60 * 60 * 1000, | 332 | startTs: Date.now() - 1 * 24 * 60 * 60 * 1000, |
333 | endTs: Date.now(), | 333 | endTs: Date.now(), |
334 | agg: AggregateDataEnum.NONE, | 334 | agg: AggregateDataEnum.NONE, |
335 | + limit: 7, | ||
335 | }); | 336 | }); |
336 | 337 | ||
337 | // 判断对象是否为空 | 338 | // 判断对象是否为空 |
@@ -371,6 +372,7 @@ | @@ -371,6 +372,7 @@ | ||
371 | data: dataArray.filter((item1) => item1[2] === item), | 372 | data: dataArray.filter((item1) => item1[2] === item), |
372 | }; | 373 | }; |
373 | }); | 374 | }); |
375 | + resize(); | ||
374 | // 设置数据 | 376 | // 设置数据 |
375 | setOptions(eChartOptions(series, keys)); | 377 | setOptions(eChartOptions(series, keys)); |
376 | } | 378 | } |