Merge pull request #10094 from dataease/pr@dev-v2@chart-labelSelector-position-fix

fix(图表): 修复水平条形图标签位置配置项不显示的问题
This commit is contained in:
jianneng-fit2cloud 2024-06-05 09:56:34 +08:00 committed by GitHub
commit 049c661fd5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -220,6 +220,24 @@ const isBarRangeTime = computed<boolean>(() => {
}
return false
})
const showPositionH = computed(() => {
if (showProperty('hPosition')) {
if (props.chart.type !== 'bidirectional-bar') {
return true
}
return props.chart.customAttr.basicStyle.layout === 'horizontal'
}
return false
})
const showPositionV = computed(() => {
if (showProperty('vPosition')) {
if (props.chart.type !== 'bidirectional-bar') {
return true
}
return props.chart.customAttr.basicStyle.layout === 'vertical'
}
return false
})
watch(
() => props.chart.customAttr.basicStyle.layout,
() => {
@ -245,12 +263,6 @@ watch(
{ deep: true }
)
const isBarBidirectionalAndVertical = computed(() => {
if (props.chart.type !== 'bidirectional-bar') {
return true
}
return props.chart.customAttr.basicStyle.layout === 'vertical'
})
onMounted(() => {
init()
})
@ -328,7 +340,7 @@ onMounted(() => {
</el-select>
</el-form-item>
<el-form-item
v-if="showProperty('hPosition') && !isBarBidirectionalAndVertical"
v-if="showPositionH"
:label="t('chart.label_position')"
class="form-item"
:class="'form-item-' + themes"
@ -349,7 +361,7 @@ onMounted(() => {
</el-select>
</el-form-item>
<el-form-item
v-if="showProperty('vPosition') && isBarBidirectionalAndVertical"
v-if="showPositionV"
:label="t('chart.label_position')"
class="form-item"
:class="'form-item-' + themes"