Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: trace检索图表框选时间范围后同步全局 --bug=130528723 #3127

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading