vxe-table 3.7.0-beta.11 → 3.7.0-beta.13
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/lib/edit/src/mixin.js +257 -207
- package/lib/edit/src/mixin.min.js +1 -1
- package/lib/icon/style/style.css +1 -1
- package/lib/icon/style/style.min.css +1 -1
- package/lib/index.css +1 -1
- package/lib/index.umd.js +312 -234
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/src/body.js +5 -5
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/cell.js +12 -12
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/methods.js +41 -14
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +6 -0
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +1 -1
- package/lib/table/src/util.min.js +1 -1
- package/lib/tools/log.js +1 -1
- package/lib/tools/log.min.js +1 -1
- package/lib/v-x-e-table/index.js +1 -1
- package/lib/v-x-e-table/index.min.js +1 -1
- package/lib/v-x-e-table/src/commands.js +1 -1
- package/lib/v-x-e-table/src/commands.min.js +1 -1
- package/lib/v-x-e-table/src/conf.js +2 -2
- package/lib/v-x-e-table/src/conf.min.js +1 -1
- package/lib/v-x-e-table/src/formats.js +1 -1
- package/lib/v-x-e-table/src/formats.min.js +1 -1
- package/lib/v-x-e-table/src/menus.js +1 -1
- package/lib/v-x-e-table/src/menus.min.js +1 -1
- package/lib/v-x-e-table/src/renderer.js +4 -4
- package/lib/v-x-e-table/src/renderer.min.js +1 -1
- package/package.json +3 -3
- package/packages/edit/src/mixin.js +174 -134
- package/packages/table/src/body.js +5 -5
- package/packages/table/src/cell.js +8 -7
- package/packages/table/src/methods.js +39 -10
- package/packages/table/src/table.js +6 -0
- package/packages/table/src/util.js +1 -1
- package/packages/v-x-e-table/src/commands.js +1 -1
- package/packages/v-x-e-table/src/conf.js +2 -2
- package/packages/v-x-e-table/src/formats.js +1 -1
- package/packages/v-x-e-table/src/menus.js +1 -1
- package/packages/v-x-e-table/src/renderer.js +4 -4
- package/types/table.d.ts +16 -1
- package/types/v-x-e-table/index.d.ts +1 -1
- /package/lib/icon/style/{iconfont.1691021948915.ttf → iconfont.1692439110338.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1691021948915.woff → iconfont.1692439110338.woff} +0 -0
- /package/lib/icon/style/{iconfont.1691021948915.woff2 → iconfont.1692439110338.woff2} +0 -0
- /package/lib/{iconfont.1691021948915.ttf → iconfont.1692439110338.ttf} +0 -0
- /package/lib/{iconfont.1691021948915.woff → iconfont.1692439110338.woff} +0 -0
- /package/lib/{iconfont.1691021948915.woff2 → iconfont.1692439110338.woff2} +0 -0
package/lib/index.umd.js
CHANGED
|
@@ -10783,13 +10783,13 @@ var iconPrefix = 'vxe-icon-';
|
|
|
10783
10783
|
isReplace: true
|
|
10784
10784
|
},
|
|
10785
10785
|
scrollX: {
|
|
10786
|
-
enabled:
|
|
10786
|
+
// enabled: false,
|
|
10787
10787
|
gt: 60
|
|
10788
10788
|
// oSize: 0
|
|
10789
10789
|
},
|
|
10790
10790
|
|
|
10791
10791
|
scrollY: {
|
|
10792
|
-
enabled:
|
|
10792
|
+
// enabled: false,
|
|
10793
10793
|
gt: 100
|
|
10794
10794
|
// oSize: 0
|
|
10795
10795
|
}
|
|
@@ -11045,7 +11045,7 @@ var es_array_concat = __webpack_require__(2222);
|
|
|
11045
11045
|
|
|
11046
11046
|
|
|
11047
11047
|
function getLog(message, params) {
|
|
11048
|
-
return "[vxe-table v".concat("3.7.0-beta.
|
|
11048
|
+
return "[vxe-table v".concat("3.7.0-beta.12", "] ").concat(conf.i18n(message, params));
|
|
11049
11049
|
}
|
|
11050
11050
|
function outLog(type) {
|
|
11051
11051
|
return function (message, params) {
|
|
@@ -12401,7 +12401,7 @@ function _t(key, args) {
|
|
|
12401
12401
|
var v = 'v3';
|
|
12402
12402
|
var VXETable = {
|
|
12403
12403
|
v: v,
|
|
12404
|
-
version: "3.7.0-beta.
|
|
12404
|
+
version: "3.7.0-beta.12",
|
|
12405
12405
|
reg: reg,
|
|
12406
12406
|
use: use,
|
|
12407
12407
|
setup: setup,
|
|
@@ -13027,7 +13027,7 @@ function countTreeExpand(prevRow, params) {
|
|
|
13027
13027
|
var treeOpts = $table.treeOpts;
|
|
13028
13028
|
var childrenField = treeOpts.children || treeOpts.childrenField;
|
|
13029
13029
|
var rowChildren = prevRow[childrenField];
|
|
13030
|
-
if ($table.isTreeExpandByRow(prevRow)) {
|
|
13030
|
+
if (rowChildren && $table.isTreeExpandByRow(prevRow)) {
|
|
13031
13031
|
for (var index = 0; index < rowChildren.length; index++) {
|
|
13032
13032
|
count += countTreeExpand(rowChildren[index], params);
|
|
13033
13033
|
}
|
|
@@ -13200,7 +13200,7 @@ function getSlotVNs(vns) {
|
|
|
13200
13200
|
var renderType = 'body';
|
|
13201
13201
|
|
|
13202
13202
|
// 滚动、拖动过程中不需要触发
|
|
13203
|
-
function
|
|
13203
|
+
function isVMScrollProcess($xetable) {
|
|
13204
13204
|
return $xetable._isResize || $xetable.lastScrollTime && Date.now() < $xetable.lastScrollTime + $xetable.delayHover;
|
|
13205
13205
|
}
|
|
13206
13206
|
function renderLine(h, _vm, $xetable, params) {
|
|
@@ -13339,7 +13339,7 @@ function renderColumn(h, _vm, $xetable, seq, rowid, fixedType, rowLevel, row, ro
|
|
|
13339
13339
|
// hover 进入事件
|
|
13340
13340
|
if (showTitle || showTooltip || showAllTip || bindMouseenter || tooltipConfig) {
|
|
13341
13341
|
tdOns.mouseenter = function (evnt) {
|
|
13342
|
-
if (
|
|
13342
|
+
if (isVMScrollProcess($xetable)) {
|
|
13343
13343
|
return;
|
|
13344
13344
|
}
|
|
13345
13345
|
if (showTitle) {
|
|
@@ -13358,7 +13358,7 @@ function renderColumn(h, _vm, $xetable, seq, rowid, fixedType, rowLevel, row, ro
|
|
|
13358
13358
|
// hover 退出事件
|
|
13359
13359
|
if (showTooltip || showAllTip || bindMouseleave || tooltipConfig) {
|
|
13360
13360
|
tdOns.mouseleave = function (evnt) {
|
|
13361
|
-
if (
|
|
13361
|
+
if (isVMScrollProcess($xetable)) {
|
|
13362
13362
|
return;
|
|
13363
13363
|
}
|
|
13364
13364
|
if (showTooltip || showAllTip) {
|
|
@@ -13512,7 +13512,7 @@ function renderRows(h, _vm, $xetable, fixedType, tableData, tableColumn) {
|
|
|
13512
13512
|
// 事件绑定
|
|
13513
13513
|
if (rowOpts.isHover || highlightHoverRow) {
|
|
13514
13514
|
trOn.mouseenter = function (evnt) {
|
|
13515
|
-
if (
|
|
13515
|
+
if (isVMScrollProcess($xetable)) {
|
|
13516
13516
|
return;
|
|
13517
13517
|
}
|
|
13518
13518
|
$xetable.triggerHoverEvent(evnt, {
|
|
@@ -13521,7 +13521,7 @@ function renderRows(h, _vm, $xetable, fixedType, tableData, tableColumn) {
|
|
|
13521
13521
|
});
|
|
13522
13522
|
};
|
|
13523
13523
|
trOn.mouseleave = function () {
|
|
13524
|
-
if (
|
|
13524
|
+
if (isVMScrollProcess($xetable)) {
|
|
13525
13525
|
return;
|
|
13526
13526
|
}
|
|
13527
13527
|
$xetable.clearHoverRow();
|
|
@@ -15271,17 +15271,17 @@ var Cell = {
|
|
|
15271
15271
|
column = params.column,
|
|
15272
15272
|
isHidden = params.isHidden;
|
|
15273
15273
|
var treeConfig = $table.treeConfig,
|
|
15274
|
-
treeIndeterminates = $table.treeIndeterminates
|
|
15275
|
-
|
|
15276
|
-
|
|
15277
|
-
checkField =
|
|
15278
|
-
|
|
15279
|
-
|
|
15280
|
-
|
|
15274
|
+
treeIndeterminates = $table.treeIndeterminates,
|
|
15275
|
+
checkboxOpts = $table.checkboxOpts;
|
|
15276
|
+
var labelField = checkboxOpts.labelField,
|
|
15277
|
+
checkField = checkboxOpts.checkField,
|
|
15278
|
+
checkMethod = checkboxOpts.checkMethod,
|
|
15279
|
+
visibleMethod = checkboxOpts.visibleMethod;
|
|
15280
|
+
var indeterminateField = checkboxOpts.indeterminateField || checkboxOpts.halfField;
|
|
15281
15281
|
var slots = column.slots;
|
|
15282
15282
|
var defaultSlot = slots ? slots["default"] : null;
|
|
15283
15283
|
var checkboxSlot = slots ? slots.checkbox : null;
|
|
15284
|
-
var
|
|
15284
|
+
var isIndeterminate = false;
|
|
15285
15285
|
var isChecked = false;
|
|
15286
15286
|
var isVisible = !visibleMethod || visibleMethod({
|
|
15287
15287
|
row: row
|
|
@@ -15304,14 +15304,14 @@ var Cell = {
|
|
|
15304
15304
|
});
|
|
15305
15305
|
}
|
|
15306
15306
|
if (treeConfig) {
|
|
15307
|
-
|
|
15307
|
+
isIndeterminate = $table.findRowIndexOf(treeIndeterminates, row) > -1;
|
|
15308
15308
|
}
|
|
15309
15309
|
}
|
|
15310
15310
|
var checkboxParams = _objectSpread2(_objectSpread2({}, params), {}, {
|
|
15311
15311
|
checked: isChecked,
|
|
15312
15312
|
disabled: isDisabled,
|
|
15313
15313
|
visible: isVisible,
|
|
15314
|
-
indeterminate:
|
|
15314
|
+
indeterminate: isIndeterminate
|
|
15315
15315
|
});
|
|
15316
15316
|
if (checkboxSlot) {
|
|
15317
15317
|
return $table.callSlot(checkboxSlot, checkboxParams, h);
|
|
@@ -15319,7 +15319,7 @@ var Cell = {
|
|
|
15319
15319
|
var checkVNs = [];
|
|
15320
15320
|
if (isVisible) {
|
|
15321
15321
|
checkVNs.push(h('span', {
|
|
15322
|
-
"class": ['vxe-checkbox--icon',
|
|
15322
|
+
"class": ['vxe-checkbox--icon', isIndeterminate ? conf.icon.TABLE_CHECKBOX_INDETERMINATE : isChecked ? conf.icon.TABLE_CHECKBOX_CHECKED : conf.icon.TABLE_CHECKBOX_UNCHECKED]
|
|
15323
15323
|
}));
|
|
15324
15324
|
}
|
|
15325
15325
|
if (defaultSlot || labelField) {
|
|
@@ -15331,7 +15331,7 @@ var Cell = {
|
|
|
15331
15331
|
"class": ['vxe-cell--checkbox', {
|
|
15332
15332
|
'is--checked': isChecked,
|
|
15333
15333
|
'is--disabled': isDisabled,
|
|
15334
|
-
'is--indeterminate':
|
|
15334
|
+
'is--indeterminate': indeterminateField && !isChecked ? row[indeterminateField] : isIndeterminate
|
|
15335
15335
|
}],
|
|
15336
15336
|
on: on
|
|
15337
15337
|
}, checkVNs)];
|
|
@@ -19136,9 +19136,29 @@ var Methods = {
|
|
|
19136
19136
|
}
|
|
19137
19137
|
},
|
|
19138
19138
|
triggerCheckRowEvent: function triggerCheckRowEvent(evnt, params, value) {
|
|
19139
|
-
var
|
|
19139
|
+
var checkboxOpts = this.checkboxOpts,
|
|
19140
|
+
afterFullData = this.afterFullData;
|
|
19141
|
+
var checkMethod = checkboxOpts.checkMethod;
|
|
19142
|
+
var row = params.row;
|
|
19143
|
+
if (checkboxOpts.isShiftKey && evnt.shiftKey && !this.treeConfig) {
|
|
19144
|
+
var checkboxRecords = this.getCheckboxRecords();
|
|
19145
|
+
if (checkboxRecords.length) {
|
|
19146
|
+
var firstRow = checkboxRecords[0];
|
|
19147
|
+
var _rowIndex = this.getVTRowIndex(row);
|
|
19148
|
+
var _firstRowIndex = this.getVTRowIndex(firstRow);
|
|
19149
|
+
if (_rowIndex !== _firstRowIndex) {
|
|
19150
|
+
this.setAllCheckboxRow(false);
|
|
19151
|
+
var rangeRows = _rowIndex < _firstRowIndex ? afterFullData.slice(_rowIndex, _firstRowIndex + 1) : afterFullData.slice(_firstRowIndex, _rowIndex + 1);
|
|
19152
|
+
this.handleCheckedCheckboxRow(rangeRows, true, false);
|
|
19153
|
+
this.emitEvent('checkbox-range-select', Object.assign({
|
|
19154
|
+
rangeRecords: rangeRows
|
|
19155
|
+
}, params), evnt);
|
|
19156
|
+
return;
|
|
19157
|
+
}
|
|
19158
|
+
}
|
|
19159
|
+
}
|
|
19140
19160
|
if (!checkMethod || checkMethod({
|
|
19141
|
-
row:
|
|
19161
|
+
row: row
|
|
19142
19162
|
})) {
|
|
19143
19163
|
this.handleSelectRow(params, value);
|
|
19144
19164
|
this.emitEvent('checkbox-change', Object.assign({
|
|
@@ -19174,6 +19194,7 @@ var Methods = {
|
|
|
19174
19194
|
reserve = checkboxOpts.reserve,
|
|
19175
19195
|
checkStrictly = checkboxOpts.checkStrictly,
|
|
19176
19196
|
checkMethod = checkboxOpts.checkMethod;
|
|
19197
|
+
var indeterminateField = checkboxOpts.indeterminateField || checkboxOpts.halfField;
|
|
19177
19198
|
var selectRows = [];
|
|
19178
19199
|
var beforeSelection = treeConfig ? [] : selectCheckboxRows.filter(function (row) {
|
|
19179
19200
|
return _this34.findRowIndexOf(afterFullData, row) === -1;
|
|
@@ -19195,6 +19216,9 @@ var Methods = {
|
|
|
19195
19216
|
}
|
|
19196
19217
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(row, checkField, value);
|
|
19197
19218
|
}
|
|
19219
|
+
if (treeConfig && indeterminateField) {
|
|
19220
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(row, indeterminateField, false);
|
|
19221
|
+
}
|
|
19198
19222
|
};
|
|
19199
19223
|
// 如果存在选中方法
|
|
19200
19224
|
// 如果方法成立,则更新值,否则忽略该数据
|
|
@@ -19300,9 +19324,9 @@ var Methods = {
|
|
|
19300
19324
|
checkboxOpts = this.checkboxOpts,
|
|
19301
19325
|
treeConfig = this.treeConfig;
|
|
19302
19326
|
var checkField = checkboxOpts.checkField,
|
|
19303
|
-
halfField = checkboxOpts.halfField,
|
|
19304
19327
|
checkStrictly = checkboxOpts.checkStrictly,
|
|
19305
19328
|
checkMethod = checkboxOpts.checkMethod;
|
|
19329
|
+
var indeterminateField = checkboxOpts.indeterminateField || checkboxOpts.halfField;
|
|
19306
19330
|
if (!checkStrictly) {
|
|
19307
19331
|
var disableRows = [];
|
|
19308
19332
|
var checkRows = [];
|
|
@@ -19327,9 +19351,9 @@ var Methods = {
|
|
|
19327
19351
|
});
|
|
19328
19352
|
isAllSelected = isAllResolve && afterFullData.length !== disableRows.length;
|
|
19329
19353
|
if (treeConfig) {
|
|
19330
|
-
if (
|
|
19354
|
+
if (indeterminateField) {
|
|
19331
19355
|
isIndeterminate = !isAllSelected && afterFullData.some(function (row) {
|
|
19332
|
-
return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, checkField) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row,
|
|
19356
|
+
return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, checkField) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, indeterminateField) || _this35.findRowIndexOf(treeIndeterminates, row) > -1;
|
|
19333
19357
|
});
|
|
19334
19358
|
} else {
|
|
19335
19359
|
isIndeterminate = !isAllSelected && afterFullData.some(function (row) {
|
|
@@ -19337,9 +19361,9 @@ var Methods = {
|
|
|
19337
19361
|
});
|
|
19338
19362
|
}
|
|
19339
19363
|
} else {
|
|
19340
|
-
if (
|
|
19364
|
+
if (indeterminateField) {
|
|
19341
19365
|
isIndeterminate = !isAllSelected && afterFullData.some(function (row) {
|
|
19342
|
-
return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, checkField) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row,
|
|
19366
|
+
return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, checkField) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, indeterminateField);
|
|
19343
19367
|
});
|
|
19344
19368
|
} else {
|
|
19345
19369
|
isIndeterminate = !isAllSelected && afterFullData.some(function (row) {
|
|
@@ -19558,15 +19582,18 @@ var Methods = {
|
|
|
19558
19582
|
checkboxOpts = this.checkboxOpts;
|
|
19559
19583
|
var checkField = checkboxOpts.checkField,
|
|
19560
19584
|
reserve = checkboxOpts.reserve;
|
|
19585
|
+
var indeterminateField = checkboxOpts.indeterminateField || checkboxOpts.halfField;
|
|
19561
19586
|
if (checkField) {
|
|
19587
|
+
var handleClearChecked = function handleClearChecked(item) {
|
|
19588
|
+
if (treeConfig && indeterminateField) {
|
|
19589
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(item, indeterminateField, false);
|
|
19590
|
+
}
|
|
19591
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(item, checkField, false);
|
|
19592
|
+
};
|
|
19562
19593
|
if (treeConfig) {
|
|
19563
|
-
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(tableFullData,
|
|
19564
|
-
return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(item, checkField, false);
|
|
19565
|
-
}, treeOpts);
|
|
19594
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(tableFullData, handleClearChecked, treeOpts);
|
|
19566
19595
|
} else {
|
|
19567
|
-
tableFullData.forEach(
|
|
19568
|
-
return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(item, checkField, false);
|
|
19569
|
-
});
|
|
19596
|
+
tableFullData.forEach(handleClearChecked);
|
|
19570
19597
|
}
|
|
19571
19598
|
}
|
|
19572
19599
|
if (reserve) {
|
|
@@ -21398,7 +21425,7 @@ var Methods = {
|
|
|
21398
21425
|
};
|
|
21399
21426
|
|
|
21400
21427
|
// Module methods
|
|
21401
|
-
var funcs = 'setFilter,openFilter,clearFilter,getCheckedFilters,closeMenu,setActiveCellArea,getActiveCellArea,getCellAreas,clearCellAreas,copyCellArea,cutCellArea,pasteCellArea,getCopyCellArea,getCopyCellAreas,clearCopyCellArea,setCellAreas,openFind,openReplace,closeFNR,getSelectedCell,clearSelected,insert,insertAt,remove,removeCheckboxRow,removeRadioRow,removeCurrentRow,getRecordset,getInsertRecords,getRemoveRecords,getUpdateRecords,clearEdit,clearActived,getEditRecord,getActiveRecord,isEditByRow,isActiveByRow,setEditRow,setActiveRow,setEditCell,setActiveCell,setSelectCell,clearValidate,fullValidate,validate,openExport,openPrint,exportData,openImport,importData,saveFile,readFile,importByFile,print'.split(',');
|
|
21428
|
+
var funcs = 'setFilter,openFilter,clearFilter,getCheckedFilters,closeMenu,setActiveCellArea,getActiveCellArea,getCellAreas,clearCellAreas,copyCellArea,cutCellArea,pasteCellArea,getCopyCellArea,getCopyCellAreas,clearCopyCellArea,setCellAreas,openFind,openReplace,closeFNR,getSelectedCell,clearSelected,insert,insertAt,insertNextAt,remove,removeCheckboxRow,removeRadioRow,removeCurrentRow,getRecordset,getInsertRecords,getRemoveRecords,getUpdateRecords,clearEdit,clearActived,getEditRecord,getActiveRecord,isEditByRow,isActiveByRow,setEditRow,setActiveRow,setEditCell,setActiveCell,setSelectCell,clearValidate,fullValidate,validate,openExport,openPrint,exportData,openImport,importData,saveFile,readFile,importByFile,print'.split(',');
|
|
21402
21429
|
funcs.forEach(function (name) {
|
|
21403
21430
|
Methods[name] = function () {
|
|
21404
21431
|
if (false) {}
|
|
@@ -23758,6 +23785,7 @@ var es_array_unshift = __webpack_require__(541);
|
|
|
23758
23785
|
|
|
23759
23786
|
|
|
23760
23787
|
|
|
23788
|
+
|
|
23761
23789
|
|
|
23762
23790
|
|
|
23763
23791
|
function insertTreeRow(_vm, newRecords, isAppend) {
|
|
@@ -23784,10 +23812,15 @@ function insertTreeRow(_vm, newRecords, isAppend) {
|
|
|
23784
23812
|
var parentRest = fullAllDataRowIdData[getRowid(_vm, parentRow)];
|
|
23785
23813
|
var parentLevel = parentRest ? parentRest.level : 0;
|
|
23786
23814
|
var parentChilds = parentRow[childrenField];
|
|
23815
|
+
var mapChilds = parentRow[mapChildrenField];
|
|
23787
23816
|
if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(parentChilds)) {
|
|
23788
23817
|
parentChilds = parentRow[childrenField] = [];
|
|
23789
23818
|
}
|
|
23819
|
+
if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(mapChilds)) {
|
|
23820
|
+
mapChilds = parentRow[childrenField] = [];
|
|
23821
|
+
}
|
|
23790
23822
|
parentChilds[funcName](item);
|
|
23823
|
+
mapChilds[funcName](item);
|
|
23791
23824
|
var rest = {
|
|
23792
23825
|
row: item,
|
|
23793
23826
|
rowid: rowid,
|
|
@@ -23821,6 +23854,181 @@ function insertTreeRow(_vm, newRecords, isAppend) {
|
|
|
23821
23854
|
}
|
|
23822
23855
|
});
|
|
23823
23856
|
}
|
|
23857
|
+
function handleInsertRowAt(_vm, records, row, isInsertNextRow) {
|
|
23858
|
+
var tableFullTreeData = _vm.tableFullTreeData,
|
|
23859
|
+
mergeList = _vm.mergeList,
|
|
23860
|
+
afterFullData = _vm.afterFullData,
|
|
23861
|
+
editStore = _vm.editStore,
|
|
23862
|
+
tableFullData = _vm.tableFullData,
|
|
23863
|
+
treeConfig = _vm.treeConfig,
|
|
23864
|
+
fullDataRowIdData = _vm.fullDataRowIdData,
|
|
23865
|
+
fullAllDataRowIdData = _vm.fullAllDataRowIdData,
|
|
23866
|
+
treeOpts = _vm.treeOpts;
|
|
23867
|
+
var transform = treeOpts.transform,
|
|
23868
|
+
rowField = treeOpts.rowField,
|
|
23869
|
+
mapChildrenField = treeOpts.mapChildrenField;
|
|
23870
|
+
var childrenField = treeOpts.children || treeOpts.childrenField;
|
|
23871
|
+
if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(records)) {
|
|
23872
|
+
records = [records];
|
|
23873
|
+
}
|
|
23874
|
+
var newRecords = _vm.defineField(records.map(function (record) {
|
|
23875
|
+
var _ref;
|
|
23876
|
+
return Object.assign(treeConfig && transform ? (_ref = {}, _defineProperty(_ref, mapChildrenField, []), _defineProperty(_ref, childrenField, []), _ref) : {}, record);
|
|
23877
|
+
}));
|
|
23878
|
+
if (!row) {
|
|
23879
|
+
// 如果为虚拟树
|
|
23880
|
+
if (treeConfig && transform) {
|
|
23881
|
+
insertTreeRow(_vm, newRecords, false);
|
|
23882
|
+
} else {
|
|
23883
|
+
afterFullData.unshift.apply(afterFullData, _toConsumableArray(newRecords));
|
|
23884
|
+
tableFullData.unshift.apply(tableFullData, _toConsumableArray(newRecords));
|
|
23885
|
+
// 刷新单元格合并
|
|
23886
|
+
mergeList.forEach(function (mergeItem) {
|
|
23887
|
+
var mergeRowIndex = mergeItem.row;
|
|
23888
|
+
if (mergeRowIndex > 0) {
|
|
23889
|
+
mergeItem.row = mergeRowIndex + newRecords.length;
|
|
23890
|
+
}
|
|
23891
|
+
});
|
|
23892
|
+
}
|
|
23893
|
+
} else {
|
|
23894
|
+
if (row === -1) {
|
|
23895
|
+
// 如果为虚拟树
|
|
23896
|
+
if (treeConfig && transform) {
|
|
23897
|
+
insertTreeRow(_vm, newRecords, true);
|
|
23898
|
+
} else {
|
|
23899
|
+
afterFullData.push.apply(afterFullData, _toConsumableArray(newRecords));
|
|
23900
|
+
tableFullData.push.apply(tableFullData, _toConsumableArray(newRecords));
|
|
23901
|
+
// 刷新单元格合并
|
|
23902
|
+
mergeList.forEach(function (mergeItem) {
|
|
23903
|
+
var mergeRowIndex = mergeItem.row,
|
|
23904
|
+
mergeRowspan = mergeItem.rowspan;
|
|
23905
|
+
if (mergeRowIndex + mergeRowspan > afterFullData.length) {
|
|
23906
|
+
mergeItem.rowspan = mergeRowspan + newRecords.length;
|
|
23907
|
+
}
|
|
23908
|
+
});
|
|
23909
|
+
}
|
|
23910
|
+
} else {
|
|
23911
|
+
// 如果为虚拟树
|
|
23912
|
+
if (treeConfig && transform) {
|
|
23913
|
+
var matchMapObj = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findTree(tableFullTreeData, function (item) {
|
|
23914
|
+
return row[rowField] === item[rowField];
|
|
23915
|
+
}, {
|
|
23916
|
+
children: mapChildrenField
|
|
23917
|
+
});
|
|
23918
|
+
if (matchMapObj) {
|
|
23919
|
+
var parentRow = matchMapObj.parent;
|
|
23920
|
+
var parentMapChilds = parentRow ? parentRow[mapChildrenField] : tableFullTreeData;
|
|
23921
|
+
var parentRest = fullAllDataRowIdData[getRowid(_vm, parentRow)];
|
|
23922
|
+
var parentLevel = parentRest ? parentRest.level : 0;
|
|
23923
|
+
newRecords.forEach(function (item, i) {
|
|
23924
|
+
var rowid = getRowid(_vm, item);
|
|
23925
|
+
if (false) {}
|
|
23926
|
+
if (parentRow) {
|
|
23927
|
+
item[treeOpts.parentField] = parentRow[rowField];
|
|
23928
|
+
}
|
|
23929
|
+
var targetIndex = matchMapObj.index + i;
|
|
23930
|
+
if (isInsertNextRow) {
|
|
23931
|
+
targetIndex = targetIndex + 1;
|
|
23932
|
+
}
|
|
23933
|
+
parentMapChilds.splice(targetIndex, 0, item);
|
|
23934
|
+
var rest = {
|
|
23935
|
+
row: item,
|
|
23936
|
+
rowid: rowid,
|
|
23937
|
+
seq: -1,
|
|
23938
|
+
index: -1,
|
|
23939
|
+
_index: -1,
|
|
23940
|
+
$index: -1,
|
|
23941
|
+
items: parentMapChilds,
|
|
23942
|
+
parent: parentRow,
|
|
23943
|
+
level: parentLevel + 1
|
|
23944
|
+
};
|
|
23945
|
+
fullDataRowIdData[rowid] = rest;
|
|
23946
|
+
fullAllDataRowIdData[rowid] = rest;
|
|
23947
|
+
});
|
|
23948
|
+
|
|
23949
|
+
// 源
|
|
23950
|
+
if (parentRow) {
|
|
23951
|
+
var matchObj = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findTree(tableFullTreeData, function (item) {
|
|
23952
|
+
return row[rowField] === item[rowField];
|
|
23953
|
+
}, {
|
|
23954
|
+
children: childrenField
|
|
23955
|
+
});
|
|
23956
|
+
if (matchObj) {
|
|
23957
|
+
var parentChilds = matchObj.items;
|
|
23958
|
+
var targetIndex = matchObj.index;
|
|
23959
|
+
if (isInsertNextRow) {
|
|
23960
|
+
targetIndex = targetIndex + 1;
|
|
23961
|
+
}
|
|
23962
|
+
parentChilds.splice.apply(parentChilds, [targetIndex, 0].concat(_toConsumableArray(newRecords)));
|
|
23963
|
+
}
|
|
23964
|
+
}
|
|
23965
|
+
} else {
|
|
23966
|
+
if (false) {}
|
|
23967
|
+
insertTreeRow(_vm, newRecords, true);
|
|
23968
|
+
}
|
|
23969
|
+
} else {
|
|
23970
|
+
if (treeConfig) {
|
|
23971
|
+
throw new Error(getLog('vxe.error.noTree', ['insert']));
|
|
23972
|
+
}
|
|
23973
|
+
var afIndex = -1;
|
|
23974
|
+
// 如果是可视索引
|
|
23975
|
+
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(row)) {
|
|
23976
|
+
if (row < afterFullData.length) {
|
|
23977
|
+
afIndex = row;
|
|
23978
|
+
}
|
|
23979
|
+
} else {
|
|
23980
|
+
afIndex = _vm.findRowIndexOf(afterFullData, row);
|
|
23981
|
+
}
|
|
23982
|
+
// 如果是插入指定行的下一行
|
|
23983
|
+
if (isInsertNextRow) {
|
|
23984
|
+
afIndex = Math.max(afterFullData.length, afIndex + 1);
|
|
23985
|
+
}
|
|
23986
|
+
if (afIndex === -1) {
|
|
23987
|
+
throw new Error(errLog('vxe.error.unableInsert'));
|
|
23988
|
+
}
|
|
23989
|
+
afterFullData.splice.apply(afterFullData, [afIndex, 0].concat(_toConsumableArray(newRecords)));
|
|
23990
|
+
tableFullData.splice.apply(tableFullData, [_vm.findRowIndexOf(tableFullData, row), 0].concat(_toConsumableArray(newRecords)));
|
|
23991
|
+
// 刷新单元格合并
|
|
23992
|
+
mergeList.forEach(function (mergeItem) {
|
|
23993
|
+
var mergeRowIndex = mergeItem.row,
|
|
23994
|
+
mergeRowspan = mergeItem.rowspan;
|
|
23995
|
+
if (mergeRowIndex > afIndex) {
|
|
23996
|
+
mergeItem.row = mergeRowIndex + newRecords.length;
|
|
23997
|
+
} else if (mergeRowIndex + mergeRowspan > afIndex) {
|
|
23998
|
+
mergeItem.rowspan = mergeRowspan + newRecords.length;
|
|
23999
|
+
}
|
|
24000
|
+
});
|
|
24001
|
+
}
|
|
24002
|
+
}
|
|
24003
|
+
}
|
|
24004
|
+
var insertList = editStore.insertList,
|
|
24005
|
+
insertMaps = editStore.insertMaps;
|
|
24006
|
+
newRecords.forEach(function (newRow) {
|
|
24007
|
+
var rowid = getRowid(_vm, newRow);
|
|
24008
|
+
insertMaps[rowid] = newRow;
|
|
24009
|
+
});
|
|
24010
|
+
insertList.unshift.apply(insertList, _toConsumableArray(newRecords));
|
|
24011
|
+
_vm.cacheRowMap();
|
|
24012
|
+
_vm.updateScrollYStatus();
|
|
24013
|
+
_vm.handleTableData(treeConfig && transform);
|
|
24014
|
+
if (!(treeConfig && transform)) {
|
|
24015
|
+
_vm.updateAfterDataIndex();
|
|
24016
|
+
}
|
|
24017
|
+
_vm.updateFooter();
|
|
24018
|
+
_vm.checkSelectionStatus();
|
|
24019
|
+
if (_vm.scrollYLoad) {
|
|
24020
|
+
_vm.updateScrollYSpace();
|
|
24021
|
+
}
|
|
24022
|
+
return _vm.$nextTick().then(function () {
|
|
24023
|
+
_vm.updateCellAreas();
|
|
24024
|
+
return _vm.recalculate();
|
|
24025
|
+
}).then(function () {
|
|
24026
|
+
return {
|
|
24027
|
+
row: newRecords.length ? newRecords[newRecords.length - 1] : null,
|
|
24028
|
+
rows: newRecords
|
|
24029
|
+
};
|
|
24030
|
+
});
|
|
24031
|
+
}
|
|
23824
24032
|
/* harmony default export */ const edit_src_mixin = ({
|
|
23825
24033
|
methods: {
|
|
23826
24034
|
/**
|
|
@@ -23829,7 +24037,7 @@ function insertTreeRow(_vm, newRecords, isAppend) {
|
|
|
23829
24037
|
* @param {*} records
|
|
23830
24038
|
*/
|
|
23831
24039
|
_insert: function _insert(records) {
|
|
23832
|
-
return this
|
|
24040
|
+
return handleInsertRowAt(this, records, null);
|
|
23833
24041
|
},
|
|
23834
24042
|
/**
|
|
23835
24043
|
* 往表格指定行中插入临时数据
|
|
@@ -23838,155 +24046,13 @@ function insertTreeRow(_vm, newRecords, isAppend) {
|
|
|
23838
24046
|
* 如果 row 为有效行则插入到该行的位置
|
|
23839
24047
|
* @param {Object/Array} records 新的数据
|
|
23840
24048
|
* @param {Row} row 指定行
|
|
24049
|
+
* @returns
|
|
23841
24050
|
*/
|
|
23842
24051
|
_insertAt: function _insertAt(records, row) {
|
|
23843
|
-
|
|
23844
|
-
|
|
23845
|
-
|
|
23846
|
-
|
|
23847
|
-
editStore = this.editStore,
|
|
23848
|
-
tableFullData = this.tableFullData,
|
|
23849
|
-
treeConfig = this.treeConfig,
|
|
23850
|
-
fullDataRowIdData = this.fullDataRowIdData,
|
|
23851
|
-
fullAllDataRowIdData = this.fullAllDataRowIdData,
|
|
23852
|
-
treeOpts = this.treeOpts;
|
|
23853
|
-
var transform = treeOpts.transform,
|
|
23854
|
-
rowField = treeOpts.rowField,
|
|
23855
|
-
mapChildrenField = treeOpts.mapChildrenField;
|
|
23856
|
-
if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(records)) {
|
|
23857
|
-
records = [records];
|
|
23858
|
-
}
|
|
23859
|
-
var newRecords = this.defineField(records.map(function (record) {
|
|
23860
|
-
return Object.assign({}, record);
|
|
23861
|
-
}));
|
|
23862
|
-
if (!row) {
|
|
23863
|
-
// 如果为虚拟树
|
|
23864
|
-
if (treeConfig && transform) {
|
|
23865
|
-
insertTreeRow(this, newRecords, false);
|
|
23866
|
-
} else {
|
|
23867
|
-
afterFullData.unshift.apply(afterFullData, _toConsumableArray(newRecords));
|
|
23868
|
-
tableFullData.unshift.apply(tableFullData, _toConsumableArray(newRecords));
|
|
23869
|
-
// 刷新单元格合并
|
|
23870
|
-
mergeList.forEach(function (mergeItem) {
|
|
23871
|
-
var mergeRowIndex = mergeItem.row;
|
|
23872
|
-
if (mergeRowIndex > 0) {
|
|
23873
|
-
mergeItem.row = mergeRowIndex + newRecords.length;
|
|
23874
|
-
}
|
|
23875
|
-
});
|
|
23876
|
-
}
|
|
23877
|
-
} else {
|
|
23878
|
-
if (row === -1) {
|
|
23879
|
-
// 如果为虚拟树
|
|
23880
|
-
if (treeConfig && transform) {
|
|
23881
|
-
insertTreeRow(this, newRecords, true);
|
|
23882
|
-
} else {
|
|
23883
|
-
afterFullData.push.apply(afterFullData, _toConsumableArray(newRecords));
|
|
23884
|
-
tableFullData.push.apply(tableFullData, _toConsumableArray(newRecords));
|
|
23885
|
-
// 刷新单元格合并
|
|
23886
|
-
mergeList.forEach(function (mergeItem) {
|
|
23887
|
-
var mergeRowIndex = mergeItem.row,
|
|
23888
|
-
mergeRowspan = mergeItem.rowspan;
|
|
23889
|
-
if (mergeRowIndex + mergeRowspan > afterFullData.length) {
|
|
23890
|
-
mergeItem.rowspan = mergeRowspan + newRecords.length;
|
|
23891
|
-
}
|
|
23892
|
-
});
|
|
23893
|
-
}
|
|
23894
|
-
} else {
|
|
23895
|
-
// 如果为虚拟树
|
|
23896
|
-
if (treeConfig && transform) {
|
|
23897
|
-
var matchObj = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findTree(tableFullTreeData, function (item) {
|
|
23898
|
-
return row[rowField] === item[rowField];
|
|
23899
|
-
}, {
|
|
23900
|
-
children: mapChildrenField
|
|
23901
|
-
});
|
|
23902
|
-
if (matchObj) {
|
|
23903
|
-
var parentRow = matchObj.parent;
|
|
23904
|
-
var parentChilds = matchObj.items;
|
|
23905
|
-
var parentRest = fullAllDataRowIdData[getRowid(this, parentRow)];
|
|
23906
|
-
var parentLevel = parentRest ? parentRest.level : 0;
|
|
23907
|
-
newRecords.forEach(function (item, i) {
|
|
23908
|
-
var rowid = getRowid(_this, item);
|
|
23909
|
-
if (false) {}
|
|
23910
|
-
if (parentRow) {
|
|
23911
|
-
item[treeOpts.parentField] = parentRow[rowField];
|
|
23912
|
-
}
|
|
23913
|
-
parentChilds.splice(matchObj.index + i, 0, item);
|
|
23914
|
-
var rest = {
|
|
23915
|
-
row: item,
|
|
23916
|
-
rowid: rowid,
|
|
23917
|
-
seq: -1,
|
|
23918
|
-
index: -1,
|
|
23919
|
-
_index: -1,
|
|
23920
|
-
$index: -1,
|
|
23921
|
-
items: parentChilds,
|
|
23922
|
-
parent: parentRow,
|
|
23923
|
-
level: parentLevel + 1
|
|
23924
|
-
};
|
|
23925
|
-
fullDataRowIdData[rowid] = rest;
|
|
23926
|
-
fullAllDataRowIdData[rowid] = rest;
|
|
23927
|
-
});
|
|
23928
|
-
} else {
|
|
23929
|
-
if (false) {}
|
|
23930
|
-
insertTreeRow(this, newRecords, true);
|
|
23931
|
-
}
|
|
23932
|
-
} else {
|
|
23933
|
-
if (treeConfig) {
|
|
23934
|
-
throw new Error(getLog('vxe.error.noTree', ['insert']));
|
|
23935
|
-
}
|
|
23936
|
-
var afIndex = -1;
|
|
23937
|
-
// 如果是可视索引
|
|
23938
|
-
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(row)) {
|
|
23939
|
-
if (row < afterFullData.length) {
|
|
23940
|
-
afIndex = row;
|
|
23941
|
-
}
|
|
23942
|
-
} else {
|
|
23943
|
-
afIndex = this.findRowIndexOf(afterFullData, row);
|
|
23944
|
-
}
|
|
23945
|
-
if (afIndex === -1) {
|
|
23946
|
-
throw new Error(errLog('vxe.error.unableInsert'));
|
|
23947
|
-
}
|
|
23948
|
-
afterFullData.splice.apply(afterFullData, [afIndex, 0].concat(_toConsumableArray(newRecords)));
|
|
23949
|
-
tableFullData.splice.apply(tableFullData, [this.findRowIndexOf(tableFullData, row), 0].concat(_toConsumableArray(newRecords)));
|
|
23950
|
-
// 刷新单元格合并
|
|
23951
|
-
mergeList.forEach(function (mergeItem) {
|
|
23952
|
-
var mergeRowIndex = mergeItem.row,
|
|
23953
|
-
mergeRowspan = mergeItem.rowspan;
|
|
23954
|
-
if (mergeRowIndex > afIndex) {
|
|
23955
|
-
mergeItem.row = mergeRowIndex + newRecords.length;
|
|
23956
|
-
} else if (mergeRowIndex + mergeRowspan > afIndex) {
|
|
23957
|
-
mergeItem.rowspan = mergeRowspan + newRecords.length;
|
|
23958
|
-
}
|
|
23959
|
-
});
|
|
23960
|
-
}
|
|
23961
|
-
}
|
|
23962
|
-
}
|
|
23963
|
-
var insertList = editStore.insertList,
|
|
23964
|
-
insertMaps = editStore.insertMaps;
|
|
23965
|
-
newRecords.forEach(function (newRow) {
|
|
23966
|
-
var rowid = getRowid(_this, newRow);
|
|
23967
|
-
insertMaps[rowid] = newRow;
|
|
23968
|
-
});
|
|
23969
|
-
insertList.unshift.apply(insertList, _toConsumableArray(newRecords));
|
|
23970
|
-
this.cacheRowMap();
|
|
23971
|
-
this.updateScrollYStatus();
|
|
23972
|
-
this.handleTableData(treeConfig && transform);
|
|
23973
|
-
if (!(treeConfig && transform)) {
|
|
23974
|
-
this.updateAfterDataIndex();
|
|
23975
|
-
}
|
|
23976
|
-
this.updateFooter();
|
|
23977
|
-
this.checkSelectionStatus();
|
|
23978
|
-
if (this.scrollYLoad) {
|
|
23979
|
-
this.updateScrollYSpace();
|
|
23980
|
-
}
|
|
23981
|
-
return this.$nextTick().then(function () {
|
|
23982
|
-
_this.updateCellAreas();
|
|
23983
|
-
return _this.recalculate();
|
|
23984
|
-
}).then(function () {
|
|
23985
|
-
return {
|
|
23986
|
-
row: newRecords.length ? newRecords[newRecords.length - 1] : null,
|
|
23987
|
-
rows: newRecords
|
|
23988
|
-
};
|
|
23989
|
-
});
|
|
24052
|
+
return handleInsertRowAt(this, records, row);
|
|
24053
|
+
},
|
|
24054
|
+
_insertNextAt: function _insertNextAt(records, row) {
|
|
24055
|
+
return handleInsertRowAt(this, records, row, true);
|
|
23990
24056
|
},
|
|
23991
24057
|
/**
|
|
23992
24058
|
* 删除指定行数据
|
|
@@ -23995,7 +24061,7 @@ function insertTreeRow(_vm, newRecords, isAppend) {
|
|
|
23995
24061
|
* 如果为空则删除所有
|
|
23996
24062
|
*/
|
|
23997
24063
|
_remove: function _remove(rows) {
|
|
23998
|
-
var
|
|
24064
|
+
var _this = this;
|
|
23999
24065
|
var afterFullData = this.afterFullData,
|
|
24000
24066
|
tableFullData = this.tableFullData,
|
|
24001
24067
|
tableFullTreeData = this.tableFullTreeData,
|
|
@@ -24006,13 +24072,15 @@ function insertTreeRow(_vm, newRecords, isAppend) {
|
|
|
24006
24072
|
selectCheckboxRows = this.selectCheckboxRows,
|
|
24007
24073
|
isInsertByRow = this.isInsertByRow,
|
|
24008
24074
|
treeOpts = this.treeOpts;
|
|
24009
|
-
var transform = treeOpts.transform
|
|
24075
|
+
var transform = treeOpts.transform,
|
|
24076
|
+
mapChildrenField = treeOpts.mapChildrenField;
|
|
24077
|
+
var childrenField = treeOpts.children || treeOpts.childrenField;
|
|
24010
24078
|
var actived = editStore.actived,
|
|
24011
24079
|
removeList = editStore.removeList,
|
|
24012
24080
|
insertList = editStore.insertList,
|
|
24013
24081
|
insertMaps = editStore.insertMaps;
|
|
24014
24082
|
var checkField = checkboxOpts.checkField;
|
|
24015
|
-
var
|
|
24083
|
+
var delList = [];
|
|
24016
24084
|
if (!rows) {
|
|
24017
24085
|
rows = tableFullData;
|
|
24018
24086
|
} else if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(rows)) {
|
|
@@ -24027,7 +24095,7 @@ function insertTreeRow(_vm, newRecords, isAppend) {
|
|
|
24027
24095
|
// 如果绑定了多选属性,则更新状态
|
|
24028
24096
|
if (!checkField) {
|
|
24029
24097
|
rows.forEach(function (row) {
|
|
24030
|
-
var sIndex =
|
|
24098
|
+
var sIndex = _this.findRowIndexOf(selectCheckboxRows, row);
|
|
24031
24099
|
if (sIndex > -1) {
|
|
24032
24100
|
selectCheckboxRows.splice(sIndex, 1);
|
|
24033
24101
|
}
|
|
@@ -24035,7 +24103,7 @@ function insertTreeRow(_vm, newRecords, isAppend) {
|
|
|
24035
24103
|
}
|
|
24036
24104
|
// 从数据源中移除
|
|
24037
24105
|
if (tableFullData === rows) {
|
|
24038
|
-
rows =
|
|
24106
|
+
rows = delList = tableFullData.slice(0);
|
|
24039
24107
|
this.tableFullData = [];
|
|
24040
24108
|
this.afterFullData = [];
|
|
24041
24109
|
this.clearMergeCells();
|
|
@@ -24043,27 +24111,37 @@ function insertTreeRow(_vm, newRecords, isAppend) {
|
|
|
24043
24111
|
// 如果为虚拟树
|
|
24044
24112
|
if (treeConfig && transform) {
|
|
24045
24113
|
rows.forEach(function (row) {
|
|
24046
|
-
var rowid = getRowid(
|
|
24114
|
+
var rowid = getRowid(_this, row);
|
|
24115
|
+
var matchMapObj = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findTree(tableFullTreeData, function (item) {
|
|
24116
|
+
return rowid === getRowid(_this, item);
|
|
24117
|
+
}, {
|
|
24118
|
+
children: mapChildrenField
|
|
24119
|
+
});
|
|
24120
|
+
if (matchMapObj) {
|
|
24121
|
+
var rItems = matchMapObj.items.splice(matchMapObj.index, 1);
|
|
24122
|
+
delList.push(rItems[0]);
|
|
24123
|
+
}
|
|
24047
24124
|
var matchObj = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findTree(tableFullTreeData, function (item) {
|
|
24048
|
-
return rowid === getRowid(
|
|
24049
|
-
},
|
|
24125
|
+
return rowid === getRowid(_this, item);
|
|
24126
|
+
}, {
|
|
24127
|
+
children: childrenField
|
|
24128
|
+
});
|
|
24050
24129
|
if (matchObj) {
|
|
24051
|
-
|
|
24052
|
-
rest.push(rItems[0]);
|
|
24130
|
+
matchObj.items.splice(matchObj.index, 1);
|
|
24053
24131
|
}
|
|
24054
|
-
var afIndex =
|
|
24132
|
+
var afIndex = _this.findRowIndexOf(afterFullData, row);
|
|
24055
24133
|
if (afIndex > -1) {
|
|
24056
24134
|
afterFullData.splice(afIndex, 1);
|
|
24057
24135
|
}
|
|
24058
24136
|
});
|
|
24059
24137
|
} else {
|
|
24060
24138
|
rows.forEach(function (row) {
|
|
24061
|
-
var tfIndex =
|
|
24139
|
+
var tfIndex = _this.findRowIndexOf(tableFullData, row);
|
|
24062
24140
|
if (tfIndex > -1) {
|
|
24063
24141
|
var rItems = tableFullData.splice(tfIndex, 1);
|
|
24064
|
-
|
|
24142
|
+
delList.push(rItems[0]);
|
|
24065
24143
|
}
|
|
24066
|
-
var afIndex =
|
|
24144
|
+
var afIndex = _this.findRowIndexOf(afterFullData, row);
|
|
24067
24145
|
if (afIndex > -1) {
|
|
24068
24146
|
// 刷新单元格合并
|
|
24069
24147
|
mergeList.forEach(function (mergeItem) {
|
|
@@ -24086,8 +24164,8 @@ function insertTreeRow(_vm, newRecords, isAppend) {
|
|
|
24086
24164
|
}
|
|
24087
24165
|
// 从新增中移除已删除的数据
|
|
24088
24166
|
rows.forEach(function (row) {
|
|
24089
|
-
var rowid = getRowid(
|
|
24090
|
-
var iIndex =
|
|
24167
|
+
var rowid = getRowid(_this, row);
|
|
24168
|
+
var iIndex = _this.findRowIndexOf(insertList, row);
|
|
24091
24169
|
if (iIndex > -1) {
|
|
24092
24170
|
insertList.splice(iIndex, 1);
|
|
24093
24171
|
}
|
|
@@ -24104,12 +24182,12 @@ function insertTreeRow(_vm, newRecords, isAppend) {
|
|
|
24104
24182
|
this.updateScrollYSpace();
|
|
24105
24183
|
}
|
|
24106
24184
|
return this.$nextTick().then(function () {
|
|
24107
|
-
|
|
24108
|
-
return
|
|
24185
|
+
_this.updateCellAreas();
|
|
24186
|
+
return _this.recalculate();
|
|
24109
24187
|
}).then(function () {
|
|
24110
24188
|
return {
|
|
24111
|
-
row:
|
|
24112
|
-
rows:
|
|
24189
|
+
row: delList.length ? delList[delList.length - 1] : null,
|
|
24190
|
+
rows: delList
|
|
24113
24191
|
};
|
|
24114
24192
|
});
|
|
24115
24193
|
},
|
|
@@ -24117,9 +24195,9 @@ function insertTreeRow(_vm, newRecords, isAppend) {
|
|
|
24117
24195
|
* 删除复选框选中的数据
|
|
24118
24196
|
*/
|
|
24119
24197
|
_removeCheckboxRow: function _removeCheckboxRow() {
|
|
24120
|
-
var
|
|
24198
|
+
var _this2 = this;
|
|
24121
24199
|
return this.remove(this.getCheckboxRecords()).then(function (params) {
|
|
24122
|
-
|
|
24200
|
+
_this2.clearCheckboxRow();
|
|
24123
24201
|
return params;
|
|
24124
24202
|
});
|
|
24125
24203
|
},
|
|
@@ -24127,10 +24205,10 @@ function insertTreeRow(_vm, newRecords, isAppend) {
|
|
|
24127
24205
|
* 删除单选框选中的数据
|
|
24128
24206
|
*/
|
|
24129
24207
|
_removeRadioRow: function _removeRadioRow() {
|
|
24130
|
-
var
|
|
24208
|
+
var _this3 = this;
|
|
24131
24209
|
var radioRecord = this.getRadioRecord();
|
|
24132
24210
|
return this.remove(radioRecord || []).then(function (params) {
|
|
24133
|
-
|
|
24211
|
+
_this3.clearRadioRow();
|
|
24134
24212
|
return params;
|
|
24135
24213
|
});
|
|
24136
24214
|
},
|
|
@@ -24138,10 +24216,10 @@ function insertTreeRow(_vm, newRecords, isAppend) {
|
|
|
24138
24216
|
* 删除当前行选中的数据
|
|
24139
24217
|
*/
|
|
24140
24218
|
_removeCurrentRow: function _removeCurrentRow() {
|
|
24141
|
-
var
|
|
24219
|
+
var _this4 = this;
|
|
24142
24220
|
var currentRecord = this.getCurrentRecord();
|
|
24143
24221
|
return this.remove(currentRecord || []).then(function (params) {
|
|
24144
|
-
|
|
24222
|
+
_this4.clearCurrentRow();
|
|
24145
24223
|
return params;
|
|
24146
24224
|
});
|
|
24147
24225
|
},
|
|
@@ -24159,12 +24237,12 @@ function insertTreeRow(_vm, newRecords, isAppend) {
|
|
|
24159
24237
|
* 获取新增的临时数据
|
|
24160
24238
|
*/
|
|
24161
24239
|
_getInsertRecords: function _getInsertRecords() {
|
|
24162
|
-
var
|
|
24240
|
+
var _this5 = this;
|
|
24163
24241
|
var fullAllDataRowIdData = this.fullAllDataRowIdData;
|
|
24164
24242
|
var insertList = this.editStore.insertList;
|
|
24165
24243
|
var insertRecords = [];
|
|
24166
24244
|
insertList.forEach(function (row) {
|
|
24167
|
-
var rowid = getRowid(
|
|
24245
|
+
var rowid = getRowid(_this5, row);
|
|
24168
24246
|
if (fullAllDataRowIdData[rowid]) {
|
|
24169
24247
|
insertRecords.push(row);
|
|
24170
24248
|
}
|
|
@@ -24211,7 +24289,7 @@ function insertTreeRow(_vm, newRecords, isAppend) {
|
|
|
24211
24289
|
* 处理激活编辑
|
|
24212
24290
|
*/
|
|
24213
24291
|
handleActived: function handleActived(params, evnt) {
|
|
24214
|
-
var
|
|
24292
|
+
var _this6 = this;
|
|
24215
24293
|
var editStore = this.editStore,
|
|
24216
24294
|
editOpts = this.editOpts,
|
|
24217
24295
|
tableColumn = this.tableColumn,
|
|
@@ -24247,13 +24325,13 @@ function insertTreeRow(_vm, newRecords, isAppend) {
|
|
|
24247
24325
|
actived.column = column;
|
|
24248
24326
|
if (mode === 'row') {
|
|
24249
24327
|
tableColumn.forEach(function (column) {
|
|
24250
|
-
return
|
|
24328
|
+
return _this6._getColumnModel(row, column);
|
|
24251
24329
|
});
|
|
24252
24330
|
} else {
|
|
24253
24331
|
this._getColumnModel(row, column);
|
|
24254
24332
|
}
|
|
24255
24333
|
this.$nextTick(function () {
|
|
24256
|
-
|
|
24334
|
+
_this6.handleFocus(params, evnt);
|
|
24257
24335
|
});
|
|
24258
24336
|
}
|
|
24259
24337
|
this.emitEvent(type, {
|
|
@@ -24282,7 +24360,7 @@ function insertTreeRow(_vm, newRecords, isAppend) {
|
|
|
24282
24360
|
actived.args = params;
|
|
24283
24361
|
actived.column = column;
|
|
24284
24362
|
setTimeout(function () {
|
|
24285
|
-
|
|
24363
|
+
_this6.handleFocus(params, evnt);
|
|
24286
24364
|
});
|
|
24287
24365
|
}
|
|
24288
24366
|
this.focus();
|
|
@@ -24307,7 +24385,7 @@ function insertTreeRow(_vm, newRecords, isAppend) {
|
|
|
24307
24385
|
}
|
|
24308
24386
|
},
|
|
24309
24387
|
_syncActivedCell: function _syncActivedCell() {
|
|
24310
|
-
var
|
|
24388
|
+
var _this7 = this;
|
|
24311
24389
|
var tableColumn = this.tableColumn,
|
|
24312
24390
|
editStore = this.editStore,
|
|
24313
24391
|
editOpts = this.editOpts;
|
|
@@ -24317,7 +24395,7 @@ function insertTreeRow(_vm, newRecords, isAppend) {
|
|
|
24317
24395
|
if (row || column) {
|
|
24318
24396
|
if (editOpts.mode === 'row') {
|
|
24319
24397
|
tableColumn.forEach(function (column) {
|
|
24320
|
-
return
|
|
24398
|
+
return _this7._setColumnModel(row, column);
|
|
24321
24399
|
});
|
|
24322
24400
|
} else {
|
|
24323
24401
|
this._setColumnModel(row, column);
|
|
@@ -24460,22 +24538,22 @@ function insertTreeRow(_vm, newRecords, isAppend) {
|
|
|
24460
24538
|
* 激活单元格编辑
|
|
24461
24539
|
*/
|
|
24462
24540
|
_setEditCell: function _setEditCell(row, fieldOrColumn) {
|
|
24463
|
-
var
|
|
24541
|
+
var _this8 = this;
|
|
24464
24542
|
var editConfig = this.editConfig;
|
|
24465
24543
|
var column = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(fieldOrColumn) ? this.getColumnByField(fieldOrColumn) : fieldOrColumn;
|
|
24466
24544
|
if (row && column && isEnableConf(editConfig) && isEnableConf(column.editRender)) {
|
|
24467
24545
|
return this.scrollToRow(row, true).then(function () {
|
|
24468
|
-
var cell =
|
|
24546
|
+
var cell = _this8.getCell(row, column);
|
|
24469
24547
|
if (cell) {
|
|
24470
|
-
|
|
24548
|
+
_this8.handleActived({
|
|
24471
24549
|
row: row,
|
|
24472
|
-
rowIndex:
|
|
24550
|
+
rowIndex: _this8.getRowIndex(row),
|
|
24473
24551
|
column: column,
|
|
24474
|
-
columnIndex:
|
|
24552
|
+
columnIndex: _this8.getColumnIndex(column),
|
|
24475
24553
|
cell: cell,
|
|
24476
|
-
$table:
|
|
24554
|
+
$table: _this8
|
|
24477
24555
|
});
|
|
24478
|
-
|
|
24556
|
+
_this8.lastCallTime = Date.now();
|
|
24479
24557
|
}
|
|
24480
24558
|
});
|
|
24481
24559
|
}
|
|
@@ -24509,7 +24587,7 @@ function insertTreeRow(_vm, newRecords, isAppend) {
|
|
|
24509
24587
|
* 处理选中源
|
|
24510
24588
|
*/
|
|
24511
24589
|
handleSelected: function handleSelected(params, evnt) {
|
|
24512
|
-
var
|
|
24590
|
+
var _this9 = this;
|
|
24513
24591
|
var mouseConfig = this.mouseConfig,
|
|
24514
24592
|
mouseOpts = this.mouseOpts,
|
|
24515
24593
|
editOpts = this.editOpts,
|
|
@@ -24522,23 +24600,23 @@ function insertTreeRow(_vm, newRecords, isAppend) {
|
|
|
24522
24600
|
var selectMethod = function selectMethod() {
|
|
24523
24601
|
if (isMouseSelected && (selected.row !== row || selected.column !== column)) {
|
|
24524
24602
|
if (actived.row !== row || (editOpts.mode === 'cell' ? actived.column !== column : false)) {
|
|
24525
|
-
|
|
24526
|
-
|
|
24527
|
-
|
|
24528
|
-
|
|
24603
|
+
_this9.clearActived(evnt);
|
|
24604
|
+
_this9.clearSelected(evnt);
|
|
24605
|
+
_this9.clearCellAreas(evnt);
|
|
24606
|
+
_this9.clearCopyCellArea(evnt);
|
|
24529
24607
|
selected.args = params;
|
|
24530
24608
|
selected.row = row;
|
|
24531
24609
|
selected.column = column;
|
|
24532
24610
|
if (isMouseSelected) {
|
|
24533
|
-
|
|
24611
|
+
_this9.addColSdCls();
|
|
24534
24612
|
}
|
|
24535
|
-
|
|
24613
|
+
_this9.focus();
|
|
24536
24614
|
if (evnt) {
|
|
24537
|
-
|
|
24615
|
+
_this9.emitEvent('cell-selected', params, evnt);
|
|
24538
24616
|
}
|
|
24539
24617
|
}
|
|
24540
24618
|
}
|
|
24541
|
-
return
|
|
24619
|
+
return _this9.$nextTick();
|
|
24542
24620
|
};
|
|
24543
24621
|
return selectMethod();
|
|
24544
24622
|
},
|