From 63bde5e19656bb2f8f19f03edf89d4a02dc921e7 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Mon, 21 Nov 2022 15:57:11 +0800 Subject: [PATCH 01/22] =?UTF-8?q?fix(=E5=85=AC=E5=85=B1=E9=93=BE=E6=8E=A5)?= =?UTF-8?q?:=20=E6=B7=B1=E8=89=B2=E4=B8=BB=E9=A2=98=E4=B8=8B=E6=93=8D?= =?UTF-8?q?=E4=BD=9C=E5=8C=BA=E5=9F=9F=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../canvas/components/editor/CanvasOptBar.vue | 66 +++++++++++++++++-- .../canvas/components/editor/Preview.vue | 6 ++ frontend/src/icons/svg/link-back.svg | 5 +- frontend/src/icons/svg/link-down.svg | 5 +- .../src/views/panel/export/PDFPreExport.vue | 2 +- 5 files changed, 68 insertions(+), 16 deletions(-) diff --git a/frontend/src/components/canvas/components/editor/CanvasOptBar.vue b/frontend/src/components/canvas/components/editor/CanvasOptBar.vue index 0f174096c0..4aae7a12ad 100644 --- a/frontend/src/components/canvas/components/editor/CanvasOptBar.vue +++ b/frontend/src/components/canvas/components/editor/CanvasOptBar.vue @@ -8,6 +8,7 @@ v-if="isPublicLink" ref="widget-div" class="function-div" + :class="functionClass" > {{ $t('panel.remove_all_linkage') }} + >{{ $t('panel.remove_all_linkage') }} { @@ -142,13 +164,43 @@ export default { width: max-content; text-align: end; z-index: 999; - ::v-deep button:hover { - background-color: rgba(31, 35, 41, 0.1); - color: #1F2329; - font-weight: bold; - border-color: rgba(31, 35, 41, 0.1) + border-radius: 4px; + ::v-deep button { + border-radius: 0px; + } + } + .function-light { + background: #FFFFFF; + border: 1px solid #DEE0E3; + box-shadow: 0px 4px 8px rgb(31 35 41 / 10%); + ::v-deep button { + background-color: #FFFFFF; + box-shadow: 0px 4px 8px rgba(31, 35, 41, 0.1); + border: 1px solid #DEE0E3; + &:hover { + background-color: rgba(31, 35, 41, 0.1); + color: #1F2329; + font-weight: bold; + border-color: rgba(31, 35, 41, 0.1) + } + } + } + .function-dark { + background: #1A1A1A; + border: 1px solid #434343; + box-shadow: 0px 4px 8px rgba(26, 26, 26, 0.1); + ::v-deep button { + background-color: #1A1A1A; + border: 1px solid #434343; + box-shadow: 0px 4px 8px rgba(26, 26, 26, 0.1); + color: #FFFFFF; + &:hover { + background-color: rgba(235, 235, 235, 0.1); + color: #EBEBEB; + font-weight: bold; + border-color: rgba(235, 235, 235, 0.1); + } } - } &:hover { border-top: 60px solid rgba(245, 74, 69, 0);; diff --git a/frontend/src/components/canvas/components/editor/Preview.vue b/frontend/src/components/canvas/components/editor/Preview.vue index 15a5186b6e..2aeb6fb1d5 100644 --- a/frontend/src/components/canvas/components/editor/Preview.vue +++ b/frontend/src/components/canvas/components/editor/Preview.vue @@ -11,6 +11,7 @@ >
{ this.exporting = true + this.backScreenShot = true + const scrollHeight = document.getElementById('preview-temp-canvas-main').scrollHeight + + document.getElementById('preview-canvas-main').style.height = (scrollHeight + 'px') setTimeout(() => { html2canvas(document.getElementById(domId)).then(canvas => { const snapshot = canvas.toDataURL('image/jpeg', 1) // 是图片质量 this.dataLoading = false this.exporting = false + this.backScreenShot = false if (snapshot !== '') { this.snapshotInfo = snapshot this.pdfExportShow = true diff --git a/frontend/src/icons/svg/link-back.svg b/frontend/src/icons/svg/link-back.svg index 1d1352fe5d..88339b6c3a 100644 --- a/frontend/src/icons/svg/link-back.svg +++ b/frontend/src/icons/svg/link-back.svg @@ -1,4 +1 @@ - - - - \ No newline at end of file + \ No newline at end of file diff --git a/frontend/src/icons/svg/link-down.svg b/frontend/src/icons/svg/link-down.svg index 90a6a5bda1..f0aaca266a 100644 --- a/frontend/src/icons/svg/link-down.svg +++ b/frontend/src/icons/svg/link-down.svg @@ -1,4 +1 @@ - - - - \ No newline at end of file + \ No newline at end of file diff --git a/frontend/src/views/panel/export/PDFPreExport.vue b/frontend/src/views/panel/export/PDFPreExport.vue index 586b653d0a..8d2c54076c 100644 --- a/frontend/src/views/panel/export/PDFPreExport.vue +++ b/frontend/src/views/panel/export/PDFPreExport.vue @@ -117,7 +117,7 @@ export default { initContent() { this.templateContentChange = this.templateContent for (const [key, value] of Object.entries(this.varsInfo)) { - this.templateContentChange = pdfTemplateReplaceAll(this.templateContentChange, key, value) + this.templateContentChange = pdfTemplateReplaceAll(this.templateContentChange, key, value || '') } }, From 01c7d4d4d74aa6403528a37a7580726add2ae014 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Mon, 21 Nov 2022 17:39:51 +0800 Subject: [PATCH 02/22] =?UTF-8?q?fix(=E4=BB=AA=E8=A1=A8=E6=9D=BF):=20?= =?UTF-8?q?=E6=89=B9=E9=87=8F=E8=AE=BE=E7=BD=AEecharts=E8=A7=86=E5=9B=BE?= =?UTF-8?q?=E5=A4=96=E9=97=B4=E8=B7=9D=E6=97=A0=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/canvas/customComponent/UserView.vue | 3 +++ 1 file changed, 3 insertions(+) diff --git a/frontend/src/components/canvas/customComponent/UserView.vue b/frontend/src/components/canvas/customComponent/UserView.vue index cfedd58b54..2c5988c915 100644 --- a/frontend/src/components/canvas/customComponent/UserView.vue +++ b/frontend/src/components/canvas/customComponent/UserView.vue @@ -585,6 +585,9 @@ export default { updateParams['customAttr'] = this.sourceCustomAttrStr } else if (param.custom === 'customStyle') { const sourceCustomStyle = JSON.parse(this.sourceCustomStyleStr) + if (param.property === 'margin') { + sourceCustomStyle[param.property] = param.value + } sourceCustomStyle[param.property][param.value.modifyName] = param.value[param.value.modifyName] this.sourceCustomStyleStr = JSON.stringify(sourceCustomStyle) this.chart.customStyle = this.sourceCustomStyleStr From 5991e9c11f4df6ce6f5e7118001c9152842bc32b Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Tue, 22 Nov 2022 10:51:08 +0800 Subject: [PATCH 03/22] =?UTF-8?q?feat(=E4=BB=AA=E8=A1=A8=E6=9D=BF):=20Tab?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E6=94=AF=E6=8C=81=E8=BD=AE=E6=92=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/canvas/utils/utils.js | 2 + .../src/components/widget/deWidget/DeTabs.vue | 27 ++++++++ .../components/widget/deWidget/TabStyle.vue | 30 +++++++++ frontend/src/lang/en.js | 4 +- frontend/src/lang/tw.js | 2 + frontend/src/lang/zh.js | 2 + frontend/src/views/chart/view/ChartEdit.vue | 62 +++++++++---------- 7 files changed, 96 insertions(+), 33 deletions(-) diff --git a/frontend/src/components/canvas/utils/utils.js b/frontend/src/components/canvas/utils/utils.js index c81866fc7b..86918cf2e4 100644 --- a/frontend/src/components/canvas/utils/utils.js +++ b/frontend/src/components/canvas/utils/utils.js @@ -103,6 +103,8 @@ export function panelDataPrepare(componentData, componentStyle, callback) { } if (item.type === 'de-tabs') { item.style.fontSize = item.style.fontSize || 16 + item.style.carouselEnable = item.style.carouselEnable || false + item.style.switchTime = item.style.switchTime || 5 } if (item.type === 'custom') { item.options.manualModify = false diff --git a/frontend/src/components/widget/deWidget/DeTabs.vue b/frontend/src/components/widget/deWidget/DeTabs.vue index 99d655a4a2..b7560db60e 100644 --- a/frontend/src/components/widget/deWidget/DeTabs.vue +++ b/frontend/src/components/widget/deWidget/DeTabs.vue @@ -272,6 +272,7 @@ export default { }, data() { return { + timer: null, scrollLeft: 50, scrollTop: 10, // 需要展示属性设置的组件类型 @@ -393,6 +394,16 @@ export default { } }, watch: { + 'element.style.carouselEnable': { + handler(newVal, oldVla) { + this.initCarousel() + } + }, + 'element.style.switchTime': { + handler(newVal, oldVla) { + this.initCarousel() + } + }, activeTabName: { handler(newVal, oldVla) { this.$store.commit('setTabActiveTabNameMap', { tabId: this.element.id, activeTabName: this.activeTabName }) @@ -439,10 +450,26 @@ export default { this.$store.commit('setTabActiveTabNameMap', { tabId: this.element.id, activeTabName: this.activeTabName }) this.setContentThemeStyle() }, + mounted() { + this.initCarousel() + }, beforeDestroy() { bus.$off('add-new-tab', this.addNewTab) }, methods: { + initCarousel() { + this.timer && clearInterval(this.timer) + if (this.element.style.carouselEnable) { + const switchTime = (this.element.style.switchTime || 5) * 1000 + let switchCount = 1 + // 轮播定时器 + this.timer = setInterval(() => { + switchCount++ + const nowIndex = switchCount % this.element.options.tabList.length + this.activeTabName = this.element.options.tabList[nowIndex].name + }, switchTime) + } + }, initScroll() { this.scrollLeft = 50 this.scrollTop = 10 diff --git a/frontend/src/components/widget/deWidget/TabStyle.vue b/frontend/src/components/widget/deWidget/TabStyle.vue index a95cdae96b..e7d1d3d15f 100644 --- a/frontend/src/components/widget/deWidget/TabStyle.vue +++ b/frontend/src/components/widget/deWidget/TabStyle.vue @@ -112,6 +112,36 @@ {{ $t('chart.text_pos_right') }} + + + + {{ $('common.enable') }} + + + + {{ $('panel.switch_time') }} + + + + + + + + + - + - + {{ $t('chart.change_chart_type') }} - + @@ -490,8 +490,8 @@ > {{ - $t('chart.drag_block_table_data_column') - }} + $t('chart.drag_block_table_data_column') + }} {{ $t('chart.drag_block_type_axis') }} @@ -499,18 +499,18 @@ v-else-if="view.type && view.type.includes('pie')" >{{ $t('chart.drag_block_pie_label') }} {{ - $t('chart.drag_block_funnel_split') - }} + $t('chart.drag_block_funnel_split') + }} {{ - $t('chart.drag_block_radar_label') - }} + $t('chart.drag_block_radar_label') + }} {{ $t('chart.area') }} {{ - $t('chart.drag_block_treemap_label') - }} + $t('chart.drag_block_treemap_label') + }} {{ - $t('chart.drag_block_word_cloud_label') - }} + $t('chart.drag_block_word_cloud_label') + }} {{ $t('chart.drag_block_label') }} / {{ $t('chart.dimension') }} @@ -633,8 +633,8 @@ > {{ - $t('chart.drag_block_table_data_column') - }} + $t('chart.drag_block_table_data_column') + }} {{ $t('chart.drag_block_value_axis') }} @@ -642,30 +642,30 @@ v-else-if="view.type && view.type.includes('pie')" >{{ $t('chart.drag_block_pie_angel') }} {{ - $t('chart.drag_block_funnel_width') - }} + $t('chart.drag_block_funnel_width') + }} {{ - $t('chart.drag_block_radar_length') - }} + $t('chart.drag_block_radar_length') + }} {{ - $t('chart.drag_block_gauge_angel') - }} + $t('chart.drag_block_gauge_angel') + }} {{ $t('chart.drag_block_label_value') }} {{ $t('chart.chart_data') }} {{ - $t('chart.drag_block_treemap_size') - }} + $t('chart.drag_block_treemap_size') + }} {{ - $t('chart.drag_block_value_axis_main') - }} + $t('chart.drag_block_value_axis_main') + }} {{ $t('chart.drag_block_progress') }} {{ - $t('chart.drag_block_word_cloud_size') - }} + $t('chart.drag_block_word_cloud_size') + }} / {{ $t('chart.quota') }} - + @@ -1268,7 +1268,7 @@ width="800px" class="dialog-css" > - +