From 65ff0bbb0c1bd8286921ef7a5e40b0c48aaf5eb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=9F=E8=B4=A4?= Date: Wed, 22 Mar 2023 23:08:03 +0800 Subject: [PATCH] try --- mock/listTableList.ts | 10 +- package.json | 3 +- pnpm-lock.yaml | 48 ++++--- .../components/ArticleListContent/index.tsx | 4 +- .../center/components/Projects/index.tsx | 7 +- src/pages/account/center/index.tsx | 7 +- src/pages/dashboard/analysis/_mock.ts | 12 +- .../analysis/components/Charts/Pie/index.tsx | 3 +- .../components/Charts/TimelineChart/index.tsx | 4 +- .../analysis/components/Charts/autoHeight.tsx | 5 +- .../analysis/components/SalesCard.tsx | 7 +- .../analysis/components/Trend/index.tsx | 1 + src/pages/dashboard/analysis/index.tsx | 8 +- src/pages/dashboard/analysis/utils/utils.ts | 16 +-- .../monitor/components/Charts/Pie/index.tsx | 4 +- .../monitor/components/Charts/autoHeight.tsx | 5 +- src/pages/dashboard/workplace/_mock.ts | 10 +- .../workplace/components/Radar/autoHeight.tsx | 5 +- .../workplace/components/Radar/index.tsx | 2 +- src/pages/dashboard/workplace/data.d.ts | 1 + src/pages/dashboard/workplace/index.tsx | 16 ++- .../editor/flow/common/IconFont/index.ts | 7 - .../EditorContextMenu/FlowContextMenu.tsx | 34 ----- .../EditorContextMenu/KoniContextMenu.tsx | 3 - .../components/EditorContextMenu/MenuItem.tsx | 27 ---- .../EditorContextMenu/MindContextMenu.tsx | 22 --- .../components/EditorContextMenu/index.less | 41 ------ .../components/EditorContextMenu/index.tsx | 5 - .../EditorDetailPanel/DetailForm.tsx | 114 ---------------- .../EditorDetailPanel/FlowDetailPanel.tsx | 27 ---- .../EditorDetailPanel/KoniDetailPanel.tsx | 3 - .../EditorDetailPanel/MindDetailPanel.tsx | 18 --- .../components/EditorDetailPanel/index.less | 6 - .../components/EditorDetailPanel/index.tsx | 5 - .../EditorItemPanel/FlowItemPanel.tsx | 53 ------- .../EditorItemPanel/KoniItemPanel.tsx | 49 ------- .../components/EditorItemPanel/index.less | 19 --- .../flow/components/EditorItemPanel/index.tsx | 4 - .../flow/components/EditorMinimap/index.tsx | 10 -- .../components/EditorToolbar/FlowToolbar.tsx | 29 ---- .../components/EditorToolbar/KoniToolbar.tsx | 3 - .../components/EditorToolbar/MindToolbar.tsx | 24 ---- .../EditorToolbar/ToolbarButton.tsx | 31 ----- .../flow/components/EditorToolbar/index.less | 40 ------ .../flow/components/EditorToolbar/index.tsx | 5 - src/pages/editor/flow/index.less | 48 ------- src/pages/editor/flow/index.tsx | 37 ----- .../editor/koni/common/IconFont/index.ts | 7 - .../EditorContextMenu/FlowContextMenu.tsx | 34 ----- .../EditorContextMenu/KoniContextMenu.tsx | 3 - .../components/EditorContextMenu/MenuItem.tsx | 27 ---- .../EditorContextMenu/MindContextMenu.tsx | 22 --- .../components/EditorContextMenu/index.less | 40 ------ .../components/EditorContextMenu/index.tsx | 5 - .../EditorDetailPanel/DetailForm.tsx | 114 ---------------- .../EditorDetailPanel/FlowDetailPanel.tsx | 27 ---- .../EditorDetailPanel/KoniDetailPanel.tsx | 3 - .../EditorDetailPanel/MindDetailPanel.tsx | 18 --- .../components/EditorDetailPanel/index.less | 6 - .../components/EditorDetailPanel/index.tsx | 5 - .../EditorItemPanel/FlowItemPanel.tsx | 53 ------- .../EditorItemPanel/KoniItemPanel.tsx | 49 ------- .../components/EditorItemPanel/index.less | 19 --- .../koni/components/EditorItemPanel/index.tsx | 4 - .../koni/components/EditorMinimap/index.tsx | 10 -- .../components/EditorToolbar/FlowToolbar.tsx | 29 ---- .../components/EditorToolbar/KoniToolbar.tsx | 3 - .../components/EditorToolbar/MindToolbar.tsx | 24 ---- .../EditorToolbar/ToolbarButton.tsx | 31 ----- .../koni/components/EditorToolbar/index.less | 39 ------ .../koni/components/EditorToolbar/index.tsx | 5 - src/pages/editor/koni/index.less | 56 -------- src/pages/editor/koni/index.tsx | 37 ----- .../editor/mind/common/IconFont/index.ts | 7 - .../EditorContextMenu/FlowContextMenu.tsx | 34 ----- .../EditorContextMenu/KoniContextMenu.tsx | 3 - .../components/EditorContextMenu/MenuItem.tsx | 27 ---- .../EditorContextMenu/MindContextMenu.tsx | 22 --- .../components/EditorContextMenu/index.less | 40 ------ .../components/EditorContextMenu/index.tsx | 5 - .../EditorDetailPanel/DetailForm.tsx | 114 ---------------- .../EditorDetailPanel/FlowDetailPanel.tsx | 27 ---- .../EditorDetailPanel/KoniDetailPanel.tsx | 3 - .../EditorDetailPanel/MindDetailPanel.tsx | 18 --- .../components/EditorDetailPanel/index.less | 6 - .../components/EditorDetailPanel/index.tsx | 5 - .../EditorItemPanel/FlowItemPanel.tsx | 53 ------- .../EditorItemPanel/KoniItemPanel.tsx | 49 ------- .../components/EditorItemPanel/index.less | 19 --- .../mind/components/EditorItemPanel/index.tsx | 4 - .../mind/components/EditorMinimap/index.tsx | 10 -- .../components/EditorToolbar/FlowToolbar.tsx | 29 ---- .../components/EditorToolbar/KoniToolbar.tsx | 3 - .../components/EditorToolbar/MindToolbar.tsx | 24 ---- .../EditorToolbar/ToolbarButton.tsx | 31 ----- .../mind/components/EditorToolbar/index.less | 40 ------ .../mind/components/EditorToolbar/index.tsx | 5 - src/pages/editor/mind/index.less | 56 -------- src/pages/editor/mind/index.tsx | 34 ----- src/pages/editor/mind/worldCup2018.json | 129 ------------------ .../advanced-form/components/TableForm.tsx | 8 +- src/pages/form/advanced-form/index.tsx | 2 +- src/pages/form/basic-form/index.tsx | 2 +- src/pages/form/step-form/index.tsx | 1 + .../basic-list/components/OperationModal.tsx | 1 + src/pages/list/basic-list/index.tsx | 4 +- .../components/StandardFormRow/index.tsx | 1 + .../components/TagSelect/index.tsx | 1 + .../components/ArticleListContent/index.tsx | 4 +- .../components/StandardFormRow/index.tsx | 1 + .../articles/components/TagSelect/index.tsx | 1 + src/pages/list/search/index.tsx | 8 +- .../components/StandardFormRow/index.tsx | 1 + .../projects/components/TagSelect/index.tsx | 1 + src/pages/list/search/projects/index.tsx | 7 +- src/pages/list/table-list/_mock.ts | 5 +- .../list/table-list/components/CreateForm.tsx | 1 + src/pages/profile/advanced/index.tsx | 6 +- src/pages/user/register-result/index.tsx | 12 +- src/pages/user/register/index.tsx | 5 +- 120 files changed, 128 insertions(+), 2253 deletions(-) delete mode 100644 src/pages/editor/flow/common/IconFont/index.ts delete mode 100644 src/pages/editor/flow/components/EditorContextMenu/FlowContextMenu.tsx delete mode 100644 src/pages/editor/flow/components/EditorContextMenu/KoniContextMenu.tsx delete mode 100644 src/pages/editor/flow/components/EditorContextMenu/MenuItem.tsx delete mode 100644 src/pages/editor/flow/components/EditorContextMenu/MindContextMenu.tsx delete mode 100644 src/pages/editor/flow/components/EditorContextMenu/index.less delete mode 100644 src/pages/editor/flow/components/EditorContextMenu/index.tsx delete mode 100644 src/pages/editor/flow/components/EditorDetailPanel/DetailForm.tsx delete mode 100644 src/pages/editor/flow/components/EditorDetailPanel/FlowDetailPanel.tsx delete mode 100644 src/pages/editor/flow/components/EditorDetailPanel/KoniDetailPanel.tsx delete mode 100644 src/pages/editor/flow/components/EditorDetailPanel/MindDetailPanel.tsx delete mode 100644 src/pages/editor/flow/components/EditorDetailPanel/index.less delete mode 100644 src/pages/editor/flow/components/EditorDetailPanel/index.tsx delete mode 100644 src/pages/editor/flow/components/EditorItemPanel/FlowItemPanel.tsx delete mode 100644 src/pages/editor/flow/components/EditorItemPanel/KoniItemPanel.tsx delete mode 100644 src/pages/editor/flow/components/EditorItemPanel/index.less delete mode 100644 src/pages/editor/flow/components/EditorItemPanel/index.tsx delete mode 100644 src/pages/editor/flow/components/EditorMinimap/index.tsx delete mode 100644 src/pages/editor/flow/components/EditorToolbar/FlowToolbar.tsx delete mode 100644 src/pages/editor/flow/components/EditorToolbar/KoniToolbar.tsx delete mode 100644 src/pages/editor/flow/components/EditorToolbar/MindToolbar.tsx delete mode 100644 src/pages/editor/flow/components/EditorToolbar/ToolbarButton.tsx delete mode 100644 src/pages/editor/flow/components/EditorToolbar/index.less delete mode 100644 src/pages/editor/flow/components/EditorToolbar/index.tsx delete mode 100644 src/pages/editor/flow/index.less delete mode 100644 src/pages/editor/flow/index.tsx delete mode 100644 src/pages/editor/koni/common/IconFont/index.ts delete mode 100644 src/pages/editor/koni/components/EditorContextMenu/FlowContextMenu.tsx delete mode 100644 src/pages/editor/koni/components/EditorContextMenu/KoniContextMenu.tsx delete mode 100644 src/pages/editor/koni/components/EditorContextMenu/MenuItem.tsx delete mode 100644 src/pages/editor/koni/components/EditorContextMenu/MindContextMenu.tsx delete mode 100644 src/pages/editor/koni/components/EditorContextMenu/index.less delete mode 100644 src/pages/editor/koni/components/EditorContextMenu/index.tsx delete mode 100644 src/pages/editor/koni/components/EditorDetailPanel/DetailForm.tsx delete mode 100644 src/pages/editor/koni/components/EditorDetailPanel/FlowDetailPanel.tsx delete mode 100644 src/pages/editor/koni/components/EditorDetailPanel/KoniDetailPanel.tsx delete mode 100644 src/pages/editor/koni/components/EditorDetailPanel/MindDetailPanel.tsx delete mode 100644 src/pages/editor/koni/components/EditorDetailPanel/index.less delete mode 100644 src/pages/editor/koni/components/EditorDetailPanel/index.tsx delete mode 100644 src/pages/editor/koni/components/EditorItemPanel/FlowItemPanel.tsx delete mode 100644 src/pages/editor/koni/components/EditorItemPanel/KoniItemPanel.tsx delete mode 100644 src/pages/editor/koni/components/EditorItemPanel/index.less delete mode 100644 src/pages/editor/koni/components/EditorItemPanel/index.tsx delete mode 100644 src/pages/editor/koni/components/EditorMinimap/index.tsx delete mode 100644 src/pages/editor/koni/components/EditorToolbar/FlowToolbar.tsx delete mode 100644 src/pages/editor/koni/components/EditorToolbar/KoniToolbar.tsx delete mode 100644 src/pages/editor/koni/components/EditorToolbar/MindToolbar.tsx delete mode 100644 src/pages/editor/koni/components/EditorToolbar/ToolbarButton.tsx delete mode 100644 src/pages/editor/koni/components/EditorToolbar/index.less delete mode 100644 src/pages/editor/koni/components/EditorToolbar/index.tsx delete mode 100644 src/pages/editor/koni/index.less delete mode 100644 src/pages/editor/koni/index.tsx delete mode 100644 src/pages/editor/mind/common/IconFont/index.ts delete mode 100644 src/pages/editor/mind/components/EditorContextMenu/FlowContextMenu.tsx delete mode 100644 src/pages/editor/mind/components/EditorContextMenu/KoniContextMenu.tsx delete mode 100644 src/pages/editor/mind/components/EditorContextMenu/MenuItem.tsx delete mode 100644 src/pages/editor/mind/components/EditorContextMenu/MindContextMenu.tsx delete mode 100644 src/pages/editor/mind/components/EditorContextMenu/index.less delete mode 100644 src/pages/editor/mind/components/EditorContextMenu/index.tsx delete mode 100644 src/pages/editor/mind/components/EditorDetailPanel/DetailForm.tsx delete mode 100644 src/pages/editor/mind/components/EditorDetailPanel/FlowDetailPanel.tsx delete mode 100644 src/pages/editor/mind/components/EditorDetailPanel/KoniDetailPanel.tsx delete mode 100644 src/pages/editor/mind/components/EditorDetailPanel/MindDetailPanel.tsx delete mode 100644 src/pages/editor/mind/components/EditorDetailPanel/index.less delete mode 100644 src/pages/editor/mind/components/EditorDetailPanel/index.tsx delete mode 100644 src/pages/editor/mind/components/EditorItemPanel/FlowItemPanel.tsx delete mode 100644 src/pages/editor/mind/components/EditorItemPanel/KoniItemPanel.tsx delete mode 100644 src/pages/editor/mind/components/EditorItemPanel/index.less delete mode 100644 src/pages/editor/mind/components/EditorItemPanel/index.tsx delete mode 100644 src/pages/editor/mind/components/EditorMinimap/index.tsx delete mode 100644 src/pages/editor/mind/components/EditorToolbar/FlowToolbar.tsx delete mode 100644 src/pages/editor/mind/components/EditorToolbar/KoniToolbar.tsx delete mode 100644 src/pages/editor/mind/components/EditorToolbar/MindToolbar.tsx delete mode 100644 src/pages/editor/mind/components/EditorToolbar/ToolbarButton.tsx delete mode 100644 src/pages/editor/mind/components/EditorToolbar/index.less delete mode 100644 src/pages/editor/mind/components/EditorToolbar/index.tsx delete mode 100644 src/pages/editor/mind/index.less delete mode 100644 src/pages/editor/mind/index.tsx delete mode 100644 src/pages/editor/mind/worldCup2018.json diff --git a/mock/listTableList.ts b/mock/listTableList.ts index 35ec3cec..fa7af931 100644 --- a/mock/listTableList.ts +++ b/mock/listTableList.ts @@ -1,5 +1,5 @@ import { Request, Response } from 'express'; -import moment from 'moment'; +import dayjs from 'dayjs'; import { parse } from 'url'; // mock tableListDataSource @@ -21,8 +21,8 @@ const genList = (current: number, pageSize: number) => { desc: '这是一段描述', callNo: Math.floor(Math.random() * 1000), status: Math.floor(Math.random() * 10) % 4, - updatedAt: moment().format('YYYY-MM-DD'), - createdAt: moment().format('YYYY-MM-DD'), + updatedAt: dayjs().format('YYYY-MM-DD'), + createdAt: dayjs().format('YYYY-MM-DD'), progress: Math.ceil(Math.random() * 100), }); } @@ -134,8 +134,8 @@ function postRule(req: Request, res: Response, u: string, b: Request) { desc, callNo: Math.floor(Math.random() * 1000), status: Math.floor(Math.random() * 10) % 2, - updatedAt: moment().format('YYYY-MM-DD'), - createdAt: moment().format('YYYY-MM-DD'), + updatedAt: dayjs().format('YYYY-MM-DD'), + createdAt: dayjs().format('YYYY-MM-DD'), progress: Math.ceil(Math.random() * 100), }; tableListDataSource.unshift(newRule); diff --git a/package.json b/package.json index 14d4cb2e..6f91ad0e 100644 --- a/package.json +++ b/package.json @@ -54,6 +54,7 @@ "@antv/l7": "^2.3.7", "@antv/l7-maps": "^2.3.7", "@antv/l7-react": "^2.1.9", + "@types/lodash.debounce": "^4.0.7", "@umijs/route-utils": "^2.2.2", "ahooks": "^2.0.0", "antd": "^5.2.2", @@ -61,10 +62,10 @@ "bizcharts": "^3.5.3-beta.0", "bizcharts-plugin-slider": "^2.1.1-beta.1", "classnames": "^2.3.2", + "dayjs": "^1.11.7", "gg-editor": "^2.0.2", "lodash": "^4.17.21", "lodash-decorators": "^6.0.0", - "moment": "^2.29.4", "numeral": "^2.0.6", "nzh": "^1.0.3", "omit.js": "^2.0.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ff66e9a1..584b9f95 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -17,6 +17,7 @@ specifiers: '@types/history': ^4.7.11 '@types/jest': ^29.4.0 '@types/lodash': ^4.14.191 + '@types/lodash.debounce': ^4.0.7 '@types/react': ^18.0.28 '@types/react-dom': ^18.0.11 '@types/react-helmet': ^6.1.6 @@ -31,6 +32,7 @@ specifiers: bizcharts-plugin-slider: ^2.1.1-beta.1 classnames: ^2.3.2 cross-env: ^7.0.3 + dayjs: ^1.11.7 eslint: ^8.34.0 express: ^4.18.2 gg-editor: ^2.0.2 @@ -42,7 +44,6 @@ specifiers: lodash: ^4.17.21 lodash-decorators: ^6.0.0 mockjs: ^1.1.0 - moment: ^2.29.4 numeral: ^2.0.6 nzh: ^1.0.3 omit.js: ^2.0.2 @@ -69,17 +70,18 @@ dependencies: '@antv/l7': 2.14.7 '@antv/l7-maps': 2.14.7 '@antv/l7-react': 2.4.3_bm7ci3oav2pap74nmaps6hk4pe + '@types/lodash.debounce': 4.0.7 '@umijs/route-utils': 2.2.2 ahooks: 2.10.14_react@18.2.0 - antd: 5.3.2_jb42yyeu5qxbfieyxjks6malva + antd: 5.3.2_biqbaboplfbrettd7655fr4n2y antd-style: 2.0.2_inhcptsb3xwksbzylhlutukt7y bizcharts: 3.5.10_react@18.2.0 bizcharts-plugin-slider: 2.1.1_xqhfrrq3rji7b4f5orc4gseufu classnames: 2.3.2 + dayjs: 1.11.7 gg-editor: 2.0.4_react@18.2.0 lodash: 4.17.21 lodash-decorators: 6.0.1_lodash@4.17.21 - moment: 2.29.4 numeral: 2.0.6 nzh: 1.0.8 omit.js: 2.0.2 @@ -318,7 +320,7 @@ packages: '@ant-design/pro-provider': 2.6.1_wacdszkbqwn7wuohqczb7gb7ie '@ant-design/pro-utils': 2.7.1_wacdszkbqwn7wuohqczb7gb7ie '@babel/runtime': 7.21.0 - antd: 5.3.2_jb42yyeu5qxbfieyxjks6malva + antd: 5.3.2_biqbaboplfbrettd7655fr4n2y classnames: 2.3.2 omit.js: 2.0.2 rc-resize-observer: 1.3.1_biqbaboplfbrettd7655fr4n2y @@ -412,7 +414,7 @@ packages: '@ant-design/pro-table': 3.5.2_wacdszkbqwn7wuohqczb7gb7ie '@ant-design/pro-utils': 2.7.1_wacdszkbqwn7wuohqczb7gb7ie '@babel/runtime': 7.21.0 - antd: 5.3.2_jb42yyeu5qxbfieyxjks6malva + antd: 5.3.2_biqbaboplfbrettd7655fr4n2y react: 18.2.0 react-dom: 18.2.0_react@18.2.0 transitivePeerDependencies: @@ -451,7 +453,7 @@ packages: '@ant-design/pro-skeleton': 2.1.0_wacdszkbqwn7wuohqczb7gb7ie '@ant-design/pro-utils': 2.7.1_wacdszkbqwn7wuohqczb7gb7ie '@babel/runtime': 7.21.0 - antd: 5.3.2_jb42yyeu5qxbfieyxjks6malva + antd: 5.3.2_biqbaboplfbrettd7655fr4n2y rc-util: 5.29.2_biqbaboplfbrettd7655fr4n2y react: 18.2.0 use-json-comparison: 1.0.6_react@18.2.0 @@ -494,7 +496,7 @@ packages: '@ant-design/pro-utils': 2.7.1_wacdszkbqwn7wuohqczb7gb7ie '@babel/runtime': 7.21.0 '@chenshuai2144/sketch-color': 1.0.9_react@18.2.0 - antd: 5.3.2_jb42yyeu5qxbfieyxjks6malva + antd: 5.3.2_biqbaboplfbrettd7655fr4n2y classnames: 2.3.2 dayjs: 1.11.7 lodash.tonumber: 4.0.3 @@ -555,7 +557,7 @@ packages: '@babel/runtime': 7.21.0 '@chenshuai2144/sketch-color': 1.0.9_react@18.2.0 '@umijs/use-params': 1.0.9_react@18.2.0 - antd: 5.3.2_jb42yyeu5qxbfieyxjks6malva + antd: 5.3.2_biqbaboplfbrettd7655fr4n2y classnames: 2.3.2 lodash.merge: 4.6.2 omit.js: 2.0.2 @@ -607,7 +609,7 @@ packages: '@babel/runtime': 7.21.0 '@umijs/route-utils': 4.0.1 '@umijs/use-params': 1.0.9_react@18.2.0 - antd: 5.3.2_jb42yyeu5qxbfieyxjks6malva + antd: 5.3.2_biqbaboplfbrettd7655fr4n2y classnames: 2.3.2 lodash.merge: 4.6.2 omit.js: 2.0.2 @@ -658,7 +660,7 @@ packages: '@ant-design/pro-field': 2.5.1_wacdszkbqwn7wuohqczb7gb7ie '@ant-design/pro-table': 3.5.2_wacdszkbqwn7wuohqczb7gb7ie '@babel/runtime': 7.21.0 - antd: 5.3.2_jb42yyeu5qxbfieyxjks6malva + antd: 5.3.2_biqbaboplfbrettd7655fr4n2y classnames: 2.3.2 dayjs: 1.11.7 rc-resize-observer: 1.3.1_biqbaboplfbrettd7655fr4n2y @@ -697,7 +699,7 @@ packages: '@ant-design/cssinjs': 1.6.1_biqbaboplfbrettd7655fr4n2y '@babel/runtime': 7.21.0 '@ctrl/tinycolor': 3.6.0 - antd: 5.3.2_jb42yyeu5qxbfieyxjks6malva + antd: 5.3.2_biqbaboplfbrettd7655fr4n2y rc-util: 5.29.2_biqbaboplfbrettd7655fr4n2y react: 18.2.0 react-dom: 18.2.0_react@18.2.0 @@ -725,7 +727,7 @@ packages: react-dom: '>=16.9.0' dependencies: '@babel/runtime': 7.21.0 - antd: 5.3.2_jb42yyeu5qxbfieyxjks6malva + antd: 5.3.2_biqbaboplfbrettd7655fr4n2y react: 18.2.0 react-dom: 18.2.0_react@18.2.0 use-media-antd-query: 1.1.0_react@18.2.0 @@ -774,7 +776,7 @@ packages: '@ant-design/pro-provider': 2.6.1_wacdszkbqwn7wuohqczb7gb7ie '@ant-design/pro-utils': 2.7.1_wacdszkbqwn7wuohqczb7gb7ie '@babel/runtime': 7.21.0 - antd: 5.3.2_jb42yyeu5qxbfieyxjks6malva + antd: 5.3.2_biqbaboplfbrettd7655fr4n2y classnames: 2.3.2 dayjs: 1.11.7 omit.js: 2.0.2 @@ -817,7 +819,7 @@ packages: '@ant-design/icons': 4.8.0_biqbaboplfbrettd7655fr4n2y '@ant-design/pro-provider': 2.6.1_wacdszkbqwn7wuohqczb7gb7ie '@babel/runtime': 7.21.0 - antd: 5.3.2_jb42yyeu5qxbfieyxjks6malva + antd: 5.3.2_biqbaboplfbrettd7655fr4n2y classnames: 2.3.2 dayjs: 1.11.7 rc-util: 5.29.2_biqbaboplfbrettd7655fr4n2y @@ -859,7 +861,7 @@ packages: react-dom: '>=17.0.0' dependencies: '@emotion/css': 11.10.6 - antd: 5.3.2_jb42yyeu5qxbfieyxjks6malva + antd: 5.3.2_biqbaboplfbrettd7655fr4n2y react: 18.2.0 react-dom: 18.2.0_react@18.2.0 dev: false @@ -5155,6 +5157,12 @@ packages: /@types/json-schema/7.0.11: resolution: {integrity: sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==} + /@types/lodash.debounce/4.0.7: + resolution: {integrity: sha512-X1T4wMZ+gT000M2/91SYj0d/7JfeNZ9PeeOldSNoE/lunLeQXKvkmIumI29IaKMotU/ln/McOIvgzZcQ/3TrSA==} + dependencies: + '@types/lodash': 4.14.191 + dev: false + /@types/lodash/4.14.191: resolution: {integrity: sha512-BdZ5BCCvho3EIXw6wUCXHe7rS53AIDPLE+JzwgT+OsJk53oBfbSmZZ7CX4VaRoN78N+TJpFi9QPlfIVNmJYWxQ==} @@ -6689,7 +6697,7 @@ packages: '@emotion/react': 11.10.6_pmekkgnqduwlme35zpnqhenc34 '@emotion/serialize': 1.1.1 '@emotion/styled': 11.10.6_oouaibmszuch5k64ms7uxp2aia - antd: 5.3.2_jb42yyeu5qxbfieyxjks6malva + antd: 5.3.2_biqbaboplfbrettd7655fr4n2y polished: 4.2.2 react: 18.2.0 transitivePeerDependencies: @@ -6749,7 +6757,7 @@ packages: scroll-into-view-if-needed: 2.2.31 dev: true - /antd/5.3.2_jb42yyeu5qxbfieyxjks6malva: + /antd/5.3.2_biqbaboplfbrettd7655fr4n2y: resolution: {integrity: sha512-AOCZ+5krqvlLPR1v33K2PQtt9XBAC0gUdjxuHltUliE9u2zlZzGT+4DSHTNnw8CtotPV4lFKab3+K+FgdtyTlw==} peerDependencies: react: '>=16.9.0' @@ -6783,7 +6791,7 @@ packages: rc-motion: 2.6.3_biqbaboplfbrettd7655fr4n2y rc-notification: 5.0.3_biqbaboplfbrettd7655fr4n2y rc-pagination: 3.3.1_biqbaboplfbrettd7655fr4n2y - rc-picker: 3.3.4_lejchghvacj3hhjkogy3eaalky + rc-picker: 3.3.4_mlnkrlbros4rghcauwy625gk7y rc-progress: 3.4.1_biqbaboplfbrettd7655fr4n2y rc-rate: 2.10.0_biqbaboplfbrettd7655fr4n2y rc-resize-observer: 1.3.1_biqbaboplfbrettd7655fr4n2y @@ -13005,6 +13013,7 @@ packages: /moment/2.29.4: resolution: {integrity: sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w==} + dev: true /ms/2.0.0: resolution: {integrity: sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==} @@ -15410,7 +15419,7 @@ packages: shallowequal: 1.1.0 dev: true - /rc-picker/3.3.4_lejchghvacj3hhjkogy3eaalky: + /rc-picker/3.3.4_mlnkrlbros4rghcauwy625gk7y: resolution: {integrity: sha512-y7muUVAXqcacXXgLERCC9klEClZybOjWrcVZ54glxO5y+UO2MZmBk+ysWhhVHQ0l2nNtY+wj19gk1xnv+5eCxg==} engines: {node: '>=8.x'} peerDependencies: @@ -15431,7 +15440,6 @@ packages: '@rc-component/trigger': 1.6.0_biqbaboplfbrettd7655fr4n2y classnames: 2.3.2 dayjs: 1.11.7 - moment: 2.29.4 rc-util: 5.29.2_biqbaboplfbrettd7655fr4n2y react: 18.2.0 react-dom: 18.2.0_react@18.2.0 diff --git a/src/pages/account/center/components/ArticleListContent/index.tsx b/src/pages/account/center/components/ArticleListContent/index.tsx index 183c38e8..4e001ffd 100644 --- a/src/pages/account/center/components/ArticleListContent/index.tsx +++ b/src/pages/account/center/components/ArticleListContent/index.tsx @@ -1,6 +1,6 @@ import { Avatar } from 'antd'; import React from 'react'; -import moment from 'moment'; +import dayjs from 'dayjs'; import styles from './index.less'; export type ApplicationsProps = { @@ -20,7 +20,7 @@ const ArticleListContent: React.FC = ({
{owner} 发布在 {href} - {moment(updatedAt).format('YYYY-MM-DD HH:mm')} + {dayjs(updatedAt).format('YYYY-MM-DD HH:mm')}
); diff --git a/src/pages/account/center/components/Projects/index.tsx b/src/pages/account/center/components/Projects/index.tsx index 2ddc7226..b7904627 100644 --- a/src/pages/account/center/components/Projects/index.tsx +++ b/src/pages/account/center/components/Projects/index.tsx @@ -1,11 +1,14 @@ import { Card, List } from 'antd'; import { useRequest } from '@umijs/max'; import React from 'react'; -import moment from 'moment'; +import dayjs from 'dayjs'; import { queryFakeList } from '../../service'; import AvatarList from '../AvatarList'; import type { ListItemDataType } from '../../data.d'; import styles from './index.less'; +import relativeTime from 'dayjs/plugin/relativeTime'; + +dayjs.extend(relativeTime); const Projects: React.FC = () => { // 获取tab列表数据 @@ -26,7 +29,7 @@ const Projects: React.FC = () => { }> {item.title}} description={item.subDescription} />
- {moment(item.updatedAt).fromNow()} + {dayjs(item.updatedAt).fromNow()}
{item.members.map((member) => ( diff --git a/src/pages/account/center/index.tsx b/src/pages/account/center/index.tsx index fd7e1826..f06936dc 100644 --- a/src/pages/account/center/index.tsx +++ b/src/pages/account/center/index.tsx @@ -1,9 +1,8 @@ import { PlusOutlined, HomeOutlined, ContactsOutlined, ClusterOutlined } from '@ant-design/icons'; -import { Avatar, Card, Col, Divider, Input, Row, Tag } from 'antd'; +import { Avatar, Card, Col, Divider, Input, InputRef, Row, Tag } from 'antd'; import React, { useState, useRef } from 'react'; import { GridContent } from '@ant-design/pro-components'; import { Link, useRequest } from '@umijs/max'; -import type { RouteChildrenProps } from 'react-router'; import Projects from './components/Projects'; import Articles from './components/Articles'; import Applications from './components/Applications'; @@ -39,7 +38,7 @@ const operationTabList = [ ]; const TagList: React.FC<{ tags: CurrentUser['tags'] }> = ({ tags }) => { - const ref = useRef(null); + const ref = useRef(null); const [newTags, setNewTags] = useState([]); const [inputVisible, setInputVisible] = useState(false); const [inputValue, setInputValue] = useState(''); @@ -93,7 +92,7 @@ const TagList: React.FC<{ tags: CurrentUser['tags'] }> = ({ tags }) => { ); }; -const Center: React.FC = () => { +const Center: React.FC = () => { const [tabKey, setTabKey] = useState('articles'); // 获取用户信息 diff --git a/src/pages/dashboard/analysis/_mock.ts b/src/pages/dashboard/analysis/_mock.ts index e811c588..3f793290 100644 --- a/src/pages/dashboard/analysis/_mock.ts +++ b/src/pages/dashboard/analysis/_mock.ts @@ -1,4 +1,4 @@ -import moment from 'moment'; +import dayjs from 'dayjs'; import type { Request, Response } from 'express'; import type { AnalysisData, RadarData, DataItem } from './data.d'; @@ -9,7 +9,7 @@ const beginDay = new Date().getTime(); const fakeY = [7, 5, 4, 2, 4, 7, 5, 6, 5, 9, 6, 3, 1, 5, 3, 6, 5]; for (let i = 0; i < fakeY.length; i += 1) { visitData.push({ - x: moment(new Date(beginDay + 1000 * 60 * 60 * 24 * i)).format('YYYY-MM-DD'), + x: dayjs(new Date(beginDay + 1000 * 60 * 60 * 24 * i)).format('YYYY-MM-DD'), y: fakeY[i], }); } @@ -18,7 +18,7 @@ const visitData2 = []; const fakeY2 = [1, 6, 4, 8, 3, 7, 2]; for (let i = 0; i < fakeY2.length; i += 1) { visitData2.push({ - x: moment(new Date(beginDay + 1000 * 60 * 60 * 24 * i)).format('YYYY-MM-DD'), + x: dayjs(new Date(beginDay + 1000 * 60 * 60 * 24 * i)).format('YYYY-MM-DD'), y: fakeY2[i], }); } @@ -126,7 +126,7 @@ for (let i = 0; i < 10; i += 1) { } const offlineChartData = []; for (let i = 0; i < 20; i += 1) { - const date = moment(new Date().getTime() + 1000 * 60 * 30 * i).format('HH:mm'); + const date = dayjs(new Date().getTime() + 1000 * 60 * 30 * i).format('HH:mm'); offlineChartData.push({ date, type: '客流量', @@ -179,8 +179,8 @@ radarOriginData.forEach((item) => { if (key !== 'name') { radarData.push({ name: item.name, - label: radarTitleMap[key], - value: item[key], + label: radarTitleMap[key as 'ref'], + value: item[key as 'ref'], }); } }); diff --git a/src/pages/dashboard/analysis/components/Charts/Pie/index.tsx b/src/pages/dashboard/analysis/components/Charts/Pie/index.tsx index e996c1e3..fba3ccc2 100644 --- a/src/pages/dashboard/analysis/components/Charts/Pie/index.tsx +++ b/src/pages/dashboard/analysis/components/Charts/Pie/index.tsx @@ -141,7 +141,8 @@ class Pie extends Component { newItem.checked = !newItem.checked; const { legendData } = this.state; - legendData[i] = newItem; + const key = i as unknown as number; + legendData[key] = newItem; const filteredLegendData = legendData.filter((l) => l.checked).map((l) => l.x); diff --git a/src/pages/dashboard/analysis/components/Charts/TimelineChart/index.tsx b/src/pages/dashboard/analysis/components/Charts/TimelineChart/index.tsx index fa17bfa7..3d91a300 100644 --- a/src/pages/dashboard/analysis/components/Charts/TimelineChart/index.tsx +++ b/src/pages/dashboard/analysis/components/Charts/TimelineChart/index.tsx @@ -65,8 +65,8 @@ const TimelineChart: React.FC = (props) => { type: 'map', callback(row: { y1: string; y2: string }) { const newRow = { ...row }; - newRow[titleMap.y1] = row.y1; - newRow[titleMap.y2] = row.y2; + newRow[titleMap.y1 as 'y1'] = row.y1; + newRow[titleMap.y2 as 'y2'] = row.y2; return newRow; }, }) diff --git a/src/pages/dashboard/analysis/components/Charts/autoHeight.tsx b/src/pages/dashboard/analysis/components/Charts/autoHeight.tsx index 5ec7bf39..cd9bcf24 100644 --- a/src/pages/dashboard/analysis/components/Charts/autoHeight.tsx +++ b/src/pages/dashboard/analysis/components/Charts/autoHeight.tsx @@ -1,9 +1,6 @@ import React from 'react'; -export type IReactComponent

= - | React.StatelessComponent

- | React.ComponentClass

- | React.ClassicComponentClass

; +export type IReactComponent

= React.ComponentClass

| React.ClassicComponentClass

; function computeHeight(node: HTMLDivElement) { const { style } = node; diff --git a/src/pages/dashboard/analysis/components/SalesCard.tsx b/src/pages/dashboard/analysis/components/SalesCard.tsx index 152d9cef..4de9ae42 100644 --- a/src/pages/dashboard/analysis/components/SalesCard.tsx +++ b/src/pages/dashboard/analysis/components/SalesCard.tsx @@ -1,13 +1,12 @@ import { Card, Col, DatePicker, Row, Tabs } from 'antd'; import type { RangePickerProps } from 'antd/es/date-picker/generatePicker'; -import type moment from 'moment'; +import type dayjs from 'dayjs'; import { Column } from '@ant-design/charts'; import numeral from 'numeral'; import type { DataItem } from '../data.d'; import styles from '../style.less'; -type RangePickerValue = RangePickerProps['value']; export type TimeType = 'today' | 'week' | 'month' | 'year'; const { RangePicker } = DatePicker; @@ -29,11 +28,11 @@ const SalesCard = ({ loading, selectDate, }: { - rangePickerValue: RangePickerValue; + rangePickerValue: RangePickerProps['value']; isActive: (key: TimeType) => string; salesData: DataItem[]; loading: boolean; - handleRangePickerChange: (dates: RangePickerValue, dateStrings: [string, string]) => void; + handleRangePickerChange: RangePickerProps['onChange']; selectDate: (key: TimeType) => void; }) => ( diff --git a/src/pages/dashboard/analysis/components/Trend/index.tsx b/src/pages/dashboard/analysis/components/Trend/index.tsx index 58f7196a..496ccfe7 100644 --- a/src/pages/dashboard/analysis/components/Trend/index.tsx +++ b/src/pages/dashboard/analysis/components/Trend/index.tsx @@ -9,6 +9,7 @@ export type TrendProps = { style?: React.CSSProperties; reverseColor?: boolean; className?: string; + children?: React.ReactNode; }; const Trend: React.FC = ({ diff --git a/src/pages/dashboard/analysis/index.tsx b/src/pages/dashboard/analysis/index.tsx index ed155302..9b0c8c86 100644 --- a/src/pages/dashboard/analysis/index.tsx +++ b/src/pages/dashboard/analysis/index.tsx @@ -5,7 +5,7 @@ import { Col, Dropdown, Menu, Row } from 'antd'; import { GridContent } from '@ant-design/pro-components'; import type { RadioChangeEvent } from 'antd/es/radio'; import type { RangePickerProps } from 'antd/es/date-picker/generatePicker'; -import type moment from 'moment'; +import type dayjs from 'dayjs'; import IntroduceRow from './components/IntroduceRow'; import SalesCard from './components/SalesCard'; import TopSearch from './components/TopSearch'; @@ -20,7 +20,7 @@ import { getTimeDistance } from './utils/utils'; import type { AnalysisData } from './data.d'; import styles from './style.less'; -type RangePickerValue = RangePickerProps['value']; +type RangePickerValue = RangePickerProps['value']; type AnalysisProps = { dashboardAndanalysis: AnalysisData; @@ -58,8 +58,8 @@ const Analysis: FC = () => { return ''; } if ( - rangePickerValue[0].isSame(value[0] as moment.Moment, 'day') && - rangePickerValue[1].isSame(value[1] as moment.Moment, 'day') + rangePickerValue[0].isSame(value[0] as dayjs.Dayjs, 'day') && + rangePickerValue[1].isSame(value[1] as dayjs.Dayjs, 'day') ) { return styles.currentDate; } diff --git a/src/pages/dashboard/analysis/utils/utils.ts b/src/pages/dashboard/analysis/utils/utils.ts index 6a0da9a2..040faadc 100644 --- a/src/pages/dashboard/analysis/utils/utils.ts +++ b/src/pages/dashboard/analysis/utils/utils.ts @@ -1,7 +1,7 @@ -import moment from 'moment'; +import dayjs from 'dayjs'; import type { RangePickerProps } from 'antd/es/date-picker/generatePicker'; -type RangePickerValue = RangePickerProps['value']; +type RangePickerValue = RangePickerProps['value']; export function fixedZero(val: number) { return val * 1 < 10 ? `0${val}` : val; @@ -15,7 +15,7 @@ export function getTimeDistance(type: 'today' | 'week' | 'month' | 'year'): Rang now.setHours(0); now.setMinutes(0); now.setSeconds(0); - return [moment(now), moment(now.getTime() + (oneDay - 1000))]; + return [dayjs(now), dayjs(now.getTime() + (oneDay - 1000))]; } if (type === 'week') { @@ -32,21 +32,21 @@ export function getTimeDistance(type: 'today' | 'week' | 'month' | 'year'): Rang const beginTime = now.getTime() - day * oneDay; - return [moment(beginTime), moment(beginTime + (7 * oneDay - 1000))]; + return [dayjs(beginTime), dayjs(beginTime + (7 * oneDay - 1000))]; } const year = now.getFullYear(); if (type === 'month') { const month = now.getMonth(); - const nextDate = moment(now).add(1, 'months'); + const nextDate = dayjs(now).add(1, 'months'); const nextYear = nextDate.year(); const nextMonth = nextDate.month(); return [ - moment(`${year}-${fixedZero(month + 1)}-01 00:00:00`), - moment(moment(`${nextYear}-${fixedZero(nextMonth + 1)}-01 00:00:00`).valueOf() - 1000), + dayjs(`${year}-${fixedZero(month + 1)}-01 00:00:00`), + dayjs(dayjs(`${nextYear}-${fixedZero(nextMonth + 1)}-01 00:00:00`).valueOf() - 1000), ]; } - return [moment(`${year}-01-01 00:00:00`), moment(`${year}-12-31 23:59:59`)]; + return [dayjs(`${year}-01-01 00:00:00`), dayjs(`${year}-12-31 23:59:59`)]; } diff --git a/src/pages/dashboard/monitor/components/Charts/Pie/index.tsx b/src/pages/dashboard/monitor/components/Charts/Pie/index.tsx index 520c5c57..654050cd 100644 --- a/src/pages/dashboard/monitor/components/Charts/Pie/index.tsx +++ b/src/pages/dashboard/monitor/components/Charts/Pie/index.tsx @@ -138,11 +138,11 @@ class Pie extends Component { }; handleLegendClick = (item: { checked: boolean }, i: string | number) => { - const newItem = item; + const newItem = { ...item }; newItem.checked = !newItem.checked; const { legendData } = this.state; - legendData[i] = newItem; + legendData[i as unknown as number] = newItem as any; const filteredLegendData = legendData.filter((l) => l.checked).map((l) => l.x); diff --git a/src/pages/dashboard/monitor/components/Charts/autoHeight.tsx b/src/pages/dashboard/monitor/components/Charts/autoHeight.tsx index f37acace..e827959a 100644 --- a/src/pages/dashboard/monitor/components/Charts/autoHeight.tsx +++ b/src/pages/dashboard/monitor/components/Charts/autoHeight.tsx @@ -1,9 +1,6 @@ import React from 'react'; -export type IReactComponent

= - | React.StatelessComponent

- | React.ComponentClass

- | React.ClassicComponentClass

; +export type IReactComponent

= React.ComponentClass

| React.ClassicComponentClass

; function computeHeight(node: HTMLDivElement) { const { style } = node; diff --git a/src/pages/dashboard/workplace/_mock.ts b/src/pages/dashboard/workplace/_mock.ts index 41b9e38a..1042c963 100644 --- a/src/pages/dashboard/workplace/_mock.ts +++ b/src/pages/dashboard/workplace/_mock.ts @@ -1,4 +1,4 @@ -import moment from 'moment'; +import dayjs from 'dayjs'; import type { Request, Response } from 'express'; import type { SearchDataType, OfflineDataType, DataItem } from './data.d'; @@ -9,7 +9,7 @@ const beginDay = new Date().getTime(); const fakeY = [7, 5, 4, 2, 4, 7, 5, 6, 5, 9, 6, 3, 1, 5, 3, 6, 5]; for (let i = 0; i < fakeY.length; i += 1) { visitData.push({ - x: moment(new Date(beginDay + 1000 * 60 * 60 * 24 * i)).format('YYYY-MM-DD'), + x: dayjs(new Date(beginDay + 1000 * 60 * 60 * 24 * i)).format('YYYY-MM-DD'), y: fakeY[i], }); } @@ -18,7 +18,7 @@ const visitData2: DataItem[] = []; const fakeY2 = [1, 6, 4, 8, 3, 7, 2]; for (let i = 0; i < fakeY2.length; i += 1) { visitData2.push({ - x: moment(new Date(beginDay + 1000 * 60 * 60 * 24 * i)).format('YYYY-MM-DD'), + x: dayjs(new Date(beginDay + 1000 * 60 * 60 * 24 * i)).format('YYYY-MM-DD'), y: fakeY2[i], }); } @@ -379,8 +379,8 @@ radarOriginData.forEach((item) => { if (key !== 'name') { radarData.push({ name: item.name, - label: radarTitleMap[key], - value: item[key], + label: radarTitleMap[key as 'ref'], + value: item[key as 'ref'], }); } }); diff --git a/src/pages/dashboard/workplace/components/Radar/autoHeight.tsx b/src/pages/dashboard/workplace/components/Radar/autoHeight.tsx index 5ec7bf39..cd9bcf24 100644 --- a/src/pages/dashboard/workplace/components/Radar/autoHeight.tsx +++ b/src/pages/dashboard/workplace/components/Radar/autoHeight.tsx @@ -1,9 +1,6 @@ import React from 'react'; -export type IReactComponent

= - | React.StatelessComponent

- | React.ComponentClass

- | React.ClassicComponentClass

; +export type IReactComponent

= React.ComponentClass

| React.ClassicComponentClass

; function computeHeight(node: HTMLDivElement) { const { style } = node; diff --git a/src/pages/dashboard/workplace/components/Radar/index.tsx b/src/pages/dashboard/workplace/components/Radar/index.tsx index f7b8596a..ebb98979 100644 --- a/src/pages/dashboard/workplace/components/Radar/index.tsx +++ b/src/pages/dashboard/workplace/components/Radar/index.tsx @@ -95,7 +95,7 @@ class Radar extends Component { newItem.checked = !newItem.checked; const { legendData } = this.state; - legendData[i] = newItem; + legendData[i as number] = newItem as any; const filteredLegendData = legendData.filter((l) => l.checked).map((l) => l.name); diff --git a/src/pages/dashboard/workplace/data.d.ts b/src/pages/dashboard/workplace/data.d.ts index e96271ec..b1114d1e 100644 --- a/src/pages/dashboard/workplace/data.d.ts +++ b/src/pages/dashboard/workplace/data.d.ts @@ -89,6 +89,7 @@ export type ActivitiesType = { id: string; updatedAt: string; user: { + link?: string; name: string; avatar: string; }; diff --git a/src/pages/dashboard/workplace/index.tsx b/src/pages/dashboard/workplace/index.tsx index da81ffaa..0c837241 100644 --- a/src/pages/dashboard/workplace/index.tsx +++ b/src/pages/dashboard/workplace/index.tsx @@ -4,11 +4,14 @@ import { Radar } from '@ant-design/charts'; import { Link, useRequest } from '@umijs/max'; import { PageContainer } from '@ant-design/pro-components'; -import moment from 'moment'; +import dayjs from 'dayjs'; import EditableLinkGroup from './components/EditableLinkGroup'; import styles from './style.less'; import type { ActivitiesType, CurrentUser } from './data.d'; import { queryProjectNotice, queryActivities, fakeChartData } from './service'; +import relativeTime from 'dayjs/plugin/relativeTime'; + +dayjs.extend(relativeTime); const links = [ { @@ -82,10 +85,11 @@ const Workplace: FC = () => { const renderActivities = (item: ActivitiesType) => { const events = item.template.split(/@\{([^{}]*)\}/gi).map((key) => { - if (item[key]) { + if (item[key as keyof ActivitiesType]) { + const value = item[key as 'user']; return ( - - {item[key].name} + + {value.name} ); } @@ -104,7 +108,7 @@ const Workplace: FC = () => { } description={ - {moment(item.updatedAt).fromNow()} + {dayjs(item.updatedAt).fromNow()} } /> @@ -156,7 +160,7 @@ const Workplace: FC = () => { {item.member || ''} {item.updatedAt && ( - {moment(item.updatedAt).fromNow()} + {dayjs(item.updatedAt).fromNow()} )}

diff --git a/src/pages/editor/flow/common/IconFont/index.ts b/src/pages/editor/flow/common/IconFont/index.ts deleted file mode 100644 index 987647c0..00000000 --- a/src/pages/editor/flow/common/IconFont/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { createFromIconfontCN } from '@ant-design/icons'; - -const IconFont = createFromIconfontCN({ - scriptUrl: 'https://at.alicdn.com/t/font_1101588_01zniftxm9yp.js', -}); - -export default IconFont; diff --git a/src/pages/editor/flow/components/EditorContextMenu/FlowContextMenu.tsx b/src/pages/editor/flow/components/EditorContextMenu/FlowContextMenu.tsx deleted file mode 100644 index c5cc4e50..00000000 --- a/src/pages/editor/flow/components/EditorContextMenu/FlowContextMenu.tsx +++ /dev/null @@ -1,34 +0,0 @@ -import { CanvasMenu, ContextMenu, EdgeMenu, GroupMenu, MultiMenu, NodeMenu } from 'gg-editor'; - -import MenuItem from './MenuItem'; -import styles from './index.less'; - -const FlowContextMenu = () => ( - - - - - - - - - - - - - - - - - - - - - - - - - -); - -export default FlowContextMenu; diff --git a/src/pages/editor/flow/components/EditorContextMenu/KoniContextMenu.tsx b/src/pages/editor/flow/components/EditorContextMenu/KoniContextMenu.tsx deleted file mode 100644 index 8b049a5e..00000000 --- a/src/pages/editor/flow/components/EditorContextMenu/KoniContextMenu.tsx +++ /dev/null @@ -1,3 +0,0 @@ -import FlowContextMenu from './FlowContextMenu'; - -export default FlowContextMenu; diff --git a/src/pages/editor/flow/components/EditorContextMenu/MenuItem.tsx b/src/pages/editor/flow/components/EditorContextMenu/MenuItem.tsx deleted file mode 100644 index 297967ab..00000000 --- a/src/pages/editor/flow/components/EditorContextMenu/MenuItem.tsx +++ /dev/null @@ -1,27 +0,0 @@ -import { Command } from 'gg-editor'; -import React from 'react'; -import IconFont from '../../common/IconFont'; -import styles from './index.less'; - -const upperFirst = (str: string) => - str.toLowerCase().replace(/( |^)[a-z]/g, (l: string) => l.toUpperCase()); - -type MenuItemProps = { - command: string; - icon?: string; - text?: string; -}; -const MenuItem: React.FC = (props) => { - const { command, icon, text } = props; - - return ( - -
- - {text || upperFirst(command)} -
-
- ); -}; - -export default MenuItem; diff --git a/src/pages/editor/flow/components/EditorContextMenu/MindContextMenu.tsx b/src/pages/editor/flow/components/EditorContextMenu/MindContextMenu.tsx deleted file mode 100644 index 5a8b4076..00000000 --- a/src/pages/editor/flow/components/EditorContextMenu/MindContextMenu.tsx +++ /dev/null @@ -1,22 +0,0 @@ -import { CanvasMenu, ContextMenu, NodeMenu } from 'gg-editor'; - -import MenuItem from './MenuItem'; -import styles from './index.less'; - -const MindContextMenu = () => ( - - - - - - - - - - - - - -); - -export default MindContextMenu; diff --git a/src/pages/editor/flow/components/EditorContextMenu/index.less b/src/pages/editor/flow/components/EditorContextMenu/index.less deleted file mode 100644 index 39cbd2e9..00000000 --- a/src/pages/editor/flow/components/EditorContextMenu/index.less +++ /dev/null @@ -1,41 +0,0 @@ -@import '~antd/es/style/themes/default.less'; - -.contextMenu { - display: none; - overflow: hidden; - background: @component-background; - border-radius: 4px; - box-shadow: @box-shadow-base; - - .item { - display: flex; - align-items: center; - padding: 5px 12px; - cursor: pointer; - transition: all 0.3s; - user-select: none; - - &:hover { - background: @select-item-selected-bg; - } - - span.anticon { - margin-right: 8px; - } - } - - :global { - .disable { - :local { - .item { - color: @disabled-color; - cursor: auto; - - &:hover { - background: @item-hover-bg; - } - } - } - } - } -} diff --git a/src/pages/editor/flow/components/EditorContextMenu/index.tsx b/src/pages/editor/flow/components/EditorContextMenu/index.tsx deleted file mode 100644 index 6ee93423..00000000 --- a/src/pages/editor/flow/components/EditorContextMenu/index.tsx +++ /dev/null @@ -1,5 +0,0 @@ -import FlowContextMenu from './FlowContextMenu'; -import KoniContextMenu from './KoniContextMenu'; -import MindContextMenu from './MindContextMenu'; - -export { FlowContextMenu, MindContextMenu, KoniContextMenu }; diff --git a/src/pages/editor/flow/components/EditorDetailPanel/DetailForm.tsx b/src/pages/editor/flow/components/EditorDetailPanel/DetailForm.tsx deleted file mode 100644 index c89265b6..00000000 --- a/src/pages/editor/flow/components/EditorDetailPanel/DetailForm.tsx +++ /dev/null @@ -1,114 +0,0 @@ -import React from 'react'; -import { Card, Input, Select, Form } from 'antd'; -import { withPropsAPI } from 'gg-editor'; - -const upperFirst = (str: string) => - str.toLowerCase().replace(/( |^)[a-z]/g, (l: string) => l.toUpperCase()); - -const { Item } = Form; -const { Option } = Select; - -const inlineFormItemLayout = { - labelCol: { - sm: { span: 8 }, - }, - wrapperCol: { - sm: { span: 16 }, - }, -}; - -type DetailFormProps = { - type: string; - propsAPI?: any; -}; - -class DetailForm extends React.Component { - get item() { - const { propsAPI } = this.props; - return propsAPI.getSelected()[0]; - } - - handleFieldChange = (values: any) => { - const { propsAPI } = this.props; - const { getSelected, executeCommand, update } = propsAPI; - - setTimeout(() => { - const item = getSelected()[0]; - if (!item) { - return; - } - executeCommand(() => { - update(item, { - ...values, - }); - }); - }, 0); - }; - - handleInputBlur = (type: string) => (e: React.FormEvent) => { - e.preventDefault(); - this.handleFieldChange({ - [type]: e.currentTarget.value, - }); - }; - - renderNodeDetail = () => { - const { label } = this.item.getModel(); - - return ( -
- - - -
- ); - }; - - renderEdgeDetail = () => { - const { label = '', shape = 'flow-smooth' } = this.item.getModel(); - - return ( -
- - - - - - -
- ); - }; - - renderGroupDetail = () => { - const { label = '新建分组' } = this.item.getModel(); - - return ( -
- - - -
- ); - }; - - render() { - const { type } = this.props; - if (!this.item) { - return null; - } - - return ( - - {type === 'node' && this.renderNodeDetail()} - {type === 'edge' && this.renderEdgeDetail()} - {type === 'group' && this.renderGroupDetail()} - - ); - } -} - -export default withPropsAPI(DetailForm as any); diff --git a/src/pages/editor/flow/components/EditorDetailPanel/FlowDetailPanel.tsx b/src/pages/editor/flow/components/EditorDetailPanel/FlowDetailPanel.tsx deleted file mode 100644 index bb7035c9..00000000 --- a/src/pages/editor/flow/components/EditorDetailPanel/FlowDetailPanel.tsx +++ /dev/null @@ -1,27 +0,0 @@ -import { CanvasPanel, DetailPanel, EdgePanel, GroupPanel, MultiPanel, NodePanel } from 'gg-editor'; - -import { Card } from 'antd'; -import DetailForm from './DetailForm'; -import styles from './index.less'; - -const FlowDetailPanel = () => ( - - - - - - - - - - - - - - - - - -); - -export default FlowDetailPanel; diff --git a/src/pages/editor/flow/components/EditorDetailPanel/KoniDetailPanel.tsx b/src/pages/editor/flow/components/EditorDetailPanel/KoniDetailPanel.tsx deleted file mode 100644 index 18aea9a4..00000000 --- a/src/pages/editor/flow/components/EditorDetailPanel/KoniDetailPanel.tsx +++ /dev/null @@ -1,3 +0,0 @@ -import FlowDetailPanel from './FlowDetailPanel'; - -export default FlowDetailPanel; diff --git a/src/pages/editor/flow/components/EditorDetailPanel/MindDetailPanel.tsx b/src/pages/editor/flow/components/EditorDetailPanel/MindDetailPanel.tsx deleted file mode 100644 index dceaf36e..00000000 --- a/src/pages/editor/flow/components/EditorDetailPanel/MindDetailPanel.tsx +++ /dev/null @@ -1,18 +0,0 @@ -import { CanvasPanel, DetailPanel, NodePanel } from 'gg-editor'; - -import { Card } from 'antd'; -import DetailForm from './DetailForm'; -import styles from './index.less'; - -const MindDetailPanel = () => ( - - - - - - - - -); - -export default MindDetailPanel; diff --git a/src/pages/editor/flow/components/EditorDetailPanel/index.less b/src/pages/editor/flow/components/EditorDetailPanel/index.less deleted file mode 100644 index 0b2c564b..00000000 --- a/src/pages/editor/flow/components/EditorDetailPanel/index.less +++ /dev/null @@ -1,6 +0,0 @@ -@import '~antd/es/style/themes/default.less'; - -.detailPanel { - flex: 1; - background-color: @component-background; -} diff --git a/src/pages/editor/flow/components/EditorDetailPanel/index.tsx b/src/pages/editor/flow/components/EditorDetailPanel/index.tsx deleted file mode 100644 index 50aa37a8..00000000 --- a/src/pages/editor/flow/components/EditorDetailPanel/index.tsx +++ /dev/null @@ -1,5 +0,0 @@ -import FlowDetailPanel from './FlowDetailPanel'; -import KoniDetailPanel from './KoniDetailPanel'; -import MindDetailPanel from './MindDetailPanel'; - -export { FlowDetailPanel, MindDetailPanel, KoniDetailPanel }; diff --git a/src/pages/editor/flow/components/EditorItemPanel/FlowItemPanel.tsx b/src/pages/editor/flow/components/EditorItemPanel/FlowItemPanel.tsx deleted file mode 100644 index c7dcbe60..00000000 --- a/src/pages/editor/flow/components/EditorItemPanel/FlowItemPanel.tsx +++ /dev/null @@ -1,53 +0,0 @@ -import { Item, ItemPanel } from 'gg-editor'; - -import { Card } from 'antd'; -import styles from './index.less'; - -const FlowItemPanel = () => ( - - - - - - - - -); - -export default FlowItemPanel; diff --git a/src/pages/editor/flow/components/EditorItemPanel/KoniItemPanel.tsx b/src/pages/editor/flow/components/EditorItemPanel/KoniItemPanel.tsx deleted file mode 100644 index 3901d292..00000000 --- a/src/pages/editor/flow/components/EditorItemPanel/KoniItemPanel.tsx +++ /dev/null @@ -1,49 +0,0 @@ -import { Item, ItemPanel } from 'gg-editor'; - -import { Card } from 'antd'; -import styles from './index.less'; - -const KoniItemPanel = () => ( - - - - - - - -); - -export default KoniItemPanel; diff --git a/src/pages/editor/flow/components/EditorItemPanel/index.less b/src/pages/editor/flow/components/EditorItemPanel/index.less deleted file mode 100644 index b594a66b..00000000 --- a/src/pages/editor/flow/components/EditorItemPanel/index.less +++ /dev/null @@ -1,19 +0,0 @@ -@import '~antd/es/style/themes/default.less'; - -.itemPanel { - flex: 1; - - :global { - .ant-card { - height: 100%; - } - .ant-card-body { - display: flex; - flex-direction: column; - align-items: center; - > div { - margin-bottom: 16px; - } - } - } -} diff --git a/src/pages/editor/flow/components/EditorItemPanel/index.tsx b/src/pages/editor/flow/components/EditorItemPanel/index.tsx deleted file mode 100644 index 2ba03fbb..00000000 --- a/src/pages/editor/flow/components/EditorItemPanel/index.tsx +++ /dev/null @@ -1,4 +0,0 @@ -import FlowItemPanel from './FlowItemPanel'; -import KoniItemPanel from './KoniItemPanel'; - -export { FlowItemPanel, KoniItemPanel }; diff --git a/src/pages/editor/flow/components/EditorMinimap/index.tsx b/src/pages/editor/flow/components/EditorMinimap/index.tsx deleted file mode 100644 index b337edbf..00000000 --- a/src/pages/editor/flow/components/EditorMinimap/index.tsx +++ /dev/null @@ -1,10 +0,0 @@ -import { Card } from 'antd'; -import { Minimap } from 'gg-editor'; - -const EditorMinimap = () => ( - - - -); - -export default EditorMinimap; diff --git a/src/pages/editor/flow/components/EditorToolbar/FlowToolbar.tsx b/src/pages/editor/flow/components/EditorToolbar/FlowToolbar.tsx deleted file mode 100644 index 90494876..00000000 --- a/src/pages/editor/flow/components/EditorToolbar/FlowToolbar.tsx +++ /dev/null @@ -1,29 +0,0 @@ -import { Divider } from 'antd'; -import { Toolbar } from 'gg-editor'; -import ToolbarButton from './ToolbarButton'; -import styles from './index.less'; - -const FlowToolbar = () => ( - - - - - - - - - - - - - - - - - - - - -); - -export default FlowToolbar; diff --git a/src/pages/editor/flow/components/EditorToolbar/KoniToolbar.tsx b/src/pages/editor/flow/components/EditorToolbar/KoniToolbar.tsx deleted file mode 100644 index f222007a..00000000 --- a/src/pages/editor/flow/components/EditorToolbar/KoniToolbar.tsx +++ /dev/null @@ -1,3 +0,0 @@ -import FlowToolbar from './FlowToolbar'; - -export default FlowToolbar; diff --git a/src/pages/editor/flow/components/EditorToolbar/MindToolbar.tsx b/src/pages/editor/flow/components/EditorToolbar/MindToolbar.tsx deleted file mode 100644 index 23761093..00000000 --- a/src/pages/editor/flow/components/EditorToolbar/MindToolbar.tsx +++ /dev/null @@ -1,24 +0,0 @@ -import { Divider } from 'antd'; -import { Toolbar } from 'gg-editor'; -import ToolbarButton from './ToolbarButton'; -import styles from './index.less'; - -const FlowToolbar = () => ( - - - - - - - - - - - - - - - -); - -export default FlowToolbar; diff --git a/src/pages/editor/flow/components/EditorToolbar/ToolbarButton.tsx b/src/pages/editor/flow/components/EditorToolbar/ToolbarButton.tsx deleted file mode 100644 index 94f9e9c6..00000000 --- a/src/pages/editor/flow/components/EditorToolbar/ToolbarButton.tsx +++ /dev/null @@ -1,31 +0,0 @@ -import { Command } from 'gg-editor'; -import React from 'react'; -import { Tooltip } from 'antd'; -import IconFont from '../../common/IconFont'; -import styles from './index.less'; - -const upperFirst = (str: string) => - str.toLowerCase().replace(/( |^)[a-z]/g, (l: string) => l.toUpperCase()); - -type ToolbarButtonProps = { - command: string; - icon?: string; - text?: string; -}; -const ToolbarButton: React.FC = (props) => { - const { command, icon, text } = props; - - return ( - - - - - - ); -}; - -export default ToolbarButton; diff --git a/src/pages/editor/flow/components/EditorToolbar/index.less b/src/pages/editor/flow/components/EditorToolbar/index.less deleted file mode 100644 index d9e98d1f..00000000 --- a/src/pages/editor/flow/components/EditorToolbar/index.less +++ /dev/null @@ -1,40 +0,0 @@ -@import '~antd/es/style/themes/default.less'; - -.toolbar { - display: flex; - align-items: center; - - :global { - .command .anticon { - display: inline-block; - width: 27px; - height: 27px; - margin: 0 6px; - padding-top: 6px; - text-align: center; - cursor: pointer; - - &:hover { - border: 1px solid @item-active-bg; - } - } - - .disable .anticon { - color: @text-color-secondary; - cursor: auto; - - &:hover { - border: 1px solid @border-color-base; - } - } - } -} - -.tooltip { - :global { - .ant-tooltip-inner { - font-size: 12px; - border-radius: 0; - } - } -} diff --git a/src/pages/editor/flow/components/EditorToolbar/index.tsx b/src/pages/editor/flow/components/EditorToolbar/index.tsx deleted file mode 100644 index 58f1d277..00000000 --- a/src/pages/editor/flow/components/EditorToolbar/index.tsx +++ /dev/null @@ -1,5 +0,0 @@ -import FlowToolbar from './FlowToolbar'; -import KoniToolbar from './KoniToolbar'; -import MindToolbar from './MindToolbar'; - -export { FlowToolbar, MindToolbar, KoniToolbar }; diff --git a/src/pages/editor/flow/index.less b/src/pages/editor/flow/index.less deleted file mode 100644 index 92dac57d..00000000 --- a/src/pages/editor/flow/index.less +++ /dev/null @@ -1,48 +0,0 @@ -@import '~antd/es/style/themes/default.less'; - -.editor { - display: flex; - flex: 1; - flex-direction: column; - width: 100%; - height: calc(100vh - 250px); - background: @component-background; -} - -.editorHd { - padding: 8px; - background: @descriptions-bg; - border: 1px solid @item-active-bg; -} - -.editorBd { - flex: 1; -} - -.editorSidebar, -.editorContent { - display: flex; - flex-direction: column; -} - -.editorSidebar { - background: @descriptions-bg; - :global { - .g6-editor-minimap-container { - background: none !important ; - } - } - &:first-child { - border-right: 1px solid @item-active-bg; - } - - &:last-child { - border-left: 1px solid @item-active-bg; - } -} - -.flow, -.mind, -.koni { - flex: 1; -} diff --git a/src/pages/editor/flow/index.tsx b/src/pages/editor/flow/index.tsx deleted file mode 100644 index 1c972505..00000000 --- a/src/pages/editor/flow/index.tsx +++ /dev/null @@ -1,37 +0,0 @@ -import { Col, Row } from 'antd'; -import GGEditor, { Flow } from 'gg-editor'; - -import { PageContainer } from '@ant-design/pro-components'; -import EditorMinimap from './components/EditorMinimap'; -import { FlowContextMenu } from './components/EditorContextMenu'; -import { FlowDetailPanel } from './components/EditorDetailPanel'; -import { FlowItemPanel } from './components/EditorItemPanel'; -import { FlowToolbar } from './components/EditorToolbar'; -import styles from './index.less'; - -GGEditor.setTrackable(false); - -export default () => ( - - - - - - - - - - - - - - - - - - - - - - -); diff --git a/src/pages/editor/koni/common/IconFont/index.ts b/src/pages/editor/koni/common/IconFont/index.ts deleted file mode 100644 index 987647c0..00000000 --- a/src/pages/editor/koni/common/IconFont/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { createFromIconfontCN } from '@ant-design/icons'; - -const IconFont = createFromIconfontCN({ - scriptUrl: 'https://at.alicdn.com/t/font_1101588_01zniftxm9yp.js', -}); - -export default IconFont; diff --git a/src/pages/editor/koni/components/EditorContextMenu/FlowContextMenu.tsx b/src/pages/editor/koni/components/EditorContextMenu/FlowContextMenu.tsx deleted file mode 100644 index c5cc4e50..00000000 --- a/src/pages/editor/koni/components/EditorContextMenu/FlowContextMenu.tsx +++ /dev/null @@ -1,34 +0,0 @@ -import { CanvasMenu, ContextMenu, EdgeMenu, GroupMenu, MultiMenu, NodeMenu } from 'gg-editor'; - -import MenuItem from './MenuItem'; -import styles from './index.less'; - -const FlowContextMenu = () => ( - - - - - - - - - - - - - - - - - - - - - - - - - -); - -export default FlowContextMenu; diff --git a/src/pages/editor/koni/components/EditorContextMenu/KoniContextMenu.tsx b/src/pages/editor/koni/components/EditorContextMenu/KoniContextMenu.tsx deleted file mode 100644 index 8b049a5e..00000000 --- a/src/pages/editor/koni/components/EditorContextMenu/KoniContextMenu.tsx +++ /dev/null @@ -1,3 +0,0 @@ -import FlowContextMenu from './FlowContextMenu'; - -export default FlowContextMenu; diff --git a/src/pages/editor/koni/components/EditorContextMenu/MenuItem.tsx b/src/pages/editor/koni/components/EditorContextMenu/MenuItem.tsx deleted file mode 100644 index 297967ab..00000000 --- a/src/pages/editor/koni/components/EditorContextMenu/MenuItem.tsx +++ /dev/null @@ -1,27 +0,0 @@ -import { Command } from 'gg-editor'; -import React from 'react'; -import IconFont from '../../common/IconFont'; -import styles from './index.less'; - -const upperFirst = (str: string) => - str.toLowerCase().replace(/( |^)[a-z]/g, (l: string) => l.toUpperCase()); - -type MenuItemProps = { - command: string; - icon?: string; - text?: string; -}; -const MenuItem: React.FC = (props) => { - const { command, icon, text } = props; - - return ( - -
- - {text || upperFirst(command)} -
-
- ); -}; - -export default MenuItem; diff --git a/src/pages/editor/koni/components/EditorContextMenu/MindContextMenu.tsx b/src/pages/editor/koni/components/EditorContextMenu/MindContextMenu.tsx deleted file mode 100644 index 5a8b4076..00000000 --- a/src/pages/editor/koni/components/EditorContextMenu/MindContextMenu.tsx +++ /dev/null @@ -1,22 +0,0 @@ -import { CanvasMenu, ContextMenu, NodeMenu } from 'gg-editor'; - -import MenuItem from './MenuItem'; -import styles from './index.less'; - -const MindContextMenu = () => ( - - - - - - - - - - - - - -); - -export default MindContextMenu; diff --git a/src/pages/editor/koni/components/EditorContextMenu/index.less b/src/pages/editor/koni/components/EditorContextMenu/index.less deleted file mode 100644 index 25d68b2c..00000000 --- a/src/pages/editor/koni/components/EditorContextMenu/index.less +++ /dev/null @@ -1,40 +0,0 @@ -@import '~antd/es/style/themes/default.less'; - -.contextMenu { - display: none; - overflow: hidden; - background: @component-background; - border-radius: 4px; - box-shadow: @box-shadow-base; - .item { - display: flex; - align-items: center; - padding: 5px 12px; - cursor: pointer; - transition: all 0.3s; - user-select: none; - - &:hover { - background: @select-item-selected-bg; - } - - .anticon { - margin-right: 8px; - } - } - - :global { - .disable { - :local { - .item { - color: @disabled-color; - cursor: auto; - - &:hover { - background: @item-hover-bg; - } - } - } - } - } -} diff --git a/src/pages/editor/koni/components/EditorContextMenu/index.tsx b/src/pages/editor/koni/components/EditorContextMenu/index.tsx deleted file mode 100644 index 6ee93423..00000000 --- a/src/pages/editor/koni/components/EditorContextMenu/index.tsx +++ /dev/null @@ -1,5 +0,0 @@ -import FlowContextMenu from './FlowContextMenu'; -import KoniContextMenu from './KoniContextMenu'; -import MindContextMenu from './MindContextMenu'; - -export { FlowContextMenu, MindContextMenu, KoniContextMenu }; diff --git a/src/pages/editor/koni/components/EditorDetailPanel/DetailForm.tsx b/src/pages/editor/koni/components/EditorDetailPanel/DetailForm.tsx deleted file mode 100644 index c89265b6..00000000 --- a/src/pages/editor/koni/components/EditorDetailPanel/DetailForm.tsx +++ /dev/null @@ -1,114 +0,0 @@ -import React from 'react'; -import { Card, Input, Select, Form } from 'antd'; -import { withPropsAPI } from 'gg-editor'; - -const upperFirst = (str: string) => - str.toLowerCase().replace(/( |^)[a-z]/g, (l: string) => l.toUpperCase()); - -const { Item } = Form; -const { Option } = Select; - -const inlineFormItemLayout = { - labelCol: { - sm: { span: 8 }, - }, - wrapperCol: { - sm: { span: 16 }, - }, -}; - -type DetailFormProps = { - type: string; - propsAPI?: any; -}; - -class DetailForm extends React.Component { - get item() { - const { propsAPI } = this.props; - return propsAPI.getSelected()[0]; - } - - handleFieldChange = (values: any) => { - const { propsAPI } = this.props; - const { getSelected, executeCommand, update } = propsAPI; - - setTimeout(() => { - const item = getSelected()[0]; - if (!item) { - return; - } - executeCommand(() => { - update(item, { - ...values, - }); - }); - }, 0); - }; - - handleInputBlur = (type: string) => (e: React.FormEvent) => { - e.preventDefault(); - this.handleFieldChange({ - [type]: e.currentTarget.value, - }); - }; - - renderNodeDetail = () => { - const { label } = this.item.getModel(); - - return ( -
- - - -
- ); - }; - - renderEdgeDetail = () => { - const { label = '', shape = 'flow-smooth' } = this.item.getModel(); - - return ( -
- - - - - - -
- ); - }; - - renderGroupDetail = () => { - const { label = '新建分组' } = this.item.getModel(); - - return ( -
- - - -
- ); - }; - - render() { - const { type } = this.props; - if (!this.item) { - return null; - } - - return ( - - {type === 'node' && this.renderNodeDetail()} - {type === 'edge' && this.renderEdgeDetail()} - {type === 'group' && this.renderGroupDetail()} - - ); - } -} - -export default withPropsAPI(DetailForm as any); diff --git a/src/pages/editor/koni/components/EditorDetailPanel/FlowDetailPanel.tsx b/src/pages/editor/koni/components/EditorDetailPanel/FlowDetailPanel.tsx deleted file mode 100644 index bb7035c9..00000000 --- a/src/pages/editor/koni/components/EditorDetailPanel/FlowDetailPanel.tsx +++ /dev/null @@ -1,27 +0,0 @@ -import { CanvasPanel, DetailPanel, EdgePanel, GroupPanel, MultiPanel, NodePanel } from 'gg-editor'; - -import { Card } from 'antd'; -import DetailForm from './DetailForm'; -import styles from './index.less'; - -const FlowDetailPanel = () => ( - - - - - - - - - - - - - - - - - -); - -export default FlowDetailPanel; diff --git a/src/pages/editor/koni/components/EditorDetailPanel/KoniDetailPanel.tsx b/src/pages/editor/koni/components/EditorDetailPanel/KoniDetailPanel.tsx deleted file mode 100644 index 18aea9a4..00000000 --- a/src/pages/editor/koni/components/EditorDetailPanel/KoniDetailPanel.tsx +++ /dev/null @@ -1,3 +0,0 @@ -import FlowDetailPanel from './FlowDetailPanel'; - -export default FlowDetailPanel; diff --git a/src/pages/editor/koni/components/EditorDetailPanel/MindDetailPanel.tsx b/src/pages/editor/koni/components/EditorDetailPanel/MindDetailPanel.tsx deleted file mode 100644 index dceaf36e..00000000 --- a/src/pages/editor/koni/components/EditorDetailPanel/MindDetailPanel.tsx +++ /dev/null @@ -1,18 +0,0 @@ -import { CanvasPanel, DetailPanel, NodePanel } from 'gg-editor'; - -import { Card } from 'antd'; -import DetailForm from './DetailForm'; -import styles from './index.less'; - -const MindDetailPanel = () => ( - - - - - - - - -); - -export default MindDetailPanel; diff --git a/src/pages/editor/koni/components/EditorDetailPanel/index.less b/src/pages/editor/koni/components/EditorDetailPanel/index.less deleted file mode 100644 index 0b2c564b..00000000 --- a/src/pages/editor/koni/components/EditorDetailPanel/index.less +++ /dev/null @@ -1,6 +0,0 @@ -@import '~antd/es/style/themes/default.less'; - -.detailPanel { - flex: 1; - background-color: @component-background; -} diff --git a/src/pages/editor/koni/components/EditorDetailPanel/index.tsx b/src/pages/editor/koni/components/EditorDetailPanel/index.tsx deleted file mode 100644 index 50aa37a8..00000000 --- a/src/pages/editor/koni/components/EditorDetailPanel/index.tsx +++ /dev/null @@ -1,5 +0,0 @@ -import FlowDetailPanel from './FlowDetailPanel'; -import KoniDetailPanel from './KoniDetailPanel'; -import MindDetailPanel from './MindDetailPanel'; - -export { FlowDetailPanel, MindDetailPanel, KoniDetailPanel }; diff --git a/src/pages/editor/koni/components/EditorItemPanel/FlowItemPanel.tsx b/src/pages/editor/koni/components/EditorItemPanel/FlowItemPanel.tsx deleted file mode 100644 index c7dcbe60..00000000 --- a/src/pages/editor/koni/components/EditorItemPanel/FlowItemPanel.tsx +++ /dev/null @@ -1,53 +0,0 @@ -import { Item, ItemPanel } from 'gg-editor'; - -import { Card } from 'antd'; -import styles from './index.less'; - -const FlowItemPanel = () => ( - - - - - - - - -); - -export default FlowItemPanel; diff --git a/src/pages/editor/koni/components/EditorItemPanel/KoniItemPanel.tsx b/src/pages/editor/koni/components/EditorItemPanel/KoniItemPanel.tsx deleted file mode 100644 index 3901d292..00000000 --- a/src/pages/editor/koni/components/EditorItemPanel/KoniItemPanel.tsx +++ /dev/null @@ -1,49 +0,0 @@ -import { Item, ItemPanel } from 'gg-editor'; - -import { Card } from 'antd'; -import styles from './index.less'; - -const KoniItemPanel = () => ( - - - - - - - -); - -export default KoniItemPanel; diff --git a/src/pages/editor/koni/components/EditorItemPanel/index.less b/src/pages/editor/koni/components/EditorItemPanel/index.less deleted file mode 100644 index b594a66b..00000000 --- a/src/pages/editor/koni/components/EditorItemPanel/index.less +++ /dev/null @@ -1,19 +0,0 @@ -@import '~antd/es/style/themes/default.less'; - -.itemPanel { - flex: 1; - - :global { - .ant-card { - height: 100%; - } - .ant-card-body { - display: flex; - flex-direction: column; - align-items: center; - > div { - margin-bottom: 16px; - } - } - } -} diff --git a/src/pages/editor/koni/components/EditorItemPanel/index.tsx b/src/pages/editor/koni/components/EditorItemPanel/index.tsx deleted file mode 100644 index 2ba03fbb..00000000 --- a/src/pages/editor/koni/components/EditorItemPanel/index.tsx +++ /dev/null @@ -1,4 +0,0 @@ -import FlowItemPanel from './FlowItemPanel'; -import KoniItemPanel from './KoniItemPanel'; - -export { FlowItemPanel, KoniItemPanel }; diff --git a/src/pages/editor/koni/components/EditorMinimap/index.tsx b/src/pages/editor/koni/components/EditorMinimap/index.tsx deleted file mode 100644 index b337edbf..00000000 --- a/src/pages/editor/koni/components/EditorMinimap/index.tsx +++ /dev/null @@ -1,10 +0,0 @@ -import { Card } from 'antd'; -import { Minimap } from 'gg-editor'; - -const EditorMinimap = () => ( - - - -); - -export default EditorMinimap; diff --git a/src/pages/editor/koni/components/EditorToolbar/FlowToolbar.tsx b/src/pages/editor/koni/components/EditorToolbar/FlowToolbar.tsx deleted file mode 100644 index 90494876..00000000 --- a/src/pages/editor/koni/components/EditorToolbar/FlowToolbar.tsx +++ /dev/null @@ -1,29 +0,0 @@ -import { Divider } from 'antd'; -import { Toolbar } from 'gg-editor'; -import ToolbarButton from './ToolbarButton'; -import styles from './index.less'; - -const FlowToolbar = () => ( - - - - - - - - - - - - - - - - - - - - -); - -export default FlowToolbar; diff --git a/src/pages/editor/koni/components/EditorToolbar/KoniToolbar.tsx b/src/pages/editor/koni/components/EditorToolbar/KoniToolbar.tsx deleted file mode 100644 index f222007a..00000000 --- a/src/pages/editor/koni/components/EditorToolbar/KoniToolbar.tsx +++ /dev/null @@ -1,3 +0,0 @@ -import FlowToolbar from './FlowToolbar'; - -export default FlowToolbar; diff --git a/src/pages/editor/koni/components/EditorToolbar/MindToolbar.tsx b/src/pages/editor/koni/components/EditorToolbar/MindToolbar.tsx deleted file mode 100644 index 23761093..00000000 --- a/src/pages/editor/koni/components/EditorToolbar/MindToolbar.tsx +++ /dev/null @@ -1,24 +0,0 @@ -import { Divider } from 'antd'; -import { Toolbar } from 'gg-editor'; -import ToolbarButton from './ToolbarButton'; -import styles from './index.less'; - -const FlowToolbar = () => ( - - - - - - - - - - - - - - - -); - -export default FlowToolbar; diff --git a/src/pages/editor/koni/components/EditorToolbar/ToolbarButton.tsx b/src/pages/editor/koni/components/EditorToolbar/ToolbarButton.tsx deleted file mode 100644 index 94f9e9c6..00000000 --- a/src/pages/editor/koni/components/EditorToolbar/ToolbarButton.tsx +++ /dev/null @@ -1,31 +0,0 @@ -import { Command } from 'gg-editor'; -import React from 'react'; -import { Tooltip } from 'antd'; -import IconFont from '../../common/IconFont'; -import styles from './index.less'; - -const upperFirst = (str: string) => - str.toLowerCase().replace(/( |^)[a-z]/g, (l: string) => l.toUpperCase()); - -type ToolbarButtonProps = { - command: string; - icon?: string; - text?: string; -}; -const ToolbarButton: React.FC = (props) => { - const { command, icon, text } = props; - - return ( - - - - - - ); -}; - -export default ToolbarButton; diff --git a/src/pages/editor/koni/components/EditorToolbar/index.less b/src/pages/editor/koni/components/EditorToolbar/index.less deleted file mode 100644 index 4edd156f..00000000 --- a/src/pages/editor/koni/components/EditorToolbar/index.less +++ /dev/null @@ -1,39 +0,0 @@ -@import '~antd/es/style/themes/default.less'; - -.toolbar { - display: flex; - align-items: center; - :global { - .command .anticon { - display: inline-block; - width: 27px; - height: 27px; - margin: 0 6px; - padding-top: 6px; - text-align: center; - cursor: pointer; - - &:hover { - border: 1px solid @item-active-bg; - } - } - - .disable .anticon { - color: @text-color-secondary; - cursor: auto; - - &:hover { - border: 1px solid @border-color-base; - } - } - } -} - -.tooltip { - :global { - .ant-tooltip-inner { - font-size: 12px; - border-radius: 0; - } - } -} diff --git a/src/pages/editor/koni/components/EditorToolbar/index.tsx b/src/pages/editor/koni/components/EditorToolbar/index.tsx deleted file mode 100644 index 58f1d277..00000000 --- a/src/pages/editor/koni/components/EditorToolbar/index.tsx +++ /dev/null @@ -1,5 +0,0 @@ -import FlowToolbar from './FlowToolbar'; -import KoniToolbar from './KoniToolbar'; -import MindToolbar from './MindToolbar'; - -export { FlowToolbar, MindToolbar, KoniToolbar }; diff --git a/src/pages/editor/koni/index.less b/src/pages/editor/koni/index.less deleted file mode 100644 index 42923fcb..00000000 --- a/src/pages/editor/koni/index.less +++ /dev/null @@ -1,56 +0,0 @@ -@import '~antd/es/style/themes/default.less'; - -.editor { - display: flex; - flex: 1; - flex-direction: column; - width: 100%; - height: calc(100vh - 250px); - background: @descriptions-bg; -} - -.editorHd { - padding: 8px; - background: @descriptions-bg; - border: 1px solid @item-active-bg; -} - -.editorBd { - flex: 1; -} - -.editorSidebar, -.editorContent { - display: flex; - flex-direction: column; -} - -.editorContent { - :global { - .graph-container canvas { - vertical-align: middle; - } - } -} - -.editorSidebar { - background: @descriptions-bg; - :global { - .g6-editor-minimap-container { - background: none !important ; - } - } - &:first-child { - border-right: 1px solid @item-active-bg; - } - - &:last-child { - border-left: 1px solid @item-active-bg; - } -} - -.flow, -.mind, -.koni { - flex: 1; -} diff --git a/src/pages/editor/koni/index.tsx b/src/pages/editor/koni/index.tsx deleted file mode 100644 index 73397233..00000000 --- a/src/pages/editor/koni/index.tsx +++ /dev/null @@ -1,37 +0,0 @@ -import { Col, Row } from 'antd'; -import GGEditor, { Koni } from 'gg-editor'; - -import { PageContainer } from '@ant-design/pro-components'; -import EditorMinimap from './components/EditorMinimap'; -import { KoniContextMenu } from './components/EditorContextMenu'; -import { KoniDetailPanel } from './components/EditorDetailPanel'; -import { KoniItemPanel } from './components/EditorItemPanel'; -import { KoniToolbar } from './components/EditorToolbar'; -import styles from './index.less'; - -GGEditor.setTrackable(false); - -export default () => ( - - - - - - - - - - - - - - - - - - - - - - -); diff --git a/src/pages/editor/mind/common/IconFont/index.ts b/src/pages/editor/mind/common/IconFont/index.ts deleted file mode 100644 index 987647c0..00000000 --- a/src/pages/editor/mind/common/IconFont/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { createFromIconfontCN } from '@ant-design/icons'; - -const IconFont = createFromIconfontCN({ - scriptUrl: 'https://at.alicdn.com/t/font_1101588_01zniftxm9yp.js', -}); - -export default IconFont; diff --git a/src/pages/editor/mind/components/EditorContextMenu/FlowContextMenu.tsx b/src/pages/editor/mind/components/EditorContextMenu/FlowContextMenu.tsx deleted file mode 100644 index c5cc4e50..00000000 --- a/src/pages/editor/mind/components/EditorContextMenu/FlowContextMenu.tsx +++ /dev/null @@ -1,34 +0,0 @@ -import { CanvasMenu, ContextMenu, EdgeMenu, GroupMenu, MultiMenu, NodeMenu } from 'gg-editor'; - -import MenuItem from './MenuItem'; -import styles from './index.less'; - -const FlowContextMenu = () => ( - - - - - - - - - - - - - - - - - - - - - - - - - -); - -export default FlowContextMenu; diff --git a/src/pages/editor/mind/components/EditorContextMenu/KoniContextMenu.tsx b/src/pages/editor/mind/components/EditorContextMenu/KoniContextMenu.tsx deleted file mode 100644 index 8b049a5e..00000000 --- a/src/pages/editor/mind/components/EditorContextMenu/KoniContextMenu.tsx +++ /dev/null @@ -1,3 +0,0 @@ -import FlowContextMenu from './FlowContextMenu'; - -export default FlowContextMenu; diff --git a/src/pages/editor/mind/components/EditorContextMenu/MenuItem.tsx b/src/pages/editor/mind/components/EditorContextMenu/MenuItem.tsx deleted file mode 100644 index 297967ab..00000000 --- a/src/pages/editor/mind/components/EditorContextMenu/MenuItem.tsx +++ /dev/null @@ -1,27 +0,0 @@ -import { Command } from 'gg-editor'; -import React from 'react'; -import IconFont from '../../common/IconFont'; -import styles from './index.less'; - -const upperFirst = (str: string) => - str.toLowerCase().replace(/( |^)[a-z]/g, (l: string) => l.toUpperCase()); - -type MenuItemProps = { - command: string; - icon?: string; - text?: string; -}; -const MenuItem: React.FC = (props) => { - const { command, icon, text } = props; - - return ( - -
- - {text || upperFirst(command)} -
-
- ); -}; - -export default MenuItem; diff --git a/src/pages/editor/mind/components/EditorContextMenu/MindContextMenu.tsx b/src/pages/editor/mind/components/EditorContextMenu/MindContextMenu.tsx deleted file mode 100644 index 5a8b4076..00000000 --- a/src/pages/editor/mind/components/EditorContextMenu/MindContextMenu.tsx +++ /dev/null @@ -1,22 +0,0 @@ -import { CanvasMenu, ContextMenu, NodeMenu } from 'gg-editor'; - -import MenuItem from './MenuItem'; -import styles from './index.less'; - -const MindContextMenu = () => ( - - - - - - - - - - - - - -); - -export default MindContextMenu; diff --git a/src/pages/editor/mind/components/EditorContextMenu/index.less b/src/pages/editor/mind/components/EditorContextMenu/index.less deleted file mode 100644 index 25d68b2c..00000000 --- a/src/pages/editor/mind/components/EditorContextMenu/index.less +++ /dev/null @@ -1,40 +0,0 @@ -@import '~antd/es/style/themes/default.less'; - -.contextMenu { - display: none; - overflow: hidden; - background: @component-background; - border-radius: 4px; - box-shadow: @box-shadow-base; - .item { - display: flex; - align-items: center; - padding: 5px 12px; - cursor: pointer; - transition: all 0.3s; - user-select: none; - - &:hover { - background: @select-item-selected-bg; - } - - .anticon { - margin-right: 8px; - } - } - - :global { - .disable { - :local { - .item { - color: @disabled-color; - cursor: auto; - - &:hover { - background: @item-hover-bg; - } - } - } - } - } -} diff --git a/src/pages/editor/mind/components/EditorContextMenu/index.tsx b/src/pages/editor/mind/components/EditorContextMenu/index.tsx deleted file mode 100644 index 6ee93423..00000000 --- a/src/pages/editor/mind/components/EditorContextMenu/index.tsx +++ /dev/null @@ -1,5 +0,0 @@ -import FlowContextMenu from './FlowContextMenu'; -import KoniContextMenu from './KoniContextMenu'; -import MindContextMenu from './MindContextMenu'; - -export { FlowContextMenu, MindContextMenu, KoniContextMenu }; diff --git a/src/pages/editor/mind/components/EditorDetailPanel/DetailForm.tsx b/src/pages/editor/mind/components/EditorDetailPanel/DetailForm.tsx deleted file mode 100644 index c89265b6..00000000 --- a/src/pages/editor/mind/components/EditorDetailPanel/DetailForm.tsx +++ /dev/null @@ -1,114 +0,0 @@ -import React from 'react'; -import { Card, Input, Select, Form } from 'antd'; -import { withPropsAPI } from 'gg-editor'; - -const upperFirst = (str: string) => - str.toLowerCase().replace(/( |^)[a-z]/g, (l: string) => l.toUpperCase()); - -const { Item } = Form; -const { Option } = Select; - -const inlineFormItemLayout = { - labelCol: { - sm: { span: 8 }, - }, - wrapperCol: { - sm: { span: 16 }, - }, -}; - -type DetailFormProps = { - type: string; - propsAPI?: any; -}; - -class DetailForm extends React.Component { - get item() { - const { propsAPI } = this.props; - return propsAPI.getSelected()[0]; - } - - handleFieldChange = (values: any) => { - const { propsAPI } = this.props; - const { getSelected, executeCommand, update } = propsAPI; - - setTimeout(() => { - const item = getSelected()[0]; - if (!item) { - return; - } - executeCommand(() => { - update(item, { - ...values, - }); - }); - }, 0); - }; - - handleInputBlur = (type: string) => (e: React.FormEvent) => { - e.preventDefault(); - this.handleFieldChange({ - [type]: e.currentTarget.value, - }); - }; - - renderNodeDetail = () => { - const { label } = this.item.getModel(); - - return ( -
- - - -
- ); - }; - - renderEdgeDetail = () => { - const { label = '', shape = 'flow-smooth' } = this.item.getModel(); - - return ( -
- - - - - - -
- ); - }; - - renderGroupDetail = () => { - const { label = '新建分组' } = this.item.getModel(); - - return ( -
- - - -
- ); - }; - - render() { - const { type } = this.props; - if (!this.item) { - return null; - } - - return ( - - {type === 'node' && this.renderNodeDetail()} - {type === 'edge' && this.renderEdgeDetail()} - {type === 'group' && this.renderGroupDetail()} - - ); - } -} - -export default withPropsAPI(DetailForm as any); diff --git a/src/pages/editor/mind/components/EditorDetailPanel/FlowDetailPanel.tsx b/src/pages/editor/mind/components/EditorDetailPanel/FlowDetailPanel.tsx deleted file mode 100644 index bb7035c9..00000000 --- a/src/pages/editor/mind/components/EditorDetailPanel/FlowDetailPanel.tsx +++ /dev/null @@ -1,27 +0,0 @@ -import { CanvasPanel, DetailPanel, EdgePanel, GroupPanel, MultiPanel, NodePanel } from 'gg-editor'; - -import { Card } from 'antd'; -import DetailForm from './DetailForm'; -import styles from './index.less'; - -const FlowDetailPanel = () => ( - - - - - - - - - - - - - - - - - -); - -export default FlowDetailPanel; diff --git a/src/pages/editor/mind/components/EditorDetailPanel/KoniDetailPanel.tsx b/src/pages/editor/mind/components/EditorDetailPanel/KoniDetailPanel.tsx deleted file mode 100644 index 18aea9a4..00000000 --- a/src/pages/editor/mind/components/EditorDetailPanel/KoniDetailPanel.tsx +++ /dev/null @@ -1,3 +0,0 @@ -import FlowDetailPanel from './FlowDetailPanel'; - -export default FlowDetailPanel; diff --git a/src/pages/editor/mind/components/EditorDetailPanel/MindDetailPanel.tsx b/src/pages/editor/mind/components/EditorDetailPanel/MindDetailPanel.tsx deleted file mode 100644 index dceaf36e..00000000 --- a/src/pages/editor/mind/components/EditorDetailPanel/MindDetailPanel.tsx +++ /dev/null @@ -1,18 +0,0 @@ -import { CanvasPanel, DetailPanel, NodePanel } from 'gg-editor'; - -import { Card } from 'antd'; -import DetailForm from './DetailForm'; -import styles from './index.less'; - -const MindDetailPanel = () => ( - - - - - - - - -); - -export default MindDetailPanel; diff --git a/src/pages/editor/mind/components/EditorDetailPanel/index.less b/src/pages/editor/mind/components/EditorDetailPanel/index.less deleted file mode 100644 index 0b2c564b..00000000 --- a/src/pages/editor/mind/components/EditorDetailPanel/index.less +++ /dev/null @@ -1,6 +0,0 @@ -@import '~antd/es/style/themes/default.less'; - -.detailPanel { - flex: 1; - background-color: @component-background; -} diff --git a/src/pages/editor/mind/components/EditorDetailPanel/index.tsx b/src/pages/editor/mind/components/EditorDetailPanel/index.tsx deleted file mode 100644 index 50aa37a8..00000000 --- a/src/pages/editor/mind/components/EditorDetailPanel/index.tsx +++ /dev/null @@ -1,5 +0,0 @@ -import FlowDetailPanel from './FlowDetailPanel'; -import KoniDetailPanel from './KoniDetailPanel'; -import MindDetailPanel from './MindDetailPanel'; - -export { FlowDetailPanel, MindDetailPanel, KoniDetailPanel }; diff --git a/src/pages/editor/mind/components/EditorItemPanel/FlowItemPanel.tsx b/src/pages/editor/mind/components/EditorItemPanel/FlowItemPanel.tsx deleted file mode 100644 index c7dcbe60..00000000 --- a/src/pages/editor/mind/components/EditorItemPanel/FlowItemPanel.tsx +++ /dev/null @@ -1,53 +0,0 @@ -import { Item, ItemPanel } from 'gg-editor'; - -import { Card } from 'antd'; -import styles from './index.less'; - -const FlowItemPanel = () => ( - - - - - - - - -); - -export default FlowItemPanel; diff --git a/src/pages/editor/mind/components/EditorItemPanel/KoniItemPanel.tsx b/src/pages/editor/mind/components/EditorItemPanel/KoniItemPanel.tsx deleted file mode 100644 index 3901d292..00000000 --- a/src/pages/editor/mind/components/EditorItemPanel/KoniItemPanel.tsx +++ /dev/null @@ -1,49 +0,0 @@ -import { Item, ItemPanel } from 'gg-editor'; - -import { Card } from 'antd'; -import styles from './index.less'; - -const KoniItemPanel = () => ( - - - - - - - -); - -export default KoniItemPanel; diff --git a/src/pages/editor/mind/components/EditorItemPanel/index.less b/src/pages/editor/mind/components/EditorItemPanel/index.less deleted file mode 100644 index b594a66b..00000000 --- a/src/pages/editor/mind/components/EditorItemPanel/index.less +++ /dev/null @@ -1,19 +0,0 @@ -@import '~antd/es/style/themes/default.less'; - -.itemPanel { - flex: 1; - - :global { - .ant-card { - height: 100%; - } - .ant-card-body { - display: flex; - flex-direction: column; - align-items: center; - > div { - margin-bottom: 16px; - } - } - } -} diff --git a/src/pages/editor/mind/components/EditorItemPanel/index.tsx b/src/pages/editor/mind/components/EditorItemPanel/index.tsx deleted file mode 100644 index 2ba03fbb..00000000 --- a/src/pages/editor/mind/components/EditorItemPanel/index.tsx +++ /dev/null @@ -1,4 +0,0 @@ -import FlowItemPanel from './FlowItemPanel'; -import KoniItemPanel from './KoniItemPanel'; - -export { FlowItemPanel, KoniItemPanel }; diff --git a/src/pages/editor/mind/components/EditorMinimap/index.tsx b/src/pages/editor/mind/components/EditorMinimap/index.tsx deleted file mode 100644 index b337edbf..00000000 --- a/src/pages/editor/mind/components/EditorMinimap/index.tsx +++ /dev/null @@ -1,10 +0,0 @@ -import { Card } from 'antd'; -import { Minimap } from 'gg-editor'; - -const EditorMinimap = () => ( - - - -); - -export default EditorMinimap; diff --git a/src/pages/editor/mind/components/EditorToolbar/FlowToolbar.tsx b/src/pages/editor/mind/components/EditorToolbar/FlowToolbar.tsx deleted file mode 100644 index 90494876..00000000 --- a/src/pages/editor/mind/components/EditorToolbar/FlowToolbar.tsx +++ /dev/null @@ -1,29 +0,0 @@ -import { Divider } from 'antd'; -import { Toolbar } from 'gg-editor'; -import ToolbarButton from './ToolbarButton'; -import styles from './index.less'; - -const FlowToolbar = () => ( - - - - - - - - - - - - - - - - - - - - -); - -export default FlowToolbar; diff --git a/src/pages/editor/mind/components/EditorToolbar/KoniToolbar.tsx b/src/pages/editor/mind/components/EditorToolbar/KoniToolbar.tsx deleted file mode 100644 index f222007a..00000000 --- a/src/pages/editor/mind/components/EditorToolbar/KoniToolbar.tsx +++ /dev/null @@ -1,3 +0,0 @@ -import FlowToolbar from './FlowToolbar'; - -export default FlowToolbar; diff --git a/src/pages/editor/mind/components/EditorToolbar/MindToolbar.tsx b/src/pages/editor/mind/components/EditorToolbar/MindToolbar.tsx deleted file mode 100644 index 23761093..00000000 --- a/src/pages/editor/mind/components/EditorToolbar/MindToolbar.tsx +++ /dev/null @@ -1,24 +0,0 @@ -import { Divider } from 'antd'; -import { Toolbar } from 'gg-editor'; -import ToolbarButton from './ToolbarButton'; -import styles from './index.less'; - -const FlowToolbar = () => ( - - - - - - - - - - - - - - - -); - -export default FlowToolbar; diff --git a/src/pages/editor/mind/components/EditorToolbar/ToolbarButton.tsx b/src/pages/editor/mind/components/EditorToolbar/ToolbarButton.tsx deleted file mode 100644 index 94f9e9c6..00000000 --- a/src/pages/editor/mind/components/EditorToolbar/ToolbarButton.tsx +++ /dev/null @@ -1,31 +0,0 @@ -import { Command } from 'gg-editor'; -import React from 'react'; -import { Tooltip } from 'antd'; -import IconFont from '../../common/IconFont'; -import styles from './index.less'; - -const upperFirst = (str: string) => - str.toLowerCase().replace(/( |^)[a-z]/g, (l: string) => l.toUpperCase()); - -type ToolbarButtonProps = { - command: string; - icon?: string; - text?: string; -}; -const ToolbarButton: React.FC = (props) => { - const { command, icon, text } = props; - - return ( - - - - - - ); -}; - -export default ToolbarButton; diff --git a/src/pages/editor/mind/components/EditorToolbar/index.less b/src/pages/editor/mind/components/EditorToolbar/index.less deleted file mode 100644 index d9e98d1f..00000000 --- a/src/pages/editor/mind/components/EditorToolbar/index.less +++ /dev/null @@ -1,40 +0,0 @@ -@import '~antd/es/style/themes/default.less'; - -.toolbar { - display: flex; - align-items: center; - - :global { - .command .anticon { - display: inline-block; - width: 27px; - height: 27px; - margin: 0 6px; - padding-top: 6px; - text-align: center; - cursor: pointer; - - &:hover { - border: 1px solid @item-active-bg; - } - } - - .disable .anticon { - color: @text-color-secondary; - cursor: auto; - - &:hover { - border: 1px solid @border-color-base; - } - } - } -} - -.tooltip { - :global { - .ant-tooltip-inner { - font-size: 12px; - border-radius: 0; - } - } -} diff --git a/src/pages/editor/mind/components/EditorToolbar/index.tsx b/src/pages/editor/mind/components/EditorToolbar/index.tsx deleted file mode 100644 index 58f1d277..00000000 --- a/src/pages/editor/mind/components/EditorToolbar/index.tsx +++ /dev/null @@ -1,5 +0,0 @@ -import FlowToolbar from './FlowToolbar'; -import KoniToolbar from './KoniToolbar'; -import MindToolbar from './MindToolbar'; - -export { FlowToolbar, MindToolbar, KoniToolbar }; diff --git a/src/pages/editor/mind/index.less b/src/pages/editor/mind/index.less deleted file mode 100644 index 42923fcb..00000000 --- a/src/pages/editor/mind/index.less +++ /dev/null @@ -1,56 +0,0 @@ -@import '~antd/es/style/themes/default.less'; - -.editor { - display: flex; - flex: 1; - flex-direction: column; - width: 100%; - height: calc(100vh - 250px); - background: @descriptions-bg; -} - -.editorHd { - padding: 8px; - background: @descriptions-bg; - border: 1px solid @item-active-bg; -} - -.editorBd { - flex: 1; -} - -.editorSidebar, -.editorContent { - display: flex; - flex-direction: column; -} - -.editorContent { - :global { - .graph-container canvas { - vertical-align: middle; - } - } -} - -.editorSidebar { - background: @descriptions-bg; - :global { - .g6-editor-minimap-container { - background: none !important ; - } - } - &:first-child { - border-right: 1px solid @item-active-bg; - } - - &:last-child { - border-left: 1px solid @item-active-bg; - } -} - -.flow, -.mind, -.koni { - flex: 1; -} diff --git a/src/pages/editor/mind/index.tsx b/src/pages/editor/mind/index.tsx deleted file mode 100644 index 30170198..00000000 --- a/src/pages/editor/mind/index.tsx +++ /dev/null @@ -1,34 +0,0 @@ -import { Col, Row } from 'antd'; -import GGEditor, { Mind } from 'gg-editor'; - -import { PageContainer } from '@ant-design/pro-components'; -import EditorMinimap from './components/EditorMinimap'; -import { MindContextMenu } from './components/EditorContextMenu'; -import { MindDetailPanel } from './components/EditorDetailPanel'; -import { MindToolbar } from './components/EditorToolbar'; -import data from './worldCup2018.json'; -import styles from './index.less'; - -GGEditor.setTrackable(false); - -export default () => ( - - - - - - - - - - - - - - - - - - - -); diff --git a/src/pages/editor/mind/worldCup2018.json b/src/pages/editor/mind/worldCup2018.json deleted file mode 100644 index 44f3e63f..00000000 --- a/src/pages/editor/mind/worldCup2018.json +++ /dev/null @@ -1,129 +0,0 @@ -{ - "roots": [ - { - "label": "法国", - "children": [ - { - "label": "克罗地亚", - "side": "left", - "children": [ - { - "label": "克罗地亚", - "children": [ - { - "label": "克罗地亚", - "children": [ - { - "label": "克罗地亚" - }, - { - "label": "丹麦" - } - ] - }, - { - "label": "俄罗斯", - "children": [ - { - "label": "俄罗斯" - }, - { - "label": "西班牙" - } - ] - } - ] - }, - { - "label": "英格兰", - "children": [ - { - "label": "英格兰", - "children": [ - { - "label": "英格兰" - }, - { - "label": "哥伦比亚" - } - ] - }, - { - "label": "瑞典", - "children": [ - { - "label": "瑞士" - }, - { - "label": "瑞典" - } - ] - } - ] - } - ] - }, - { - "label": "法国", - "side": "right", - "children": [ - { - "label": "法国", - "children": [ - { - "label": "法国", - "children": [ - { - "label": "法国" - }, - { - "label": "阿根廷" - } - ] - }, - { - "label": "乌拉圭", - "children": [ - { - "label": "乌拉圭" - }, - { - "label": "葡萄牙" - } - ] - } - ] - }, - { - "label": "比利时", - "children": [ - { - "label": "比利时", - "children": [ - { - "label": "比利时" - }, - { - "label": "日本" - } - ] - }, - { - "label": "巴西", - "children": [ - { - "label": "巴西" - }, - { - "label": "墨西哥" - } - ] - } - ] - } - ] - } - ] - } - ] -} diff --git a/src/pages/form/advanced-form/components/TableForm.tsx b/src/pages/form/advanced-form/components/TableForm.tsx index 26059b67..3925c123 100644 --- a/src/pages/form/advanced-form/components/TableForm.tsx +++ b/src/pages/form/advanced-form/components/TableForm.tsx @@ -22,7 +22,7 @@ const TableForm: FC = ({ value, onChange }) => { const [clickedCancel, setClickedCancel] = useState(false); const [loading, setLoading] = useState(false); const [index, setIndex] = useState(0); - const [cacheOriginData, setCacheOriginData] = useState({}); + const [cacheOriginData, setCacheOriginData] = useState>({}); const [data, setData] = useState(value); const getRowByKey = (key: string, newData?: TableFormDateType[]) => @@ -68,13 +68,13 @@ const TableForm: FC = ({ value, onChange }) => { const handleFieldChange = ( e: React.ChangeEvent, - fieldName: string, + fieldName: keyof TableFormDateType, key: string, ) => { const newData = [...(data as TableFormDateType[])]; const target = getRowByKey(key, newData); - if (target) { - target[fieldName] = e.target.value; + if (target && target[fieldName]) { + target[fieldName as 'key'] = e.target.value; setData(newData); } }; diff --git a/src/pages/form/advanced-form/index.tsx b/src/pages/form/advanced-form/index.tsx index cb88927f..604e2e96 100644 --- a/src/pages/form/advanced-form/index.tsx +++ b/src/pages/form/advanced-form/index.tsx @@ -84,7 +84,7 @@ const AdvancedForm: FC> = () => { if (!err || err.errors.length === 0) { return null; } - const key = err.name[0] as string; + const key = err.name[0] as 'name' | 'url' | 'owner' | 'approver' | 'dateRange' | 'type'; return (
  • scrollToField(key)}> diff --git a/src/pages/form/basic-form/index.tsx b/src/pages/form/basic-form/index.tsx index 24d0cd2c..fad0f004 100644 --- a/src/pages/form/basic-form/index.tsx +++ b/src/pages/form/basic-form/index.tsx @@ -127,7 +127,7 @@ const BasicForm: FC> = () => { width="xs" fieldProps={{ formatter: (value) => `${value || 0}%`, - parser: (value) => (value ? value.replace('%', '') : '0'), + parser: (value) => Number(value ? value.replace('%', '') : '0'), }} /> diff --git a/src/pages/form/step-form/index.tsx b/src/pages/form/step-form/index.tsx index f0b434fb..47c3aca4 100644 --- a/src/pages/form/step-form/index.tsx +++ b/src/pages/form/step-form/index.tsx @@ -43,6 +43,7 @@ const StepDescriptions: React.FC<{ const StepResult: React.FC<{ onFinish: () => Promise; + children?: React.ReactNode; }> = (props) => { return ( | undefined; onDone: () => void; onSubmit: (values: BasicListItemDataType) => void; + children?: React.ReactNode; }; const OperationModal: FC = (props) => { diff --git a/src/pages/list/basic-list/index.tsx b/src/pages/list/basic-list/index.tsx index 94ab9282..1ec60e17 100644 --- a/src/pages/list/basic-list/index.tsx +++ b/src/pages/list/basic-list/index.tsx @@ -18,7 +18,7 @@ import { import { PageContainer } from '@ant-design/pro-components'; import { useRequest } from '@umijs/max'; -import moment from 'moment'; +import dayjs from 'dayjs'; import OperationModal from './components/OperationModal'; import { addFakeList, queryFakeList, removeFakeList, updateFakeList } from './service'; import type { BasicListItemDataType } from './data.d'; @@ -52,7 +52,7 @@ const ListContent = ({
  • 开始时间 -

    {moment(createdAt).format('YYYY-MM-DD HH:mm')}

    +

    {dayjs(createdAt).format('YYYY-MM-DD HH:mm')}

    diff --git a/src/pages/list/search/applications/components/StandardFormRow/index.tsx b/src/pages/list/search/applications/components/StandardFormRow/index.tsx index fe4cb388..0b244361 100644 --- a/src/pages/list/search/applications/components/StandardFormRow/index.tsx +++ b/src/pages/list/search/applications/components/StandardFormRow/index.tsx @@ -8,6 +8,7 @@ type StandardFormRowProps = { block?: boolean; grid?: boolean; style?: React.CSSProperties; + children?: React.ReactNode; }; const StandardFormRow: React.FC = ({ diff --git a/src/pages/list/search/applications/components/TagSelect/index.tsx b/src/pages/list/search/applications/components/TagSelect/index.tsx index 5f10efd4..ded2c5ab 100644 --- a/src/pages/list/search/applications/components/TagSelect/index.tsx +++ b/src/pages/list/search/applications/components/TagSelect/index.tsx @@ -13,6 +13,7 @@ export interface TagSelectOptionProps { style?: React.CSSProperties; checked?: boolean; onChange?: (value: string | number, state: boolean) => void; + children?: React.ReactNode; } const TagSelectOption: React.FC & { diff --git a/src/pages/list/search/articles/components/ArticleListContent/index.tsx b/src/pages/list/search/articles/components/ArticleListContent/index.tsx index b5734538..8621e7f8 100644 --- a/src/pages/list/search/articles/components/ArticleListContent/index.tsx +++ b/src/pages/list/search/articles/components/ArticleListContent/index.tsx @@ -1,6 +1,6 @@ import { Avatar } from 'antd'; import React from 'react'; -import moment from 'moment'; +import dayjs from 'dayjs'; import styles from './index.less'; type ArticleListContentProps = { @@ -21,7 +21,7 @@ const ArticleListContent: React.FC = ({
    {owner} 发布在 {href} - {moment(updatedAt).format('YYYY-MM-DD HH:mm')} + {dayjs(updatedAt).format('YYYY-MM-DD HH:mm')}
    ); diff --git a/src/pages/list/search/articles/components/StandardFormRow/index.tsx b/src/pages/list/search/articles/components/StandardFormRow/index.tsx index fe4cb388..33285ab8 100644 --- a/src/pages/list/search/articles/components/StandardFormRow/index.tsx +++ b/src/pages/list/search/articles/components/StandardFormRow/index.tsx @@ -7,6 +7,7 @@ type StandardFormRowProps = { last?: boolean; block?: boolean; grid?: boolean; + children?: React.ReactNode; style?: React.CSSProperties; }; diff --git a/src/pages/list/search/articles/components/TagSelect/index.tsx b/src/pages/list/search/articles/components/TagSelect/index.tsx index 5f10efd4..a027ed44 100644 --- a/src/pages/list/search/articles/components/TagSelect/index.tsx +++ b/src/pages/list/search/articles/components/TagSelect/index.tsx @@ -12,6 +12,7 @@ export interface TagSelectOptionProps { value: string | number; style?: React.CSSProperties; checked?: boolean; + children?: React.ReactNode; onChange?: (value: string | number, state: boolean) => void; } diff --git a/src/pages/list/search/index.tsx b/src/pages/list/search/index.tsx index 3f066220..61cbfe72 100644 --- a/src/pages/list/search/index.tsx +++ b/src/pages/list/search/index.tsx @@ -4,13 +4,7 @@ import type { FC } from 'react'; import { history } from '@umijs/max'; type SearchProps = { - match: { - url: string; - path: string; - }; - location: { - pathname: string; - }; + children?: React.ReactNode; }; const tabList = [ diff --git a/src/pages/list/search/projects/components/StandardFormRow/index.tsx b/src/pages/list/search/projects/components/StandardFormRow/index.tsx index fe4cb388..33285ab8 100644 --- a/src/pages/list/search/projects/components/StandardFormRow/index.tsx +++ b/src/pages/list/search/projects/components/StandardFormRow/index.tsx @@ -7,6 +7,7 @@ type StandardFormRowProps = { last?: boolean; block?: boolean; grid?: boolean; + children?: React.ReactNode; style?: React.CSSProperties; }; diff --git a/src/pages/list/search/projects/components/TagSelect/index.tsx b/src/pages/list/search/projects/components/TagSelect/index.tsx index 5f10efd4..64223ef9 100644 --- a/src/pages/list/search/projects/components/TagSelect/index.tsx +++ b/src/pages/list/search/projects/components/TagSelect/index.tsx @@ -10,6 +10,7 @@ const { CheckableTag } = Tag; export interface TagSelectOptionProps { value: string | number; + children?: React.ReactNode; style?: React.CSSProperties; checked?: boolean; onChange?: (value: string | number, state: boolean) => void; diff --git a/src/pages/list/search/projects/index.tsx b/src/pages/list/search/projects/index.tsx index 992ba53e..8c3396da 100644 --- a/src/pages/list/search/projects/index.tsx +++ b/src/pages/list/search/projects/index.tsx @@ -1,5 +1,4 @@ import { Card, Col, Form, List, Row, Select, Typography } from 'antd'; -import moment from 'moment'; import type { FC } from 'react'; import { useRequest } from '@umijs/max'; import AvatarList from './components/AvatarList'; @@ -8,6 +7,10 @@ import TagSelect from './components/TagSelect'; import type { ListItemDataType } from './data.d'; import { queryFakeList } from './service'; import styles from './style.less'; +import dayjs from 'dayjs'; +import relativeTime from 'dayjs/plugin/relativeTime'; + +dayjs.extend(relativeTime); const { Option } = Select; const FormItem = Form.Item; @@ -51,7 +54,7 @@ const Projects: FC = () => { } />
    - {moment(item.updatedAt).fromNow()} + {dayjs(item.updatedAt).fromNow()}
    {item.members.map((member, i) => ( diff --git a/src/pages/list/table-list/_mock.ts b/src/pages/list/table-list/_mock.ts index 26724780..9ff423aa 100644 --- a/src/pages/list/table-list/_mock.ts +++ b/src/pages/list/table-list/_mock.ts @@ -1,4 +1,3 @@ -// eslint-disable-next-line import/no-extraneous-dependencies import type { Request, Response } from 'express'; import { parse } from 'url'; import type { TableListItem, TableListParams } from './data.d'; @@ -47,7 +46,7 @@ function getRule(req: Request, res: Response, u: string) { ); if (params.sorter) { const sorter = JSON.parse(params.sorter as any); - dataSource = dataSource.sort((prev, next) => { + dataSource = dataSource.sort((prev: any, next: any) => { let sortNumber = 0; Object.keys(sorter).forEach((key) => { if (sorter[key] === 'descend') { @@ -75,7 +74,7 @@ function getRule(req: Request, res: Response, u: string) { if (!filter[key]) { return true; } - if (filter[key].includes(`${item[key]}`)) { + if (filter[key].includes(`${item[key as 'status']}`)) { return true; } return false; diff --git a/src/pages/list/table-list/components/CreateForm.tsx b/src/pages/list/table-list/components/CreateForm.tsx index f7ecb093..d84822fb 100644 --- a/src/pages/list/table-list/components/CreateForm.tsx +++ b/src/pages/list/table-list/components/CreateForm.tsx @@ -3,6 +3,7 @@ import { Modal } from 'antd'; type CreateFormProps = { modalVisible: boolean; + children?: React.ReactNode; onCancel: () => void; }; diff --git a/src/pages/profile/advanced/index.tsx b/src/pages/profile/advanced/index.tsx index e28c09b4..6730b7c6 100644 --- a/src/pages/profile/advanced/index.tsx +++ b/src/pages/profile/advanced/index.tsx @@ -202,7 +202,7 @@ const columns = [ ]; type AdvancedState = { - operationKey: string; + operationKey: 'tab1' | 'tab2' | 'tab3'; tabActiveKey: string; }; @@ -243,7 +243,7 @@ const Advanced: FC = () => { seTabStatus({ ...tabStatus, tabActiveKey }); }; const onOperationTabChange = (key: string) => { - seTabStatus({ ...tabStatus, operationKey: key }); + seTabStatus({ ...tabStatus, operationKey: key as 'tab1' }); }; return ( @@ -345,7 +345,7 @@ const Advanced: FC = () => { tabList={operationTabList} onTabChange={onOperationTabChange} > - {contentList[tabStatus.operationKey]} + {contentList[tabStatus.operationKey] as React.ReactNode}
    diff --git a/src/pages/user/register-result/index.tsx b/src/pages/user/register-result/index.tsx index cbe22dac..77be58fa 100644 --- a/src/pages/user/register-result/index.tsx +++ b/src/pages/user/register-result/index.tsx @@ -1,7 +1,6 @@ import { Button, Result } from 'antd'; -import { Link } from '@umijs/max'; +import { Link, useSearchParams } from '@umijs/max'; import React from 'react'; -import type { RouteChildrenProps } from 'react-router'; import styles from './style.less'; @@ -18,12 +17,9 @@ const actions = (
    ); -export type LocationState = Record; - -const RegisterResult: React.FC = ({ location }) => { - const email = location.state - ? (location.state as LocationState).account - : 'AntDesign@example.com'; +const RegisterResult: React.FC> = () => { + const [params] = useSearchParams(); + const email = params?.get('account') || 'AntDesign@example.com'; return ( { if (data.status === 'ok') { message.success('注册成功!'); history.push({ - pathname: '/user/register-result', - state: { - account: params.email, - }, + pathname: '/user/register-result?account=' + params.email, }); } },