From b6fb7e05fa3278ad1fba3cc3a041f71dde52b8ff Mon Sep 17 00:00:00 2001 From: SikongJueluo Date: Fri, 6 Jun 2025 21:05:46 +0800 Subject: [PATCH] refactor: rewrite basic canvas using konva --- package-lock.json | 29 ++ package.json | 1 + src/main.ts | 7 +- src/views/ProjectView.vue | 885 +++------------------------------- src/views/ProjectViewBack.vue | 844 ++++++++++++++++++++++++++++++++ 5 files changed, 944 insertions(+), 822 deletions(-) create mode 100644 src/views/ProjectViewBack.vue diff --git a/package-lock.json b/package-lock.json index f09f5a1..14b3c9c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -22,6 +22,7 @@ "ts-log": "^2.2.7", "ts-results-es": "^5.0.1", "vue": "^3.5.13", + "vue-konva": "^3.2.1", "vue-router": "4", "yocto-queue": "^1.2.1", "zod": "^3.24.2" @@ -4036,6 +4037,34 @@ } } }, + "node_modules/vue-konva": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/vue-konva/-/vue-konva-3.2.1.tgz", + "integrity": "sha512-gLF+VYnlrBfwtaN3NkgzzEqlj9nyCll80VZv2DdvLUM3cisUsdcRJJuMwGTBJOTebcnn6MB22r33IFd2m+m/ig==", + "funding": [ + { + "type": "patreon", + "url": "https://www.patreon.com/lavrton" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/konva" + }, + { + "type": "github", + "url": "https://github.com/sponsors/lavrton" + } + ], + "license": "MIT", + "engines": { + "node": ">= 4.0.0", + "npm": ">= 3.0.0" + }, + "peerDependencies": { + "konva": ">7", + "vue": "^3" + } + }, "node_modules/vue-router": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/vue-router/-/vue-router-4.5.0.tgz", diff --git a/package.json b/package.json index 3ca444d..bd67f66 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ "ts-log": "^2.2.7", "ts-results-es": "^5.0.1", "vue": "^3.5.13", + "vue-konva": "^3.2.1", "vue-router": "4", "yocto-queue": "^1.2.1", "zod": "^3.24.2" diff --git a/src/main.ts b/src/main.ts index ec12a8b..01902de 100644 --- a/src/main.ts +++ b/src/main.ts @@ -2,13 +2,10 @@ import './assets/main.css' import { createApp } from 'vue' import { createPinia } from 'pinia' +import VueKonva from "vue-konva" import App from '@/App.vue' import router from './router' -// import { Client } from './APIClient' -const app = createApp(App).use(router).use(createPinia()).mount('#app') - -// 初始化约束通信 -// initConstraintCommunication(); +const app = createApp(App).use(router).use(createPinia()).use(VueKonva).mount('#app') diff --git a/src/views/ProjectView.vue b/src/views/ProjectView.vue index 88bc8c3..ce94090 100644 --- a/src/views/ProjectView.vue +++ b/src/views/ProjectView.vue @@ -1,844 +1,95 @@ - diff --git a/src/views/ProjectViewBack.vue b/src/views/ProjectViewBack.vue new file mode 100644 index 0000000..88bc8c3 --- /dev/null +++ b/src/views/ProjectViewBack.vue @@ -0,0 +1,844 @@ + + + + +