diff --git a/core/core-frontend/src/custom-component/rich-text/DeRichTextView.vue b/core/core-frontend/src/custom-component/rich-text/DeRichTextView.vue index 5c190c4138..f0f775f939 100644 --- a/core/core-frontend/src/custom-component/rich-text/DeRichTextView.vue +++ b/core/core-frontend/src/custom-component/rich-text/DeRichTextView.vue @@ -55,6 +55,7 @@ import { storeToRefs } from 'pinia' import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain' import ChartError from '@/views/chart/components/views/components/ChartError.vue' import { useEmitt } from '@/hooks/web/useEmitt' +import { valueFormatter } from '@/views/chart/components/js/formatter' const snapshotStore = snapshotStoreWithOut() const errMsg = ref('') const dvMainStore = dvMainStoreWithOut() @@ -389,9 +390,18 @@ const initCurFields = chartDetails => { yDataeaseNamesCfg[yItem.dataeaseName] = yItem.formatterCfg }) } + const valueFieldMap: Record = chartDetails.yAxis.reduce((p, n) => { + p[n.dataeaseName] = n + return p + }, {}) for (const key in rowData) { dataRowSelect.value[nameIdMap[key]] = rowData[key] - dataRowNameSelect.value[sourceFieldNameIdMap[key]] = rowData[key] + let rowDataValue = rowData[key] + const f = valueFieldMap[key] + if (f && f.formatterCfg) { + rowDataValue = valueFormatter(rowDataValue, f.formatterCfg) + } + dataRowNameSelect.value[sourceFieldNameIdMap[key]] = rowDataValue } } element.value.propValue['innerType'] = chartDetails.type diff --git a/core/core-frontend/src/views/chart/components/editor/drag-item/QuotaItem.vue b/core/core-frontend/src/views/chart/components/editor/drag-item/QuotaItem.vue index acc6bbe4d2..48d25deff0 100644 --- a/core/core-frontend/src/views/chart/components/editor/drag-item/QuotaItem.vue +++ b/core/core-frontend/src/views/chart/components/editor/drag-item/QuotaItem.vue @@ -82,7 +82,7 @@ watch( }, { deep: true } ) -const AXIS_FORMAT_VIEW = ['table-normal', 'table-info', 'table-pivot', 'indicator'] +const AXIS_FORMAT_VIEW = ['table-normal', 'table-info', 'table-pivot', 'indicator', 'rich-text'] const showValueFormatter = computed(() => { return ( AXIS_FORMAT_VIEW.includes(props.chart.type) &&