vxe-table 3.14.0-beta.5 → 3.14.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/methods.js +47 -45
- package/es/table/src/util.js +26 -3
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/index.umd.js +92 -54
- 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/methods.js +47 -42
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/util.js +29 -3
- 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/methods.ts +49 -44
- package/packages/table/src/util.ts +29 -3
- /package/es/{iconfont.1741176404780.ttf → iconfont.1741265532675.ttf} +0 -0
- /package/es/{iconfont.1741176404780.woff → iconfont.1741265532675.woff} +0 -0
- /package/es/{iconfont.1741176404780.woff2 → iconfont.1741265532675.woff2} +0 -0
- /package/lib/{iconfont.1741176404780.ttf → iconfont.1741265532675.ttf} +0 -0
- /package/lib/{iconfont.1741176404780.woff → iconfont.1741265532675.woff} +0 -0
- /package/lib/{iconfont.1741176404780.woff2 → iconfont.1741265532675.woff2} +0 -0
package/es/table/src/footer.js
CHANGED
|
@@ -100,6 +100,7 @@ function renderRows(h, _vm, tableColumn, footerTableData, row, $rowIndex, _rowIn
|
|
|
100
100
|
tfOns.dblclick = (evnt) => {
|
|
101
101
|
$xeTable.dispatchEvent('footer-cell-dblclick', Object.assign({ cell: evnt.currentTarget }, cellParams), evnt);
|
|
102
102
|
};
|
|
103
|
+
let isMergeCell = false;
|
|
103
104
|
// 合并行或列
|
|
104
105
|
if (mergeFooterList.length) {
|
|
105
106
|
const spanRest = mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex);
|
|
@@ -109,9 +110,11 @@ function renderRows(h, _vm, tableColumn, footerTableData, row, $rowIndex, _rowIn
|
|
|
109
110
|
return null;
|
|
110
111
|
}
|
|
111
112
|
if (rowspan > 1) {
|
|
113
|
+
isMergeCell = true;
|
|
112
114
|
attrs.rowspan = rowspan;
|
|
113
115
|
}
|
|
114
116
|
if (colspan > 1) {
|
|
117
|
+
isMergeCell = true;
|
|
115
118
|
attrs.colspan = colspan;
|
|
116
119
|
}
|
|
117
120
|
}
|
|
@@ -132,8 +135,10 @@ function renderRows(h, _vm, tableColumn, footerTableData, row, $rowIndex, _rowIn
|
|
|
132
135
|
const isLastColumn = $columnIndex === tableColumn.length - 1;
|
|
133
136
|
const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto');
|
|
134
137
|
let isVNPreEmptyStatus = false;
|
|
135
|
-
if (
|
|
136
|
-
|
|
138
|
+
if (!isMergeCell) {
|
|
139
|
+
if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
|
|
140
|
+
isVNPreEmptyStatus = true;
|
|
141
|
+
}
|
|
137
142
|
}
|
|
138
143
|
const tcStyle = {};
|
|
139
144
|
if (hasEllipsis) {
|
package/es/table/src/methods.js
CHANGED
|
@@ -3,7 +3,7 @@ import { browse, getTpImg, isPx, isScale, hasClass, addClass, removeClass, getEv
|
|
|
3
3
|
import { getLastZIndex, nextZIndex, hasChildrenList, getFuncText, isEnableConf, formatText, eqEmptyValue } from '../../ui/src/utils';
|
|
4
4
|
import { VxeUI } from '../../ui';
|
|
5
5
|
import Cell from './cell';
|
|
6
|
-
import { getRowUniqueId, clearTableAllStatus, getRowkey, getRowid, rowToVisible, colToVisible, getCellValue, setCellValue, handleFieldOrColumn, toTreePathSeq, restoreScrollLocation, getRootColumn, getColReMinWidth, getRefElem } from './util';
|
|
6
|
+
import { getRowUniqueId, clearTableAllStatus, getRowkey, getRowid, rowToVisible, colToVisible, getCellValue, setCellValue, handleFieldOrColumn, toTreePathSeq, restoreScrollLocation, getRootColumn, getColReMinWidth, updateDeepRowKey, updateFastRowKey, getRefElem } from './util';
|
|
7
7
|
import { getSlotVNs } from '../../ui/src/vn';
|
|
8
8
|
import { warnLog, errLog } from '../../ui/src/log';
|
|
9
9
|
const { getConfig, getI18n, renderer, formats, interceptor, createEvent } = VxeUI;
|
|
@@ -2628,32 +2628,19 @@ const Methods = {
|
|
|
2628
2628
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
2629
2629
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
2630
2630
|
const hasChildField = treeOpts.hasChild || treeOpts.hasChildField;
|
|
2631
|
+
const { lazy } = treeOpts;
|
|
2631
2632
|
const rowkey = getRowkey($xeTable);
|
|
2633
|
+
const isDeepKey = rowkey.indexOf('.') > -1;
|
|
2632
2634
|
const fullAllDataRowIdMaps = Object.assign({}, fullAllDataRowIdData); // 存在已删除数据
|
|
2633
2635
|
const fullDataRowIdMaps = {};
|
|
2634
2636
|
const treeTempExpandedMaps = Object.assign({}, treeExpandedMaps);
|
|
2635
|
-
const
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
const level = nodes ? nodes.length - 1 : 0;
|
|
2639
|
-
if (eqEmptyValue(rowid)) {
|
|
2640
|
-
rowid = getRowUniqueId();
|
|
2641
|
-
XEUtils.set(row, rowkey, rowid);
|
|
2642
|
-
}
|
|
2643
|
-
if (treeConfig && treeOpts.lazy) {
|
|
2644
|
-
const treeExpRest = treeExpandedMaps[rowid];
|
|
2645
|
-
if (row[hasChildField] && XEUtils.isUndefined(row[childrenField])) {
|
|
2646
|
-
row[childrenField] = null;
|
|
2647
|
-
}
|
|
2648
|
-
if (treeExpRest) {
|
|
2649
|
-
if (!row[childrenField] || !row[childrenField].length) {
|
|
2650
|
-
delete treeTempExpandedMaps[rowid];
|
|
2651
|
-
}
|
|
2652
|
-
}
|
|
2653
|
-
}
|
|
2654
|
-
let rowRest = fullAllDataRowIdData[rowid];
|
|
2637
|
+
const handleRowId = isDeepKey ? updateDeepRowKey : updateFastRowKey;
|
|
2638
|
+
const handleRowCache = (row, index, items, currIndex, parentRow, rowid, level, seq) => {
|
|
2639
|
+
let rowRest = fullAllDataRowIdMaps[rowid];
|
|
2655
2640
|
if (!rowRest) {
|
|
2656
2641
|
rowRest = { row, rowid, seq, index: -1, _index: -1, $index: -1, treeIndex: index, items, parent: parentRow, level, height: 0, resizeHeight: 0, oTop: 0, expandHeight: 0 };
|
|
2642
|
+
fullDataRowIdMaps[rowid] = rowRest;
|
|
2643
|
+
fullAllDataRowIdMaps[rowid] = rowRest;
|
|
2657
2644
|
}
|
|
2658
2645
|
rowRest.treeLoaded = false;
|
|
2659
2646
|
rowRest.expandLoaded = false;
|
|
@@ -2661,15 +2648,30 @@ const Methods = {
|
|
|
2661
2648
|
rowRest.items = items;
|
|
2662
2649
|
rowRest.parent = parentRow;
|
|
2663
2650
|
rowRest.level = level;
|
|
2664
|
-
rowRest.index =
|
|
2665
|
-
|
|
2666
|
-
fullAllDataRowIdMaps[rowid] = rowRest;
|
|
2651
|
+
rowRest.index = currIndex;
|
|
2652
|
+
rowRest.treeIndex = index;
|
|
2667
2653
|
};
|
|
2668
2654
|
if (treeConfig) {
|
|
2669
|
-
XEUtils.eachTree(tableFullTreeData,
|
|
2655
|
+
XEUtils.eachTree(tableFullTreeData, (row, index, items, path, parentRow, nodes) => {
|
|
2656
|
+
const rowid = handleRowId(row, rowkey);
|
|
2657
|
+
if (treeConfig && lazy) {
|
|
2658
|
+
const treeExpRest = treeTempExpandedMaps[rowid];
|
|
2659
|
+
if (row[hasChildField] && row[childrenField] === undefined) {
|
|
2660
|
+
row[childrenField] = null;
|
|
2661
|
+
}
|
|
2662
|
+
if (treeExpRest) {
|
|
2663
|
+
if (!row[childrenField] || !row[childrenField].length) {
|
|
2664
|
+
delete treeTempExpandedMaps[rowid];
|
|
2665
|
+
}
|
|
2666
|
+
}
|
|
2667
|
+
}
|
|
2668
|
+
handleRowCache(row, index, items, parentRow ? -1 : index, parentRow, rowid, nodes.length - 1, toTreePathSeq(path));
|
|
2669
|
+
}, { children: childrenField });
|
|
2670
2670
|
}
|
|
2671
2671
|
else {
|
|
2672
|
-
tableFullData.forEach(
|
|
2672
|
+
tableFullData.forEach((row, index, items) => {
|
|
2673
|
+
handleRowCache(row, index, items, index, null, handleRowId(row, rowkey), 0, index + 1);
|
|
2674
|
+
});
|
|
2673
2675
|
}
|
|
2674
2676
|
internalData.fullDataRowIdData = fullDataRowIdMaps;
|
|
2675
2677
|
internalData.fullAllDataRowIdData = fullAllDataRowIdMaps;
|
|
@@ -2998,12 +3000,12 @@ const Methods = {
|
|
|
2998
3000
|
const reactData = $xeTable;
|
|
2999
3001
|
const internalData = $xeTable;
|
|
3000
3002
|
const { keepSource, treeConfig } = props;
|
|
3001
|
-
const { fullAllDataRowIdData, tableSourceData, sourceDataRowIdData, tableFullData, afterFullData } = internalData;
|
|
3003
|
+
const { fullAllDataRowIdData, fullDataRowIdData, tableSourceData, sourceDataRowIdData, tableFullData, afterFullData } = internalData;
|
|
3002
3004
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
3003
3005
|
const { transform } = treeOpts;
|
|
3004
3006
|
if (!keepSource) {
|
|
3005
3007
|
if (process.env.NODE_ENV === 'development') {
|
|
3006
|
-
|
|
3008
|
+
errLog('vxe.error.reqProp', ['keep-source']);
|
|
3007
3009
|
}
|
|
3008
3010
|
return $xeTable.$nextTick();
|
|
3009
3011
|
}
|
|
@@ -3018,23 +3020,23 @@ const Methods = {
|
|
|
3018
3020
|
}
|
|
3019
3021
|
let reDelFlag = false;
|
|
3020
3022
|
if (targetRows.length) {
|
|
3021
|
-
targetRows.forEach((
|
|
3022
|
-
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
|
-
|
|
3028
|
-
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
|
|
3036
|
-
tableFullData.unshift(
|
|
3037
|
-
afterFullData.unshift(
|
|
3023
|
+
targetRows.forEach((item) => {
|
|
3024
|
+
const rowid = getRowid($xeTable, item);
|
|
3025
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
3026
|
+
if (rowRest) {
|
|
3027
|
+
const row = rowRest.row;
|
|
3028
|
+
if (!$xeTable.isInsertByRow(row)) {
|
|
3029
|
+
const oRow = sourceDataRowIdData[rowid];
|
|
3030
|
+
if (oRow && row) {
|
|
3031
|
+
if (field) {
|
|
3032
|
+
XEUtils.set(row, field, XEUtils.clone(XEUtils.get(oRow, field), true));
|
|
3033
|
+
}
|
|
3034
|
+
else {
|
|
3035
|
+
XEUtils.destructuring(row, XEUtils.clone(oRow, true));
|
|
3036
|
+
}
|
|
3037
|
+
if (!fullDataRowIdData[rowid] && $xeTable.isRemoveByRow(row)) {
|
|
3038
|
+
tableFullData.unshift(row);
|
|
3039
|
+
afterFullData.unshift(row);
|
|
3038
3040
|
reDelFlag = true;
|
|
3039
3041
|
}
|
|
3040
3042
|
}
|
package/es/table/src/util.js
CHANGED
|
@@ -2,6 +2,7 @@ import XEUtils from 'xe-utils';
|
|
|
2
2
|
import { ColumnInfo } from './columnInfo';
|
|
3
3
|
import { isScale, isPx } from '../../ui/src/dom';
|
|
4
4
|
import { warnLog, errLog } from '../../ui/src/log';
|
|
5
|
+
import { eqEmptyValue } from '../../ui/src/utils';
|
|
5
6
|
const getAllConvertColumns = (columns, parentColumn) => {
|
|
6
7
|
const result = [];
|
|
7
8
|
columns.forEach((column) => {
|
|
@@ -90,13 +91,35 @@ export function getRowUniqueId() {
|
|
|
90
91
|
return XEUtils.uniqueId('row_');
|
|
91
92
|
}
|
|
92
93
|
// 行主键 key
|
|
93
|
-
export function getRowkey($
|
|
94
|
-
|
|
94
|
+
export function getRowkey($xeTable) {
|
|
95
|
+
const props = $xeTable;
|
|
96
|
+
const rowOpts = $xeTable.computeRowOpts;
|
|
97
|
+
return `${props.rowId || rowOpts.keyField || '_X_ROW_KEY'}`;
|
|
95
98
|
}
|
|
96
99
|
// 行主键 value
|
|
97
100
|
export function getRowid($xetable, row) {
|
|
98
101
|
const rowid = XEUtils.get(row, getRowkey($xetable));
|
|
99
|
-
return
|
|
102
|
+
return encodeRowid(rowid);
|
|
103
|
+
}
|
|
104
|
+
// 编码行主键
|
|
105
|
+
export function encodeRowid(rowVal) {
|
|
106
|
+
return XEUtils.eqNull(rowVal) ? '' : encodeURIComponent(rowVal);
|
|
107
|
+
}
|
|
108
|
+
export function updateDeepRowKey(row, rowkey) {
|
|
109
|
+
let rowid = XEUtils.get(row, rowkey);
|
|
110
|
+
if (eqEmptyValue(rowid)) {
|
|
111
|
+
rowid = getRowUniqueId();
|
|
112
|
+
XEUtils.set(row, rowkey, rowid);
|
|
113
|
+
}
|
|
114
|
+
return rowid;
|
|
115
|
+
}
|
|
116
|
+
export function updateFastRowKey(row, rowkey) {
|
|
117
|
+
let rowid = row[rowkey];
|
|
118
|
+
if (eqEmptyValue(rowid)) {
|
|
119
|
+
rowid = getRowUniqueId();
|
|
120
|
+
row[rowkey] = rowid;
|
|
121
|
+
}
|
|
122
|
+
return rowid;
|
|
100
123
|
}
|
|
101
124
|
function getPaddingLeftRightSize(elem) {
|
|
102
125
|
if (elem) {
|
package/es/ui/index.js
CHANGED
package/es/ui/src/log.js
CHANGED
package/lib/index.umd.js
CHANGED
|
@@ -2220,7 +2220,7 @@ function getClass(property, params) {
|
|
|
2220
2220
|
;// CONCATENATED MODULE: ./packages/ui/index.ts
|
|
2221
2221
|
|
|
2222
2222
|
|
|
2223
|
-
const version = "3.14.0-beta.
|
|
2223
|
+
const version = "3.14.0-beta.7";
|
|
2224
2224
|
core_.VxeUI.version = version;
|
|
2225
2225
|
core_.VxeUI.tableVersion = version;
|
|
2226
2226
|
core_.VxeUI.setConfig({
|
|
@@ -2843,7 +2843,7 @@ function isNodeElement(elem) {
|
|
|
2843
2843
|
const {
|
|
2844
2844
|
log: log_log
|
|
2845
2845
|
} = core_.VxeUI;
|
|
2846
|
-
const log_version = `table v${"3.14.0-beta.
|
|
2846
|
+
const log_version = `table v${"3.14.0-beta.7"}`;
|
|
2847
2847
|
const warnLog = log_log.create('warn', log_version);
|
|
2848
2848
|
const errLog = log_log.create('error', log_version);
|
|
2849
2849
|
;// CONCATENATED MODULE: ./packages/table/src/columnInfo.ts
|
|
@@ -3026,6 +3026,7 @@ class ColumnInfo {
|
|
|
3026
3026
|
|
|
3027
3027
|
|
|
3028
3028
|
|
|
3029
|
+
|
|
3029
3030
|
const getAllConvertColumns = (columns, parentColumn) => {
|
|
3030
3031
|
const result = [];
|
|
3031
3032
|
columns.forEach(column => {
|
|
@@ -3111,13 +3112,35 @@ function getRowUniqueId() {
|
|
|
3111
3112
|
return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().uniqueId('row_');
|
|
3112
3113
|
}
|
|
3113
3114
|
// 行主键 key
|
|
3114
|
-
function getRowkey($
|
|
3115
|
-
|
|
3115
|
+
function getRowkey($xeTable) {
|
|
3116
|
+
const props = $xeTable;
|
|
3117
|
+
const rowOpts = $xeTable.computeRowOpts;
|
|
3118
|
+
return `${props.rowId || rowOpts.keyField || '_X_ROW_KEY'}`;
|
|
3116
3119
|
}
|
|
3117
3120
|
// 行主键 value
|
|
3118
3121
|
function getRowid($xetable, row) {
|
|
3119
3122
|
const rowid = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, getRowkey($xetable));
|
|
3120
|
-
return
|
|
3123
|
+
return encodeRowid(rowid);
|
|
3124
|
+
}
|
|
3125
|
+
// 编码行主键
|
|
3126
|
+
function encodeRowid(rowVal) {
|
|
3127
|
+
return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(rowVal) ? '' : encodeURIComponent(rowVal);
|
|
3128
|
+
}
|
|
3129
|
+
function updateDeepRowKey(row, rowkey) {
|
|
3130
|
+
let rowid = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, rowkey);
|
|
3131
|
+
if (eqEmptyValue(rowid)) {
|
|
3132
|
+
rowid = getRowUniqueId();
|
|
3133
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(row, rowkey, rowid);
|
|
3134
|
+
}
|
|
3135
|
+
return rowid;
|
|
3136
|
+
}
|
|
3137
|
+
function updateFastRowKey(row, rowkey) {
|
|
3138
|
+
let rowid = row[rowkey];
|
|
3139
|
+
if (eqEmptyValue(rowid)) {
|
|
3140
|
+
rowid = getRowUniqueId();
|
|
3141
|
+
row[rowkey] = rowid;
|
|
3142
|
+
}
|
|
3143
|
+
return rowid;
|
|
3121
3144
|
}
|
|
3122
3145
|
function getPaddingLeftRightSize(elem) {
|
|
3123
3146
|
if (elem) {
|
|
@@ -8094,7 +8117,11 @@ const Methods = {
|
|
|
8094
8117
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
8095
8118
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
8096
8119
|
const hasChildField = treeOpts.hasChild || treeOpts.hasChildField;
|
|
8120
|
+
const {
|
|
8121
|
+
lazy
|
|
8122
|
+
} = treeOpts;
|
|
8097
8123
|
const rowkey = getRowkey($xeTable);
|
|
8124
|
+
const isDeepKey = rowkey.indexOf('.') > -1;
|
|
8098
8125
|
const fullAllDataRowIdMaps = {
|
|
8099
8126
|
...fullAllDataRowIdData
|
|
8100
8127
|
}; // 存在已删除数据
|
|
@@ -8102,26 +8129,9 @@ const Methods = {
|
|
|
8102
8129
|
const treeTempExpandedMaps = {
|
|
8103
8130
|
...treeExpandedMaps
|
|
8104
8131
|
};
|
|
8105
|
-
const
|
|
8106
|
-
|
|
8107
|
-
|
|
8108
|
-
const level = nodes ? nodes.length - 1 : 0;
|
|
8109
|
-
if (eqEmptyValue(rowid)) {
|
|
8110
|
-
rowid = getRowUniqueId();
|
|
8111
|
-
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(row, rowkey, rowid);
|
|
8112
|
-
}
|
|
8113
|
-
if (treeConfig && treeOpts.lazy) {
|
|
8114
|
-
const treeExpRest = treeExpandedMaps[rowid];
|
|
8115
|
-
if (row[hasChildField] && external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isUndefined(row[childrenField])) {
|
|
8116
|
-
row[childrenField] = null;
|
|
8117
|
-
}
|
|
8118
|
-
if (treeExpRest) {
|
|
8119
|
-
if (!row[childrenField] || !row[childrenField].length) {
|
|
8120
|
-
delete treeTempExpandedMaps[rowid];
|
|
8121
|
-
}
|
|
8122
|
-
}
|
|
8123
|
-
}
|
|
8124
|
-
let rowRest = fullAllDataRowIdData[rowid];
|
|
8132
|
+
const handleRowId = isDeepKey ? updateDeepRowKey : updateFastRowKey;
|
|
8133
|
+
const handleRowCache = (row, index, items, currIndex, parentRow, rowid, level, seq) => {
|
|
8134
|
+
let rowRest = fullAllDataRowIdMaps[rowid];
|
|
8125
8135
|
if (!rowRest) {
|
|
8126
8136
|
rowRest = {
|
|
8127
8137
|
row,
|
|
@@ -8139,6 +8149,8 @@ const Methods = {
|
|
|
8139
8149
|
oTop: 0,
|
|
8140
8150
|
expandHeight: 0
|
|
8141
8151
|
};
|
|
8152
|
+
fullDataRowIdMaps[rowid] = rowRest;
|
|
8153
|
+
fullAllDataRowIdMaps[rowid] = rowRest;
|
|
8142
8154
|
}
|
|
8143
8155
|
rowRest.treeLoaded = false;
|
|
8144
8156
|
rowRest.expandLoaded = false;
|
|
@@ -8146,16 +8158,31 @@ const Methods = {
|
|
|
8146
8158
|
rowRest.items = items;
|
|
8147
8159
|
rowRest.parent = parentRow;
|
|
8148
8160
|
rowRest.level = level;
|
|
8149
|
-
rowRest.index =
|
|
8150
|
-
|
|
8151
|
-
fullAllDataRowIdMaps[rowid] = rowRest;
|
|
8161
|
+
rowRest.index = currIndex;
|
|
8162
|
+
rowRest.treeIndex = index;
|
|
8152
8163
|
};
|
|
8153
8164
|
if (treeConfig) {
|
|
8154
|
-
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(tableFullTreeData,
|
|
8165
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(tableFullTreeData, (row, index, items, path, parentRow, nodes) => {
|
|
8166
|
+
const rowid = handleRowId(row, rowkey);
|
|
8167
|
+
if (treeConfig && lazy) {
|
|
8168
|
+
const treeExpRest = treeTempExpandedMaps[rowid];
|
|
8169
|
+
if (row[hasChildField] && row[childrenField] === undefined) {
|
|
8170
|
+
row[childrenField] = null;
|
|
8171
|
+
}
|
|
8172
|
+
if (treeExpRest) {
|
|
8173
|
+
if (!row[childrenField] || !row[childrenField].length) {
|
|
8174
|
+
delete treeTempExpandedMaps[rowid];
|
|
8175
|
+
}
|
|
8176
|
+
}
|
|
8177
|
+
}
|
|
8178
|
+
handleRowCache(row, index, items, parentRow ? -1 : index, parentRow, rowid, nodes.length - 1, toTreePathSeq(path));
|
|
8179
|
+
}, {
|
|
8155
8180
|
children: childrenField
|
|
8156
8181
|
});
|
|
8157
8182
|
} else {
|
|
8158
|
-
tableFullData.forEach(
|
|
8183
|
+
tableFullData.forEach((row, index, items) => {
|
|
8184
|
+
handleRowCache(row, index, items, index, null, handleRowId(row, rowkey), 0, index + 1);
|
|
8185
|
+
});
|
|
8159
8186
|
}
|
|
8160
8187
|
internalData.fullDataRowIdData = fullDataRowIdMaps;
|
|
8161
8188
|
internalData.fullAllDataRowIdData = fullAllDataRowIdMaps;
|
|
@@ -8553,6 +8580,7 @@ const Methods = {
|
|
|
8553
8580
|
} = props;
|
|
8554
8581
|
const {
|
|
8555
8582
|
fullAllDataRowIdData,
|
|
8583
|
+
fullDataRowIdData,
|
|
8556
8584
|
tableSourceData,
|
|
8557
8585
|
sourceDataRowIdData,
|
|
8558
8586
|
tableFullData,
|
|
@@ -8564,7 +8592,7 @@ const Methods = {
|
|
|
8564
8592
|
} = treeOpts;
|
|
8565
8593
|
if (!keepSource) {
|
|
8566
8594
|
if (true) {
|
|
8567
|
-
|
|
8595
|
+
errLog('vxe.error.reqProp', ['keep-source']);
|
|
8568
8596
|
}
|
|
8569
8597
|
return $xeTable.$nextTick();
|
|
8570
8598
|
}
|
|
@@ -8578,22 +8606,22 @@ const Methods = {
|
|
|
8578
8606
|
}
|
|
8579
8607
|
let reDelFlag = false;
|
|
8580
8608
|
if (targetRows.length) {
|
|
8581
|
-
targetRows.forEach(
|
|
8582
|
-
|
|
8583
|
-
|
|
8584
|
-
|
|
8585
|
-
|
|
8586
|
-
|
|
8587
|
-
|
|
8588
|
-
|
|
8589
|
-
|
|
8590
|
-
|
|
8591
|
-
|
|
8592
|
-
|
|
8593
|
-
|
|
8594
|
-
|
|
8595
|
-
tableFullData.unshift(
|
|
8596
|
-
afterFullData.unshift(
|
|
8609
|
+
targetRows.forEach(item => {
|
|
8610
|
+
const rowid = getRowid($xeTable, item);
|
|
8611
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
8612
|
+
if (rowRest) {
|
|
8613
|
+
const row = rowRest.row;
|
|
8614
|
+
if (!$xeTable.isInsertByRow(row)) {
|
|
8615
|
+
const oRow = sourceDataRowIdData[rowid];
|
|
8616
|
+
if (oRow && row) {
|
|
8617
|
+
if (field) {
|
|
8618
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(row, field, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().clone(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(oRow, field), true));
|
|
8619
|
+
} else {
|
|
8620
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().destructuring(row, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().clone(oRow, true));
|
|
8621
|
+
}
|
|
8622
|
+
if (!fullDataRowIdData[rowid] && $xeTable.isRemoveByRow(row)) {
|
|
8623
|
+
tableFullData.unshift(row);
|
|
8624
|
+
afterFullData.unshift(row);
|
|
8597
8625
|
reDelFlag = true;
|
|
8598
8626
|
}
|
|
8599
8627
|
}
|
|
@@ -15894,6 +15922,7 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
|
|
|
15894
15922
|
tdOns.dblclick = evnt => {
|
|
15895
15923
|
$xeTable.triggerCellDblclickEvent(evnt, cellParams);
|
|
15896
15924
|
};
|
|
15925
|
+
let isMergeCell = false;
|
|
15897
15926
|
// 合并行或列
|
|
15898
15927
|
if (mergeList.length) {
|
|
15899
15928
|
const spanRest = mergeBodyMethod(mergeList, _rowIndex, _columnIndex);
|
|
@@ -15906,9 +15935,11 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
|
|
|
15906
15935
|
return null;
|
|
15907
15936
|
}
|
|
15908
15937
|
if (rowspan > 1) {
|
|
15938
|
+
isMergeCell = true;
|
|
15909
15939
|
tdAttrs.rowspan = rowspan;
|
|
15910
15940
|
}
|
|
15911
15941
|
if (colspan > 1) {
|
|
15942
|
+
isMergeCell = true;
|
|
15912
15943
|
tdAttrs.colspan = colspan;
|
|
15913
15944
|
}
|
|
15914
15945
|
}
|
|
@@ -15943,11 +15974,13 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
|
|
|
15943
15974
|
const isLastColumn = $columnIndex === columns.length - 1;
|
|
15944
15975
|
const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto');
|
|
15945
15976
|
let isVNPreEmptyStatus = false;
|
|
15946
|
-
if (!
|
|
15947
|
-
if (
|
|
15948
|
-
|
|
15949
|
-
|
|
15950
|
-
|
|
15977
|
+
if (!isMergeCell) {
|
|
15978
|
+
if (!dragRow || getRowid($xeTable, dragRow) !== rowid) {
|
|
15979
|
+
if (scrollYLoad && (_rowIndex < scrollYStore.visibleStartIndex - scrollYStore.preloadSize || _rowIndex > scrollYStore.visibleEndIndex + scrollYStore.preloadSize)) {
|
|
15980
|
+
isVNPreEmptyStatus = true;
|
|
15981
|
+
} else if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
|
|
15982
|
+
isVNPreEmptyStatus = true;
|
|
15983
|
+
}
|
|
15951
15984
|
}
|
|
15952
15985
|
}
|
|
15953
15986
|
const tcStyle = {};
|
|
@@ -17163,6 +17196,7 @@ function footer_renderRows(h, _vm, tableColumn, footerTableData, row, $rowIndex,
|
|
|
17163
17196
|
cell: evnt.currentTarget
|
|
17164
17197
|
}, cellParams), evnt);
|
|
17165
17198
|
};
|
|
17199
|
+
let isMergeCell = false;
|
|
17166
17200
|
// 合并行或列
|
|
17167
17201
|
if (mergeFooterList.length) {
|
|
17168
17202
|
const spanRest = mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex);
|
|
@@ -17175,9 +17209,11 @@ function footer_renderRows(h, _vm, tableColumn, footerTableData, row, $rowIndex,
|
|
|
17175
17209
|
return null;
|
|
17176
17210
|
}
|
|
17177
17211
|
if (rowspan > 1) {
|
|
17212
|
+
isMergeCell = true;
|
|
17178
17213
|
attrs.rowspan = rowspan;
|
|
17179
17214
|
}
|
|
17180
17215
|
if (colspan > 1) {
|
|
17216
|
+
isMergeCell = true;
|
|
17181
17217
|
attrs.colspan = colspan;
|
|
17182
17218
|
}
|
|
17183
17219
|
}
|
|
@@ -17200,8 +17236,10 @@ function footer_renderRows(h, _vm, tableColumn, footerTableData, row, $rowIndex,
|
|
|
17200
17236
|
const isLastColumn = $columnIndex === tableColumn.length - 1;
|
|
17201
17237
|
const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto');
|
|
17202
17238
|
let isVNPreEmptyStatus = false;
|
|
17203
|
-
if (
|
|
17204
|
-
|
|
17239
|
+
if (!isMergeCell) {
|
|
17240
|
+
if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
|
|
17241
|
+
isVNPreEmptyStatus = true;
|
|
17242
|
+
}
|
|
17205
17243
|
}
|
|
17206
17244
|
const tcStyle = {};
|
|
17207
17245
|
if (hasEllipsis) {
|