From d1ca71ca3cba7849a8f11e819044bf4bc32c9011 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Wed, 14 May 2025 22:11:28 +0800 Subject: [PATCH] feat: dashboard init --- frontend/package.json | 3 +- .../src/views/dashboard/PreviewDashboard.vue | 53 ++ .../views/dashboard/canvas/DsCanvasCore.vue | 898 ++++++++++++++++++ frontend/src/views/dashboard/css/DeDrag.less | 110 +++ 4 files changed, 1063 insertions(+), 1 deletion(-) create mode 100644 frontend/src/views/dashboard/PreviewDashboard.vue create mode 100644 frontend/src/views/dashboard/canvas/DsCanvasCore.vue create mode 100644 frontend/src/views/dashboard/css/DeDrag.less diff --git a/frontend/package.json b/frontend/package.json index d167c93b..ad54c7df 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -9,6 +9,7 @@ "preview": "vite preview" }, "dependencies": { + "lodash": "^4.17.21", "vue": "^3.5.13", "vue-router": "^4.5.0", "web-storage-cache": "^1.1.1" @@ -16,11 +17,11 @@ "devDependencies": { "@element-plus/icons-vue": "^2.3.1", "@types/crypto-js": "^4.2.2", - "crypto-js": "^4.2.0", "@types/node": "^22.14.1", "@vitejs/plugin-vue": "^5.2.2", "@vue/tsconfig": "^0.7.0", "axios": "^1.8.4", + "crypto-js": "^4.2.0", "element-plus": "^2.9.7", "less": "^4.3.0", "pinia": "^3.0.2", diff --git a/frontend/src/views/dashboard/PreviewDashboard.vue b/frontend/src/views/dashboard/PreviewDashboard.vue new file mode 100644 index 00000000..70afb45f --- /dev/null +++ b/frontend/src/views/dashboard/PreviewDashboard.vue @@ -0,0 +1,53 @@ + + + + + diff --git a/frontend/src/views/dashboard/canvas/DsCanvasCore.vue b/frontend/src/views/dashboard/canvas/DsCanvasCore.vue new file mode 100644 index 00000000..5862fb11 --- /dev/null +++ b/frontend/src/views/dashboard/canvas/DsCanvasCore.vue @@ -0,0 +1,898 @@ + + + + + diff --git a/frontend/src/views/dashboard/css/DeDrag.less b/frontend/src/views/dashboard/css/DeDrag.less new file mode 100644 index 00000000..08c48f67 --- /dev/null +++ b/frontend/src/views/dashboard/css/DeDrag.less @@ -0,0 +1,110 @@ +.dragAndResize +{ + position: relative; + + user-select: none; + + * + { + box-sizing: border-box; + margin: 0; + padding: 0; + } + + .item + { + position: absolute; + + width: 100px; + height: 100px; + + cursor: move; + + border: 1px solid; + background-color: #fff; + + .resizeHandle + { + position: absolute; + right: 2px; + bottom: 2px; + + width: 0; + height: 0; + + cursor: nw-resize; + + opacity: .5; + border-bottom: 10px solid black; + border-left: 10px solid transparent; + } + } + + .moveAnimation + { + transition: top 80ms ease; + } + + .canNotDrag + { + cursor: default!important; + } + + .cloneNode + { + z-index: 3; + + transition: none; + + opacity: .5; + } + + .movingItem + { + position: absolute; + + border: none; + &:before + { + position: absolute; + z-index: 2; + top: 0; + left: 0; + + width: 100%; + height: 100%; + + content: ''; + + background-color: #bbb; + } + } + + .positionBox + { + position: fixed; + top: 0; + right: 100px; + + overflow: auto; + + width: 500px; + height: 500px; + + border: 1px solid; + } + + .coords + { + position: fixed; + right: 100px; + bottom: 200px; + + overflow: auto; + + width: 200px; + height: 200px; + + border: 1px solid; + } +}