Unverified Commit 65137b54 authored by ZackYoung's avatar ZackYoung Committed by GitHub

[Bug]fix_web_some_bug (#2524)

* fix_web_some_bug * fix_web_some_bug
parent 6f689ac7
...@@ -46,7 +46,6 @@ export type CodeEditFormProps = { ...@@ -46,7 +46,6 @@ export type CodeEditFormProps = {
code: string; code: string;
readOnly?: boolean; readOnly?: boolean;
lineNumbers?: string; lineNumbers?: string;
theme?: string;
autoWrap?: string; autoWrap?: string;
showFloatButton?: boolean; showFloatButton?: boolean;
editorDidMount?: (editor: editor.IStandaloneCodeEditor, monaco: Monaco) => void; editorDidMount?: (editor: editor.IStandaloneCodeEditor, monaco: Monaco) => void;
......
...@@ -22,7 +22,6 @@ import CodeShow from '@/components/CustomEditor/CodeShow'; ...@@ -22,7 +22,6 @@ import CodeShow from '@/components/CustomEditor/CodeShow';
import useThemeValue from '@/hooks/useThemeValue'; import useThemeValue from '@/hooks/useThemeValue';
import { jsonToSql } from '@/pages/DataStudio/BottomContainer/Tools/JsonToSql/service'; import { jsonToSql } from '@/pages/DataStudio/BottomContainer/Tools/JsonToSql/service';
import { StateType } from '@/pages/DataStudio/model'; import { StateType } from '@/pages/DataStudio/model';
import { convertCodeEditTheme } from '@/utils/function';
import { connect } from '@@/exports'; import { connect } from '@@/exports';
import { Button, Space } from 'antd'; import { Button, Space } from 'antd';
import React, { useState } from 'react'; import React, { useState } from 'react';
...@@ -53,8 +52,7 @@ const JsonToSql: React.FC = (props: connect) => { ...@@ -53,8 +52,7 @@ const JsonToSql: React.FC = (props: connect) => {
height={maxHeight + 'px'} height={maxHeight + 'px'}
code={jsonData} code={jsonData}
language={'json'} language={'json'}
theme={convertCodeEditTheme()} onChange={(x:string) => {
onChange={(x) => {
setJsonData(x ?? ''); setJsonData(x ?? '');
}} }}
/> />
......
/* /*
* *
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with * contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. * this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0 * The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with * (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at * the License. You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
* *
*/ */
import { CircleBtn } from '@/components/CallBackButton/CircleBtn'; import {CircleBtn} from '@/components/CallBackButton/CircleBtn';
import Title from '@/components/Front/Title'; import Title from '@/components/Front/Title';
import ContentScroll from '@/components/Scroll/ContentScroll'; import ContentScroll from '@/components/Scroll/ContentScroll';
import MovableSidebar from '@/components/Sidebar/MovableSidebar'; import MovableSidebar from '@/components/Sidebar/MovableSidebar';
import { StateType, STUDIO_MODEL, VIEW } from '@/pages/DataStudio/model'; import {StateType, STUDIO_MODEL, VIEW} from '@/pages/DataStudio/model';
import { LeftBottomMoreTabs, LeftBottomSide } from '@/pages/DataStudio/route'; import {LeftBottomMoreTabs, LeftBottomSide} from '@/pages/DataStudio/route';
import { l } from '@/utils/intl'; import {l} from '@/utils/intl';
import { connect } from '@@/exports'; import {connect} from '@@/exports';
import { PlusOutlined } from '@ant-design/icons'; import {PlusOutlined} from '@ant-design/icons';
import { ConfigProvider, Space, Tabs } from 'antd'; import {ConfigProvider, Space, Tabs} from 'antd';
import React from 'react'; import React from 'react';
export type BottomContainerProps = { export type BottomContainerProps = {
size: number; size: number;
height: number | string;
}; };
const BottomContainer: React.FC<BottomContainerProps> = (props: any) => { const BottomContainer: React.FC<BottomContainerProps> = (props: any) => {
const { dispatch, size, bottomContainer } = props; const {dispatch, size, bottomContainer, height} = props;
const width = document.documentElement.clientWidth - VIEW.sideWidth * 2; const width = document.documentElement.clientWidth - VIEW.sideWidth * 2;
/** /**
* 侧边栏最小化 * 侧边栏最小化
*/ */
const handleMinimize = () => { const handleMinimize = () => {
dispatch({ dispatch({
type: STUDIO_MODEL.updateSelectBottomKey, type: STUDIO_MODEL.updateSelectBottomKey,
payload: '' payload: ''
}); });
}; };
/** /**
* 更新底部高度 * 更新底部高度
* @param {number} height * @param {number} height
*/ */
const updateBottomHeight = (height: number) => { const updateBottomHeight = (height: number) => {
dispatch({ dispatch({
type: STUDIO_MODEL.updateBottomHeight, type: STUDIO_MODEL.updateBottomHeight,
payload: height payload: height
}); });
}; };
/** /**
* 更新中间内容高度 * 更新中间内容高度
* @param {number} height * @param {number} height
*/ */
const updateCenterContentHeight = (height: number) => { const updateCenterContentHeight = (height: number) => {
dispatch({ dispatch({
type: STUDIO_MODEL.updateCenterContentHeight, type: STUDIO_MODEL.updateCenterContentHeight,
payload: height payload: height
}); });
}; };
const updateSelectBottomSubKey = (key: string) => { const updateSelectBottomSubKey = (key: string) => {
dispatch({ dispatch({
type: STUDIO_MODEL.updateSelectBottomSubKey, type: STUDIO_MODEL.updateSelectBottomSubKey,
payload: key payload: key
}); });
}; };
/** /**
* 更新工具栏内容高度 * 更新工具栏内容高度
* @param {number} height * @param {number} height
*/ */
const updateToolContentHeight = (height: number) => { const updateToolContentHeight = (height: number) => {
dispatch({ dispatch({
type: STUDIO_MODEL.updateToolContentHeight, type: STUDIO_MODEL.updateToolContentHeight,
payload: height payload: height
}); });
}; };
const getSubTabs = () => { const getSubTabs = () => {
// @ts-ignore // @ts-ignore
return Object.values( return Object.values(
Object.keys(LeftBottomMoreTabs).map((x) => Object.keys(LeftBottomMoreTabs).map((x) =>
LeftBottomMoreTabs[x].map((y) => { LeftBottomMoreTabs[x].map((y) => {
return { ...y, key: x + '/' + y.key }; return {...y, key: x + '/' + y.key};
}) })
) )
).flatMap((x) => x); ).flatMap((x) => x);
}; };
/** /**
* 拖动回调 * 拖动回调
* @param event * @param event
* @param direction * @param direction
* @param {{offsetHeight: any}} elementRef * @param {{offsetHeight: any}} elementRef
*/ */
const resizeCallback = ( const resizeCallback = (
event: any, event: any,
direction: any, direction: any,
elementRef: { elementRef: {
offsetHeight: any; offsetHeight: any;
} }
) => { ) => {
updateBottomHeight(elementRef.offsetHeight); const centerContentHeight =
const centerContentHeight = document.documentElement.clientHeight -
document.documentElement.clientHeight - VIEW.headerHeight -
VIEW.headerHeight - VIEW.headerNavHeight -
VIEW.headerNavHeight - VIEW.footerHeight -
VIEW.footerHeight - VIEW.otherHeight -
VIEW.otherHeight - elementRef.offsetHeight;
bottomContainer.height; updateBottomHeight(elementRef.offsetHeight);
updateCenterContentHeight(centerContentHeight); updateCenterContentHeight(centerContentHeight);
updateToolContentHeight(centerContentHeight - VIEW.leftMargin); updateToolContentHeight(centerContentHeight - VIEW.leftMargin);
}; };
const renderTabPane = () => { const renderTabPane = () => {
// @ts-ignore // @ts-ignore
const leftBottomMoreTab = LeftBottomMoreTabs[bottomContainer.selectKey]; const leftBottomMoreTab = LeftBottomMoreTabs[bottomContainer.selectKey];
if (leftBottomMoreTab) { if (leftBottomMoreTab) {
const items = leftBottomMoreTab.map((item: any) => { const items = leftBottomMoreTab.map((item: any) => {
return { return {
key: bottomContainer.selectKey + '/' + item.key, key: bottomContainer.selectKey + '/' + item.key,
label: ( label: (
<span> <span>
{item.icon} {item.icon}
{item.label} {item.label}
</span> </span>
) )
}; };
}); });
return ( return (
<Tabs <Tabs
style={{ height: '32px', display: '-webkit-box' }} style={{height: '32px', display: '-webkit-box'}}
items={items} items={items}
type='card' type='card'
onChange={(key: string) => { onChange={(key: string) => {
updateSelectBottomSubKey(key.split('/')[1]); updateSelectBottomSubKey(key.split('/')[1]);
}} }}
activeKey={ activeKey={
bottomContainer.selectKey + bottomContainer.selectKey +
'/' + '/' +
bottomContainer.selectSubKey[bottomContainer.selectKey] bottomContainer.selectSubKey[bottomContainer.selectKey]
} }
size='small' size='small'
tabPosition='top' tabPosition='top'
/> />
); );
} }
return <></>; return <></>;
}; };
const renderItems = () => { const renderItems = () => {
return [ return [
...LeftBottomSide.map((x) => { ...LeftBottomSide.map((x) => {
return { ...x, key: x.key + '/' }; return {...x, key: x.key + '/'};
}), }),
...getSubTabs() ...getSubTabs()
].map((item) => { ].map((item) => {
return { return {
...item, ...item,
children: ( children: (
<ContentScroll height={props.bottomContainer.height - VIEW.leftMargin}> <ContentScroll height={props.height - VIEW.leftMargin}>
{item.children} {item.children}
</ContentScroll> </ContentScroll>
) )
}; };
}); });
}; };
return ( return (
<MovableSidebar <MovableSidebar
title={ title={
<ConfigProvider <ConfigProvider
theme={{ theme={{
components: { components: {
Tabs: { Tabs: {
horizontalMargin: '0', horizontalMargin: '0',
cardPaddingSM: '6px', cardPaddingSM: '6px',
horizontalItemPadding: '0' horizontalItemPadding: '0'
} }
}
}}
>
<Space>
<Title>{l(bottomContainer.selectKey)}</Title>
{renderTabPane()}
</Space>
</ConfigProvider>
} }
}} visible={bottomContainer.selectKey}
style={{
zIndex: 999,
height: height,
marginTop: 0,
backgroundColor: '#fff',
position: 'fixed',
bottom: VIEW.footerHeight
}}
defaultSize={{width: '100%', height: height}}
minHeight={VIEW.midMargin}
maxHeight={size.contentHeight - 40}
onResize={(
event: any,
direction: any,
elementRef: {
offsetHeight: any;
}
) => resizeCallback(event, direction, elementRef)}
btnGroup={[<CircleBtn key={'max'} icon={<PlusOutlined/>}/>]}
enable={{top: true}}
handlerMinimize={handleMinimize}
maxWidth={width}
> >
<Space> <Tabs
<Title>{l(bottomContainer.selectKey)}</Title> activeKey={
{renderTabPane()} bottomContainer.selectKey +
</Space> '/' +
</ConfigProvider> (bottomContainer.selectSubKey[bottomContainer.selectKey]
} ? bottomContainer.selectSubKey[bottomContainer.selectKey]
visible={bottomContainer.selectKey} : '')
style={{ }
zIndex: 999, items={renderItems()}
height: bottomContainer.height, tabBarStyle={{display: 'none'}}
marginTop: 0, />
backgroundColor: '#fff', </MovableSidebar>
position: 'fixed', );
bottom: VIEW.footerHeight
}}
defaultSize={{ width: '100%', height: bottomContainer.height }}
minHeight={VIEW.midMargin}
maxHeight={size.contentHeight - 40}
onResize={(
event: any,
direction: any,
elementRef: {
offsetHeight: any;
}
) => resizeCallback(event, direction, elementRef)}
btnGroup={[<CircleBtn key={'max'} icon={<PlusOutlined />} />]}
enable={{ top: true }}
handlerMinimize={handleMinimize}
maxWidth={width}
>
<Tabs
activeKey={
bottomContainer.selectKey +
'/' +
(bottomContainer.selectSubKey[bottomContainer.selectKey]
? bottomContainer.selectSubKey[bottomContainer.selectKey]
: '')
}
items={renderItems()}
tabBarStyle={{ display: 'none' }}
/>
</MovableSidebar>
);
}; };
export default connect(({ Studio }: { Studio: StateType }) => ({ export default connect(({Studio}: { Studio: StateType }) => ({
leftContainer: Studio.leftContainer, bottomContainer: Studio.bottomContainer,
bottomContainer: Studio.bottomContainer,
centerContentHeight: Studio.centerContentHeight
}))(BottomContainer); }))(BottomContainer);
/* /*
* *
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with * contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. * this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0 * The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with * (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at * the License. You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
* *
*/ */
...@@ -56,7 +56,6 @@ const FooterContainer: React.FC<FooterContainerProps & StateType> = (props) => { ...@@ -56,7 +56,6 @@ const FooterContainer: React.FC<FooterContainerProps & StateType> = (props) => {
const themeValue = useThemeValue(); const themeValue = useThemeValue();
const [viewJobRunning, setViewJobRunning] = useState(false); const [viewJobRunning, setViewJobRunning] = useState(false);
const [memDetailInfo, setMemDetailInfo] = useState(memDetails); const [memDetailInfo, setMemDetailInfo] = useState(memDetails);
const currentTab = getCurrentTab(tabs.panes ?? [], tabs.activeKey); const currentTab = getCurrentTab(tabs.panes ?? [], tabs.activeKey);
useEffect(() => { useEffect(() => {
......
/* /*
* *
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with * contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. * this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0 * The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with * (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at * the License. You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
* *
*/ */
import { CircleBtn, CircleDataStudioButtonProps } from '@/components/CallBackButton/CircleBtn'; import {CircleBtn, CircleDataStudioButtonProps} from '@/components/CallBackButton/CircleBtn';
import MovableSidebar, { MovableSidebarProps } from '@/components/Sidebar/MovableSidebar'; import MovableSidebar, {MovableSidebarProps} from '@/components/Sidebar/MovableSidebar';
import useThemeValue from '@/hooks/useThemeValue'; import useThemeValue from '@/hooks/useThemeValue';
import ProjectTitle from '@/pages/DataStudio/LeftContainer/Project/ProjectTitle'; import ProjectTitle from '@/pages/DataStudio/LeftContainer/Project/ProjectTitle';
import { StateType, STUDIO_MODEL, VIEW } from '@/pages/DataStudio/model'; import {StateType, STUDIO_MODEL, VIEW} from '@/pages/DataStudio/model';
import { BtnRoute, LeftSide } from '@/pages/DataStudio/route'; import {BtnRoute, LeftSide} from '@/pages/DataStudio/route';
import { connect } from '@@/exports'; import {connect} from '@@/exports';
import { Tabs } from 'antd'; import {Tabs} from 'antd';
import React from 'react'; import React from 'react';
export type LeftContainerProps = { export type LeftContainerProps = {
size: number; size: number;
leftContainer: StateType['leftContainer'];
rightContainer: StateType['rightContainer'];
}; };
const LeftContainer: React.FC<LeftContainerProps> = (props: any) => { const LeftContainer: React.FC<LeftContainerProps> = (props: any) => {
const { const {
dispatch, dispatch,
size, size,
toolContentHeight, toolContentHeight,
leftContainer, leftContainer,
rightContainer, rightContainer,
tabs: { panes, activeKey } tabs: {panes, activeKey}
} = props; } = props;
const themeValue = useThemeValue(); const themeValue = useThemeValue();
const MAX_WIDTH = size.width - 2 * VIEW.leftToolWidth - rightContainer.width - 700;
/**
* 侧边栏大小变化
* @param width
*/
const handleReSizeChange = (width: any) => {
dispatch({
type: STUDIO_MODEL.updateLeftWidth,
payload: width
});
};
const MAX_WIDTH = size.width - 2 * VIEW.leftToolWidth - rightContainer.width - 700; /**
/** * 侧边栏最小化
* 侧边栏大小变化 */
* @param width const handleMinimize = () => {
*/ dispatch({
const handleReSizeChange = (width: any) => { type: STUDIO_MODEL.updateSelectLeftKey,
dispatch({ payload: ''
type: STUDIO_MODEL.updateLeftWidth, });
payload: width };
});
};
/** /**
* 侧边栏最小化 * 侧边栏最大化
*/ */
const handleMinimize = () => { const handleMaxsize = () => {
dispatch({ handleReSizeChange(MAX_WIDTH);
type: STUDIO_MODEL.updateSelectLeftKey, };
payload: ''
});
};
/** /**
* 侧边栏最大化 * 侧边栏属性
*/ * @type {{onResize: (event: any, direction: any, elementRef: {offsetWidth: any}) => void, visible: boolean, defaultSize: {width: any, height: any}, enable: {right: boolean}, minWidth: number, title: string, handlerMinimize: () => void, contentHeight: any, maxWidth: number}}
const handleMaxsize = () => { */
handleReSizeChange(MAX_WIDTH); const restMovableSidebarProps: MovableSidebarProps = {
}; contentHeight: toolContentHeight,
onResize: (event: any, direction: any, elementRef: { offsetWidth: any }) =>
handleReSizeChange(elementRef.offsetWidth),
title: <ProjectTitle/>,
handlerMinimize: () => handleMinimize(),
handlerMaxsize: handleMaxsize,
visible: leftContainer.selectKey !== '',
defaultSize: {width: leftContainer.width, height: leftContainer.height},
minWidth: 160,
maxWidth: MAX_WIDTH,
enable: {right: true},
btnGroup: BtnRoute[leftContainer.selectKey]
? BtnRoute[leftContainer.selectKey].map((item: CircleDataStudioButtonProps) => (
<CircleBtn
title={item.title}
icon={item.icon}
onClick={() => item.onClick?.(panes, activeKey)}
key={item.title}
/>
))
: [],
style: {borderInlineEnd: `1px solid ${themeValue.borderColor}`}
};
/** const content = (
* 侧边栏属性 <Tabs activeKey={leftContainer.selectKey} items={LeftSide} tabBarStyle={{display: 'none'}}/>
* @type {{onResize: (event: any, direction: any, elementRef: {offsetWidth: any}) => void, visible: boolean, defaultSize: {width: any, height: any}, enable: {right: boolean}, minWidth: number, title: string, handlerMinimize: () => void, contentHeight: any, maxWidth: number}} );
*/
const restMovableSidebarProps: MovableSidebarProps = {
contentHeight: toolContentHeight,
onResize: (event: any, direction: any, elementRef: { offsetWidth: any }) =>
handleReSizeChange(elementRef.offsetWidth),
title: <ProjectTitle />,
handlerMinimize: () => handleMinimize(),
handlerMaxsize: handleMaxsize,
visible: leftContainer.selectKey !== '',
defaultSize: { width: leftContainer.width, height: leftContainer.height },
minWidth: 160,
maxWidth: MAX_WIDTH,
enable: { right: true },
btnGroup: BtnRoute[leftContainer.selectKey]
? BtnRoute[leftContainer.selectKey].map((item: CircleDataStudioButtonProps) => (
<CircleBtn
title={item.title}
icon={item.icon}
onClick={() => item.onClick?.(panes, activeKey)}
key={item.title}
/>
))
: [],
style: { borderInlineEnd: `1px solid ${themeValue.borderColor}` }
};
const content = ( return (
<Tabs activeKey={leftContainer.selectKey} items={LeftSide} tabBarStyle={{ display: 'none' }} /> <MovableSidebar {...restMovableSidebarProps}>
); {/*<Tabs activeKey={leftContainer.selectKey} items={LeftSide} tabBarStyle={{display: "none"}}/>*/}
{content}
return ( </MovableSidebar>
<MovableSidebar {...restMovableSidebarProps}> );
{/*<Tabs activeKey={leftContainer.selectKey} items={LeftSide} tabBarStyle={{display: "none"}}/>*/}
{content}
</MovableSidebar>
);
}; };
export default connect(({ Studio }: { Studio: StateType }) => ({ export default connect(({Studio}: { Studio: StateType }) => ({
leftContainer: Studio.leftContainer, // leftContainer: Studio.leftContainer,
rightContainer: Studio.rightContainer, // rightContainer: Studio.rightContainer,
toolContentHeight: Studio.toolContentHeight, toolContentHeight: Studio.toolContentHeight,
tabs: Studio.tabs tabs: Studio.tabs
}))(LeftContainer); }))(LeftContainer);
/* /*
* *
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with * contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. * this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0 * The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with * (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at * the License. You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
* *
*/ */
...@@ -26,6 +26,7 @@ import { DiffEditor } from '@monaco-editor/react'; ...@@ -26,6 +26,7 @@ import { DiffEditor } from '@monaco-editor/react';
import { Col, Modal, Row, Space, Table, Tabs, Typography } from 'antd'; import { Col, Modal, Row, Space, Table, Tabs, Typography } from 'antd';
import React from 'react'; import React from 'react';
import styles from './index.less'; import styles from './index.less';
import {convertCodeEditTheme} from "@/utils/function";
const { Text, Link } = Typography; const { Text, Link } = Typography;
...@@ -61,6 +62,7 @@ const DiffModal: React.FC<DiffModalProps> = (props) => { ...@@ -61,6 +62,7 @@ const DiffModal: React.FC<DiffModalProps> = (props) => {
{...DIFF_EDITOR_PARAMS} {...DIFF_EDITOR_PARAMS}
original={statementDiff?.server} original={statementDiff?.server}
modified={statementDiff?.cache} modified={statementDiff?.cache}
theme={convertCodeEditTheme()}
/> />
</div> </div>
) : ( ) : (
......
...@@ -31,6 +31,7 @@ import { Button, Card, Modal, Tag } from 'antd'; ...@@ -31,6 +31,7 @@ import { Button, Card, Modal, Tag } from 'antd';
import moment from 'moment'; import moment from 'moment';
import React, { useState } from 'react'; import React, { useState } from 'react';
import { connect } from 'umi'; import { connect } from 'umi';
import {convertCodeEditTheme} from "@/utils/function";
const HistoryVersion = (props: any) => { const HistoryVersion = (props: any) => {
const { const {
...@@ -93,9 +94,9 @@ const HistoryVersion = (props: any) => { ...@@ -93,9 +94,9 @@ const HistoryVersion = (props: any) => {
automaticLayout: true automaticLayout: true
}} }}
language={'sql'} language={'sql'}
theme={'vs-dark'}
original={originalValue} original={originalValue}
modified={currentValue} modified={currentValue}
theme={convertCodeEditTheme()}
/> />
</React.StrictMode> </React.StrictMode>
</Modal> </Modal>
......
...@@ -225,7 +225,7 @@ const DataStudio = (props: any) => { ...@@ -225,7 +225,7 @@ const DataStudio = (props: any) => {
<Content style={{ display: 'flex', flexDirection: 'column', minWidth: 0 }}> <Content style={{ display: 'flex', flexDirection: 'column', minWidth: 0 }}>
<div style={{ display: 'flex' }}> <div style={{ display: 'flex' }}>
<LeftContainer size={size} /> <LeftContainer size={size} leftContainer={leftContainer} rightContainer={rightContainer} />
<Content <Content
style={{ style={{
width: width:
...@@ -236,7 +236,7 @@ const DataStudio = (props: any) => { ...@@ -236,7 +236,7 @@ const DataStudio = (props: any) => {
</Content> </Content>
<RightContainer size={size} bottomHeight={bottomHeight} /> <RightContainer size={size} bottomHeight={bottomHeight} />
</div> </div>
{<BottomContainer size={size} />} {<BottomContainer size={size} height={bottomHeight} />}
</Content> </Content>
<Sider collapsed collapsedWidth={40}> <Sider collapsed collapsedWidth={40}>
......
...@@ -425,19 +425,25 @@ const Model: ModelType = { ...@@ -425,19 +425,25 @@ const Model: ModelType = {
* 更新工具栏高度 * 更新工具栏高度
*/ */
updateToolContentHeight(state, { payload }) { updateToolContentHeight(state, { payload }) {
return { if (payload != state.toolContentHeight) {
...state, return {
toolContentHeight: payload ...state,
}; toolContentHeight: payload
};
}
return state;
}, },
/** /**
* 更新中间内容高度 * 更新中间内容高度
*/ */
updateCenterContentHeight(state, { payload }) { updateCenterContentHeight(state, { payload }) {
return { if (payload != state.centerContentHeight) {
...state, return {
centerContentHeight: payload ...state,
}; centerContentHeight: payload
};
}
return state;
}, },
/** /**
* 更新左侧选中key * 更新左侧选中key
...@@ -536,13 +542,16 @@ const Model: ModelType = { ...@@ -536,13 +542,16 @@ const Model: ModelType = {
* 更新底部高度 * 更新底部高度
*/ */
updateBottomHeight(state, { payload }) { updateBottomHeight(state, { payload }) {
return { if (payload!=state.bottomContainer.height) {
...state, return {
bottomContainer: { ...state,
...state.bottomContainer, bottomContainer: {
height: payload ...state.bottomContainer,
} height: payload
}; }
};
}
return state;
}, },
/** /**
* 更新数据库列表 * 更新数据库列表
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment