vxe-table 4.12.0-beta.7 → 4.12.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 -9
- package/es/style.css +1 -1
- package/es/table/src/table.js +170 -48
- package/es/table/src/util.js +7 -0
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/grid/src/grid.js +17 -9
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.umd.js +1079 -12137
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/src/table.js +191 -51
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +9 -1
- 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 +17 -9
- package/packages/table/src/table.ts +172 -49
- package/packages/table/src/util.ts +8 -0
- /package/es/{iconfont.1741265552139.ttf → iconfont.1741337003908.ttf} +0 -0
- /package/es/{iconfont.1741265552139.woff → iconfont.1741337003908.woff} +0 -0
- /package/es/{iconfont.1741265552139.woff2 → iconfont.1741337003908.woff2} +0 -0
- /package/lib/{iconfont.1741265552139.ttf → iconfont.1741337003908.ttf} +0 -0
- /package/lib/{iconfont.1741265552139.woff → iconfont.1741337003908.woff} +0 -0
- /package/lib/{iconfont.1741265552139.woff2 → iconfont.1741337003908.woff2} +0 -0
package/es/table/src/table.js
CHANGED
|
@@ -9,7 +9,7 @@ import TableHeaderComponent from './header';
|
|
|
9
9
|
import TableFooterComponent from './footer';
|
|
10
10
|
import tableProps from './props';
|
|
11
11
|
import tableEmits from './emits';
|
|
12
|
-
import { getRowUniqueId, clearTableAllStatus, getRowkey, getRowid, rowToVisible, colToVisible, getCellValue, setCellValue, handleFieldOrColumn, toTreePathSeq, restoreScrollLocation, getRootColumn, getRefElem, getColReMinWidth, updateDeepRowKey, updateFastRowKey } from './util';
|
|
12
|
+
import { getRowUniqueId, clearTableAllStatus, getRowkey, getRowid, rowToVisible, colToVisible, getCellValue, setCellValue, handleRowidOrRow, handleFieldOrColumn, toTreePathSeq, restoreScrollLocation, getRootColumn, getRefElem, getColReMinWidth, updateDeepRowKey, updateFastRowKey } from './util';
|
|
13
13
|
import { getSlotVNs } from '../../ui/src/vn';
|
|
14
14
|
import { warnLog, errLog } from '../../ui/src/log';
|
|
15
15
|
import TableCustomPanelComponent from '../module/custom/panel';
|
|
@@ -2238,6 +2238,7 @@ export default defineComponent({
|
|
|
2238
2238
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
2239
2239
|
const checkboxOpts = computeCheckboxOpts.value;
|
|
2240
2240
|
const { checkField, reserve, checkMethod } = checkboxOpts;
|
|
2241
|
+
// indeterminateField 仅支持读取
|
|
2241
2242
|
const indeterminateField = checkboxOpts.indeterminateField || checkboxOpts.halfField;
|
|
2242
2243
|
const selectRowMaps = {};
|
|
2243
2244
|
/**
|
|
@@ -3438,6 +3439,9 @@ export default defineComponent({
|
|
|
3438
3439
|
};
|
|
3439
3440
|
tableMethods = {
|
|
3440
3441
|
dispatchEvent,
|
|
3442
|
+
getEl() {
|
|
3443
|
+
return refElem.value;
|
|
3444
|
+
},
|
|
3441
3445
|
/**
|
|
3442
3446
|
* 重置表格的一切数据状态
|
|
3443
3447
|
*/
|
|
@@ -3740,7 +3744,9 @@ export default defineComponent({
|
|
|
3740
3744
|
*/
|
|
3741
3745
|
revertData(rows, field) {
|
|
3742
3746
|
const { keepSource, treeConfig } = props;
|
|
3747
|
+
const { editStore } = reactData;
|
|
3743
3748
|
const { fullAllDataRowIdData, fullDataRowIdData, tableSourceData, sourceDataRowIdData, tableFullData, afterFullData } = internalData;
|
|
3749
|
+
const removeTempMaps = Object.assign({}, editStore.removeMaps);
|
|
3744
3750
|
const treeOpts = computeTreeOpts.value;
|
|
3745
3751
|
const { transform } = treeOpts;
|
|
3746
3752
|
if (!keepSource) {
|
|
@@ -3775,6 +3781,7 @@ export default defineComponent({
|
|
|
3775
3781
|
XEUtils.destructuring(row, XEUtils.clone(oRow, true));
|
|
3776
3782
|
}
|
|
3777
3783
|
if (!fullDataRowIdData[rowid] && $xeTable.isRemoveByRow(row)) {
|
|
3784
|
+
delete removeTempMaps[rowid];
|
|
3778
3785
|
tableFullData.unshift(row);
|
|
3779
3786
|
afterFullData.unshift(row);
|
|
3780
3787
|
reDelFlag = true;
|
|
@@ -3786,6 +3793,7 @@ export default defineComponent({
|
|
|
3786
3793
|
}
|
|
3787
3794
|
if (rows) {
|
|
3788
3795
|
if (reDelFlag) {
|
|
3796
|
+
editStore.removeMaps = removeTempMaps;
|
|
3789
3797
|
$xeTable.updateFooter();
|
|
3790
3798
|
$xeTable.cacheRowMap(false);
|
|
3791
3799
|
$xeTable.handleTableData(treeConfig && transform);
|
|
@@ -3938,18 +3946,20 @@ export default defineComponent({
|
|
|
3938
3946
|
},
|
|
3939
3947
|
/**
|
|
3940
3948
|
* 检查行或列数据是否发生改变
|
|
3941
|
-
* @param {Row}
|
|
3949
|
+
* @param {Row} rowidOrRow 行对象、行主键
|
|
3942
3950
|
* @param {String} field 字段名
|
|
3943
3951
|
*/
|
|
3944
|
-
isUpdateByRow(
|
|
3952
|
+
isUpdateByRow(rowidOrRow, field) {
|
|
3945
3953
|
const { keepSource } = props;
|
|
3946
3954
|
const { tableFullColumn, fullDataRowIdData, sourceDataRowIdData } = internalData;
|
|
3947
3955
|
if (keepSource) {
|
|
3948
|
-
const rowid = getRowid($xeTable,
|
|
3956
|
+
const rowid = XEUtils.isString(rowidOrRow) || XEUtils.isNumber(rowidOrRow) ? rowidOrRow : getRowid($xeTable, rowidOrRow);
|
|
3957
|
+
const rowRest = fullDataRowIdData[rowid];
|
|
3949
3958
|
// 新增的数据不需要检测
|
|
3950
|
-
if (!
|
|
3959
|
+
if (!rowRest) {
|
|
3951
3960
|
return false;
|
|
3952
3961
|
}
|
|
3962
|
+
const row = rowRest.row;
|
|
3953
3963
|
const oRow = sourceDataRowIdData[rowid];
|
|
3954
3964
|
if (oRow) {
|
|
3955
3965
|
if (arguments.length > 1) {
|
|
@@ -4013,6 +4023,94 @@ export default defineComponent({
|
|
|
4013
4023
|
tableColumn: reactData.tableColumn.slice(0)
|
|
4014
4024
|
};
|
|
4015
4025
|
},
|
|
4026
|
+
/**
|
|
4027
|
+
* 移动列到指定列的位置
|
|
4028
|
+
* @param fieldOrColumn
|
|
4029
|
+
* @param targetFieldOrColumn
|
|
4030
|
+
* @param options
|
|
4031
|
+
*/
|
|
4032
|
+
moveColumnTo(fieldOrColumn, targetFieldOrColumn, options) {
|
|
4033
|
+
const { fullColumnIdData, visibleColumn } = internalData;
|
|
4034
|
+
const { dragToChild, dragPos, isCrossDrag } = Object.assign({}, options);
|
|
4035
|
+
const dragCol = handleFieldOrColumn($xeTable, fieldOrColumn);
|
|
4036
|
+
let prevDragCol = null;
|
|
4037
|
+
const colRest = dragCol ? fullColumnIdData[dragCol.id] : null;
|
|
4038
|
+
let defPos = 'left';
|
|
4039
|
+
if (XEUtils.isNumber(targetFieldOrColumn)) {
|
|
4040
|
+
if (colRest && targetFieldOrColumn) {
|
|
4041
|
+
let currList = colRest.items;
|
|
4042
|
+
let offsetIndex = colRest._index + targetFieldOrColumn;
|
|
4043
|
+
if (isCrossDrag) {
|
|
4044
|
+
currList = visibleColumn;
|
|
4045
|
+
offsetIndex = colRest._index + targetFieldOrColumn;
|
|
4046
|
+
}
|
|
4047
|
+
if (offsetIndex > 0 && offsetIndex < currList.length - 1) {
|
|
4048
|
+
prevDragCol = currList[offsetIndex];
|
|
4049
|
+
}
|
|
4050
|
+
if (targetFieldOrColumn > 0) {
|
|
4051
|
+
defPos = 'right';
|
|
4052
|
+
}
|
|
4053
|
+
}
|
|
4054
|
+
}
|
|
4055
|
+
else {
|
|
4056
|
+
prevDragCol = handleFieldOrColumn($xeTable, targetFieldOrColumn);
|
|
4057
|
+
const targetColRest = prevDragCol ? fullColumnIdData[prevDragCol.id] : null;
|
|
4058
|
+
if (colRest && targetColRest) {
|
|
4059
|
+
if (targetColRest._index > colRest._index) {
|
|
4060
|
+
defPos = 'right';
|
|
4061
|
+
}
|
|
4062
|
+
}
|
|
4063
|
+
}
|
|
4064
|
+
return $xeTable.handleColDragSwapEvent(null, true, dragCol, prevDragCol, dragPos || defPos, dragToChild === true);
|
|
4065
|
+
},
|
|
4066
|
+
/**
|
|
4067
|
+
* 移动行到指定行的位置
|
|
4068
|
+
* @param rowidOrRow
|
|
4069
|
+
* @param targetRowidOrRow
|
|
4070
|
+
* @param options
|
|
4071
|
+
*/
|
|
4072
|
+
moveRowTo(rowidOrRow, targetRowidOrRow, options) {
|
|
4073
|
+
const { treeConfig } = props;
|
|
4074
|
+
const { fullAllDataRowIdData, afterFullData } = internalData;
|
|
4075
|
+
const { dragToChild, dragPos, isCrossDrag } = Object.assign({}, options);
|
|
4076
|
+
const treeOpts = computeTreeOpts.value;
|
|
4077
|
+
const dragRow = handleRowidOrRow($xeTable, rowidOrRow);
|
|
4078
|
+
let prevDragRow = null;
|
|
4079
|
+
let defPos = 'top';
|
|
4080
|
+
const rowRest = dragRow ? fullAllDataRowIdData[getRowid($xeTable, dragRow)] : null;
|
|
4081
|
+
if (XEUtils.isNumber(targetRowidOrRow)) {
|
|
4082
|
+
if (rowRest && targetRowidOrRow) {
|
|
4083
|
+
let currList = afterFullData;
|
|
4084
|
+
let offsetIndex = rowRest._index + targetRowidOrRow;
|
|
4085
|
+
if (treeConfig) {
|
|
4086
|
+
currList = rowRest.items;
|
|
4087
|
+
if (treeOpts.transform) {
|
|
4088
|
+
offsetIndex = rowRest.treeIndex + targetRowidOrRow;
|
|
4089
|
+
if (isCrossDrag) {
|
|
4090
|
+
currList = afterFullData;
|
|
4091
|
+
offsetIndex = rowRest._index + targetRowidOrRow;
|
|
4092
|
+
}
|
|
4093
|
+
}
|
|
4094
|
+
}
|
|
4095
|
+
if (offsetIndex >= 0 && offsetIndex <= currList.length - 1) {
|
|
4096
|
+
prevDragRow = currList[offsetIndex];
|
|
4097
|
+
}
|
|
4098
|
+
if (targetRowidOrRow > 0) {
|
|
4099
|
+
defPos = 'bottom';
|
|
4100
|
+
}
|
|
4101
|
+
}
|
|
4102
|
+
}
|
|
4103
|
+
else {
|
|
4104
|
+
prevDragRow = handleRowidOrRow($xeTable, targetRowidOrRow);
|
|
4105
|
+
const targetRowRest = prevDragRow ? fullAllDataRowIdData[getRowid($xeTable, prevDragRow)] : null;
|
|
4106
|
+
if (rowRest && targetRowRest) {
|
|
4107
|
+
if (targetRowRest._index > rowRest._index) {
|
|
4108
|
+
defPos = 'bottom';
|
|
4109
|
+
}
|
|
4110
|
+
}
|
|
4111
|
+
}
|
|
4112
|
+
return $xeTable.handleRowDragSwapEvent(null, true, dragRow, prevDragRow, dragPos || defPos, dragToChild === true);
|
|
4113
|
+
},
|
|
4016
4114
|
/**
|
|
4017
4115
|
* 获取表格的全量列
|
|
4018
4116
|
*/
|
|
@@ -4032,6 +4130,7 @@ export default defineComponent({
|
|
|
4032
4130
|
*/
|
|
4033
4131
|
getCheckboxRecords(isFull) {
|
|
4034
4132
|
const { treeConfig } = props;
|
|
4133
|
+
const { selectCheckboxMaps } = reactData;
|
|
4035
4134
|
const { tableFullData, afterFullData, afterTreeFullData, tableFullTreeData, fullDataRowIdData, afterFullRowMaps } = internalData;
|
|
4036
4135
|
const treeOpts = computeTreeOpts.value;
|
|
4037
4136
|
const checkboxOpts = computeCheckboxOpts.value;
|
|
@@ -4039,17 +4138,17 @@ export default defineComponent({
|
|
|
4039
4138
|
const { checkField } = checkboxOpts;
|
|
4040
4139
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
4041
4140
|
let rowList = [];
|
|
4042
|
-
const currTableData = isFull ? (transform ? tableFullTreeData : tableFullData) : (transform ? afterTreeFullData : afterFullData);
|
|
4043
4141
|
if (checkField) {
|
|
4044
4142
|
if (treeConfig) {
|
|
4143
|
+
const currTableData = isFull ? (transform ? tableFullTreeData : tableFullData) : (transform ? afterTreeFullData : afterFullData);
|
|
4045
4144
|
rowList = XEUtils.filterTree(currTableData, row => XEUtils.get(row, checkField), { children: transform ? mapChildrenField : childrenField });
|
|
4046
4145
|
}
|
|
4047
4146
|
else {
|
|
4147
|
+
const currTableData = isFull ? tableFullData : afterFullData;
|
|
4048
4148
|
rowList = currTableData.filter((row) => XEUtils.get(row, checkField));
|
|
4049
4149
|
}
|
|
4050
4150
|
}
|
|
4051
4151
|
else {
|
|
4052
|
-
const { selectCheckboxMaps } = reactData;
|
|
4053
4152
|
XEUtils.each(selectCheckboxMaps, (row, rowid) => {
|
|
4054
4153
|
if (isFull) {
|
|
4055
4154
|
if (fullDataRowIdData[rowid]) {
|
|
@@ -4734,6 +4833,7 @@ export default defineComponent({
|
|
|
4734
4833
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
4735
4834
|
const checkboxOpts = computeCheckboxOpts.value;
|
|
4736
4835
|
const { checkField, reserve } = checkboxOpts;
|
|
4836
|
+
// indeterminateField 仅支持读取
|
|
4737
4837
|
const indeterminateField = checkboxOpts.indeterminateField || checkboxOpts.halfField;
|
|
4738
4838
|
if (checkField) {
|
|
4739
4839
|
const handleClearChecked = (item) => {
|
|
@@ -6772,6 +6872,8 @@ export default defineComponent({
|
|
|
6772
6872
|
rowRest.level = level;
|
|
6773
6873
|
rowRest.index = currIndex;
|
|
6774
6874
|
rowRest.treeIndex = index;
|
|
6875
|
+
fullDataRowIdMaps[rowid] = rowRest;
|
|
6876
|
+
fullAllDataRowIdMaps[rowid] = rowRest;
|
|
6775
6877
|
};
|
|
6776
6878
|
if (treeConfig) {
|
|
6777
6879
|
XEUtils.eachTree(tableFullTreeData, (row, index, items, path, parentRow, nodes) => {
|
|
@@ -7452,6 +7554,7 @@ export default defineComponent({
|
|
|
7452
7554
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
7453
7555
|
const checkboxOpts = computeCheckboxOpts.value;
|
|
7454
7556
|
const { checkField, checkStrictly, checkMethod } = checkboxOpts;
|
|
7557
|
+
// indeterminateField 仅支持读取
|
|
7455
7558
|
const indeterminateField = checkboxOpts.indeterminateField || checkboxOpts.halfField;
|
|
7456
7559
|
if (checkField) {
|
|
7457
7560
|
// 树结构
|
|
@@ -8099,6 +8202,9 @@ export default defineComponent({
|
|
|
8099
8202
|
const { afterFullData, tableFullData } = internalData;
|
|
8100
8203
|
const dEndMethod = dragEndMethod || (dragConfig ? dragConfig.dragEndMethod : null);
|
|
8101
8204
|
const dragOffsetIndex = prevDragPos === 'bottom' ? 1 : 0;
|
|
8205
|
+
const errRest = {
|
|
8206
|
+
status: false
|
|
8207
|
+
};
|
|
8102
8208
|
if (prevDragRow && dragRow) {
|
|
8103
8209
|
// 判断是否有拖动
|
|
8104
8210
|
if (prevDragRow !== dragRow) {
|
|
@@ -8113,7 +8219,7 @@ export default defineComponent({
|
|
|
8113
8219
|
const isDragToChildFlag = isSelfToChildDrag && dragToChildMethod ? dragToChildMethod(dragParams) : prevDragToChild;
|
|
8114
8220
|
return Promise.resolve(dEndMethod ? dEndMethod(dragParams) : true).then((status) => {
|
|
8115
8221
|
if (!status) {
|
|
8116
|
-
return;
|
|
8222
|
+
return errRest;
|
|
8117
8223
|
}
|
|
8118
8224
|
let oafIndex = -1;
|
|
8119
8225
|
let nafIndex = -1;
|
|
@@ -8138,12 +8244,12 @@ export default defineComponent({
|
|
|
8138
8244
|
if (isPeerDrag && !isCrossDrag) {
|
|
8139
8245
|
if (oldRest.row[parentField] !== newRest.row[parentField]) {
|
|
8140
8246
|
// 非同级
|
|
8141
|
-
return;
|
|
8247
|
+
return errRest;
|
|
8142
8248
|
}
|
|
8143
8249
|
}
|
|
8144
8250
|
else {
|
|
8145
8251
|
if (!isCrossDrag) {
|
|
8146
|
-
return;
|
|
8252
|
+
return errRest;
|
|
8147
8253
|
}
|
|
8148
8254
|
if (oldAllMaps[newRowid]) {
|
|
8149
8255
|
isSelfToChildStatus = true;
|
|
@@ -8154,7 +8260,7 @@ export default defineComponent({
|
|
|
8154
8260
|
content: getI18n('vxe.error.treeDragChild')
|
|
8155
8261
|
});
|
|
8156
8262
|
}
|
|
8157
|
-
return;
|
|
8263
|
+
return errRest;
|
|
8158
8264
|
}
|
|
8159
8265
|
}
|
|
8160
8266
|
}
|
|
@@ -8162,13 +8268,13 @@ export default defineComponent({
|
|
|
8162
8268
|
else if (oldLevel) {
|
|
8163
8269
|
// 子到根
|
|
8164
8270
|
if (!isCrossDrag) {
|
|
8165
|
-
return;
|
|
8271
|
+
return errRest;
|
|
8166
8272
|
}
|
|
8167
8273
|
}
|
|
8168
8274
|
else if (newLevel) {
|
|
8169
8275
|
// 根到子
|
|
8170
8276
|
if (!isCrossDrag) {
|
|
8171
|
-
return;
|
|
8277
|
+
return errRest;
|
|
8172
8278
|
}
|
|
8173
8279
|
if (oldAllMaps[newRowid]) {
|
|
8174
8280
|
isSelfToChildStatus = true;
|
|
@@ -8179,7 +8285,7 @@ export default defineComponent({
|
|
|
8179
8285
|
content: getI18n('vxe.error.treeDragChild')
|
|
8180
8286
|
});
|
|
8181
8287
|
}
|
|
8182
|
-
return;
|
|
8288
|
+
return errRest;
|
|
8183
8289
|
}
|
|
8184
8290
|
}
|
|
8185
8291
|
}
|
|
@@ -8239,27 +8345,34 @@ export default defineComponent({
|
|
|
8239
8345
|
if (reactData.scrollYLoad) {
|
|
8240
8346
|
$xeTable.updateScrollYSpace();
|
|
8241
8347
|
}
|
|
8242
|
-
|
|
8348
|
+
if (evnt) {
|
|
8349
|
+
dispatchEvent('row-dragend', {
|
|
8350
|
+
oldRow: dragRow,
|
|
8351
|
+
newRow: prevDragRow,
|
|
8352
|
+
dragRow,
|
|
8353
|
+
dragPos: prevDragPos,
|
|
8354
|
+
dragToChild: isDragToChildFlag,
|
|
8355
|
+
offsetIndex: dragOffsetIndex,
|
|
8356
|
+
_index: {
|
|
8357
|
+
newIndex: nafIndex,
|
|
8358
|
+
oldIndex: oafIndex
|
|
8359
|
+
}
|
|
8360
|
+
}, evnt);
|
|
8361
|
+
}
|
|
8362
|
+
return nextTick().then(() => {
|
|
8243
8363
|
$xeTable.updateCellAreas();
|
|
8244
8364
|
$xeTable.recalculate();
|
|
8365
|
+
}).then(() => {
|
|
8366
|
+
return {
|
|
8367
|
+
status: true
|
|
8368
|
+
};
|
|
8245
8369
|
});
|
|
8246
|
-
dispatchEvent('row-dragend', {
|
|
8247
|
-
oldRow: dragRow,
|
|
8248
|
-
newRow: prevDragRow,
|
|
8249
|
-
dragRow,
|
|
8250
|
-
dragPos: prevDragPos,
|
|
8251
|
-
dragToChild: isDragToChildFlag,
|
|
8252
|
-
offsetIndex: dragOffsetIndex,
|
|
8253
|
-
_index: {
|
|
8254
|
-
newIndex: nafIndex,
|
|
8255
|
-
oldIndex: oafIndex
|
|
8256
|
-
}
|
|
8257
|
-
}, evnt);
|
|
8258
8370
|
}).catch(() => {
|
|
8371
|
+
return errRest;
|
|
8259
8372
|
});
|
|
8260
8373
|
}
|
|
8261
8374
|
}
|
|
8262
|
-
return Promise.resolve();
|
|
8375
|
+
return Promise.resolve(errRest);
|
|
8263
8376
|
},
|
|
8264
8377
|
handleRowDragDragendEvent(evnt) {
|
|
8265
8378
|
const { treeConfig } = props;
|
|
@@ -8386,6 +8499,9 @@ export default defineComponent({
|
|
|
8386
8499
|
const { isPeerDrag, isCrossDrag, isSelfToChildDrag, isToChildDrag, dragEndMethod, dragToChildMethod } = columnDragOpts;
|
|
8387
8500
|
const { collectColumn } = internalData;
|
|
8388
8501
|
const dragOffsetIndex = prevDragPos === 'right' ? 1 : 0;
|
|
8502
|
+
const errRest = {
|
|
8503
|
+
status: false
|
|
8504
|
+
};
|
|
8389
8505
|
if (prevDragCol && dragCol) {
|
|
8390
8506
|
// 判断是否有拖动
|
|
8391
8507
|
if (prevDragCol !== dragCol) {
|
|
@@ -8402,7 +8518,7 @@ export default defineComponent({
|
|
|
8402
8518
|
const isDragToChildFlag = isSelfToChildDrag && dragToChildMethod ? dragToChildMethod(dragParams) : prevDragToChild;
|
|
8403
8519
|
return Promise.resolve(dragEndMethod ? dragEndMethod(dragParams) : true).then((status) => {
|
|
8404
8520
|
if (!status) {
|
|
8405
|
-
return;
|
|
8521
|
+
return errRest;
|
|
8406
8522
|
}
|
|
8407
8523
|
let oafIndex = -1;
|
|
8408
8524
|
let nafIndex = -1;
|
|
@@ -8416,12 +8532,12 @@ export default defineComponent({
|
|
|
8416
8532
|
if (isPeerDrag && !isCrossDrag) {
|
|
8417
8533
|
if (dragColumn.parentId !== newColumn.parentId) {
|
|
8418
8534
|
// 非同级
|
|
8419
|
-
return;
|
|
8535
|
+
return errRest;
|
|
8420
8536
|
}
|
|
8421
8537
|
}
|
|
8422
8538
|
else {
|
|
8423
8539
|
if (!isCrossDrag) {
|
|
8424
|
-
return;
|
|
8540
|
+
return errRest;
|
|
8425
8541
|
}
|
|
8426
8542
|
if (oldAllMaps[newColumn.id]) {
|
|
8427
8543
|
isSelfToChildStatus = true;
|
|
@@ -8432,7 +8548,7 @@ export default defineComponent({
|
|
|
8432
8548
|
content: getI18n('vxe.error.treeDragChild')
|
|
8433
8549
|
});
|
|
8434
8550
|
}
|
|
8435
|
-
return;
|
|
8551
|
+
return errRest;
|
|
8436
8552
|
}
|
|
8437
8553
|
}
|
|
8438
8554
|
}
|
|
@@ -8440,13 +8556,13 @@ export default defineComponent({
|
|
|
8440
8556
|
else if (dragColumn.parentId) {
|
|
8441
8557
|
// 子到根
|
|
8442
8558
|
if (!isCrossDrag) {
|
|
8443
|
-
return;
|
|
8559
|
+
return errRest;
|
|
8444
8560
|
}
|
|
8445
8561
|
}
|
|
8446
8562
|
else if (newColumn.parentId) {
|
|
8447
8563
|
// 根到子
|
|
8448
8564
|
if (!isCrossDrag) {
|
|
8449
|
-
return;
|
|
8565
|
+
return errRest;
|
|
8450
8566
|
}
|
|
8451
8567
|
if (oldAllMaps[newColumn.id]) {
|
|
8452
8568
|
isSelfToChildStatus = true;
|
|
@@ -8457,7 +8573,7 @@ export default defineComponent({
|
|
|
8457
8573
|
content: getI18n('vxe.error.treeDragChild')
|
|
8458
8574
|
});
|
|
8459
8575
|
}
|
|
8460
|
-
return;
|
|
8576
|
+
return errRest;
|
|
8461
8577
|
}
|
|
8462
8578
|
}
|
|
8463
8579
|
}
|
|
@@ -8518,26 +8634,32 @@ export default defineComponent({
|
|
|
8518
8634
|
$xeTable.clearCopyCellArea();
|
|
8519
8635
|
}
|
|
8520
8636
|
}
|
|
8521
|
-
|
|
8522
|
-
|
|
8523
|
-
|
|
8524
|
-
|
|
8525
|
-
|
|
8526
|
-
|
|
8527
|
-
|
|
8528
|
-
|
|
8529
|
-
|
|
8530
|
-
|
|
8531
|
-
|
|
8532
|
-
|
|
8637
|
+
if (evnt) {
|
|
8638
|
+
dispatchEvent('column-dragend', {
|
|
8639
|
+
oldColumn: dragColumn,
|
|
8640
|
+
newColumn,
|
|
8641
|
+
dragColumn,
|
|
8642
|
+
dragPos: prevDragPos,
|
|
8643
|
+
dragToChild: isDragToChildFlag,
|
|
8644
|
+
offsetIndex: dragOffsetIndex,
|
|
8645
|
+
_index: {
|
|
8646
|
+
newIndex: nafIndex,
|
|
8647
|
+
oldIndex: oafIndex
|
|
8648
|
+
}
|
|
8649
|
+
}, evnt);
|
|
8650
|
+
}
|
|
8533
8651
|
if (isSyncColumn) {
|
|
8534
8652
|
$xeTable.handleColDragSwapColumn();
|
|
8535
8653
|
}
|
|
8654
|
+
return {
|
|
8655
|
+
status: true
|
|
8656
|
+
};
|
|
8536
8657
|
}).catch(() => {
|
|
8658
|
+
return errRest;
|
|
8537
8659
|
});
|
|
8538
8660
|
}
|
|
8539
8661
|
}
|
|
8540
|
-
return Promise.resolve();
|
|
8662
|
+
return Promise.resolve(errRest);
|
|
8541
8663
|
},
|
|
8542
8664
|
handleHeaderCellDragDragendEvent(evnt) {
|
|
8543
8665
|
const { dragCol } = reactData;
|
package/es/table/src/util.js
CHANGED
|
@@ -125,6 +125,13 @@ export const handleFieldOrColumn = ($xeTable, fieldOrColumn) => {
|
|
|
125
125
|
}
|
|
126
126
|
return null;
|
|
127
127
|
};
|
|
128
|
+
export const handleRowidOrRow = ($xeTable, rowidOrRow) => {
|
|
129
|
+
if (rowidOrRow) {
|
|
130
|
+
const rowid = XEUtils.isString(rowidOrRow) || XEUtils.isNumber(rowidOrRow) ? rowidOrRow : getRowid($xeTable, rowidOrRow);
|
|
131
|
+
return $xeTable.getRowById(rowid);
|
|
132
|
+
}
|
|
133
|
+
return null;
|
|
134
|
+
};
|
|
128
135
|
function getPaddingLeftRightSize(elem) {
|
|
129
136
|
if (elem) {
|
|
130
137
|
const computedStyle = getComputedStyle(elem);
|
package/es/ui/index.js
CHANGED
package/es/ui/src/log.js
CHANGED
package/lib/grid/src/grid.js
CHANGED
|
@@ -28,7 +28,7 @@ const {
|
|
|
28
28
|
renderEmptyElement
|
|
29
29
|
} = _ui.VxeUI;
|
|
30
30
|
const tableComponentPropKeys = Object.keys(_props.default);
|
|
31
|
-
const tableComponentMethodKeys = ['clearAll', 'syncData', 'updateData', 'loadData', 'reloadData', 'reloadRow', 'loadColumn', 'reloadColumn', 'getRowNode', 'getColumnNode', 'getRowIndex', 'getVTRowIndex', 'getVMRowIndex', 'getColumnIndex', 'getVTColumnIndex', 'getVMColumnIndex', 'setRow', 'createData', 'createRow', 'revertData', 'clearData', 'isRemoveByRow', 'isInsertByRow', 'isUpdateByRow', 'getColumns', 'getColumnById', 'getColumnByField', 'getTableColumn', 'getFullColumns', 'getData', 'getCheckboxRecords', 'getParentRow', 'getTreeParentRow', 'getRowSeq', 'getRowById', 'getRowid', 'getTableData', 'getFullData', 'setColumnFixed', 'clearColumnFixed', 'setColumnWidth', 'getColumnWidth', 'setRowHeightConf', 'getRowHeightConf', 'setRowHeight', 'getRowHeight', 'hideColumn', 'showColumn', 'resetColumn', 'refreshColumn', 'refreshScroll', 'recalculate', 'closeTooltip', 'isAllCheckboxChecked', 'isAllCheckboxIndeterminate', 'getCheckboxIndeterminateRecords', 'setCheckboxRow', 'setCheckboxRowKey', 'isCheckedByCheckboxRow', 'isCheckedByCheckboxRowKey', 'isIndeterminateByCheckboxRow', 'isIndeterminateByCheckboxRowKey', 'toggleCheckboxRow', 'setAllCheckboxRow', 'getRadioReserveRecord', 'clearRadioReserve', 'getCheckboxReserveRecords', 'clearCheckboxReserve', 'toggleAllCheckboxRow', 'clearCheckboxRow', 'setCurrentRow', 'isCheckedByRadioRow', 'isCheckedByRadioRowKey', 'setRadioRow', 'setRadioRowKey', 'clearCurrentRow', 'clearRadioRow', 'getCurrentRecord', 'getRadioRecord', 'getCurrentColumn', 'setCurrentColumn', 'clearCurrentColumn', 'setPendingRow', 'togglePendingRow', 'getPendingRecords', 'clearPendingRow', 'sort', 'setSort', 'clearSort', 'isSort', 'getSortColumns', 'closeFilter', 'isFilter', 'isActiveFilterByColumn', 'isRowExpandLoaded', 'clearRowExpandLoaded', 'reloadRowExpand', 'reloadRowExpand', 'toggleRowExpand', 'setAllRowExpand', 'setRowExpand', 'isExpandByRow', 'isRowExpandByRow', 'clearRowExpand', 'clearRowExpandReserve', 'getRowExpandRecords', 'getTreeExpandRecords', 'isTreeExpandLoaded', 'clearTreeExpandLoaded', 'reloadTreeExpand', 'reloadTreeChilds', 'toggleTreeExpand', 'setAllTreeExpand', 'setTreeExpand', 'isTreeExpandByRow', 'clearTreeExpand', 'clearTreeExpandReserve', 'getScroll', 'scrollTo', 'scrollToRow', 'scrollToColumn', 'clearScroll', 'updateFooter', 'updateStatus', 'setMergeCells', 'removeInsertRow', 'removeMergeCells', 'getMergeCells', 'clearMergeCells', 'setMergeFooterItems', 'removeMergeFooterItems', 'getMergeFooterItems', 'clearMergeFooterItems', 'getCustomStoreData', 'openTooltip', 'getCellLabel', 'getCellElement', 'focus', 'blur', 'connect'];
|
|
31
|
+
const tableComponentMethodKeys = ['clearAll', 'syncData', 'updateData', 'loadData', 'reloadData', 'reloadRow', 'loadColumn', 'reloadColumn', 'getRowNode', 'getColumnNode', 'getRowIndex', 'getVTRowIndex', 'getVMRowIndex', 'getColumnIndex', 'getVTColumnIndex', 'getVMColumnIndex', 'setRow', 'createData', 'createRow', 'revertData', 'clearData', 'isRemoveByRow', 'isInsertByRow', 'isUpdateByRow', 'getColumns', 'getColumnById', 'getColumnByField', 'getTableColumn', 'getFullColumns', 'getData', 'getCheckboxRecords', 'getParentRow', 'getTreeParentRow', 'getRowSeq', 'getRowById', 'getRowid', 'getTableData', 'getFullData', 'setColumnFixed', 'clearColumnFixed', 'setColumnWidth', 'getColumnWidth', 'setRowHeightConf', 'getRowHeightConf', 'setRowHeight', 'getRowHeight', 'hideColumn', 'showColumn', 'resetColumn', 'refreshColumn', 'refreshScroll', 'recalculate', 'closeTooltip', 'isAllCheckboxChecked', 'isAllCheckboxIndeterminate', 'getCheckboxIndeterminateRecords', 'setCheckboxRow', 'setCheckboxRowKey', 'isCheckedByCheckboxRow', 'isCheckedByCheckboxRowKey', 'isIndeterminateByCheckboxRow', 'isIndeterminateByCheckboxRowKey', 'toggleCheckboxRow', 'setAllCheckboxRow', 'getRadioReserveRecord', 'clearRadioReserve', 'getCheckboxReserveRecords', 'clearCheckboxReserve', 'toggleAllCheckboxRow', 'clearCheckboxRow', 'setCurrentRow', 'isCheckedByRadioRow', 'isCheckedByRadioRowKey', 'setRadioRow', 'setRadioRowKey', 'clearCurrentRow', 'clearRadioRow', 'getCurrentRecord', 'getRadioRecord', 'getCurrentColumn', 'setCurrentColumn', 'clearCurrentColumn', 'setPendingRow', 'togglePendingRow', 'getPendingRecords', 'clearPendingRow', 'sort', 'setSort', 'clearSort', 'isSort', 'getSortColumns', 'closeFilter', 'isFilter', 'isActiveFilterByColumn', 'isRowExpandLoaded', 'clearRowExpandLoaded', 'reloadRowExpand', 'reloadRowExpand', 'toggleRowExpand', 'setAllRowExpand', 'setRowExpand', 'isExpandByRow', 'isRowExpandByRow', 'clearRowExpand', 'clearRowExpandReserve', 'getRowExpandRecords', 'getTreeExpandRecords', 'isTreeExpandLoaded', 'clearTreeExpandLoaded', 'reloadTreeExpand', 'reloadTreeChilds', 'toggleTreeExpand', 'setAllTreeExpand', 'setTreeExpand', 'isTreeExpandByRow', 'clearTreeExpand', 'clearTreeExpandReserve', 'getScroll', 'scrollTo', 'scrollToRow', 'scrollToColumn', 'clearScroll', 'updateFooter', 'updateStatus', 'setMergeCells', 'removeInsertRow', 'removeMergeCells', 'getMergeCells', 'clearMergeCells', 'setMergeFooterItems', 'removeMergeFooterItems', 'getMergeFooterItems', 'clearMergeFooterItems', 'getCustomStoreData', 'openTooltip', 'moveColumnTo', 'moveRowTo', 'getCellLabel', 'getCellElement', 'focus', 'blur', 'connect'];
|
|
32
32
|
const gridComponentEmits = [..._emits.default, 'page-change', 'form-submit', 'form-submit-invalid', 'form-reset', 'form-collapse', 'form-toggle-collapse', 'proxy-query', 'proxy-delete', 'proxy-save', 'toolbar-button-click', 'toolbar-tool-click', 'zoom'];
|
|
33
33
|
var _default = exports.default = (0, _vue.defineComponent)({
|
|
34
34
|
name: 'VxeGrid',
|
|
@@ -868,6 +868,9 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
868
868
|
};
|
|
869
869
|
const gridMethods = {
|
|
870
870
|
dispatchEvent,
|
|
871
|
+
getEl() {
|
|
872
|
+
return refElem.value;
|
|
873
|
+
},
|
|
871
874
|
/**
|
|
872
875
|
* 提交指令,支持 code 或 button
|
|
873
876
|
* @param {String/Object} code 字符串或对象
|
|
@@ -1407,18 +1410,23 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
1407
1410
|
isZMax
|
|
1408
1411
|
} = reactData;
|
|
1409
1412
|
const el = refElem.value;
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1413
|
+
if (el) {
|
|
1414
|
+
const formWrapper = refFormWrapper.value;
|
|
1415
|
+
const toolbarWrapper = refToolbarWrapper.value;
|
|
1416
|
+
const topWrapper = refTopWrapper.value;
|
|
1417
|
+
const bottomWrapper = refBottomWrapper.value;
|
|
1418
|
+
const pagerWrapper = refPagerWrapper.value;
|
|
1419
|
+
const parentEl = el.parentElement;
|
|
1420
|
+
const parentPaddingSize = isZMax ? 0 : parentEl ? (0, _dom.getPaddingTopBottomSize)(parentEl) : 0;
|
|
1421
|
+
return parentPaddingSize + (0, _dom.getPaddingTopBottomSize)(el) + (0, _dom.getOffsetHeight)(formWrapper) + (0, _dom.getOffsetHeight)(toolbarWrapper) + (0, _dom.getOffsetHeight)(topWrapper) + (0, _dom.getOffsetHeight)(bottomWrapper) + (0, _dom.getOffsetHeight)(pagerWrapper);
|
|
1422
|
+
}
|
|
1423
|
+
return 0;
|
|
1417
1424
|
},
|
|
1418
1425
|
getParentHeight() {
|
|
1419
1426
|
const el = refElem.value;
|
|
1420
1427
|
if (el) {
|
|
1421
|
-
|
|
1428
|
+
const parentEl = el.parentElement;
|
|
1429
|
+
return (reactData.isZMax ? (0, _dom.getDomNode)().visibleHeight : parentEl ? _xeUtils.default.toNumber(getComputedStyle(parentEl).height) : 0) - gridPrivateMethods.getExcludeHeight();
|
|
1422
1430
|
}
|
|
1423
1431
|
return 0;
|
|
1424
1432
|
},
|