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

View File

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