vxe-table 3.14.0-beta.7 → 3.14.0-beta.9
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 +17 -8
- package/es/style.css +1 -1
- package/es/table/src/methods.js +202 -64
- package/es/table/src/util.js +9 -2
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/grid/src/grid.js +17 -8
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.umd.js +263 -89
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/src/methods.js +233 -77
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/util.js +11 -2
- 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 +18 -8
- package/packages/table/src/methods.ts +224 -71
- package/packages/table/src/util.ts +10 -2
- /package/es/{iconfont.1741265532675.ttf → iconfont.1741336976538.ttf} +0 -0
- /package/es/{iconfont.1741265532675.woff → iconfont.1741336976538.woff} +0 -0
- /package/es/{iconfont.1741265532675.woff2 → iconfont.1741336976538.woff2} +0 -0
- /package/lib/{iconfont.1741265532675.ttf → iconfont.1741336976538.ttf} +0 -0
- /package/lib/{iconfont.1741265532675.woff → iconfont.1741336976538.woff} +0 -0
- /package/lib/{iconfont.1741265532675.woff2 → iconfont.1741336976538.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.9";
|
|
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.9"}`;
|
|
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
|
|
@@ -3166,12 +3166,19 @@ function getCellHeight(height) {
|
|
|
3166
3166
|
}
|
|
3167
3167
|
return height || 0;
|
|
3168
3168
|
}
|
|
3169
|
-
function handleFieldOrColumn(
|
|
3169
|
+
function handleFieldOrColumn($xeTable, fieldOrColumn) {
|
|
3170
3170
|
if (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) ?
|
|
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;
|
|
3172
3172
|
}
|
|
3173
3173
|
return null;
|
|
3174
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
|
+
};
|
|
3175
3182
|
// 组装列配置
|
|
3176
3183
|
function assembleColumn(_vm) {
|
|
3177
3184
|
const {
|
|
@@ -6052,6 +6059,7 @@ function handleCheckedAllCheckboxRow($xeTable, checked, isForce) {
|
|
|
6052
6059
|
reserve,
|
|
6053
6060
|
checkMethod
|
|
6054
6061
|
} = checkboxOpts;
|
|
6062
|
+
// indeterminateField 仅支持读取
|
|
6055
6063
|
const indeterminateField = checkboxOpts.indeterminateField || checkboxOpts.halfField;
|
|
6056
6064
|
const selectRowMaps = {};
|
|
6057
6065
|
/**
|
|
@@ -7718,6 +7726,10 @@ const Methods = {
|
|
|
7718
7726
|
}
|
|
7719
7727
|
return [];
|
|
7720
7728
|
},
|
|
7729
|
+
getEl() {
|
|
7730
|
+
const $xeTable = this;
|
|
7731
|
+
return $xeTable.$refs.refElem;
|
|
7732
|
+
},
|
|
7721
7733
|
/**
|
|
7722
7734
|
* 获取父容器元素
|
|
7723
7735
|
*/
|
|
@@ -8149,8 +8161,6 @@ const Methods = {
|
|
|
8149
8161
|
oTop: 0,
|
|
8150
8162
|
expandHeight: 0
|
|
8151
8163
|
};
|
|
8152
|
-
fullDataRowIdMaps[rowid] = rowRest;
|
|
8153
|
-
fullAllDataRowIdMaps[rowid] = rowRest;
|
|
8154
8164
|
}
|
|
8155
8165
|
rowRest.treeLoaded = false;
|
|
8156
8166
|
rowRest.expandLoaded = false;
|
|
@@ -8160,6 +8170,8 @@ const Methods = {
|
|
|
8160
8170
|
rowRest.level = level;
|
|
8161
8171
|
rowRest.index = currIndex;
|
|
8162
8172
|
rowRest.treeIndex = index;
|
|
8173
|
+
fullDataRowIdMaps[rowid] = rowRest;
|
|
8174
|
+
fullAllDataRowIdMaps[rowid] = rowRest;
|
|
8163
8175
|
};
|
|
8164
8176
|
if (treeConfig) {
|
|
8165
8177
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(tableFullTreeData, (row, index, items, path, parentRow, nodes) => {
|
|
@@ -8189,24 +8201,26 @@ const Methods = {
|
|
|
8189
8201
|
reactData.treeExpandedMaps = treeTempExpandedMaps;
|
|
8190
8202
|
},
|
|
8191
8203
|
cacheSourceMap(fullData) {
|
|
8204
|
+
const $xeTable = this;
|
|
8205
|
+
const props = $xeTable;
|
|
8206
|
+
const internalData = $xeTable;
|
|
8207
|
+
const {
|
|
8208
|
+
treeConfig
|
|
8209
|
+
} = props;
|
|
8210
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
8192
8211
|
let {
|
|
8193
|
-
treeConfig,
|
|
8194
|
-
treeOpts,
|
|
8195
8212
|
sourceDataRowIdData
|
|
8196
|
-
} =
|
|
8213
|
+
} = internalData;
|
|
8197
8214
|
const sourceData = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().clone(fullData, true);
|
|
8198
|
-
const rowkey = getRowkey(
|
|
8199
|
-
sourceDataRowIdData =
|
|
8215
|
+
const rowkey = getRowkey($xeTable);
|
|
8216
|
+
sourceDataRowIdData = internalData.sourceDataRowIdData = {};
|
|
8200
8217
|
const handleSourceRow = row => {
|
|
8201
|
-
let rowid = getRowid(
|
|
8218
|
+
let rowid = getRowid($xeTable, row);
|
|
8202
8219
|
if (eqEmptyValue(rowid)) {
|
|
8203
8220
|
rowid = getRowUniqueId();
|
|
8204
8221
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(row, rowkey, rowid);
|
|
8205
8222
|
}
|
|
8206
|
-
sourceDataRowIdData[rowid] =
|
|
8207
|
-
row,
|
|
8208
|
-
rowid
|
|
8209
|
-
};
|
|
8223
|
+
sourceDataRowIdData[rowid] = row;
|
|
8210
8224
|
};
|
|
8211
8225
|
// 源数据缓存
|
|
8212
8226
|
if (treeConfig) {
|
|
@@ -8217,7 +8231,7 @@ const Methods = {
|
|
|
8217
8231
|
} else {
|
|
8218
8232
|
sourceData.forEach(handleSourceRow);
|
|
8219
8233
|
}
|
|
8220
|
-
|
|
8234
|
+
internalData.tableSourceData = sourceData;
|
|
8221
8235
|
},
|
|
8222
8236
|
getParams() {
|
|
8223
8237
|
return this.params;
|
|
@@ -8578,6 +8592,9 @@ const Methods = {
|
|
|
8578
8592
|
keepSource,
|
|
8579
8593
|
treeConfig
|
|
8580
8594
|
} = props;
|
|
8595
|
+
const {
|
|
8596
|
+
editStore
|
|
8597
|
+
} = reactData;
|
|
8581
8598
|
const {
|
|
8582
8599
|
fullAllDataRowIdData,
|
|
8583
8600
|
fullDataRowIdData,
|
|
@@ -8586,6 +8603,9 @@ const Methods = {
|
|
|
8586
8603
|
tableFullData,
|
|
8587
8604
|
afterFullData
|
|
8588
8605
|
} = internalData;
|
|
8606
|
+
const removeTempMaps = {
|
|
8607
|
+
...editStore.removeMaps
|
|
8608
|
+
};
|
|
8589
8609
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
8590
8610
|
const {
|
|
8591
8611
|
transform
|
|
@@ -8620,6 +8640,7 @@ const Methods = {
|
|
|
8620
8640
|
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
8641
|
}
|
|
8622
8642
|
if (!fullDataRowIdData[rowid] && $xeTable.isRemoveByRow(row)) {
|
|
8643
|
+
delete removeTempMaps[rowid];
|
|
8623
8644
|
tableFullData.unshift(row);
|
|
8624
8645
|
afterFullData.unshift(row);
|
|
8625
8646
|
reDelFlag = true;
|
|
@@ -8631,6 +8652,7 @@ const Methods = {
|
|
|
8631
8652
|
}
|
|
8632
8653
|
if (rows) {
|
|
8633
8654
|
if (reDelFlag) {
|
|
8655
|
+
editStore.removeMaps = removeTempMaps;
|
|
8634
8656
|
$xeTable.updateFooter();
|
|
8635
8657
|
$xeTable.cacheRowMap(false);
|
|
8636
8658
|
$xeTable.handleTableData(treeConfig && transform);
|
|
@@ -8810,25 +8832,31 @@ const Methods = {
|
|
|
8810
8832
|
},
|
|
8811
8833
|
/**
|
|
8812
8834
|
* 检查行或列数据是否发生改变
|
|
8813
|
-
* @param {Row}
|
|
8835
|
+
* @param {Row} rowOrId 行对象
|
|
8814
8836
|
* @param {String} field 字段名
|
|
8815
8837
|
*/
|
|
8816
|
-
isUpdateByRow(
|
|
8838
|
+
isUpdateByRow(rowOrId, field) {
|
|
8839
|
+
const $xeTable = this;
|
|
8840
|
+
const props = $xeTable;
|
|
8841
|
+
const internalData = $xeTable;
|
|
8842
|
+
const {
|
|
8843
|
+
keepSource
|
|
8844
|
+
} = props;
|
|
8817
8845
|
const {
|
|
8818
8846
|
tableFullColumn,
|
|
8819
|
-
|
|
8820
|
-
sourceDataRowIdData
|
|
8821
|
-
|
|
8822
|
-
} = this;
|
|
8847
|
+
fullDataRowIdData,
|
|
8848
|
+
sourceDataRowIdData
|
|
8849
|
+
} = internalData;
|
|
8823
8850
|
if (keepSource) {
|
|
8824
|
-
const rowid = getRowid(
|
|
8851
|
+
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);
|
|
8852
|
+
const rowRest = fullDataRowIdData[rowid];
|
|
8825
8853
|
// 新增的数据不需要检测
|
|
8826
|
-
if (!
|
|
8854
|
+
if (!rowRest) {
|
|
8827
8855
|
return false;
|
|
8828
8856
|
}
|
|
8829
|
-
const
|
|
8830
|
-
|
|
8831
|
-
|
|
8857
|
+
const row = rowRest.row;
|
|
8858
|
+
const oRow = sourceDataRowIdData[rowid];
|
|
8859
|
+
if (oRow) {
|
|
8832
8860
|
if (arguments.length > 1) {
|
|
8833
8861
|
return !eqCellValue(oRow, row, field);
|
|
8834
8862
|
}
|
|
@@ -8890,6 +8918,113 @@ const Methods = {
|
|
|
8890
8918
|
tableColumn: this.tableColumn.slice(0)
|
|
8891
8919
|
};
|
|
8892
8920
|
},
|
|
8921
|
+
/**
|
|
8922
|
+
* 移动列到指定列的位置
|
|
8923
|
+
* @param fieldOrColumn
|
|
8924
|
+
* @param targetFieldOrColumn
|
|
8925
|
+
* @param options
|
|
8926
|
+
*/
|
|
8927
|
+
moveColumnTo(fieldOrColumn, targetFieldOrColumn, options) {
|
|
8928
|
+
const $xeTable = this;
|
|
8929
|
+
const internalData = $xeTable;
|
|
8930
|
+
const {
|
|
8931
|
+
fullColumnIdData,
|
|
8932
|
+
visibleColumn
|
|
8933
|
+
} = internalData;
|
|
8934
|
+
const {
|
|
8935
|
+
dragToChild,
|
|
8936
|
+
dragPos,
|
|
8937
|
+
isCrossDrag
|
|
8938
|
+
} = Object.assign({}, options);
|
|
8939
|
+
const dragCol = handleFieldOrColumn($xeTable, fieldOrColumn);
|
|
8940
|
+
let prevDragCol = null;
|
|
8941
|
+
const colRest = dragCol ? fullColumnIdData[dragCol.id] : null;
|
|
8942
|
+
let defPos = 'left';
|
|
8943
|
+
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(targetFieldOrColumn)) {
|
|
8944
|
+
if (colRest && targetFieldOrColumn) {
|
|
8945
|
+
let currList = colRest.items;
|
|
8946
|
+
let offsetIndex = colRest._index + targetFieldOrColumn;
|
|
8947
|
+
if (isCrossDrag) {
|
|
8948
|
+
currList = visibleColumn;
|
|
8949
|
+
offsetIndex = colRest._index + targetFieldOrColumn;
|
|
8950
|
+
}
|
|
8951
|
+
if (offsetIndex > 0 && offsetIndex < currList.length - 1) {
|
|
8952
|
+
prevDragCol = currList[offsetIndex];
|
|
8953
|
+
}
|
|
8954
|
+
if (targetFieldOrColumn > 0) {
|
|
8955
|
+
defPos = 'right';
|
|
8956
|
+
}
|
|
8957
|
+
}
|
|
8958
|
+
} else {
|
|
8959
|
+
prevDragCol = handleFieldOrColumn($xeTable, targetFieldOrColumn);
|
|
8960
|
+
const targetColRest = prevDragCol ? fullColumnIdData[prevDragCol.id] : null;
|
|
8961
|
+
if (colRest && targetColRest) {
|
|
8962
|
+
if (targetColRest._index > colRest._index) {
|
|
8963
|
+
defPos = 'right';
|
|
8964
|
+
}
|
|
8965
|
+
}
|
|
8966
|
+
}
|
|
8967
|
+
return $xeTable.handleColDragSwapEvent(null, true, dragCol, prevDragCol, dragPos || defPos, dragToChild === true);
|
|
8968
|
+
},
|
|
8969
|
+
/**
|
|
8970
|
+
* 移动行到指定行的位置
|
|
8971
|
+
* @param rowidOrRow
|
|
8972
|
+
* @param targetRowidOrRow
|
|
8973
|
+
* @param options
|
|
8974
|
+
*/
|
|
8975
|
+
moveRowTo(rowidOrRow, targetRowidOrRow, options) {
|
|
8976
|
+
const $xeTable = this;
|
|
8977
|
+
const props = $xeTable;
|
|
8978
|
+
const internalData = $xeTable;
|
|
8979
|
+
const {
|
|
8980
|
+
treeConfig
|
|
8981
|
+
} = props;
|
|
8982
|
+
const {
|
|
8983
|
+
fullAllDataRowIdData,
|
|
8984
|
+
afterFullData
|
|
8985
|
+
} = internalData;
|
|
8986
|
+
const {
|
|
8987
|
+
dragToChild,
|
|
8988
|
+
dragPos,
|
|
8989
|
+
isCrossDrag
|
|
8990
|
+
} = Object.assign({}, options);
|
|
8991
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
8992
|
+
const dragRow = handleRowidOrRow($xeTable, rowidOrRow);
|
|
8993
|
+
let prevDragRow = null;
|
|
8994
|
+
let defPos = 'top';
|
|
8995
|
+
const rowRest = dragRow ? fullAllDataRowIdData[getRowid($xeTable, dragRow)] : null;
|
|
8996
|
+
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(targetRowidOrRow)) {
|
|
8997
|
+
if (rowRest && targetRowidOrRow) {
|
|
8998
|
+
let currList = afterFullData;
|
|
8999
|
+
let offsetIndex = rowRest._index + targetRowidOrRow;
|
|
9000
|
+
if (treeConfig) {
|
|
9001
|
+
currList = rowRest.items;
|
|
9002
|
+
if (treeOpts.transform) {
|
|
9003
|
+
offsetIndex = rowRest.treeIndex + targetRowidOrRow;
|
|
9004
|
+
if (isCrossDrag) {
|
|
9005
|
+
currList = afterFullData;
|
|
9006
|
+
offsetIndex = rowRest._index + targetRowidOrRow;
|
|
9007
|
+
}
|
|
9008
|
+
}
|
|
9009
|
+
}
|
|
9010
|
+
if (offsetIndex >= 0 && offsetIndex <= currList.length - 1) {
|
|
9011
|
+
prevDragRow = currList[offsetIndex];
|
|
9012
|
+
}
|
|
9013
|
+
if (targetRowidOrRow > 0) {
|
|
9014
|
+
defPos = 'bottom';
|
|
9015
|
+
}
|
|
9016
|
+
}
|
|
9017
|
+
} else {
|
|
9018
|
+
prevDragRow = handleRowidOrRow($xeTable, targetRowidOrRow);
|
|
9019
|
+
const targetRowRest = prevDragRow ? fullAllDataRowIdData[getRowid($xeTable, prevDragRow)] : null;
|
|
9020
|
+
if (rowRest && targetRowRest) {
|
|
9021
|
+
if (targetRowRest._index > rowRest._index) {
|
|
9022
|
+
defPos = 'bottom';
|
|
9023
|
+
}
|
|
9024
|
+
}
|
|
9025
|
+
}
|
|
9026
|
+
return $xeTable.handleRowDragSwapEvent(null, true, dragRow, prevDragRow, dragPos || defPos, dragToChild === true);
|
|
9027
|
+
},
|
|
8893
9028
|
/**
|
|
8894
9029
|
* 获取表格的全量列
|
|
8895
9030
|
*/
|
|
@@ -8912,16 +9047,26 @@ const Methods = {
|
|
|
8912
9047
|
* 用于多选行,获取已选中的数据
|
|
8913
9048
|
*/
|
|
8914
9049
|
getCheckboxRecords(isFull) {
|
|
9050
|
+
const $xeTable = this;
|
|
9051
|
+
const props = $xeTable;
|
|
9052
|
+
const reactData = $xeTable;
|
|
9053
|
+
const internalData = $xeTable;
|
|
9054
|
+
const {
|
|
9055
|
+
treeConfig
|
|
9056
|
+
} = props;
|
|
9057
|
+
const {
|
|
9058
|
+
selectCheckboxMaps
|
|
9059
|
+
} = reactData;
|
|
8915
9060
|
const {
|
|
8916
9061
|
tableFullData,
|
|
8917
9062
|
afterFullData,
|
|
8918
|
-
treeConfig,
|
|
8919
|
-
treeOpts,
|
|
8920
|
-
checkboxOpts,
|
|
8921
|
-
tableFullTreeData,
|
|
8922
9063
|
afterTreeFullData,
|
|
9064
|
+
tableFullTreeData,
|
|
9065
|
+
fullDataRowIdData,
|
|
8923
9066
|
afterFullRowMaps
|
|
8924
|
-
} =
|
|
9067
|
+
} = internalData;
|
|
9068
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
9069
|
+
const checkboxOpts = $xeTable.computeCheckboxOpts;
|
|
8925
9070
|
const {
|
|
8926
9071
|
transform,
|
|
8927
9072
|
mapChildrenField
|
|
@@ -8930,21 +9075,18 @@ const Methods = {
|
|
|
8930
9075
|
checkField
|
|
8931
9076
|
} = checkboxOpts;
|
|
8932
9077
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
8933
|
-
const currTableData = isFull ? transform ? tableFullTreeData : tableFullData : transform ? afterTreeFullData : afterFullData;
|
|
8934
9078
|
let rowList = [];
|
|
8935
9079
|
if (checkField) {
|
|
8936
9080
|
if (treeConfig) {
|
|
9081
|
+
const currTableData = isFull ? transform ? tableFullTreeData : tableFullData : transform ? afterTreeFullData : afterFullData;
|
|
8937
9082
|
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), {
|
|
8938
9083
|
children: transform ? mapChildrenField : childrenField
|
|
8939
9084
|
});
|
|
8940
9085
|
} else {
|
|
9086
|
+
const currTableData = isFull ? tableFullData : afterFullData;
|
|
8941
9087
|
rowList = currTableData.filter(row => external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, checkField));
|
|
8942
9088
|
}
|
|
8943
9089
|
} else {
|
|
8944
|
-
const {
|
|
8945
|
-
selectCheckboxMaps,
|
|
8946
|
-
fullDataRowIdData
|
|
8947
|
-
} = this;
|
|
8948
9090
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(selectCheckboxMaps, (row, rowid) => {
|
|
8949
9091
|
if (isFull) {
|
|
8950
9092
|
if (fullDataRowIdData[rowid]) {
|
|
@@ -11424,6 +11566,7 @@ const Methods = {
|
|
|
11424
11566
|
checkStrictly,
|
|
11425
11567
|
checkMethod
|
|
11426
11568
|
} = checkboxOpts;
|
|
11569
|
+
// indeterminateField 仅支持读取
|
|
11427
11570
|
const indeterminateField = checkboxOpts.indeterminateField || checkboxOpts.halfField;
|
|
11428
11571
|
if (checkField) {
|
|
11429
11572
|
// 树结构
|
|
@@ -11950,6 +12093,7 @@ const Methods = {
|
|
|
11950
12093
|
reserve
|
|
11951
12094
|
} = checkboxOpts;
|
|
11952
12095
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
12096
|
+
// indeterminateField 仅支持读取
|
|
11953
12097
|
const indeterminateField = checkboxOpts.indeterminateField || checkboxOpts.halfField;
|
|
11954
12098
|
if (checkField) {
|
|
11955
12099
|
const handleClearChecked = item => {
|
|
@@ -12723,6 +12867,9 @@ const Methods = {
|
|
|
12723
12867
|
} = internalData;
|
|
12724
12868
|
const dEndMethod = dragEndMethod || (dragConfig ? dragConfig.dragEndMethod : null);
|
|
12725
12869
|
const dragOffsetIndex = prevDragPos === 'bottom' ? 1 : 0;
|
|
12870
|
+
const errRest = {
|
|
12871
|
+
status: false
|
|
12872
|
+
};
|
|
12726
12873
|
if (prevDragRow && dragRow) {
|
|
12727
12874
|
// 判断是否有拖动
|
|
12728
12875
|
if (prevDragRow !== dragRow) {
|
|
@@ -12737,7 +12884,7 @@ const Methods = {
|
|
|
12737
12884
|
const isDragToChildFlag = isSelfToChildDrag && dragToChildMethod ? dragToChildMethod(dragParams) : prevDragToChild;
|
|
12738
12885
|
return Promise.resolve(dEndMethod ? dEndMethod(dragParams) : true).then(status => {
|
|
12739
12886
|
if (!status) {
|
|
12740
|
-
return;
|
|
12887
|
+
return errRest;
|
|
12741
12888
|
}
|
|
12742
12889
|
let oafIndex = -1;
|
|
12743
12890
|
let nafIndex = -1;
|
|
@@ -12768,11 +12915,11 @@ const Methods = {
|
|
|
12768
12915
|
if (isPeerDrag && !isCrossDrag) {
|
|
12769
12916
|
if (oldRest.row[parentField] !== newRest.row[parentField]) {
|
|
12770
12917
|
// 非同级
|
|
12771
|
-
return;
|
|
12918
|
+
return errRest;
|
|
12772
12919
|
}
|
|
12773
12920
|
} else {
|
|
12774
12921
|
if (!isCrossDrag) {
|
|
12775
|
-
return;
|
|
12922
|
+
return errRest;
|
|
12776
12923
|
}
|
|
12777
12924
|
if (oldAllMaps[newRowid]) {
|
|
12778
12925
|
isSelfToChildStatus = true;
|
|
@@ -12783,19 +12930,19 @@ const Methods = {
|
|
|
12783
12930
|
content: methods_getI18n('vxe.error.treeDragChild')
|
|
12784
12931
|
});
|
|
12785
12932
|
}
|
|
12786
|
-
return;
|
|
12933
|
+
return errRest;
|
|
12787
12934
|
}
|
|
12788
12935
|
}
|
|
12789
12936
|
}
|
|
12790
12937
|
} else if (oldLevel) {
|
|
12791
12938
|
// 子到根
|
|
12792
12939
|
if (!isCrossDrag) {
|
|
12793
|
-
return;
|
|
12940
|
+
return errRest;
|
|
12794
12941
|
}
|
|
12795
12942
|
} else if (newLevel) {
|
|
12796
12943
|
// 根到子
|
|
12797
12944
|
if (!isCrossDrag) {
|
|
12798
|
-
return;
|
|
12945
|
+
return errRest;
|
|
12799
12946
|
}
|
|
12800
12947
|
if (oldAllMaps[newRowid]) {
|
|
12801
12948
|
isSelfToChildStatus = true;
|
|
@@ -12806,7 +12953,7 @@ const Methods = {
|
|
|
12806
12953
|
content: methods_getI18n('vxe.error.treeDragChild')
|
|
12807
12954
|
});
|
|
12808
12955
|
}
|
|
12809
|
-
return;
|
|
12956
|
+
return errRest;
|
|
12810
12957
|
}
|
|
12811
12958
|
}
|
|
12812
12959
|
} else {
|
|
@@ -12864,26 +13011,34 @@ const Methods = {
|
|
|
12864
13011
|
if (reactData.scrollYLoad) {
|
|
12865
13012
|
$xeTable.updateScrollYSpace();
|
|
12866
13013
|
}
|
|
12867
|
-
|
|
13014
|
+
if (evnt) {
|
|
13015
|
+
$xeTable.dispatchEvent('row-dragend', {
|
|
13016
|
+
oldRow: dragRow,
|
|
13017
|
+
newRow: prevDragRow,
|
|
13018
|
+
dragRow,
|
|
13019
|
+
dragPos: prevDragPos,
|
|
13020
|
+
dragToChild: isDragToChildFlag,
|
|
13021
|
+
offsetIndex: dragOffsetIndex,
|
|
13022
|
+
_index: {
|
|
13023
|
+
newIndex: nafIndex,
|
|
13024
|
+
oldIndex: oafIndex
|
|
13025
|
+
}
|
|
13026
|
+
}, evnt);
|
|
13027
|
+
}
|
|
13028
|
+
return $xeTable.$nextTick().then(() => {
|
|
12868
13029
|
$xeTable.updateCellAreas();
|
|
12869
13030
|
$xeTable.recalculate();
|
|
13031
|
+
}).then(() => {
|
|
13032
|
+
return {
|
|
13033
|
+
status: true
|
|
13034
|
+
};
|
|
12870
13035
|
});
|
|
12871
|
-
|
|
12872
|
-
|
|
12873
|
-
|
|
12874
|
-
dragRow,
|
|
12875
|
-
dragPos: prevDragPos,
|
|
12876
|
-
dragToChild: isDragToChildFlag,
|
|
12877
|
-
offsetIndex: dragOffsetIndex,
|
|
12878
|
-
_index: {
|
|
12879
|
-
newIndex: nafIndex,
|
|
12880
|
-
oldIndex: oafIndex
|
|
12881
|
-
}
|
|
12882
|
-
}, evnt);
|
|
12883
|
-
}).catch(() => {});
|
|
13036
|
+
}).catch(() => {
|
|
13037
|
+
return errRest;
|
|
13038
|
+
});
|
|
12884
13039
|
}
|
|
12885
13040
|
}
|
|
12886
|
-
return Promise.resolve();
|
|
13041
|
+
return Promise.resolve(errRest);
|
|
12887
13042
|
},
|
|
12888
13043
|
handleRowDragDragendEvent(evnt) {
|
|
12889
13044
|
const $xeTable = this;
|
|
@@ -13069,6 +13224,9 @@ const Methods = {
|
|
|
13069
13224
|
collectColumn
|
|
13070
13225
|
} = internalData;
|
|
13071
13226
|
const dragOffsetIndex = prevDragPos === 'right' ? 1 : 0;
|
|
13227
|
+
const errRest = {
|
|
13228
|
+
status: false
|
|
13229
|
+
};
|
|
13072
13230
|
if (prevDragCol && dragCol) {
|
|
13073
13231
|
// 判断是否有拖动
|
|
13074
13232
|
if (prevDragCol !== dragCol) {
|
|
@@ -13085,7 +13243,7 @@ const Methods = {
|
|
|
13085
13243
|
const isDragToChildFlag = isSelfToChildDrag && dragToChildMethod ? dragToChildMethod(dragParams) : prevDragToChild;
|
|
13086
13244
|
return Promise.resolve(dragEndMethod ? dragEndMethod(dragParams) : true).then(status => {
|
|
13087
13245
|
if (!status) {
|
|
13088
|
-
return;
|
|
13246
|
+
return errRest;
|
|
13089
13247
|
}
|
|
13090
13248
|
let oafIndex = -1;
|
|
13091
13249
|
let nafIndex = -1;
|
|
@@ -13099,11 +13257,11 @@ const Methods = {
|
|
|
13099
13257
|
if (isPeerDrag && !isCrossDrag) {
|
|
13100
13258
|
if (dragColumn.parentId !== newColumn.parentId) {
|
|
13101
13259
|
// 非同级
|
|
13102
|
-
return;
|
|
13260
|
+
return errRest;
|
|
13103
13261
|
}
|
|
13104
13262
|
} else {
|
|
13105
13263
|
if (!isCrossDrag) {
|
|
13106
|
-
return;
|
|
13264
|
+
return errRest;
|
|
13107
13265
|
}
|
|
13108
13266
|
if (oldAllMaps[newColumn.id]) {
|
|
13109
13267
|
isSelfToChildStatus = true;
|
|
@@ -13114,19 +13272,19 @@ const Methods = {
|
|
|
13114
13272
|
content: methods_getI18n('vxe.error.treeDragChild')
|
|
13115
13273
|
});
|
|
13116
13274
|
}
|
|
13117
|
-
return;
|
|
13275
|
+
return errRest;
|
|
13118
13276
|
}
|
|
13119
13277
|
}
|
|
13120
13278
|
}
|
|
13121
13279
|
} else if (dragColumn.parentId) {
|
|
13122
13280
|
// 子到根
|
|
13123
13281
|
if (!isCrossDrag) {
|
|
13124
|
-
return;
|
|
13282
|
+
return errRest;
|
|
13125
13283
|
}
|
|
13126
13284
|
} else if (newColumn.parentId) {
|
|
13127
13285
|
// 根到子
|
|
13128
13286
|
if (!isCrossDrag) {
|
|
13129
|
-
return;
|
|
13287
|
+
return errRest;
|
|
13130
13288
|
}
|
|
13131
13289
|
if (oldAllMaps[newColumn.id]) {
|
|
13132
13290
|
isSelfToChildStatus = true;
|
|
@@ -13137,7 +13295,7 @@ const Methods = {
|
|
|
13137
13295
|
content: methods_getI18n('vxe.error.treeDragChild')
|
|
13138
13296
|
});
|
|
13139
13297
|
}
|
|
13140
|
-
return;
|
|
13298
|
+
return errRest;
|
|
13141
13299
|
}
|
|
13142
13300
|
}
|
|
13143
13301
|
} else {
|
|
@@ -13206,25 +13364,32 @@ const Methods = {
|
|
|
13206
13364
|
$xeTable.clearCopyCellArea();
|
|
13207
13365
|
}
|
|
13208
13366
|
}
|
|
13209
|
-
|
|
13210
|
-
|
|
13211
|
-
|
|
13212
|
-
|
|
13213
|
-
|
|
13214
|
-
|
|
13215
|
-
|
|
13216
|
-
|
|
13217
|
-
|
|
13218
|
-
|
|
13219
|
-
|
|
13220
|
-
|
|
13367
|
+
if (evnt) {
|
|
13368
|
+
$xeTable.dispatchEvent('column-dragend', {
|
|
13369
|
+
oldColumn: dragColumn,
|
|
13370
|
+
newColumn,
|
|
13371
|
+
dragColumn,
|
|
13372
|
+
dragPos: prevDragPos,
|
|
13373
|
+
dragToChild: isDragToChildFlag,
|
|
13374
|
+
offsetIndex: dragOffsetIndex,
|
|
13375
|
+
_index: {
|
|
13376
|
+
newIndex: nafIndex,
|
|
13377
|
+
oldIndex: oafIndex
|
|
13378
|
+
}
|
|
13379
|
+
}, evnt);
|
|
13380
|
+
}
|
|
13221
13381
|
if (isSyncColumn) {
|
|
13222
13382
|
$xeTable.handleColDragSwapColumn();
|
|
13223
13383
|
}
|
|
13224
|
-
|
|
13384
|
+
return {
|
|
13385
|
+
status: true
|
|
13386
|
+
};
|
|
13387
|
+
}).catch(() => {
|
|
13388
|
+
return errRest;
|
|
13389
|
+
});
|
|
13225
13390
|
}
|
|
13226
13391
|
}
|
|
13227
|
-
return Promise.resolve();
|
|
13392
|
+
return Promise.resolve(errRest);
|
|
13228
13393
|
},
|
|
13229
13394
|
handleHeaderCellDragDragendEvent(evnt) {
|
|
13230
13395
|
const $xeTable = this;
|
|
@@ -28759,6 +28924,10 @@ Object.keys(table.methods).forEach(name => {
|
|
|
28759
28924
|
}
|
|
28760
28925
|
return [];
|
|
28761
28926
|
},
|
|
28927
|
+
getEl() {
|
|
28928
|
+
const $xeGrid = this;
|
|
28929
|
+
return $xeGrid.$refs.refElem;
|
|
28930
|
+
},
|
|
28762
28931
|
/**
|
|
28763
28932
|
* 获取需要排除的高度
|
|
28764
28933
|
*/
|
|
@@ -28769,20 +28938,25 @@ Object.keys(table.methods).forEach(name => {
|
|
|
28769
28938
|
isZMax
|
|
28770
28939
|
} = reactData;
|
|
28771
28940
|
const el = $xeGrid.$refs.refElem;
|
|
28772
|
-
|
|
28773
|
-
|
|
28774
|
-
|
|
28775
|
-
|
|
28776
|
-
|
|
28777
|
-
|
|
28778
|
-
|
|
28941
|
+
if (el) {
|
|
28942
|
+
const formWrapper = $xeGrid.$refs.refFormWrapper;
|
|
28943
|
+
const toolbarWrapper = $xeGrid.$refs.refToolbarWrapper;
|
|
28944
|
+
const topWrapper = $xeGrid.$refs.refTopWrapper;
|
|
28945
|
+
const bottomWrapper = $xeGrid.$refs.refBottomWrapper;
|
|
28946
|
+
const pagerWrapper = $xeGrid.$refs.refPagerWrapper;
|
|
28947
|
+
const parentEl = el.parentElement;
|
|
28948
|
+
const parentPaddingSize = isZMax ? 0 : parentEl ? getPaddingTopBottomSize(parentEl) : 0;
|
|
28949
|
+
return parentPaddingSize + getPaddingTopBottomSize(el) + getOffsetHeight(formWrapper) + getOffsetHeight(toolbarWrapper) + getOffsetHeight(topWrapper) + getOffsetHeight(bottomWrapper) + getOffsetHeight(pagerWrapper);
|
|
28950
|
+
}
|
|
28951
|
+
return 0;
|
|
28779
28952
|
},
|
|
28780
28953
|
getParentHeight() {
|
|
28781
28954
|
const $xeGrid = this;
|
|
28782
28955
|
const reactData = $xeGrid;
|
|
28783
28956
|
const el = $xeGrid.$refs.refElem;
|
|
28784
28957
|
if (el) {
|
|
28785
|
-
|
|
28958
|
+
const parentEl = el.parentElement;
|
|
28959
|
+
return (reactData.isZMax ? getDomNode().visibleHeight : parentEl ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(getComputedStyle(parentEl).height) : 0) - $xeGrid.getExcludeHeight();
|
|
28786
28960
|
}
|
|
28787
28961
|
return 0;
|
|
28788
28962
|
},
|