From 9192ef96b1eee63874a488bc1d819ac9971a694b Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Fri, 30 Sep 2022 08:51:23 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E8=A7=86=E5=9B=BE):=20=E8=AE=BE=E7=BD=AEta?= =?UTF-8?q?b=E8=83=8C=E6=99=AF=E5=AF=B9=E5=86=85=E9=83=A8=E5=9C=B0?= =?UTF-8?q?=E5=9B=BE=E6=96=87=E5=AD=97=E6=97=A0=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/widget/DeWidget/DeTabs.vue | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/widget/DeWidget/DeTabs.vue b/frontend/src/components/widget/DeWidget/DeTabs.vue index 2502b260fc..043983da4c 100644 --- a/frontend/src/components/widget/DeWidget/DeTabs.vue +++ b/frontend/src/components/widget/DeWidget/DeTabs.vue @@ -252,6 +252,9 @@ export default { }, isCurrentEdit() { return this.isEdit && this.curComponent && this.curComponent.id === this.element.id + }, + themeStyle() { + return this.element.commonBackground } }, watch: { @@ -282,17 +285,34 @@ export default { this.$store.commit('setCurActiveTabInner', null) } } - + }, + 'themeStyle.color'(value, old) { + if (value !== old) { + this.setContentThemeStyle() + } + }, + 'themeStyle.commonBackground.color'(value, old) { + if (value !== old) { + this.setContentThemeStyle() + } } }, created() { bus.$on('add-new-tab', this.addNewTab) this.activeTabName = this.element.options.tabList[0].name + this.setContentThemeStyle() }, beforeDestroy() { bus.$off('add-new-tab', this.addNewTab) }, methods: { + setContentThemeStyle() { + this.element.options.tabList.forEach(tab => { + if(tab.content && tab.content.type === 'view') { + tab.content.commonBackground = this.themeStyle ? JSON.parse(JSON.stringify(this.themeStyle)) : null + } + }) + }, beforeHandleCommond(item, param) { return { 'command': item, @@ -374,6 +394,8 @@ export default { component.propValue = propValue component.filters = [] component.linkageFilters = [] + if(this.themeStyle) + component.commonBackground = JSON.parse(JSON.stringify(this.themeStyle)) } }) component.id = newComponentId