Browse Source

fix:
1.Decimal为nullBUG

WanRuixiang 5 months ago
parent
commit
74905d417a
2 changed files with 2 additions and 2 deletions
  1. 1 1
      src/app/components/ChartsGraph/utils.js
  2. 1 1
      src/app/pages/IndexDefine/index.jsx

+ 1 - 1
src/app/components/ChartsGraph/utils.js

@@ -72,7 +72,7 @@ export const formatData=(data, dim, mtc, cat)=>(
     const mtcData = item[mtc?.value];
     const metric = mtcType==="PERCENT" && mtcData
       ? new Decimal(parseFloat(mtcData.replace('%', '')) / 100).toDP(4).toNumber()
-      : new Decimal(mtcData).toNumber()
+      : new Decimal(mtcData||'0').toNumber()
     return {
       dimension:item[dim?.value],
       category:item[cat?.value],

+ 1 - 1
src/app/pages/IndexDefine/index.jsx

@@ -42,7 +42,7 @@ import useI18NPrefix from "../../hooks/useI18NPrefix";
 // TODO
 //  1.指标SQK创建AS中文,
 //  2.创建指标退出时SQL字段配置重置,
-//  5.全选,批量设置、复制指标生成SQL到剪切板、指标应用权限
+//  5.批量设置、复制指标生成SQL到剪切板、指标应用权限
 //  6.Decimal转换null
 //  7.指标卡片调度显示不一致
 export const IndexDefine = () => {