Merge pull request #4543 from dataease/pr@dev@fix_filter-title

fix(仪表板): 修复切换主题色过滤组件表头位置也变化的问题
This commit is contained in:
王嘉豪 2023-02-15 16:47:26 +08:00 committed by GitHub
commit 6efedf6651
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 3 deletions

View File

@ -381,7 +381,10 @@ export function adaptCurThemeCommonStyle(component) {
if (isFilterComponent(component.component)) {
const filterStyle = store.state.canvasStyleData.chartInfo.filterStyle
for (const styleKey in filterStyle) {
Vue.set(component.style, styleKey, filterStyle[styleKey])
// 位置属性不修改
if (styleKey !== 'horizontal' && styleKey !== 'vertical') {
Vue.set(component.style, styleKey, filterStyle[styleKey])
}
}
} else if (isTabComponent(component.component)) {
const tabStyle = store.state.canvasStyleData.chartInfo.tabStyle

View File

@ -19,12 +19,14 @@
<el-radio-group
v-model="styleInfo.horizontal"
size="mini"
@change="styleChange"
>
<el-radio-button label="left">{{ $t('chart.text_pos_left') }}</el-radio-button>
<el-radio-button
:disabled="styleInfo.vertical === 'center' && elementType !== 'de-select-grid'"
label="center"
>{{ $t('chart.text_pos_center') }}</el-radio-button>
>{{ $t('chart.text_pos_center') }}
</el-radio-button>
<el-radio-button label="right">{{ $t('chart.text_pos_right') }}</el-radio-button>
</el-radio-group>
</el-form-item>
@ -36,12 +38,14 @@
<el-radio-group
v-model="styleInfo.vertical"
size="mini"
@change="styleChange"
>
<el-radio-button label="top">{{ $t('chart.text_pos_top') }}</el-radio-button>
<el-radio-button
:disabled="styleInfo.horizontal === 'center'"
label="center"
>{{ $t('chart.text_pos_center') }}</el-radio-button>
>{{ $t('chart.text_pos_center') }}
</el-radio-button>
</el-radio-group>
</el-form-item>
@ -73,6 +77,12 @@ export default {
type: String,
default: ''
}
},
methods: {
styleChange() {
this.$store.commit('canvasChange')
}
}
}