From 8209dae48e4e327fa9446bdb92e86607c192cfb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=92=AC=E8=BD=AE=E7=8C=AB?= <10928033@qq.com> Date: Tue, 17 Jan 2023 21:26:07 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=AF=BC=E5=85=A5=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E6=A0=91=E9=A2=84=E8=A7=88=E7=AD=89=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 4 +- pnpm-lock.yaml | 20 ++ src/assets/icons/delete.svg | 13 +- src/assets/icons/return.svg | 8 + src/components/webtopo-svg-preview/index.vue | 242 ++++++++++++++++++ .../components/center-panel/index.vue | 2 +- .../components/component-tree/index.vue | 35 +++ .../components/connection-line/index.vue | 14 +- .../components/echarts/pie-charts/index.vue | 42 +-- .../components/export-json/index.vue | 36 +++ .../components/import-json/index.vue | 50 ++++ .../right-panel/dynamic-el-form-item.vue | 19 ++ .../components/right-panel/json-edit.vue | 44 ++++ .../components/top-panel/index.vue | 44 +++- src/components/webtopo-svgedit/index.vue | 60 ++++- src/components/webtopo-svgedit/types.ts | 19 ++ src/config-center/ace-edit/index.ts | 24 ++ src/config-center/system/index.ts | 5 + .../vue/echarts/pie-charts/index.ts | 41 ++- src/store/config/types.ts | 23 +- src/views/edit/index.vue | 5 +- src/views/preview/index.vue | 14 +- 22 files changed, 715 insertions(+), 49 deletions(-) create mode 100644 src/assets/icons/return.svg create mode 100644 src/components/webtopo-svg-preview/index.vue create mode 100644 src/components/webtopo-svgedit/components/component-tree/index.vue create mode 100644 src/components/webtopo-svgedit/components/export-json/index.vue create mode 100644 src/components/webtopo-svgedit/components/import-json/index.vue create mode 100644 src/components/webtopo-svgedit/components/right-panel/json-edit.vue create mode 100644 src/components/webtopo-svgedit/types.ts create mode 100644 src/config-center/ace-edit/index.ts diff --git a/package.json b/package.json index d15b53c..b9abc55 100644 --- a/package.json +++ b/package.json @@ -10,12 +10,14 @@ "postinstall": "husky install" }, "dependencies": { + "ace-builds": "^1.14.0", "echarts": "^5.4.1", "element-plus": "^2.2.9", "pinia": "^2.0.16", "vue": "^3.2.25", "vue-echarts": "^6.5.1", - "vue-router": "4" + "vue-router": "4", + "vue3-ace-editor": "^2.2.2" }, "devDependencies": { "@commitlint/cli": "^17.0.3", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index bfbae5d..e9dbe2e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -6,6 +6,7 @@ specifiers: '@typescript-eslint/eslint-plugin': ^5.30.5 '@typescript-eslint/parser': ^5.30.5 '@vitejs/plugin-vue': ^2.3.3 + ace-builds: ^1.14.0 echarts: ^5.4.1 element-plus: ^2.2.9 eslint: ^8.19.0 @@ -27,15 +28,18 @@ specifiers: vue-eslint-parser: ^9.0.3 vue-router: '4' vue-tsc: ^0.34.7 + vue3-ace-editor: ^2.2.2 windicss: ^3.5.6 dependencies: + ace-builds: 1.14.0 echarts: 5.4.1 element-plus: 2.2.9_vue@3.2.37 pinia: 2.0.17_j6bzmzd4ujpabbp5objtwxyjp4 vue: 3.2.37 vue-echarts: 6.5.1_echarts@5.4.1+vue@3.2.37 vue-router: 4.1.1_vue@3.2.37 + vue3-ace-editor: 2.2.2 devDependencies: '@commitlint/cli': 17.0.3 @@ -770,6 +774,10 @@ packages: through: 2.3.8 dev: true + /ace-builds/1.14.0: + resolution: {integrity: sha512-3q8LvawomApRCt4cC0OzxVjDsZ609lDbm8l0Xl9uqG06dKEq4RT0YXLUyk7J2SxmqIp5YXzZNw767Dr8GKUruw==} + dev: false + /acorn-jsx/5.3.2_acorn@8.7.1: resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} peerDependencies: @@ -3219,6 +3227,10 @@ packages: resolution: {integrity: sha512-R/tCuvuOHQ8o2boRP6vgx8hXCCy87H1eY9V5imBYeVNyNVpuL9ciReSccLj2gDcax9+2weXy3bc8Vv+NRXeEvQ==} dev: false + /resize-observer-polyfill/1.5.1: + resolution: {integrity: sha512-LwZrotdHOo12nQuZlHEmtuXdqGoOD0OhaxopaNFxWzInpEgaLWoVuAMbTzixuosCx2nEG58ngzW3vxdWoxIgdg==} + dev: false + /resolve-from/4.0.0: resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} engines: {node: '>=4'} @@ -3933,6 +3945,14 @@ packages: '@vue/server-renderer': 3.2.37_vue@3.2.37 '@vue/shared': 3.2.37 + /vue3-ace-editor/2.2.2: + resolution: {integrity: sha512-fZ6OWosbU+odLrtrcGC/536QjCigujYJB0Hf6/tBp+ef/ohTadwQAqyBlVzOmvrmzZyubphpV9zkaZcx5Fuivw==} + dependencies: + ace-builds: 1.14.0 + resize-observer-polyfill: 1.5.1 + vue: 3.2.37 + dev: false + /which/2.0.2: resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} engines: {node: '>= 8'} diff --git a/src/assets/icons/delete.svg b/src/assets/icons/delete.svg index 7e876cb..fd94203 100644 --- a/src/assets/icons/delete.svg +++ b/src/assets/icons/delete.svg @@ -1,9 +1,12 @@ - - - - - + + + + + + + + \ No newline at end of file diff --git a/src/assets/icons/return.svg b/src/assets/icons/return.svg new file mode 100644 index 0000000..8ae9abc --- /dev/null +++ b/src/assets/icons/return.svg @@ -0,0 +1,8 @@ + + + + + \ No newline at end of file diff --git a/src/components/webtopo-svg-preview/index.vue b/src/components/webtopo-svg-preview/index.vue new file mode 100644 index 0000000..cc1e661 --- /dev/null +++ b/src/components/webtopo-svg-preview/index.vue @@ -0,0 +1,242 @@ + + + + diff --git a/src/components/webtopo-svgedit/components/center-panel/index.vue b/src/components/webtopo-svgedit/components/center-panel/index.vue index b432274..4ece794 100644 --- a/src/components/webtopo-svgedit/components/center-panel/index.vue +++ b/src/components/webtopo-svgedit/components/center-panel/index.vue @@ -571,7 +571,7 @@ globalStore.mouse_info.new_position_y; // globalStore.setDoneJson(globalStore.done_json); setSvgActualInfo(globalStore.done_json[globalStore.handle_svg_info.index]); - globalStore.intention = EGlobalStoreIntention.Select; + globalStore.intention = EGlobalStoreIntention.None; //记录历史记录 globalStore.setDoneJson(globalStore.done_json); // globalStore.setHandleSvgInfo(undefined, 0); diff --git a/src/components/webtopo-svgedit/components/component-tree/index.vue b/src/components/webtopo-svgedit/components/component-tree/index.vue new file mode 100644 index 0000000..deaa78e --- /dev/null +++ b/src/components/webtopo-svgedit/components/component-tree/index.vue @@ -0,0 +1,35 @@ + + + diff --git a/src/components/webtopo-svgedit/components/connection-line/index.vue b/src/components/webtopo-svgedit/components/connection-line/index.vue index d93b775..40c4997 100644 --- a/src/components/webtopo-svgedit/components/connection-line/index.vue +++ b/src/components/webtopo-svgedit/components/connection-line/index.vue @@ -10,11 +10,13 @@ ? props.itemInfo.animations.color.val : props.itemInfo.props.stroke.val " - stroke-width="2" + :stroke-width="props.itemInfo.props['stroke-width'].val" style="cursor: move" stroke-dashoffset="0" :stroke-dasharray=" - props.itemInfo.animations?.type.val === EConfigAnimationsType.Electricity ? 6 : 0 + props.itemInfo.animations?.type.val === EConfigAnimationsType.Electricity + ? props.itemInfo.props['stroke-width'].val * 3 + : 0 " > @@ -52,7 +54,7 @@ v-else-if="props.itemInfo.animations?.type.val === EConfigAnimationsType.Track" cx="0" cy="0" - r="5" + :r="props.itemInfo.props['stroke-width'].val * 2" :fill="props.itemInfo.animations.color.val" > - +