forked from github/dataease
Merge pull request #11645 from dataease/pr@dev-v2@chart-yoy-fix
fix(图表): 修复同环比中,判断是否是指标卡图表类型的方式不正确问题
This commit is contained in:
commit
4611e8bc70
@ -1,6 +1,6 @@
|
|||||||
<script lang="tsx" setup>
|
<script lang="tsx" setup>
|
||||||
import { useI18n } from '@/hooks/web/useI18n'
|
import { useI18n } from '@/hooks/web/useI18n'
|
||||||
import { reactive, toRefs, watch } from 'vue'
|
import { computed, reactive, toRefs, watch } from 'vue'
|
||||||
import {
|
import {
|
||||||
compareYearList,
|
compareYearList,
|
||||||
compareMonthList,
|
compareMonthList,
|
||||||
@ -44,9 +44,9 @@ watch(
|
|||||||
{ deep: true }
|
{ deep: true }
|
||||||
)
|
)
|
||||||
|
|
||||||
const isIndicator = () => {
|
const isIndicator = computed(() => {
|
||||||
return chart.value.type === 'indicator'
|
return chart.value.type === 'indicator'
|
||||||
}
|
})
|
||||||
|
|
||||||
// 过滤xaxis,extStack所有日期字段
|
// 过滤xaxis,extStack所有日期字段
|
||||||
const initFieldList = () => {
|
const initFieldList = () => {
|
||||||
@ -73,7 +73,7 @@ const initFieldList = () => {
|
|||||||
|
|
||||||
t1.push(...t2)
|
t1.push(...t2)
|
||||||
}
|
}
|
||||||
if (isIndicator) {
|
if (isIndicator.value) {
|
||||||
t1.length = 0
|
t1.length = 0
|
||||||
t1.push(...props.dimensionData.filter(ele => ele.deType === 1))
|
t1.push(...props.dimensionData.filter(ele => ele.deType === 1))
|
||||||
t1.push(...props.quotaData.filter(ele => ele.deType === 1))
|
t1.push(...props.quotaData.filter(ele => ele.deType === 1))
|
||||||
@ -109,7 +109,7 @@ const initCompareType = () => {
|
|||||||
} else {
|
} else {
|
||||||
state.compareList = []
|
state.compareList = []
|
||||||
}
|
}
|
||||||
if (isIndicator) {
|
if (isIndicator.value) {
|
||||||
state.compareList = [
|
state.compareList = [
|
||||||
{ name: 'day_mom', value: 'day_mom' },
|
{ name: 'day_mom', value: 'day_mom' },
|
||||||
{ name: 'month_mom', value: 'month_mom' },
|
{ name: 'month_mom', value: 'month_mom' },
|
||||||
@ -130,7 +130,7 @@ const initCompareType = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const fieldFormatter = field => {
|
const fieldFormatter = field => {
|
||||||
if (isIndicator) {
|
if (isIndicator.value) {
|
||||||
return field.name
|
return field.name
|
||||||
} else {
|
} else {
|
||||||
return field.name + '(' + t('chart.' + field.dateStyle) + ')'
|
return field.name + '(' + t('chart.' + field.dateStyle) + ')'
|
||||||
|
Loading…
Reference in New Issue
Block a user