From 26047142eaea394ed62b8dc40eca7c133b4c317e Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Fri, 24 Dec 2021 18:43:29 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=BF=87=E6=BB=A4=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../canvas/components/Editor/PreviewEject.vue | 5 +- .../components/canvas/components/Toolbar.vue | 7 +- .../canvas/mobile/PreviewMobile.vue | 93 ------------------- frontend/src/components/canvas/utils/utils.js | 3 +- 4 files changed, 12 insertions(+), 96 deletions(-) delete mode 100644 frontend/src/components/canvas/mobile/PreviewMobile.vue diff --git a/frontend/src/components/canvas/components/Editor/PreviewEject.vue b/frontend/src/components/canvas/components/Editor/PreviewEject.vue index 493c6efbe0..c742272618 100644 --- a/frontend/src/components/canvas/components/Editor/PreviewEject.vue +++ b/frontend/src/components/canvas/components/Editor/PreviewEject.vue @@ -9,6 +9,7 @@ import { uuid } from 'vue-uuid' import { findOne } from '@/api/panel/panel' import { getPanelAllLinkageInfo } from '@/api/panel/linkage' import { queryPanelJumpInfo, queryTargetPanelJumpInfo } from '@/api/panel/linkJump' +import { panelInit } from '@/components/canvas/utils/utils' export default { components: { Preview }, @@ -43,8 +44,10 @@ export default { } // 加载视图数据 findOne(this.panelId).then(response => { + const componentDatas = JSON.parse(response.data.panelData) + panelInit(componentDatas) this.dataLoading = false - this.$store.commit('setComponentData', this.resetID(JSON.parse(response.data.panelData))) + this.$store.commit('setComponentData', this.resetID(componentDatas)) this.$store.commit('setCanvasStyle', JSON.parse(response.data.panelStyle)) const data = { id: response.data.id, diff --git a/frontend/src/components/canvas/components/Toolbar.vue b/frontend/src/components/canvas/components/Toolbar.vue index 1bbdc16046..28e4fb0cd7 100644 --- a/frontend/src/components/canvas/components/Toolbar.vue +++ b/frontend/src/components/canvas/components/Toolbar.vue @@ -75,7 +75,6 @@ import { deepCopy, mobile2MainCanvas } from '@/components/canvas/utils/utils' import { panelSave } from '@/api/panel/panel' import { saveLinkage, getPanelAllLinkageInfo } from '@/api/panel/linkage' import bus from '@/utils/bus' - import { DEFAULT_COMMON_CANVAS_STYLE_STRING } from '@/views/panel/panel' @@ -266,6 +265,12 @@ export default { panelStyle: JSON.stringify(this.canvasStyleData), panelData: JSON.stringify(this.componentData) } + const components = deepCopy(this.componentData) + components.forEach(view => { + if (view.filters && view.filters.length > 0) { view.filters = [] } + }) + // 无需保存条件 + requestInfo.panelData = JSON.stringify(components) panelSave(requestInfo).then(response => { this.$store.commit('refreshSaveStatus') this.$message({ diff --git a/frontend/src/components/canvas/mobile/PreviewMobile.vue b/frontend/src/components/canvas/mobile/PreviewMobile.vue deleted file mode 100644 index 04805e2d47..0000000000 --- a/frontend/src/components/canvas/mobile/PreviewMobile.vue +++ /dev/null @@ -1,93 +0,0 @@ - - - - - diff --git a/frontend/src/components/canvas/utils/utils.js b/frontend/src/components/canvas/utils/utils.js index 6b39797de7..b93f77ba55 100644 --- a/frontend/src/components/canvas/utils/utils.js +++ b/frontend/src/components/canvas/utils/utils.js @@ -60,7 +60,8 @@ export function mobile2MainCanvas(mainSource, mobileSource) { export function panelInit(componentDatas) { componentDatas.forEach(item => { - item.filters = (item.filters || []) + /* item.filters = (item.filters || []) */ + item.filters = [] item.linkageFilters = (item.linkageFilters || []) item.auxiliaryMatrix = (item.auxiliaryMatrix || false) item.x = (item.x || 1)