vxe-table 3.13.4 → 3.13.5
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/index.css +1 -1
- package/es/index.min.css +1 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/src/methods.js +40 -37
- package/es/table/src/table.js +1 -1
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/index.css +1 -1
- package/lib/index.min.css +1 -1
- package/lib/index.umd.js +46 -44
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/src/methods.js +41 -39
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +1 -1
- package/lib/table/src/table.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/methods.ts +42 -39
- package/packages/table/src/table.ts +1 -1
- package/styles/theme/base.scss +1 -1
- /package/es/{iconfont.1740013687420.ttf → iconfont.1740038065641.ttf} +0 -0
- /package/es/{iconfont.1740013687420.woff → iconfont.1740038065641.woff} +0 -0
- /package/es/{iconfont.1740013687420.woff2 → iconfont.1740038065641.woff2} +0 -0
- /package/lib/{iconfont.1740013687420.ttf → iconfont.1740038065641.ttf} +0 -0
- /package/lib/{iconfont.1740013687420.woff → iconfont.1740038065641.woff} +0 -0
- /package/lib/{iconfont.1740013687420.woff2 → iconfont.1740038065641.woff2} +0 -0
package/es/table/src/methods.js
CHANGED
|
@@ -2113,15 +2113,11 @@ const Methods = {
|
|
|
2113
2113
|
internalData.tableFullData = fullData;
|
|
2114
2114
|
internalData.tableFullTreeData = treeData;
|
|
2115
2115
|
// 缓存数据
|
|
2116
|
-
$xeTable.cacheRowMap(true
|
|
2116
|
+
$xeTable.cacheRowMap(true);
|
|
2117
2117
|
// 原始数据
|
|
2118
2118
|
internalData.tableSynchData = datas;
|
|
2119
2119
|
if (isReset) {
|
|
2120
2120
|
internalData.isResizeCellHeight = false;
|
|
2121
|
-
reactData.rowExpandedMaps = {};
|
|
2122
|
-
reactData.rowExpandLazyLoadedMaps = {};
|
|
2123
|
-
reactData.treeExpandedMaps = {};
|
|
2124
|
-
reactData.treeExpandLazyLoadedMaps = {};
|
|
2125
2121
|
}
|
|
2126
2122
|
// 克隆原数据,用于显示编辑状态,与编辑值做对比
|
|
2127
2123
|
if (keepSource) {
|
|
@@ -2305,16 +2301,21 @@ const Methods = {
|
|
|
2305
2301
|
/**
|
|
2306
2302
|
* 更新数据行的 Map
|
|
2307
2303
|
*/
|
|
2308
|
-
cacheRowMap(
|
|
2309
|
-
const
|
|
2304
|
+
cacheRowMap() {
|
|
2305
|
+
const $xeTable = this;
|
|
2306
|
+
const props = $xeTable;
|
|
2307
|
+
const internalData = $xeTable;
|
|
2308
|
+
const { treeConfig } = props;
|
|
2309
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
2310
|
+
const { fullAllDataRowIdData, tableFullData, tableFullTreeData } = internalData;
|
|
2310
2311
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
2311
2312
|
const hasChildField = treeOpts.hasChild || treeOpts.hasChildField;
|
|
2312
|
-
const rowkey = getRowkey(
|
|
2313
|
+
const rowkey = getRowkey($xeTable);
|
|
2313
2314
|
const isLazy = treeConfig && treeOpts.lazy;
|
|
2314
2315
|
const fullAllDataRowIdMaps = {};
|
|
2315
2316
|
const fullDataRowIdMaps = {};
|
|
2316
|
-
const
|
|
2317
|
-
let rowid = getRowid(
|
|
2317
|
+
const handleRow = (row, index, items, path, parentRow, nodes) => {
|
|
2318
|
+
let rowid = getRowid($xeTable, row);
|
|
2318
2319
|
const seq = treeConfig && path ? toTreePathSeq(path) : index + 1;
|
|
2319
2320
|
const level = nodes ? nodes.length - 1 : 0;
|
|
2320
2321
|
if (eqEmptyValue(rowid)) {
|
|
@@ -2324,29 +2325,25 @@ const Methods = {
|
|
|
2324
2325
|
if (isLazy && row[hasChildField] && XEUtils.isUndefined(row[childrenField])) {
|
|
2325
2326
|
row[childrenField] = null;
|
|
2326
2327
|
}
|
|
2327
|
-
let
|
|
2328
|
-
if (
|
|
2329
|
-
|
|
2330
|
-
}
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
}
|
|
2339
|
-
fullAllDataRowIdMaps[rowid] = cacheItem;
|
|
2328
|
+
let rowRest = fullAllDataRowIdData[rowid];
|
|
2329
|
+
if (!rowRest) {
|
|
2330
|
+
rowRest = { row, rowid, seq, index: -1, _index: -1, $index: -1, treeIndex: index, items, parent: parentRow, level, height: 0, resizeHeight: 0, oTop: 0, expandHeight: 0 };
|
|
2331
|
+
}
|
|
2332
|
+
rowRest.row = row;
|
|
2333
|
+
rowRest.items = items;
|
|
2334
|
+
rowRest.parent = parentRow;
|
|
2335
|
+
rowRest.level = level;
|
|
2336
|
+
rowRest.index = treeConfig && parentRow ? -1 : index;
|
|
2337
|
+
fullDataRowIdMaps[rowid] = rowRest;
|
|
2338
|
+
fullAllDataRowIdMaps[rowid] = rowRest;
|
|
2340
2339
|
};
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
}
|
|
2344
|
-
this.fullAllDataRowIdData = fullAllDataRowIdMaps;
|
|
2340
|
+
internalData.fullDataRowIdData = fullDataRowIdMaps;
|
|
2341
|
+
internalData.fullAllDataRowIdData = fullAllDataRowIdMaps;
|
|
2345
2342
|
if (treeConfig) {
|
|
2346
|
-
XEUtils.eachTree(tableFullTreeData,
|
|
2343
|
+
XEUtils.eachTree(tableFullTreeData, handleRow, { children: childrenField });
|
|
2347
2344
|
}
|
|
2348
2345
|
else {
|
|
2349
|
-
tableFullData.forEach(
|
|
2346
|
+
tableFullData.forEach(handleRow);
|
|
2350
2347
|
}
|
|
2351
2348
|
},
|
|
2352
2349
|
cacheSourceMap(fullData) {
|
|
@@ -3168,7 +3165,7 @@ const Methods = {
|
|
|
3168
3165
|
const props = $xeTable;
|
|
3169
3166
|
const internalData = $xeTable;
|
|
3170
3167
|
const { treeConfig } = props;
|
|
3171
|
-
const {
|
|
3168
|
+
const { fullAllDataRowIdData } = internalData;
|
|
3172
3169
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
3173
3170
|
const { transform, mapChildrenField } = treeOpts;
|
|
3174
3171
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
@@ -3181,7 +3178,7 @@ const Methods = {
|
|
|
3181
3178
|
rowid = getRowid($xeTable, rowOrRowid);
|
|
3182
3179
|
}
|
|
3183
3180
|
if (rowid) {
|
|
3184
|
-
const rest =
|
|
3181
|
+
const rest = fullAllDataRowIdData[rowid];
|
|
3185
3182
|
const row = rest ? rest.row : null;
|
|
3186
3183
|
if (row) {
|
|
3187
3184
|
return row[transform ? mapChildrenField : childrenField] || [];
|
|
@@ -3198,7 +3195,7 @@ const Methods = {
|
|
|
3198
3195
|
const props = $xeTable;
|
|
3199
3196
|
const internalData = $xeTable;
|
|
3200
3197
|
const { treeConfig } = props;
|
|
3201
|
-
const {
|
|
3198
|
+
const { fullAllDataRowIdData } = internalData;
|
|
3202
3199
|
if (rowOrRowid && treeConfig) {
|
|
3203
3200
|
let rowid;
|
|
3204
3201
|
if (XEUtils.isString(rowOrRowid)) {
|
|
@@ -3208,7 +3205,7 @@ const Methods = {
|
|
|
3208
3205
|
rowid = getRowid($xeTable, rowOrRowid);
|
|
3209
3206
|
}
|
|
3210
3207
|
if (rowid) {
|
|
3211
|
-
const rest =
|
|
3208
|
+
const rest = fullAllDataRowIdData[rowid];
|
|
3212
3209
|
return rest ? rest.parent : null;
|
|
3213
3210
|
}
|
|
3214
3211
|
}
|
|
@@ -3226,9 +3223,9 @@ const Methods = {
|
|
|
3226
3223
|
getRowById(cellValue) {
|
|
3227
3224
|
const $xeTable = this;
|
|
3228
3225
|
const internalData = $xeTable;
|
|
3229
|
-
const {
|
|
3226
|
+
const { fullAllDataRowIdData } = internalData;
|
|
3230
3227
|
const rowid = XEUtils.eqNull(cellValue) ? '' : encodeURIComponent(cellValue);
|
|
3231
|
-
return
|
|
3228
|
+
return fullAllDataRowIdData[rowid] ? fullAllDataRowIdData[rowid].row : null;
|
|
3232
3229
|
},
|
|
3233
3230
|
/**
|
|
3234
3231
|
* 根据行获取行的唯一主键
|
|
@@ -7459,11 +7456,12 @@ const Methods = {
|
|
|
7459
7456
|
const $xeTable = this;
|
|
7460
7457
|
const reactData = $xeTable;
|
|
7461
7458
|
const internalData = $xeTable;
|
|
7462
|
-
const tExpandedMaps = Object.assign({}, reactData.treeExpandedMaps);
|
|
7463
7459
|
const { fullAllDataRowIdData } = internalData;
|
|
7464
7460
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
7465
7461
|
const { transform } = treeOpts;
|
|
7462
|
+
let tExpandedMaps = {};
|
|
7466
7463
|
if (rows) {
|
|
7464
|
+
tExpandedMaps = Object.assign({}, reactData.treeExpandedMaps);
|
|
7467
7465
|
if (!XEUtils.isArray(rows)) {
|
|
7468
7466
|
rows = [rows];
|
|
7469
7467
|
}
|
|
@@ -7478,7 +7476,12 @@ const Methods = {
|
|
|
7478
7476
|
}
|
|
7479
7477
|
});
|
|
7480
7478
|
}
|
|
7481
|
-
|
|
7479
|
+
else {
|
|
7480
|
+
XEUtils.each(fullAllDataRowIdData, (rowRest) => {
|
|
7481
|
+
rowRest.treeLoaded = false;
|
|
7482
|
+
});
|
|
7483
|
+
}
|
|
7484
|
+
reactData.treeExpandedMaps = {};
|
|
7482
7485
|
if (transform) {
|
|
7483
7486
|
handleVirtualTreeToList($xeTable);
|
|
7484
7487
|
return $xeTable.handleTableData();
|
package/es/table/src/table.js
CHANGED
|
@@ -1113,7 +1113,7 @@ export default {
|
|
|
1113
1113
|
if (value && value.length >= 50000) {
|
|
1114
1114
|
warnLog('vxe.error.errLargeData', ['loadData(data), reloadData(data)']);
|
|
1115
1115
|
}
|
|
1116
|
-
this.loadTableData(value || [],
|
|
1116
|
+
this.loadTableData(value || [], false).then(() => {
|
|
1117
1117
|
const { scrollXLoad, scrollYLoad, expandColumn } = reactData;
|
|
1118
1118
|
const expandOpts = $xeTable.computeExpandOpts;
|
|
1119
1119
|
this.inited = true;
|
package/es/ui/index.js
CHANGED
package/es/ui/src/log.js
CHANGED