Skip to content

Commit 1c8c44c

Browse files
committed
refactor:DataChartWidgetCore
1 parent 167e556 commit 1c8c44c

File tree

1 file changed

+15
-27
lines changed

1 file changed

+15
-27
lines changed

frontend/src/app/pages/DashBoardPage/components/Widgets/DataChartWidget/DataChartWidgetCore.tsx

Lines changed: 15 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,7 @@ export const DataChartWidgetCore: React.FC<{}> = memo(() => {
7878
let drillOption;
7979
drillOption = option;
8080
drillOptionRef.current = drillOption;
81-
boardDrillManager.setWidgetDrill({
82-
bid,
83-
wid,
84-
drillOption,
85-
});
81+
boardDrillManager.setWidgetDrill({ bid, wid, drillOption });
8682
onWidgetGetData(widgetRef.current);
8783
},
8884

@@ -232,20 +228,18 @@ export const DataChartWidgetCore: React.FC<{}> = memo(() => {
232228
return (
233229
<Wrapper id={renderMode + wid} className="widget-chart" ref={ref}>
234230
<ChartFrameBox>
235-
<PreviewBlock>
236-
<ChartDrillContext.Provider
237-
value={{
238-
drillOption: drillOptionRef.current,
239-
onDrillOptionChange: handleDrillOptionChange,
240-
}}
241-
>
242-
<ChartWrapper>
243-
<ChartDrillContextMenu>{chartFrame}</ChartDrillContextMenu>
244-
</ChartWrapper>
231+
<ChartDrillContext.Provider
232+
value={{
233+
drillOption: drillOptionRef.current,
234+
onDrillOptionChange: handleDrillOptionChange,
235+
}}
236+
>
237+
<ChartWrapper>
238+
<ChartDrillContextMenu>{chartFrame}</ChartDrillContextMenu>
239+
</ChartWrapper>
245240

246-
<ChartDrillPaths />
247-
</ChartDrillContext.Provider>
248-
</PreviewBlock>
241+
<ChartDrillPaths />
242+
</ChartDrillContext.Provider>
249243
</ChartFrameBox>
250244
</Wrapper>
251245
);
@@ -257,6 +251,9 @@ const Wrapper = styled.div`
257251
`;
258252
const ChartFrameBox = styled.div`
259253
position: absolute;
254+
display: flex;
255+
flex: 1;
256+
flex-direction: column;
260257
width: 100%;
261258
height: 100%;
262259
overflow: hidden;
@@ -271,12 +268,3 @@ const ChartWrapper = styled.div`
271268
height: 100%;
272269
}
273270
`;
274-
const PreviewBlock = styled.div`
275-
display: flex;
276-
flex: 1;
277-
flex-direction: column;
278-
width: 100%;
279-
height: 100%;
280-
overflow: hidden;
281-
box-shadow: ${p => p.theme.shadowBlock};
282-
`;

0 commit comments

Comments
 (0)