提交 0fc6aab3 编写于 作者: tony001's avatar tony001

zpc --- 修复图表排序问题

上级 709b8f5e
...@@ -594,7 +594,7 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char ...@@ -594,7 +594,7 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char
let curCodeList:Map<number,any> = allCodeList.get(groupField[0].codelist.tag); let curCodeList:Map<number,any> = allCodeList.get(groupField[0].codelist.tag);
curCodeList.forEach((codelist:any) =>{ curCodeList.forEach((codelist:any) =>{
arr.forEach((item:any) =>{ arr.forEach((item:any) =>{
if(Object.is(item.planetype,codelist)){ if(Object.is(item[groupField[0].name],codelist)){
returnArray.push(item); returnArray.push(item);
item.hasused = true; item.hasused = true;
} }
...@@ -640,8 +640,8 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char ...@@ -640,8 +640,8 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char
public handleSortGroupData(arr:Array<any>,groupField:any,label:string){ public handleSortGroupData(arr:Array<any>,groupField:any,label:string){
arr.forEach((item:any) =>{ arr.forEach((item:any) =>{
let sortFieldValue:Array<any> = item[groupField[0].name].split("-"); let sortFieldValue:Array<any> = item[groupField[0].name].split("-");
Object.assign(item,{sortField:Number(sortFieldValue[0]+sortFieldValue[1])}); Object.assign(item,{sortField:Number(sortFieldValue[0])*10000+Number(sortFieldValue[1])});
item[groupField[0].name] = sortFieldValue[0]+"年"+sortFieldValue[1]+label; item[groupField[0].name] = sortFieldValue[0]+"年"+sortFieldValue[1]+label;
}) })
arr.sort((a:any, b:any) => { arr.sort((a:any, b:any) => {
return Number(a.sortField) - Number(b.sortField); return Number(a.sortField) - Number(b.sortField);
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册