Skip to content

Commit

Permalink
fix: trace检索图表框选时间范围后同步全局 --bug=130528723 (#3127)
Browse files Browse the repository at this point in the history
  • Loading branch information
shan-shuo authored Sep 25, 2024
1 parent 5532824 commit 9f80333
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion bkmonitor/webpack/src/trace/pages/main/inquire.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -171,6 +171,9 @@ export default defineComponent({
};
getAppList();
const timeRange = ref<TimeRangeType>(DEFAULT_TIME_RANGE);
const cacheTimeRange = ref('');
const enableSelectionRestoreAll = ref(true);
const showRestore = ref(false);
const timezone = ref<string>(getDefaultTimezone());
const refleshImmediate = ref<number | string>('');
/* 此时间下拉加载时不变 */
Expand All @@ -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);
Expand Down

0 comments on commit 9f80333

Please sign in to comment.