vxe-table 4.11.17 → 4.11.19
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 -1
- package/es/style.css +1 -1
- package/es/table/render/index.js +88 -57
- package/es/table/src/body.js +11 -6
- package/es/table/src/footer.js +7 -2
- package/es/table/src/table.js +188 -67
- package/es/table/src/util.js +13 -3
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/grid/src/grid.js +4 -1
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.umd.js +335 -143
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/render/index.js +96 -62
- package/lib/table/render/index.min.js +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/table.js +203 -66
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +16 -6
- 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 +4 -1
- package/packages/table/render/index.ts +87 -55
- package/packages/table/src/body.ts +10 -5
- package/packages/table/src/footer.ts +7 -2
- package/packages/table/src/table.ts +187 -67
- package/packages/table/src/util.ts +15 -3
- /package/es/{iconfont.1741140593243.ttf → iconfont.1741333398347.ttf} +0 -0
- /package/es/{iconfont.1741140593243.woff → iconfont.1741333398347.woff} +0 -0
- /package/es/{iconfont.1741140593243.woff2 → iconfont.1741333398347.woff2} +0 -0
- /package/lib/{iconfont.1741140593243.ttf → iconfont.1741333398347.ttf} +0 -0
- /package/lib/{iconfont.1741140593243.woff → iconfont.1741333398347.woff} +0 -0
- /package/lib/{iconfont.1741140593243.woff2 → iconfont.1741333398347.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 } from './util';
|
|
12
|
+
import { getRowUniqueId, clearTableAllStatus, getRowkey, getRowid, rowToVisible, colToVisible, getCellValue, setCellValue, handleRowidOrRow, handleFieldOrColumn, toTreePathSeq, restoreScrollLocation, getRootColumn, getRefElem, getColReMinWidth } 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';
|
|
@@ -2715,7 +2715,7 @@ export default defineComponent({
|
|
|
2715
2715
|
// warnLog('vxe.error.reqProp', ['table.show-overflow'])
|
|
2716
2716
|
// }
|
|
2717
2717
|
if (props.spanMethod) {
|
|
2718
|
-
|
|
2718
|
+
errLog('vxe.error.scrollErrProp', ['table.span-method']);
|
|
2719
2719
|
}
|
|
2720
2720
|
}
|
|
2721
2721
|
handleReserveStatus();
|
|
@@ -3374,6 +3374,9 @@ export default defineComponent({
|
|
|
3374
3374
|
};
|
|
3375
3375
|
tableMethods = {
|
|
3376
3376
|
dispatchEvent,
|
|
3377
|
+
getEl() {
|
|
3378
|
+
return refElem.value;
|
|
3379
|
+
},
|
|
3377
3380
|
/**
|
|
3378
3381
|
* 重置表格的一切数据状态
|
|
3379
3382
|
*/
|
|
@@ -3693,12 +3696,12 @@ export default defineComponent({
|
|
|
3693
3696
|
*/
|
|
3694
3697
|
revertData(rows, field) {
|
|
3695
3698
|
const { keepSource, treeConfig } = props;
|
|
3696
|
-
const { fullAllDataRowIdData, tableSourceData, sourceDataRowIdData, tableFullData, afterFullData } = internalData;
|
|
3699
|
+
const { fullAllDataRowIdData, fullDataRowIdData, tableSourceData, sourceDataRowIdData, tableFullData, afterFullData } = internalData;
|
|
3697
3700
|
const treeOpts = computeTreeOpts.value;
|
|
3698
3701
|
const { transform } = treeOpts;
|
|
3699
3702
|
if (!keepSource) {
|
|
3700
3703
|
if (process.env.NODE_ENV === 'development') {
|
|
3701
|
-
|
|
3704
|
+
errLog('vxe.error.reqProp', ['keep-source']);
|
|
3702
3705
|
}
|
|
3703
3706
|
return nextTick();
|
|
3704
3707
|
}
|
|
@@ -3713,23 +3716,23 @@ export default defineComponent({
|
|
|
3713
3716
|
}
|
|
3714
3717
|
let reDelFlag = false;
|
|
3715
3718
|
if (targetRows.length) {
|
|
3716
|
-
targetRows.forEach((
|
|
3717
|
-
|
|
3718
|
-
|
|
3719
|
-
|
|
3720
|
-
|
|
3721
|
-
|
|
3722
|
-
|
|
3723
|
-
|
|
3724
|
-
|
|
3725
|
-
|
|
3726
|
-
|
|
3727
|
-
|
|
3728
|
-
|
|
3729
|
-
|
|
3730
|
-
|
|
3731
|
-
tableFullData.unshift(
|
|
3732
|
-
afterFullData.unshift(
|
|
3719
|
+
targetRows.forEach((item) => {
|
|
3720
|
+
const rowid = getRowid($xeTable, item);
|
|
3721
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
3722
|
+
if (rowRest) {
|
|
3723
|
+
const row = rowRest.row;
|
|
3724
|
+
if (!$xeTable.isInsertByRow(row)) {
|
|
3725
|
+
const oRow = sourceDataRowIdData[rowid];
|
|
3726
|
+
if (oRow && row) {
|
|
3727
|
+
if (field) {
|
|
3728
|
+
XEUtils.set(row, field, XEUtils.clone(XEUtils.get(oRow, field), true));
|
|
3729
|
+
}
|
|
3730
|
+
else {
|
|
3731
|
+
XEUtils.destructuring(row, XEUtils.clone(oRow, true));
|
|
3732
|
+
}
|
|
3733
|
+
if (!fullDataRowIdData[rowid] && $xeTable.isRemoveByRow(row)) {
|
|
3734
|
+
tableFullData.unshift(row);
|
|
3735
|
+
afterFullData.unshift(row);
|
|
3733
3736
|
reDelFlag = true;
|
|
3734
3737
|
}
|
|
3735
3738
|
}
|
|
@@ -3891,18 +3894,20 @@ export default defineComponent({
|
|
|
3891
3894
|
},
|
|
3892
3895
|
/**
|
|
3893
3896
|
* 检查行或列数据是否发生改变
|
|
3894
|
-
* @param {Row}
|
|
3897
|
+
* @param {Row} rowOrId 行对象
|
|
3895
3898
|
* @param {String} field 字段名
|
|
3896
3899
|
*/
|
|
3897
|
-
isUpdateByRow(
|
|
3900
|
+
isUpdateByRow(rowOrId, field) {
|
|
3898
3901
|
const { keepSource } = props;
|
|
3899
3902
|
const { tableFullColumn, fullDataRowIdData, sourceDataRowIdData } = internalData;
|
|
3900
3903
|
if (keepSource) {
|
|
3901
|
-
const rowid = getRowid($xeTable,
|
|
3904
|
+
const rowid = XEUtils.isString(rowOrId) || XEUtils.isNumber(rowOrId) ? rowOrId : getRowid($xeTable, rowOrId);
|
|
3905
|
+
const rowRest = fullDataRowIdData[rowid];
|
|
3902
3906
|
// 新增的数据不需要检测
|
|
3903
|
-
if (!
|
|
3907
|
+
if (!rowRest) {
|
|
3904
3908
|
return false;
|
|
3905
3909
|
}
|
|
3910
|
+
const row = rowRest.row;
|
|
3906
3911
|
const oRow = sourceDataRowIdData[rowid];
|
|
3907
3912
|
if (oRow) {
|
|
3908
3913
|
if (arguments.length > 1) {
|
|
@@ -3966,6 +3971,94 @@ export default defineComponent({
|
|
|
3966
3971
|
tableColumn: reactData.tableColumn.slice(0)
|
|
3967
3972
|
};
|
|
3968
3973
|
},
|
|
3974
|
+
/**
|
|
3975
|
+
* 移动列到指定列的位置
|
|
3976
|
+
* @param fieldOrColumn
|
|
3977
|
+
* @param targetFieldOrColumn
|
|
3978
|
+
* @param options
|
|
3979
|
+
*/
|
|
3980
|
+
moveColumnTo(fieldOrColumn, targetFieldOrColumn, options) {
|
|
3981
|
+
const { fullColumnIdData, visibleColumn } = internalData;
|
|
3982
|
+
const { dragToChild, dragPos, isCrossDrag } = Object.assign({}, options);
|
|
3983
|
+
const dragCol = handleFieldOrColumn($xeTable, fieldOrColumn);
|
|
3984
|
+
let prevDragCol = null;
|
|
3985
|
+
const colRest = dragCol ? fullColumnIdData[dragCol.id] : null;
|
|
3986
|
+
let defPos = 'left';
|
|
3987
|
+
if (XEUtils.isNumber(targetFieldOrColumn)) {
|
|
3988
|
+
if (colRest && targetFieldOrColumn) {
|
|
3989
|
+
let currList = colRest.items;
|
|
3990
|
+
let offsetIndex = colRest._index + targetFieldOrColumn;
|
|
3991
|
+
if (isCrossDrag) {
|
|
3992
|
+
currList = visibleColumn;
|
|
3993
|
+
offsetIndex = colRest._index + targetFieldOrColumn;
|
|
3994
|
+
}
|
|
3995
|
+
if (offsetIndex > 0 && offsetIndex < currList.length - 1) {
|
|
3996
|
+
prevDragCol = currList[offsetIndex];
|
|
3997
|
+
}
|
|
3998
|
+
if (targetFieldOrColumn > 0) {
|
|
3999
|
+
defPos = 'right';
|
|
4000
|
+
}
|
|
4001
|
+
}
|
|
4002
|
+
}
|
|
4003
|
+
else {
|
|
4004
|
+
prevDragCol = handleFieldOrColumn($xeTable, targetFieldOrColumn);
|
|
4005
|
+
const targetColRest = prevDragCol ? fullColumnIdData[prevDragCol.id] : null;
|
|
4006
|
+
if (colRest && targetColRest) {
|
|
4007
|
+
if (targetColRest._index > colRest._index) {
|
|
4008
|
+
defPos = 'right';
|
|
4009
|
+
}
|
|
4010
|
+
}
|
|
4011
|
+
}
|
|
4012
|
+
return $xeTable.handleColDragSwapEvent(null, true, dragCol, prevDragCol, dragPos || defPos, dragToChild === true);
|
|
4013
|
+
},
|
|
4014
|
+
/**
|
|
4015
|
+
* 移动行到指定行的位置
|
|
4016
|
+
* @param rowidOrRow
|
|
4017
|
+
* @param targetRowidOrRow
|
|
4018
|
+
* @param options
|
|
4019
|
+
*/
|
|
4020
|
+
moveRowTo(rowidOrRow, targetRowidOrRow, options) {
|
|
4021
|
+
const { treeConfig } = props;
|
|
4022
|
+
const { fullAllDataRowIdData, afterFullData } = internalData;
|
|
4023
|
+
const { dragToChild, dragPos, isCrossDrag } = Object.assign({}, options);
|
|
4024
|
+
const treeOpts = computeTreeOpts.value;
|
|
4025
|
+
const dragRow = handleRowidOrRow($xeTable, rowidOrRow);
|
|
4026
|
+
let prevDragRow = null;
|
|
4027
|
+
let defPos = 'top';
|
|
4028
|
+
const rowRest = dragRow ? fullAllDataRowIdData[getRowid($xeTable, dragRow)] : null;
|
|
4029
|
+
if (XEUtils.isNumber(targetRowidOrRow)) {
|
|
4030
|
+
if (rowRest && targetRowidOrRow) {
|
|
4031
|
+
let currList = afterFullData;
|
|
4032
|
+
let offsetIndex = rowRest._index + targetRowidOrRow;
|
|
4033
|
+
if (treeConfig) {
|
|
4034
|
+
currList = rowRest.items;
|
|
4035
|
+
if (treeOpts.transform) {
|
|
4036
|
+
offsetIndex = rowRest.treeIndex + targetRowidOrRow;
|
|
4037
|
+
if (isCrossDrag) {
|
|
4038
|
+
currList = afterFullData;
|
|
4039
|
+
offsetIndex = rowRest._index + targetRowidOrRow;
|
|
4040
|
+
}
|
|
4041
|
+
}
|
|
4042
|
+
}
|
|
4043
|
+
if (offsetIndex >= 0 && offsetIndex <= currList.length - 1) {
|
|
4044
|
+
prevDragRow = currList[offsetIndex];
|
|
4045
|
+
}
|
|
4046
|
+
if (targetRowidOrRow > 0) {
|
|
4047
|
+
defPos = 'bottom';
|
|
4048
|
+
}
|
|
4049
|
+
}
|
|
4050
|
+
}
|
|
4051
|
+
else {
|
|
4052
|
+
prevDragRow = handleRowidOrRow($xeTable, targetRowidOrRow);
|
|
4053
|
+
const targetRowRest = prevDragRow ? fullAllDataRowIdData[getRowid($xeTable, prevDragRow)] : null;
|
|
4054
|
+
if (rowRest && targetRowRest) {
|
|
4055
|
+
if (targetRowRest._index > rowRest._index) {
|
|
4056
|
+
defPos = 'bottom';
|
|
4057
|
+
}
|
|
4058
|
+
}
|
|
4059
|
+
}
|
|
4060
|
+
return $xeTable.handleRowDragSwapEvent(null, true, dragRow, prevDragRow, dragPos || defPos, dragToChild === true);
|
|
4061
|
+
},
|
|
3969
4062
|
/**
|
|
3970
4063
|
* 获取表格的全量列
|
|
3971
4064
|
*/
|
|
@@ -6596,7 +6689,16 @@ export default defineComponent({
|
|
|
6596
6689
|
if (el) {
|
|
6597
6690
|
const parentElem = el.parentNode;
|
|
6598
6691
|
const parentPaddingSize = height === '100%' || height === 'auto' ? getPaddingTopBottomSize(parentElem) : 0;
|
|
6599
|
-
|
|
6692
|
+
let parentWrapperHeight = 0;
|
|
6693
|
+
if (parentElem) {
|
|
6694
|
+
if ($xeGrid && hasClass(parentElem, 'vxe-grid--table-wrapper')) {
|
|
6695
|
+
parentWrapperHeight = $xeGrid.getParentHeight();
|
|
6696
|
+
}
|
|
6697
|
+
else {
|
|
6698
|
+
parentWrapperHeight = parentElem.clientHeight;
|
|
6699
|
+
}
|
|
6700
|
+
}
|
|
6701
|
+
return Math.floor(parentWrapperHeight - parentPaddingSize);
|
|
6600
6702
|
}
|
|
6601
6703
|
return 0;
|
|
6602
6704
|
},
|
|
@@ -8030,6 +8132,9 @@ export default defineComponent({
|
|
|
8030
8132
|
const { afterFullData, tableFullData } = internalData;
|
|
8031
8133
|
const dEndMethod = dragEndMethod || (dragConfig ? dragConfig.dragEndMethod : null);
|
|
8032
8134
|
const dragOffsetIndex = prevDragPos === 'bottom' ? 1 : 0;
|
|
8135
|
+
const errRest = {
|
|
8136
|
+
status: false
|
|
8137
|
+
};
|
|
8033
8138
|
if (prevDragRow && dragRow) {
|
|
8034
8139
|
// 判断是否有拖动
|
|
8035
8140
|
if (prevDragRow !== dragRow) {
|
|
@@ -8044,7 +8149,7 @@ export default defineComponent({
|
|
|
8044
8149
|
const isDragToChildFlag = isSelfToChildDrag && dragToChildMethod ? dragToChildMethod(dragParams) : prevDragToChild;
|
|
8045
8150
|
return Promise.resolve(dEndMethod ? dEndMethod(dragParams) : true).then((status) => {
|
|
8046
8151
|
if (!status) {
|
|
8047
|
-
return;
|
|
8152
|
+
return errRest;
|
|
8048
8153
|
}
|
|
8049
8154
|
let oafIndex = -1;
|
|
8050
8155
|
let nafIndex = -1;
|
|
@@ -8069,12 +8174,12 @@ export default defineComponent({
|
|
|
8069
8174
|
if (isPeerDrag && !isCrossDrag) {
|
|
8070
8175
|
if (oldRest.row[parentField] !== newRest.row[parentField]) {
|
|
8071
8176
|
// 非同级
|
|
8072
|
-
return;
|
|
8177
|
+
return errRest;
|
|
8073
8178
|
}
|
|
8074
8179
|
}
|
|
8075
8180
|
else {
|
|
8076
8181
|
if (!isCrossDrag) {
|
|
8077
|
-
return;
|
|
8182
|
+
return errRest;
|
|
8078
8183
|
}
|
|
8079
8184
|
if (oldAllMaps[newRowid]) {
|
|
8080
8185
|
isSelfToChildStatus = true;
|
|
@@ -8085,7 +8190,7 @@ export default defineComponent({
|
|
|
8085
8190
|
content: getI18n('vxe.error.treeDragChild')
|
|
8086
8191
|
});
|
|
8087
8192
|
}
|
|
8088
|
-
return;
|
|
8193
|
+
return errRest;
|
|
8089
8194
|
}
|
|
8090
8195
|
}
|
|
8091
8196
|
}
|
|
@@ -8093,13 +8198,13 @@ export default defineComponent({
|
|
|
8093
8198
|
else if (oldLevel) {
|
|
8094
8199
|
// 子到根
|
|
8095
8200
|
if (!isCrossDrag) {
|
|
8096
|
-
return;
|
|
8201
|
+
return errRest;
|
|
8097
8202
|
}
|
|
8098
8203
|
}
|
|
8099
8204
|
else if (newLevel) {
|
|
8100
8205
|
// 根到子
|
|
8101
8206
|
if (!isCrossDrag) {
|
|
8102
|
-
return;
|
|
8207
|
+
return errRest;
|
|
8103
8208
|
}
|
|
8104
8209
|
if (oldAllMaps[newRowid]) {
|
|
8105
8210
|
isSelfToChildStatus = true;
|
|
@@ -8110,7 +8215,7 @@ export default defineComponent({
|
|
|
8110
8215
|
content: getI18n('vxe.error.treeDragChild')
|
|
8111
8216
|
});
|
|
8112
8217
|
}
|
|
8113
|
-
return;
|
|
8218
|
+
return errRest;
|
|
8114
8219
|
}
|
|
8115
8220
|
}
|
|
8116
8221
|
}
|
|
@@ -8170,27 +8275,34 @@ export default defineComponent({
|
|
|
8170
8275
|
if (reactData.scrollYLoad) {
|
|
8171
8276
|
$xeTable.updateScrollYSpace();
|
|
8172
8277
|
}
|
|
8173
|
-
|
|
8278
|
+
if (evnt) {
|
|
8279
|
+
dispatchEvent('row-dragend', {
|
|
8280
|
+
oldRow: dragRow,
|
|
8281
|
+
newRow: prevDragRow,
|
|
8282
|
+
dragRow,
|
|
8283
|
+
dragPos: prevDragPos,
|
|
8284
|
+
dragToChild: isDragToChildFlag,
|
|
8285
|
+
offsetIndex: dragOffsetIndex,
|
|
8286
|
+
_index: {
|
|
8287
|
+
newIndex: nafIndex,
|
|
8288
|
+
oldIndex: oafIndex
|
|
8289
|
+
}
|
|
8290
|
+
}, evnt);
|
|
8291
|
+
}
|
|
8292
|
+
return nextTick().then(() => {
|
|
8174
8293
|
$xeTable.updateCellAreas();
|
|
8175
8294
|
$xeTable.recalculate();
|
|
8295
|
+
}).then(() => {
|
|
8296
|
+
return {
|
|
8297
|
+
status: true
|
|
8298
|
+
};
|
|
8176
8299
|
});
|
|
8177
|
-
dispatchEvent('row-dragend', {
|
|
8178
|
-
oldRow: dragRow,
|
|
8179
|
-
newRow: prevDragRow,
|
|
8180
|
-
dragRow,
|
|
8181
|
-
dragPos: prevDragPos,
|
|
8182
|
-
dragToChild: isDragToChildFlag,
|
|
8183
|
-
offsetIndex: dragOffsetIndex,
|
|
8184
|
-
_index: {
|
|
8185
|
-
newIndex: nafIndex,
|
|
8186
|
-
oldIndex: oafIndex
|
|
8187
|
-
}
|
|
8188
|
-
}, evnt);
|
|
8189
8300
|
}).catch(() => {
|
|
8301
|
+
return errRest;
|
|
8190
8302
|
});
|
|
8191
8303
|
}
|
|
8192
8304
|
}
|
|
8193
|
-
return Promise.resolve();
|
|
8305
|
+
return Promise.resolve(errRest);
|
|
8194
8306
|
},
|
|
8195
8307
|
handleRowDragDragendEvent(evnt) {
|
|
8196
8308
|
const { treeConfig } = props;
|
|
@@ -8317,6 +8429,9 @@ export default defineComponent({
|
|
|
8317
8429
|
const { isPeerDrag, isCrossDrag, isSelfToChildDrag, isToChildDrag, dragEndMethod, dragToChildMethod } = columnDragOpts;
|
|
8318
8430
|
const { collectColumn } = internalData;
|
|
8319
8431
|
const dragOffsetIndex = prevDragPos === 'right' ? 1 : 0;
|
|
8432
|
+
const errRest = {
|
|
8433
|
+
status: false
|
|
8434
|
+
};
|
|
8320
8435
|
if (prevDragCol && dragCol) {
|
|
8321
8436
|
// 判断是否有拖动
|
|
8322
8437
|
if (prevDragCol !== dragCol) {
|
|
@@ -8333,7 +8448,7 @@ export default defineComponent({
|
|
|
8333
8448
|
const isDragToChildFlag = isSelfToChildDrag && dragToChildMethod ? dragToChildMethod(dragParams) : prevDragToChild;
|
|
8334
8449
|
return Promise.resolve(dragEndMethod ? dragEndMethod(dragParams) : true).then((status) => {
|
|
8335
8450
|
if (!status) {
|
|
8336
|
-
return;
|
|
8451
|
+
return errRest;
|
|
8337
8452
|
}
|
|
8338
8453
|
let oafIndex = -1;
|
|
8339
8454
|
let nafIndex = -1;
|
|
@@ -8347,12 +8462,12 @@ export default defineComponent({
|
|
|
8347
8462
|
if (isPeerDrag && !isCrossDrag) {
|
|
8348
8463
|
if (dragColumn.parentId !== newColumn.parentId) {
|
|
8349
8464
|
// 非同级
|
|
8350
|
-
return;
|
|
8465
|
+
return errRest;
|
|
8351
8466
|
}
|
|
8352
8467
|
}
|
|
8353
8468
|
else {
|
|
8354
8469
|
if (!isCrossDrag) {
|
|
8355
|
-
return;
|
|
8470
|
+
return errRest;
|
|
8356
8471
|
}
|
|
8357
8472
|
if (oldAllMaps[newColumn.id]) {
|
|
8358
8473
|
isSelfToChildStatus = true;
|
|
@@ -8363,7 +8478,7 @@ export default defineComponent({
|
|
|
8363
8478
|
content: getI18n('vxe.error.treeDragChild')
|
|
8364
8479
|
});
|
|
8365
8480
|
}
|
|
8366
|
-
return;
|
|
8481
|
+
return errRest;
|
|
8367
8482
|
}
|
|
8368
8483
|
}
|
|
8369
8484
|
}
|
|
@@ -8371,13 +8486,13 @@ export default defineComponent({
|
|
|
8371
8486
|
else if (dragColumn.parentId) {
|
|
8372
8487
|
// 子到根
|
|
8373
8488
|
if (!isCrossDrag) {
|
|
8374
|
-
return;
|
|
8489
|
+
return errRest;
|
|
8375
8490
|
}
|
|
8376
8491
|
}
|
|
8377
8492
|
else if (newColumn.parentId) {
|
|
8378
8493
|
// 根到子
|
|
8379
8494
|
if (!isCrossDrag) {
|
|
8380
|
-
return;
|
|
8495
|
+
return errRest;
|
|
8381
8496
|
}
|
|
8382
8497
|
if (oldAllMaps[newColumn.id]) {
|
|
8383
8498
|
isSelfToChildStatus = true;
|
|
@@ -8388,7 +8503,7 @@ export default defineComponent({
|
|
|
8388
8503
|
content: getI18n('vxe.error.treeDragChild')
|
|
8389
8504
|
});
|
|
8390
8505
|
}
|
|
8391
|
-
return;
|
|
8506
|
+
return errRest;
|
|
8392
8507
|
}
|
|
8393
8508
|
}
|
|
8394
8509
|
}
|
|
@@ -8449,26 +8564,32 @@ export default defineComponent({
|
|
|
8449
8564
|
$xeTable.clearCopyCellArea();
|
|
8450
8565
|
}
|
|
8451
8566
|
}
|
|
8452
|
-
|
|
8453
|
-
|
|
8454
|
-
|
|
8455
|
-
|
|
8456
|
-
|
|
8457
|
-
|
|
8458
|
-
|
|
8459
|
-
|
|
8460
|
-
|
|
8461
|
-
|
|
8462
|
-
|
|
8463
|
-
|
|
8567
|
+
if (evnt) {
|
|
8568
|
+
dispatchEvent('column-dragend', {
|
|
8569
|
+
oldColumn: dragColumn,
|
|
8570
|
+
newColumn,
|
|
8571
|
+
dragColumn,
|
|
8572
|
+
dragPos: prevDragPos,
|
|
8573
|
+
dragToChild: isDragToChildFlag,
|
|
8574
|
+
offsetIndex: dragOffsetIndex,
|
|
8575
|
+
_index: {
|
|
8576
|
+
newIndex: nafIndex,
|
|
8577
|
+
oldIndex: oafIndex
|
|
8578
|
+
}
|
|
8579
|
+
}, evnt);
|
|
8580
|
+
}
|
|
8464
8581
|
if (isSyncColumn) {
|
|
8465
8582
|
$xeTable.handleColDragSwapColumn();
|
|
8466
8583
|
}
|
|
8584
|
+
return {
|
|
8585
|
+
status: true
|
|
8586
|
+
};
|
|
8467
8587
|
}).catch(() => {
|
|
8588
|
+
return errRest;
|
|
8468
8589
|
});
|
|
8469
8590
|
}
|
|
8470
8591
|
}
|
|
8471
|
-
return Promise.resolve();
|
|
8592
|
+
return Promise.resolve(errRest);
|
|
8472
8593
|
},
|
|
8473
8594
|
handleHeaderCellDragDragendEvent(evnt) {
|
|
8474
8595
|
const { dragCol } = reactData;
|
package/es/table/src/util.js
CHANGED
|
@@ -90,14 +90,17 @@ export function getRowUniqueId() {
|
|
|
90
90
|
export function getRowkey($xeTable) {
|
|
91
91
|
const { props } = $xeTable;
|
|
92
92
|
const { computeRowOpts } = $xeTable.getComputeMaps();
|
|
93
|
-
const { rowId } = props;
|
|
94
93
|
const rowOpts = computeRowOpts.value;
|
|
95
|
-
return rowId || rowOpts.keyField || '_X_ROW_KEY'
|
|
94
|
+
return `${props.rowId || rowOpts.keyField || '_X_ROW_KEY'}`;
|
|
96
95
|
}
|
|
97
96
|
// 行主键 value
|
|
98
97
|
export function getRowid($xeTable, row) {
|
|
99
98
|
const rowid = XEUtils.get(row, getRowkey($xeTable));
|
|
100
|
-
return
|
|
99
|
+
return encodeRowid(rowid);
|
|
100
|
+
}
|
|
101
|
+
// 编码行主键
|
|
102
|
+
export function encodeRowid(rowVal) {
|
|
103
|
+
return XEUtils.eqNull(rowVal) ? '' : encodeURIComponent(rowVal);
|
|
101
104
|
}
|
|
102
105
|
export const handleFieldOrColumn = ($xeTable, fieldOrColumn) => {
|
|
103
106
|
if (fieldOrColumn) {
|
|
@@ -105,6 +108,13 @@ export const handleFieldOrColumn = ($xeTable, fieldOrColumn) => {
|
|
|
105
108
|
}
|
|
106
109
|
return null;
|
|
107
110
|
};
|
|
111
|
+
export const handleRowidOrRow = ($xeTable, rowidOrRow) => {
|
|
112
|
+
if (rowidOrRow) {
|
|
113
|
+
const rowid = XEUtils.isString(rowidOrRow) || XEUtils.isNumber(rowidOrRow) ? rowidOrRow : getRowid($xeTable, rowidOrRow);
|
|
114
|
+
return $xeTable.getRowById(rowid);
|
|
115
|
+
}
|
|
116
|
+
return null;
|
|
117
|
+
};
|
|
108
118
|
function getPaddingLeftRightSize(elem) {
|
|
109
119
|
if (elem) {
|
|
110
120
|
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', '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',
|
|
@@ -870,6 +870,9 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
870
870
|
};
|
|
871
871
|
const gridMethods = {
|
|
872
872
|
dispatchEvent,
|
|
873
|
+
getEl() {
|
|
874
|
+
return refElem.value;
|
|
875
|
+
},
|
|
873
876
|
/**
|
|
874
877
|
* 提交指令,支持 code 或 button
|
|
875
878
|
* @param {String/Object} code 字符串或对象
|