提交 c13a9720 编写于 作者: Mosher's avatar Mosher

修复数据图标月份显示问题 --- fix1

上级 e840abc5
...@@ -743,11 +743,17 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char ...@@ -743,11 +743,17 @@ import { ChartDataSetField,ChartLineSeries,ChartFunnelSeries,ChartPieSeries,Char
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])*10000+Number(sortFieldValue[1])}); Object.assign(item,{sortField:Number(sortFieldValue[0])*10000+Number(sortFieldValue[1])});
/**
* @judgment 分组为月份时,月份+1 start
* @author mos
* @date 2020.07.20
*/
if(Object.is(label, "月")) { if(Object.is(label, "月")) {
item[groupField[0].name] = sortFieldValue[0]+(this.$t('app.chart.year') as string)+(Number(sortFieldValue[1])+1)+label; item[groupField[0].name] = sortFieldValue[0]+(this.$t('app.chart.year') as string)+(Number(sortFieldValue[1])+1)+label;
} else { } else {
item[groupField[0].name] = sortFieldValue[0]+(this.$t('app.chart.year') as string)+sortFieldValue[1]+label; item[groupField[0].name] = sortFieldValue[0]+(this.$t('app.chart.year') as string)+sortFieldValue[1]+label;
} }
// @judgment 分组为月份时,月份+1 end
}) })
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 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册