From 915ccf326e4ec1ba69c5fc399025c49a63308c64 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Tue, 16 Mar 2021 11:38:20 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E5=A2=9E=E5=8A=A0=E4=BB=AA=E8=A1=A8?= =?UTF-8?q?=E7=9B=98=E8=AE=BE=E8=AE=A1=E7=BB=84=E4=BB=B6=E5=8F=8A=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../vue-drag-resize-rotate/index.vue | 23 +- frontend/src/main.js | 3 + frontend/src/styles/vdrr/common-temp.scss | 8 + .../src/views/panel/list/PanelPreview.vue | 393 ++++++++++++++ .../src/views/panel/list/PanelViewShow.vue | 478 ++++++++++-------- 5 files changed, 697 insertions(+), 208 deletions(-) create mode 100644 frontend/src/styles/vdrr/common-temp.scss create mode 100644 frontend/src/views/panel/list/PanelPreview.vue diff --git a/frontend/src/components/vue-drag-resize-rotate/index.vue b/frontend/src/components/vue-drag-resize-rotate/index.vue index 032c17fee9..5146a30394 100644 --- a/frontend/src/components/vue-drag-resize-rotate/index.vue +++ b/frontend/src/components/vue-drag-resize-rotate/index.vue @@ -26,6 +26,7 @@ > + @@ -68,6 +69,10 @@ export default { replace: true, name: 'vue-drag-resize-rotate', props: { + viewId: { + type: String, + default: '' + }, className: { type: String, default: 'vdr' @@ -141,7 +146,7 @@ export default { type: Boolean, default: false }, - // 新增 外部传入纵横比 w/h + // 新增 外部传入纵横比 w/h outsideAspectRatio: { type: [Number, String], default: 0 @@ -394,6 +399,11 @@ export default { }, methods: { + removeView(){ + debugger + console.log(this.viewId); + this.$emit('removeView',this.viewId) + }, // 重置边界和鼠标状态 resetBoundsAndMouseState() { this.mouseClickPosition = { mouseX: 0, mouseY: 0, x: 0, y: 0, w: 0, h: 0 } @@ -1310,13 +1320,15 @@ export default { } }, style() { - return { + let newStyle ={ transform: `translate(${this.left}px, ${this.top}px) rotate(${this.rotate}deg)`, width: this.computedWidth, height: this.computedHeight, zIndex: this.zIndex, ...(this.dragging && this.disableUserSelect ? userSelectNone : userSelectAuto) }; + this.$emit('newStyle', this.viewId,newStyle); + return newStyle; }, // 控制柄显示与否 actualHandles() { @@ -1503,4 +1515,11 @@ export default { height: 7px; background-color: #666; } + +.close { + float: right; + padding-top: 8px; + padding-bottom: 8px; +} + diff --git a/frontend/src/main.js b/frontend/src/main.js index b5ddc1e834..793d8b5cfc 100644 --- a/frontend/src/main.js +++ b/frontend/src/main.js @@ -19,6 +19,9 @@ import message from '@/metersphere/common/js/message' import { left2RightDrag, bottom2TopDrag, right2LeftDrag } from '@/metersphere/common/js/directive' import directives from './directive' +import './styles/vdrr/common-temp.scss' + + import vdrr from './components/vue-drag-resize-rotate' Vue.component('vdrr', vdrr) diff --git a/frontend/src/styles/vdrr/common-temp.scss b/frontend/src/styles/vdrr/common-temp.scss new file mode 100644 index 0000000000..73a6ed7e0e --- /dev/null +++ b/frontend/src/styles/vdrr/common-temp.scss @@ -0,0 +1,8 @@ + +.vdr { + border: 1px dashed; +} + +.vdrr { + border: 1px dashed; +} diff --git a/frontend/src/views/panel/list/PanelPreview.vue b/frontend/src/views/panel/list/PanelPreview.vue new file mode 100644 index 0000000000..dee4a6d5f2 --- /dev/null +++ b/frontend/src/views/panel/list/PanelPreview.vue @@ -0,0 +1,393 @@ + + + 仪表盘名称:{{panelName}} + + + + + + diff --git a/frontend/src/views/panel/list/PanelViewShow.vue b/frontend/src/views/panel/list/PanelViewShow.vue index 23e0c02f5a..7c4745b1a1 100644 --- a/frontend/src/views/panel/list/PanelViewShow.vue +++ b/frontend/src/views/panel/list/PanelViewShow.vue @@ -5,7 +5,7 @@ - 视图 + 视图 - + + {{item.name}} + + - 组件 + 组件 开发中... - - + + 背景图 - 透视 + 预览 - + - - + + + + + + + + + + + + + + + + + + + + + @@ -52,217 +74,251 @@