Unverified Commit 5eb34dc1 authored by ZackYoung's avatar ZackYoung Committed by GitHub

[Fix][Web] Fix DataStudio page bug (#2338)

* optimize_docker_action * optimize_docker_action * optimize_docker_action * fix datastudio develop page bug * fix sse * optimize_action
parent bb8b272d
...@@ -77,7 +77,7 @@ jobs: ...@@ -77,7 +77,7 @@ jobs:
${{ runner.os }}-node- ${{ runner.os }}-node-
- name: Install Dependencies - name: Install Dependencies
if: steps.filter.outputs.frontend == 'true' if: steps.filter.outputs.frontend == 'true'
run: cd dinky-web && npm install --prefer-offline --no-audit --progress=false --legacy-peer-deps run: cd dinky-web && npm install --no-audit --progress=false --legacy-peer-deps
- name: Npm Web Build - name: Npm Web Build
if: steps.filter.outputs.frontend == 'true' if: steps.filter.outputs.frontend == 'true'
run: cd dinky-web && npm run build run: cd dinky-web && npm run build
......
...@@ -46,9 +46,9 @@ jobs: ...@@ -46,9 +46,9 @@ jobs:
key: ${{ runner.os }}-maven-${{ hashFiles('pom.xml') }} key: ${{ runner.os }}-maven-${{ hashFiles('pom.xml') }}
restore-keys: | restore-keys: |
${{ runner.os }}-maven- ${{ runner.os }}-maven-
- name: Check Style # - name: Check Style
run: | # run: |
./mvnw -T 4C -B --no-snapshot-updates clean spotless:check # ./mvnw -T 4C -B --no-snapshot-updates clean spotless:check
- name: Build and Package - name: Build and Package
run: | run: |
./mvnw -B clean install \ ./mvnw -B clean install \
...@@ -75,9 +75,6 @@ jobs: ...@@ -75,9 +75,6 @@ jobs:
namespace: dinkydocker namespace: dinkydocker
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Move Dockerfile
run: |
cp ./docker/Dockerfile* ./
- name: Log in to the Container registry,url -> ${{ matrix.url }} - name: Log in to the Container registry,url -> ${{ matrix.url }}
if: ${{ matrix.url == 'registry.cn-hangzhou.aliyuncs.com'}} if: ${{ matrix.url == 'registry.cn-hangzhou.aliyuncs.com'}}
uses: docker/login-action@v2 uses: docker/login-action@v2
...@@ -95,7 +92,7 @@ jobs: ...@@ -95,7 +92,7 @@ jobs:
- name: push docker dinky mysql image - name: push docker dinky mysql image
uses: docker/build-push-action@v2 uses: docker/build-push-action@v2
with: with:
file: DockerfileMysql file: docker/DockerfileMysql
context: . context: .
push: true push: true
tags: ${{ matrix.url }}/${{ matrix.namespace }}/dinky-mysql-server:${{ inputs.version }} tags: ${{ matrix.url }}/${{ matrix.namespace }}/dinky-mysql-server:${{ inputs.version }}
...@@ -167,11 +164,11 @@ jobs: ...@@ -167,11 +164,11 @@ jobs:
FLINK_BIG_VERSION: 1.13 FLINK_BIG_VERSION: 1.13
- FLINK_VERSION: 1.14.6 - FLINK_VERSION: 1.14.6
FLINK_BIG_VERSION: 1.14 FLINK_BIG_VERSION: 1.14
- FLINK_VERSION: 1.15.2 - FLINK_VERSION: 1.15.4
FLINK_BIG_VERSION: 1.15 FLINK_BIG_VERSION: 1.15
- FLINK_VERSION: 1.16.0 - FLINK_VERSION: 1.16.2
FLINK_BIG_VERSION: 1.16 FLINK_BIG_VERSION: 1.16
- FLINK_VERSION : 1.17.0 - FLINK_VERSION : 1.17.1
FLINK_BIG_VERSION: 1.17 FLINK_BIG_VERSION: 1.17
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
...@@ -208,7 +205,7 @@ jobs: ...@@ -208,7 +205,7 @@ jobs:
FLINK_VERSION=${{ matrix.FLINK_VERSION }} FLINK_VERSION=${{ matrix.FLINK_VERSION }}
DINKY_IMAGE=${{ matrix.url }}/${{ matrix.namespace }}/dinky-standalone-server:${{ inputs.version }} DINKY_IMAGE=${{ matrix.url }}/${{ matrix.namespace }}/dinky-standalone-server:${{ inputs.version }}
FLINK_BIG_VERSION=${{ matrix.FLINK_BIG_VERSION }} FLINK_BIG_VERSION=${{ matrix.FLINK_BIG_VERSION }}
file: DockerfileDinkyFlink file: ./docker/DockerfileDinkyFlink
context: . context: .
push: true push: true
tags: ${{ matrix.url }}/${{ matrix.namespace }}/dinky-standalone-server:${{ inputs.version }}-flink-${{matrix.FLINK_BIG_VERSION }} tags: ${{ matrix.url }}/${{ matrix.namespace }}/dinky-standalone-server:${{ inputs.version }}-flink-${{matrix.FLINK_BIG_VERSION }}
...@@ -34,7 +34,6 @@ import org.apache.paimon.data.Timestamp; ...@@ -34,7 +34,6 @@ import org.apache.paimon.data.Timestamp;
import org.apache.paimon.predicate.Predicate; import org.apache.paimon.predicate.Predicate;
import org.apache.paimon.predicate.PredicateBuilder; import org.apache.paimon.predicate.PredicateBuilder;
import java.io.IOException;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
...@@ -106,8 +105,6 @@ public class MonitorServiceImpl extends ServiceImpl<MetricsMapper, Metrics> impl ...@@ -106,8 +105,6 @@ public class MonitorServiceImpl extends ServiceImpl<MetricsMapper, Metrics> impl
sseEmitter.send(JSONUtil.toJsonStr(Jvm.of())); sseEmitter.send(JSONUtil.toJsonStr(Jvm.of()));
ThreadUtil.sleep(10000); ThreadUtil.sleep(10000);
} }
} catch (IOException e) {
sseEmitter.complete();
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
sseEmitter.complete(); sseEmitter.complete();
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
package org.dinky.sse; package org.dinky.sse;
import java.io.IOException;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import org.springframework.http.HttpHeaders; import org.springframework.http.HttpHeaders;
...@@ -26,6 +27,10 @@ import org.springframework.http.MediaType; ...@@ -26,6 +27,10 @@ import org.springframework.http.MediaType;
import org.springframework.http.server.ServerHttpResponse; import org.springframework.http.server.ServerHttpResponse;
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter; import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;
import cn.hutool.core.util.ReflectUtil;
import lombok.extern.slf4j.Slf4j;
@Slf4j
public class SseEmitterUTF8 extends SseEmitter { public class SseEmitterUTF8 extends SseEmitter {
public SseEmitterUTF8(Long timeout) { public SseEmitterUTF8(Long timeout) {
super(timeout); super(timeout);
...@@ -38,4 +43,14 @@ public class SseEmitterUTF8 extends SseEmitter { ...@@ -38,4 +43,14 @@ public class SseEmitterUTF8 extends SseEmitter {
HttpHeaders headers = outputMessage.getHeaders(); HttpHeaders headers = outputMessage.getHeaders();
headers.setContentType(new MediaType(MediaType.TEXT_EVENT_STREAM, StandardCharsets.UTF_8)); headers.setContentType(new MediaType(MediaType.TEXT_EVENT_STREAM, StandardCharsets.UTF_8));
} }
@Override
public void send(Object object, MediaType mediaType) throws IOException {
Boolean complete = (Boolean) ReflectUtil.getFieldValue(this, "complete");
if (complete) {
log.warn("SseEmitter is complete, cannot send message: {}", object);
return;
}
super.send(object, mediaType);
}
} }
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
"omit.js": "^2.0.2", "omit.js": "^2.0.2",
"rc-menu": "^9.8.4", "rc-menu": "^9.8.4",
"rc-util": "^5.33.0", "rc-util": "^5.33.0",
"re-resizable": "6.9.9", "re-resizable": "6.9.11",
"react": "^18.2.0", "react": "^18.2.0",
"react-countup": "^6.4.2", "react-countup": "^6.4.2",
"react-dom": "^18.0.0", "react-dom": "^18.0.0",
......
...@@ -20,6 +20,7 @@ export type MovableSidebarProps = { ...@@ -20,6 +20,7 @@ export type MovableSidebarProps = {
handlerMaxsize?: () => void; handlerMaxsize?: () => void;
btnGroup?: React.ReactNode[]; btnGroup?: React.ReactNode[];
onResize?: ResizeCallback; onResize?: ResizeCallback;
onResizeStop?: ResizeCallback;
style?: React.CSSProperties; style?: React.CSSProperties;
tagList?: TabPaneProps[]; tagList?: TabPaneProps[];
}; };
...@@ -32,6 +33,7 @@ const MovableSidebar: React.FC<MovableSidebarProps> = (props) => { ...@@ -32,6 +33,7 @@ const MovableSidebar: React.FC<MovableSidebarProps> = (props) => {
style, style,
visible, visible,
onResize, onResize,
onResizeStop,
defaultSize, defaultSize,
minWidth, minWidth,
maxWidth, maxWidth,
...@@ -57,6 +59,7 @@ const MovableSidebar: React.FC<MovableSidebarProps> = (props) => { ...@@ -57,6 +59,7 @@ const MovableSidebar: React.FC<MovableSidebarProps> = (props) => {
borderRadius: 5 borderRadius: 5
}} }}
onResize={onResize} onResize={onResize}
onResizeStop={onResizeStop}
defaultSize={defaultSize} defaultSize={defaultSize}
minWidth={minWidth} minWidth={minWidth}
maxWidth={maxWidth} maxWidth={maxWidth}
...@@ -64,27 +67,6 @@ const MovableSidebar: React.FC<MovableSidebarProps> = (props) => { ...@@ -64,27 +67,6 @@ const MovableSidebar: React.FC<MovableSidebarProps> = (props) => {
maxHeight={maxHeight} maxHeight={maxHeight}
enable={enable} enable={enable}
> >
{/*<PageContainer*/}
{/* title={title}*/}
{/* tabProps={{*/}
{/* type: "editable-card",*/}
{/* hideAdd: true,*/}
{/* size: "small",*/}
{/* animated: true,*/}
{/* tabBarStyle: {margin: 0, padding: 0},*/}
{/* }}*/}
{/* tabList={tagList}*/}
{/* extra={[*/}
{/* <Button title={l('global.mini')} key={"minimize"} icon={<MinusOutlined/>} block type={"text"} shape={"circle"}*/}
{/* onClick={props.handlerMinimize}/>*/}
{/* // <MinusSquareOutlined size={15} title={l('global.mini')} key={"minimize"} onClick={handlerMinimize}/>,*/}
{/* // <MinusOutlined size={35} title={l('global.mini')} key={"minimize"} onClick={handlerMinimize}/>,*/}
{/* // <PlusSquareOutlined size={15} title={l('global.max')} key={"maximize"} onClick={handlerMaxsize}/>*/}
{/* ]}*/}
{/* fixedHeader*/}
{/*>*/}
{/* <div style={{height: contentHeight,marginBlock:-5,marginInline:-10}}>{children}</div>*/}
{/*</PageContainer>*/}
<> <>
<div <div
style={{ style={{
...@@ -95,7 +77,7 @@ const MovableSidebar: React.FC<MovableSidebarProps> = (props) => { ...@@ -95,7 +77,7 @@ const MovableSidebar: React.FC<MovableSidebarProps> = (props) => {
> >
<div>{title}</div> <div>{title}</div>
<div className={showBtn ? 'show' : 'hide'}> <div className={showBtn ? 'show' : 'hide'}>
<Space size={5}> <Space size={1}>
{props.btnGroup} {props.btnGroup}
<CircleBtn onClick={props.handlerMinimize} icon={<MinusOutlined />} /> <CircleBtn onClick={props.handlerMinimize} icon={<MinusOutlined />} />
</Space> </Space>
......
...@@ -369,6 +369,9 @@ h5 { ...@@ -369,6 +369,9 @@ h5 {
font-weight: 500; font-weight: 500;
font-size: 15px; font-size: 15px;
font-family: 'SimHei', serif; font-family: 'SimHei', serif;
overflow: visible;
white-space: nowrap;
text-overflow: ellipsis;
} }
.container-header { .container-header {
display: flex; display: flex;
......
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;
}; };
const BottomContainer: React.FC<BottomContainerProps> = (props: any) => { const BottomContainer: React.FC<BottomContainerProps> = (props: any) => {
const { dispatch, size, bottomContainer } = props; const {dispatch, size, bottomContainer} = props;
const width = document.documentElement.clientWidth - VIEW.sideWidth * 2;
/** /**
* 侧边栏最小化 * 侧边栏最小化
...@@ -70,7 +71,7 @@ const BottomContainer: React.FC<BottomContainerProps> = (props: any) => { ...@@ -70,7 +71,7 @@ const BottomContainer: React.FC<BottomContainerProps> = (props: any) => {
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);
...@@ -82,7 +83,9 @@ const BottomContainer: React.FC<BottomContainerProps> = (props: any) => { ...@@ -82,7 +83,9 @@ const BottomContainer: React.FC<BottomContainerProps> = (props: any) => {
* @param direction * @param direction
* @param {{offsetHeight: any}} elementRef * @param {{offsetHeight: any}} elementRef
*/ */
const resizeCallback = (event: any, direction: any, elementRef: { offsetHeight: any }) => { const resizeCallback = (event: any, direction: any, elementRef: {
offsetHeight: any
}) => {
updateBottomHeight(elementRef.offsetHeight); updateBottomHeight(elementRef.offsetHeight);
const centerContentHeight = const centerContentHeight =
document.documentElement.clientHeight - document.documentElement.clientHeight -
...@@ -92,7 +95,7 @@ const BottomContainer: React.FC<BottomContainerProps> = (props: any) => { ...@@ -92,7 +95,7 @@ const BottomContainer: React.FC<BottomContainerProps> = (props: any) => {
VIEW.otherHeight - VIEW.otherHeight -
bottomContainer.height; bottomContainer.height;
updateCenterContentHeight(centerContentHeight); updateCenterContentHeight(centerContentHeight);
updateToolContentHeight(centerContentHeight - VIEW.midMargin); updateToolContentHeight(centerContentHeight - VIEW.leftMargin);
}; };
const renderTabPane = () => { const renderTabPane = () => {
...@@ -112,7 +115,7 @@ const BottomContainer: React.FC<BottomContainerProps> = (props: any) => { ...@@ -112,7 +115,7 @@ const BottomContainer: React.FC<BottomContainerProps> = (props: any) => {
}); });
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) => {
...@@ -133,14 +136,14 @@ const BottomContainer: React.FC<BottomContainerProps> = (props: any) => { ...@@ -133,14 +136,14 @@ const BottomContainer: React.FC<BottomContainerProps> = (props: any) => {
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.midMargin}> <ContentScroll height={props.bottomContainer.height - VIEW.leftMargin}>
{item.children} {item.children}
</ContentScroll> </ContentScroll>
) )
...@@ -148,7 +151,6 @@ const BottomContainer: React.FC<BottomContainerProps> = (props: any) => { ...@@ -148,7 +151,6 @@ const BottomContainer: React.FC<BottomContainerProps> = (props: any) => {
}); });
}; };
// @ts-ignore
return ( return (
<MovableSidebar <MovableSidebar
title={ title={
...@@ -169,14 +171,16 @@ const BottomContainer: React.FC<BottomContainerProps> = (props: any) => { ...@@ -169,14 +171,16 @@ const BottomContainer: React.FC<BottomContainerProps> = (props: any) => {
</Space> </Space>
</ConfigProvider> </ConfigProvider>
} }
visible={bottomContainer.selectKey !== ''} visible={bottomContainer.selectKey}
style={{ style={{
zIndex: 999, zIndex: 999,
height: bottomContainer.height, height: bottomContainer.height,
marginTop: 0, marginTop: 0,
backgroundColor: '#fff' backgroundColor: '#fff',
position: "fixed",
bottom: VIEW.footerHeight
}} }}
defaultSize={{ width: '100%', height: bottomContainer.height }} defaultSize={{width: '100%', height: bottomContainer.height}}
minHeight={VIEW.midMargin} minHeight={VIEW.midMargin}
maxHeight={size.contentHeight - 40} maxHeight={size.contentHeight - 40}
onResize={( onResize={(
...@@ -186,9 +190,10 @@ const BottomContainer: React.FC<BottomContainerProps> = (props: any) => { ...@@ -186,9 +190,10 @@ const BottomContainer: React.FC<BottomContainerProps> = (props: any) => {
offsetHeight: any; offsetHeight: any;
} }
) => resizeCallback(event, direction, elementRef)} ) => resizeCallback(event, direction, elementRef)}
btnGroup={[<CircleBtn key={'max'} icon={<PlusOutlined />} />]} btnGroup={[<CircleBtn key={'max'} icon={<PlusOutlined/>}/>]}
enable={{ top: true }} enable={{top: true}}
handlerMinimize={handleMinimize} handlerMinimize={handleMinimize}
maxWidth={width}
> >
<Tabs <Tabs
activeKey={ activeKey={
...@@ -199,13 +204,15 @@ const BottomContainer: React.FC<BottomContainerProps> = (props: any) => { ...@@ -199,13 +204,15 @@ const BottomContainer: React.FC<BottomContainerProps> = (props: any) => {
: '') : '')
} }
items={renderItems()} items={renderItems()}
tabBarStyle={{ display: 'none' }} tabBarStyle={{display: 'none'}}
/> />
</MovableSidebar> </MovableSidebar>
); );
}; };
export default connect(({ Studio }: { Studio: StateType }) => ({ export default connect(({Studio}: {
Studio: StateType
}) => ({
leftContainer: Studio.leftContainer, leftContainer: Studio.leftContainer,
bottomContainer: Studio.bottomContainer, bottomContainer: Studio.bottomContainer,
centerContentHeight: Studio.centerContentHeight centerContentHeight: Studio.centerContentHeight
......
...@@ -144,7 +144,11 @@ const FooterContainer: React.FC<FooterContainerProps & StateType> = (props) => { ...@@ -144,7 +144,11 @@ const FooterContainer: React.FC<FooterContainerProps & StateType> = (props) => {
height: VIEW.footerHeight, height: VIEW.footerHeight,
width: '100%', width: '100%',
display: 'flex', display: 'flex',
paddingInline: 10 paddingInline: 10,
position: 'fixed',
bottom: 0,
right: 0,
left: 0,
}} }}
> >
<Space style={{ direction: 'ltr', width: '30%%' }}> <Space style={{ direction: 'ltr', width: '30%%' }}>
......
...@@ -4,11 +4,11 @@ import { connect } from '@@/exports'; ...@@ -4,11 +4,11 @@ import { connect } from '@@/exports';
import { Editor } from '@monaco-editor/react'; import { Editor } from '@monaco-editor/react';
import { editor } from 'monaco-editor'; import { editor } from 'monaco-editor';
import React from 'react'; import React from 'react';
import {never} from "@umijs/utils/compiled/zod";
export type EditorProps = { export type EditorProps = {
statement: string; statement: string;
}; };
const { ScrollType } = editor;
const CodeEditor: React.FC<EditorProps & any> = (props) => { const CodeEditor: React.FC<EditorProps & any> = (props) => {
const { const {
...@@ -64,12 +64,12 @@ const CodeEditor: React.FC<EditorProps & any> = (props) => { ...@@ -64,12 +64,12 @@ const CodeEditor: React.FC<EditorProps & any> = (props) => {
}); });
}); });
}} }}
onChange={(v, d) => { onChange={(v) => {
if (!current) { if (!current) {
return; return;
} }
current.statement = v; typeof v === "string" ? current.statement = v :never;
dispatch({ dispatch({
type: STUDIO_MODEL.saveTabs, type: STUDIO_MODEL.saveTabs,
payload: { ...props.tabs } payload: { ...props.tabs }
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
import { KEY_BOARD_MIDDLE } from '@/pages/DataStudio/MiddleContainer/KeyBoard/constant'; import { KEY_BOARD_MIDDLE } from '@/pages/DataStudio/MiddleContainer/KeyBoard/constant';
import { l } from '@/utils/intl'; import { l } from '@/utils/intl';
import { Divider, Typography } from 'antd'; import { Divider, Typography } from 'antd';
import {Fragment} from "react";
const { Title, Paragraph, Text } = Typography; const { Title, Paragraph, Text } = Typography;
...@@ -27,7 +28,7 @@ const KeyBoard = () => { ...@@ -27,7 +28,7 @@ const KeyBoard = () => {
const buildKeyBoard = () => { const buildKeyBoard = () => {
return KEY_BOARD_MIDDLE.map((item, index) => { return KEY_BOARD_MIDDLE.map((item, index) => {
return ( return (
<> <Fragment key={index}>
{index % 5 === 0 ? ( {index % 5 === 0 ? (
<> <>
<Divider plain orientationMargin={0} /> <Divider plain orientationMargin={0} />
...@@ -42,7 +43,7 @@ const KeyBoard = () => { ...@@ -42,7 +43,7 @@ const KeyBoard = () => {
<Divider type='vertical' /> <Divider type='vertical' />
</> </>
)} )}
</> </Fragment>
); );
}); });
}; };
......
...@@ -21,6 +21,7 @@ import { QUICK_GUIDE } from '@/pages/DataStudio/MiddleContainer/QuickGuide/const ...@@ -21,6 +21,7 @@ import { QUICK_GUIDE } from '@/pages/DataStudio/MiddleContainer/QuickGuide/const
import { l } from '@/utils/intl'; import { l } from '@/utils/intl';
import { Link } from '@umijs/max'; import { Link } from '@umijs/max';
import { Divider, Typography } from 'antd'; import { Divider, Typography } from 'antd';
import {Fragment} from "react";
const { Title, Paragraph } = Typography; const { Title, Paragraph } = Typography;
...@@ -28,7 +29,7 @@ const QuickGuide = () => { ...@@ -28,7 +29,7 @@ const QuickGuide = () => {
const buildQuickGuide = () => { const buildQuickGuide = () => {
return QUICK_GUIDE.map((item, index) => { return QUICK_GUIDE.map((item, index) => {
return ( return (
<> <Fragment key={index}>
{index % 5 === 0 ? ( {index % 5 === 0 ? (
<> <>
<Divider plain orientationMargin={0} /> <Divider plain orientationMargin={0} />
...@@ -44,7 +45,7 @@ const QuickGuide = () => { ...@@ -44,7 +45,7 @@ const QuickGuide = () => {
</Link> </Link>
</> </>
)} )}
</> </Fragment>
); );
}); });
}; };
......
...@@ -267,14 +267,15 @@ const MiddleContainer = (props: any) => { ...@@ -267,14 +267,15 @@ const MiddleContainer = (props: any) => {
const renderMiddleContent = () => { const renderMiddleContent = () => {
if (tabItems?.length === 0) { if (tabItems?.length === 0) {
return ( return (
<> // 这里必需设置高度,否则会导致下册内容无法正常拉动
<div style={{height:0}}>
<KeyBoard /> <KeyBoard />
<Divider /> <Divider />
<br /> <br />
<br /> <br />
<br /> <br />
<QuickGuide /> <QuickGuide />
</> </div>
); );
} }
......
...@@ -20,12 +20,12 @@ ...@@ -20,12 +20,12 @@
import Title from '@/components/Front/Title'; import Title from '@/components/Front/Title';
import MovableSidebar from '@/components/Sidebar/MovableSidebar'; import MovableSidebar from '@/components/Sidebar/MovableSidebar';
import useThemeValue from '@/hooks/useThemeValue'; import useThemeValue from '@/hooks/useThemeValue';
import { mapDispatchToProps } from '@/pages/DataStudio/function'; import {mapDispatchToProps} from '@/pages/DataStudio/function';
import { StateType, VIEW } from '@/pages/DataStudio/model'; import {StateType, VIEW} from '@/pages/DataStudio/model';
import { RightSide } from '@/pages/DataStudio/route'; import {RightSide} from '@/pages/DataStudio/route';
import { l } from '@/utils/intl'; import {l} from '@/utils/intl';
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 RightContainerProps = { export type RightContainerProps = {
...@@ -38,7 +38,7 @@ const RightContainer: React.FC<RightContainerProps> = (prop: any) => { ...@@ -38,7 +38,7 @@ const RightContainer: React.FC<RightContainerProps> = (prop: any) => {
size, size,
leftContainer, leftContainer,
rightContainer, rightContainer,
bottomHeight, toolContentHeight,
updateRightWidth, updateRightWidth,
updateSelectRightKey, updateSelectRightKey,
tabs tabs
...@@ -46,7 +46,7 @@ const RightContainer: React.FC<RightContainerProps> = (prop: any) => { ...@@ -46,7 +46,7 @@ const RightContainer: React.FC<RightContainerProps> = (prop: any) => {
const maxWidth = size.width - 2 * VIEW.leftToolWidth - leftContainer.width - 600; const maxWidth = size.width - 2 * VIEW.leftToolWidth - leftContainer.width - 600;
return ( return (
<MovableSidebar <MovableSidebar
contentHeight={size.contentHeight - VIEW.midMargin - bottomHeight} contentHeight={toolContentHeight}
onResize={( onResize={(
event: any, event: any,
direction: any, direction: any,
...@@ -64,14 +64,14 @@ const RightContainer: React.FC<RightContainerProps> = (prop: any) => { ...@@ -64,14 +64,14 @@ const RightContainer: React.FC<RightContainerProps> = (prop: any) => {
}} }}
minWidth={200} minWidth={200}
maxWidth={maxWidth} maxWidth={maxWidth}
enable={{ left: true }} enable={{left: true}}
style={{ borderInlineStart: `1px solid ${themeValue.borderColor}` }} style={{borderInlineStart: `1px solid ${themeValue.borderColor}`}}
> >
{tabs.panes.length > 0 ? ( {tabs.panes.length > 0 ? (
<Tabs <Tabs
activeKey={rightContainer.selectKey} activeKey={rightContainer.selectKey}
items={RightSide} items={RightSide}
tabBarStyle={{ display: 'none' }} tabBarStyle={{display: 'none'}}
/> />
) : ( ) : (
<> </> <> </>
...@@ -81,12 +81,13 @@ const RightContainer: React.FC<RightContainerProps> = (prop: any) => { ...@@ -81,12 +81,13 @@ const RightContainer: React.FC<RightContainerProps> = (prop: any) => {
}; };
export default connect( export default connect(
({ Studio }: { Studio: StateType }) => ({ ({Studio}: { Studio: StateType }) => ({
leftContainer: Studio.leftContainer, leftContainer: Studio.leftContainer,
rightContainer: Studio.rightContainer, rightContainer: Studio.rightContainer,
bottomContainer: Studio.bottomContainer, bottomContainer: Studio.bottomContainer,
activeBreadcrumbTitle: Studio.tabs.activeBreadcrumbTitle, activeBreadcrumbTitle: Studio.tabs.activeBreadcrumbTitle,
tabs: Studio.tabs tabs: Studio.tabs,
toolContentHeight: Studio.toolContentHeight
}), }),
mapDispatchToProps mapDispatchToProps
)(RightContainer); )(RightContainer);
...@@ -91,8 +91,8 @@ const DataStudio = (props: any) => { ...@@ -91,8 +91,8 @@ const DataStudio = (props: any) => {
height: document.documentElement.clientHeight, height: document.documentElement.clientHeight,
contentHeight: contentHeight:
document.documentElement.clientHeight - document.documentElement.clientHeight -
VIEW.headerHeight -
VIEW.headerNavHeight - VIEW.headerNavHeight -
VIEW.headerHeight -
VIEW.footerHeight - VIEW.footerHeight -
VIEW.otherHeight VIEW.otherHeight
}); });
...@@ -103,7 +103,7 @@ const DataStudio = (props: any) => { ...@@ -103,7 +103,7 @@ const DataStudio = (props: any) => {
setSize(getClientSize()); setSize(getClientSize());
const centerContentHeight = getClientSize().contentHeight - bottomHeight; const centerContentHeight = getClientSize().contentHeight - bottomHeight;
updateCenterContentHeight(centerContentHeight); updateCenterContentHeight(centerContentHeight);
updateToolContentHeight(centerContentHeight - VIEW.midMargin); updateToolContentHeight(centerContentHeight - VIEW.leftMargin);
}; };
useEffect(() => { useEffect(() => {
......
...@@ -16,7 +16,7 @@ import ICodeEditor = editor.ICodeEditor; ...@@ -16,7 +16,7 @@ import ICodeEditor = editor.ICodeEditor;
*/ */
export const VIEW = { export const VIEW = {
headerHeight: 32, headerHeight: 32,
headerNavHeight: 55, headerNavHeight: 56,
footerHeight: 25, footerHeight: 25,
sideWidth: 40, sideWidth: 40,
leftToolWidth: 180, leftToolWidth: 180,
...@@ -26,7 +26,7 @@ export const VIEW = { ...@@ -26,7 +26,7 @@ export const VIEW = {
rightMargin: 32, rightMargin: 32,
leftMargin: 36, leftMargin: 36,
midMargin: 44, midMargin: 44,
otherHeight: 1, otherHeight: 0,
paddingInline: 50 paddingInline: 50
}; };
......
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