vxe-table 3.20.13 → 3.21.0-beta.1
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/style.css +1 -1
- package/es/table/module/edit/mixin.js +33 -12
- package/es/table/module/keyboard/mixin.js +2 -2
- package/es/table/src/cell.js +3 -3
- package/es/table/src/column.js +10 -5
- package/es/table/src/group.js +10 -5
- package/es/table/src/methods.js +382 -169
- package/es/table/src/props.js +2 -2
- package/es/table/src/table.js +13 -6
- package/es/table/src/util.js +12 -3
- package/es/toolbar/src/toolbar.js +3 -2
- package/es/ui/index.js +3 -3
- package/es/ui/src/dom.js +4 -0
- package/es/ui/src/log.js +1 -1
- package/lib/index.umd.js +377 -310
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/module/edit/mixin.js +39 -12
- package/lib/table/module/edit/mixin.min.js +1 -1
- package/lib/table/module/keyboard/mixin.js +2 -2
- package/lib/table/module/keyboard/mixin.min.js +1 -1
- package/lib/table/src/cell.js +3 -3
- package/lib/table/src/column.js +10 -5
- package/lib/table/src/column.min.js +1 -1
- package/lib/table/src/group.js +10 -5
- package/lib/table/src/group.min.js +1 -1
- package/lib/table/src/methods.js +37 -31
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/props.js +2 -2
- package/lib/table/src/props.min.js +1 -1
- package/lib/table/src/table.js +15 -6
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +12 -3
- package/lib/table/src/util.min.js +1 -1
- package/lib/toolbar/src/toolbar.js +3 -2
- package/lib/toolbar/src/toolbar.min.js +1 -1
- package/lib/ui/index.js +3 -3
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/dom.js +5 -0
- package/lib/ui/src/dom.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/package.json +3 -3
- package/packages/table/module/edit/mixin.ts +47 -12
- package/packages/table/module/keyboard/mixin.ts +2 -2
- package/packages/table/src/cell.ts +5 -5
- package/packages/table/src/column.ts +16 -9
- package/packages/table/src/group.ts +16 -8
- package/packages/table/src/methods.ts +397 -167
- package/packages/table/src/props.ts +3 -3
- package/packages/table/src/table.ts +13 -6
- package/packages/table/src/util.ts +16 -6
- package/packages/toolbar/src/toolbar.ts +4 -2
- package/packages/ui/index.ts +2 -2
- package/packages/ui/src/dom.ts +5 -0
- /package/es/{iconfont.1776926445391.ttf → iconfont.1778035421318.ttf} +0 -0
- /package/es/{iconfont.1776926445391.woff → iconfont.1778035421318.woff} +0 -0
- /package/es/{iconfont.1776926445391.woff2 → iconfont.1778035421318.woff2} +0 -0
- /package/lib/{iconfont.1776926445391.ttf → iconfont.1778035421318.ttf} +0 -0
- /package/lib/{iconfont.1776926445391.woff → iconfont.1778035421318.woff} +0 -0
- /package/lib/{iconfont.1776926445391.woff2 → iconfont.1778035421318.woff2} +0 -0
package/es/table/src/methods.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import XEUtils from 'xe-utils';
|
|
2
|
-
import { getTpImg, isPx, isScale, hasClass, addClass, removeClass, wheelScrollLeftTo, wheelScrollTopTo, getEventTargetNode, getPaddingTopBottomSize, setScrollTop, setScrollLeft, toCssUnit, hasControlKey, checkTargetElement } from '../../ui/src/dom';
|
|
2
|
+
import { getTpImg, isPx, isScale, hasClass, addClass, removeClass, wheelScrollLeftTo, wheelScrollTopTo, getEventTargetNode, getPaddingTopBottomSize, setScrollTop, setScrollLeft, toCssUnit, hasControlKey, checkTargetElement, hasEventInputTarget } from '../../ui/src/dom';
|
|
3
3
|
import { getLastZIndex, nextZIndex, hasChildrenList, getFuncText, isEnableConf, formatText, eqEmptyValue } from '../../ui/src/utils';
|
|
4
4
|
import { VxeUI } from '../../ui';
|
|
5
5
|
import Cell from './cell';
|
|
@@ -8,7 +8,7 @@ import { getSlotVNs } from '../../ui/src/vn';
|
|
|
8
8
|
import { moveRowAnimateToTb, clearRowAnimate, moveColAnimateToLr, clearColAnimate } from '../../ui/src/anime';
|
|
9
9
|
import { warnLog, errLog } from '../../ui/src/log';
|
|
10
10
|
import { getCrossTableDragRowInfo } from './store';
|
|
11
|
-
const { getConfig, getI18n, renderer, formats, interceptor, createEvent } = VxeUI;
|
|
11
|
+
const { getConfig, getI18n, renderer, formats, interceptor, createEvent, globalEvents, GLOBAL_EVENT_KEYS } = VxeUI;
|
|
12
12
|
const browseObj = XEUtils.browse();
|
|
13
13
|
const supportMaxRow = 5e6;
|
|
14
14
|
const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
@@ -365,7 +365,7 @@ function cacheColumnMap($xeTable) {
|
|
|
365
365
|
errLog('vxe.error.errConflicts', ['mouse-config.area', 'column.type=expand']);
|
|
366
366
|
}
|
|
367
367
|
if (expandOpts.mode !== 'inside' && (treeConfig && !treeOpts.transform)) {
|
|
368
|
-
errLog('vxe.error.notConflictProp', ['tree-config.transform=false', 'expand-config.mode=
|
|
368
|
+
errLog('vxe.error.notConflictProp', ['tree-config.transform=false', 'expand-config.mode=inside']);
|
|
369
369
|
}
|
|
370
370
|
if (props.spanMethod) {
|
|
371
371
|
warnLog('vxe.error.notSupportProp', ['column.type=expand', 'span-method', 'span-method=null']);
|
|
@@ -3365,6 +3365,7 @@ function loadTableData($xeTable, datas, isReload, isReset) {
|
|
|
3365
3365
|
}
|
|
3366
3366
|
$xeTable.clearMergeCells();
|
|
3367
3367
|
$xeTable.clearMergeFooterItems();
|
|
3368
|
+
$xeTable.handleClearStack();
|
|
3368
3369
|
$xeTable.handleTableData(true);
|
|
3369
3370
|
$xeTable.updateFooter();
|
|
3370
3371
|
$xeTable.handleUpdateBodyMerge();
|
|
@@ -4293,6 +4294,108 @@ function reUpdateCustomStyleEvent($xeTable, evnt) {
|
|
|
4293
4294
|
}
|
|
4294
4295
|
}
|
|
4295
4296
|
}
|
|
4297
|
+
function truncateStackHistory($xeTable) {
|
|
4298
|
+
const internalData = $xeTable;
|
|
4299
|
+
const { stackHistoryStore } = internalData;
|
|
4300
|
+
const { undoStacks } = stackHistoryStore;
|
|
4301
|
+
const undoRedoHistoryOpts = $xeTable.computeUndoRedoHistoryOpts;
|
|
4302
|
+
const { stackSize } = undoRedoHistoryOpts;
|
|
4303
|
+
if (undoStacks.length > XEUtils.toNumber(stackSize)) {
|
|
4304
|
+
undoStacks.shift();
|
|
4305
|
+
}
|
|
4306
|
+
}
|
|
4307
|
+
/**
|
|
4308
|
+
* 生成快照数据
|
|
4309
|
+
*/
|
|
4310
|
+
function getSnapshotStackData($xeTable) {
|
|
4311
|
+
const reactData = $xeTable;
|
|
4312
|
+
const internalData = $xeTable;
|
|
4313
|
+
const { editStore } = reactData;
|
|
4314
|
+
const { afterFullData, elemStore } = internalData;
|
|
4315
|
+
const { selected, actived } = editStore;
|
|
4316
|
+
const { row: selectRow, column: selectColumn } = selected;
|
|
4317
|
+
const { row: editRow, column: editColumn } = actived;
|
|
4318
|
+
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
4319
|
+
const stackObj = {
|
|
4320
|
+
selectActiveInfo: selectRow && selectColumn
|
|
4321
|
+
? {
|
|
4322
|
+
rowid: getRowid($xeTable, selectRow),
|
|
4323
|
+
colid: selectColumn.id
|
|
4324
|
+
}
|
|
4325
|
+
: undefined,
|
|
4326
|
+
editActiveInfo: editRow && editColumn
|
|
4327
|
+
? {
|
|
4328
|
+
rowid: getRowid($xeTable, editRow),
|
|
4329
|
+
colid: editColumn.id
|
|
4330
|
+
}
|
|
4331
|
+
: undefined,
|
|
4332
|
+
scrollInfo: {
|
|
4333
|
+
top: bodyScrollElem ? bodyScrollElem.scrollTop : 0,
|
|
4334
|
+
left: bodyScrollElem ? bodyScrollElem.scrollLeft : 0
|
|
4335
|
+
},
|
|
4336
|
+
visibleData: XEUtils.clone(afterFullData, true),
|
|
4337
|
+
visibleColumn: []
|
|
4338
|
+
};
|
|
4339
|
+
return $xeTable.getCellAreaPushStackObj ? $xeTable.getCellAreaPushStackObj(stackObj) : stackObj;
|
|
4340
|
+
}
|
|
4341
|
+
/**
|
|
4342
|
+
* 刷新栈视图
|
|
4343
|
+
*/
|
|
4344
|
+
function handleUpdateSnapshotStackData($xeTable, stackObj) {
|
|
4345
|
+
const reactData = $xeTable;
|
|
4346
|
+
const internalData = $xeTable;
|
|
4347
|
+
const { editStore } = reactData;
|
|
4348
|
+
const { fullAllDataRowIdData, fullColumnIdData } = internalData;
|
|
4349
|
+
if (!stackObj) {
|
|
4350
|
+
return;
|
|
4351
|
+
}
|
|
4352
|
+
const { visibleData, editActiveInfo, selectActiveInfo, scrollInfo } = stackObj;
|
|
4353
|
+
const afterFullList = visibleData.map(item => {
|
|
4354
|
+
const rowid = getRowid($xeTable, item);
|
|
4355
|
+
const rest = fullAllDataRowIdData[rowid];
|
|
4356
|
+
let row = item;
|
|
4357
|
+
if (rest) {
|
|
4358
|
+
row = rest.row;
|
|
4359
|
+
Object.assign(row, item);
|
|
4360
|
+
}
|
|
4361
|
+
return row;
|
|
4362
|
+
});
|
|
4363
|
+
internalData.afterFullData = afterFullList;
|
|
4364
|
+
if ($xeTable.handleCellAreaSnapshotStackData) {
|
|
4365
|
+
$xeTable.handleCellAreaSnapshotStackData(stackObj);
|
|
4366
|
+
}
|
|
4367
|
+
else {
|
|
4368
|
+
const { selected } = editStore;
|
|
4369
|
+
const mouseOpts = $xeTable.computeMouseOpts;
|
|
4370
|
+
let selectRowid = '';
|
|
4371
|
+
let selectColid = '';
|
|
4372
|
+
if (editActiveInfo) {
|
|
4373
|
+
selectRowid = editActiveInfo.rowid;
|
|
4374
|
+
selectColid = editActiveInfo.colid;
|
|
4375
|
+
}
|
|
4376
|
+
else if (selectActiveInfo) {
|
|
4377
|
+
selectRowid = selectActiveInfo.rowid;
|
|
4378
|
+
selectColid = selectActiveInfo.colid;
|
|
4379
|
+
}
|
|
4380
|
+
if (selectRowid && selectColid && mouseOpts.selected) {
|
|
4381
|
+
const editRow = fullAllDataRowIdData[selectRowid] ? fullAllDataRowIdData[selectRowid].row : null;
|
|
4382
|
+
const editColumn = fullColumnIdData[selectColid] ? fullColumnIdData[selectColid].column : null;
|
|
4383
|
+
if (editRow && editColumn) {
|
|
4384
|
+
const params = {
|
|
4385
|
+
row: editRow,
|
|
4386
|
+
column: editColumn
|
|
4387
|
+
};
|
|
4388
|
+
selected.row = editRow;
|
|
4389
|
+
selected.column = editColumn;
|
|
4390
|
+
selected.args = params;
|
|
4391
|
+
$xeTable.$nextTick(() => {
|
|
4392
|
+
$xeTable.addCellSelectedClass();
|
|
4393
|
+
$xeTable.scrollTo(scrollInfo);
|
|
4394
|
+
});
|
|
4395
|
+
}
|
|
4396
|
+
}
|
|
4397
|
+
}
|
|
4398
|
+
}
|
|
4296
4399
|
const tableMethods = {
|
|
4297
4400
|
callSlot(slotFunc, params, h, vNodes) {
|
|
4298
4401
|
const $xeTable = this;
|
|
@@ -4373,7 +4476,8 @@ const tableMethods = {
|
|
|
4373
4476
|
* 重置表格的一切数据状态
|
|
4374
4477
|
*/
|
|
4375
4478
|
clearAll() {
|
|
4376
|
-
|
|
4479
|
+
const $xeTable = this;
|
|
4480
|
+
return clearTableAllStatus($xeTable);
|
|
4377
4481
|
},
|
|
4378
4482
|
handleUpdateRowGroup(groupFields) {
|
|
4379
4483
|
const $xeTable = this;
|
|
@@ -7023,18 +7127,20 @@ const tableMethods = {
|
|
|
7023
7127
|
const { isLastEnterAppendRow, beforeEnterMethod, enterMethod, isLastTabAppendRow, beforeTabMethod, tabMethod } = keyboardOpts;
|
|
7024
7128
|
const { selected, actived } = editStore;
|
|
7025
7129
|
const { keyCode } = evnt;
|
|
7026
|
-
const
|
|
7027
|
-
const
|
|
7028
|
-
const
|
|
7029
|
-
const
|
|
7030
|
-
const isSpacebar =
|
|
7031
|
-
const isLeftArrow =
|
|
7032
|
-
const isUpArrow =
|
|
7033
|
-
const isRightArrow =
|
|
7034
|
-
const isDwArrow =
|
|
7035
|
-
const hasDeleteKey =
|
|
7036
|
-
const
|
|
7037
|
-
const
|
|
7130
|
+
const isEsc = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ESCAPE);
|
|
7131
|
+
const hasBackspaceKey = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.BACKSPACE);
|
|
7132
|
+
const isTab = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.TAB);
|
|
7133
|
+
const isEnter = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ENTER);
|
|
7134
|
+
const isSpacebar = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.SPACEBAR);
|
|
7135
|
+
const isLeftArrow = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ARROW_LEFT);
|
|
7136
|
+
const isUpArrow = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ARROW_UP);
|
|
7137
|
+
const isRightArrow = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ARROW_RIGHT);
|
|
7138
|
+
const isDwArrow = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ARROW_DOWN);
|
|
7139
|
+
const hasDeleteKey = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.DELETE);
|
|
7140
|
+
const isY = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.Y);
|
|
7141
|
+
const isZ = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.Z);
|
|
7142
|
+
const isF2 = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.F2);
|
|
7143
|
+
const isContextMenu = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.CONTEXT_MENU);
|
|
7038
7144
|
const isControlKey = hasControlKey(evnt);
|
|
7039
7145
|
const hasShiftKey = evnt.shiftKey;
|
|
7040
7146
|
const hasAltKey = evnt.altKey;
|
|
@@ -7043,6 +7149,7 @@ const tableMethods = {
|
|
|
7043
7149
|
const isEditStatus = isEnableConf(editConfig) && actived.column && actived.row;
|
|
7044
7150
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
7045
7151
|
const beforeEditMethod = editOpts.beforeEditMethod || editOpts.activeMethod;
|
|
7152
|
+
const selectColumn = selected.column;
|
|
7046
7153
|
if (operCtxMenu) {
|
|
7047
7154
|
// 如果配置了右键菜单; 支持方向键操作、回车
|
|
7048
7155
|
evnt.preventDefault();
|
|
@@ -7074,10 +7181,10 @@ const tableMethods = {
|
|
|
7074
7181
|
}
|
|
7075
7182
|
}
|
|
7076
7183
|
}
|
|
7077
|
-
else if (keyboardConfig && isSpacebar && keyboardOpts.isChecked && selected.row &&
|
|
7184
|
+
else if (keyboardConfig && isSpacebar && keyboardOpts.isChecked && selected.row && selectColumn && (selectColumn.type === 'checkbox' || selectColumn.type === 'radio')) {
|
|
7078
7185
|
// 空格键支持选中复选框
|
|
7079
7186
|
evnt.preventDefault();
|
|
7080
|
-
if (
|
|
7187
|
+
if (selectColumn.type === 'checkbox') {
|
|
7081
7188
|
$xeTable.handleToggleCheckRowEvent(evnt, selected.args);
|
|
7082
7189
|
}
|
|
7083
7190
|
else {
|
|
@@ -7087,8 +7194,7 @@ const tableMethods = {
|
|
|
7087
7194
|
else if (isF2 && isEnableConf(editConfig)) {
|
|
7088
7195
|
if (!isEditStatus) {
|
|
7089
7196
|
// 如果按下了 F2 键
|
|
7090
|
-
if (selected.row &&
|
|
7091
|
-
evnt.stopPropagation();
|
|
7197
|
+
if (selected.row && selectColumn) {
|
|
7092
7198
|
evnt.preventDefault();
|
|
7093
7199
|
$xeTable.handleEdit(selected.args, evnt);
|
|
7094
7200
|
}
|
|
@@ -7096,7 +7202,7 @@ const tableMethods = {
|
|
|
7096
7202
|
}
|
|
7097
7203
|
else if (isContextMenu) {
|
|
7098
7204
|
// 如果按下上下文键
|
|
7099
|
-
internalData._keyCtx = selected.row &&
|
|
7205
|
+
internalData._keyCtx = selected.row && selectColumn && bodyMenu.length;
|
|
7100
7206
|
clearTimeout(internalData.keyCtxTimeout);
|
|
7101
7207
|
internalData.keyCtxTimeout = setTimeout(() => {
|
|
7102
7208
|
internalData._keyCtx = false;
|
|
@@ -7119,89 +7225,91 @@ const tableMethods = {
|
|
|
7119
7225
|
// 如果是激活状态,退则出到上一行/下一行
|
|
7120
7226
|
if (selected.row || actived.row) {
|
|
7121
7227
|
const activeRow = selected.row || actived.row;
|
|
7122
|
-
const activeColumn =
|
|
7123
|
-
|
|
7124
|
-
|
|
7125
|
-
if (
|
|
7126
|
-
|
|
7228
|
+
const activeColumn = selectColumn || actived.column;
|
|
7229
|
+
if (activeColumn) {
|
|
7230
|
+
const activeParams = selected.row ? selected.args : actived.args;
|
|
7231
|
+
if (hasShiftKey) {
|
|
7232
|
+
if (keyboardOpts.enterToTab) {
|
|
7233
|
+
$xeTable.moveTabSelected(activeParams, hasShiftKey, evnt);
|
|
7234
|
+
}
|
|
7235
|
+
else {
|
|
7236
|
+
$xeTable.moveEnterSelected(activeParams, isLeftArrow, true, isRightArrow, false, evnt);
|
|
7237
|
+
}
|
|
7127
7238
|
}
|
|
7128
7239
|
else {
|
|
7129
|
-
$xeTable.
|
|
7130
|
-
|
|
7131
|
-
|
|
7132
|
-
|
|
7133
|
-
|
|
7134
|
-
|
|
7135
|
-
|
|
7136
|
-
|
|
7137
|
-
|
|
7138
|
-
|
|
7139
|
-
|
|
7140
|
-
|
|
7141
|
-
|
|
7142
|
-
|
|
7143
|
-
|
|
7144
|
-
|
|
7145
|
-
|
|
7146
|
-
|
|
7147
|
-
|
|
7148
|
-
|
|
7149
|
-
|
|
7150
|
-
|
|
7151
|
-
|
|
7152
|
-
|
|
7153
|
-
|
|
7154
|
-
|
|
7240
|
+
const _rowIndex = $xeTable.getVTRowIndex(activeRow);
|
|
7241
|
+
const _columnIndex = $xeTable.getVTColumnIndex(activeColumn);
|
|
7242
|
+
if (keyboardOpts.enterToTab) {
|
|
7243
|
+
const ttrParams = {
|
|
7244
|
+
row: activeRow,
|
|
7245
|
+
rowIndex: $xeTable.getRowIndex(activeRow),
|
|
7246
|
+
$rowIndex: $xeTable.getVMRowIndex(activeRow),
|
|
7247
|
+
_rowIndex,
|
|
7248
|
+
column: activeColumn,
|
|
7249
|
+
columnIndex: $xeTable.getColumnIndex(activeColumn),
|
|
7250
|
+
$columnIndex: $xeTable.getVMColumnIndex(activeColumn),
|
|
7251
|
+
_columnIndex,
|
|
7252
|
+
$table: $xeTable
|
|
7253
|
+
};
|
|
7254
|
+
if (!beforeTabMethod || beforeTabMethod(ttrParams) !== false) {
|
|
7255
|
+
evnt.preventDefault();
|
|
7256
|
+
// 最后一行按下Tab键,自动追加一行
|
|
7257
|
+
if (isLastTabAppendRow) {
|
|
7258
|
+
const newColumn = visibleColumn[0];
|
|
7259
|
+
if (_rowIndex >= afterFullData.length - 1 && _columnIndex >= visibleColumn.length - 1) {
|
|
7260
|
+
if (actived.row) {
|
|
7261
|
+
$xeTable.handleClearEdit(evnt);
|
|
7262
|
+
}
|
|
7263
|
+
$xeTable.insertAt({}, -1).then(({ row: newRow }) => {
|
|
7264
|
+
$xeTable.scrollToRow(newRow, newColumn);
|
|
7265
|
+
$xeTable.handleSelected(Object.assign(Object.assign({}, activeParams), { row: newRow, column: newColumn }), evnt);
|
|
7266
|
+
});
|
|
7267
|
+
$xeTable.dispatchEvent('tab-append-row', ttrParams, evnt);
|
|
7268
|
+
return;
|
|
7155
7269
|
}
|
|
7156
|
-
$xeTable.insertAt({}, -1).then(({ row: newRow }) => {
|
|
7157
|
-
$xeTable.scrollToRow(newRow, newColumn);
|
|
7158
|
-
$xeTable.handleSelected(Object.assign(Object.assign({}, activeParams), { row: newRow, column: newColumn }), evnt);
|
|
7159
|
-
});
|
|
7160
|
-
$xeTable.dispatchEvent('tab-append-row', ttrParams, evnt);
|
|
7161
|
-
return;
|
|
7162
7270
|
}
|
|
7163
|
-
|
|
7164
|
-
|
|
7165
|
-
|
|
7166
|
-
|
|
7167
|
-
|
|
7168
|
-
|
|
7271
|
+
if (tabMethod) {
|
|
7272
|
+
tabMethod(ttrParams);
|
|
7273
|
+
}
|
|
7274
|
+
else {
|
|
7275
|
+
$xeTable.moveTabSelected(activeParams, hasShiftKey, evnt);
|
|
7276
|
+
}
|
|
7169
7277
|
}
|
|
7170
7278
|
}
|
|
7171
|
-
|
|
7172
|
-
|
|
7173
|
-
|
|
7174
|
-
|
|
7175
|
-
|
|
7176
|
-
|
|
7177
|
-
|
|
7178
|
-
|
|
7179
|
-
|
|
7180
|
-
|
|
7181
|
-
|
|
7182
|
-
|
|
7183
|
-
|
|
7184
|
-
|
|
7185
|
-
|
|
7186
|
-
|
|
7187
|
-
|
|
7188
|
-
|
|
7189
|
-
|
|
7190
|
-
|
|
7191
|
-
|
|
7192
|
-
|
|
7193
|
-
|
|
7194
|
-
|
|
7279
|
+
else {
|
|
7280
|
+
const etrParams = {
|
|
7281
|
+
row: activeRow,
|
|
7282
|
+
rowIndex: $xeTable.getRowIndex(activeRow),
|
|
7283
|
+
$rowIndex: $xeTable.getVMRowIndex(activeRow),
|
|
7284
|
+
_rowIndex,
|
|
7285
|
+
column: activeColumn,
|
|
7286
|
+
columnIndex: $xeTable.getColumnIndex(activeColumn),
|
|
7287
|
+
$columnIndex: $xeTable.getVMColumnIndex(activeColumn),
|
|
7288
|
+
_columnIndex,
|
|
7289
|
+
$table: $xeTable
|
|
7290
|
+
};
|
|
7291
|
+
if (!beforeEnterMethod || beforeEnterMethod(etrParams) !== false) {
|
|
7292
|
+
evnt.preventDefault();
|
|
7293
|
+
// 最后一行按下回车键,自动追加一行
|
|
7294
|
+
if (isLastEnterAppendRow) {
|
|
7295
|
+
if (_rowIndex >= afterFullData.length - 1) {
|
|
7296
|
+
$xeTable.insertAt({}, -1).then(({ row: newRow }) => {
|
|
7297
|
+
$xeTable.scrollToRow(newRow, selectColumn);
|
|
7298
|
+
$xeTable.handleSelected(Object.assign(Object.assign({}, activeParams), { row: newRow }), evnt);
|
|
7299
|
+
});
|
|
7300
|
+
$xeTable.dispatchEvent('enter-append-row', etrParams, evnt);
|
|
7301
|
+
return;
|
|
7302
|
+
}
|
|
7195
7303
|
}
|
|
7196
|
-
|
|
7197
|
-
|
|
7198
|
-
|
|
7199
|
-
|
|
7200
|
-
|
|
7201
|
-
|
|
7202
|
-
|
|
7304
|
+
if (enterMethod) {
|
|
7305
|
+
enterMethod(etrParams);
|
|
7306
|
+
}
|
|
7307
|
+
else {
|
|
7308
|
+
if (actived.row) {
|
|
7309
|
+
$xeTable.handleClearEdit(evnt);
|
|
7310
|
+
}
|
|
7311
|
+
$xeTable.moveEnterSelected(activeParams, isLeftArrow, false, isRightArrow, true, evnt);
|
|
7203
7312
|
}
|
|
7204
|
-
$xeTable.moveEnterSelected(activeParams, isLeftArrow, false, isRightArrow, true, evnt);
|
|
7205
7313
|
}
|
|
7206
7314
|
}
|
|
7207
7315
|
}
|
|
@@ -7229,7 +7337,7 @@ const tableMethods = {
|
|
|
7229
7337
|
else if (operArrow && keyboardConfig && keyboardOpts.isArrow) {
|
|
7230
7338
|
if (!isEditStatus) {
|
|
7231
7339
|
// 如果按下了方向键
|
|
7232
|
-
if (mouseOpts.selected && selected.row &&
|
|
7340
|
+
if (mouseOpts.selected && selected.row && selectColumn) {
|
|
7233
7341
|
$xeTable.moveArrowSelected(selected.args, isLeftArrow, isUpArrow, isRightArrow, isDwArrow, evnt);
|
|
7234
7342
|
}
|
|
7235
7343
|
else {
|
|
@@ -7248,59 +7356,61 @@ const tableMethods = {
|
|
|
7248
7356
|
// 如果按下了 Tab 键切换
|
|
7249
7357
|
if (selected.row || actived.row) {
|
|
7250
7358
|
const activeRow = selected.row || actived.row;
|
|
7251
|
-
const activeColumn =
|
|
7252
|
-
|
|
7253
|
-
|
|
7254
|
-
|
|
7255
|
-
|
|
7256
|
-
|
|
7257
|
-
|
|
7258
|
-
|
|
7259
|
-
|
|
7260
|
-
|
|
7261
|
-
|
|
7262
|
-
|
|
7263
|
-
|
|
7264
|
-
|
|
7265
|
-
|
|
7266
|
-
|
|
7267
|
-
|
|
7268
|
-
|
|
7269
|
-
|
|
7270
|
-
|
|
7271
|
-
|
|
7359
|
+
const activeColumn = selectColumn || actived.column;
|
|
7360
|
+
if (activeColumn) {
|
|
7361
|
+
const activeParams = selected.row ? selected.args : actived.args;
|
|
7362
|
+
const _rowIndex = $xeTable.getVTRowIndex(activeRow);
|
|
7363
|
+
const _columnIndex = $xeTable.getVTColumnIndex(activeColumn);
|
|
7364
|
+
const ttrParams = {
|
|
7365
|
+
row: activeRow,
|
|
7366
|
+
rowIndex: $xeTable.getRowIndex(activeRow),
|
|
7367
|
+
$rowIndex: $xeTable.getVMRowIndex(activeRow),
|
|
7368
|
+
_rowIndex,
|
|
7369
|
+
column: activeColumn,
|
|
7370
|
+
columnIndex: $xeTable.getColumnIndex(activeColumn),
|
|
7371
|
+
$columnIndex: $xeTable.getVMColumnIndex(activeColumn),
|
|
7372
|
+
_columnIndex,
|
|
7373
|
+
$table: $xeTable
|
|
7374
|
+
};
|
|
7375
|
+
if (!beforeTabMethod || beforeTabMethod(ttrParams) !== false) {
|
|
7376
|
+
evnt.preventDefault();
|
|
7377
|
+
// 最后一行按下Tab键,自动追加一行
|
|
7378
|
+
if (isLastTabAppendRow) {
|
|
7379
|
+
const newColumn = visibleColumn[0];
|
|
7380
|
+
if (_rowIndex >= afterFullData.length - 1 && _columnIndex >= visibleColumn.length - 1) {
|
|
7381
|
+
if (actived.row) {
|
|
7382
|
+
$xeTable.handleClearEdit(evnt);
|
|
7383
|
+
}
|
|
7384
|
+
$xeTable.insertAt({}, -1).then(({ row: newRow }) => {
|
|
7385
|
+
$xeTable.scrollToRow(newRow, newColumn);
|
|
7386
|
+
$xeTable.handleSelected(Object.assign(Object.assign({}, activeParams), { row: newRow, column: newColumn }), evnt);
|
|
7387
|
+
});
|
|
7388
|
+
$xeTable.dispatchEvent('tab-append-row', ttrParams, evnt);
|
|
7389
|
+
return;
|
|
7390
|
+
}
|
|
7391
|
+
}
|
|
7392
|
+
if (tabMethod) {
|
|
7393
|
+
tabMethod(ttrParams);
|
|
7394
|
+
}
|
|
7395
|
+
else {
|
|
7272
7396
|
if (actived.row) {
|
|
7273
7397
|
$xeTable.handleClearEdit(evnt);
|
|
7274
7398
|
}
|
|
7275
|
-
$xeTable.
|
|
7276
|
-
$xeTable.scrollToRow(newRow, newColumn);
|
|
7277
|
-
$xeTable.handleSelected(Object.assign(Object.assign({}, activeParams), { row: newRow, column: newColumn }), evnt);
|
|
7278
|
-
});
|
|
7279
|
-
$xeTable.dispatchEvent('tab-append-row', ttrParams, evnt);
|
|
7280
|
-
return;
|
|
7281
|
-
}
|
|
7282
|
-
}
|
|
7283
|
-
if (tabMethod) {
|
|
7284
|
-
tabMethod(ttrParams);
|
|
7285
|
-
}
|
|
7286
|
-
else {
|
|
7287
|
-
if (actived.row) {
|
|
7288
|
-
$xeTable.handleClearEdit(evnt);
|
|
7399
|
+
$xeTable.moveTabSelected(activeParams, hasShiftKey, evnt);
|
|
7289
7400
|
}
|
|
7290
|
-
$xeTable.moveTabSelected(activeParams, hasShiftKey, evnt);
|
|
7291
7401
|
}
|
|
7292
7402
|
}
|
|
7293
7403
|
}
|
|
7294
7404
|
}
|
|
7295
|
-
else if (keyboardConfig && keyboardOpts.isDel && hasDeleteKey && isEnableConf(editConfig) && (selected.row ||
|
|
7405
|
+
else if (keyboardConfig && keyboardOpts.isDel && hasDeleteKey && isEnableConf(editConfig) && (selected.row || selectColumn)) {
|
|
7296
7406
|
// 如果是删除键
|
|
7297
7407
|
if (!isEditStatus) {
|
|
7298
7408
|
const { delMethod } = keyboardOpts;
|
|
7299
7409
|
const params = {
|
|
7300
7410
|
row: selected.row,
|
|
7301
7411
|
rowIndex: $xeTable.getRowIndex(selected.row),
|
|
7302
|
-
column:
|
|
7303
|
-
columnIndex: $xeTable.getColumnIndex(
|
|
7412
|
+
column: selectColumn,
|
|
7413
|
+
columnIndex: $xeTable.getColumnIndex(selectColumn),
|
|
7304
7414
|
$table: $xeTable,
|
|
7305
7415
|
$grid: $xeGrid,
|
|
7306
7416
|
$gantt: $xeGantt
|
|
@@ -7311,7 +7421,11 @@ const tableMethods = {
|
|
|
7311
7421
|
delMethod(params);
|
|
7312
7422
|
}
|
|
7313
7423
|
else {
|
|
7314
|
-
|
|
7424
|
+
const selectCellValue = getCellValue(selected.row, selectColumn);
|
|
7425
|
+
if (selectCellValue !== null) {
|
|
7426
|
+
$xeTable.handlePushStack();
|
|
7427
|
+
setCellValue(selected.row, selectColumn, null);
|
|
7428
|
+
}
|
|
7315
7429
|
}
|
|
7316
7430
|
// 如果按下 del 键,更新表尾数据
|
|
7317
7431
|
$xeTable.updateFooter();
|
|
@@ -7319,16 +7433,16 @@ const tableMethods = {
|
|
|
7319
7433
|
}
|
|
7320
7434
|
}
|
|
7321
7435
|
}
|
|
7322
|
-
else if (hasBackspaceKey && keyboardConfig && keyboardOpts.isBack && isEnableConf(editConfig) && (selected.row ||
|
|
7436
|
+
else if (hasBackspaceKey && keyboardConfig && keyboardOpts.isBack && isEnableConf(editConfig) && (selected.row || selectColumn)) {
|
|
7323
7437
|
if (!isEditStatus) {
|
|
7324
|
-
const {
|
|
7438
|
+
const { backMethod } = keyboardOpts;
|
|
7325
7439
|
// 如果是删除键
|
|
7326
|
-
if (keyboardOpts.isDel && isEnableConf(editConfig) && (selected.row ||
|
|
7440
|
+
if (keyboardOpts.isDel && isEnableConf(editConfig) && (selected.row || selectColumn)) {
|
|
7327
7441
|
const params = {
|
|
7328
7442
|
row: selected.row,
|
|
7329
7443
|
rowIndex: $xeTable.getRowIndex(selected.row),
|
|
7330
|
-
column:
|
|
7331
|
-
columnIndex: $xeTable.getColumnIndex(
|
|
7444
|
+
column: selectColumn,
|
|
7445
|
+
columnIndex: $xeTable.getColumnIndex(selectColumn),
|
|
7332
7446
|
$table: $xeTable,
|
|
7333
7447
|
$grid: $xeGrid,
|
|
7334
7448
|
$gantt: $xeGantt
|
|
@@ -7339,11 +7453,9 @@ const tableMethods = {
|
|
|
7339
7453
|
backMethod(params);
|
|
7340
7454
|
}
|
|
7341
7455
|
else {
|
|
7342
|
-
|
|
7343
|
-
|
|
7344
|
-
|
|
7345
|
-
}
|
|
7346
|
-
$xeTable.handleEdit(selected.args, evnt);
|
|
7456
|
+
$xeTable.handleEdit(params, evnt, {
|
|
7457
|
+
isClear: true
|
|
7458
|
+
});
|
|
7347
7459
|
}
|
|
7348
7460
|
$xeTable.dispatchEvent('cell-backspace-value', params, evnt);
|
|
7349
7461
|
}
|
|
@@ -7368,20 +7480,32 @@ const tableMethods = {
|
|
|
7368
7480
|
.then(() => $xeTable.triggerCurrentRowEvent(evnt, params));
|
|
7369
7481
|
}
|
|
7370
7482
|
}
|
|
7483
|
+
else if (keyboardConfig && keyboardOpts.isUndoRedo && isControlKey && (isZ || isY) && !hasEventInputTarget(evnt.target)) {
|
|
7484
|
+
if (isY || (hasShiftKey && isZ)) {
|
|
7485
|
+
// 恢复被撤销的操作:Ctrl + Y 或 Ctrl + Shift + Z
|
|
7486
|
+
evnt.preventDefault();
|
|
7487
|
+
$xeTable.handleRedoStackEvent(evnt);
|
|
7488
|
+
}
|
|
7489
|
+
else if (isZ) {
|
|
7490
|
+
// 撤销上一步操作:Ctrl + Z
|
|
7491
|
+
evnt.preventDefault();
|
|
7492
|
+
$xeTable.handleUndoStackEvent(evnt);
|
|
7493
|
+
}
|
|
7494
|
+
}
|
|
7371
7495
|
else if (keyboardConfig && keyboardOpts.isEdit && !isControlKey && (isSpacebar || (keyCode >= 48 && keyCode <= 57) || (keyCode >= 65 && keyCode <= 90) || (keyCode >= 96 && keyCode <= 111) || (keyCode >= 186 && keyCode <= 192) || (keyCode >= 219 && keyCode <= 222))) {
|
|
7372
|
-
const { editMethod } = keyboardOpts;
|
|
7496
|
+
const { editMode, editMethod } = keyboardOpts;
|
|
7373
7497
|
// 启用编辑后,空格键功能将失效
|
|
7374
7498
|
// if (isSpacebar) {
|
|
7375
7499
|
// evnt.preventDefault()
|
|
7376
7500
|
// }
|
|
7377
7501
|
// 如果是按下非功能键之外允许直接编辑
|
|
7378
|
-
if (
|
|
7502
|
+
if (selectColumn && selected.row && isEnableConf(selectColumn.editRender)) {
|
|
7379
7503
|
const beforeEditMethod = editOpts.beforeEditMethod || editOpts.activeMethod;
|
|
7380
7504
|
const params = {
|
|
7381
7505
|
row: selected.row,
|
|
7382
7506
|
rowIndex: $xeTable.getRowIndex(selected.row),
|
|
7383
|
-
column:
|
|
7384
|
-
columnIndex: $xeTable.getColumnIndex(
|
|
7507
|
+
column: selectColumn,
|
|
7508
|
+
columnIndex: $xeTable.getColumnIndex(selectColumn),
|
|
7385
7509
|
$table: $xeTable,
|
|
7386
7510
|
$grid: $xeGrid,
|
|
7387
7511
|
$gantt: $xeGantt
|
|
@@ -7391,8 +7515,14 @@ const tableMethods = {
|
|
|
7391
7515
|
editMethod(params);
|
|
7392
7516
|
}
|
|
7393
7517
|
else {
|
|
7394
|
-
|
|
7395
|
-
|
|
7518
|
+
let isClearValue = false;
|
|
7519
|
+
// 追加方式与覆盖式
|
|
7520
|
+
if (editMode !== 'insert') {
|
|
7521
|
+
isClearValue = true;
|
|
7522
|
+
}
|
|
7523
|
+
$xeTable.handleEdit(params, evnt, {
|
|
7524
|
+
isClear: isClearValue
|
|
7525
|
+
});
|
|
7396
7526
|
}
|
|
7397
7527
|
}
|
|
7398
7528
|
}
|
|
@@ -8217,17 +8347,23 @@ const tableMethods = {
|
|
|
8217
8347
|
* 获取单选框保留选中的行
|
|
8218
8348
|
*/
|
|
8219
8349
|
getRadioReserveRecord(isFull) {
|
|
8220
|
-
const
|
|
8350
|
+
const $xeTable = this;
|
|
8351
|
+
const props = $xeTable;
|
|
8352
|
+
const internalData = $xeTable;
|
|
8353
|
+
const { treeConfig } = props;
|
|
8354
|
+
const { fullDataRowIdData, radioReserveRow, afterFullData } = internalData;
|
|
8355
|
+
const radioOpts = $xeTable.computeRadioOpts;
|
|
8356
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
8221
8357
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
8222
8358
|
if (radioOpts.reserve && radioReserveRow) {
|
|
8223
|
-
const rowid = getRowid(
|
|
8359
|
+
const rowid = getRowid($xeTable, radioReserveRow);
|
|
8224
8360
|
if (isFull) {
|
|
8225
8361
|
if (!fullDataRowIdData[rowid]) {
|
|
8226
8362
|
return radioReserveRow;
|
|
8227
8363
|
}
|
|
8228
8364
|
}
|
|
8229
8365
|
else {
|
|
8230
|
-
const rowkey = getRowkey(
|
|
8366
|
+
const rowkey = getRowkey($xeTable);
|
|
8231
8367
|
if (treeConfig) {
|
|
8232
8368
|
const matchObj = XEUtils.findTree(afterFullData, row => rowid === XEUtils.get(row, rowkey), { children: childrenField });
|
|
8233
8369
|
if (matchObj) {
|
|
@@ -9236,6 +9372,7 @@ const tableMethods = {
|
|
|
9236
9372
|
afterFullData.splice(nafIndex, 0, dragRow);
|
|
9237
9373
|
tableFullData.splice(ntfIndex, 0, dragRow);
|
|
9238
9374
|
}
|
|
9375
|
+
$xeTable.handleClearStack();
|
|
9239
9376
|
$xeTable.handleTableData(treeConfig && transform);
|
|
9240
9377
|
$xeTable.cacheRowMap(false);
|
|
9241
9378
|
updateScrollYStatus($xeTable);
|
|
@@ -9929,6 +10066,7 @@ const tableMethods = {
|
|
|
9929
10066
|
column.renderSortNumber = sortIndex;
|
|
9930
10067
|
}
|
|
9931
10068
|
});
|
|
10069
|
+
$xeTable.handleClearStack();
|
|
9932
10070
|
if (mouseConfig) {
|
|
9933
10071
|
if ($xeTable.clearSelected) {
|
|
9934
10072
|
$xeTable.clearSelected();
|
|
@@ -12434,12 +12572,71 @@ const tableMethods = {
|
|
|
12434
12572
|
const internalData = $xeTable;
|
|
12435
12573
|
return loadTableData($xeTable, internalData.tableSynchData, false, true);
|
|
12436
12574
|
},
|
|
12575
|
+
handlePushStack() {
|
|
12576
|
+
const $xeTable = this;
|
|
12577
|
+
const internalData = $xeTable;
|
|
12578
|
+
const keyboardOpts = $xeTable.computeKeyboardOpts;
|
|
12579
|
+
if (!keyboardOpts.isUndoRedo) {
|
|
12580
|
+
return;
|
|
12581
|
+
}
|
|
12582
|
+
const { stackHistoryStore } = internalData;
|
|
12583
|
+
const stackObj = getSnapshotStackData($xeTable);
|
|
12584
|
+
stackHistoryStore.undoStacks.push(stackObj);
|
|
12585
|
+
stackHistoryStore.redoStacks = [];
|
|
12586
|
+
truncateStackHistory($xeTable);
|
|
12587
|
+
},
|
|
12588
|
+
handleUndoStackEvent(evnt) {
|
|
12589
|
+
const $xeTable = this;
|
|
12590
|
+
const internalData = $xeTable;
|
|
12591
|
+
const { stackHistoryStore } = internalData;
|
|
12592
|
+
const { undoStacks, redoStacks } = stackHistoryStore;
|
|
12593
|
+
if (undoStacks.length) {
|
|
12594
|
+
const stackObj = getSnapshotStackData($xeTable);
|
|
12595
|
+
redoStacks.push(stackObj);
|
|
12596
|
+
handleUpdateSnapshotStackData($xeTable, undoStacks.pop());
|
|
12597
|
+
if (evnt) {
|
|
12598
|
+
$xeTable.dispatchEvent('undo', {}, evnt);
|
|
12599
|
+
}
|
|
12600
|
+
return $xeTable.$nextTick(() => {
|
|
12601
|
+
return { status: true };
|
|
12602
|
+
});
|
|
12603
|
+
}
|
|
12604
|
+
return Promise.resolve({ status: false });
|
|
12605
|
+
},
|
|
12606
|
+
handleRedoStackEvent(evnt) {
|
|
12607
|
+
const $xeTable = this;
|
|
12608
|
+
const internalData = $xeTable;
|
|
12609
|
+
const { stackHistoryStore } = internalData;
|
|
12610
|
+
const { undoStacks, redoStacks } = stackHistoryStore;
|
|
12611
|
+
if (redoStacks.length) {
|
|
12612
|
+
const stackObj = getSnapshotStackData($xeTable);
|
|
12613
|
+
undoStacks.push(stackObj);
|
|
12614
|
+
handleUpdateSnapshotStackData($xeTable, redoStacks.pop());
|
|
12615
|
+
if (evnt) {
|
|
12616
|
+
$xeTable.dispatchEvent('redo', {}, evnt);
|
|
12617
|
+
}
|
|
12618
|
+
return $xeTable.$nextTick(() => {
|
|
12619
|
+
return { status: true };
|
|
12620
|
+
});
|
|
12621
|
+
}
|
|
12622
|
+
return Promise.resolve({ status: false });
|
|
12623
|
+
},
|
|
12624
|
+
handleClearStack() {
|
|
12625
|
+
const $xeTable = this;
|
|
12626
|
+
const internalData = $xeTable;
|
|
12627
|
+
const { stackHistoryStore } = internalData;
|
|
12628
|
+
stackHistoryStore.undoStacks = [];
|
|
12629
|
+
stackHistoryStore.redoStacks = [];
|
|
12630
|
+
},
|
|
12437
12631
|
updateZindex() {
|
|
12438
|
-
|
|
12439
|
-
|
|
12632
|
+
const $xeTable = this;
|
|
12633
|
+
const props = $xeTable;
|
|
12634
|
+
const internalData = $xeTable;
|
|
12635
|
+
if (props.zIndex) {
|
|
12636
|
+
internalData.tZindex = props.zIndex;
|
|
12440
12637
|
}
|
|
12441
|
-
else if (
|
|
12442
|
-
|
|
12638
|
+
else if (internalData.tZindex < getLastZIndex()) {
|
|
12639
|
+
internalData.tZindex = nextZIndex();
|
|
12443
12640
|
}
|
|
12444
12641
|
},
|
|
12445
12642
|
updateCellAreas() {
|
|
@@ -12452,6 +12649,14 @@ const tableMethods = {
|
|
|
12452
12649
|
}
|
|
12453
12650
|
return $xeTable.$nextTick();
|
|
12454
12651
|
},
|
|
12652
|
+
undo() {
|
|
12653
|
+
const $xeTable = this;
|
|
12654
|
+
return $xeTable.handleUndoStackEvent(null);
|
|
12655
|
+
},
|
|
12656
|
+
redo() {
|
|
12657
|
+
const $xeTable = this;
|
|
12658
|
+
return $xeTable.handleRedoStackEvent(null);
|
|
12659
|
+
},
|
|
12455
12660
|
dispatchEvent(type, params, evnt) {
|
|
12456
12661
|
const $xeTable = this;
|
|
12457
12662
|
const $xeGrid = $xeTable.$xeGrid;
|
|
@@ -12464,19 +12669,24 @@ const tableMethods = {
|
|
|
12464
12669
|
$xeTable.dispatchEvent(type, params, evnt);
|
|
12465
12670
|
},
|
|
12466
12671
|
focus() {
|
|
12467
|
-
|
|
12468
|
-
|
|
12672
|
+
const $xeTable = this;
|
|
12673
|
+
const internalData = $xeTable;
|
|
12674
|
+
internalData.isActivated = true;
|
|
12675
|
+
return $xeTable.$nextTick();
|
|
12469
12676
|
},
|
|
12470
12677
|
blur() {
|
|
12471
|
-
|
|
12472
|
-
|
|
12678
|
+
const $xeTable = this;
|
|
12679
|
+
const internalData = $xeTable;
|
|
12680
|
+
internalData.isActivated = false;
|
|
12681
|
+
return $xeTable.$nextTick();
|
|
12473
12682
|
},
|
|
12474
12683
|
/**
|
|
12475
12684
|
* 已废弃,被 connectToolbar 替换
|
|
12476
12685
|
* @deprecated
|
|
12477
12686
|
*/
|
|
12478
12687
|
connect($toolbar) {
|
|
12479
|
-
|
|
12688
|
+
const $xeTable = this;
|
|
12689
|
+
return $xeTable.connectToolbar($toolbar);
|
|
12480
12690
|
},
|
|
12481
12691
|
/**
|
|
12482
12692
|
* 连接工具栏
|
|
@@ -12484,14 +12694,15 @@ const tableMethods = {
|
|
|
12484
12694
|
*/
|
|
12485
12695
|
connectToolbar($toolbar) {
|
|
12486
12696
|
const $xeTable = this;
|
|
12697
|
+
const internalData = $xeTable;
|
|
12487
12698
|
if ($toolbar && $toolbar.syncUpdate) {
|
|
12488
|
-
$toolbar.syncUpdate({ collectColumn:
|
|
12699
|
+
$toolbar.syncUpdate({ collectColumn: internalData.collectColumn, $table: $xeTable });
|
|
12489
12700
|
this.$toolbar = $toolbar;
|
|
12490
12701
|
}
|
|
12491
12702
|
else {
|
|
12492
12703
|
errLog('vxe.error.barUnableLink');
|
|
12493
12704
|
}
|
|
12494
|
-
return
|
|
12705
|
+
return $xeTable.$nextTick();
|
|
12495
12706
|
},
|
|
12496
12707
|
handleConnectGanttView($ganttView) {
|
|
12497
12708
|
const $xeTable = this;
|
|
@@ -12510,17 +12721,19 @@ const tableMethods = {
|
|
|
12510
12721
|
* @deprecated
|
|
12511
12722
|
*/
|
|
12512
12723
|
getCell(row, column) {
|
|
12513
|
-
|
|
12724
|
+
const $xeTable = this;
|
|
12725
|
+
return $xeTable.getCellElement(row, column);
|
|
12514
12726
|
},
|
|
12515
12727
|
findRowIndexOf(list, row) {
|
|
12516
12728
|
return row ? XEUtils.findIndexOf(list, item => this.eqRow(item, row)) : -1;
|
|
12517
12729
|
},
|
|
12518
12730
|
eqRow(row1, row2) {
|
|
12731
|
+
const $xeTable = this;
|
|
12519
12732
|
if (row1 && row2) {
|
|
12520
12733
|
if (row1 === row2) {
|
|
12521
12734
|
return true;
|
|
12522
12735
|
}
|
|
12523
|
-
return getRowid(
|
|
12736
|
+
return getRowid($xeTable, row1) === getRowid($xeTable, row2);
|
|
12524
12737
|
}
|
|
12525
12738
|
return false;
|
|
12526
12739
|
},
|