vxe-table 4.12.0-beta.6 → 4.12.0-beta.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/style.css +1 -1
- package/es/table/src/body.js +11 -6
- package/es/table/src/footer.js +7 -2
- package/es/table/src/table.js +29 -27
- package/es/table/src/util.js +23 -3
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/index.umd.js +72 -40
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/src/body.js +10 -5
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/footer.js +7 -2
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/table.js +30 -26
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +26 -5
- package/lib/table/src/util.min.js +1 -1
- package/lib/ui/index.js +1 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/package.json +2 -2
- package/packages/table/src/body.ts +10 -5
- package/packages/table/src/footer.ts +7 -2
- package/packages/table/src/table.ts +32 -27
- package/packages/table/src/util.ts +26 -3
- /package/es/{iconfont.1741224140308.ttf → iconfont.1741265552139.ttf} +0 -0
- /package/es/{iconfont.1741224140308.woff → iconfont.1741265552139.woff} +0 -0
- /package/es/{iconfont.1741224140308.woff2 → iconfont.1741265552139.woff2} +0 -0
- /package/lib/{iconfont.1741224140308.ttf → iconfont.1741265552139.ttf} +0 -0
- /package/lib/{iconfont.1741224140308.woff → iconfont.1741265552139.woff} +0 -0
- /package/lib/{iconfont.1741224140308.woff2 → iconfont.1741265552139.woff2} +0 -0
package/es/table/src/footer.js
CHANGED
|
@@ -126,6 +126,7 @@ export default defineComponent({
|
|
|
126
126
|
tfOns.onDblclick = (evnt) => {
|
|
127
127
|
$xeTable.dispatchEvent('footer-cell-dblclick', Object.assign({ cell: evnt.currentTarget }, cellParams), evnt);
|
|
128
128
|
};
|
|
129
|
+
let isMergeCell = false;
|
|
129
130
|
// 合并行或列
|
|
130
131
|
if (mergeFooterList.length) {
|
|
131
132
|
const spanRest = mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex);
|
|
@@ -135,9 +136,11 @@ export default defineComponent({
|
|
|
135
136
|
return null;
|
|
136
137
|
}
|
|
137
138
|
if (rowspan > 1) {
|
|
139
|
+
isMergeCell = true;
|
|
138
140
|
attrs.rowspan = rowspan;
|
|
139
141
|
}
|
|
140
142
|
if (colspan > 1) {
|
|
143
|
+
isMergeCell = true;
|
|
141
144
|
attrs.colspan = colspan;
|
|
142
145
|
}
|
|
143
146
|
}
|
|
@@ -158,8 +161,10 @@ export default defineComponent({
|
|
|
158
161
|
const isLastColumn = $columnIndex === tableColumn.length - 1;
|
|
159
162
|
const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto');
|
|
160
163
|
let isVNPreEmptyStatus = false;
|
|
161
|
-
if (
|
|
162
|
-
|
|
164
|
+
if (!isMergeCell) {
|
|
165
|
+
if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
|
|
166
|
+
isVNPreEmptyStatus = true;
|
|
167
|
+
}
|
|
163
168
|
}
|
|
164
169
|
const tcStyle = {};
|
|
165
170
|
if (hasEllipsis) {
|
package/es/table/src/table.js
CHANGED
|
@@ -9,7 +9,7 @@ import TableHeaderComponent from './header';
|
|
|
9
9
|
import TableFooterComponent from './footer';
|
|
10
10
|
import tableProps from './props';
|
|
11
11
|
import tableEmits from './emits';
|
|
12
|
-
import { getRowUniqueId, clearTableAllStatus, getRowkey, getRowid, rowToVisible, colToVisible, getCellValue, setCellValue, handleFieldOrColumn, toTreePathSeq, restoreScrollLocation, getRootColumn, getRefElem, getColReMinWidth } from './util';
|
|
12
|
+
import { getRowUniqueId, clearTableAllStatus, getRowkey, getRowid, rowToVisible, colToVisible, getCellValue, setCellValue, handleFieldOrColumn, toTreePathSeq, restoreScrollLocation, getRootColumn, getRefElem, getColReMinWidth, updateDeepRowKey, updateFastRowKey } from './util';
|
|
13
13
|
import { getSlotVNs } from '../../ui/src/vn';
|
|
14
14
|
import { warnLog, errLog } from '../../ui/src/log';
|
|
15
15
|
import TableCustomPanelComponent from '../module/custom/panel';
|
|
@@ -2651,7 +2651,7 @@ export default defineComponent({
|
|
|
2651
2651
|
const { transform } = treeOpts;
|
|
2652
2652
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
2653
2653
|
let treeData = [];
|
|
2654
|
-
let fullData = reactive(datas ? datas.slice(0) : []); //
|
|
2654
|
+
let fullData = reactive(datas ? datas.slice(0) : []); // 转为响应式数据
|
|
2655
2655
|
if (treeConfig) {
|
|
2656
2656
|
if (transform) {
|
|
2657
2657
|
// 树结构自动转换
|
|
@@ -6750,32 +6750,19 @@ export default defineComponent({
|
|
|
6750
6750
|
const treeOpts = computeTreeOpts.value;
|
|
6751
6751
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
6752
6752
|
const hasChildField = treeOpts.hasChild || treeOpts.hasChildField;
|
|
6753
|
+
const { lazy } = treeOpts;
|
|
6753
6754
|
const rowkey = getRowkey($xeTable);
|
|
6755
|
+
const isDeepKey = rowkey.indexOf('.') > -1;
|
|
6754
6756
|
const fullAllDataRowIdMaps = Object.assign({}, fullAllDataRowIdData); // 存在已删除数据
|
|
6755
6757
|
const fullDataRowIdMaps = {};
|
|
6756
6758
|
const treeTempExpandedMaps = Object.assign({}, treeExpandedMaps);
|
|
6757
|
-
const
|
|
6758
|
-
|
|
6759
|
-
|
|
6760
|
-
const level = nodes ? nodes.length - 1 : 0;
|
|
6761
|
-
if (eqEmptyValue(rowid)) {
|
|
6762
|
-
rowid = getRowUniqueId();
|
|
6763
|
-
XEUtils.set(row, rowkey, rowid);
|
|
6764
|
-
}
|
|
6765
|
-
if (treeConfig && treeOpts.lazy) {
|
|
6766
|
-
const treeExpRest = treeExpandedMaps[rowid];
|
|
6767
|
-
if (row[hasChildField] && XEUtils.isUndefined(row[childrenField])) {
|
|
6768
|
-
row[childrenField] = null;
|
|
6769
|
-
}
|
|
6770
|
-
if (treeExpRest) {
|
|
6771
|
-
if (!row[childrenField] || !row[childrenField].length) {
|
|
6772
|
-
delete treeTempExpandedMaps[rowid];
|
|
6773
|
-
}
|
|
6774
|
-
}
|
|
6775
|
-
}
|
|
6776
|
-
let rowRest = fullAllDataRowIdData[rowid];
|
|
6759
|
+
const handleRowId = isDeepKey ? updateDeepRowKey : updateFastRowKey;
|
|
6760
|
+
const handleRowCache = (row, index, items, currIndex, parentRow, rowid, level, seq) => {
|
|
6761
|
+
let rowRest = fullAllDataRowIdMaps[rowid];
|
|
6777
6762
|
if (!rowRest) {
|
|
6778
6763
|
rowRest = { row, rowid, seq, index: -1, _index: -1, $index: -1, treeIndex: index, items, parent: parentRow, level, height: 0, resizeHeight: 0, oTop: 0, expandHeight: 0 };
|
|
6764
|
+
fullDataRowIdMaps[rowid] = rowRest;
|
|
6765
|
+
fullAllDataRowIdMaps[rowid] = rowRest;
|
|
6779
6766
|
}
|
|
6780
6767
|
rowRest.treeLoaded = false;
|
|
6781
6768
|
rowRest.expandLoaded = false;
|
|
@@ -6783,15 +6770,30 @@ export default defineComponent({
|
|
|
6783
6770
|
rowRest.items = items;
|
|
6784
6771
|
rowRest.parent = parentRow;
|
|
6785
6772
|
rowRest.level = level;
|
|
6786
|
-
rowRest.index =
|
|
6787
|
-
|
|
6788
|
-
fullAllDataRowIdMaps[rowid] = rowRest;
|
|
6773
|
+
rowRest.index = currIndex;
|
|
6774
|
+
rowRest.treeIndex = index;
|
|
6789
6775
|
};
|
|
6790
6776
|
if (treeConfig) {
|
|
6791
|
-
XEUtils.eachTree(tableFullTreeData,
|
|
6777
|
+
XEUtils.eachTree(tableFullTreeData, (row, index, items, path, parentRow, nodes) => {
|
|
6778
|
+
const rowid = handleRowId(row, rowkey);
|
|
6779
|
+
if (treeConfig && lazy) {
|
|
6780
|
+
const treeExpRest = treeTempExpandedMaps[rowid];
|
|
6781
|
+
if (row[hasChildField] && row[childrenField] === undefined) {
|
|
6782
|
+
row[childrenField] = null;
|
|
6783
|
+
}
|
|
6784
|
+
if (treeExpRest) {
|
|
6785
|
+
if (!row[childrenField] || !row[childrenField].length) {
|
|
6786
|
+
delete treeTempExpandedMaps[rowid];
|
|
6787
|
+
}
|
|
6788
|
+
}
|
|
6789
|
+
}
|
|
6790
|
+
handleRowCache(row, index, items, parentRow ? -1 : index, parentRow, rowid, nodes.length - 1, toTreePathSeq(path));
|
|
6791
|
+
}, { children: childrenField });
|
|
6792
6792
|
}
|
|
6793
6793
|
else {
|
|
6794
|
-
tableFullData.forEach(
|
|
6794
|
+
tableFullData.forEach((row, index, items) => {
|
|
6795
|
+
handleRowCache(row, index, items, index, null, handleRowId(row, rowkey), 0, index + 1);
|
|
6796
|
+
});
|
|
6795
6797
|
}
|
|
6796
6798
|
internalData.fullDataRowIdData = fullDataRowIdMaps;
|
|
6797
6799
|
internalData.fullAllDataRowIdData = fullAllDataRowIdMaps;
|
package/es/table/src/util.js
CHANGED
|
@@ -2,6 +2,7 @@ import { watch, reactive } from 'vue';
|
|
|
2
2
|
import XEUtils from 'xe-utils';
|
|
3
3
|
import { ColumnInfo } from './columnInfo';
|
|
4
4
|
import { isPx, isScale } from '../../ui/src/dom';
|
|
5
|
+
import { eqEmptyValue } from '../../ui/src/utils';
|
|
5
6
|
const getAllConvertColumns = (columns, parentColumn) => {
|
|
6
7
|
const result = [];
|
|
7
8
|
columns.forEach((column) => {
|
|
@@ -90,14 +91,33 @@ export function getRowUniqueId() {
|
|
|
90
91
|
export function getRowkey($xeTable) {
|
|
91
92
|
const { props } = $xeTable;
|
|
92
93
|
const { computeRowOpts } = $xeTable.getComputeMaps();
|
|
93
|
-
const { rowId } = props;
|
|
94
94
|
const rowOpts = computeRowOpts.value;
|
|
95
|
-
return rowId || rowOpts.keyField || '_X_ROW_KEY'
|
|
95
|
+
return `${props.rowId || rowOpts.keyField || '_X_ROW_KEY'}`;
|
|
96
96
|
}
|
|
97
97
|
// 行主键 value
|
|
98
98
|
export function getRowid($xeTable, row) {
|
|
99
99
|
const rowid = XEUtils.get(row, getRowkey($xeTable));
|
|
100
|
-
return
|
|
100
|
+
return encodeRowid(rowid);
|
|
101
|
+
}
|
|
102
|
+
// 编码行主键
|
|
103
|
+
export function encodeRowid(rowVal) {
|
|
104
|
+
return XEUtils.eqNull(rowVal) ? '' : encodeURIComponent(rowVal);
|
|
105
|
+
}
|
|
106
|
+
export function updateDeepRowKey(row, rowkey) {
|
|
107
|
+
let rowid = XEUtils.get(row, rowkey);
|
|
108
|
+
if (eqEmptyValue(rowid)) {
|
|
109
|
+
rowid = getRowUniqueId();
|
|
110
|
+
XEUtils.set(row, rowkey, rowid);
|
|
111
|
+
}
|
|
112
|
+
return rowid;
|
|
113
|
+
}
|
|
114
|
+
export function updateFastRowKey(row, rowkey) {
|
|
115
|
+
let rowid = row[rowkey];
|
|
116
|
+
if (eqEmptyValue(rowid)) {
|
|
117
|
+
rowid = getRowUniqueId();
|
|
118
|
+
row[rowkey] = rowid;
|
|
119
|
+
}
|
|
120
|
+
return rowid;
|
|
101
121
|
}
|
|
102
122
|
export const handleFieldOrColumn = ($xeTable, fieldOrColumn) => {
|
|
103
123
|
if (fieldOrColumn) {
|
package/es/ui/index.js
CHANGED
package/es/ui/src/log.js
CHANGED
package/lib/index.umd.js
CHANGED
|
@@ -3138,7 +3138,7 @@ function eqEmptyValue(cellValue) {
|
|
|
3138
3138
|
;// ./packages/ui/index.ts
|
|
3139
3139
|
|
|
3140
3140
|
|
|
3141
|
-
const version = "4.12.0-beta.
|
|
3141
|
+
const version = "4.12.0-beta.7";
|
|
3142
3142
|
core_.VxeUI.version = version;
|
|
3143
3143
|
core_.VxeUI.tableVersion = version;
|
|
3144
3144
|
core_.VxeUI.setConfig({
|
|
@@ -3586,7 +3586,7 @@ var esnext_iterator_some = __webpack_require__(7550);
|
|
|
3586
3586
|
const {
|
|
3587
3587
|
log: log_log
|
|
3588
3588
|
} = core_.VxeUI;
|
|
3589
|
-
const log_version = `table v${"4.12.0-beta.
|
|
3589
|
+
const log_version = `table v${"4.12.0-beta.7"}`;
|
|
3590
3590
|
const warnLog = log_log.create('warn', log_version);
|
|
3591
3591
|
const errLog = log_log.create('error', log_version);
|
|
3592
3592
|
;// ./packages/table/src/columnInfo.ts
|
|
@@ -3960,6 +3960,7 @@ function isNodeElement(elem) {
|
|
|
3960
3960
|
|
|
3961
3961
|
|
|
3962
3962
|
|
|
3963
|
+
|
|
3963
3964
|
const getAllConvertColumns = (columns, parentColumn) => {
|
|
3964
3965
|
const result = [];
|
|
3965
3966
|
columns.forEach(column => {
|
|
@@ -4049,16 +4050,33 @@ function getRowkey($xeTable) {
|
|
|
4049
4050
|
const {
|
|
4050
4051
|
computeRowOpts
|
|
4051
4052
|
} = $xeTable.getComputeMaps();
|
|
4052
|
-
const {
|
|
4053
|
-
rowId
|
|
4054
|
-
} = props;
|
|
4055
4053
|
const rowOpts = computeRowOpts.value;
|
|
4056
|
-
return rowId || rowOpts.keyField || '_X_ROW_KEY'
|
|
4054
|
+
return `${props.rowId || rowOpts.keyField || '_X_ROW_KEY'}`;
|
|
4057
4055
|
}
|
|
4058
4056
|
// 行主键 value
|
|
4059
4057
|
function getRowid($xeTable, row) {
|
|
4060
4058
|
const rowid = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, getRowkey($xeTable));
|
|
4061
|
-
return
|
|
4059
|
+
return encodeRowid(rowid);
|
|
4060
|
+
}
|
|
4061
|
+
// 编码行主键
|
|
4062
|
+
function encodeRowid(rowVal) {
|
|
4063
|
+
return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(rowVal) ? '' : encodeURIComponent(rowVal);
|
|
4064
|
+
}
|
|
4065
|
+
function updateDeepRowKey(row, rowkey) {
|
|
4066
|
+
let rowid = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, rowkey);
|
|
4067
|
+
if (eqEmptyValue(rowid)) {
|
|
4068
|
+
rowid = getRowUniqueId();
|
|
4069
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(row, rowkey, rowid);
|
|
4070
|
+
}
|
|
4071
|
+
return rowid;
|
|
4072
|
+
}
|
|
4073
|
+
function updateFastRowKey(row, rowkey) {
|
|
4074
|
+
let rowid = row[rowkey];
|
|
4075
|
+
if (eqEmptyValue(rowid)) {
|
|
4076
|
+
rowid = getRowUniqueId();
|
|
4077
|
+
row[rowkey] = rowid;
|
|
4078
|
+
}
|
|
4079
|
+
return rowid;
|
|
4062
4080
|
}
|
|
4063
4081
|
const handleFieldOrColumn = ($xeTable, fieldOrColumn) => {
|
|
4064
4082
|
if (fieldOrColumn) {
|
|
@@ -6462,6 +6480,7 @@ const renderType = 'body';
|
|
|
6462
6480
|
tdOns.onDblclick = evnt => {
|
|
6463
6481
|
$xeTable.triggerCellDblclickEvent(evnt, cellParams);
|
|
6464
6482
|
};
|
|
6483
|
+
let isMergeCell = false;
|
|
6465
6484
|
// 合并行或列
|
|
6466
6485
|
if (mergeList.length) {
|
|
6467
6486
|
const spanRest = mergeBodyMethod(mergeList, _rowIndex, _columnIndex);
|
|
@@ -6474,9 +6493,11 @@ const renderType = 'body';
|
|
|
6474
6493
|
return null;
|
|
6475
6494
|
}
|
|
6476
6495
|
if (rowspan > 1) {
|
|
6496
|
+
isMergeCell = true;
|
|
6477
6497
|
tdAttrs.rowspan = rowspan;
|
|
6478
6498
|
}
|
|
6479
6499
|
if (colspan > 1) {
|
|
6500
|
+
isMergeCell = true;
|
|
6480
6501
|
tdAttrs.colspan = colspan;
|
|
6481
6502
|
}
|
|
6482
6503
|
}
|
|
@@ -6511,11 +6532,13 @@ const renderType = 'body';
|
|
|
6511
6532
|
const isLastColumn = $columnIndex === columns.length - 1;
|
|
6512
6533
|
const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto');
|
|
6513
6534
|
let isVNPreEmptyStatus = false;
|
|
6514
|
-
if (!
|
|
6515
|
-
if (
|
|
6516
|
-
|
|
6517
|
-
|
|
6518
|
-
|
|
6535
|
+
if (!isMergeCell) {
|
|
6536
|
+
if (!dragRow || getRowid($xeTable, dragRow) !== rowid) {
|
|
6537
|
+
if (scrollYLoad && (_rowIndex < scrollYStore.visibleStartIndex - scrollYStore.preloadSize || _rowIndex > scrollYStore.visibleEndIndex + scrollYStore.preloadSize)) {
|
|
6538
|
+
isVNPreEmptyStatus = true;
|
|
6539
|
+
} else if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
|
|
6540
|
+
isVNPreEmptyStatus = true;
|
|
6541
|
+
}
|
|
6519
6542
|
}
|
|
6520
6543
|
}
|
|
6521
6544
|
const tcStyle = {};
|
|
@@ -7704,6 +7727,7 @@ function mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex) {
|
|
|
7704
7727
|
cell: evnt.currentTarget
|
|
7705
7728
|
}, cellParams), evnt);
|
|
7706
7729
|
};
|
|
7730
|
+
let isMergeCell = false;
|
|
7707
7731
|
// 合并行或列
|
|
7708
7732
|
if (mergeFooterList.length) {
|
|
7709
7733
|
const spanRest = mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex);
|
|
@@ -7716,9 +7740,11 @@ function mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex) {
|
|
|
7716
7740
|
return null;
|
|
7717
7741
|
}
|
|
7718
7742
|
if (rowspan > 1) {
|
|
7743
|
+
isMergeCell = true;
|
|
7719
7744
|
attrs.rowspan = rowspan;
|
|
7720
7745
|
}
|
|
7721
7746
|
if (colspan > 1) {
|
|
7747
|
+
isMergeCell = true;
|
|
7722
7748
|
attrs.colspan = colspan;
|
|
7723
7749
|
}
|
|
7724
7750
|
}
|
|
@@ -7741,8 +7767,10 @@ function mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex) {
|
|
|
7741
7767
|
const isLastColumn = $columnIndex === tableColumn.length - 1;
|
|
7742
7768
|
const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto');
|
|
7743
7769
|
let isVNPreEmptyStatus = false;
|
|
7744
|
-
if (
|
|
7745
|
-
|
|
7770
|
+
if (!isMergeCell) {
|
|
7771
|
+
if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
|
|
7772
|
+
isVNPreEmptyStatus = true;
|
|
7773
|
+
}
|
|
7746
7774
|
}
|
|
7747
7775
|
const tcStyle = {};
|
|
7748
7776
|
if (hasEllipsis) {
|
|
@@ -13428,7 +13456,7 @@ const maxXWidth = 5e6;
|
|
|
13428
13456
|
} = treeOpts;
|
|
13429
13457
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
13430
13458
|
let treeData = [];
|
|
13431
|
-
let fullData = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.reactive)(datas ? datas.slice(0) : []); //
|
|
13459
|
+
let fullData = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.reactive)(datas ? datas.slice(0) : []); // 转为响应式数据
|
|
13432
13460
|
if (treeConfig) {
|
|
13433
13461
|
if (transform) {
|
|
13434
13462
|
// 树结构自动转换
|
|
@@ -18088,7 +18116,11 @@ const maxXWidth = 5e6;
|
|
|
18088
18116
|
const treeOpts = computeTreeOpts.value;
|
|
18089
18117
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
18090
18118
|
const hasChildField = treeOpts.hasChild || treeOpts.hasChildField;
|
|
18119
|
+
const {
|
|
18120
|
+
lazy
|
|
18121
|
+
} = treeOpts;
|
|
18091
18122
|
const rowkey = getRowkey($xeTable);
|
|
18123
|
+
const isDeepKey = rowkey.indexOf('.') > -1;
|
|
18092
18124
|
const fullAllDataRowIdMaps = {
|
|
18093
18125
|
...fullAllDataRowIdData
|
|
18094
18126
|
}; // 存在已删除数据
|
|
@@ -18096,26 +18128,9 @@ const maxXWidth = 5e6;
|
|
|
18096
18128
|
const treeTempExpandedMaps = {
|
|
18097
18129
|
...treeExpandedMaps
|
|
18098
18130
|
};
|
|
18099
|
-
const
|
|
18100
|
-
|
|
18101
|
-
|
|
18102
|
-
const level = nodes ? nodes.length - 1 : 0;
|
|
18103
|
-
if (eqEmptyValue(rowid)) {
|
|
18104
|
-
rowid = getRowUniqueId();
|
|
18105
|
-
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(row, rowkey, rowid);
|
|
18106
|
-
}
|
|
18107
|
-
if (treeConfig && treeOpts.lazy) {
|
|
18108
|
-
const treeExpRest = treeExpandedMaps[rowid];
|
|
18109
|
-
if (row[hasChildField] && external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isUndefined(row[childrenField])) {
|
|
18110
|
-
row[childrenField] = null;
|
|
18111
|
-
}
|
|
18112
|
-
if (treeExpRest) {
|
|
18113
|
-
if (!row[childrenField] || !row[childrenField].length) {
|
|
18114
|
-
delete treeTempExpandedMaps[rowid];
|
|
18115
|
-
}
|
|
18116
|
-
}
|
|
18117
|
-
}
|
|
18118
|
-
let rowRest = fullAllDataRowIdData[rowid];
|
|
18131
|
+
const handleRowId = isDeepKey ? updateDeepRowKey : updateFastRowKey;
|
|
18132
|
+
const handleRowCache = (row, index, items, currIndex, parentRow, rowid, level, seq) => {
|
|
18133
|
+
let rowRest = fullAllDataRowIdMaps[rowid];
|
|
18119
18134
|
if (!rowRest) {
|
|
18120
18135
|
rowRest = {
|
|
18121
18136
|
row,
|
|
@@ -18133,6 +18148,8 @@ const maxXWidth = 5e6;
|
|
|
18133
18148
|
oTop: 0,
|
|
18134
18149
|
expandHeight: 0
|
|
18135
18150
|
};
|
|
18151
|
+
fullDataRowIdMaps[rowid] = rowRest;
|
|
18152
|
+
fullAllDataRowIdMaps[rowid] = rowRest;
|
|
18136
18153
|
}
|
|
18137
18154
|
rowRest.treeLoaded = false;
|
|
18138
18155
|
rowRest.expandLoaded = false;
|
|
@@ -18140,16 +18157,31 @@ const maxXWidth = 5e6;
|
|
|
18140
18157
|
rowRest.items = items;
|
|
18141
18158
|
rowRest.parent = parentRow;
|
|
18142
18159
|
rowRest.level = level;
|
|
18143
|
-
rowRest.index =
|
|
18144
|
-
|
|
18145
|
-
fullAllDataRowIdMaps[rowid] = rowRest;
|
|
18160
|
+
rowRest.index = currIndex;
|
|
18161
|
+
rowRest.treeIndex = index;
|
|
18146
18162
|
};
|
|
18147
18163
|
if (treeConfig) {
|
|
18148
|
-
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(tableFullTreeData,
|
|
18164
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(tableFullTreeData, (row, index, items, path, parentRow, nodes) => {
|
|
18165
|
+
const rowid = handleRowId(row, rowkey);
|
|
18166
|
+
if (treeConfig && lazy) {
|
|
18167
|
+
const treeExpRest = treeTempExpandedMaps[rowid];
|
|
18168
|
+
if (row[hasChildField] && row[childrenField] === undefined) {
|
|
18169
|
+
row[childrenField] = null;
|
|
18170
|
+
}
|
|
18171
|
+
if (treeExpRest) {
|
|
18172
|
+
if (!row[childrenField] || !row[childrenField].length) {
|
|
18173
|
+
delete treeTempExpandedMaps[rowid];
|
|
18174
|
+
}
|
|
18175
|
+
}
|
|
18176
|
+
}
|
|
18177
|
+
handleRowCache(row, index, items, parentRow ? -1 : index, parentRow, rowid, nodes.length - 1, toTreePathSeq(path));
|
|
18178
|
+
}, {
|
|
18149
18179
|
children: childrenField
|
|
18150
18180
|
});
|
|
18151
18181
|
} else {
|
|
18152
|
-
tableFullData.forEach(
|
|
18182
|
+
tableFullData.forEach((row, index, items) => {
|
|
18183
|
+
handleRowCache(row, index, items, index, null, handleRowId(row, rowkey), 0, index + 1);
|
|
18184
|
+
});
|
|
18153
18185
|
}
|
|
18154
18186
|
internalData.fullDataRowIdData = fullDataRowIdMaps;
|
|
18155
18187
|
internalData.fullAllDataRowIdData = fullAllDataRowIdMaps;
|