From f12aeb4bddd4d04ef40608a7ccece2f1285c06cc Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Mon, 20 Dec 2021 17:19:28 +0800 Subject: [PATCH 01/15] =?UTF-8?q?fix:=20chrome-driver=E6=88=AA=E5=9B=BE?= =?UTF-8?q?=E5=88=86=E8=BE=A8=E7=8E=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../strategy/impl/EmailTaskHandler.java | 26 +++++++++---------- .../plugins/server/XEmailTaskServer.java | 17 +++++++----- 2 files changed, 22 insertions(+), 21 deletions(-) diff --git a/backend/src/main/java/io/dataease/job/sechedule/strategy/impl/EmailTaskHandler.java b/backend/src/main/java/io/dataease/job/sechedule/strategy/impl/EmailTaskHandler.java index 775d4da38b..83172c2235 100644 --- a/backend/src/main/java/io/dataease/job/sechedule/strategy/impl/EmailTaskHandler.java +++ b/backend/src/main/java/io/dataease/job/sechedule/strategy/impl/EmailTaskHandler.java @@ -1,6 +1,5 @@ package io.dataease.job.sechedule.strategy.impl; - import io.dataease.auth.entity.SysUserEntity; import io.dataease.auth.entity.TokenInfo; import io.dataease.auth.service.AuthUserService; @@ -26,11 +25,9 @@ import org.springframework.stereotype.Service; import javax.annotation.Resource; - @Service public class EmailTaskHandler extends TaskHandler implements Job { - private static final Integer RUNING = 0; private static final Integer SUCCESS = 1; private static final Integer ERROR = -1; @@ -38,7 +35,6 @@ public class EmailTaskHandler extends TaskHandler implements Job { @Resource private AuthUserServiceImpl authUserServiceImpl; - @Override protected JobDataMap jobDataMap(GlobalTaskEntity taskEntity) { JobDataMap jobDataMap = new JobDataMap(); @@ -54,7 +50,8 @@ public class EmailTaskHandler extends TaskHandler implements Job { @Override public void execute(JobExecutionContext context) throws JobExecutionException { // 插件没有加载 空转 - if (!CommonBeanFactory.getBean(AuthUserService.class).pluginLoaded()) return; + if (!CommonBeanFactory.getBean(AuthUserService.class).pluginLoaded()) + return; JobDataMap jobDataMap = context.getJobDetail().getJobDataMap(); GlobalTaskEntity taskEntity = (GlobalTaskEntity) jobDataMap.get("taskEntity"); @@ -74,7 +71,6 @@ public class EmailTaskHandler extends TaskHandler implements Job { } - public EmailTaskHandler proxy() { return CommonBeanFactory.getBean(EmailTaskHandler.class); } @@ -106,12 +102,13 @@ public class EmailTaskHandler extends TaskHandler implements Job { emailXpackService.saveInstance(taskInstance); } - @Async - public void sendReport(GlobalTaskInstance taskInstance, XpackEmailTemplateDTO emailTemplateDTO, SysUserEntity user) { + public void sendReport(GlobalTaskInstance taskInstance, XpackEmailTemplateDTO emailTemplateDTO, + SysUserEntity user) { EmailXpackService emailXpackService = SpringContextUtil.getBean(EmailXpackService.class); try { - byte[] bytes = emailXpackService.printData(panelUrl(emailTemplateDTO.getPanelId()), tokenByUser(user), buildPixel(emailTemplateDTO)); + byte[] bytes = emailXpackService.printData(panelUrl(emailTemplateDTO.getPanelId()), tokenByUser(user), + buildPixel(emailTemplateDTO)); // 下面继续执行发送邮件的 String recipients = emailTemplateDTO.getRecipients(); byte[] content = emailTemplateDTO.getContent(); @@ -131,12 +128,14 @@ public class EmailTaskHandler extends TaskHandler implements Job { private XpackPixelEntity buildPixel(XpackEmailTemplateDTO emailTemplateDTO) { XpackPixelEntity pixelEntity = new XpackPixelEntity(); String pixelStr = emailTemplateDTO.getPixel(); - if (StringUtils.isBlank(pixelStr)) return null; + if (StringUtils.isBlank(pixelStr)) + return null; String[] arr = pixelStr.split("\\*"); - if (arr.length != 2) return null; + if (arr.length != 2) + return null; try { - int x = Integer.parseInt(arr[0]); - int y = Integer.parseInt(arr[1]); + int x = Integer.parseInt(arr[0].trim()); + int y = Integer.parseInt(arr[1].trim()); pixelEntity.setX(String.valueOf(x)); pixelEntity.setY(String.valueOf(y)); return pixelEntity; @@ -145,7 +144,6 @@ public class EmailTaskHandler extends TaskHandler implements Job { } } - private String tokenByUser(SysUserEntity user) { TokenInfo tokenInfo = TokenInfo.builder().userId(user.getUserId()).username(user.getUsername()).build(); String token = JWTUtils.sign(tokenInfo, user.getPassword()); diff --git a/backend/src/main/java/io/dataease/plugins/server/XEmailTaskServer.java b/backend/src/main/java/io/dataease/plugins/server/XEmailTaskServer.java index ea5110e449..82462243e4 100644 --- a/backend/src/main/java/io/dataease/plugins/server/XEmailTaskServer.java +++ b/backend/src/main/java/io/dataease/plugins/server/XEmailTaskServer.java @@ -1,6 +1,5 @@ package io.dataease.plugins.server; - import com.github.pagehelper.Page; import com.github.pagehelper.PageHelper; import io.dataease.commons.exception.DEException; @@ -34,7 +33,8 @@ public class XEmailTaskServer { private ScheduleService scheduleService; @PostMapping("/queryTasks/{goPage}/{pageSize}") - public Pager> queryTask(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody XpackGridRequest request) { + public Pager> queryTask(@PathVariable int goPage, @PathVariable int pageSize, + @RequestBody XpackGridRequest request) { EmailXpackService emailXpackService = SpringContextUtil.getBean(EmailXpackService.class); Page page = PageHelper.startPage(goPage, pageSize, true); List tasks = emailXpackService.taskGrid(request); @@ -115,7 +115,8 @@ public class XEmailTaskServer { } @PostMapping("/queryInstancies/{goPage}/{pageSize}") - public Pager> instancesGrid(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody XpackGridRequest request) { + public Pager> instancesGrid(@PathVariable int goPage, @PathVariable int pageSize, + @RequestBody XpackGridRequest request) { EmailXpackService emailXpackService = SpringContextUtil.getBean(EmailXpackService.class); Page page = PageHelper.startPage(goPage, pageSize, true); List instances = emailXpackService.taskInstanceGrid(request); @@ -132,13 +133,15 @@ public class XEmailTaskServer { private XpackPixelEntity buildPixel(String pixel) { - if (StringUtils.isBlank(pixel)) return null; + if (StringUtils.isBlank(pixel)) + return null; String[] arr = pixel.split("\\*"); - if (arr.length != 2) return null; + if (arr.length != 2) + return null; try { XpackPixelEntity result = new XpackPixelEntity(); - int x = Integer.parseInt(arr[0]); - int y = Integer.parseInt(arr[1]); + int x = Integer.parseInt(arr[0].trim()); + int y = Integer.parseInt(arr[1].trim()); result.setX(String.valueOf(x)); result.setY(String.valueOf(y)); return result; From b781e8e83aa4a71ffb0725d5d1811af3c4e666e1 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Mon, 20 Dec 2021 17:34:27 +0800 Subject: [PATCH 02/15] =?UTF-8?q?fix:=20tabs=E7=BB=84=E4=BB=B6=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E5=A4=9A=E4=B8=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../canvas/components/Editor/SettingMenu.vue | 2 +- frontend/src/components/widget/DeWidget/DeTabs.vue | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/frontend/src/components/canvas/components/Editor/SettingMenu.vue b/frontend/src/components/canvas/components/Editor/SettingMenu.vue index 70aea3a8b4..9a9a5b3c20 100644 --- a/frontend/src/components/canvas/components/Editor/SettingMenu.vue +++ b/frontend/src/components/canvas/components/Editor/SettingMenu.vue @@ -142,7 +142,7 @@ export default { }) }, addTab() { - bus.$emit('add-new-tab') + bus.$emit('add-new-tab', this.curComponent.id) }, // 跳转设置 linkJumpSet() { diff --git a/frontend/src/components/widget/DeWidget/DeTabs.vue b/frontend/src/components/widget/DeWidget/DeTabs.vue index 2a5e45ed5a..65a84e3e67 100644 --- a/frontend/src/components/widget/DeWidget/DeTabs.vue +++ b/frontend/src/components/widget/DeWidget/DeTabs.vue @@ -134,10 +134,14 @@ export default { tabList: [] } }, + computed: { + ...mapState([ + 'curComponent' + ]) + }, watch: { curComponent: { handler(newVal, oldVla) { - console.log(newVal) }, deep: true } @@ -147,11 +151,6 @@ export default { this.tabList = this.element.options && this.element.options.tabList this.activeTabName = this.tabList[0].name }, - computed: { - ...mapState([ - 'curComponent' - ]) - }, methods: { beforeHandleCommond(item, param) { return { @@ -244,7 +243,8 @@ export default { this.styleChange() }, - addNewTab() { + addNewTab(componentId) { + if (!componentId || componentId !== this.element.id) return const curName = uuid.v1() const tab = { title: 'NewTab', From 0f8137ec6dad58404aeae8c8aeb2815ffaad3c76 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Mon, 20 Dec 2021 18:20:28 +0800 Subject: [PATCH 03/15] =?UTF-8?q?fix:=20=E8=87=AA=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E6=8E=A7=E5=88=B6=E8=8C=83=E5=9B=B4=E5=A4=B1=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/widget/DeWidget/DeDate.vue | 8 ++++++++ .../src/components/widget/DeWidget/DeInputSearch.vue | 12 +++++++++++- .../src/components/widget/DeWidget/DeNumberRange.vue | 12 ++++++++++-- frontend/src/components/widget/DeWidget/DeSelect.vue | 8 ++++++++ .../src/components/widget/DeWidget/DeSelectGrid.vue | 9 ++++++++- 5 files changed, 45 insertions(+), 4 deletions(-) diff --git a/frontend/src/components/widget/DeWidget/DeDate.vue b/frontend/src/components/widget/DeWidget/DeDate.vue index da8e73aef7..7dc6a011ae 100644 --- a/frontend/src/components/widget/DeWidget/DeDate.vue +++ b/frontend/src/components/widget/DeWidget/DeDate.vue @@ -51,9 +51,17 @@ export default { defaultValueStr() { if (!this.element || !this.element.options || !this.element.options.value) return '' return this.element.options.value.toString() + }, + viewIds() { + if (!this.element || !this.element.options || !this.element.options.attrs.viewIds) return '' + return this.element.options.attrs.viewIds.toString() } }, watch: { + 'viewIds': function(value, old) { + if (typeof value === 'undefined' || value === old) return + this.setCondition() + }, 'defaultValueStr': function(value, old) { if (this.element.serviceName === 'timeDateWidget' && this.element.options.attrs.default.isDynamic) { // 如果设置了动态时间 不做任何操作 diff --git a/frontend/src/components/widget/DeWidget/DeInputSearch.vue b/frontend/src/components/widget/DeWidget/DeInputSearch.vue index f3c010c57e..d35478bd47 100644 --- a/frontend/src/components/widget/DeWidget/DeInputSearch.vue +++ b/frontend/src/components/widget/DeWidget/DeInputSearch.vue @@ -5,10 +5,10 @@ v-model="value" resize="vertical" :placeholder="$t(element.options.attrs.placeholder)" + :size="size" @input="valueChange" @keypress.enter.native="search" @dblclick="setEdit" - :size="size" > @@ -37,7 +37,17 @@ export default { canEdit: false } }, + computed: { + viewIds() { + if (!this.element || !this.element.options || !this.element.options.attrs.viewIds) return '' + return this.element.options.attrs.viewIds.toString() + } + }, watch: { + 'viewIds': function(value, old) { + if (typeof value === 'undefined' || value === old) return + this.setCondition() + }, 'element.options.value': function(value, old) { if (value === old) return this.value = value diff --git a/frontend/src/components/widget/DeWidget/DeNumberRange.vue b/frontend/src/components/widget/DeWidget/DeNumberRange.vue index 53b9818f52..ba54471314 100644 --- a/frontend/src/components/widget/DeWidget/DeNumberRange.vue +++ b/frontend/src/components/widget/DeWidget/DeNumberRange.vue @@ -3,11 +3,11 @@
- + {{ $t('denumberrange.split_placeholder') }} - +
@@ -60,9 +60,17 @@ export default { return JSON.stringify([]) } return JSON.stringify(this.element.options.value) + }, + viewIds() { + if (!this.element || !this.element.options || !this.element.options.attrs.viewIds) return '' + return this.element.options.attrs.viewIds.toString() } }, watch: { + 'viewIds': function(value, old) { + if (typeof value === 'undefined' || value === old) return + this.setCondition() + }, 'defaultvalues': function(value, old) { if (value === old) return const values = this.element.options.value diff --git a/frontend/src/components/widget/DeWidget/DeSelect.vue b/frontend/src/components/widget/DeWidget/DeSelect.vue index 35e42a2a2b..d9bdab45e8 100644 --- a/frontend/src/components/widget/DeWidget/DeSelect.vue +++ b/frontend/src/components/widget/DeWidget/DeSelect.vue @@ -62,10 +62,18 @@ export default { defaultValueStr() { if (!this.element || !this.element.options || !this.element.options.value) return '' return this.element.options.value.toString() + }, + viewIds() { + if (!this.element || !this.element.options || !this.element.options.attrs.viewIds) return '' + return this.element.options.attrs.viewIds.toString() } }, watch: { + 'viewIds': function(value, old) { + if (typeof value === 'undefined' || value === old) return + this.setCondition() + }, 'defaultValueStr': function(value, old) { if (value === old) return this.value = this.fillValueDerfault() diff --git a/frontend/src/components/widget/DeWidget/DeSelectGrid.vue b/frontend/src/components/widget/DeWidget/DeSelectGrid.vue index e23c85d97e..43e51a023b 100644 --- a/frontend/src/components/widget/DeWidget/DeSelectGrid.vue +++ b/frontend/src/components/widget/DeWidget/DeSelectGrid.vue @@ -75,10 +75,17 @@ export default { defaultValueStr() { if (!this.element || !this.element.options || !this.element.options.value) return '' return this.element.options.value.toString() + }, + viewIds() { + if (!this.element || !this.element.options || !this.element.options.attrs.viewIds) return '' + return this.element.options.attrs.viewIds.toString() } }, watch: { - + 'viewIds': function(value, old) { + if (typeof value === 'undefined' || value === old) return + this.setCondition() + }, 'defaultValueStr': function(value, old) { if (value === old) return this.value = this.fillValueDerfault() From 03cb1f0630ce61e09ead8f5876e36a09ca54315f Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Mon, 20 Dec 2021 18:50:20 +0800 Subject: [PATCH 04/15] =?UTF-8?q?refactor:=20=E4=BB=AA=E8=A1=A8=E6=9D=BF?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E9=AB=98=E6=B8=85PDF=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../canvas/components/Editor/Preview.vue | 2 +- .../canvas/components/Editor/index.vue | 2 +- .../canvas/custom-component/UserView.vue | 1 + frontend/src/components/canvas/utils/style.js | 2 - frontend/src/store/index.js | 10 ++-- .../src/views/panel/export/PDFPreExport.vue | 58 +++++++++++++------ .../src/views/panel/list/PanelViewShow.vue | 52 ++++++++++++----- 7 files changed, 88 insertions(+), 39 deletions(-) diff --git a/frontend/src/components/canvas/components/Editor/Preview.vue b/frontend/src/components/canvas/components/Editor/Preview.vue index 535992bc93..97b8daaff5 100644 --- a/frontend/src/components/canvas/components/Editor/Preview.vue +++ b/frontend/src/components/canvas/components/Editor/Preview.vue @@ -229,7 +229,7 @@ export default { const canvasWidth = document.getElementById('canvasInfoMain').offsetWidth this.scaleWidth = (canvasWidth) * 100 / this.canvasStyleData.width // 获取宽度比 this.scaleHeight = canvasHeight * 100 / this.canvasStyleData.height// 获取高度比 - this.$store.commit('setPreviewCanvasScale', (this.scaleWidth / 100), (this.scaleHeight / 100)) + this.$store.commit('setPreviewCanvasScale', { scaleWidth: (this.scaleWidth / 100), scaleHeight: (this.scaleHeight / 100) }) this.handleScaleChange() }, resetID(data) { diff --git a/frontend/src/components/canvas/components/Editor/index.vue b/frontend/src/components/canvas/components/Editor/index.vue index 5693a63d6c..8c67a62a75 100644 --- a/frontend/src/components/canvas/components/Editor/index.vue +++ b/frontend/src/components/canvas/components/Editor/index.vue @@ -1195,7 +1195,7 @@ export default { matrixStyleOriginWidth: this.matrixStyle.originWidth, matrixStyleOriginHeight: this.matrixStyle.originHeight }) - this.$store.commit('setPreviewCanvasScale', this.scalePointWidth, this.scalePointHeight) + this.$store.commit('setPreviewCanvasScale', { scaleWidth: this.scalePointWidth, scaleHeight: this.scalePointHeight }) } }, getShapeStyleIntDeDrag(style, prop) { diff --git a/frontend/src/components/canvas/custom-component/UserView.vue b/frontend/src/components/canvas/custom-component/UserView.vue index 68f59f2b8c..80d9f9353e 100644 --- a/frontend/src/components/canvas/custom-component/UserView.vue +++ b/frontend/src/components/canvas/custom-component/UserView.vue @@ -316,6 +316,7 @@ export default { // 根据仪表板的缩放比例,修改视图内部参数 mergeScale() { const scale = Math.min(this.previewCanvasScale.scalePointWidth, this.previewCanvasScale.scalePointHeight) * this.scaleCoefficient + console.log('scale:' + scale + ';this.previewCanvasScale:' + JSON.stringify(this.previewCanvasScale)) const customAttrChart = JSON.parse(this.sourceCustomAttrStr) const customStyleChart = JSON.parse(this.sourceCustomStyleStr) recursionTransObj(customAttrTrans, customAttrChart, scale, this.scaleCoefficientType) diff --git a/frontend/src/components/canvas/utils/style.js b/frontend/src/components/canvas/utils/style.js index 08835b0b4b..96106289a4 100644 --- a/frontend/src/components/canvas/utils/style.js +++ b/frontend/src/components/canvas/utils/style.js @@ -94,8 +94,6 @@ export const customAttrTrans = { 'barWidth', 'lineWidth', 'lineSymbolSize', - 'pieInnerRadius', - 'pieOuterRadius', 'funnelWidth', // 漏斗图 最大宽度 'tableTitleFontSize', 'tableItemFontSize', diff --git a/frontend/src/store/index.js b/frontend/src/store/index.js index c46c7b479b..17c5ca0f0d 100644 --- a/frontend/src/store/index.js +++ b/frontend/src/store/index.js @@ -140,12 +140,12 @@ const data = { setCurCanvasScale(state, curCanvasScale) { state.curCanvasScale = curCanvasScale }, - setPreviewCanvasScale(state, scaleWidth, scaleHeight) { - if (scaleWidth) { - state.previewCanvasScale.scalePointWidth = scaleWidth + setPreviewCanvasScale(state, scale) { + if (scale.scaleWidth) { + state.previewCanvasScale.scalePointWidth = scale.scaleWidth } - if (scaleHeight) { - state.previewCanvasScale.scalePointHeight = scaleHeight + if (scale.scaleHeight) { + state.previewCanvasScale.scalePointHeight = scale.scaleHeight } }, setShapeStyle({ curComponent, canvasStyleData, curCanvasScale }, { top, left, width, height, rotate }) { diff --git a/frontend/src/views/panel/export/PDFPreExport.vue b/frontend/src/views/panel/export/PDFPreExport.vue index 99f410c3bf..ce37c512e2 100644 --- a/frontend/src/views/panel/export/PDFPreExport.vue +++ b/frontend/src/views/panel/export/PDFPreExport.vue @@ -4,11 +4,11 @@ style="height: 100%;width: 100%;" :element-loading-text="$t('panel.export_loading')" element-loading-spinner="el-icon-loading" - element-loading-background="rgba(0, 0, 0, 0.8)" + element-loading-background="rgba(0, 0, 0, 1)" > -
-
+
+
@@ -26,6 +26,7 @@ import { pdfTemplateReplaceAll } from '@/utils/StringUtils.js' export default { name: 'PDFPreExport', + components: { }, props: { // eslint-disable-next-line vue/require-default-prop panelName: { @@ -43,6 +44,7 @@ export default { }, data() { return { + toExport: false, exportLoading: false, activeName: '', templateContentChange: '', @@ -60,7 +62,26 @@ export default { } }, computed: { - + mainCanvasStyle() { + if (this.toExport) { + return { + width: '4096px' + } + } else { + return { + width: '100%' + } + } + }, + templateHtmlStyle() { + if (this.toExport) { + return { + fontSize: '48px!important' + } + } else { + return {} + } + } }, watch: { templateContent(newVal, oldVla) { @@ -92,19 +113,22 @@ export default { const _this = this _this.exportLoading = true setTimeout(() => { - html2canvas(document.getElementById('exportPdf')).then(function(canvas) { - _this.exportLoading = false - const contentWidth = canvas.width - const contentHeight = canvas.height - const pageData = canvas.toDataURL('image/jpeg', 1.0) - const lp = contentWidth > contentHeight ? 'l' : 'p' - const PDF = new JsPDF(lp, 'pt', [contentWidth, contentHeight]) - PDF.addImage(pageData, 'JPEG', 0, 0, contentWidth, contentHeight) - PDF.save(_this.panelName + '.pdf') - _this.$emit('closePreExport') - } - ) - }, 50) + _this.toExport = true + setTimeout(() => { + html2canvas(document.getElementById('exportPdf')).then(function(canvas) { + _this.exportLoading = false + const contentWidth = canvas.width + const contentHeight = canvas.height + const pageData = canvas.toDataURL('image/jpeg', 1.0) + const lp = contentWidth > contentHeight ? 'l' : 'p' + const PDF = new JsPDF(lp, 'pt', [contentWidth, contentHeight]) + PDF.addImage(pageData, 'JPEG', 0, 0, contentWidth, contentHeight) + PDF.save(_this.panelName + '.pdf') + _this.$emit('closePreExport') + } + ) + }, 1500) + }, 500) } } diff --git a/frontend/src/views/panel/list/PanelViewShow.vue b/frontend/src/views/panel/list/PanelViewShow.vue index 7acb3533e6..9f9672ee49 100644 --- a/frontend/src/views/panel/list/PanelViewShow.vue +++ b/frontend/src/views/panel/list/PanelViewShow.vue @@ -4,7 +4,7 @@ style="height: 100%;width: 100%;" :element-loading-text="$t('panel.data_loading')" element-loading-spinner="el-icon-loading" - element-loading-background="rgba(0, 0, 0, 0.8)" + element-loading-background="rgba(0, 0, 0, 1)" > @@ -73,9 +73,10 @@ -
+ +
- +
@@ -129,6 +130,7 @@ import { starStatus, saveEnshrine, deleteEnshrine } from '@/api/panel/enshrine' import bus from '@/utils/bus' import { queryAll } from '@/api/panel/pdfTemplate' import ShareHead from '@/views/panel/GrantAuth/ShareHead' +import JsPDF from 'jspdf' export default { name: 'PanelViewShow', @@ -154,10 +156,27 @@ export default { pdfExportShow: false, snapshotInfo: '', showType: 0, - dataLoading: false + dataLoading: false, + exporting: false } }, computed: { + imageWrapperStyle() { + if (this.exporting) { + return { + width: '4096px', + height: '2160px' + } + } else { + return { + width: '100%', + height: '100%' + } + } + }, + showMainFlag() { + return this.showMain + }, panelInfo() { return this.$store.state.panel.panelInfo }, @@ -252,17 +271,24 @@ export default { }, downloadAsPDF() { + // this.pdfExportShow = true + // this.dataLoading = true + setTimeout(() => { - html2canvas(document.getElementById('canvasInfoTemp')).then(canvas => { - const snapshot = canvas.toDataURL('image/jpeg', 1) // 是图片质量 - this.dataLoading = false - if (snapshot !== '') { - this.snapshotInfo = snapshot - this.pdfExportShow = true - } - }) - }, 50) + this.exporting = true + setTimeout(() => { + html2canvas(document.getElementById('canvasInfoTemp')).then(canvas => { + const snapshot = canvas.toDataURL('image/jpeg', 1) // 是图片质量 + this.dataLoading = false + this.exporting = false + if (snapshot !== '') { + this.snapshotInfo = snapshot + this.pdfExportShow = true + } + }) + }, 1500) + }, 500) }, refreshTemplateInfo() { this.templateInfo = {} From c44cb8bf02bee1e81dd54477b773e00d0bf186be Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Tue, 21 Dec 2021 10:36:41 +0800 Subject: [PATCH 05/15] =?UTF-8?q?fix:=20=E5=85=BC=E5=AE=B9=E8=80=81?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E8=BF=87=E6=BB=A4=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/widget/DeWidget/DeDate.vue | 6 +++--- frontend/src/components/widget/DeWidget/DeSelect.vue | 4 ++-- frontend/src/components/widget/DeWidget/DeSelectGrid.vue | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/frontend/src/components/widget/DeWidget/DeDate.vue b/frontend/src/components/widget/DeWidget/DeDate.vue index 7dc6a011ae..1f9ca1bfb8 100644 --- a/frontend/src/components/widget/DeWidget/DeDate.vue +++ b/frontend/src/components/widget/DeWidget/DeDate.vue @@ -87,7 +87,7 @@ export default { } }, created() { - if (this.element.serviceName === 'timeDateWidget' && this.element.options.attrs.default.isDynamic) { + if (this.element.serviceName === 'timeDateWidget' && this.element.options.attrs.default && this.element.options.attrs.default.isDynamic) { if (this.element.options.attrs.default) { const widget = ApplicationContext.getService(this.element.serviceName) this.values = widget.dynamicDateFormNow(this.element) @@ -154,10 +154,10 @@ export default { fillValueDerfault() { const defaultV = this.element.options.value === null ? '' : this.element.options.value.toString() if (this.element.options.attrs.type === 'daterange') { - if (defaultV === null || typeof defaultV === 'undefined' || defaultV === '') return [] + if (defaultV === null || typeof defaultV === 'undefined' || defaultV === '' || defaultV === '[object Object]') return [] return defaultV.split(',').map(item => parseFloat(item)) } else { - if (defaultV === null || typeof defaultV === 'undefined' || defaultV === '') return null + if (defaultV === null || typeof defaultV === 'undefined' || defaultV === '' || defaultV === '[object Object]') return null return parseFloat(defaultV.split(',')[0]) } } diff --git a/frontend/src/components/widget/DeWidget/DeSelect.vue b/frontend/src/components/widget/DeWidget/DeSelect.vue index d9bdab45e8..62a8f31835 100644 --- a/frontend/src/components/widget/DeWidget/DeSelect.vue +++ b/frontend/src/components/widget/DeWidget/DeSelect.vue @@ -161,10 +161,10 @@ export default { fillValueDerfault() { const defaultV = this.element.options.value === null ? '' : this.element.options.value.toString() if (this.element.options.attrs.multiple) { - if (defaultV === null || typeof defaultV === 'undefined' || defaultV === '') return [] + if (defaultV === null || typeof defaultV === 'undefined' || defaultV === '' || defaultV === '[object Object]') return [] return defaultV.split(',') } else { - if (defaultV === null || typeof defaultV === 'undefined' || defaultV === '') return null + if (defaultV === null || typeof defaultV === 'undefined' || defaultV === '' || defaultV === '[object Object]') return null return defaultV.split(',')[0] } }, diff --git a/frontend/src/components/widget/DeWidget/DeSelectGrid.vue b/frontend/src/components/widget/DeWidget/DeSelectGrid.vue index 43e51a023b..14a77c930d 100644 --- a/frontend/src/components/widget/DeWidget/DeSelectGrid.vue +++ b/frontend/src/components/widget/DeWidget/DeSelectGrid.vue @@ -165,12 +165,12 @@ export default { return this.value.split(',') }, fillValueDerfault() { - const defaultV = this.element.options.value + const defaultV = this.element.options.value === null ? '' : this.element.options.value.toString() if (this.element.options.attrs.multiple) { - if (defaultV === null || typeof defaultV === 'undefined' || defaultV === '') return [] + if (defaultV === null || typeof defaultV === 'undefined' || defaultV === '' || defaultV === '[object Object]') return [] return defaultV.split(',') } else { - if (defaultV === null || typeof defaultV === 'undefined' || defaultV === '') return null + if (defaultV === null || typeof defaultV === 'undefined' || defaultV === '' || defaultV === '[object Object]') return null return defaultV.split(',')[0] } }, From 3222f645a1164b4d8caaf78ded5405ea25d8d344 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Tue, 21 Dec 2021 10:57:37 +0800 Subject: [PATCH 06/15] =?UTF-8?q?feat:=20=E6=A0=B9=E6=8D=AE=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E4=BF=A1=E6=81=AF=E8=87=AA=E5=8A=A8=E8=AF=86=E5=88=AB?= =?UTF-8?q?=E7=BB=88=E7=AB=AF=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/canvas/components/Editor/Preview.vue | 10 ++++++---- .../components/canvas/custom-component/UserView.vue | 2 -- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/frontend/src/components/canvas/components/Editor/Preview.vue b/frontend/src/components/canvas/components/Editor/Preview.vue index 97b8daaff5..4e71af110d 100644 --- a/frontend/src/components/canvas/components/Editor/Preview.vue +++ b/frontend/src/components/canvas/components/Editor/Preview.vue @@ -123,10 +123,6 @@ export default { } }, created() { - const terminalInfo = this.$route.query.terminal - if (terminalInfo) { - this.terminal = terminalInfo - } }, computed: { customStyle() { @@ -178,6 +174,7 @@ export default { } }, mounted() { + this._isMobile() const _this = this const erd = elementResizeDetectorMaker() // 监听主div变动事件 @@ -206,6 +203,11 @@ export default { clearInterval(this.timer) }, methods: { + _isMobile() { + console.log('navigator.userAgent:' + navigator.userAgent) + const flag = navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i) + this.terminal = flag ? 'mobile' : 'pc' + }, canvasStyleDataInit() { // 数据刷新计时器 this.searchCount = 0 diff --git a/frontend/src/components/canvas/custom-component/UserView.vue b/frontend/src/components/canvas/custom-component/UserView.vue index df7621c24a..d9b2216b9b 100644 --- a/frontend/src/components/canvas/custom-component/UserView.vue +++ b/frontend/src/components/canvas/custom-component/UserView.vue @@ -299,7 +299,6 @@ export default { // 监控缩放比例 previewCanvasScale: { handler(newVal, oldVal) { - console.log('previewCanvasScale:' + JSON.stringify(this.previewCanvasScale)) this.destroyScaleTimeMachine() this.changeScaleIndex++ this.chartScale(this.changeScaleIndex) @@ -317,7 +316,6 @@ export default { // 根据仪表板的缩放比例,修改视图内部参数 mergeScale() { const scale = Math.min(this.previewCanvasScale.scalePointWidth, this.previewCanvasScale.scalePointHeight) * this.scaleCoefficient - console.log('scale:' + scale + ';this.previewCanvasScale:' + JSON.stringify(this.previewCanvasScale)) const customAttrChart = JSON.parse(this.sourceCustomAttrStr) const customStyleChart = JSON.parse(this.sourceCustomStyleStr) recursionTransObj(customAttrTrans, customAttrChart, scale, this.scaleCoefficientType) From d890222d0a61f413ce86b5a42d8606d6bb4bc7aa Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Tue, 21 Dec 2021 11:12:48 +0800 Subject: [PATCH 07/15] =?UTF-8?q?feat:=20=E6=97=B6=E9=97=B4=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E5=A2=9E=E5=8A=A0=E6=97=B6=E9=97=B4=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?'=E6=97=A0'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/canvas/components/Editor/DateFormat.vue | 3 ++- frontend/src/components/widget/DeWidget/DeShowDate.vue | 8 ++++---- .../src/components/widget/DeWidget/TimeDefault.vue | 2 +- frontend/src/components/widget/DeWidget/TimeElec.vue | 10 +++++++--- frontend/src/components/widget/DeWidget/TimeSimple.vue | 8 +++++--- 5 files changed, 19 insertions(+), 12 deletions(-) diff --git a/frontend/src/components/canvas/components/Editor/DateFormat.vue b/frontend/src/components/canvas/components/Editor/DateFormat.vue index 48b41e3307..97e0d45673 100644 --- a/frontend/src/components/canvas/components/Editor/DateFormat.vue +++ b/frontend/src/components/canvas/components/Editor/DateFormat.vue @@ -97,7 +97,8 @@ export default { timeOptions: [ { value: 'hh:mm:ss', label: 'hh:mm:ss' }, - { value: 'hh时mm分ss秒', label: 'hh时mm分ss秒' } + { value: 'hh时mm分ss秒', label: 'hh时mm分ss秒' }, + { value: '', label: '无' } ], dateOptions: [ { value: 'yyyy-MM-dd', label: 'yyyy-MM-dd' }, diff --git a/frontend/src/components/widget/DeWidget/DeShowDate.vue b/frontend/src/components/widget/DeWidget/DeShowDate.vue index 5b71e6a3d5..6b95c13419 100644 --- a/frontend/src/components/widget/DeWidget/DeShowDate.vue +++ b/frontend/src/components/widget/DeWidget/DeShowDate.vue @@ -1,12 +1,12 @@ diff --git a/frontend/src/components/widget/DeWidget/TimeDefault.vue b/frontend/src/components/widget/DeWidget/TimeDefault.vue index c33066b290..5b59dcd0cc 100644 --- a/frontend/src/components/widget/DeWidget/TimeDefault.vue +++ b/frontend/src/components/widget/DeWidget/TimeDefault.vue @@ -44,7 +44,7 @@ export default { }, formatDate() { const weekArr = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'] - let timeFormat = this.element.formatInfo.timeFormat || 'hh:mm:ss' + let timeFormat = this.element.formatInfo.timeFormat const showWeek = this.element.formatInfo.showWeek const showDate = this.element.formatInfo.showDate const dateFormat = this.element.formatInfo.dateFormat || 'yyyy-MM-dd' diff --git a/frontend/src/components/widget/DeWidget/TimeElec.vue b/frontend/src/components/widget/DeWidget/TimeElec.vue index 0ad7958f40..0270662399 100644 --- a/frontend/src/components/widget/DeWidget/TimeElec.vue +++ b/frontend/src/components/widget/DeWidget/TimeElec.vue @@ -1,7 +1,7 @@ @@ -66,7 +66,7 @@ export default { }, updateTime() { var cd = new Date() - const timeFormat = this.element.formatInfo.timeFormat || 'hh:mm:ss' + const timeFormat = this.element.formatInfo.timeFormat const showWeek = this.element.formatInfo.showWeek const showDate = this.element.formatInfo.showDate const dateFormat = this.element.formatInfo.dateFormat || 'yyyy-MM-dd' @@ -75,8 +75,12 @@ export default { nowDate = cd.format(dateFormat) } const nowWeek = this.week[cd.getDay()] + if (timeFormat) { + this.time = cd.format(timeFormat) + } else { + this.time = null + } - this.time = cd.format(timeFormat) this.date = showWeek ? (nowDate + ' ' + nowWeek) : nowDate } } diff --git a/frontend/src/components/widget/DeWidget/TimeSimple.vue b/frontend/src/components/widget/DeWidget/TimeSimple.vue index badb0ecd83..a33212b60e 100644 --- a/frontend/src/components/widget/DeWidget/TimeSimple.vue +++ b/frontend/src/components/widget/DeWidget/TimeSimple.vue @@ -65,7 +65,7 @@ export default { this.timer = setInterval(this.canvass, 500) }, canvass() { - const timeFormat = this.element.formatInfo.timeFormat || 'hh:mm:ss' + const timeFormat = this.element.formatInfo.timeFormat const dateFormat = this.element.formatInfo.dateFormat || 'yyyy-MM-dd' const showWeek = this.element.formatInfo.showWeek const showDate = this.element.formatInfo.showDate @@ -110,8 +110,10 @@ export default { } else { englishWeek = 'Saturday' } - - const simpleTime = time.format(timeFormat) + let simpleTime = '' + if (timeFormat) { + simpleTime = time.format(timeFormat) + } let nowDate = '' if (showDate && dateFormat) { nowDate = time.format(dateFormat) From 3a8f5ca1af7bb37997873ed847cb964453fb160b Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Tue, 21 Dec 2021 11:21:22 +0800 Subject: [PATCH 08/15] =?UTF-8?q?fix:=20=E6=90=9C=E7=B4=A2=E8=BF=87?= =?UTF-8?q?=E6=BB=A4=E7=BB=84=E4=BB=B6=E5=85=BC=E5=AE=B9=E8=80=81=E7=89=88?= =?UTF-8?q?=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/widget/DeWidget/DeInputSearch.vue | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/widget/DeWidget/DeInputSearch.vue b/frontend/src/components/widget/DeWidget/DeInputSearch.vue index d35478bd47..65a43db761 100644 --- a/frontend/src/components/widget/DeWidget/DeInputSearch.vue +++ b/frontend/src/components/widget/DeWidget/DeInputSearch.vue @@ -38,6 +38,10 @@ export default { } }, computed: { + defaultValueStr() { + if (!this.element || !this.element.options || !this.element.options.value) return '' + return this.element.options.value.toString() + }, viewIds() { if (!this.element || !this.element.options || !this.element.options.attrs.viewIds) return '' return this.element.options.attrs.viewIds.toString() @@ -48,9 +52,9 @@ export default { if (typeof value === 'undefined' || value === old) return this.setCondition() }, - 'element.options.value': function(value, old) { + 'defaultValueStr': function(value, old) { if (value === old) return - this.value = value + this.value = this.fillValueDerfault() this.search() } }, @@ -82,6 +86,11 @@ export default { if (!this.inDraw) { this.element.options.value = val } + }, + fillValueDerfault() { + const defaultV = this.element.options.value === null ? '' : this.element.options.value.toString() + if (defaultV === null || typeof defaultV === 'undefined' || defaultV === '' || defaultV === '[object Object]') return null + return defaultV.split(',')[0] } } } From 4287a78ecb76f8abcf9dc17d446924125d3b6a64 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Tue, 21 Dec 2021 11:31:19 +0800 Subject: [PATCH 09/15] =?UTF-8?q?fix:=20=E5=AE=8C=E5=96=84=E5=AE=9A?= =?UTF-8?q?=E6=97=B6=E6=8A=A5=E5=91=8A=E5=88=86=E8=BE=A8=E7=8E=87=E6=8F=90?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/lang/en.js | 2 +- frontend/src/lang/tw.js | 2 +- frontend/src/lang/zh.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/lang/en.js b/frontend/src/lang/en.js index a7738681b5..9ab8fab6dd 100644 --- a/frontend/src/lang/en.js +++ b/frontend/src/lang/en.js @@ -1720,7 +1720,7 @@ export default { once_a_week: 'Once a week', once_a_month: 'Once a month', complex_repeat: 'Complex repeat', - pixel_tip: 'Please select' + pixel_tip: 'Please code custom pixel(such as 2560 * 1600) or select' } } diff --git a/frontend/src/lang/tw.js b/frontend/src/lang/tw.js index 85efa381fc..dc6d472e3c 100644 --- a/frontend/src/lang/tw.js +++ b/frontend/src/lang/tw.js @@ -1732,7 +1732,7 @@ export default { once_a_week: '每周一次', once_a_month: '每月一次', complex_repeat: '複雜重複', - pixel_tip: '可直接輸入分辨率或者選擇' + pixel_tip: '可直接輸入分辨率(例如:2560 * 1600)或者選擇' } } diff --git a/frontend/src/lang/zh.js b/frontend/src/lang/zh.js index 5630a294a4..1cdc650e73 100644 --- a/frontend/src/lang/zh.js +++ b/frontend/src/lang/zh.js @@ -1742,7 +1742,7 @@ export default { once_a_week: '每周一次', once_a_month: '每月一次', complex_repeat: '复杂重复', - pixel_tip: '可直接输入自定义分辨率或选择' + pixel_tip: '可直接输入自定义分辨率(例如:2560 * 1600)或选择' } } From 3089a502a3ceb505dacc98ceedf8700c1ec23e25 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Tue, 21 Dec 2021 11:56:03 +0800 Subject: [PATCH 10/15] =?UTF-8?q?fix:=20=E6=96=87=E5=AD=97=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E7=BB=84=E4=BB=B6=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/widget/DeWidget/DeInputSearch.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/components/widget/DeWidget/DeInputSearch.vue b/frontend/src/components/widget/DeWidget/DeInputSearch.vue index 65a43db761..89bb482618 100644 --- a/frontend/src/components/widget/DeWidget/DeInputSearch.vue +++ b/frontend/src/components/widget/DeWidget/DeInputSearch.vue @@ -74,7 +74,7 @@ export default { setCondition() { const param = { component: this.element, - value: !this.value ? [] : [this.value], + value: !this.value ? [] : Array.isArray(this.value) ? this.value : [this.value], operator: this.operator } this.inDraw && this.$store.commit('addViewFilter', param) From ca0401f115fe45b5ccad9953c7b5cbefd6ad6db4 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Tue, 21 Dec 2021 12:35:45 +0800 Subject: [PATCH 11/15] =?UTF-8?q?fix:=20=E5=A4=9A=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E8=BF=87=E6=BB=A4=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/widget/DeWidget/DeSelectGrid.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/components/widget/DeWidget/DeSelectGrid.vue b/frontend/src/components/widget/DeWidget/DeSelectGrid.vue index 14a77c930d..bad50f9d35 100644 --- a/frontend/src/components/widget/DeWidget/DeSelectGrid.vue +++ b/frontend/src/components/widget/DeWidget/DeSelectGrid.vue @@ -126,7 +126,7 @@ export default { initLoad() { this.value = this.element.options.attrs.multiple ? [] : null if (this.element.options.attrs.fieldId) { - multFieldValues(this.element.options.attrs.fieldId.split()).then(res => { + multFieldValues(this.element.options.attrs.fieldId.split(',')).then(res => { this.datas = this.optionDatas(res.data) if (this.element.options.attrs.multiple) { this.checkAll = this.value.length === this.datas.length From b191c845a47a42cf1d75cd5d16d4867a80665b17 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Tue, 21 Dec 2021 12:41:06 +0800 Subject: [PATCH 12/15] =?UTF-8?q?refactor:=20=E7=A7=BB=E5=8A=A8=E7=AB=AF?= =?UTF-8?q?=E5=B8=83=E5=B1=80=E9=80=82=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/api/panel/enshrine.js | 12 ++-- .../canvas/components/Editor/Preview.vue | 1 + .../canvas/components/Editor/PreviewEject.vue | 4 +- frontend/src/views/panel/edit/index.vue | 60 ++++++++++++++++++- 4 files changed, 67 insertions(+), 10 deletions(-) diff --git a/frontend/src/api/panel/enshrine.js b/frontend/src/api/panel/enshrine.js index 4be99e1bdc..e8b98951ec 100644 --- a/frontend/src/api/panel/enshrine.js +++ b/frontend/src/api/panel/enshrine.js @@ -1,26 +1,26 @@ import request from '@/utils/request' -export function saveEnshrine(panelGroupId) { +export function saveEnshrine(panelGroupId, loading = true) { return request({ url: '/api/store/' + panelGroupId, method: 'post', - loading: true + loading: loading }) } -export function deleteEnshrine(id) { +export function deleteEnshrine(id, loading = true) { return request({ url: '/api/store/remove/' + id, method: 'post', - loading: true + loading: loading }) } -export function enshrineList(data) { +export function enshrineList(data, loading = true) { return request({ url: '/api/store/list', method: 'post', - loading: true, + loading: loading, data }) } diff --git a/frontend/src/components/canvas/components/Editor/Preview.vue b/frontend/src/components/canvas/components/Editor/Preview.vue index 4e71af110d..71000f4928 100644 --- a/frontend/src/components/canvas/components/Editor/Preview.vue +++ b/frontend/src/components/canvas/components/Editor/Preview.vue @@ -207,6 +207,7 @@ export default { console.log('navigator.userAgent:' + navigator.userAgent) const flag = navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i) this.terminal = flag ? 'mobile' : 'pc' + // this.terminal = 'mobile' }, canvasStyleDataInit() { // 数据刷新计时器 diff --git a/frontend/src/components/canvas/components/Editor/PreviewEject.vue b/frontend/src/components/canvas/components/Editor/PreviewEject.vue index 9af90493e8..ab25d00889 100644 --- a/frontend/src/components/canvas/components/Editor/PreviewEject.vue +++ b/frontend/src/components/canvas/components/Editor/PreviewEject.vue @@ -80,8 +80,8 @@ export default { .bg { width: 100%; height: 100vh!important; - min-width: 800px; - min-height: 600px; + min-width: 200px; + min-height: 300px; background-color: #f7f8fa; } diff --git a/frontend/src/views/panel/edit/index.vue b/frontend/src/views/panel/edit/index.vue index 5809f95db0..12b0219db1 100644 --- a/frontend/src/views/panel/edit/index.vue +++ b/frontend/src/views/panel/edit/index.vue @@ -122,12 +122,24 @@ @scroll="canvasScroll" > + + {{ panelInfo.name }} + - + + + + + + + + + +
@@ -233,6 +245,7 @@ import generateID from '@/components/canvas/utils/generateID' import TextAttr from '@/components/canvas/components/TextAttr' import { queryPanelJumpInfo } from '@/api/panel/linkJump' import ComponentWait from '@/views/panel/edit/ComponentWait' +import { deleteEnshrine, saveEnshrine, starStatus } from '@/api/panel/enshrine' export default { name: 'PanelEdit', @@ -256,6 +269,8 @@ export default { }, data() { return { + mobileEditorShow: true, + hasStar: false, drawerSize: '300px', visible: false, show: false, @@ -453,6 +468,7 @@ export default { }, methods: { init(panelId) { + this.initHasStar() // 如果临时画布有数据 则使用临时画布数据(视图编辑的时候 会保存临时画布数据) const componentDataTemp = this.$store.state.panel.componentDataTemp const canvasStyleDataTemp = this.$store.state.panel.canvasStyleDataTemp @@ -512,6 +528,27 @@ export default { }) } }, + star() { + this.panelInfo && saveEnshrine(this.panelInfo.id, false).then(res => { + this.hasStar = true + }) + }, + unstar() { + this.panelInfo && deleteEnshrine(this.panelInfo.id, false).then(res => { + this.hasStar = false + }) + }, + initHasStar() { + starStatus(this.panelInfo.id, false).then(res => { + this.hasStar = res.data + }) + }, + mobileRefresh() { + this.mobileEditorShow = false + this.$nextTick(() => { + this.mobileEditorShow = true + }) + }, save() { }, @@ -964,11 +1001,30 @@ export default { background-size:100% 100% !important; } +.this_mobile_canvas_inner_top{ + vertical-align: middle; + text-align: center; + background-color: #f7f8fa; + height: 30px; + line-height: 30px; + font-size: 14px; + width: 100%; +} + .this_mobile_canvas_top{ height: 30px; width: 100%; } +.this_mobile_canvas_inner_bottom{ + background-color: #f7f8fa; + line-height: 30px; + vertical-align: middle; + color: gray; + height: 30px; + width: 100%; +} + .this_mobile_canvas_bottom{ height: 30px; width: 100%; @@ -977,7 +1033,7 @@ export default { .this_mobile_canvas_main{ overflow-x: hidden; overflow-y: auto; - height: calc(100% - 60px);; + height: calc(100% - 120px);; background-color: #d7d9e3; background-size:100% 100% !important; } From cda6b7513f0449710f22d0221fd25cf28cf8c6fc Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Tue, 21 Dec 2021 16:05:14 +0800 Subject: [PATCH 13/15] =?UTF-8?q?refactor:=20=E4=BB=AA=E8=A1=A8=E6=9D=BF?= =?UTF-8?q?=E9=80=82=E9=85=8D=E5=90=8E=E7=AB=AF=E9=95=BF=E5=B1=8F=E6=88=AA?= =?UTF-8?q?=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../canvas/components/Editor/Preview.vue | 36 ++++++++++++++++--- .../canvas/components/Editor/PreviewEject.vue | 25 ++++++++++--- frontend/src/permission.js | 2 +- frontend/src/router/index.js | 6 +++- 4 files changed, 59 insertions(+), 10 deletions(-) diff --git a/frontend/src/components/canvas/components/Editor/Preview.vue b/frontend/src/components/canvas/components/Editor/Preview.vue index 71000f4928..f1194a6d84 100644 --- a/frontend/src/components/canvas/components/Editor/Preview.vue +++ b/frontend/src/components/canvas/components/Editor/Preview.vue @@ -1,6 +1,6 @@