Merge pull request #11645 from dataease/pr@dev-v2@chart-yoy-fix

fix(图表): 修复同环比中,判断是否是指标卡图表类型的方式不正确问题
This commit is contained in:
jianneng-fit2cloud 2024-08-19 18:22:33 +08:00 committed by GitHub
commit 4611e8bc70
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,6 +1,6 @@
<script lang="tsx" setup>
import { useI18n } from '@/hooks/web/useI18n'
import { reactive, toRefs, watch } from 'vue'
import { computed, reactive, toRefs, watch } from 'vue'
import {
compareYearList,
compareMonthList,
@ -44,9 +44,9 @@ watch(
{ deep: true }
)
const isIndicator = () => {
const isIndicator = computed(() => {
return chart.value.type === 'indicator'
}
})
// xaxisextStack
const initFieldList = () => {
@ -73,7 +73,7 @@ const initFieldList = () => {
t1.push(...t2)
}
if (isIndicator) {
if (isIndicator.value) {
t1.length = 0
t1.push(...props.dimensionData.filter(ele => ele.deType === 1))
t1.push(...props.quotaData.filter(ele => ele.deType === 1))
@ -109,7 +109,7 @@ const initCompareType = () => {
} else {
state.compareList = []
}
if (isIndicator) {
if (isIndicator.value) {
state.compareList = [
{ name: 'day_mom', value: 'day_mom' },
{ name: 'month_mom', value: 'month_mom' },
@ -130,7 +130,7 @@ const initCompareType = () => {
}
const fieldFormatter = field => {
if (isIndicator) {
if (isIndicator.value) {
return field.name
} else {
return field.name + '(' + t('chart.' + field.dateStyle) + ')'