From 9f80333d9cc74e2adda802289e6fda8905d4a182 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=97=AA=E7=83=81?= <57348011+shan-shuo@users.noreply.github.com> Date: Wed, 25 Sep 2024 20:20:40 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20trace=E6=A3=80=E7=B4=A2=E5=9B=BE?= =?UTF-8?q?=E8=A1=A8=E6=A1=86=E9=80=89=E6=97=B6=E9=97=B4=E8=8C=83=E5=9B=B4?= =?UTF-8?q?=E5=90=8E=E5=90=8C=E6=AD=A5=E5=85=A8=E5=B1=80=20--bug=3D1305287?= =?UTF-8?q?23=20(#3127)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../webpack/src/trace/pages/main/inquire.tsx | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/bkmonitor/webpack/src/trace/pages/main/inquire.tsx b/bkmonitor/webpack/src/trace/pages/main/inquire.tsx index 91c41dc6cd..190d8d99f4 100644 --- a/bkmonitor/webpack/src/trace/pages/main/inquire.tsx +++ b/bkmonitor/webpack/src/trace/pages/main/inquire.tsx @@ -41,7 +41,7 @@ import { useRoute, useRouter } from 'vue-router'; // import TemporaryShare from '../../components/temporary-share/temporary-share'; import * as authorityMap from 'apm/pages/home/authority-map'; -import { Button, Cascader, Dialog, Input, Loading, Popover, Radio } from 'bkui-vue'; +import { Button, Cascader, Dialog, Input, Popover, Radio } from 'bkui-vue'; import { listApplicationInfo } from 'monitor-api/modules/apm_meta'; import { getFieldOptionValues, @@ -171,6 +171,9 @@ export default defineComponent({ }; getAppList(); const timeRange = ref(DEFAULT_TIME_RANGE); + const cacheTimeRange = ref(''); + const enableSelectionRestoreAll = ref(true); + const showRestore = ref(false); const timezone = ref(getDefaultTimezone()); const refleshImmediate = ref(''); /* 此时间下拉加载时不变 */ @@ -189,6 +192,22 @@ export default defineComponent({ ]; const headerToolMenuList: ISelectMenuOption[] = [{ id: 'config', name: t('应用设置') }]; + function handleChartDataZoom(value) { + if (JSON.stringify(timeRange.value) !== JSON.stringify(value)) { + cacheTimeRange.value = JSON.parse(JSON.stringify(timeRange.value)); + timeRange.value = value; + showRestore.value = true; + } + } + function handleRestoreEvent() { + timeRange.value = JSON.parse(JSON.stringify(cacheTimeRange.value)); + showRestore.value = false; + } + // 框选图表事件范围触发(触发后缓存之前的时间,且展示复位按钮) + provide('showRestore', showRestore); + provide('enableSelectionRestoreAll', enableSelectionRestoreAll); + provide('handleChartDataZoom', handleChartDataZoom); + provide('handleRestoreEvent', handleRestoreEvent); provide(TIME_RANGE_KEY, timeRange); provide(TIMEZONE_KEY, timezone); provide(REFLESH_INTERVAL_KEY, refleshInterval);