Merge pull request #3268 from dataease/pr@dev@fix_tab_view_style

fix(视图): 设置tab背景对内部地图文字无效
This commit is contained in:
xuwei-fit2cloud 2022-09-30 09:42:49 +08:00 committed by GitHub
commit 8bf60e09a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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