From ca51c15eda9627da7e48e9da478afc600dc3b227 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Thu, 2 Nov 2023 13:20:47 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E4=BB=AA=E8=A1=A8=E6=9D=BF):=20=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E7=BB=84=E4=BB=B6=E5=86=85=E9=83=A8=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E6=98=AF=E5=90=A6=E8=87=AA=E9=80=82=E5=BA=94=E4=BB=AA=E8=A1=A8?= =?UTF-8?q?=E6=9D=BF=E7=BC=A9=E6=94=BE=E5=8A=9F=E8=83=BD=20#5793?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/canvas/components/Toolbar.vue | 45 ++++++----- .../canvas/components/editor/DeEditor.vue | 77 ++++++++++--------- .../canvas/components/editor/Preview.vue | 4 +- .../src/components/canvas/utils/utils.js | 1 + .../src/icons/svg/icon_auto-adaptor.svg | 1 + core/frontend/src/lang/en.js | 1 + core/frontend/src/lang/tw.js | 1 + core/frontend/src/lang/zh.js | 1 + core/frontend/src/views/panel/panel.js | 1 + 9 files changed, 73 insertions(+), 59 deletions(-) create mode 100644 core/frontend/src/icons/svg/icon_auto-adaptor.svg diff --git a/core/frontend/src/components/canvas/components/Toolbar.vue b/core/frontend/src/components/canvas/components/Toolbar.vue index 47147343d3..e69d49d100 100644 --- a/core/frontend/src/components/canvas/components/Toolbar.vue +++ b/core/frontend/src/components/canvas/components/Toolbar.vue @@ -7,10 +7,10 @@ @change="openMobileLayout" > - + - + @@ -99,7 +99,7 @@ - + {{ $t('panel.new_element_distribution') }} - + {{ $t('panel.params_setting') }} - + {{ $t('panel.clean_canvas') }} - + {{ $t('panel.watermark') }} {{ batchOptStatus?$t('panel.cancel_batch_opt'):$t('panel.batch_opt') }} + >{{ batchOptStatus ? $t('panel.cancel_batch_opt') : $t('panel.batch_opt') }} {{ - $t('panel.panel_save_warn_tips') - }} + $t('panel.panel_save_warn_tips') + }}
import generateID from '@/components/canvas/utils/generateID' import toast from '@/components/canvas/utils/toast' -import { mapState } from 'vuex' -import { commonAttr, commonStyle } from '@/components/canvas/customComponent/component-list' +import {mapState} from 'vuex' +import {commonAttr, commonStyle} from '@/components/canvas/customComponent/component-list' import eventBus from '@/components/canvas/utils/eventBus' -import { deepCopy, mobile2MainCanvas } from '@/components/canvas/utils/utils' -import { panelUpdate, removePanelCache, saveCache } from '@/api/panel/panel' -import { getPanelAllLinkageInfo, saveLinkage } from '@/api/panel/linkage' +import {deepCopy, mobile2MainCanvas} from '@/components/canvas/utils/utils' +import {panelUpdate, removePanelCache, saveCache} from '@/api/panel/panel' +import {getPanelAllLinkageInfo, saveLinkage} from '@/api/panel/linkage' import bus from '@/utils/bus' -import { queryPanelJumpInfo } from '@/api/panel/linkJump' -import { inOtherPlatform } from '@/utils/index' +import {queryPanelJumpInfo} from '@/api/panel/linkJump' +import {inOtherPlatform} from '@/utils/index' + export default { name: 'Toolbar', props: { @@ -274,6 +275,7 @@ export default { return { showPageLine: false, showGridSwitch: false, + autoSizeAdaptorSwitch: true, mobileLayoutInitStatus: false, isShowPreview: false, needToChange: [ @@ -333,6 +335,7 @@ export default { this.scale = this.canvasStyleData.scale this.mobileLayoutInitStatus = this.mobileLayoutStatus this.showGridSwitch = this.canvasStyleData.aidedDesign.showGrid + this.autoSizeAdaptorSwitch = this.canvasStyleData.autoSizeAdaptor || true this.showPageLine = this.canvasStyleData.pdfPageLine?.showPageLine this.autoCache() }, @@ -362,7 +365,7 @@ export default { this.$emit('close-left-panel') removePanelCache(this.panelInfo.id) this.$nextTick(() => { - bus.$emit('PanelSwitchComponent', { name: 'PanelMain' }) + bus.$emit('PanelSwitchComponent', {name: 'PanelMain'}) }) }, closePanelEdit() { @@ -545,7 +548,7 @@ export default { this.$store.commit('setComponentData', []) this.$store.commit('recordSnapshot', 'clearCanvas') bus.$emit('change_panel_right_draw', false) - this.$store.commit('setCurComponent', { component: null, index: null }) + this.$store.commit('setCurComponent', {component: null, index: null}) }, handlePreviewChange() { @@ -572,7 +575,7 @@ export default { const linkageInfo = this.targetLinkageInfo[key] const linkageFields = linkageInfo['linkageFields'] if (linkageFields) { - linkageFields.forEach(function(linkage) { + linkageFields.forEach(function (linkage) { if (!(linkage.sourceField && linkage.targetField)) { subCheckCount++ } @@ -623,6 +626,10 @@ export default { this.$store.commit('canvasChange') this.canvasStyleData.aidedDesign.showGrid = !this.canvasStyleData.aidedDesign.showGrid }, + showSizeAdaptorSwitchChange() { + this.$store.commit('canvasChange') + this.canvasStyleData.autoSizeAdaptor = !this.canvasStyleData.autoSizeAdaptor + }, showPageLineChange() { this.$store.commit('canvasChange') this.canvasStyleData.pdfPageLine.showPageLine = !this.canvasStyleData.pdfPageLine.showPageLine diff --git a/core/frontend/src/components/canvas/components/editor/DeEditor.vue b/core/frontend/src/components/canvas/components/editor/DeEditor.vue index 2407a73cb2..be9c815dd5 100644 --- a/core/frontend/src/components/canvas/components/editor/DeEditor.vue +++ b/core/frontend/src/components/canvas/components/editor/DeEditor.vue @@ -150,13 +150,13 @@