Skip to content

Commit

Permalink
fix: 时间轴重复多次添加筛选条件
Browse files Browse the repository at this point in the history
  • Loading branch information
lvisei committed Jan 23, 2024
1 parent d890f02 commit 4baf8a0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Chart } from '@antv/g2';
import { debounce } from 'lodash-es';
import React, { useEffect, useRef } from 'react';
import type { Selection } from '../TimeLinePanel/types';

Expand Down Expand Up @@ -148,7 +149,7 @@ export const TimeLineChart = (props: TimeLineChartProps) => {
if (!chartRef.current) {
return () => null;
}
const onHighlight = (e: any) => {
const onHighlight = debounce((e: any) => {
const { nativeEvent, data } = e;
if (!nativeEvent) return;
const [selectionX] = data.selection;
Expand All @@ -157,7 +158,7 @@ export const TimeLineChart = (props: TimeLineChartProps) => {
// 选择的区间没有变化
if (start === selection?.[0] && end === selection?.[1]) return;
onSelection(start, end);
};
}, 160);
const onBrushRemove = (e: any) => {
if (!e?.nativeEvent) return;
onReset();
Expand Down
2 changes: 0 additions & 2 deletions packages/li-core-assets/src/services/fetch-dataset/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ export const getFetchData = (params: Params) => {
: properties.requestOptions.body,
});

console.log('getFetchData filter: ', filter);

if (Chache.has(requestkey)) {
const data = Chache.get(requestkey);
return datasetFilterService({ data, filter }, signal);
Expand Down

0 comments on commit 4baf8a0

Please sign in to comment.