From 0d4e6809983bd5094f7d3cc25bd0313e4f67f6b1 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Fri, 16 May 2025 16:06:28 +0800 Subject: [PATCH] refactor: dashboard --- frontend/src/router/index.ts | 1 - .../views/dashboard/canvas/CanvasShape.vue | 24 +----- .../views/dashboard/canvas/DsCanvasCore.vue | 85 ++++++++++--------- 3 files changed, 49 insertions(+), 61 deletions(-) diff --git a/frontend/src/router/index.ts b/frontend/src/router/index.ts index 35cfaee5..3c98ed22 100644 --- a/frontend/src/router/index.ts +++ b/frontend/src/router/index.ts @@ -4,7 +4,6 @@ import Layout from '@/components/layout/index.vue' import login from '@/views/login/index.vue' import chat from '@/views/chat/index.vue' import ds from '@/views/ds/index.vue' -import dashboard from '@/views/dashboard/index.vue' import DashboardEditor from '@/views/dashboard/DashboardEditor.vue' import setting from '@/views/setting/index.vue' import { watchRouter } from './watch' diff --git a/frontend/src/views/dashboard/canvas/CanvasShape.vue b/frontend/src/views/dashboard/canvas/CanvasShape.vue index 9ae68ac2..034e7b06 100644 --- a/frontend/src/views/dashboard/canvas/CanvasShape.vue +++ b/frontend/src/views/dashboard/canvas/CanvasShape.vue @@ -20,22 +20,6 @@ const props = defineProps({ type: Boolean, required: true }, - baseWidth: { - type: Number, - default: 100 - }, - baseHeight: { - type: Number, - default: 50 - }, - baseMarginLeft: { - type: Number, - default: 20 - }, - baseMarginTop: { - type: Number, - default: 20 - }, startMove: { type: Function, default: () => { @@ -51,11 +35,7 @@ const props = defineProps({ }) const { - baseWidth, - baseHeight, - baseMarginLeft, - baseMarginTop, - draggable, + draggable } = toRefs(props) const cursors = { @@ -116,7 +96,7 @@ const pointList = ['lt', 't', 'rt', 'r', 'rb', 'b', 'lb', 'l'] canNotDrag: !draggable }" @mousedown="startMove($event, configItem, itemIndex)" ref="shapeRef"> -
diff --git a/frontend/src/views/dashboard/canvas/DsCanvasCore.vue b/frontend/src/views/dashboard/canvas/DsCanvasCore.vue index 3e7c16fd..1ea3cebd 100644 --- a/frontend/src/views/dashboard/canvas/DsCanvasCore.vue +++ b/frontend/src/views/dashboard/canvas/DsCanvasCore.vue @@ -1,9 +1,10 @@