File tree Expand file tree Collapse file tree
common/changes/@visactor/vtable Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ {
2+ "changes" : [
3+ {
4+ "comment" : " fix: distinguish null and empty string values in row/column dimensions\n\n " ,
5+ "type" : " none" ,
6+ "packageName" : " @visactor/vtable"
7+ }
8+ ],
9+ "packageName" : " @visactor/vtable" ,
10+ "email" : " gongshiwei@kkgroup.cn"
11+ }
Original file line number Diff line number Diff line change @@ -803,8 +803,9 @@ export class Dataset {
803803 if ( this . indicatorsAsCol ) {
804804 assignedIndicatorKey_value = colKeys [ col_j ] . indicatorKey ;
805805 }
806- const flatRowKey = rowKey . join ( this . stringJoinChar ) ;
807- const flatColKey = colKey . join ( this . stringJoinChar ) ;
806+ // 原生的数组join方法会将null转换为空字符串
807+ const flatRowKey = join ( rowKey , this . stringJoinChar ) ;
808+ const flatColKey = join ( colKey , this . stringJoinChar ) ;
808809
809810 //#region 收集用户传入的汇总数据到totalRecordsTree
810811 //该条数据为汇总数据
Original file line number Diff line number Diff line change @@ -2344,8 +2344,12 @@ export class PivotHeaderLayoutMap implements LayoutMapAPI {
23442344 } = { } ;
23452345 rowHeaderPath . dimensionKey = rowHeader . dimensionKey ;
23462346 rowHeaderPath . indicatorKey = rowHeader . indicatorKey ;
2347+ // 如果value为null且没有indicatorKey时保持value为null(区分null和空字符串,防止单元格数据匹配不对)
23472348 rowHeaderPath . value =
2348- rowHeader . value ?? this . getIndicatorInfoByIndicatorKey ( rowHeader . indicatorKey ) ?. title ?? '' ;
2349+ rowHeader . value ??
2350+ ( rowHeader . indicatorKey
2351+ ? this . getIndicatorInfoByIndicatorKey ( rowHeader . indicatorKey ) ?. title ?? ''
2352+ : rowHeader . value ) ;
23492353 rowHeaderPath . virtual = rowHeader . virtual ;
23502354 rowHeaderPath . role = rowHeader . role ;
23512355 headerPaths . rowHeaderPaths ! . push ( rowHeaderPath ) ;
You can’t perform that action at this time.
0 commit comments