vxe-table 4.11.18 → 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/src/body.js +11 -6
- package/es/table/src/footer.js +7 -2
- package/es/table/src/table.js +158 -46
- 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 +211 -62
- 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/table.js +175 -47
- 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/src/body.ts +10 -5
- package/packages/table/src/footer.ts +7 -2
- package/packages/table/src/table.ts +159 -47
- package/packages/table/src/util.ts +15 -3
- /package/es/{iconfont.1741224125327.ttf → iconfont.1741333398347.ttf} +0 -0
- /package/es/{iconfont.1741224125327.woff → iconfont.1741333398347.woff} +0 -0
- /package/es/{iconfont.1741224125327.woff2 → iconfont.1741333398347.woff2} +0 -0
- /package/lib/{iconfont.1741224125327.ttf → iconfont.1741333398347.ttf} +0 -0
- /package/lib/{iconfont.1741224125327.woff → iconfont.1741333398347.woff} +0 -0
- /package/lib/{iconfont.1741224125327.woff2 → iconfont.1741333398347.woff2} +0 -0
package/es/table/src/body.js
CHANGED
|
@@ -205,6 +205,7 @@ export default defineComponent({
|
|
|
205
205
|
tdOns.onDblclick = (evnt) => {
|
|
206
206
|
$xeTable.triggerCellDblclickEvent(evnt, cellParams);
|
|
207
207
|
};
|
|
208
|
+
let isMergeCell = false;
|
|
208
209
|
// 合并行或列
|
|
209
210
|
if (mergeList.length) {
|
|
210
211
|
const spanRest = mergeBodyMethod(mergeList, _rowIndex, _columnIndex);
|
|
@@ -214,9 +215,11 @@ export default defineComponent({
|
|
|
214
215
|
return null;
|
|
215
216
|
}
|
|
216
217
|
if (rowspan > 1) {
|
|
218
|
+
isMergeCell = true;
|
|
217
219
|
tdAttrs.rowspan = rowspan;
|
|
218
220
|
}
|
|
219
221
|
if (colspan > 1) {
|
|
222
|
+
isMergeCell = true;
|
|
220
223
|
tdAttrs.colspan = colspan;
|
|
221
224
|
}
|
|
222
225
|
}
|
|
@@ -249,12 +252,14 @@ export default defineComponent({
|
|
|
249
252
|
const isLastColumn = $columnIndex === columns.length - 1;
|
|
250
253
|
const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto');
|
|
251
254
|
let isVNPreEmptyStatus = false;
|
|
252
|
-
if (!
|
|
253
|
-
if (
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
255
|
+
if (!isMergeCell) {
|
|
256
|
+
if (!dragRow || getRowid($xeTable, dragRow) !== rowid) {
|
|
257
|
+
if (scrollYLoad && (_rowIndex < scrollYStore.visibleStartIndex - scrollYStore.preloadSize || _rowIndex > scrollYStore.visibleEndIndex + scrollYStore.preloadSize)) {
|
|
258
|
+
isVNPreEmptyStatus = true;
|
|
259
|
+
}
|
|
260
|
+
else if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
|
|
261
|
+
isVNPreEmptyStatus = true;
|
|
262
|
+
}
|
|
258
263
|
}
|
|
259
264
|
}
|
|
260
265
|
const tcStyle = {};
|
package/es/table/src/footer.js
CHANGED
|
@@ -126,6 +126,7 @@ export default defineComponent({
|
|
|
126
126
|
tfOns.onDblclick = (evnt) => {
|
|
127
127
|
$xeTable.dispatchEvent('footer-cell-dblclick', Object.assign({ cell: evnt.currentTarget }, cellParams), evnt);
|
|
128
128
|
};
|
|
129
|
+
let isMergeCell = false;
|
|
129
130
|
// 合并行或列
|
|
130
131
|
if (mergeFooterList.length) {
|
|
131
132
|
const spanRest = mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex);
|
|
@@ -135,9 +136,11 @@ export default defineComponent({
|
|
|
135
136
|
return null;
|
|
136
137
|
}
|
|
137
138
|
if (rowspan > 1) {
|
|
139
|
+
isMergeCell = true;
|
|
138
140
|
attrs.rowspan = rowspan;
|
|
139
141
|
}
|
|
140
142
|
if (colspan > 1) {
|
|
143
|
+
isMergeCell = true;
|
|
141
144
|
attrs.colspan = colspan;
|
|
142
145
|
}
|
|
143
146
|
}
|
|
@@ -158,8 +161,10 @@ export default defineComponent({
|
|
|
158
161
|
const isLastColumn = $columnIndex === tableColumn.length - 1;
|
|
159
162
|
const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto');
|
|
160
163
|
let isVNPreEmptyStatus = false;
|
|
161
|
-
if (
|
|
162
|
-
|
|
164
|
+
if (!isMergeCell) {
|
|
165
|
+
if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
|
|
166
|
+
isVNPreEmptyStatus = true;
|
|
167
|
+
}
|
|
163
168
|
}
|
|
164
169
|
const tcStyle = {};
|
|
165
170
|
if (hasEllipsis) {
|
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';
|
|
@@ -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
|
*/
|
|
@@ -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
|
*/
|
|
@@ -8039,6 +8132,9 @@ export default defineComponent({
|
|
|
8039
8132
|
const { afterFullData, tableFullData } = internalData;
|
|
8040
8133
|
const dEndMethod = dragEndMethod || (dragConfig ? dragConfig.dragEndMethod : null);
|
|
8041
8134
|
const dragOffsetIndex = prevDragPos === 'bottom' ? 1 : 0;
|
|
8135
|
+
const errRest = {
|
|
8136
|
+
status: false
|
|
8137
|
+
};
|
|
8042
8138
|
if (prevDragRow && dragRow) {
|
|
8043
8139
|
// 判断是否有拖动
|
|
8044
8140
|
if (prevDragRow !== dragRow) {
|
|
@@ -8053,7 +8149,7 @@ export default defineComponent({
|
|
|
8053
8149
|
const isDragToChildFlag = isSelfToChildDrag && dragToChildMethod ? dragToChildMethod(dragParams) : prevDragToChild;
|
|
8054
8150
|
return Promise.resolve(dEndMethod ? dEndMethod(dragParams) : true).then((status) => {
|
|
8055
8151
|
if (!status) {
|
|
8056
|
-
return;
|
|
8152
|
+
return errRest;
|
|
8057
8153
|
}
|
|
8058
8154
|
let oafIndex = -1;
|
|
8059
8155
|
let nafIndex = -1;
|
|
@@ -8078,12 +8174,12 @@ export default defineComponent({
|
|
|
8078
8174
|
if (isPeerDrag && !isCrossDrag) {
|
|
8079
8175
|
if (oldRest.row[parentField] !== newRest.row[parentField]) {
|
|
8080
8176
|
// 非同级
|
|
8081
|
-
return;
|
|
8177
|
+
return errRest;
|
|
8082
8178
|
}
|
|
8083
8179
|
}
|
|
8084
8180
|
else {
|
|
8085
8181
|
if (!isCrossDrag) {
|
|
8086
|
-
return;
|
|
8182
|
+
return errRest;
|
|
8087
8183
|
}
|
|
8088
8184
|
if (oldAllMaps[newRowid]) {
|
|
8089
8185
|
isSelfToChildStatus = true;
|
|
@@ -8094,7 +8190,7 @@ export default defineComponent({
|
|
|
8094
8190
|
content: getI18n('vxe.error.treeDragChild')
|
|
8095
8191
|
});
|
|
8096
8192
|
}
|
|
8097
|
-
return;
|
|
8193
|
+
return errRest;
|
|
8098
8194
|
}
|
|
8099
8195
|
}
|
|
8100
8196
|
}
|
|
@@ -8102,13 +8198,13 @@ export default defineComponent({
|
|
|
8102
8198
|
else if (oldLevel) {
|
|
8103
8199
|
// 子到根
|
|
8104
8200
|
if (!isCrossDrag) {
|
|
8105
|
-
return;
|
|
8201
|
+
return errRest;
|
|
8106
8202
|
}
|
|
8107
8203
|
}
|
|
8108
8204
|
else if (newLevel) {
|
|
8109
8205
|
// 根到子
|
|
8110
8206
|
if (!isCrossDrag) {
|
|
8111
|
-
return;
|
|
8207
|
+
return errRest;
|
|
8112
8208
|
}
|
|
8113
8209
|
if (oldAllMaps[newRowid]) {
|
|
8114
8210
|
isSelfToChildStatus = true;
|
|
@@ -8119,7 +8215,7 @@ export default defineComponent({
|
|
|
8119
8215
|
content: getI18n('vxe.error.treeDragChild')
|
|
8120
8216
|
});
|
|
8121
8217
|
}
|
|
8122
|
-
return;
|
|
8218
|
+
return errRest;
|
|
8123
8219
|
}
|
|
8124
8220
|
}
|
|
8125
8221
|
}
|
|
@@ -8179,27 +8275,34 @@ export default defineComponent({
|
|
|
8179
8275
|
if (reactData.scrollYLoad) {
|
|
8180
8276
|
$xeTable.updateScrollYSpace();
|
|
8181
8277
|
}
|
|
8182
|
-
|
|
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(() => {
|
|
8183
8293
|
$xeTable.updateCellAreas();
|
|
8184
8294
|
$xeTable.recalculate();
|
|
8295
|
+
}).then(() => {
|
|
8296
|
+
return {
|
|
8297
|
+
status: true
|
|
8298
|
+
};
|
|
8185
8299
|
});
|
|
8186
|
-
dispatchEvent('row-dragend', {
|
|
8187
|
-
oldRow: dragRow,
|
|
8188
|
-
newRow: prevDragRow,
|
|
8189
|
-
dragRow,
|
|
8190
|
-
dragPos: prevDragPos,
|
|
8191
|
-
dragToChild: isDragToChildFlag,
|
|
8192
|
-
offsetIndex: dragOffsetIndex,
|
|
8193
|
-
_index: {
|
|
8194
|
-
newIndex: nafIndex,
|
|
8195
|
-
oldIndex: oafIndex
|
|
8196
|
-
}
|
|
8197
|
-
}, evnt);
|
|
8198
8300
|
}).catch(() => {
|
|
8301
|
+
return errRest;
|
|
8199
8302
|
});
|
|
8200
8303
|
}
|
|
8201
8304
|
}
|
|
8202
|
-
return Promise.resolve();
|
|
8305
|
+
return Promise.resolve(errRest);
|
|
8203
8306
|
},
|
|
8204
8307
|
handleRowDragDragendEvent(evnt) {
|
|
8205
8308
|
const { treeConfig } = props;
|
|
@@ -8326,6 +8429,9 @@ export default defineComponent({
|
|
|
8326
8429
|
const { isPeerDrag, isCrossDrag, isSelfToChildDrag, isToChildDrag, dragEndMethod, dragToChildMethod } = columnDragOpts;
|
|
8327
8430
|
const { collectColumn } = internalData;
|
|
8328
8431
|
const dragOffsetIndex = prevDragPos === 'right' ? 1 : 0;
|
|
8432
|
+
const errRest = {
|
|
8433
|
+
status: false
|
|
8434
|
+
};
|
|
8329
8435
|
if (prevDragCol && dragCol) {
|
|
8330
8436
|
// 判断是否有拖动
|
|
8331
8437
|
if (prevDragCol !== dragCol) {
|
|
@@ -8342,7 +8448,7 @@ export default defineComponent({
|
|
|
8342
8448
|
const isDragToChildFlag = isSelfToChildDrag && dragToChildMethod ? dragToChildMethod(dragParams) : prevDragToChild;
|
|
8343
8449
|
return Promise.resolve(dragEndMethod ? dragEndMethod(dragParams) : true).then((status) => {
|
|
8344
8450
|
if (!status) {
|
|
8345
|
-
return;
|
|
8451
|
+
return errRest;
|
|
8346
8452
|
}
|
|
8347
8453
|
let oafIndex = -1;
|
|
8348
8454
|
let nafIndex = -1;
|
|
@@ -8356,12 +8462,12 @@ export default defineComponent({
|
|
|
8356
8462
|
if (isPeerDrag && !isCrossDrag) {
|
|
8357
8463
|
if (dragColumn.parentId !== newColumn.parentId) {
|
|
8358
8464
|
// 非同级
|
|
8359
|
-
return;
|
|
8465
|
+
return errRest;
|
|
8360
8466
|
}
|
|
8361
8467
|
}
|
|
8362
8468
|
else {
|
|
8363
8469
|
if (!isCrossDrag) {
|
|
8364
|
-
return;
|
|
8470
|
+
return errRest;
|
|
8365
8471
|
}
|
|
8366
8472
|
if (oldAllMaps[newColumn.id]) {
|
|
8367
8473
|
isSelfToChildStatus = true;
|
|
@@ -8372,7 +8478,7 @@ export default defineComponent({
|
|
|
8372
8478
|
content: getI18n('vxe.error.treeDragChild')
|
|
8373
8479
|
});
|
|
8374
8480
|
}
|
|
8375
|
-
return;
|
|
8481
|
+
return errRest;
|
|
8376
8482
|
}
|
|
8377
8483
|
}
|
|
8378
8484
|
}
|
|
@@ -8380,13 +8486,13 @@ export default defineComponent({
|
|
|
8380
8486
|
else if (dragColumn.parentId) {
|
|
8381
8487
|
// 子到根
|
|
8382
8488
|
if (!isCrossDrag) {
|
|
8383
|
-
return;
|
|
8489
|
+
return errRest;
|
|
8384
8490
|
}
|
|
8385
8491
|
}
|
|
8386
8492
|
else if (newColumn.parentId) {
|
|
8387
8493
|
// 根到子
|
|
8388
8494
|
if (!isCrossDrag) {
|
|
8389
|
-
return;
|
|
8495
|
+
return errRest;
|
|
8390
8496
|
}
|
|
8391
8497
|
if (oldAllMaps[newColumn.id]) {
|
|
8392
8498
|
isSelfToChildStatus = true;
|
|
@@ -8397,7 +8503,7 @@ export default defineComponent({
|
|
|
8397
8503
|
content: getI18n('vxe.error.treeDragChild')
|
|
8398
8504
|
});
|
|
8399
8505
|
}
|
|
8400
|
-
return;
|
|
8506
|
+
return errRest;
|
|
8401
8507
|
}
|
|
8402
8508
|
}
|
|
8403
8509
|
}
|
|
@@ -8458,26 +8564,32 @@ export default defineComponent({
|
|
|
8458
8564
|
$xeTable.clearCopyCellArea();
|
|
8459
8565
|
}
|
|
8460
8566
|
}
|
|
8461
|
-
|
|
8462
|
-
|
|
8463
|
-
|
|
8464
|
-
|
|
8465
|
-
|
|
8466
|
-
|
|
8467
|
-
|
|
8468
|
-
|
|
8469
|
-
|
|
8470
|
-
|
|
8471
|
-
|
|
8472
|
-
|
|
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
|
+
}
|
|
8473
8581
|
if (isSyncColumn) {
|
|
8474
8582
|
$xeTable.handleColDragSwapColumn();
|
|
8475
8583
|
}
|
|
8584
|
+
return {
|
|
8585
|
+
status: true
|
|
8586
|
+
};
|
|
8476
8587
|
}).catch(() => {
|
|
8588
|
+
return errRest;
|
|
8477
8589
|
});
|
|
8478
8590
|
}
|
|
8479
8591
|
}
|
|
8480
|
-
return Promise.resolve();
|
|
8592
|
+
return Promise.resolve(errRest);
|
|
8481
8593
|
},
|
|
8482
8594
|
handleHeaderCellDragDragendEvent(evnt) {
|
|
8483
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 字符串或对象
|