fix:兼容 NCC 以前的业务逻辑,支持外部通过 record 中的 isleaf 字段,判断是否为叶子节点

This commit is contained in:
yangchch6 2019-12-31 15:20:13 +08:00
parent 0f6834dba3
commit 0efad91481
4 changed files with 10 additions and 4 deletions

View File

@ -874,8 +874,10 @@ var Table = function (_Component) {
var isHiddenExpandIcon = void 0;
var record = data[i];
var key = this.getRowKey(record, i);
// 兼容 NCC 以前的业务逻辑,支持外部通过 record 中的 isleaf 字段,判断是否为叶子节点
record['isLeaf'] = typeof record['isleaf'] === 'boolean' ? record['isleaf'] : record['isLeaf'];
// isLeaf 字段是在 bigData 里添加的,只有层级树大数据场景需要该字段
// isLeaf 有三种取值情况true / false / null
// isLeaf 有三种取值情况true / false / nullTable内部字段
var isLeaf = typeof record['isLeaf'] === 'boolean' ? record['isLeaf'] : null;
var childrenColumn = isLeaf ? false : record[childrenColumnName];
var isRowExpanded = this.isRowExpanded(record, i);

4
dist/demo.js vendored
View File

@ -37911,8 +37911,10 @@
var isHiddenExpandIcon = void 0;
var record = data[i];
var key = this.getRowKey(record, i);
// 兼容 NCC 以前的业务逻辑,支持外部通过 record 中的 isleaf 字段,判断是否为叶子节点
record['isLeaf'] = typeof record['isleaf'] === 'boolean' ? record['isleaf'] : record['isLeaf'];
// isLeaf 字段是在 bigData 里添加的,只有层级树大数据场景需要该字段
// isLeaf 有三种取值情况true / false / null
// isLeaf 有三种取值情况true / false / nullTable内部字段
var isLeaf = typeof record['isLeaf'] === 'boolean' ? record['isLeaf'] : null;
var childrenColumn = isLeaf ? false : record[childrenColumnName];
var isRowExpanded = this.isRowExpanded(record, i);

2
dist/demo.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -715,8 +715,10 @@ class Table extends Component {
let isHiddenExpandIcon;
const record = data[i];
const key = this.getRowKey(record, i);
// 兼容 NCC 以前的业务逻辑,支持外部通过 record 中的 isleaf 字段,判断是否为叶子节点
record['isLeaf'] = typeof record['isleaf'] === 'boolean' ? record['isleaf'] : record['isLeaf'];
// isLeaf 字段是在 bigData 里添加的,只有层级树大数据场景需要该字段
// isLeaf 有三种取值情况true / false / null
// isLeaf 有三种取值情况true / false / nullTable内部字段
const isLeaf = typeof record['isLeaf'] === 'boolean' ? record['isLeaf'] : null;
const childrenColumn = isLeaf ? false : record[childrenColumnName];
const isRowExpanded = this.isRowExpanded(record, i);