From 8926ecbebc305bf075f1edaeb7c63a63cc9e6ede Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Fri, 25 Jun 2021 14:28:27 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=96=B0=E5=BB=BA=E4=BB=AA=E8=A1=A8?= =?UTF-8?q?=E6=9D=BF=E6=97=B6=EF=BC=8C=E6=9D=A5=E5=9B=9E=E5=88=87=E6=8D=A2?= =?UTF-8?q?=E6=96=B0=E5=BB=BA=E4=BB=AA=E8=A1=A8=E6=9D=BF=E5=92=8C=E5=A4=8D?= =?UTF-8?q?=E7=94=A8=E4=BB=AA=E8=A1=A8=E6=9D=BF=E5=86=8D=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/panel/list/EditPanel/index.vue | 22 +++++++++++++------ frontend/src/views/panel/list/PanelList.vue | 2 +- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/frontend/src/views/panel/list/EditPanel/index.vue b/frontend/src/views/panel/list/EditPanel/index.vue index 2f29295c0b..249d869ced 100644 --- a/frontend/src/views/panel/list/EditPanel/index.vue +++ b/frontend/src/views/panel/list/EditPanel/index.vue @@ -35,11 +35,12 @@ import { panelSave } from '@/api/panel/panel' import { showTemplateList } from '@/api/system/template' import TemplateAllList from './TemplateAllList' +import { deepCopy } from '@/components/canvas/utils/utils' export default { components: { TemplateAllList }, props: { - editPanel: { + editPanelOut: { type: Object, required: true } @@ -55,7 +56,8 @@ export default { templateList: [], importTemplateInfo: { snapshot: '' - } + }, + editPanel: null } }, computed: { @@ -70,14 +72,20 @@ export default { } }, watch: { - inputType() { - this.editPanel.panelInfo.name = null - this.editPanel.panelInfo.panelStyle = null - this.editPanel.panelInfo.panelData = null - this.importTemplateInfo.snapshot = null + inputType(newVal) { + debugger + if (newVal === 'self') { + this.editPanel = deepCopy(this.editPanelOut) + } else { + this.editPanel.panelInfo.name = null + this.editPanel.panelInfo.panelStyle = null + this.editPanel.panelInfo.panelData = null + this.importTemplateInfo.snapshot = null + } } }, created() { + this.editPanel = deepCopy(this.editPanelOut) // this.getTree() }, mounted() { diff --git a/frontend/src/views/panel/list/PanelList.vue b/frontend/src/views/panel/list/PanelList.vue index 540b707bc3..30d5b9ddee 100644 --- a/frontend/src/views/panel/list/PanelList.vue +++ b/frontend/src/views/panel/list/PanelList.vue @@ -164,7 +164,7 @@ - +