vxe-table 3.7.0-beta.12 → 3.7.0-beta.14

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/index.umd.js CHANGED
@@ -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.12", "] ").concat(conf.i18n(message, params));
11048
+ return "[vxe-table v".concat("3.7.0-beta.13", "] ").concat(conf.i18n(message, params));
11049
11049
  }
11050
11050
  function outLog(type) {
11051
11051
  return function (message, params) {
@@ -11219,6 +11219,88 @@ var es_array_splice = __webpack_require__(561);
11219
11219
  var es_array_last_index_of = __webpack_require__(4986);
11220
11220
  // EXTERNAL MODULE: ./node_modules/core-js/modules/es.parse-float.js
11221
11221
  var es_parse_float = __webpack_require__(4678);
11222
+ ;// CONCATENATED MODULE: ./node_modules/dom-zindex/es/index.esm.js
11223
+ var storeEl = null;
11224
+ var storeId = 'z-index-manage';
11225
+ var storeMainKey = 'm';
11226
+ var storeSubKey = 's';
11227
+ var storeData = {
11228
+ m: 1000,
11229
+ s: 1000
11230
+ };
11231
+ function getDom() {
11232
+ if (!storeEl) {
11233
+ if (typeof document !== 'undefined') {
11234
+ storeEl = document.getElementById(storeId);
11235
+ if (!storeEl) {
11236
+ storeEl = document.createElement('div');
11237
+ storeEl.id = storeId;
11238
+ document.body.appendChild(storeEl);
11239
+ setCurrent(storeData.m);
11240
+ setSubCurrent(storeData.s);
11241
+ }
11242
+ }
11243
+ }
11244
+ return storeEl;
11245
+ }
11246
+ function createSetHandle(key) {
11247
+ return function (value) {
11248
+ if (value) {
11249
+ value = Number(value);
11250
+ storeData[key] = value;
11251
+ var doc = getDom();
11252
+ if (doc) {
11253
+ if (doc.dataset) {
11254
+ doc.dataset[key] = value + '';
11255
+ }
11256
+ else {
11257
+ doc.setAttribute('data-' + key, value + '');
11258
+ }
11259
+ }
11260
+ }
11261
+ return storeData[key];
11262
+ };
11263
+ }
11264
+ var setCurrent = createSetHandle(storeMainKey);
11265
+ function createGetHandle(key) {
11266
+ return function getCurrent() {
11267
+ var zIndex;
11268
+ var doc = getDom();
11269
+ if (doc) {
11270
+ zIndex = doc.dataset ? doc.dataset[key] : doc.getAttribute('data-' + key);
11271
+ }
11272
+ if (zIndex) {
11273
+ return Number(zIndex);
11274
+ }
11275
+ return storeData[key];
11276
+ };
11277
+ }
11278
+ var getCurrent = createGetHandle(storeMainKey);
11279
+ function getNext() {
11280
+ return setCurrent(getCurrent() + 1);
11281
+ }
11282
+ var setSubCurrent = createSetHandle(storeSubKey);
11283
+ var _getSubCurrent = createGetHandle(storeSubKey);
11284
+ function getSubCurrent() {
11285
+ return getCurrent() + _getSubCurrent();
11286
+ }
11287
+ function getSubNext() {
11288
+ setSubCurrent(_getSubCurrent() + 1);
11289
+ return getSubCurrent();
11290
+ }
11291
+ /**
11292
+ * Web common z-index style management
11293
+ */
11294
+ var DomZIndex = {
11295
+ setCurrent: setCurrent,
11296
+ getCurrent: getCurrent,
11297
+ getNext: getNext,
11298
+ setSubCurrent: setSubCurrent,
11299
+ getSubCurrent: getSubCurrent,
11300
+ getSubNext: getSubNext
11301
+ };
11302
+ /* harmony default export */ const index_esm = (DomZIndex);
11303
+
11222
11304
  ;// CONCATENATED MODULE: ./packages/tools/utils.js
11223
11305
 
11224
11306
 
@@ -11233,8 +11315,7 @@ var es_parse_float = __webpack_require__(4678);
11233
11315
 
11234
11316
 
11235
11317
 
11236
- var zindexIndex = 0;
11237
- var lastZindex = 1;
11318
+
11238
11319
  function isEnableConf(conf) {
11239
11320
  return conf && conf.enabled !== false;
11240
11321
  }
@@ -11259,11 +11340,10 @@ function getColumnList(columns) {
11259
11340
  }
11260
11341
  var UtilTools = {
11261
11342
  nextZIndex: function nextZIndex() {
11262
- lastZindex = conf.zIndex + zindexIndex++;
11263
- return lastZindex;
11343
+ return index_esm.getNext();
11264
11344
  },
11265
11345
  getLastZIndex: function getLastZIndex() {
11266
- return lastZindex;
11346
+ return index_esm.getCurrent();
11267
11347
  },
11268
11348
  getColumnList: getColumnList,
11269
11349
  getClass: function getClass(property, params) {
@@ -12401,7 +12481,7 @@ function _t(key, args) {
12401
12481
  var v = 'v3';
12402
12482
  var VXETable = {
12403
12483
  v: v,
12404
- version: "3.7.0-beta.12",
12484
+ version: "3.7.0-beta.13",
12405
12485
  reg: reg,
12406
12486
  use: use,
12407
12487
  setup: setup,
@@ -21425,7 +21505,7 @@ var Methods = {
21425
21505
  };
21426
21506
 
21427
21507
  // Module methods
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,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(',');
21508
+ 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(',');
21429
21509
  funcs.forEach(function (name) {
21430
21510
  Methods[name] = function () {
21431
21511
  if (false) {}
@@ -23785,6 +23865,7 @@ var es_array_unshift = __webpack_require__(541);
23785
23865
 
23786
23866
 
23787
23867
 
23868
+
23788
23869
 
23789
23870
 
23790
23871
  function insertTreeRow(_vm, newRecords, isAppend) {
@@ -23853,6 +23934,181 @@ function insertTreeRow(_vm, newRecords, isAppend) {
23853
23934
  }
23854
23935
  });
23855
23936
  }
23937
+ function handleInsertRowAt(_vm, records, row, isInsertNextRow) {
23938
+ var tableFullTreeData = _vm.tableFullTreeData,
23939
+ mergeList = _vm.mergeList,
23940
+ afterFullData = _vm.afterFullData,
23941
+ editStore = _vm.editStore,
23942
+ tableFullData = _vm.tableFullData,
23943
+ treeConfig = _vm.treeConfig,
23944
+ fullDataRowIdData = _vm.fullDataRowIdData,
23945
+ fullAllDataRowIdData = _vm.fullAllDataRowIdData,
23946
+ treeOpts = _vm.treeOpts;
23947
+ var transform = treeOpts.transform,
23948
+ rowField = treeOpts.rowField,
23949
+ mapChildrenField = treeOpts.mapChildrenField;
23950
+ var childrenField = treeOpts.children || treeOpts.childrenField;
23951
+ if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(records)) {
23952
+ records = [records];
23953
+ }
23954
+ var newRecords = _vm.defineField(records.map(function (record) {
23955
+ var _ref;
23956
+ return Object.assign(treeConfig && transform ? (_ref = {}, _defineProperty(_ref, mapChildrenField, []), _defineProperty(_ref, childrenField, []), _ref) : {}, record);
23957
+ }));
23958
+ if (!row) {
23959
+ // 如果为虚拟树
23960
+ if (treeConfig && transform) {
23961
+ insertTreeRow(_vm, newRecords, false);
23962
+ } else {
23963
+ afterFullData.unshift.apply(afterFullData, _toConsumableArray(newRecords));
23964
+ tableFullData.unshift.apply(tableFullData, _toConsumableArray(newRecords));
23965
+ // 刷新单元格合并
23966
+ mergeList.forEach(function (mergeItem) {
23967
+ var mergeRowIndex = mergeItem.row;
23968
+ if (mergeRowIndex > 0) {
23969
+ mergeItem.row = mergeRowIndex + newRecords.length;
23970
+ }
23971
+ });
23972
+ }
23973
+ } else {
23974
+ if (row === -1) {
23975
+ // 如果为虚拟树
23976
+ if (treeConfig && transform) {
23977
+ insertTreeRow(_vm, newRecords, true);
23978
+ } else {
23979
+ afterFullData.push.apply(afterFullData, _toConsumableArray(newRecords));
23980
+ tableFullData.push.apply(tableFullData, _toConsumableArray(newRecords));
23981
+ // 刷新单元格合并
23982
+ mergeList.forEach(function (mergeItem) {
23983
+ var mergeRowIndex = mergeItem.row,
23984
+ mergeRowspan = mergeItem.rowspan;
23985
+ if (mergeRowIndex + mergeRowspan > afterFullData.length) {
23986
+ mergeItem.rowspan = mergeRowspan + newRecords.length;
23987
+ }
23988
+ });
23989
+ }
23990
+ } else {
23991
+ // 如果为虚拟树
23992
+ if (treeConfig && transform) {
23993
+ var matchMapObj = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findTree(tableFullTreeData, function (item) {
23994
+ return row[rowField] === item[rowField];
23995
+ }, {
23996
+ children: mapChildrenField
23997
+ });
23998
+ if (matchMapObj) {
23999
+ var parentRow = matchMapObj.parent;
24000
+ var parentMapChilds = parentRow ? parentRow[mapChildrenField] : tableFullTreeData;
24001
+ var parentRest = fullAllDataRowIdData[getRowid(_vm, parentRow)];
24002
+ var parentLevel = parentRest ? parentRest.level : 0;
24003
+ newRecords.forEach(function (item, i) {
24004
+ var rowid = getRowid(_vm, item);
24005
+ if (false) {}
24006
+ if (parentRow) {
24007
+ item[treeOpts.parentField] = parentRow[rowField];
24008
+ }
24009
+ var targetIndex = matchMapObj.index + i;
24010
+ if (isInsertNextRow) {
24011
+ targetIndex = targetIndex + 1;
24012
+ }
24013
+ parentMapChilds.splice(targetIndex, 0, item);
24014
+ var rest = {
24015
+ row: item,
24016
+ rowid: rowid,
24017
+ seq: -1,
24018
+ index: -1,
24019
+ _index: -1,
24020
+ $index: -1,
24021
+ items: parentMapChilds,
24022
+ parent: parentRow,
24023
+ level: parentLevel + 1
24024
+ };
24025
+ fullDataRowIdData[rowid] = rest;
24026
+ fullAllDataRowIdData[rowid] = rest;
24027
+ });
24028
+
24029
+ // 源
24030
+ if (parentRow) {
24031
+ var matchObj = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findTree(tableFullTreeData, function (item) {
24032
+ return row[rowField] === item[rowField];
24033
+ }, {
24034
+ children: childrenField
24035
+ });
24036
+ if (matchObj) {
24037
+ var parentChilds = matchObj.items;
24038
+ var targetIndex = matchObj.index;
24039
+ if (isInsertNextRow) {
24040
+ targetIndex = targetIndex + 1;
24041
+ }
24042
+ parentChilds.splice.apply(parentChilds, [targetIndex, 0].concat(_toConsumableArray(newRecords)));
24043
+ }
24044
+ }
24045
+ } else {
24046
+ if (false) {}
24047
+ insertTreeRow(_vm, newRecords, true);
24048
+ }
24049
+ } else {
24050
+ if (treeConfig) {
24051
+ throw new Error(getLog('vxe.error.noTree', ['insert']));
24052
+ }
24053
+ var afIndex = -1;
24054
+ // 如果是可视索引
24055
+ if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(row)) {
24056
+ if (row < afterFullData.length) {
24057
+ afIndex = row;
24058
+ }
24059
+ } else {
24060
+ afIndex = _vm.findRowIndexOf(afterFullData, row);
24061
+ }
24062
+ // 如果是插入指定行的下一行
24063
+ if (isInsertNextRow) {
24064
+ afIndex = Math.max(afterFullData.length, afIndex + 1);
24065
+ }
24066
+ if (afIndex === -1) {
24067
+ throw new Error(errLog('vxe.error.unableInsert'));
24068
+ }
24069
+ afterFullData.splice.apply(afterFullData, [afIndex, 0].concat(_toConsumableArray(newRecords)));
24070
+ tableFullData.splice.apply(tableFullData, [_vm.findRowIndexOf(tableFullData, row), 0].concat(_toConsumableArray(newRecords)));
24071
+ // 刷新单元格合并
24072
+ mergeList.forEach(function (mergeItem) {
24073
+ var mergeRowIndex = mergeItem.row,
24074
+ mergeRowspan = mergeItem.rowspan;
24075
+ if (mergeRowIndex > afIndex) {
24076
+ mergeItem.row = mergeRowIndex + newRecords.length;
24077
+ } else if (mergeRowIndex + mergeRowspan > afIndex) {
24078
+ mergeItem.rowspan = mergeRowspan + newRecords.length;
24079
+ }
24080
+ });
24081
+ }
24082
+ }
24083
+ }
24084
+ var insertList = editStore.insertList,
24085
+ insertMaps = editStore.insertMaps;
24086
+ newRecords.forEach(function (newRow) {
24087
+ var rowid = getRowid(_vm, newRow);
24088
+ insertMaps[rowid] = newRow;
24089
+ });
24090
+ insertList.unshift.apply(insertList, _toConsumableArray(newRecords));
24091
+ _vm.cacheRowMap();
24092
+ _vm.updateScrollYStatus();
24093
+ _vm.handleTableData(treeConfig && transform);
24094
+ if (!(treeConfig && transform)) {
24095
+ _vm.updateAfterDataIndex();
24096
+ }
24097
+ _vm.updateFooter();
24098
+ _vm.checkSelectionStatus();
24099
+ if (_vm.scrollYLoad) {
24100
+ _vm.updateScrollYSpace();
24101
+ }
24102
+ return _vm.$nextTick().then(function () {
24103
+ _vm.updateCellAreas();
24104
+ return _vm.recalculate();
24105
+ }).then(function () {
24106
+ return {
24107
+ row: newRecords.length ? newRecords[newRecords.length - 1] : null,
24108
+ rows: newRecords
24109
+ };
24110
+ });
24111
+ }
23856
24112
  /* harmony default export */ const edit_src_mixin = ({
23857
24113
  methods: {
23858
24114
  /**
@@ -23861,7 +24117,7 @@ function insertTreeRow(_vm, newRecords, isAppend) {
23861
24117
  * @param {*} records
23862
24118
  */
23863
24119
  _insert: function _insert(records) {
23864
- return this.insertAt(records);
24120
+ return handleInsertRowAt(this, records, null);
23865
24121
  },
23866
24122
  /**
23867
24123
  * 往表格指定行中插入临时数据
@@ -23870,155 +24126,13 @@ function insertTreeRow(_vm, newRecords, isAppend) {
23870
24126
  * 如果 row 为有效行则插入到该行的位置
23871
24127
  * @param {Object/Array} records 新的数据
23872
24128
  * @param {Row} row 指定行
24129
+ * @returns
23873
24130
  */
23874
24131
  _insertAt: function _insertAt(records, row) {
23875
- var _this = this;
23876
- var tableFullTreeData = this.tableFullTreeData,
23877
- mergeList = this.mergeList,
23878
- afterFullData = this.afterFullData,
23879
- editStore = this.editStore,
23880
- tableFullData = this.tableFullData,
23881
- treeConfig = this.treeConfig,
23882
- fullDataRowIdData = this.fullDataRowIdData,
23883
- fullAllDataRowIdData = this.fullAllDataRowIdData,
23884
- treeOpts = this.treeOpts;
23885
- var transform = treeOpts.transform,
23886
- rowField = treeOpts.rowField,
23887
- mapChildrenField = treeOpts.mapChildrenField;
23888
- if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(records)) {
23889
- records = [records];
23890
- }
23891
- var newRecords = this.defineField(records.map(function (record) {
23892
- return Object.assign({}, record);
23893
- }));
23894
- if (!row) {
23895
- // 如果为虚拟树
23896
- if (treeConfig && transform) {
23897
- insertTreeRow(this, newRecords, false);
23898
- } else {
23899
- afterFullData.unshift.apply(afterFullData, _toConsumableArray(newRecords));
23900
- tableFullData.unshift.apply(tableFullData, _toConsumableArray(newRecords));
23901
- // 刷新单元格合并
23902
- mergeList.forEach(function (mergeItem) {
23903
- var mergeRowIndex = mergeItem.row;
23904
- if (mergeRowIndex > 0) {
23905
- mergeItem.row = mergeRowIndex + newRecords.length;
23906
- }
23907
- });
23908
- }
23909
- } else {
23910
- if (row === -1) {
23911
- // 如果为虚拟树
23912
- if (treeConfig && transform) {
23913
- insertTreeRow(this, newRecords, true);
23914
- } else {
23915
- afterFullData.push.apply(afterFullData, _toConsumableArray(newRecords));
23916
- tableFullData.push.apply(tableFullData, _toConsumableArray(newRecords));
23917
- // 刷新单元格合并
23918
- mergeList.forEach(function (mergeItem) {
23919
- var mergeRowIndex = mergeItem.row,
23920
- mergeRowspan = mergeItem.rowspan;
23921
- if (mergeRowIndex + mergeRowspan > afterFullData.length) {
23922
- mergeItem.rowspan = mergeRowspan + newRecords.length;
23923
- }
23924
- });
23925
- }
23926
- } else {
23927
- // 如果为虚拟树
23928
- if (treeConfig && transform) {
23929
- var matchObj = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findTree(tableFullTreeData, function (item) {
23930
- return row[rowField] === item[rowField];
23931
- }, {
23932
- children: mapChildrenField
23933
- });
23934
- if (matchObj) {
23935
- var parentRow = matchObj.parent;
23936
- var parentChilds = matchObj.items;
23937
- var parentRest = fullAllDataRowIdData[getRowid(this, parentRow)];
23938
- var parentLevel = parentRest ? parentRest.level : 0;
23939
- newRecords.forEach(function (item, i) {
23940
- var rowid = getRowid(_this, item);
23941
- if (false) {}
23942
- if (parentRow) {
23943
- item[treeOpts.parentField] = parentRow[rowField];
23944
- }
23945
- parentChilds.splice(matchObj.index + i, 0, item);
23946
- var rest = {
23947
- row: item,
23948
- rowid: rowid,
23949
- seq: -1,
23950
- index: -1,
23951
- _index: -1,
23952
- $index: -1,
23953
- items: parentChilds,
23954
- parent: parentRow,
23955
- level: parentLevel + 1
23956
- };
23957
- fullDataRowIdData[rowid] = rest;
23958
- fullAllDataRowIdData[rowid] = rest;
23959
- });
23960
- } else {
23961
- if (false) {}
23962
- insertTreeRow(this, newRecords, true);
23963
- }
23964
- } else {
23965
- if (treeConfig) {
23966
- throw new Error(getLog('vxe.error.noTree', ['insert']));
23967
- }
23968
- var afIndex = -1;
23969
- // 如果是可视索引
23970
- if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(row)) {
23971
- if (row < afterFullData.length) {
23972
- afIndex = row;
23973
- }
23974
- } else {
23975
- afIndex = this.findRowIndexOf(afterFullData, row);
23976
- }
23977
- if (afIndex === -1) {
23978
- throw new Error(errLog('vxe.error.unableInsert'));
23979
- }
23980
- afterFullData.splice.apply(afterFullData, [afIndex, 0].concat(_toConsumableArray(newRecords)));
23981
- tableFullData.splice.apply(tableFullData, [this.findRowIndexOf(tableFullData, row), 0].concat(_toConsumableArray(newRecords)));
23982
- // 刷新单元格合并
23983
- mergeList.forEach(function (mergeItem) {
23984
- var mergeRowIndex = mergeItem.row,
23985
- mergeRowspan = mergeItem.rowspan;
23986
- if (mergeRowIndex > afIndex) {
23987
- mergeItem.row = mergeRowIndex + newRecords.length;
23988
- } else if (mergeRowIndex + mergeRowspan > afIndex) {
23989
- mergeItem.rowspan = mergeRowspan + newRecords.length;
23990
- }
23991
- });
23992
- }
23993
- }
23994
- }
23995
- var insertList = editStore.insertList,
23996
- insertMaps = editStore.insertMaps;
23997
- newRecords.forEach(function (newRow) {
23998
- var rowid = getRowid(_this, newRow);
23999
- insertMaps[rowid] = newRow;
24000
- });
24001
- insertList.unshift.apply(insertList, _toConsumableArray(newRecords));
24002
- this.cacheRowMap();
24003
- this.updateScrollYStatus();
24004
- this.handleTableData(treeConfig && transform);
24005
- if (!(treeConfig && transform)) {
24006
- this.updateAfterDataIndex();
24007
- }
24008
- this.updateFooter();
24009
- this.checkSelectionStatus();
24010
- if (this.scrollYLoad) {
24011
- this.updateScrollYSpace();
24012
- }
24013
- return this.$nextTick().then(function () {
24014
- _this.updateCellAreas();
24015
- return _this.recalculate();
24016
- }).then(function () {
24017
- return {
24018
- row: newRecords.length ? newRecords[newRecords.length - 1] : null,
24019
- rows: newRecords
24020
- };
24021
- });
24132
+ return handleInsertRowAt(this, records, row);
24133
+ },
24134
+ _insertNextAt: function _insertNextAt(records, row) {
24135
+ return handleInsertRowAt(this, records, row, true);
24022
24136
  },
24023
24137
  /**
24024
24138
  * 删除指定行数据
@@ -24027,7 +24141,7 @@ function insertTreeRow(_vm, newRecords, isAppend) {
24027
24141
  * 如果为空则删除所有
24028
24142
  */
24029
24143
  _remove: function _remove(rows) {
24030
- var _this2 = this;
24144
+ var _this = this;
24031
24145
  var afterFullData = this.afterFullData,
24032
24146
  tableFullData = this.tableFullData,
24033
24147
  tableFullTreeData = this.tableFullTreeData,
@@ -24038,13 +24152,15 @@ function insertTreeRow(_vm, newRecords, isAppend) {
24038
24152
  selectCheckboxRows = this.selectCheckboxRows,
24039
24153
  isInsertByRow = this.isInsertByRow,
24040
24154
  treeOpts = this.treeOpts;
24041
- var transform = treeOpts.transform;
24155
+ var transform = treeOpts.transform,
24156
+ mapChildrenField = treeOpts.mapChildrenField;
24157
+ var childrenField = treeOpts.children || treeOpts.childrenField;
24042
24158
  var actived = editStore.actived,
24043
24159
  removeList = editStore.removeList,
24044
24160
  insertList = editStore.insertList,
24045
24161
  insertMaps = editStore.insertMaps;
24046
24162
  var checkField = checkboxOpts.checkField;
24047
- var rest = [];
24163
+ var delList = [];
24048
24164
  if (!rows) {
24049
24165
  rows = tableFullData;
24050
24166
  } else if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(rows)) {
@@ -24059,7 +24175,7 @@ function insertTreeRow(_vm, newRecords, isAppend) {
24059
24175
  // 如果绑定了多选属性,则更新状态
24060
24176
  if (!checkField) {
24061
24177
  rows.forEach(function (row) {
24062
- var sIndex = _this2.findRowIndexOf(selectCheckboxRows, row);
24178
+ var sIndex = _this.findRowIndexOf(selectCheckboxRows, row);
24063
24179
  if (sIndex > -1) {
24064
24180
  selectCheckboxRows.splice(sIndex, 1);
24065
24181
  }
@@ -24067,7 +24183,7 @@ function insertTreeRow(_vm, newRecords, isAppend) {
24067
24183
  }
24068
24184
  // 从数据源中移除
24069
24185
  if (tableFullData === rows) {
24070
- rows = rest = tableFullData.slice(0);
24186
+ rows = delList = tableFullData.slice(0);
24071
24187
  this.tableFullData = [];
24072
24188
  this.afterFullData = [];
24073
24189
  this.clearMergeCells();
@@ -24075,27 +24191,37 @@ function insertTreeRow(_vm, newRecords, isAppend) {
24075
24191
  // 如果为虚拟树
24076
24192
  if (treeConfig && transform) {
24077
24193
  rows.forEach(function (row) {
24078
- var rowid = getRowid(_this2, row);
24194
+ var rowid = getRowid(_this, row);
24195
+ var matchMapObj = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findTree(tableFullTreeData, function (item) {
24196
+ return rowid === getRowid(_this, item);
24197
+ }, {
24198
+ children: mapChildrenField
24199
+ });
24200
+ if (matchMapObj) {
24201
+ var rItems = matchMapObj.items.splice(matchMapObj.index, 1);
24202
+ delList.push(rItems[0]);
24203
+ }
24079
24204
  var matchObj = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findTree(tableFullTreeData, function (item) {
24080
- return rowid === getRowid(_this2, item);
24081
- }, treeOpts);
24205
+ return rowid === getRowid(_this, item);
24206
+ }, {
24207
+ children: childrenField
24208
+ });
24082
24209
  if (matchObj) {
24083
- var rItems = matchObj.items.splice(matchObj.index, 1);
24084
- rest.push(rItems[0]);
24210
+ matchObj.items.splice(matchObj.index, 1);
24085
24211
  }
24086
- var afIndex = _this2.findRowIndexOf(afterFullData, row);
24212
+ var afIndex = _this.findRowIndexOf(afterFullData, row);
24087
24213
  if (afIndex > -1) {
24088
24214
  afterFullData.splice(afIndex, 1);
24089
24215
  }
24090
24216
  });
24091
24217
  } else {
24092
24218
  rows.forEach(function (row) {
24093
- var tfIndex = _this2.findRowIndexOf(tableFullData, row);
24219
+ var tfIndex = _this.findRowIndexOf(tableFullData, row);
24094
24220
  if (tfIndex > -1) {
24095
24221
  var rItems = tableFullData.splice(tfIndex, 1);
24096
- rest.push(rItems[0]);
24222
+ delList.push(rItems[0]);
24097
24223
  }
24098
- var afIndex = _this2.findRowIndexOf(afterFullData, row);
24224
+ var afIndex = _this.findRowIndexOf(afterFullData, row);
24099
24225
  if (afIndex > -1) {
24100
24226
  // 刷新单元格合并
24101
24227
  mergeList.forEach(function (mergeItem) {
@@ -24118,8 +24244,8 @@ function insertTreeRow(_vm, newRecords, isAppend) {
24118
24244
  }
24119
24245
  // 从新增中移除已删除的数据
24120
24246
  rows.forEach(function (row) {
24121
- var rowid = getRowid(_this2, row);
24122
- var iIndex = _this2.findRowIndexOf(insertList, row);
24247
+ var rowid = getRowid(_this, row);
24248
+ var iIndex = _this.findRowIndexOf(insertList, row);
24123
24249
  if (iIndex > -1) {
24124
24250
  insertList.splice(iIndex, 1);
24125
24251
  }
@@ -24136,12 +24262,12 @@ function insertTreeRow(_vm, newRecords, isAppend) {
24136
24262
  this.updateScrollYSpace();
24137
24263
  }
24138
24264
  return this.$nextTick().then(function () {
24139
- _this2.updateCellAreas();
24140
- return _this2.recalculate();
24265
+ _this.updateCellAreas();
24266
+ return _this.recalculate();
24141
24267
  }).then(function () {
24142
24268
  return {
24143
- row: rest.length ? rest[rest.length - 1] : null,
24144
- rows: rest
24269
+ row: delList.length ? delList[delList.length - 1] : null,
24270
+ rows: delList
24145
24271
  };
24146
24272
  });
24147
24273
  },
@@ -24149,9 +24275,9 @@ function insertTreeRow(_vm, newRecords, isAppend) {
24149
24275
  * 删除复选框选中的数据
24150
24276
  */
24151
24277
  _removeCheckboxRow: function _removeCheckboxRow() {
24152
- var _this3 = this;
24278
+ var _this2 = this;
24153
24279
  return this.remove(this.getCheckboxRecords()).then(function (params) {
24154
- _this3.clearCheckboxRow();
24280
+ _this2.clearCheckboxRow();
24155
24281
  return params;
24156
24282
  });
24157
24283
  },
@@ -24159,10 +24285,10 @@ function insertTreeRow(_vm, newRecords, isAppend) {
24159
24285
  * 删除单选框选中的数据
24160
24286
  */
24161
24287
  _removeRadioRow: function _removeRadioRow() {
24162
- var _this4 = this;
24288
+ var _this3 = this;
24163
24289
  var radioRecord = this.getRadioRecord();
24164
24290
  return this.remove(radioRecord || []).then(function (params) {
24165
- _this4.clearRadioRow();
24291
+ _this3.clearRadioRow();
24166
24292
  return params;
24167
24293
  });
24168
24294
  },
@@ -24170,10 +24296,10 @@ function insertTreeRow(_vm, newRecords, isAppend) {
24170
24296
  * 删除当前行选中的数据
24171
24297
  */
24172
24298
  _removeCurrentRow: function _removeCurrentRow() {
24173
- var _this5 = this;
24299
+ var _this4 = this;
24174
24300
  var currentRecord = this.getCurrentRecord();
24175
24301
  return this.remove(currentRecord || []).then(function (params) {
24176
- _this5.clearCurrentRow();
24302
+ _this4.clearCurrentRow();
24177
24303
  return params;
24178
24304
  });
24179
24305
  },
@@ -24191,12 +24317,12 @@ function insertTreeRow(_vm, newRecords, isAppend) {
24191
24317
  * 获取新增的临时数据
24192
24318
  */
24193
24319
  _getInsertRecords: function _getInsertRecords() {
24194
- var _this6 = this;
24320
+ var _this5 = this;
24195
24321
  var fullAllDataRowIdData = this.fullAllDataRowIdData;
24196
24322
  var insertList = this.editStore.insertList;
24197
24323
  var insertRecords = [];
24198
24324
  insertList.forEach(function (row) {
24199
- var rowid = getRowid(_this6, row);
24325
+ var rowid = getRowid(_this5, row);
24200
24326
  if (fullAllDataRowIdData[rowid]) {
24201
24327
  insertRecords.push(row);
24202
24328
  }
@@ -24243,7 +24369,7 @@ function insertTreeRow(_vm, newRecords, isAppend) {
24243
24369
  * 处理激活编辑
24244
24370
  */
24245
24371
  handleActived: function handleActived(params, evnt) {
24246
- var _this7 = this;
24372
+ var _this6 = this;
24247
24373
  var editStore = this.editStore,
24248
24374
  editOpts = this.editOpts,
24249
24375
  tableColumn = this.tableColumn,
@@ -24279,13 +24405,13 @@ function insertTreeRow(_vm, newRecords, isAppend) {
24279
24405
  actived.column = column;
24280
24406
  if (mode === 'row') {
24281
24407
  tableColumn.forEach(function (column) {
24282
- return _this7._getColumnModel(row, column);
24408
+ return _this6._getColumnModel(row, column);
24283
24409
  });
24284
24410
  } else {
24285
24411
  this._getColumnModel(row, column);
24286
24412
  }
24287
24413
  this.$nextTick(function () {
24288
- _this7.handleFocus(params, evnt);
24414
+ _this6.handleFocus(params, evnt);
24289
24415
  });
24290
24416
  }
24291
24417
  this.emitEvent(type, {
@@ -24314,7 +24440,7 @@ function insertTreeRow(_vm, newRecords, isAppend) {
24314
24440
  actived.args = params;
24315
24441
  actived.column = column;
24316
24442
  setTimeout(function () {
24317
- _this7.handleFocus(params, evnt);
24443
+ _this6.handleFocus(params, evnt);
24318
24444
  });
24319
24445
  }
24320
24446
  this.focus();
@@ -24339,7 +24465,7 @@ function insertTreeRow(_vm, newRecords, isAppend) {
24339
24465
  }
24340
24466
  },
24341
24467
  _syncActivedCell: function _syncActivedCell() {
24342
- var _this8 = this;
24468
+ var _this7 = this;
24343
24469
  var tableColumn = this.tableColumn,
24344
24470
  editStore = this.editStore,
24345
24471
  editOpts = this.editOpts;
@@ -24349,7 +24475,7 @@ function insertTreeRow(_vm, newRecords, isAppend) {
24349
24475
  if (row || column) {
24350
24476
  if (editOpts.mode === 'row') {
24351
24477
  tableColumn.forEach(function (column) {
24352
- return _this8._setColumnModel(row, column);
24478
+ return _this7._setColumnModel(row, column);
24353
24479
  });
24354
24480
  } else {
24355
24481
  this._setColumnModel(row, column);
@@ -24492,22 +24618,22 @@ function insertTreeRow(_vm, newRecords, isAppend) {
24492
24618
  * 激活单元格编辑
24493
24619
  */
24494
24620
  _setEditCell: function _setEditCell(row, fieldOrColumn) {
24495
- var _this9 = this;
24621
+ var _this8 = this;
24496
24622
  var editConfig = this.editConfig;
24497
24623
  var column = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(fieldOrColumn) ? this.getColumnByField(fieldOrColumn) : fieldOrColumn;
24498
24624
  if (row && column && isEnableConf(editConfig) && isEnableConf(column.editRender)) {
24499
24625
  return this.scrollToRow(row, true).then(function () {
24500
- var cell = _this9.getCell(row, column);
24626
+ var cell = _this8.getCell(row, column);
24501
24627
  if (cell) {
24502
- _this9.handleActived({
24628
+ _this8.handleActived({
24503
24629
  row: row,
24504
- rowIndex: _this9.getRowIndex(row),
24630
+ rowIndex: _this8.getRowIndex(row),
24505
24631
  column: column,
24506
- columnIndex: _this9.getColumnIndex(column),
24632
+ columnIndex: _this8.getColumnIndex(column),
24507
24633
  cell: cell,
24508
- $table: _this9
24634
+ $table: _this8
24509
24635
  });
24510
- _this9.lastCallTime = Date.now();
24636
+ _this8.lastCallTime = Date.now();
24511
24637
  }
24512
24638
  });
24513
24639
  }
@@ -24541,7 +24667,7 @@ function insertTreeRow(_vm, newRecords, isAppend) {
24541
24667
  * 处理选中源
24542
24668
  */
24543
24669
  handleSelected: function handleSelected(params, evnt) {
24544
- var _this10 = this;
24670
+ var _this9 = this;
24545
24671
  var mouseConfig = this.mouseConfig,
24546
24672
  mouseOpts = this.mouseOpts,
24547
24673
  editOpts = this.editOpts,
@@ -24554,23 +24680,23 @@ function insertTreeRow(_vm, newRecords, isAppend) {
24554
24680
  var selectMethod = function selectMethod() {
24555
24681
  if (isMouseSelected && (selected.row !== row || selected.column !== column)) {
24556
24682
  if (actived.row !== row || (editOpts.mode === 'cell' ? actived.column !== column : false)) {
24557
- _this10.clearActived(evnt);
24558
- _this10.clearSelected(evnt);
24559
- _this10.clearCellAreas(evnt);
24560
- _this10.clearCopyCellArea(evnt);
24683
+ _this9.clearActived(evnt);
24684
+ _this9.clearSelected(evnt);
24685
+ _this9.clearCellAreas(evnt);
24686
+ _this9.clearCopyCellArea(evnt);
24561
24687
  selected.args = params;
24562
24688
  selected.row = row;
24563
24689
  selected.column = column;
24564
24690
  if (isMouseSelected) {
24565
- _this10.addColSdCls();
24691
+ _this9.addColSdCls();
24566
24692
  }
24567
- _this10.focus();
24693
+ _this9.focus();
24568
24694
  if (evnt) {
24569
- _this10.emitEvent('cell-selected', params, evnt);
24695
+ _this9.emitEvent('cell-selected', params, evnt);
24570
24696
  }
24571
24697
  }
24572
24698
  }
24573
- return _this10.$nextTick();
24699
+ return _this9.$nextTick();
24574
24700
  };
24575
24701
  return selectMethod();
24576
24702
  },