From 03e81d2205e1482540c299a5e411b3a95dfb4ee8 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Mon, 25 Jul 2022 11:57:49 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E4=BB=AA=E8=A1=A8=E6=9D=BF):=20?= =?UTF-8?q?=E4=BB=AA=E8=A1=A8=E6=9D=BF=E7=9A=84=E5=A4=8D=E7=94=A8=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E5=A4=8D=E7=94=A8=E6=89=80=E6=9C=89=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/Editor/ComponentWrapper.vue | 4 +-- .../canvas/components/Editor/EditBar.vue | 27 ++++++++++++++++--- .../canvas/custom-component/UserView.vue | 2 +- frontend/src/components/canvas/store/copy.js | 4 +-- .../src/components/widget/DeWidget/DeTabs.vue | 6 +++++ frontend/src/layout/components/Topbar.vue | 2 +- frontend/src/permission.js | 3 ++- 7 files changed, 37 insertions(+), 11 deletions(-) diff --git a/frontend/src/components/canvas/components/Editor/ComponentWrapper.vue b/frontend/src/components/canvas/components/Editor/ComponentWrapper.vue index 0c1bd92118..fdd949c3bc 100644 --- a/frontend/src/components/canvas/components/Editor/ComponentWrapper.vue +++ b/frontend/src/components/canvas/components/Editor/ComponentWrapper.vue @@ -5,7 +5,7 @@ @click="handleClick" @mousedown="elementMouseDown" > - +
+
+ +
@@ -73,10 +76,16 @@ export default { previewVisible: { type: Boolean, default: false + }, + showPosition: { + type: String, + required: false, + default: 'NotProvided' } }, data() { return { + multiplexingCheckModel: false, barWidth: 24, componentType: null, linkageActiveStatus: false, @@ -106,7 +115,6 @@ export default { return 'bar-main-preview' } }, - showJumpFlag() { return this.curComponent && this.curComponent.hyperlinks && this.curComponent.hyperlinks.enable }, @@ -120,7 +128,7 @@ export default { }, // 编辑或预览区域显示 normalAreaShow() { - return !this.linkageSettingStatus && !this.batchOptStatus + return !this.linkageSettingStatus && !this.batchOptStatus && !this.positionCheck('multiplexing') }, existLinkage() { let linkageFiltersCount = 0 @@ -166,6 +174,18 @@ export default { beforeDestroy() { }, methods: { + positionCheck(position) { + return this.showPosition.includes(position) + }, + multiplexingCheck(val) { + if (val) { + // push + this.$store.commit('addCurMultiplexingComponent', { 'component': this.element, 'componentId': this.element.id }) + } else { + // remove + this.$store.commit('removeCurMultiplexingComponentWithId', this.element.id ) + } + }, closePreview() { this.$emit('closePreview') }, @@ -217,8 +237,7 @@ export default { edit() { if (this.curComponent.type === 'custom') { bus.$emit('component-dialog-edit', 'update') - } - else if (this.curComponent.type === 'custom-button') { + } else if (this.curComponent.type === 'custom-button') { bus.$emit('button-dialog-edit') } else if (this.curComponent.type === 'v-text' || this.curComponent.type === 'de-rich-text' || this.curComponent.type === 'rect-shape') { bus.$emit('component-dialog-style') diff --git a/frontend/src/components/canvas/custom-component/UserView.vue b/frontend/src/components/canvas/custom-component/UserView.vue index 498a06a4cd..56b45d5e42 100644 --- a/frontend/src/components/canvas/custom-component/UserView.vue +++ b/frontend/src/components/canvas/custom-component/UserView.vue @@ -236,7 +236,7 @@ export default { } }, editBarViewShowFlag() { - return (this.active && this.inTab && !this.mobileLayoutStatus) || this.showPosition.includes('multiplexing') || this.showPosition.includes('email-task') + return (this.active && this.inTab && !this.mobileLayoutStatus) && !this.showPosition.includes('multiplexing') || this.showPosition.includes('email-task') }, charViewShowFlag() { return this.httpRequest.status && this.chart.type && !this.chart.type.includes('table') && !this.chart.type.includes('text') && this.chart.type !== 'label' && this.renderComponent() === 'echarts' diff --git a/frontend/src/components/canvas/store/copy.js b/frontend/src/components/canvas/store/copy.js index 0771f09a48..1c5ded3c56 100644 --- a/frontend/src/components/canvas/store/copy.js +++ b/frontend/src/components/canvas/store/copy.js @@ -35,10 +35,10 @@ export default { const canvasStyleData = state.canvasStyleData const curCanvasScale = state.curCanvasScale const componentGap = state.componentGap - Object.keys(state.curMultiplexingComponents).forEach(function(viewId, index) { + Object.keys(state.curMultiplexingComponents).forEach(function(componentId, index) { const component = { - ...deepCopy(state.curMultiplexingComponents[viewId]), + ...deepCopy(state.curMultiplexingComponents[componentId]), ...deepCopy(deepCopy(state.viewBase)), 'auxiliaryMatrix': canvasStyleData.auxiliaryMatrix } diff --git a/frontend/src/components/widget/DeWidget/DeTabs.vue b/frontend/src/components/widget/DeWidget/DeTabs.vue index a250968fff..97ed4dcb29 100644 --- a/frontend/src/components/widget/DeWidget/DeTabs.vue +++ b/frontend/src/components/widget/DeWidget/DeTabs.vue @@ -80,6 +80,7 @@ :filters="filterMap[item.content.propValue && item.content.propValue.viewId] || []" :out-style="outStyle" :canvas-style-data="canvasStyleData" + :show-position="showPosition" /> @@ -193,6 +194,11 @@ export default { h: { type: Number, default: 200 + }, + showPosition: { + type: String, + required: false, + default: 'NotProvided' } }, data() { diff --git a/frontend/src/layout/components/Topbar.vue b/frontend/src/layout/components/Topbar.vue index 9459ee439d..5786652d3d 100644 --- a/frontend/src/layout/components/Topbar.vue +++ b/frontend/src/layout/components/Topbar.vue @@ -329,7 +329,7 @@ export default { if (result !== 'success' && result !== 'fail') { window.location.href = result } else { - this.$router.push(`/login?redirect=${this.$route.fullPath}`) + this.$router.push('/login') } }, loadUiInfo() { diff --git a/frontend/src/permission.js b/frontend/src/permission.js index e06dc31f53..a2898d8ab1 100644 --- a/frontend/src/permission.js +++ b/frontend/src/permission.js @@ -92,7 +92,8 @@ router.beforeEach(async(to, from, next) => { next() } else { // other pages that do not have permission to access are redirected to the login page. - next(`/login?redirect=${to.path}`) + // next(`/login?redirect=${to.path}`) + next('/login') NProgress.done() } }