From 49322f51b52d28f5f825e3f10db8c16009dfc0a3 Mon Sep 17 00:00:00 2001 From: ZackYoung Date: Mon, 30 Sep 2024 19:06:50 +0800 Subject: [PATCH 01/85] new_dataStudio --- dinky-web/config/routes.ts | 9 +- dinky-web/package.json | 1 + .../LeftContainer/Project/JobTree/index.tsx | 8 +- .../src/pages/DataStudioNew/ContentLayout.tsx | 210 +++++++++++++++++ .../pages/DataStudioNew/RightContextMenu.tsx | 92 ++++++++ .../pages/DataStudioNew/Toolbar/data.d.tsx | 26 +++ .../pages/DataStudioNew/Toolbar/index.less | 42 ++++ .../src/pages/DataStudioNew/Toolbar/index.tsx | 33 +++ .../DataStudioNew/Toolbar/toolbar-route.tsx | 101 ++++++++ dinky-web/src/pages/DataStudioNew/data.d.tsx | 36 +++ .../src/pages/DataStudioNew/function.tsx | 52 +++++ dinky-web/src/pages/DataStudioNew/index.less | 43 ++++ dinky-web/src/pages/DataStudioNew/index.tsx | 216 ++++++++++++++++++ 13 files changed, 864 insertions(+), 5 deletions(-) create mode 100644 dinky-web/src/pages/DataStudioNew/ContentLayout.tsx create mode 100644 dinky-web/src/pages/DataStudioNew/RightContextMenu.tsx create mode 100644 dinky-web/src/pages/DataStudioNew/Toolbar/data.d.tsx create mode 100644 dinky-web/src/pages/DataStudioNew/Toolbar/index.less create mode 100644 dinky-web/src/pages/DataStudioNew/Toolbar/index.tsx create mode 100644 dinky-web/src/pages/DataStudioNew/Toolbar/toolbar-route.tsx create mode 100644 dinky-web/src/pages/DataStudioNew/data.d.tsx create mode 100644 dinky-web/src/pages/DataStudioNew/function.tsx create mode 100644 dinky-web/src/pages/DataStudioNew/index.less create mode 100644 dinky-web/src/pages/DataStudioNew/index.tsx diff --git a/dinky-web/config/routes.ts b/dinky-web/config/routes.ts index 9c7b6976bd..00fa864f6c 100644 --- a/dinky-web/config/routes.ts +++ b/dinky-web/config/routes.ts @@ -64,6 +64,13 @@ export default [ footerRender: false, component: './DataStudio' }, + { + path: '/datastudio-new', + name: 'datastudio', + icon: 'CodeOutlined', + footerRender: false, + component: './DataStudioNew' + }, { path: '/devops', name: 'devops', @@ -325,5 +332,5 @@ export default [ { path: '*', component: './Other/404' - } + }, ]; diff --git a/dinky-web/package.json b/dinky-web/package.json index a717a5c0d4..59a7ac81c5 100644 --- a/dinky-web/package.json +++ b/dinky-web/package.json @@ -68,6 +68,7 @@ "monaco-editor": "^0.51.0", "omit.js": "^2.0.2", "path-to-regexp": "^6.2.2", + "rc-dock": "^3.3.0", "rc-menu": "^9.14.0", "rc-util": "^5.43.0", "re-resizable": "^6.10.0", diff --git a/dinky-web/src/pages/DataStudio/LeftContainer/Project/JobTree/index.tsx b/dinky-web/src/pages/DataStudio/LeftContainer/Project/JobTree/index.tsx index e341c5616e..a503367ae6 100644 --- a/dinky-web/src/pages/DataStudio/LeftContainer/Project/JobTree/index.tsx +++ b/dinky-web/src/pages/DataStudio/LeftContainer/Project/JobTree/index.tsx @@ -39,7 +39,7 @@ import { connect } from '@@/exports'; import { SortAscendingOutlined } from '@ant-design/icons'; import { Key } from '@ant-design/pro-components'; import { useModel } from '@umijs/max'; -import { Divider, MenuProps } from 'antd'; +import {Divider, Flex, MenuProps} from 'antd'; import { Button, Dropdown, Empty, Space, Tree } from 'antd'; import type { ButtonType } from 'antd/es/button/buttonHelpers'; import Search from 'antd/es/input/Search'; @@ -271,9 +271,9 @@ const JobTree: React.FC = (props) => { return ( <> - + = (props) => { > - +
openTerminal()}> SQL Cli Terminal diff --git a/dinky-web/src/pages/DataStudioNew/ContentLayout.tsx b/dinky-web/src/pages/DataStudioNew/ContentLayout.tsx new file mode 100644 index 0000000000..83a3f76570 --- /dev/null +++ b/dinky-web/src/pages/DataStudioNew/ContentLayout.tsx @@ -0,0 +1,210 @@ +import React, {Dispatch, RefObject, SetStateAction} from "react"; +import {DockLayout, DropDirection, LayoutBase, LayoutData, TabGroup} from 'rc-dock'; +import {DockContext, PanelData, TabData} from "rc-dock/lib/DockData"; +import "rc-dock/style/index-light.less"; +import "./index.less"; +import {BorderOutlined, CloseOutlined, ImportOutlined, SelectOutlined, SwitcherOutlined} from "@ant-design/icons"; +import Project from "@/pages/DataStudio/LeftContainer/Project"; +import KeyBoard from "@/pages/DataStudio/MiddleContainer/KeyBoard"; +import QuickGuide from "@/pages/DataStudio/MiddleContainer/QuickGuide"; +import {Divider} from "antd"; +import {sleep} from "ahooks/es/utils/testingHelpers"; +import {LayoutState} from "@/pages/DataStudioNew/data.d"; + +const jsxTab = { + id: 'jsxTab', + title: 'jsx', + closable: true, + content: