vxe-table 3.14.0-beta.6 → 3.14.0-beta.8
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/grid/src/grid.js +4 -0
- 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 +212 -78
- package/es/table/src/util.js +35 -5
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/grid/src/grid.js +4 -0
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.umd.js +299 -103
- 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 +241 -89
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/util.js +40 -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/grid/src/grid.ts +5 -0
- package/packages/table/src/body.ts +10 -5
- package/packages/table/src/footer.ts +7 -2
- package/packages/table/src/methods.ts +235 -85
- package/packages/table/src/util.ts +39 -5
- /package/es/{iconfont.1741224120026.ttf → iconfont.1741333630357.ttf} +0 -0
- /package/es/{iconfont.1741224120026.woff → iconfont.1741333630357.woff} +0 -0
- /package/es/{iconfont.1741224120026.woff2 → iconfont.1741333630357.woff2} +0 -0
- /package/lib/{iconfont.1741224120026.ttf → iconfont.1741333630357.ttf} +0 -0
- /package/lib/{iconfont.1741224120026.woff → iconfont.1741333630357.woff} +0 -0
- /package/lib/{iconfont.1741224120026.woff2 → iconfont.1741333630357.woff2} +0 -0
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.8";
|
|
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.8"}`;
|
|
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) {
|
|
@@ -3143,12 +3166,19 @@ function getCellHeight(height) {
|
|
|
3143
3166
|
}
|
|
3144
3167
|
return height || 0;
|
|
3145
3168
|
}
|
|
3146
|
-
function handleFieldOrColumn(
|
|
3169
|
+
function handleFieldOrColumn($xeTable, fieldOrColumn) {
|
|
3147
3170
|
if (fieldOrColumn) {
|
|
3148
|
-
return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(fieldOrColumn) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(fieldOrColumn) ?
|
|
3171
|
+
return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(fieldOrColumn) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(fieldOrColumn) ? $xeTable.getColumnByField(`${fieldOrColumn}`) : fieldOrColumn;
|
|
3149
3172
|
}
|
|
3150
3173
|
return null;
|
|
3151
3174
|
}
|
|
3175
|
+
const handleRowidOrRow = ($xeTable, rowidOrRow) => {
|
|
3176
|
+
if (rowidOrRow) {
|
|
3177
|
+
const rowid = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(rowidOrRow) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(rowidOrRow) ? rowidOrRow : getRowid($xeTable, rowidOrRow);
|
|
3178
|
+
return $xeTable.getRowById(rowid);
|
|
3179
|
+
}
|
|
3180
|
+
return null;
|
|
3181
|
+
};
|
|
3152
3182
|
// 组装列配置
|
|
3153
3183
|
function assembleColumn(_vm) {
|
|
3154
3184
|
const {
|
|
@@ -6029,6 +6059,7 @@ function handleCheckedAllCheckboxRow($xeTable, checked, isForce) {
|
|
|
6029
6059
|
reserve,
|
|
6030
6060
|
checkMethod
|
|
6031
6061
|
} = checkboxOpts;
|
|
6062
|
+
// indeterminateField 仅支持读取
|
|
6032
6063
|
const indeterminateField = checkboxOpts.indeterminateField || checkboxOpts.halfField;
|
|
6033
6064
|
const selectRowMaps = {};
|
|
6034
6065
|
/**
|
|
@@ -7695,6 +7726,10 @@ const Methods = {
|
|
|
7695
7726
|
}
|
|
7696
7727
|
return [];
|
|
7697
7728
|
},
|
|
7729
|
+
getEl() {
|
|
7730
|
+
const $xeTable = this;
|
|
7731
|
+
return $xeTable.$refs.refElem;
|
|
7732
|
+
},
|
|
7698
7733
|
/**
|
|
7699
7734
|
* 获取父容器元素
|
|
7700
7735
|
*/
|
|
@@ -8094,7 +8129,11 @@ const Methods = {
|
|
|
8094
8129
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
8095
8130
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
8096
8131
|
const hasChildField = treeOpts.hasChild || treeOpts.hasChildField;
|
|
8132
|
+
const {
|
|
8133
|
+
lazy
|
|
8134
|
+
} = treeOpts;
|
|
8097
8135
|
const rowkey = getRowkey($xeTable);
|
|
8136
|
+
const isDeepKey = rowkey.indexOf('.') > -1;
|
|
8098
8137
|
const fullAllDataRowIdMaps = {
|
|
8099
8138
|
...fullAllDataRowIdData
|
|
8100
8139
|
}; // 存在已删除数据
|
|
@@ -8102,26 +8141,9 @@ const Methods = {
|
|
|
8102
8141
|
const treeTempExpandedMaps = {
|
|
8103
8142
|
...treeExpandedMaps
|
|
8104
8143
|
};
|
|
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];
|
|
8144
|
+
const handleRowId = isDeepKey ? updateDeepRowKey : updateFastRowKey;
|
|
8145
|
+
const handleRowCache = (row, index, items, currIndex, parentRow, rowid, level, seq) => {
|
|
8146
|
+
let rowRest = fullAllDataRowIdMaps[rowid];
|
|
8125
8147
|
if (!rowRest) {
|
|
8126
8148
|
rowRest = {
|
|
8127
8149
|
row,
|
|
@@ -8139,6 +8161,8 @@ const Methods = {
|
|
|
8139
8161
|
oTop: 0,
|
|
8140
8162
|
expandHeight: 0
|
|
8141
8163
|
};
|
|
8164
|
+
fullDataRowIdMaps[rowid] = rowRest;
|
|
8165
|
+
fullAllDataRowIdMaps[rowid] = rowRest;
|
|
8142
8166
|
}
|
|
8143
8167
|
rowRest.treeLoaded = false;
|
|
8144
8168
|
rowRest.expandLoaded = false;
|
|
@@ -8146,16 +8170,31 @@ const Methods = {
|
|
|
8146
8170
|
rowRest.items = items;
|
|
8147
8171
|
rowRest.parent = parentRow;
|
|
8148
8172
|
rowRest.level = level;
|
|
8149
|
-
rowRest.index =
|
|
8150
|
-
|
|
8151
|
-
fullAllDataRowIdMaps[rowid] = rowRest;
|
|
8173
|
+
rowRest.index = currIndex;
|
|
8174
|
+
rowRest.treeIndex = index;
|
|
8152
8175
|
};
|
|
8153
8176
|
if (treeConfig) {
|
|
8154
|
-
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(tableFullTreeData,
|
|
8177
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(tableFullTreeData, (row, index, items, path, parentRow, nodes) => {
|
|
8178
|
+
const rowid = handleRowId(row, rowkey);
|
|
8179
|
+
if (treeConfig && lazy) {
|
|
8180
|
+
const treeExpRest = treeTempExpandedMaps[rowid];
|
|
8181
|
+
if (row[hasChildField] && row[childrenField] === undefined) {
|
|
8182
|
+
row[childrenField] = null;
|
|
8183
|
+
}
|
|
8184
|
+
if (treeExpRest) {
|
|
8185
|
+
if (!row[childrenField] || !row[childrenField].length) {
|
|
8186
|
+
delete treeTempExpandedMaps[rowid];
|
|
8187
|
+
}
|
|
8188
|
+
}
|
|
8189
|
+
}
|
|
8190
|
+
handleRowCache(row, index, items, parentRow ? -1 : index, parentRow, rowid, nodes.length - 1, toTreePathSeq(path));
|
|
8191
|
+
}, {
|
|
8155
8192
|
children: childrenField
|
|
8156
8193
|
});
|
|
8157
8194
|
} else {
|
|
8158
|
-
tableFullData.forEach(
|
|
8195
|
+
tableFullData.forEach((row, index, items) => {
|
|
8196
|
+
handleRowCache(row, index, items, index, null, handleRowId(row, rowkey), 0, index + 1);
|
|
8197
|
+
});
|
|
8159
8198
|
}
|
|
8160
8199
|
internalData.fullDataRowIdData = fullDataRowIdMaps;
|
|
8161
8200
|
internalData.fullAllDataRowIdData = fullAllDataRowIdMaps;
|
|
@@ -8783,25 +8822,31 @@ const Methods = {
|
|
|
8783
8822
|
},
|
|
8784
8823
|
/**
|
|
8785
8824
|
* 检查行或列数据是否发生改变
|
|
8786
|
-
* @param {Row}
|
|
8825
|
+
* @param {Row} rowOrId 行对象
|
|
8787
8826
|
* @param {String} field 字段名
|
|
8788
8827
|
*/
|
|
8789
|
-
isUpdateByRow(
|
|
8828
|
+
isUpdateByRow(rowOrId, field) {
|
|
8829
|
+
const $xeTable = this;
|
|
8830
|
+
const props = $xeTable;
|
|
8831
|
+
const internalData = $xeTable;
|
|
8832
|
+
const {
|
|
8833
|
+
keepSource
|
|
8834
|
+
} = props;
|
|
8790
8835
|
const {
|
|
8791
8836
|
tableFullColumn,
|
|
8792
|
-
|
|
8793
|
-
sourceDataRowIdData
|
|
8794
|
-
|
|
8795
|
-
} = this;
|
|
8837
|
+
fullDataRowIdData,
|
|
8838
|
+
sourceDataRowIdData
|
|
8839
|
+
} = internalData;
|
|
8796
8840
|
if (keepSource) {
|
|
8797
|
-
const rowid = getRowid(
|
|
8841
|
+
const rowid = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(rowOrId) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(rowOrId) ? rowOrId : getRowid($xeTable, rowOrId);
|
|
8842
|
+
const rowRest = fullDataRowIdData[rowid];
|
|
8798
8843
|
// 新增的数据不需要检测
|
|
8799
|
-
if (!
|
|
8844
|
+
if (!rowRest) {
|
|
8800
8845
|
return false;
|
|
8801
8846
|
}
|
|
8802
|
-
const
|
|
8803
|
-
|
|
8804
|
-
|
|
8847
|
+
const row = rowRest.row;
|
|
8848
|
+
const oRow = sourceDataRowIdData[rowid];
|
|
8849
|
+
if (oRow) {
|
|
8805
8850
|
if (arguments.length > 1) {
|
|
8806
8851
|
return !eqCellValue(oRow, row, field);
|
|
8807
8852
|
}
|
|
@@ -8863,6 +8908,113 @@ const Methods = {
|
|
|
8863
8908
|
tableColumn: this.tableColumn.slice(0)
|
|
8864
8909
|
};
|
|
8865
8910
|
},
|
|
8911
|
+
/**
|
|
8912
|
+
* 移动列到指定列的位置
|
|
8913
|
+
* @param fieldOrColumn
|
|
8914
|
+
* @param targetFieldOrColumn
|
|
8915
|
+
* @param options
|
|
8916
|
+
*/
|
|
8917
|
+
moveColumnTo(fieldOrColumn, targetFieldOrColumn, options) {
|
|
8918
|
+
const $xeTable = this;
|
|
8919
|
+
const internalData = $xeTable;
|
|
8920
|
+
const {
|
|
8921
|
+
fullColumnIdData,
|
|
8922
|
+
visibleColumn
|
|
8923
|
+
} = internalData;
|
|
8924
|
+
const {
|
|
8925
|
+
dragToChild,
|
|
8926
|
+
dragPos,
|
|
8927
|
+
isCrossDrag
|
|
8928
|
+
} = Object.assign({}, options);
|
|
8929
|
+
const dragCol = handleFieldOrColumn($xeTable, fieldOrColumn);
|
|
8930
|
+
let prevDragCol = null;
|
|
8931
|
+
const colRest = dragCol ? fullColumnIdData[dragCol.id] : null;
|
|
8932
|
+
let defPos = 'left';
|
|
8933
|
+
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(targetFieldOrColumn)) {
|
|
8934
|
+
if (colRest && targetFieldOrColumn) {
|
|
8935
|
+
let currList = colRest.items;
|
|
8936
|
+
let offsetIndex = colRest._index + targetFieldOrColumn;
|
|
8937
|
+
if (isCrossDrag) {
|
|
8938
|
+
currList = visibleColumn;
|
|
8939
|
+
offsetIndex = colRest._index + targetFieldOrColumn;
|
|
8940
|
+
}
|
|
8941
|
+
if (offsetIndex > 0 && offsetIndex < currList.length - 1) {
|
|
8942
|
+
prevDragCol = currList[offsetIndex];
|
|
8943
|
+
}
|
|
8944
|
+
if (targetFieldOrColumn > 0) {
|
|
8945
|
+
defPos = 'right';
|
|
8946
|
+
}
|
|
8947
|
+
}
|
|
8948
|
+
} else {
|
|
8949
|
+
prevDragCol = handleFieldOrColumn($xeTable, targetFieldOrColumn);
|
|
8950
|
+
const targetColRest = prevDragCol ? fullColumnIdData[prevDragCol.id] : null;
|
|
8951
|
+
if (colRest && targetColRest) {
|
|
8952
|
+
if (targetColRest._index > colRest._index) {
|
|
8953
|
+
defPos = 'right';
|
|
8954
|
+
}
|
|
8955
|
+
}
|
|
8956
|
+
}
|
|
8957
|
+
return $xeTable.handleColDragSwapEvent(null, true, dragCol, prevDragCol, dragPos || defPos, dragToChild === true);
|
|
8958
|
+
},
|
|
8959
|
+
/**
|
|
8960
|
+
* 移动行到指定行的位置
|
|
8961
|
+
* @param rowidOrRow
|
|
8962
|
+
* @param targetRowidOrRow
|
|
8963
|
+
* @param options
|
|
8964
|
+
*/
|
|
8965
|
+
moveRowTo(rowidOrRow, targetRowidOrRow, options) {
|
|
8966
|
+
const $xeTable = this;
|
|
8967
|
+
const props = $xeTable;
|
|
8968
|
+
const internalData = $xeTable;
|
|
8969
|
+
const {
|
|
8970
|
+
treeConfig
|
|
8971
|
+
} = props;
|
|
8972
|
+
const {
|
|
8973
|
+
fullAllDataRowIdData,
|
|
8974
|
+
afterFullData
|
|
8975
|
+
} = internalData;
|
|
8976
|
+
const {
|
|
8977
|
+
dragToChild,
|
|
8978
|
+
dragPos,
|
|
8979
|
+
isCrossDrag
|
|
8980
|
+
} = Object.assign({}, options);
|
|
8981
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
8982
|
+
const dragRow = handleRowidOrRow($xeTable, rowidOrRow);
|
|
8983
|
+
let prevDragRow = null;
|
|
8984
|
+
let defPos = 'top';
|
|
8985
|
+
const rowRest = dragRow ? fullAllDataRowIdData[getRowid($xeTable, dragRow)] : null;
|
|
8986
|
+
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(targetRowidOrRow)) {
|
|
8987
|
+
if (rowRest && targetRowidOrRow) {
|
|
8988
|
+
let currList = afterFullData;
|
|
8989
|
+
let offsetIndex = rowRest._index + targetRowidOrRow;
|
|
8990
|
+
if (treeConfig) {
|
|
8991
|
+
currList = rowRest.items;
|
|
8992
|
+
if (treeOpts.transform) {
|
|
8993
|
+
offsetIndex = rowRest.treeIndex + targetRowidOrRow;
|
|
8994
|
+
if (isCrossDrag) {
|
|
8995
|
+
currList = afterFullData;
|
|
8996
|
+
offsetIndex = rowRest._index + targetRowidOrRow;
|
|
8997
|
+
}
|
|
8998
|
+
}
|
|
8999
|
+
}
|
|
9000
|
+
if (offsetIndex >= 0 && offsetIndex <= currList.length - 1) {
|
|
9001
|
+
prevDragRow = currList[offsetIndex];
|
|
9002
|
+
}
|
|
9003
|
+
if (targetRowidOrRow > 0) {
|
|
9004
|
+
defPos = 'bottom';
|
|
9005
|
+
}
|
|
9006
|
+
}
|
|
9007
|
+
} else {
|
|
9008
|
+
prevDragRow = handleRowidOrRow($xeTable, targetRowidOrRow);
|
|
9009
|
+
const targetRowRest = prevDragRow ? fullAllDataRowIdData[getRowid($xeTable, prevDragRow)] : null;
|
|
9010
|
+
if (rowRest && targetRowRest) {
|
|
9011
|
+
if (targetRowRest._index > rowRest._index) {
|
|
9012
|
+
defPos = 'bottom';
|
|
9013
|
+
}
|
|
9014
|
+
}
|
|
9015
|
+
}
|
|
9016
|
+
return $xeTable.handleRowDragSwapEvent(null, true, dragRow, prevDragRow, dragPos || defPos, dragToChild === true);
|
|
9017
|
+
},
|
|
8866
9018
|
/**
|
|
8867
9019
|
* 获取表格的全量列
|
|
8868
9020
|
*/
|
|
@@ -8885,16 +9037,26 @@ const Methods = {
|
|
|
8885
9037
|
* 用于多选行,获取已选中的数据
|
|
8886
9038
|
*/
|
|
8887
9039
|
getCheckboxRecords(isFull) {
|
|
9040
|
+
const $xeTable = this;
|
|
9041
|
+
const props = $xeTable;
|
|
9042
|
+
const reactData = $xeTable;
|
|
9043
|
+
const internalData = $xeTable;
|
|
9044
|
+
const {
|
|
9045
|
+
treeConfig
|
|
9046
|
+
} = props;
|
|
9047
|
+
const {
|
|
9048
|
+
selectCheckboxMaps
|
|
9049
|
+
} = reactData;
|
|
8888
9050
|
const {
|
|
8889
9051
|
tableFullData,
|
|
8890
9052
|
afterFullData,
|
|
8891
|
-
treeConfig,
|
|
8892
|
-
treeOpts,
|
|
8893
|
-
checkboxOpts,
|
|
8894
|
-
tableFullTreeData,
|
|
8895
9053
|
afterTreeFullData,
|
|
9054
|
+
tableFullTreeData,
|
|
9055
|
+
fullDataRowIdData,
|
|
8896
9056
|
afterFullRowMaps
|
|
8897
|
-
} =
|
|
9057
|
+
} = internalData;
|
|
9058
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
9059
|
+
const checkboxOpts = $xeTable.computeCheckboxOpts;
|
|
8898
9060
|
const {
|
|
8899
9061
|
transform,
|
|
8900
9062
|
mapChildrenField
|
|
@@ -8903,21 +9065,18 @@ const Methods = {
|
|
|
8903
9065
|
checkField
|
|
8904
9066
|
} = checkboxOpts;
|
|
8905
9067
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
8906
|
-
const currTableData = isFull ? transform ? tableFullTreeData : tableFullData : transform ? afterTreeFullData : afterFullData;
|
|
8907
9068
|
let rowList = [];
|
|
8908
9069
|
if (checkField) {
|
|
8909
9070
|
if (treeConfig) {
|
|
9071
|
+
const currTableData = isFull ? transform ? tableFullTreeData : tableFullData : transform ? afterTreeFullData : afterFullData;
|
|
8910
9072
|
rowList = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().filterTree(currTableData, row => external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, checkField), {
|
|
8911
9073
|
children: transform ? mapChildrenField : childrenField
|
|
8912
9074
|
});
|
|
8913
9075
|
} else {
|
|
9076
|
+
const currTableData = isFull ? tableFullData : afterFullData;
|
|
8914
9077
|
rowList = currTableData.filter(row => external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, checkField));
|
|
8915
9078
|
}
|
|
8916
9079
|
} else {
|
|
8917
|
-
const {
|
|
8918
|
-
selectCheckboxMaps,
|
|
8919
|
-
fullDataRowIdData
|
|
8920
|
-
} = this;
|
|
8921
9080
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(selectCheckboxMaps, (row, rowid) => {
|
|
8922
9081
|
if (isFull) {
|
|
8923
9082
|
if (fullDataRowIdData[rowid]) {
|
|
@@ -11397,6 +11556,7 @@ const Methods = {
|
|
|
11397
11556
|
checkStrictly,
|
|
11398
11557
|
checkMethod
|
|
11399
11558
|
} = checkboxOpts;
|
|
11559
|
+
// indeterminateField 仅支持读取
|
|
11400
11560
|
const indeterminateField = checkboxOpts.indeterminateField || checkboxOpts.halfField;
|
|
11401
11561
|
if (checkField) {
|
|
11402
11562
|
// 树结构
|
|
@@ -11923,6 +12083,7 @@ const Methods = {
|
|
|
11923
12083
|
reserve
|
|
11924
12084
|
} = checkboxOpts;
|
|
11925
12085
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
12086
|
+
// indeterminateField 仅支持读取
|
|
11926
12087
|
const indeterminateField = checkboxOpts.indeterminateField || checkboxOpts.halfField;
|
|
11927
12088
|
if (checkField) {
|
|
11928
12089
|
const handleClearChecked = item => {
|
|
@@ -12696,6 +12857,9 @@ const Methods = {
|
|
|
12696
12857
|
} = internalData;
|
|
12697
12858
|
const dEndMethod = dragEndMethod || (dragConfig ? dragConfig.dragEndMethod : null);
|
|
12698
12859
|
const dragOffsetIndex = prevDragPos === 'bottom' ? 1 : 0;
|
|
12860
|
+
const errRest = {
|
|
12861
|
+
status: false
|
|
12862
|
+
};
|
|
12699
12863
|
if (prevDragRow && dragRow) {
|
|
12700
12864
|
// 判断是否有拖动
|
|
12701
12865
|
if (prevDragRow !== dragRow) {
|
|
@@ -12710,7 +12874,7 @@ const Methods = {
|
|
|
12710
12874
|
const isDragToChildFlag = isSelfToChildDrag && dragToChildMethod ? dragToChildMethod(dragParams) : prevDragToChild;
|
|
12711
12875
|
return Promise.resolve(dEndMethod ? dEndMethod(dragParams) : true).then(status => {
|
|
12712
12876
|
if (!status) {
|
|
12713
|
-
return;
|
|
12877
|
+
return errRest;
|
|
12714
12878
|
}
|
|
12715
12879
|
let oafIndex = -1;
|
|
12716
12880
|
let nafIndex = -1;
|
|
@@ -12741,11 +12905,11 @@ const Methods = {
|
|
|
12741
12905
|
if (isPeerDrag && !isCrossDrag) {
|
|
12742
12906
|
if (oldRest.row[parentField] !== newRest.row[parentField]) {
|
|
12743
12907
|
// 非同级
|
|
12744
|
-
return;
|
|
12908
|
+
return errRest;
|
|
12745
12909
|
}
|
|
12746
12910
|
} else {
|
|
12747
12911
|
if (!isCrossDrag) {
|
|
12748
|
-
return;
|
|
12912
|
+
return errRest;
|
|
12749
12913
|
}
|
|
12750
12914
|
if (oldAllMaps[newRowid]) {
|
|
12751
12915
|
isSelfToChildStatus = true;
|
|
@@ -12756,19 +12920,19 @@ const Methods = {
|
|
|
12756
12920
|
content: methods_getI18n('vxe.error.treeDragChild')
|
|
12757
12921
|
});
|
|
12758
12922
|
}
|
|
12759
|
-
return;
|
|
12923
|
+
return errRest;
|
|
12760
12924
|
}
|
|
12761
12925
|
}
|
|
12762
12926
|
}
|
|
12763
12927
|
} else if (oldLevel) {
|
|
12764
12928
|
// 子到根
|
|
12765
12929
|
if (!isCrossDrag) {
|
|
12766
|
-
return;
|
|
12930
|
+
return errRest;
|
|
12767
12931
|
}
|
|
12768
12932
|
} else if (newLevel) {
|
|
12769
12933
|
// 根到子
|
|
12770
12934
|
if (!isCrossDrag) {
|
|
12771
|
-
return;
|
|
12935
|
+
return errRest;
|
|
12772
12936
|
}
|
|
12773
12937
|
if (oldAllMaps[newRowid]) {
|
|
12774
12938
|
isSelfToChildStatus = true;
|
|
@@ -12779,7 +12943,7 @@ const Methods = {
|
|
|
12779
12943
|
content: methods_getI18n('vxe.error.treeDragChild')
|
|
12780
12944
|
});
|
|
12781
12945
|
}
|
|
12782
|
-
return;
|
|
12946
|
+
return errRest;
|
|
12783
12947
|
}
|
|
12784
12948
|
}
|
|
12785
12949
|
} else {
|
|
@@ -12837,26 +13001,34 @@ const Methods = {
|
|
|
12837
13001
|
if (reactData.scrollYLoad) {
|
|
12838
13002
|
$xeTable.updateScrollYSpace();
|
|
12839
13003
|
}
|
|
12840
|
-
|
|
13004
|
+
if (evnt) {
|
|
13005
|
+
$xeTable.dispatchEvent('row-dragend', {
|
|
13006
|
+
oldRow: dragRow,
|
|
13007
|
+
newRow: prevDragRow,
|
|
13008
|
+
dragRow,
|
|
13009
|
+
dragPos: prevDragPos,
|
|
13010
|
+
dragToChild: isDragToChildFlag,
|
|
13011
|
+
offsetIndex: dragOffsetIndex,
|
|
13012
|
+
_index: {
|
|
13013
|
+
newIndex: nafIndex,
|
|
13014
|
+
oldIndex: oafIndex
|
|
13015
|
+
}
|
|
13016
|
+
}, evnt);
|
|
13017
|
+
}
|
|
13018
|
+
return $xeTable.$nextTick().then(() => {
|
|
12841
13019
|
$xeTable.updateCellAreas();
|
|
12842
13020
|
$xeTable.recalculate();
|
|
13021
|
+
}).then(() => {
|
|
13022
|
+
return {
|
|
13023
|
+
status: true
|
|
13024
|
+
};
|
|
12843
13025
|
});
|
|
12844
|
-
|
|
12845
|
-
|
|
12846
|
-
|
|
12847
|
-
dragRow,
|
|
12848
|
-
dragPos: prevDragPos,
|
|
12849
|
-
dragToChild: isDragToChildFlag,
|
|
12850
|
-
offsetIndex: dragOffsetIndex,
|
|
12851
|
-
_index: {
|
|
12852
|
-
newIndex: nafIndex,
|
|
12853
|
-
oldIndex: oafIndex
|
|
12854
|
-
}
|
|
12855
|
-
}, evnt);
|
|
12856
|
-
}).catch(() => {});
|
|
13026
|
+
}).catch(() => {
|
|
13027
|
+
return errRest;
|
|
13028
|
+
});
|
|
12857
13029
|
}
|
|
12858
13030
|
}
|
|
12859
|
-
return Promise.resolve();
|
|
13031
|
+
return Promise.resolve(errRest);
|
|
12860
13032
|
},
|
|
12861
13033
|
handleRowDragDragendEvent(evnt) {
|
|
12862
13034
|
const $xeTable = this;
|
|
@@ -13042,6 +13214,9 @@ const Methods = {
|
|
|
13042
13214
|
collectColumn
|
|
13043
13215
|
} = internalData;
|
|
13044
13216
|
const dragOffsetIndex = prevDragPos === 'right' ? 1 : 0;
|
|
13217
|
+
const errRest = {
|
|
13218
|
+
status: false
|
|
13219
|
+
};
|
|
13045
13220
|
if (prevDragCol && dragCol) {
|
|
13046
13221
|
// 判断是否有拖动
|
|
13047
13222
|
if (prevDragCol !== dragCol) {
|
|
@@ -13058,7 +13233,7 @@ const Methods = {
|
|
|
13058
13233
|
const isDragToChildFlag = isSelfToChildDrag && dragToChildMethod ? dragToChildMethod(dragParams) : prevDragToChild;
|
|
13059
13234
|
return Promise.resolve(dragEndMethod ? dragEndMethod(dragParams) : true).then(status => {
|
|
13060
13235
|
if (!status) {
|
|
13061
|
-
return;
|
|
13236
|
+
return errRest;
|
|
13062
13237
|
}
|
|
13063
13238
|
let oafIndex = -1;
|
|
13064
13239
|
let nafIndex = -1;
|
|
@@ -13072,11 +13247,11 @@ const Methods = {
|
|
|
13072
13247
|
if (isPeerDrag && !isCrossDrag) {
|
|
13073
13248
|
if (dragColumn.parentId !== newColumn.parentId) {
|
|
13074
13249
|
// 非同级
|
|
13075
|
-
return;
|
|
13250
|
+
return errRest;
|
|
13076
13251
|
}
|
|
13077
13252
|
} else {
|
|
13078
13253
|
if (!isCrossDrag) {
|
|
13079
|
-
return;
|
|
13254
|
+
return errRest;
|
|
13080
13255
|
}
|
|
13081
13256
|
if (oldAllMaps[newColumn.id]) {
|
|
13082
13257
|
isSelfToChildStatus = true;
|
|
@@ -13087,19 +13262,19 @@ const Methods = {
|
|
|
13087
13262
|
content: methods_getI18n('vxe.error.treeDragChild')
|
|
13088
13263
|
});
|
|
13089
13264
|
}
|
|
13090
|
-
return;
|
|
13265
|
+
return errRest;
|
|
13091
13266
|
}
|
|
13092
13267
|
}
|
|
13093
13268
|
}
|
|
13094
13269
|
} else if (dragColumn.parentId) {
|
|
13095
13270
|
// 子到根
|
|
13096
13271
|
if (!isCrossDrag) {
|
|
13097
|
-
return;
|
|
13272
|
+
return errRest;
|
|
13098
13273
|
}
|
|
13099
13274
|
} else if (newColumn.parentId) {
|
|
13100
13275
|
// 根到子
|
|
13101
13276
|
if (!isCrossDrag) {
|
|
13102
|
-
return;
|
|
13277
|
+
return errRest;
|
|
13103
13278
|
}
|
|
13104
13279
|
if (oldAllMaps[newColumn.id]) {
|
|
13105
13280
|
isSelfToChildStatus = true;
|
|
@@ -13110,7 +13285,7 @@ const Methods = {
|
|
|
13110
13285
|
content: methods_getI18n('vxe.error.treeDragChild')
|
|
13111
13286
|
});
|
|
13112
13287
|
}
|
|
13113
|
-
return;
|
|
13288
|
+
return errRest;
|
|
13114
13289
|
}
|
|
13115
13290
|
}
|
|
13116
13291
|
} else {
|
|
@@ -13179,25 +13354,32 @@ const Methods = {
|
|
|
13179
13354
|
$xeTable.clearCopyCellArea();
|
|
13180
13355
|
}
|
|
13181
13356
|
}
|
|
13182
|
-
|
|
13183
|
-
|
|
13184
|
-
|
|
13185
|
-
|
|
13186
|
-
|
|
13187
|
-
|
|
13188
|
-
|
|
13189
|
-
|
|
13190
|
-
|
|
13191
|
-
|
|
13192
|
-
|
|
13193
|
-
|
|
13357
|
+
if (evnt) {
|
|
13358
|
+
$xeTable.dispatchEvent('column-dragend', {
|
|
13359
|
+
oldColumn: dragColumn,
|
|
13360
|
+
newColumn,
|
|
13361
|
+
dragColumn,
|
|
13362
|
+
dragPos: prevDragPos,
|
|
13363
|
+
dragToChild: isDragToChildFlag,
|
|
13364
|
+
offsetIndex: dragOffsetIndex,
|
|
13365
|
+
_index: {
|
|
13366
|
+
newIndex: nafIndex,
|
|
13367
|
+
oldIndex: oafIndex
|
|
13368
|
+
}
|
|
13369
|
+
}, evnt);
|
|
13370
|
+
}
|
|
13194
13371
|
if (isSyncColumn) {
|
|
13195
13372
|
$xeTable.handleColDragSwapColumn();
|
|
13196
13373
|
}
|
|
13197
|
-
|
|
13374
|
+
return {
|
|
13375
|
+
status: true
|
|
13376
|
+
};
|
|
13377
|
+
}).catch(() => {
|
|
13378
|
+
return errRest;
|
|
13379
|
+
});
|
|
13198
13380
|
}
|
|
13199
13381
|
}
|
|
13200
|
-
return Promise.resolve();
|
|
13382
|
+
return Promise.resolve(errRest);
|
|
13201
13383
|
},
|
|
13202
13384
|
handleHeaderCellDragDragendEvent(evnt) {
|
|
13203
13385
|
const $xeTable = this;
|
|
@@ -15895,6 +16077,7 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
|
|
|
15895
16077
|
tdOns.dblclick = evnt => {
|
|
15896
16078
|
$xeTable.triggerCellDblclickEvent(evnt, cellParams);
|
|
15897
16079
|
};
|
|
16080
|
+
let isMergeCell = false;
|
|
15898
16081
|
// 合并行或列
|
|
15899
16082
|
if (mergeList.length) {
|
|
15900
16083
|
const spanRest = mergeBodyMethod(mergeList, _rowIndex, _columnIndex);
|
|
@@ -15907,9 +16090,11 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
|
|
|
15907
16090
|
return null;
|
|
15908
16091
|
}
|
|
15909
16092
|
if (rowspan > 1) {
|
|
16093
|
+
isMergeCell = true;
|
|
15910
16094
|
tdAttrs.rowspan = rowspan;
|
|
15911
16095
|
}
|
|
15912
16096
|
if (colspan > 1) {
|
|
16097
|
+
isMergeCell = true;
|
|
15913
16098
|
tdAttrs.colspan = colspan;
|
|
15914
16099
|
}
|
|
15915
16100
|
}
|
|
@@ -15944,11 +16129,13 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
|
|
|
15944
16129
|
const isLastColumn = $columnIndex === columns.length - 1;
|
|
15945
16130
|
const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto');
|
|
15946
16131
|
let isVNPreEmptyStatus = false;
|
|
15947
|
-
if (!
|
|
15948
|
-
if (
|
|
15949
|
-
|
|
15950
|
-
|
|
15951
|
-
|
|
16132
|
+
if (!isMergeCell) {
|
|
16133
|
+
if (!dragRow || getRowid($xeTable, dragRow) !== rowid) {
|
|
16134
|
+
if (scrollYLoad && (_rowIndex < scrollYStore.visibleStartIndex - scrollYStore.preloadSize || _rowIndex > scrollYStore.visibleEndIndex + scrollYStore.preloadSize)) {
|
|
16135
|
+
isVNPreEmptyStatus = true;
|
|
16136
|
+
} else if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
|
|
16137
|
+
isVNPreEmptyStatus = true;
|
|
16138
|
+
}
|
|
15952
16139
|
}
|
|
15953
16140
|
}
|
|
15954
16141
|
const tcStyle = {};
|
|
@@ -17164,6 +17351,7 @@ function footer_renderRows(h, _vm, tableColumn, footerTableData, row, $rowIndex,
|
|
|
17164
17351
|
cell: evnt.currentTarget
|
|
17165
17352
|
}, cellParams), evnt);
|
|
17166
17353
|
};
|
|
17354
|
+
let isMergeCell = false;
|
|
17167
17355
|
// 合并行或列
|
|
17168
17356
|
if (mergeFooterList.length) {
|
|
17169
17357
|
const spanRest = mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex);
|
|
@@ -17176,9 +17364,11 @@ function footer_renderRows(h, _vm, tableColumn, footerTableData, row, $rowIndex,
|
|
|
17176
17364
|
return null;
|
|
17177
17365
|
}
|
|
17178
17366
|
if (rowspan > 1) {
|
|
17367
|
+
isMergeCell = true;
|
|
17179
17368
|
attrs.rowspan = rowspan;
|
|
17180
17369
|
}
|
|
17181
17370
|
if (colspan > 1) {
|
|
17371
|
+
isMergeCell = true;
|
|
17182
17372
|
attrs.colspan = colspan;
|
|
17183
17373
|
}
|
|
17184
17374
|
}
|
|
@@ -17201,8 +17391,10 @@ function footer_renderRows(h, _vm, tableColumn, footerTableData, row, $rowIndex,
|
|
|
17201
17391
|
const isLastColumn = $columnIndex === tableColumn.length - 1;
|
|
17202
17392
|
const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto');
|
|
17203
17393
|
let isVNPreEmptyStatus = false;
|
|
17204
|
-
if (
|
|
17205
|
-
|
|
17394
|
+
if (!isMergeCell) {
|
|
17395
|
+
if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
|
|
17396
|
+
isVNPreEmptyStatus = true;
|
|
17397
|
+
}
|
|
17206
17398
|
}
|
|
17207
17399
|
const tcStyle = {};
|
|
17208
17400
|
if (hasEllipsis) {
|
|
@@ -28722,6 +28914,10 @@ Object.keys(table.methods).forEach(name => {
|
|
|
28722
28914
|
}
|
|
28723
28915
|
return [];
|
|
28724
28916
|
},
|
|
28917
|
+
getEl() {
|
|
28918
|
+
const $xeGrid = this;
|
|
28919
|
+
return $xeGrid.$refs.refElem;
|
|
28920
|
+
},
|
|
28725
28921
|
/**
|
|
28726
28922
|
* 获取需要排除的高度
|
|
28727
28923
|
*/
|