vxe-table 3.7.7-beta.2 → 3.7.7-beta.4
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/README.md +1 -1
- package/helper/vetur/tags.json +1 -1
- package/lib/edit/src/mixin.js +24 -5
- package/lib/edit/src/mixin.min.js +1 -1
- package/lib/grid/src/grid.js +21 -61
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/grid/style/style.css +0 -18
- package/lib/grid/style/style.min.css +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 +496 -310
- package/lib/index.umd.min.js +1 -1
- package/lib/pulldown/src/pulldown.js +19 -6
- package/lib/pulldown/src/pulldown.min.js +1 -1
- package/lib/pulldown/style/style.css +2 -2
- package/lib/pulldown/style/style.min.css +1 -1
- package/lib/select/src/select.js +69 -48
- package/lib/select/src/select.min.js +1 -1
- package/lib/select/style/style.css +23 -6
- package/lib/select/style/style.min.css +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/src/body.js +19 -14
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/methods.js +217 -130
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +10 -8
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/style/style.css +72 -23
- package/lib/table/style/style.min.css +1 -1
- package/lib/textarea/src/textarea.js +1 -1
- package/lib/textarea/src/textarea.min.js +1 -1
- package/lib/tools/log.js +1 -1
- package/lib/tools/log.min.js +1 -1
- package/lib/tooltip/src/tooltip.js +1 -1
- package/lib/tooltip/src/tooltip.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/conf.js +1 -1
- package/lib/v-x-e-table/src/conf.min.js +1 -1
- package/lib/validator/src/mixin.js +111 -33
- package/lib/validator/src/mixin.min.js +1 -1
- package/package.json +1 -1
- package/packages/edit/src/mixin.js +24 -5
- package/packages/grid/src/grid.js +16 -45
- package/packages/pulldown/src/pulldown.js +18 -6
- package/packages/select/src/select.js +33 -12
- package/packages/table/src/body.js +20 -15
- package/packages/table/src/methods.js +106 -23
- package/packages/table/src/table.js +10 -7
- package/packages/textarea/src/textarea.js +1 -1
- package/packages/tooltip/src/tooltip.js +1 -1
- package/packages/v-x-e-table/src/conf.js +1 -1
- package/packages/validator/src/mixin.js +105 -35
- package/styles/grid.scss +0 -20
- package/styles/pulldown.scss +2 -2
- package/styles/select.scss +23 -6
- package/styles/table.scss +95 -23
- package/types/grid.d.ts +1 -1
- package/types/table.d.ts +22 -0
- package/types/v-x-e-table/renderer.d.ts +1 -1
- /package/lib/icon/style/{iconfont.1700611974815.ttf → iconfont.1703431233417.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1700611974815.woff → iconfont.1703431233417.woff} +0 -0
- /package/lib/icon/style/{iconfont.1700611974815.woff2 → iconfont.1703431233417.woff2} +0 -0
- /package/lib/{iconfont.1700611974815.ttf → iconfont.1703431233417.ttf} +0 -0
- /package/lib/{iconfont.1700611974815.woff → iconfont.1703431233417.woff} +0 -0
- /package/lib/{iconfont.1700611974815.woff2 → iconfont.1703431233417.woff2} +0 -0
package/lib/index.umd.js
CHANGED
|
@@ -10222,7 +10222,7 @@ var iconPrefix = 'vxe-icon-';
|
|
|
10222
10222
|
showHeader: true,
|
|
10223
10223
|
animat: true,
|
|
10224
10224
|
delayHover: 250,
|
|
10225
|
-
autoResize:
|
|
10225
|
+
autoResize: true,
|
|
10226
10226
|
minHeight: 144,
|
|
10227
10227
|
// keepSource: false,
|
|
10228
10228
|
// showOverflow: null,
|
|
@@ -10591,7 +10591,7 @@ var es_array_concat = __webpack_require__(2222);
|
|
|
10591
10591
|
|
|
10592
10592
|
|
|
10593
10593
|
function getLog(message, params) {
|
|
10594
|
-
return "[vxe-table v".concat("3.7.7-beta.
|
|
10594
|
+
return "[vxe-table v".concat("3.7.7-beta.4", "] ").concat(conf.i18n(message, params));
|
|
10595
10595
|
}
|
|
10596
10596
|
function outLog(type) {
|
|
10597
10597
|
return function (message, params) {
|
|
@@ -12023,7 +12023,7 @@ var setup = config;
|
|
|
12023
12023
|
var globalStore = {};
|
|
12024
12024
|
var VXETable = {
|
|
12025
12025
|
v: v,
|
|
12026
|
-
version: "3.7.7-beta.
|
|
12026
|
+
version: "3.7.7-beta.4",
|
|
12027
12027
|
reg: reg,
|
|
12028
12028
|
use: use,
|
|
12029
12029
|
setup: setup,
|
|
@@ -12883,10 +12883,10 @@ function renderColumn(h, _vm, $xetable, seq, rowid, fixedType, rowLevel, row, ro
|
|
|
12883
12883
|
editRules = $xetable.editRules,
|
|
12884
12884
|
validOpts = $xetable.validOpts,
|
|
12885
12885
|
editStore = $xetable.editStore,
|
|
12886
|
-
validStore = $xetable.validStore,
|
|
12887
12886
|
tooltipConfig = $xetable.tooltipConfig,
|
|
12888
12887
|
rowOpts = $xetable.rowOpts,
|
|
12889
|
-
columnOpts = $xetable.columnOpts
|
|
12888
|
+
columnOpts = $xetable.columnOpts,
|
|
12889
|
+
validErrorMaps = $xetable.validErrorMaps;
|
|
12890
12890
|
var type = column.type,
|
|
12891
12891
|
cellRender = column.cellRender,
|
|
12892
12892
|
editRender = column.editRender,
|
|
@@ -12914,7 +12914,7 @@ function renderColumn(h, _vm, $xetable, seq, rowid, fixedType, rowLevel, row, ro
|
|
|
12914
12914
|
var isDirty;
|
|
12915
12915
|
var tdOns = {};
|
|
12916
12916
|
var cellAlign = align || allAlign;
|
|
12917
|
-
var
|
|
12917
|
+
var errorValidItem = validErrorMaps["".concat(rowid, ":").concat(column.id)];
|
|
12918
12918
|
var showValidTip = editRules && validOpts.showMessage && (validOpts.message === 'default' ? height || tableData.length > 1 : validOpts.message === 'inline');
|
|
12919
12919
|
var attrs = {
|
|
12920
12920
|
colid: column.id
|
|
@@ -13070,19 +13070,19 @@ function renderColumn(h, _vm, $xetable, seq, rowid, fixedType, rowLevel, row, ro
|
|
|
13070
13070
|
title: showTitle ? $xetable.getCellLabel(row, column) : null
|
|
13071
13071
|
}
|
|
13072
13072
|
}, column.renderCell(h, params))]));
|
|
13073
|
-
if (showValidTip &&
|
|
13073
|
+
if (showValidTip && errorValidItem) {
|
|
13074
13074
|
tdVNs.push(h('div', {
|
|
13075
|
-
class: 'vxe-cell--valid',
|
|
13076
|
-
style:
|
|
13077
|
-
width: "".concat(
|
|
13075
|
+
class: 'vxe-cell--valid-error-hint',
|
|
13076
|
+
style: errorValidItem.rule && errorValidItem.rule.maxWidth ? {
|
|
13077
|
+
width: "".concat(errorValidItem.rule.maxWidth, "px")
|
|
13078
13078
|
} : null
|
|
13079
13079
|
}, [h('span', {
|
|
13080
|
-
class: 'vxe-cell--valid-msg'
|
|
13081
|
-
},
|
|
13080
|
+
class: 'vxe-cell--valid-error-msg'
|
|
13081
|
+
}, errorValidItem.content)]));
|
|
13082
13082
|
}
|
|
13083
13083
|
}
|
|
13084
13084
|
return h('td', {
|
|
13085
|
-
class: ['vxe-body--column', column.id, (_ref2 = {}, _defineProperty(_ref2, "col--".concat(cellAlign), cellAlign), _defineProperty(_ref2, "col--".concat(type), type), _defineProperty(_ref2, 'col--last', $columnIndex === columns.length - 1), _defineProperty(_ref2, 'col--tree-node', treeNode), _defineProperty(_ref2, 'col--edit', isEdit), _defineProperty(_ref2, 'col--ellipsis', hasEllipsis), _defineProperty(_ref2, 'fixed--hidden', fixedHiddenColumn), _defineProperty(_ref2, 'col--dirty', isDirty), _defineProperty(_ref2, 'col--
|
|
13085
|
+
class: ['vxe-body--column', column.id, (_ref2 = {}, _defineProperty(_ref2, "col--".concat(cellAlign), cellAlign), _defineProperty(_ref2, "col--".concat(type), type), _defineProperty(_ref2, 'col--last', $columnIndex === columns.length - 1), _defineProperty(_ref2, 'col--tree-node', treeNode), _defineProperty(_ref2, 'col--edit', isEdit), _defineProperty(_ref2, 'col--ellipsis', hasEllipsis), _defineProperty(_ref2, 'fixed--hidden', fixedHiddenColumn), _defineProperty(_ref2, 'col--dirty', isDirty), _defineProperty(_ref2, 'col--active', editConfig && isEdit && actived.row === row && (actived.column === column || editOpts.mode === 'row')), _defineProperty(_ref2, 'col--valid-error', !!errorValidItem), _defineProperty(_ref2, 'col--current', currentColumn === column), _ref2), utils.getClass(compCellClassName, params), utils.getClass(className, params), utils.getClass(allCellClassName, params)],
|
|
13086
13086
|
key: columnKey || columnOpts.useKey ? column.id : $columnIndex,
|
|
13087
13087
|
attrs: attrs,
|
|
13088
13088
|
style: Object.assign({
|
|
@@ -13111,7 +13111,9 @@ function renderRows(h, _vm, $xetable, fixedType, tableData, tableColumn) {
|
|
|
13111
13111
|
expandColumn = $xetable.expandColumn,
|
|
13112
13112
|
hasFixedColumn = $xetable.hasFixedColumn,
|
|
13113
13113
|
fullAllDataRowIdData = $xetable.fullAllDataRowIdData,
|
|
13114
|
-
rowOpts = $xetable.rowOpts
|
|
13114
|
+
rowOpts = $xetable.rowOpts,
|
|
13115
|
+
pendingRowList = $xetable.pendingRowList,
|
|
13116
|
+
pendingRowMaps = $xetable.pendingRowMaps;
|
|
13115
13117
|
var childrenField = treeOpts.children || treeOpts.childrenField;
|
|
13116
13118
|
var rows = [];
|
|
13117
13119
|
tableData.forEach(function (row, $rowIndex) {
|
|
@@ -13175,7 +13177,8 @@ function renderRows(h, _vm, $xetable, fixedType, tableData, tableColumn) {
|
|
|
13175
13177
|
'is--expand-tree': isExpandTree,
|
|
13176
13178
|
'row--new': isNewRow && (editOpts.showStatus || editOpts.showInsertStatus),
|
|
13177
13179
|
'row--radio': radioOpts.highlight && $xetable.selectRadioRow === row,
|
|
13178
|
-
'row--checked': checkboxOpts.highlight && $xetable.isCheckedByCheckboxRow(row)
|
|
13180
|
+
'row--checked': checkboxOpts.highlight && $xetable.isCheckedByCheckboxRow(row),
|
|
13181
|
+
'row--pending': pendingRowList.length && !!pendingRowMaps[rowid]
|
|
13179
13182
|
}, rowClassName ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(rowClassName) ? rowClassName(params) : rowClassName : ''],
|
|
13180
13183
|
attrs: {
|
|
13181
13184
|
rowid: rowid
|
|
@@ -13309,8 +13312,10 @@ function syncBodyScroll(_vm, fixedType, scrollTop, elem1, elem2) {
|
|
|
13309
13312
|
elemStore["".concat(prefix, "xSpace")] = $refs.xSpace;
|
|
13310
13313
|
elemStore["".concat(prefix, "ySpace")] = $refs.ySpace;
|
|
13311
13314
|
elemStore["".concat(prefix, "emptyBlock")] = $refs.emptyBlock;
|
|
13312
|
-
this.$el
|
|
13313
|
-
|
|
13315
|
+
if (this.$el) {
|
|
13316
|
+
this.$el.onscroll = this.scrollEvent;
|
|
13317
|
+
this.$el._onscroll = this.scrollEvent;
|
|
13318
|
+
}
|
|
13314
13319
|
},
|
|
13315
13320
|
beforeDestroy: function beforeDestroy() {
|
|
13316
13321
|
clearTimeout(this.wheelTime);
|
|
@@ -17893,7 +17898,9 @@ var Methods = {
|
|
|
17893
17898
|
mouseConfig = this.mouseConfig,
|
|
17894
17899
|
editStore = this.editStore,
|
|
17895
17900
|
ctxMenuStore = this.ctxMenuStore,
|
|
17901
|
+
editRules = this.editRules,
|
|
17896
17902
|
editOpts = this.editOpts,
|
|
17903
|
+
validOpts = this.validOpts,
|
|
17897
17904
|
filterStore = this.filterStore,
|
|
17898
17905
|
getRowNode = this.getRowNode;
|
|
17899
17906
|
var actived = editStore.actived;
|
|
@@ -17974,8 +17981,13 @@ var Methods = {
|
|
|
17974
17981
|
if (ctxMenuStore.visible && ctxWrapper && !getEventTargetNode(evnt, ctxWrapper.$el).flag) {
|
|
17975
17982
|
this.closeMenu();
|
|
17976
17983
|
}
|
|
17984
|
+
var isActivated = getEventTargetNode(evnt, ($xegrid || this).$el).flag;
|
|
17985
|
+
// 如果存在校验,点击了表格之外则清除
|
|
17986
|
+
if (!isActivated && editRules && validOpts.autoClear) {
|
|
17987
|
+
this.validErrorMaps = {};
|
|
17988
|
+
}
|
|
17977
17989
|
// 最后激活的表格
|
|
17978
|
-
this.isActivated =
|
|
17990
|
+
this.isActivated = isActivated;
|
|
17979
17991
|
},
|
|
17980
17992
|
/**
|
|
17981
17993
|
* 窗口失焦事件处理
|
|
@@ -19760,8 +19772,78 @@ var Methods = {
|
|
|
19760
19772
|
this.emitEvent('sort-change', params, evnt);
|
|
19761
19773
|
}
|
|
19762
19774
|
},
|
|
19763
|
-
|
|
19775
|
+
setPendingRow: function setPendingRow(rows, status) {
|
|
19764
19776
|
var _this40 = this;
|
|
19777
|
+
var pendingMaps = _objectSpread2({}, this.pendingRowMaps);
|
|
19778
|
+
var pendingList = _toConsumableArray(this.pendingRowList);
|
|
19779
|
+
if (rows && !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(rows)) {
|
|
19780
|
+
rows = [rows];
|
|
19781
|
+
}
|
|
19782
|
+
if (status) {
|
|
19783
|
+
rows.forEach(function (row) {
|
|
19784
|
+
var rowid = getRowid(_this40, row);
|
|
19785
|
+
if (rowid && !pendingMaps[rowid]) {
|
|
19786
|
+
pendingList.push(row);
|
|
19787
|
+
pendingMaps[rowid] = row;
|
|
19788
|
+
}
|
|
19789
|
+
});
|
|
19790
|
+
} else {
|
|
19791
|
+
rows.forEach(function (row) {
|
|
19792
|
+
var rowid = getRowid(_this40, row);
|
|
19793
|
+
if (rowid && pendingMaps[rowid]) {
|
|
19794
|
+
var pendingIndex = _this40.findRowIndexOf(pendingList, row);
|
|
19795
|
+
if (pendingIndex > -1) {
|
|
19796
|
+
pendingList.splice(pendingIndex, 1);
|
|
19797
|
+
}
|
|
19798
|
+
delete pendingMaps[rowid];
|
|
19799
|
+
}
|
|
19800
|
+
});
|
|
19801
|
+
}
|
|
19802
|
+
this.pendingRowMaps = pendingMaps;
|
|
19803
|
+
this.pendingRowList = pendingList;
|
|
19804
|
+
return this.$nextTick();
|
|
19805
|
+
},
|
|
19806
|
+
togglePendingRow: function togglePendingRow(rows) {
|
|
19807
|
+
var _this41 = this;
|
|
19808
|
+
var pendingMaps = _objectSpread2({}, this.pendingRowMaps);
|
|
19809
|
+
var pendingList = _toConsumableArray(this.pendingRowList);
|
|
19810
|
+
if (rows && !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(rows)) {
|
|
19811
|
+
rows = [rows];
|
|
19812
|
+
}
|
|
19813
|
+
rows.forEach(function (row) {
|
|
19814
|
+
var rowid = getRowid(_this41, row);
|
|
19815
|
+
if (rowid) {
|
|
19816
|
+
if (pendingMaps[rowid]) {
|
|
19817
|
+
var pendingIndex = _this41.findRowIndexOf(pendingList, row);
|
|
19818
|
+
if (pendingIndex > -1) {
|
|
19819
|
+
pendingList.splice(pendingIndex, 1);
|
|
19820
|
+
}
|
|
19821
|
+
delete pendingMaps[rowid];
|
|
19822
|
+
} else {
|
|
19823
|
+
pendingList.push(row);
|
|
19824
|
+
pendingMaps[rowid] = row;
|
|
19825
|
+
}
|
|
19826
|
+
}
|
|
19827
|
+
});
|
|
19828
|
+
this.pendingRowMaps = pendingMaps;
|
|
19829
|
+
this.pendingRowList = pendingList;
|
|
19830
|
+
return this.$nextTick();
|
|
19831
|
+
},
|
|
19832
|
+
getPendingRecords: function getPendingRecords() {
|
|
19833
|
+
return this.pendingRowList.slice(0);
|
|
19834
|
+
},
|
|
19835
|
+
hasPendingByRow: function hasPendingByRow(row) {
|
|
19836
|
+
var pendingRowMaps = this.pendingRowMaps;
|
|
19837
|
+
var rowid = getRowid(this, row);
|
|
19838
|
+
return !!pendingRowMaps[rowid];
|
|
19839
|
+
},
|
|
19840
|
+
clearPendingRow: function clearPendingRow() {
|
|
19841
|
+
this.pendingRowMaps = {};
|
|
19842
|
+
this.pendingRowList = [];
|
|
19843
|
+
return this.$nextTick();
|
|
19844
|
+
},
|
|
19845
|
+
sort: function sort(sortConfs, sortOrder) {
|
|
19846
|
+
var _this42 = this;
|
|
19765
19847
|
var sortOpts = this.sortOpts;
|
|
19766
19848
|
var multiple = sortOpts.multiple,
|
|
19767
19849
|
remote = sortOpts.remote,
|
|
@@ -19787,14 +19869,14 @@ var Methods = {
|
|
|
19787
19869
|
order = confs.order;
|
|
19788
19870
|
var column = field;
|
|
19789
19871
|
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(field)) {
|
|
19790
|
-
column =
|
|
19872
|
+
column = _this42.getColumnByField(field);
|
|
19791
19873
|
}
|
|
19792
19874
|
if (column && (column.sortable || column.remoteSort)) {
|
|
19793
19875
|
if (!firstSortColumn) {
|
|
19794
19876
|
firstSortColumn = column;
|
|
19795
19877
|
}
|
|
19796
19878
|
if (orders.indexOf(order) === -1) {
|
|
19797
|
-
order = getNextSortOrder(
|
|
19879
|
+
order = getNextSortOrder(_this42, column);
|
|
19798
19880
|
}
|
|
19799
19881
|
if (column.order !== order) {
|
|
19800
19882
|
column.order = order;
|
|
@@ -19807,8 +19889,8 @@ var Methods = {
|
|
|
19807
19889
|
this.handleTableData(true);
|
|
19808
19890
|
}
|
|
19809
19891
|
return this.$nextTick().then(function () {
|
|
19810
|
-
|
|
19811
|
-
return
|
|
19892
|
+
_this42.updateCellAreas();
|
|
19893
|
+
return _this42.updateStyle();
|
|
19812
19894
|
});
|
|
19813
19895
|
}
|
|
19814
19896
|
return this.$nextTick();
|
|
@@ -19942,14 +20024,14 @@ var Methods = {
|
|
|
19942
20024
|
* @param {Row} row 行对象
|
|
19943
20025
|
*/
|
|
19944
20026
|
reloadRowExpand: function reloadRowExpand(row) {
|
|
19945
|
-
var
|
|
20027
|
+
var _this43 = this;
|
|
19946
20028
|
var expandOpts = this.expandOpts,
|
|
19947
20029
|
rowExpandLazyLoadedMaps = this.rowExpandLazyLoadedMaps;
|
|
19948
20030
|
var lazy = expandOpts.lazy;
|
|
19949
20031
|
var rowid = getRowid(this, row);
|
|
19950
20032
|
if (lazy && !rowExpandLazyLoadedMaps[rowid]) {
|
|
19951
20033
|
this.clearRowExpandLoaded(row).then(function () {
|
|
19952
|
-
return
|
|
20034
|
+
return _this43.handleAsyncRowExpand(row);
|
|
19953
20035
|
});
|
|
19954
20036
|
}
|
|
19955
20037
|
return this.$nextTick();
|
|
@@ -19970,7 +20052,7 @@ var Methods = {
|
|
|
19970
20052
|
var lazy = expandOpts.lazy;
|
|
19971
20053
|
var rowid = getRowid(this, row);
|
|
19972
20054
|
if (!lazy || !rowExpandLazyLoadedMaps[rowid]) {
|
|
19973
|
-
var expanded = !this.
|
|
20055
|
+
var expanded = !this.isRowExpandByRow(row);
|
|
19974
20056
|
var columnIndex = this.getColumnIndex(column);
|
|
19975
20057
|
var $columnIndex = this.getVMColumnIndex(column);
|
|
19976
20058
|
this.setRowExpand(row, expanded);
|
|
@@ -19989,7 +20071,7 @@ var Methods = {
|
|
|
19989
20071
|
* 切换展开行
|
|
19990
20072
|
*/
|
|
19991
20073
|
toggleRowExpand: function toggleRowExpand(row) {
|
|
19992
|
-
return this.setRowExpand(row, !this.
|
|
20074
|
+
return this.setRowExpand(row, !this.isRowExpandByRow(row));
|
|
19993
20075
|
},
|
|
19994
20076
|
/**
|
|
19995
20077
|
* 处理默认展开行
|
|
@@ -20034,39 +20116,39 @@ var Methods = {
|
|
|
20034
20116
|
return this.setRowExpand(expandedRows, expanded);
|
|
20035
20117
|
},
|
|
20036
20118
|
handleAsyncRowExpand: function handleAsyncRowExpand(row) {
|
|
20037
|
-
var
|
|
20119
|
+
var _this44 = this;
|
|
20038
20120
|
var fullAllDataRowMap = this.fullAllDataRowMap,
|
|
20039
20121
|
expandOpts = this.expandOpts;
|
|
20040
20122
|
var rest = fullAllDataRowMap.get(row);
|
|
20041
20123
|
return new Promise(function (resolve) {
|
|
20042
20124
|
var loadMethod = expandOpts.loadMethod;
|
|
20043
20125
|
if (loadMethod) {
|
|
20044
|
-
var rowExpandLazyLoadedMaps =
|
|
20126
|
+
var rowExpandLazyLoadedMaps = _this44.rowExpandLazyLoadedMaps;
|
|
20045
20127
|
var rowTempExpandLazyLoadedMaps = _objectSpread2({}, rowExpandLazyLoadedMaps);
|
|
20046
|
-
var rowid = getRowid(
|
|
20128
|
+
var rowid = getRowid(_this44, row);
|
|
20047
20129
|
rowTempExpandLazyLoadedMaps[rowid] = row;
|
|
20048
|
-
|
|
20130
|
+
_this44.rowExpandLazyLoadedMaps = rowTempExpandLazyLoadedMaps;
|
|
20049
20131
|
loadMethod({
|
|
20050
|
-
$table:
|
|
20132
|
+
$table: _this44,
|
|
20051
20133
|
row: row,
|
|
20052
|
-
rowIndex:
|
|
20053
|
-
$rowIndex:
|
|
20134
|
+
rowIndex: _this44.getRowIndex(row),
|
|
20135
|
+
$rowIndex: _this44.getVMRowIndex(row)
|
|
20054
20136
|
}).then(function () {
|
|
20055
20137
|
rest.expandLoaded = true;
|
|
20056
|
-
var rowExpandedMaps =
|
|
20138
|
+
var rowExpandedMaps = _this44.rowExpandedMaps;
|
|
20057
20139
|
var rowTempExpandedMaps = _objectSpread2({}, rowExpandedMaps);
|
|
20058
20140
|
rowTempExpandedMaps[rowid] = row;
|
|
20059
|
-
|
|
20141
|
+
_this44.rowExpandedMaps = rowTempExpandedMaps;
|
|
20060
20142
|
}).catch(function () {
|
|
20061
20143
|
rest.expandLoaded = false;
|
|
20062
20144
|
}).finally(function () {
|
|
20063
|
-
var rowExpandLazyLoadedMaps =
|
|
20145
|
+
var rowExpandLazyLoadedMaps = _this44.rowExpandLazyLoadedMaps;
|
|
20064
20146
|
var rowTempExpandLazyLoadedMaps = _objectSpread2({}, rowExpandLazyLoadedMaps);
|
|
20065
20147
|
if (rowTempExpandLazyLoadedMaps[rowid]) {
|
|
20066
20148
|
delete rowTempExpandLazyLoadedMaps[rowid];
|
|
20067
20149
|
}
|
|
20068
|
-
|
|
20069
|
-
resolve(
|
|
20150
|
+
_this44.rowExpandLazyLoadedMaps = rowTempExpandLazyLoadedMaps;
|
|
20151
|
+
resolve(_this44.$nextTick().then(_this44.recalculate));
|
|
20070
20152
|
});
|
|
20071
20153
|
} else {
|
|
20072
20154
|
resolve();
|
|
@@ -20081,7 +20163,7 @@ var Methods = {
|
|
|
20081
20163
|
* @param {Boolean} expanded 是否展开
|
|
20082
20164
|
*/
|
|
20083
20165
|
setRowExpand: function setRowExpand(rows, expanded) {
|
|
20084
|
-
var
|
|
20166
|
+
var _this45 = this;
|
|
20085
20167
|
var rowExpandedMaps = this.rowExpandedMaps,
|
|
20086
20168
|
fullAllDataRowIdData = this.fullAllDataRowIdData,
|
|
20087
20169
|
rowExpandLazyLoadedMaps = this.rowExpandLazyLoadedMaps,
|
|
@@ -20111,18 +20193,18 @@ var Methods = {
|
|
|
20111
20193
|
columnIndex: columnIndex,
|
|
20112
20194
|
$columnIndex: $columnIndex,
|
|
20113
20195
|
row: row,
|
|
20114
|
-
rowIndex:
|
|
20115
|
-
$rowIndex:
|
|
20196
|
+
rowIndex: _this45.getRowIndex(row),
|
|
20197
|
+
$rowIndex: _this45.getVMRowIndex(row)
|
|
20116
20198
|
});
|
|
20117
20199
|
}) : rows;
|
|
20118
20200
|
if (expanded) {
|
|
20119
20201
|
validRows.forEach(function (row) {
|
|
20120
|
-
var rowid = getRowid(
|
|
20202
|
+
var rowid = getRowid(_this45, row);
|
|
20121
20203
|
if (!rExpandedMaps[rowid]) {
|
|
20122
20204
|
var rest = fullAllDataRowIdData[rowid];
|
|
20123
20205
|
var isLoad = lazy && !rest.expandLoaded && !rowExpandLazyLoadedMaps[rowid];
|
|
20124
20206
|
if (isLoad) {
|
|
20125
|
-
lazyRests.push(
|
|
20207
|
+
lazyRests.push(_this45.handleAsyncRowExpand(row));
|
|
20126
20208
|
} else {
|
|
20127
20209
|
rExpandedMaps[rowid] = row;
|
|
20128
20210
|
}
|
|
@@ -20130,7 +20212,7 @@ var Methods = {
|
|
|
20130
20212
|
});
|
|
20131
20213
|
} else {
|
|
20132
20214
|
validRows.forEach(function (item) {
|
|
20133
|
-
var rowid = getRowid(
|
|
20215
|
+
var rowid = getRowid(_this45, item);
|
|
20134
20216
|
if (rExpandedMaps[rowid]) {
|
|
20135
20217
|
delete rExpandedMaps[rowid];
|
|
20136
20218
|
}
|
|
@@ -20138,7 +20220,7 @@ var Methods = {
|
|
|
20138
20220
|
}
|
|
20139
20221
|
if (reserve) {
|
|
20140
20222
|
validRows.forEach(function (row) {
|
|
20141
|
-
return
|
|
20223
|
+
return _this45.handleRowExpandReserve(row, expanded);
|
|
20142
20224
|
});
|
|
20143
20225
|
}
|
|
20144
20226
|
}
|
|
@@ -20149,16 +20231,23 @@ var Methods = {
|
|
|
20149
20231
|
* 判断行是否为展开状态
|
|
20150
20232
|
* @param {Row} row 行对象
|
|
20151
20233
|
*/
|
|
20152
|
-
|
|
20234
|
+
isRowExpandByRow: function isRowExpandByRow(row) {
|
|
20153
20235
|
var rowExpandedMaps = this.rowExpandedMaps;
|
|
20154
20236
|
var rowid = getRowid(this, row);
|
|
20155
20237
|
return !!rowExpandedMaps[rowid];
|
|
20156
20238
|
},
|
|
20239
|
+
isExpandByRow: function isExpandByRow(row) {
|
|
20240
|
+
// if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
20241
|
+
// warnLog('vxe.error.delFunc', ['isExpandByRow', 'isRowExpandByRow'])
|
|
20242
|
+
// }
|
|
20243
|
+
// 即将废弃
|
|
20244
|
+
return this.isRowExpandByRow(row);
|
|
20245
|
+
},
|
|
20157
20246
|
/**
|
|
20158
20247
|
* 手动清空展开行状态,数据会恢复成未展开的状态
|
|
20159
20248
|
*/
|
|
20160
20249
|
clearRowExpand: function clearRowExpand() {
|
|
20161
|
-
var
|
|
20250
|
+
var _this46 = this;
|
|
20162
20251
|
var expandOpts = this.expandOpts,
|
|
20163
20252
|
tableFullData = this.tableFullData;
|
|
20164
20253
|
var reserve = expandOpts.reserve;
|
|
@@ -20166,12 +20255,12 @@ var Methods = {
|
|
|
20166
20255
|
this.rowExpandedMaps = {};
|
|
20167
20256
|
if (reserve) {
|
|
20168
20257
|
tableFullData.forEach(function (row) {
|
|
20169
|
-
return
|
|
20258
|
+
return _this46.handleRowExpandReserve(row, false);
|
|
20170
20259
|
});
|
|
20171
20260
|
}
|
|
20172
20261
|
return this.$nextTick().then(function () {
|
|
20173
20262
|
if (expList.length) {
|
|
20174
|
-
|
|
20263
|
+
_this46.recalculate();
|
|
20175
20264
|
}
|
|
20176
20265
|
});
|
|
20177
20266
|
},
|
|
@@ -20254,7 +20343,7 @@ var Methods = {
|
|
|
20254
20343
|
* @param {Row} row 行对象
|
|
20255
20344
|
*/
|
|
20256
20345
|
reloadTreeExpand: function reloadTreeExpand(row) {
|
|
20257
|
-
var
|
|
20346
|
+
var _this47 = this;
|
|
20258
20347
|
var treeOpts = this.treeOpts,
|
|
20259
20348
|
treeExpandLazyLoadedMaps = this.treeExpandLazyLoadedMaps;
|
|
20260
20349
|
var transform = treeOpts.transform,
|
|
@@ -20263,14 +20352,14 @@ var Methods = {
|
|
|
20263
20352
|
var rowid = getRowid(this, row);
|
|
20264
20353
|
if (lazy && row[hasChildField] && !treeExpandLazyLoadedMaps[rowid]) {
|
|
20265
20354
|
this.clearTreeExpandLoaded(row).then(function () {
|
|
20266
|
-
return
|
|
20355
|
+
return _this47.handleAsyncTreeExpandChilds(row);
|
|
20267
20356
|
}).then(function () {
|
|
20268
20357
|
if (transform) {
|
|
20269
|
-
|
|
20270
|
-
return
|
|
20358
|
+
_this47.handleVirtualTreeToList();
|
|
20359
|
+
return _this47.handleTableData();
|
|
20271
20360
|
}
|
|
20272
20361
|
}).then(function () {
|
|
20273
|
-
return
|
|
20362
|
+
return _this47.recalculate();
|
|
20274
20363
|
});
|
|
20275
20364
|
}
|
|
20276
20365
|
return this.$nextTick();
|
|
@@ -20341,7 +20430,7 @@ var Methods = {
|
|
|
20341
20430
|
}
|
|
20342
20431
|
},
|
|
20343
20432
|
handleAsyncTreeExpandChilds: function handleAsyncTreeExpandChilds(row) {
|
|
20344
|
-
var
|
|
20433
|
+
var _this48 = this;
|
|
20345
20434
|
var treeOpts = this.treeOpts,
|
|
20346
20435
|
checkboxOpts = this.checkboxOpts;
|
|
20347
20436
|
var transform = treeOpts.transform,
|
|
@@ -20349,13 +20438,13 @@ var Methods = {
|
|
|
20349
20438
|
var checkStrictly = checkboxOpts.checkStrictly;
|
|
20350
20439
|
return new Promise(function (resolve) {
|
|
20351
20440
|
if (loadMethod) {
|
|
20352
|
-
var fullAllDataRowMap =
|
|
20353
|
-
treeExpandLazyLoadedMaps =
|
|
20354
|
-
var rowid = getRowid(
|
|
20441
|
+
var fullAllDataRowMap = _this48.fullAllDataRowMap,
|
|
20442
|
+
treeExpandLazyLoadedMaps = _this48.treeExpandLazyLoadedMaps;
|
|
20443
|
+
var rowid = getRowid(_this48, row);
|
|
20355
20444
|
var rest = fullAllDataRowMap.get(row);
|
|
20356
20445
|
treeExpandLazyLoadedMaps[rowid] = row;
|
|
20357
20446
|
loadMethod({
|
|
20358
|
-
$table:
|
|
20447
|
+
$table: _this48,
|
|
20359
20448
|
row: row
|
|
20360
20449
|
}).then(function (childRecords) {
|
|
20361
20450
|
// 响应成功后则展开行,并将子节点挂载到该节点下
|
|
@@ -20367,20 +20456,20 @@ var Methods = {
|
|
|
20367
20456
|
childRecords = [];
|
|
20368
20457
|
}
|
|
20369
20458
|
if (childRecords) {
|
|
20370
|
-
return
|
|
20371
|
-
var treeExpandedMaps =
|
|
20459
|
+
return _this48.loadTreeChildren(row, childRecords).then(function (childRows) {
|
|
20460
|
+
var treeExpandedMaps = _this48.treeExpandedMaps;
|
|
20372
20461
|
var treeTempExpandedMaps = _objectSpread2({}, treeExpandedMaps);
|
|
20373
20462
|
if (childRows.length && !treeTempExpandedMaps[rowid]) {
|
|
20374
20463
|
treeTempExpandedMaps[rowid] = row;
|
|
20375
|
-
|
|
20464
|
+
_this48.treeExpandedMaps = treeTempExpandedMaps;
|
|
20376
20465
|
}
|
|
20377
20466
|
// 如果当前节点已选中,则展开后子节点也被选中
|
|
20378
|
-
if (!checkStrictly &&
|
|
20379
|
-
|
|
20467
|
+
if (!checkStrictly && _this48.isCheckedByCheckboxRow(row)) {
|
|
20468
|
+
_this48.handleCheckedCheckboxRow(childRows, true, true);
|
|
20380
20469
|
}
|
|
20381
|
-
return
|
|
20470
|
+
return _this48.$nextTick().then(function () {
|
|
20382
20471
|
if (transform) {
|
|
20383
|
-
return
|
|
20472
|
+
return _this48.handleTableData();
|
|
20384
20473
|
}
|
|
20385
20474
|
});
|
|
20386
20475
|
});
|
|
@@ -20388,13 +20477,13 @@ var Methods = {
|
|
|
20388
20477
|
}).catch(function () {
|
|
20389
20478
|
// 如果响应异常,则不展开,再次点击后将重新触发懒加载
|
|
20390
20479
|
rest.treeLoaded = false;
|
|
20391
|
-
var treeExpandLazyLoadedMaps =
|
|
20480
|
+
var treeExpandLazyLoadedMaps = _this48.treeExpandLazyLoadedMaps;
|
|
20392
20481
|
if (treeExpandLazyLoadedMaps[rowid]) {
|
|
20393
20482
|
treeExpandLazyLoadedMaps[rowid] = null;
|
|
20394
20483
|
}
|
|
20395
20484
|
}).finally(function () {
|
|
20396
|
-
|
|
20397
|
-
return
|
|
20485
|
+
_this48.$nextTick().then(function () {
|
|
20486
|
+
return _this48.recalculate();
|
|
20398
20487
|
}).then(function () {
|
|
20399
20488
|
return resolve();
|
|
20400
20489
|
});
|
|
@@ -20431,7 +20520,7 @@ var Methods = {
|
|
|
20431
20520
|
* @returns
|
|
20432
20521
|
*/
|
|
20433
20522
|
handleBaseTreeExpand: function handleBaseTreeExpand(rows, expanded) {
|
|
20434
|
-
var
|
|
20523
|
+
var _this49 = this;
|
|
20435
20524
|
var fullAllDataRowMap = this.fullAllDataRowMap,
|
|
20436
20525
|
tableFullData = this.tableFullData,
|
|
20437
20526
|
treeExpandedMaps = this.treeExpandedMaps,
|
|
@@ -20467,7 +20556,7 @@ var Methods = {
|
|
|
20467
20556
|
});
|
|
20468
20557
|
if (matchObj) {
|
|
20469
20558
|
matchObj.items.forEach(function (item) {
|
|
20470
|
-
var rowid = getRowid(
|
|
20559
|
+
var rowid = getRowid(_this49, item);
|
|
20471
20560
|
if (treeTempExpandedMaps[rowid]) {
|
|
20472
20561
|
delete treeTempExpandedMaps[rowid];
|
|
20473
20562
|
}
|
|
@@ -20476,13 +20565,13 @@ var Methods = {
|
|
|
20476
20565
|
}
|
|
20477
20566
|
if (expanded) {
|
|
20478
20567
|
validRows.forEach(function (row) {
|
|
20479
|
-
var rowid = getRowid(
|
|
20568
|
+
var rowid = getRowid(_this49, row);
|
|
20480
20569
|
if (!treeTempExpandedMaps[rowid]) {
|
|
20481
20570
|
var rest = fullAllDataRowMap.get(row);
|
|
20482
20571
|
var isLoad = lazy && row[hasChildField] && !rest.treeLoaded && !treeExpandLazyLoadedMaps[rowid];
|
|
20483
20572
|
// 是否使用懒加载
|
|
20484
20573
|
if (isLoad) {
|
|
20485
|
-
result.push(
|
|
20574
|
+
result.push(_this49.handleAsyncTreeExpandChilds(row));
|
|
20486
20575
|
} else {
|
|
20487
20576
|
if (row[childrenField] && row[childrenField].length) {
|
|
20488
20577
|
treeTempExpandedMaps[rowid] = row;
|
|
@@ -20492,7 +20581,7 @@ var Methods = {
|
|
|
20492
20581
|
});
|
|
20493
20582
|
} else {
|
|
20494
20583
|
validRows.forEach(function (item) {
|
|
20495
|
-
var rowid = getRowid(
|
|
20584
|
+
var rowid = getRowid(_this49, item);
|
|
20496
20585
|
if (treeTempExpandedMaps[rowid]) {
|
|
20497
20586
|
delete treeTempExpandedMaps[rowid];
|
|
20498
20587
|
}
|
|
@@ -20500,7 +20589,7 @@ var Methods = {
|
|
|
20500
20589
|
}
|
|
20501
20590
|
if (reserve) {
|
|
20502
20591
|
validRows.forEach(function (row) {
|
|
20503
|
-
return
|
|
20592
|
+
return _this49.handleTreeExpandReserve(row, expanded);
|
|
20504
20593
|
});
|
|
20505
20594
|
}
|
|
20506
20595
|
this.treeExpandedMaps = treeTempExpandedMaps;
|
|
@@ -20513,12 +20602,12 @@ var Methods = {
|
|
|
20513
20602
|
* @returns
|
|
20514
20603
|
*/
|
|
20515
20604
|
handleVirtualTreeExpand: function handleVirtualTreeExpand(rows, expanded) {
|
|
20516
|
-
var
|
|
20605
|
+
var _this50 = this;
|
|
20517
20606
|
return this.handleBaseTreeExpand(rows, expanded).then(function () {
|
|
20518
|
-
|
|
20519
|
-
return
|
|
20607
|
+
_this50.handleVirtualTreeToList();
|
|
20608
|
+
return _this50.handleTableData();
|
|
20520
20609
|
}).then(function () {
|
|
20521
|
-
return
|
|
20610
|
+
return _this50.recalculate();
|
|
20522
20611
|
});
|
|
20523
20612
|
},
|
|
20524
20613
|
/**
|
|
@@ -20558,7 +20647,7 @@ var Methods = {
|
|
|
20558
20647
|
* 手动清空树形节点的展开状态,数据会恢复成未展开的状态
|
|
20559
20648
|
*/
|
|
20560
20649
|
clearTreeExpand: function clearTreeExpand() {
|
|
20561
|
-
var
|
|
20650
|
+
var _this51 = this;
|
|
20562
20651
|
var treeOpts = this.treeOpts,
|
|
20563
20652
|
tableFullData = this.tableFullData;
|
|
20564
20653
|
var transform = treeOpts.transform,
|
|
@@ -20568,19 +20657,19 @@ var Methods = {
|
|
|
20568
20657
|
this.treeExpandedMaps = {};
|
|
20569
20658
|
if (reserve) {
|
|
20570
20659
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(tableFullData, function (row) {
|
|
20571
|
-
return
|
|
20660
|
+
return _this51.handleTreeExpandReserve(row, false);
|
|
20572
20661
|
}, {
|
|
20573
20662
|
children: childrenField
|
|
20574
20663
|
});
|
|
20575
20664
|
}
|
|
20576
20665
|
return this.handleTableData().then(function () {
|
|
20577
20666
|
if (transform) {
|
|
20578
|
-
|
|
20579
|
-
return
|
|
20667
|
+
_this51.handleVirtualTreeToList();
|
|
20668
|
+
return _this51.handleTableData();
|
|
20580
20669
|
}
|
|
20581
20670
|
}).then(function () {
|
|
20582
20671
|
if (expList.length) {
|
|
20583
|
-
|
|
20672
|
+
_this51.recalculate();
|
|
20584
20673
|
}
|
|
20585
20674
|
});
|
|
20586
20675
|
},
|
|
@@ -20699,28 +20788,28 @@ var Methods = {
|
|
|
20699
20788
|
},
|
|
20700
20789
|
// 计算可视渲染相关数据
|
|
20701
20790
|
computeScrollLoad: function computeScrollLoad() {
|
|
20702
|
-
var
|
|
20791
|
+
var _this52 = this;
|
|
20703
20792
|
return this.$nextTick().then(function () {
|
|
20704
|
-
var sYOpts =
|
|
20705
|
-
sXOpts =
|
|
20706
|
-
scrollXLoad =
|
|
20707
|
-
scrollYLoad =
|
|
20708
|
-
scrollXStore =
|
|
20709
|
-
scrollYStore =
|
|
20793
|
+
var sYOpts = _this52.sYOpts,
|
|
20794
|
+
sXOpts = _this52.sXOpts,
|
|
20795
|
+
scrollXLoad = _this52.scrollXLoad,
|
|
20796
|
+
scrollYLoad = _this52.scrollYLoad,
|
|
20797
|
+
scrollXStore = _this52.scrollXStore,
|
|
20798
|
+
scrollYStore = _this52.scrollYStore;
|
|
20710
20799
|
// 计算 X 逻辑
|
|
20711
20800
|
if (scrollXLoad) {
|
|
20712
|
-
var _computeVirtualX3 = computeVirtualX(
|
|
20801
|
+
var _computeVirtualX3 = computeVirtualX(_this52),
|
|
20713
20802
|
visibleXSize = _computeVirtualX3.visibleSize;
|
|
20714
20803
|
var offsetXSize = sXOpts.oSize ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(sXOpts.oSize) : browse.msie ? 10 : browse.edge ? 5 : 0;
|
|
20715
20804
|
scrollXStore.offsetSize = offsetXSize;
|
|
20716
20805
|
scrollXStore.visibleSize = visibleXSize;
|
|
20717
20806
|
scrollXStore.endIndex = Math.max(scrollXStore.startIndex + scrollXStore.visibleSize + offsetXSize, scrollXStore.endIndex);
|
|
20718
|
-
|
|
20807
|
+
_this52.updateScrollXData();
|
|
20719
20808
|
} else {
|
|
20720
|
-
|
|
20809
|
+
_this52.updateScrollXSpace();
|
|
20721
20810
|
}
|
|
20722
20811
|
// 计算 Y 逻辑
|
|
20723
|
-
var _computeVirtualY = computeVirtualY(
|
|
20812
|
+
var _computeVirtualY = computeVirtualY(_this52),
|
|
20724
20813
|
rowHeight = _computeVirtualY.rowHeight,
|
|
20725
20814
|
visibleYSize = _computeVirtualY.visibleSize;
|
|
20726
20815
|
scrollYStore.rowHeight = rowHeight;
|
|
@@ -20729,12 +20818,12 @@ var Methods = {
|
|
|
20729
20818
|
scrollYStore.offsetSize = offsetYSize;
|
|
20730
20819
|
scrollYStore.visibleSize = visibleYSize;
|
|
20731
20820
|
scrollYStore.endIndex = Math.max(scrollYStore.startIndex + visibleYSize + offsetYSize, scrollYStore.endIndex);
|
|
20732
|
-
|
|
20821
|
+
_this52.updateScrollYData();
|
|
20733
20822
|
} else {
|
|
20734
|
-
|
|
20823
|
+
_this52.updateScrollYSpace();
|
|
20735
20824
|
}
|
|
20736
|
-
|
|
20737
|
-
|
|
20825
|
+
_this52.rowHeight = rowHeight;
|
|
20826
|
+
_this52.$nextTick(_this52.updateStyle);
|
|
20738
20827
|
});
|
|
20739
20828
|
},
|
|
20740
20829
|
handleTableColumn: function handleTableColumn() {
|
|
@@ -20744,11 +20833,11 @@ var Methods = {
|
|
|
20744
20833
|
this.tableColumn = scrollXLoad ? visibleColumn.slice(scrollXStore.startIndex, scrollXStore.endIndex) : visibleColumn.slice(0);
|
|
20745
20834
|
},
|
|
20746
20835
|
updateScrollXData: function updateScrollXData() {
|
|
20747
|
-
var
|
|
20836
|
+
var _this53 = this;
|
|
20748
20837
|
// this.tableColumn = []
|
|
20749
20838
|
this.$nextTick(function () {
|
|
20750
|
-
|
|
20751
|
-
|
|
20839
|
+
_this53.handleTableColumn();
|
|
20840
|
+
_this53.updateScrollXSpace();
|
|
20752
20841
|
});
|
|
20753
20842
|
},
|
|
20754
20843
|
// 更新横向 X 可视渲染上下剩余空间大小
|
|
@@ -20799,11 +20888,11 @@ var Methods = {
|
|
|
20799
20888
|
}
|
|
20800
20889
|
},
|
|
20801
20890
|
updateScrollYData: function updateScrollYData() {
|
|
20802
|
-
var
|
|
20891
|
+
var _this54 = this;
|
|
20803
20892
|
// this.tableData = []
|
|
20804
20893
|
this.$nextTick(function () {
|
|
20805
|
-
|
|
20806
|
-
|
|
20894
|
+
_this54.handleTableData();
|
|
20895
|
+
_this54.updateScrollYSpace();
|
|
20807
20896
|
});
|
|
20808
20897
|
},
|
|
20809
20898
|
// 更新纵向 Y 可视渲染上下剩余空间大小
|
|
@@ -20844,7 +20933,7 @@ var Methods = {
|
|
|
20844
20933
|
* @param {Number} scrollTop 上距离
|
|
20845
20934
|
*/
|
|
20846
20935
|
scrollTo: function scrollTo(scrollLeft, scrollTop) {
|
|
20847
|
-
var
|
|
20936
|
+
var _this55 = this;
|
|
20848
20937
|
var $refs = this.$refs;
|
|
20849
20938
|
var tableBody = $refs.tableBody,
|
|
20850
20939
|
rightBody = $refs.rightBody,
|
|
@@ -20861,7 +20950,7 @@ var Methods = {
|
|
|
20861
20950
|
if (this.scrollXLoad || this.scrollYLoad) {
|
|
20862
20951
|
return new Promise(function (resolve) {
|
|
20863
20952
|
return setTimeout(function () {
|
|
20864
|
-
return resolve(
|
|
20953
|
+
return resolve(_this55.$nextTick());
|
|
20865
20954
|
}, 50);
|
|
20866
20955
|
});
|
|
20867
20956
|
}
|
|
@@ -20903,7 +20992,7 @@ var Methods = {
|
|
|
20903
20992
|
* @param {Row} row 行对象
|
|
20904
20993
|
*/
|
|
20905
20994
|
scrollToTreeRow: function scrollToTreeRow(row) {
|
|
20906
|
-
var
|
|
20995
|
+
var _this56 = this;
|
|
20907
20996
|
var tableFullData = this.tableFullData,
|
|
20908
20997
|
treeConfig = this.treeConfig,
|
|
20909
20998
|
treeOpts = this.treeOpts;
|
|
@@ -20918,14 +21007,14 @@ var Methods = {
|
|
|
20918
21007
|
if (matchObj) {
|
|
20919
21008
|
var nodes = matchObj.nodes;
|
|
20920
21009
|
nodes.forEach(function (row, index) {
|
|
20921
|
-
if (index < nodes.length - 1 && !
|
|
20922
|
-
rests.push(
|
|
21010
|
+
if (index < nodes.length - 1 && !_this56.isTreeExpandByRow(row)) {
|
|
21011
|
+
rests.push(_this56.setTreeExpand(row, true));
|
|
20923
21012
|
}
|
|
20924
21013
|
});
|
|
20925
21014
|
}
|
|
20926
21015
|
}
|
|
20927
21016
|
return Promise.all(rests).then(function () {
|
|
20928
|
-
return rowToVisible(
|
|
21017
|
+
return rowToVisible(_this56, row);
|
|
20929
21018
|
});
|
|
20930
21019
|
},
|
|
20931
21020
|
/**
|
|
@@ -20975,41 +21064,44 @@ var Methods = {
|
|
|
20975
21064
|
return this.$nextTick();
|
|
20976
21065
|
},
|
|
20977
21066
|
/**
|
|
20978
|
-
* 更新列状态
|
|
21067
|
+
* 更新列状态 updateStatus({ row, column }, cellValue)
|
|
20979
21068
|
* 如果组件值 v-model 发生 change 时,调用改函数用于更新某一列编辑状态
|
|
20980
21069
|
* 如果单元格配置了校验规则,则会进行校验
|
|
20981
21070
|
*/
|
|
20982
21071
|
updateStatus: function updateStatus(slotParams, cellValue) {
|
|
20983
|
-
var
|
|
21072
|
+
var _this57 = this;
|
|
20984
21073
|
var customVal = !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isUndefined(cellValue);
|
|
20985
21074
|
return this.$nextTick().then(function () {
|
|
20986
|
-
var $refs =
|
|
20987
|
-
editRules =
|
|
20988
|
-
validStore =
|
|
20989
|
-
|
|
21075
|
+
var $refs = _this57.$refs,
|
|
21076
|
+
editRules = _this57.editRules,
|
|
21077
|
+
validStore = _this57.validStore;
|
|
21078
|
+
var tableBody = $refs.tableBody;
|
|
21079
|
+
if (slotParams && tableBody && editRules) {
|
|
20990
21080
|
var row = slotParams.row,
|
|
20991
21081
|
column = slotParams.column;
|
|
20992
21082
|
var type = 'change';
|
|
20993
|
-
if (
|
|
20994
|
-
|
|
20995
|
-
|
|
20996
|
-
|
|
20997
|
-
|
|
20998
|
-
|
|
20999
|
-
|
|
21000
|
-
|
|
21001
|
-
|
|
21002
|
-
|
|
21003
|
-
|
|
21004
|
-
|
|
21005
|
-
|
|
21006
|
-
|
|
21007
|
-
|
|
21008
|
-
|
|
21009
|
-
|
|
21010
|
-
|
|
21083
|
+
if (_this57.hasCellRules) {
|
|
21084
|
+
if (_this57.hasCellRules(type, row, column)) {
|
|
21085
|
+
var cell = _this57.getCell(row, column);
|
|
21086
|
+
if (cell) {
|
|
21087
|
+
return _this57.validCellRules(type, row, column, cellValue).then(function () {
|
|
21088
|
+
if (customVal && validStore.visible) {
|
|
21089
|
+
setCellValue(row, column, cellValue);
|
|
21090
|
+
}
|
|
21091
|
+
_this57.clearValidate(row, column);
|
|
21092
|
+
}).catch(function (_ref8) {
|
|
21093
|
+
var rule = _ref8.rule;
|
|
21094
|
+
if (customVal) {
|
|
21095
|
+
setCellValue(row, column, cellValue);
|
|
21096
|
+
}
|
|
21097
|
+
_this57.showValidTooltip({
|
|
21098
|
+
rule: rule,
|
|
21099
|
+
row: row,
|
|
21100
|
+
column: column,
|
|
21101
|
+
cell: cell
|
|
21102
|
+
});
|
|
21011
21103
|
});
|
|
21012
|
-
}
|
|
21104
|
+
}
|
|
21013
21105
|
}
|
|
21014
21106
|
}
|
|
21015
21107
|
}
|
|
@@ -21023,13 +21115,13 @@ var Methods = {
|
|
|
21023
21115
|
* @param {TableMergeConfig[]} merges { row: Row|number, column: ColumnInfo|number, rowspan: number, colspan: number }
|
|
21024
21116
|
*/
|
|
21025
21117
|
setMergeCells: function setMergeCells(merges) {
|
|
21026
|
-
var
|
|
21118
|
+
var _this58 = this;
|
|
21027
21119
|
if (this.spanMethod) {
|
|
21028
21120
|
errLog('vxe.error.errConflicts', ['merge-cells', 'span-method']);
|
|
21029
21121
|
}
|
|
21030
21122
|
setMerges(this, merges, this.mergeList, this.afterFullData);
|
|
21031
21123
|
return this.$nextTick().then(function () {
|
|
21032
|
-
return
|
|
21124
|
+
return _this58.updateCellAreas();
|
|
21033
21125
|
});
|
|
21034
21126
|
},
|
|
21035
21127
|
/**
|
|
@@ -21037,13 +21129,13 @@ var Methods = {
|
|
|
21037
21129
|
* @param {TableMergeConfig[]} merges 多个或数组 [{row:Row|number, col:ColumnInfo|number}]
|
|
21038
21130
|
*/
|
|
21039
21131
|
removeMergeCells: function removeMergeCells(merges) {
|
|
21040
|
-
var
|
|
21132
|
+
var _this59 = this;
|
|
21041
21133
|
if (this.spanMethod) {
|
|
21042
21134
|
errLog('vxe.error.errConflicts', ['merge-cells', 'span-method']);
|
|
21043
21135
|
}
|
|
21044
21136
|
var rest = removeMerges(this, merges, this.mergeList, this.afterFullData);
|
|
21045
21137
|
return this.$nextTick().then(function () {
|
|
21046
|
-
|
|
21138
|
+
_this59.updateCellAreas();
|
|
21047
21139
|
return rest;
|
|
21048
21140
|
});
|
|
21049
21141
|
},
|
|
@@ -21064,23 +21156,23 @@ var Methods = {
|
|
|
21064
21156
|
this.setMergeFooterItems(this.mergeFooterItems);
|
|
21065
21157
|
},
|
|
21066
21158
|
setMergeFooterItems: function setMergeFooterItems(merges) {
|
|
21067
|
-
var
|
|
21159
|
+
var _this60 = this;
|
|
21068
21160
|
if (this.footerSpanMethod) {
|
|
21069
21161
|
errLog('vxe.error.errConflicts', ['merge-footer-items', 'footer-span-method']);
|
|
21070
21162
|
}
|
|
21071
21163
|
setMerges(this, merges, this.mergeFooterList, null);
|
|
21072
21164
|
return this.$nextTick().then(function () {
|
|
21073
|
-
return
|
|
21165
|
+
return _this60.updateCellAreas();
|
|
21074
21166
|
});
|
|
21075
21167
|
},
|
|
21076
21168
|
removeMergeFooterItems: function removeMergeFooterItems(merges) {
|
|
21077
|
-
var
|
|
21169
|
+
var _this61 = this;
|
|
21078
21170
|
if (this.footerSpanMethod) {
|
|
21079
21171
|
errLog('vxe.error.errConflicts', ['merge-footer-items', 'footer-span-method']);
|
|
21080
21172
|
}
|
|
21081
21173
|
var rest = removeMerges(this, merges, this.mergeFooterList, null);
|
|
21082
21174
|
return this.$nextTick().then(function () {
|
|
21083
|
-
|
|
21175
|
+
_this61.updateCellAreas();
|
|
21084
21176
|
return rest;
|
|
21085
21177
|
});
|
|
21086
21178
|
},
|
|
@@ -21197,9 +21289,9 @@ var Methods = {
|
|
|
21197
21289
|
return cellLabel;
|
|
21198
21290
|
},
|
|
21199
21291
|
findRowIndexOf: function findRowIndexOf(list, row) {
|
|
21200
|
-
var
|
|
21292
|
+
var _this62 = this;
|
|
21201
21293
|
return row ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findIndexOf(list, function (item) {
|
|
21202
|
-
return
|
|
21294
|
+
return _this62.eqRow(item, row);
|
|
21203
21295
|
}) : -1;
|
|
21204
21296
|
},
|
|
21205
21297
|
eqRow: function eqRow(row1, row2) {
|
|
@@ -21764,6 +21856,10 @@ function handleUupdateResize(_vm) {
|
|
|
21764
21856
|
upDataFlag: 0,
|
|
21765
21857
|
// 刷新列标识,当列的特定属性被改变时,触发表格刷新列
|
|
21766
21858
|
reColumnFlag: 0,
|
|
21859
|
+
// 已标记的对象集
|
|
21860
|
+
pendingRowMaps: {},
|
|
21861
|
+
// 已标记的行
|
|
21862
|
+
pendingRowList: [],
|
|
21767
21863
|
// 当前选中的筛选列
|
|
21768
21864
|
filterStore: {
|
|
21769
21865
|
isAllSelected: false,
|
|
@@ -21834,13 +21930,9 @@ function handleUupdateResize(_vm) {
|
|
|
21834
21930
|
},
|
|
21835
21931
|
// 存放数据校验相关信息
|
|
21836
21932
|
validStore: {
|
|
21837
|
-
visible: false
|
|
21838
|
-
row: null,
|
|
21839
|
-
column: null,
|
|
21840
|
-
content: '',
|
|
21841
|
-
rule: null,
|
|
21842
|
-
isArrow: false
|
|
21933
|
+
visible: false
|
|
21843
21934
|
},
|
|
21935
|
+
validErrorMaps: {},
|
|
21844
21936
|
// 导入相关信息
|
|
21845
21937
|
importStore: {
|
|
21846
21938
|
inited: false,
|
|
@@ -22375,7 +22467,7 @@ function handleUupdateResize(_vm) {
|
|
|
22375
22467
|
var leftList = columnStore.leftList,
|
|
22376
22468
|
rightList = columnStore.rightList;
|
|
22377
22469
|
return h('div', {
|
|
22378
|
-
class: ['vxe-table', 'vxe-table--render-default', "tid_".concat(tId), vSize ? "size--".concat(vSize) : '', "border--".concat(tableBorder), (_ref = {}, _defineProperty(_ref, "vaild-msg--".concat(validOpts.msgMode), !!editRules), _defineProperty(_ref, 'vxe-editable', !!editConfig), _defineProperty(_ref, 'cell--highlight', highlightCell), _defineProperty(_ref, 'cell--selected', mouseConfig && mouseOpts.selected), _defineProperty(_ref, 'cell--area', mouseConfig && mouseOpts.area), _defineProperty(_ref, 'row--highlight', rowOpts.isHover || highlightHoverRow), _defineProperty(_ref, 'column--highlight', columnOpts.isHover || highlightHoverColumn), _defineProperty(_ref, 'is--header', showHeader), _defineProperty(_ref, 'is--footer', showFooter), _defineProperty(_ref, 'is--group', isGroup), _defineProperty(_ref, 'is--tree-line', treeConfig && (treeOpts.showLine || treeOpts.line)), _defineProperty(_ref, 'is--fixed-left', leftList.length), _defineProperty(_ref, 'is--fixed-right', rightList.length), _defineProperty(_ref, 'is--animat', !!this.animat), _defineProperty(_ref, 'is--round', this.round), _defineProperty(_ref, 'is--stripe', !treeConfig && stripe), _defineProperty(_ref, 'is--loading', loading), _defineProperty(_ref, 'is--empty', !loading && !tableData.length), _defineProperty(_ref, 'is--scroll-y', overflowY), _defineProperty(_ref, 'is--scroll-x', overflowX), _defineProperty(_ref, 'is--virtual-x', scrollXLoad), _defineProperty(_ref, 'is--virtual-y', scrollYLoad), _ref)],
|
|
22470
|
+
class: ['vxe-table', 'vxe-table--render-default', "tid_".concat(tId), vSize ? "size--".concat(vSize) : '', "border--".concat(tableBorder), (_ref = {}, _defineProperty(_ref, "vaild-msg--".concat(validOpts.msgMode), !!editRules), _defineProperty(_ref, 'vxe-editable', !!editConfig), _defineProperty(_ref, 'old-cell-valid', editRules && conf.cellVaildMode === 'obsolete'), _defineProperty(_ref, 'cell--highlight', highlightCell), _defineProperty(_ref, 'cell--selected', mouseConfig && mouseOpts.selected), _defineProperty(_ref, 'cell--area', mouseConfig && mouseOpts.area), _defineProperty(_ref, 'row--highlight', rowOpts.isHover || highlightHoverRow), _defineProperty(_ref, 'column--highlight', columnOpts.isHover || highlightHoverColumn), _defineProperty(_ref, 'is--header', showHeader), _defineProperty(_ref, 'is--footer', showFooter), _defineProperty(_ref, 'is--group', isGroup), _defineProperty(_ref, 'is--tree-line', treeConfig && (treeOpts.showLine || treeOpts.line)), _defineProperty(_ref, 'is--fixed-left', leftList.length), _defineProperty(_ref, 'is--fixed-right', rightList.length), _defineProperty(_ref, 'is--animat', !!this.animat), _defineProperty(_ref, 'is--round', this.round), _defineProperty(_ref, 'is--stripe', !treeConfig && stripe), _defineProperty(_ref, 'is--loading', loading), _defineProperty(_ref, 'is--empty', !loading && !tableData.length), _defineProperty(_ref, 'is--scroll-y', overflowY), _defineProperty(_ref, 'is--scroll-x', overflowX), _defineProperty(_ref, 'is--virtual-x', scrollXLoad), _defineProperty(_ref, 'is--virtual-y', scrollYLoad), _ref)],
|
|
22379
22471
|
on: {
|
|
22380
22472
|
keydown: this.keydownEvent
|
|
22381
22473
|
}
|
|
@@ -22530,7 +22622,9 @@ function handleUupdateResize(_vm) {
|
|
|
22530
22622
|
*/
|
|
22531
22623
|
hasTip && this.editRules && validOpts.showMessage && (validOpts.message === 'default' ? !height : validOpts.message === 'tooltip') ? h('vxe-tooltip', {
|
|
22532
22624
|
ref: 'validTip',
|
|
22533
|
-
class:
|
|
22625
|
+
class: [{
|
|
22626
|
+
'old-cell-valid': editRules && conf.cellVaildMode === 'obsolete'
|
|
22627
|
+
}, 'vxe-table--valid-error'],
|
|
22534
22628
|
props: validOpts.message === 'tooltip' || tableData.length === 1 ? validTipOpts : null
|
|
22535
22629
|
}) : _e()]);
|
|
22536
22630
|
},
|
|
@@ -23574,6 +23668,7 @@ var es_array_unshift = __webpack_require__(541);
|
|
|
23574
23668
|
|
|
23575
23669
|
|
|
23576
23670
|
|
|
23671
|
+
|
|
23577
23672
|
|
|
23578
23673
|
|
|
23579
23674
|
function insertTreeRow(_vm, newRecords, isAppend) {
|
|
@@ -24020,7 +24115,8 @@ function handleInsertRowAt(_vm, records, row, isInsertNextRow) {
|
|
|
24020
24115
|
return {
|
|
24021
24116
|
insertRecords: this.getInsertRecords(),
|
|
24022
24117
|
removeRecords: this.getRemoveRecords(),
|
|
24023
|
-
updateRecords: this.getUpdateRecords()
|
|
24118
|
+
updateRecords: this.getUpdateRecords(),
|
|
24119
|
+
pendingRecords: this.getUpdateRecords()
|
|
24024
24120
|
};
|
|
24025
24121
|
},
|
|
24026
24122
|
/**
|
|
@@ -24092,7 +24188,7 @@ function handleInsertRowAt(_vm, records, row, isInsertNextRow) {
|
|
|
24092
24188
|
var editRender = column.editRender;
|
|
24093
24189
|
var cell = params.cell = params.cell || this.getCell(row, column);
|
|
24094
24190
|
var beforeEditMethod = editOpts.beforeEditMethod || editOpts.activeMethod;
|
|
24095
|
-
if (isEnableConf(editConfig) && isEnableConf(editRender) && cell) {
|
|
24191
|
+
if (isEnableConf(editConfig) && isEnableConf(editRender) && !this.hasPendingByRow(row) && cell) {
|
|
24096
24192
|
if (actived.row !== row || (mode === 'cell' ? actived.column !== column : false)) {
|
|
24097
24193
|
// 判断是否禁用编辑
|
|
24098
24194
|
var type = 'edit-disabled';
|
|
@@ -24108,7 +24204,7 @@ function handleInsertRowAt(_vm, records, row, isInsertNextRow) {
|
|
|
24108
24204
|
if (actived.column) {
|
|
24109
24205
|
this.clearActived(evnt);
|
|
24110
24206
|
}
|
|
24111
|
-
type = 'edit-
|
|
24207
|
+
type = 'edit-activated';
|
|
24112
24208
|
column.renderHeight = cell.offsetHeight;
|
|
24113
24209
|
actived.args = params;
|
|
24114
24210
|
actived.row = row;
|
|
@@ -24132,6 +24228,18 @@ function handleInsertRowAt(_vm, records, row, isInsertNextRow) {
|
|
|
24132
24228
|
columnIndex: this.getColumnIndex(column),
|
|
24133
24229
|
$columnIndex: this.getVMColumnIndex(column)
|
|
24134
24230
|
}, evnt);
|
|
24231
|
+
|
|
24232
|
+
// v4已废弃
|
|
24233
|
+
if (type === 'edit-activated') {
|
|
24234
|
+
this.emitEvent('edit-actived', {
|
|
24235
|
+
row: row,
|
|
24236
|
+
rowIndex: this.getRowIndex(row),
|
|
24237
|
+
$rowIndex: this.getVMRowIndex(row),
|
|
24238
|
+
column: column,
|
|
24239
|
+
columnIndex: this.getColumnIndex(column),
|
|
24240
|
+
$columnIndex: this.getVMColumnIndex(column)
|
|
24241
|
+
}, evnt);
|
|
24242
|
+
}
|
|
24135
24243
|
} else {
|
|
24136
24244
|
var oldColumn = actived.column;
|
|
24137
24245
|
if (mouseConfig) {
|
|
@@ -24222,7 +24330,12 @@ function handleInsertRowAt(_vm, records, row, isInsertNextRow) {
|
|
|
24222
24330
|
$columnIndex: this.getVMColumnIndex(column)
|
|
24223
24331
|
}, evnt);
|
|
24224
24332
|
}
|
|
24225
|
-
|
|
24333
|
+
if (conf.cellVaildMode === 'obsolete') {
|
|
24334
|
+
if (this.clearValidate) {
|
|
24335
|
+
return this.clearValidate();
|
|
24336
|
+
}
|
|
24337
|
+
}
|
|
24338
|
+
return this.$nextTick();
|
|
24226
24339
|
},
|
|
24227
24340
|
_getActiveRecord: function _getActiveRecord() {
|
|
24228
24341
|
// if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
@@ -24238,7 +24351,7 @@ function handleInsertRowAt(_vm, records, row, isInsertNextRow) {
|
|
|
24238
24351
|
var actived = editStore.actived;
|
|
24239
24352
|
var args = actived.args,
|
|
24240
24353
|
row = actived.row;
|
|
24241
|
-
if (args && this.findRowIndexOf(afterFullData, row) > -1 && $el.querySelectorAll('.vxe-body--column.col--
|
|
24354
|
+
if (args && this.findRowIndexOf(afterFullData, row) > -1 && $el.querySelectorAll('.vxe-body--column.col--active').length) {
|
|
24242
24355
|
return Object.assign({}, args);
|
|
24243
24356
|
}
|
|
24244
24357
|
return null;
|
|
@@ -28396,7 +28509,8 @@ function checkOptionDisabled(_vm, isSelected, option, group) {
|
|
|
28396
28509
|
return false;
|
|
28397
28510
|
}
|
|
28398
28511
|
function renderOption(h, _vm, list, group) {
|
|
28399
|
-
var
|
|
28512
|
+
var $scopedSlots = _vm.$scopedSlots,
|
|
28513
|
+
isGroup = _vm.isGroup,
|
|
28400
28514
|
labelField = _vm.labelField,
|
|
28401
28515
|
valueField = _vm.valueField,
|
|
28402
28516
|
optionKey = _vm.optionKey,
|
|
@@ -28405,6 +28519,7 @@ function renderOption(h, _vm, list, group) {
|
|
|
28405
28519
|
currentValue = _vm.currentValue,
|
|
28406
28520
|
optionOpts = _vm.optionOpts;
|
|
28407
28521
|
var useKey = optionOpts.useKey;
|
|
28522
|
+
var optionSlot = $scopedSlots.option;
|
|
28408
28523
|
return list.map(function (option, cIndex) {
|
|
28409
28524
|
var slots = option.slots;
|
|
28410
28525
|
var optionValue = option[valueField];
|
|
@@ -28413,6 +28528,11 @@ function renderOption(h, _vm, list, group) {
|
|
|
28413
28528
|
var isDisabled = checkOptionDisabled(_vm, isSelected, option, group);
|
|
28414
28529
|
var optid = getOptid(_vm, option);
|
|
28415
28530
|
var defaultSlot = slots ? slots.default : null;
|
|
28531
|
+
var optParams = {
|
|
28532
|
+
option: option,
|
|
28533
|
+
group: null,
|
|
28534
|
+
$select: _vm
|
|
28535
|
+
};
|
|
28416
28536
|
return isVisible ? h('div', {
|
|
28417
28537
|
key: useKey || optionKey ? optid : cIndex,
|
|
28418
28538
|
class: ['vxe-select-option', option.className, {
|
|
@@ -28436,24 +28556,28 @@ function renderOption(h, _vm, list, group) {
|
|
|
28436
28556
|
}
|
|
28437
28557
|
}
|
|
28438
28558
|
}
|
|
28439
|
-
}, defaultSlot ? _vm.callSlot(defaultSlot,
|
|
28440
|
-
option: option,
|
|
28441
|
-
$select: _vm
|
|
28442
|
-
}, h) : utils.formatText(getFuncText(option[labelField]))) : null;
|
|
28559
|
+
}, optionSlot ? _vm.callSlot(optionSlot, optParams, h) : defaultSlot ? _vm.callSlot(defaultSlot, optParams, h) : utils.formatText(getFuncText(option[labelField]))) : null;
|
|
28443
28560
|
});
|
|
28444
28561
|
}
|
|
28445
28562
|
function renderOptgroup(h, _vm) {
|
|
28446
|
-
var
|
|
28563
|
+
var $scopedSlots = _vm.$scopedSlots,
|
|
28564
|
+
optionKey = _vm.optionKey,
|
|
28447
28565
|
visibleGroupList = _vm.visibleGroupList,
|
|
28448
28566
|
groupLabelField = _vm.groupLabelField,
|
|
28449
28567
|
groupOptionsField = _vm.groupOptionsField,
|
|
28450
28568
|
optionOpts = _vm.optionOpts;
|
|
28451
28569
|
var useKey = optionOpts.useKey;
|
|
28570
|
+
var optionSlot = $scopedSlots.option;
|
|
28452
28571
|
return visibleGroupList.map(function (group, gIndex) {
|
|
28453
28572
|
var slots = group.slots;
|
|
28454
28573
|
var optid = getOptid(_vm, group);
|
|
28455
28574
|
var isGroupDisabled = group.disabled;
|
|
28456
28575
|
var defaultSlot = slots ? slots.default : null;
|
|
28576
|
+
var optParams = {
|
|
28577
|
+
option: group,
|
|
28578
|
+
group: group,
|
|
28579
|
+
$select: _vm
|
|
28580
|
+
};
|
|
28457
28581
|
return h('div', {
|
|
28458
28582
|
key: useKey || optionKey ? optid : gIndex,
|
|
28459
28583
|
class: ['vxe-optgroup', group.className, {
|
|
@@ -28464,10 +28588,7 @@ function renderOptgroup(h, _vm) {
|
|
|
28464
28588
|
}
|
|
28465
28589
|
}, [h('div', {
|
|
28466
28590
|
class: 'vxe-optgroup--title'
|
|
28467
|
-
}, defaultSlot ? _vm.callSlot(defaultSlot, {
|
|
28468
|
-
option: group,
|
|
28469
|
-
$select: _vm
|
|
28470
|
-
}, h) : getFuncText(group[groupLabelField])), h('div', {
|
|
28591
|
+
}, optionSlot ? _vm.callSlot(optionSlot, optParams, h) : defaultSlot ? _vm.callSlot(defaultSlot, optParams, h) : getFuncText(group[groupLabelField])), h('div', {
|
|
28471
28592
|
class: 'vxe-optgroup--wrapper'
|
|
28472
28593
|
}, renderOption(h, _vm, group[groupOptionsField], group))]);
|
|
28473
28594
|
});
|
|
@@ -28711,7 +28832,9 @@ function renderOpts(h, _vm) {
|
|
|
28711
28832
|
GlobalEvent.off(this, 'blur');
|
|
28712
28833
|
},
|
|
28713
28834
|
render: function render(h) {
|
|
28714
|
-
var _ref,
|
|
28835
|
+
var _ref,
|
|
28836
|
+
_this2 = this,
|
|
28837
|
+
_ref2;
|
|
28715
28838
|
var _e = this._e,
|
|
28716
28839
|
$scopedSlots = this.$scopedSlots,
|
|
28717
28840
|
vSize = this.vSize,
|
|
@@ -28723,7 +28846,10 @@ function renderOpts(h, _vm) {
|
|
|
28723
28846
|
disabled = this.disabled,
|
|
28724
28847
|
visiblePanel = this.visiblePanel,
|
|
28725
28848
|
filterable = this.filterable;
|
|
28849
|
+
var defaultSlot = $scopedSlots.default;
|
|
28726
28850
|
var prefixSlot = $scopedSlots.prefix;
|
|
28851
|
+
var headerSlot = $scopedSlots.header;
|
|
28852
|
+
var footerSlot = $scopedSlots.footer;
|
|
28727
28853
|
return h('div', {
|
|
28728
28854
|
class: ['vxe-select', className ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(className) ? className({
|
|
28729
28855
|
$select: this
|
|
@@ -28731,7 +28857,7 @@ function renderOpts(h, _vm) {
|
|
|
28731
28857
|
}, [h('div', {
|
|
28732
28858
|
class: 'vxe-select-slots',
|
|
28733
28859
|
ref: 'hideOption'
|
|
28734
|
-
}, this
|
|
28860
|
+
}, defaultSlot ? defaultSlot.call(this, {}) : []), h('vxe-input', {
|
|
28735
28861
|
ref: 'input',
|
|
28736
28862
|
props: {
|
|
28737
28863
|
clearable: this.clearable,
|
|
@@ -28752,7 +28878,7 @@ function renderOpts(h, _vm) {
|
|
|
28752
28878
|
},
|
|
28753
28879
|
scopedSlots: prefixSlot ? {
|
|
28754
28880
|
prefix: function prefix() {
|
|
28755
|
-
return prefixSlot({});
|
|
28881
|
+
return prefixSlot.call(_this2, {});
|
|
28756
28882
|
}
|
|
28757
28883
|
} : {}
|
|
28758
28884
|
}), h('div', {
|
|
@@ -28765,10 +28891,10 @@ function renderOpts(h, _vm) {
|
|
|
28765
28891
|
},
|
|
28766
28892
|
style: this.panelStyle
|
|
28767
28893
|
}, inited ? [filterable ? h('div', {
|
|
28768
|
-
class: 'vxe-select-
|
|
28894
|
+
class: 'vxe-select--panel-search'
|
|
28769
28895
|
}, [h('vxe-input', {
|
|
28770
28896
|
ref: 'inpSearch',
|
|
28771
|
-
class: 'vxe-select-
|
|
28897
|
+
class: 'vxe-select-search--input',
|
|
28772
28898
|
props: {
|
|
28773
28899
|
value: this.searchValue,
|
|
28774
28900
|
type: 'text',
|
|
@@ -28784,9 +28910,17 @@ function renderOpts(h, _vm) {
|
|
|
28784
28910
|
search: this.triggerSearchEvent
|
|
28785
28911
|
}
|
|
28786
28912
|
})]) : _e(), h('div', {
|
|
28913
|
+
class: 'vxe-select--panel-wrapper'
|
|
28914
|
+
}, [headerSlot ? h('div', {
|
|
28915
|
+
class: 'vxe-select--panel-header'
|
|
28916
|
+
}, headerSlot.call(this, {})) : _e(), h('div', {
|
|
28917
|
+
class: 'vxe-select--panel-body'
|
|
28918
|
+
}, [h('div', {
|
|
28787
28919
|
ref: 'optWrapper',
|
|
28788
28920
|
class: 'vxe-select-option--wrapper'
|
|
28789
|
-
}, renderOpts(h, this))]
|
|
28921
|
+
}, renderOpts(h, this))]), footerSlot ? h('div', {
|
|
28922
|
+
class: 'vxe-select--panel-footer'
|
|
28923
|
+
}, footerSlot.call(this, {})) : _e()])] : [])]);
|
|
28790
28924
|
},
|
|
28791
28925
|
methods: {
|
|
28792
28926
|
callSlot: function callSlot(slotFunc, params, h) {
|
|
@@ -28802,13 +28936,13 @@ function renderOpts(h, _vm) {
|
|
|
28802
28936
|
return [];
|
|
28803
28937
|
},
|
|
28804
28938
|
cacheItemMap: function cacheItemMap() {
|
|
28805
|
-
var
|
|
28939
|
+
var _this3 = this;
|
|
28806
28940
|
var fullOptionList = this.fullOptionList,
|
|
28807
28941
|
fullGroupList = this.fullGroupList,
|
|
28808
28942
|
groupOptionsField = this.groupOptionsField;
|
|
28809
28943
|
var optkey = getOptkey(this);
|
|
28810
28944
|
var handleOptis = function handleOptis(item) {
|
|
28811
|
-
if (!getOptid(
|
|
28945
|
+
if (!getOptid(_this3, item)) {
|
|
28812
28946
|
item[optkey] = getOptUniqueId();
|
|
28813
28947
|
}
|
|
28814
28948
|
};
|
|
@@ -28878,12 +29012,12 @@ function renderOpts(h, _vm) {
|
|
|
28878
29012
|
}
|
|
28879
29013
|
},
|
|
28880
29014
|
scrollToOption: function scrollToOption(option, isAlignBottom) {
|
|
28881
|
-
var
|
|
29015
|
+
var _this4 = this;
|
|
28882
29016
|
return this.$nextTick().then(function () {
|
|
28883
29017
|
if (option) {
|
|
28884
|
-
var $refs =
|
|
29018
|
+
var $refs = _this4.$refs;
|
|
28885
29019
|
var optWrapperElem = $refs.optWrapper;
|
|
28886
|
-
var optElem = $refs.panel.querySelector("[optid='".concat(getOptid(
|
|
29020
|
+
var optElem = $refs.panel.querySelector("[optid='".concat(getOptid(_this4, option), "']"));
|
|
28887
29021
|
if (optWrapperElem && optElem) {
|
|
28888
29022
|
var wrapperHeight = optWrapperElem.offsetHeight;
|
|
28889
29023
|
var offsetPadding = 5;
|
|
@@ -29053,11 +29187,11 @@ function renderOpts(h, _vm) {
|
|
|
29053
29187
|
}
|
|
29054
29188
|
},
|
|
29055
29189
|
handleFocusSearch: function handleFocusSearch() {
|
|
29056
|
-
var
|
|
29190
|
+
var _this5 = this;
|
|
29057
29191
|
if (this.filterable) {
|
|
29058
29192
|
this.$nextTick(function () {
|
|
29059
|
-
if (
|
|
29060
|
-
|
|
29193
|
+
if (_this5.$refs.inpSearch) {
|
|
29194
|
+
_this5.$refs.inpSearch.focus();
|
|
29061
29195
|
}
|
|
29062
29196
|
});
|
|
29063
29197
|
}
|
|
@@ -29091,7 +29225,7 @@ function renderOpts(h, _vm) {
|
|
|
29091
29225
|
}
|
|
29092
29226
|
},
|
|
29093
29227
|
triggerSearchEvent: external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().debounce(function () {
|
|
29094
|
-
var
|
|
29228
|
+
var _this6 = this;
|
|
29095
29229
|
var remote = this.remote,
|
|
29096
29230
|
remoteMethod = this.remoteMethod,
|
|
29097
29231
|
searchValue = this.searchValue;
|
|
@@ -29100,12 +29234,12 @@ function renderOpts(h, _vm) {
|
|
|
29100
29234
|
Promise.resolve(remoteMethod({
|
|
29101
29235
|
searchValue: searchValue
|
|
29102
29236
|
})).then(function () {
|
|
29103
|
-
return
|
|
29237
|
+
return _this6.$nextTick();
|
|
29104
29238
|
}).catch(function () {
|
|
29105
|
-
return
|
|
29239
|
+
return _this6.$nextTick();
|
|
29106
29240
|
}).finally(function () {
|
|
29107
|
-
|
|
29108
|
-
|
|
29241
|
+
_this6.searchLoading = false;
|
|
29242
|
+
_this6.refreshOption();
|
|
29109
29243
|
});
|
|
29110
29244
|
} else {
|
|
29111
29245
|
this.refreshOption();
|
|
@@ -29146,7 +29280,7 @@ function renderOpts(h, _vm) {
|
|
|
29146
29280
|
}
|
|
29147
29281
|
},
|
|
29148
29282
|
showOptionPanel: function showOptionPanel() {
|
|
29149
|
-
var
|
|
29283
|
+
var _this7 = this;
|
|
29150
29284
|
var loading = this.loading,
|
|
29151
29285
|
disabled = this.disabled,
|
|
29152
29286
|
filterable = this.filterable;
|
|
@@ -29165,37 +29299,37 @@ function renderOpts(h, _vm) {
|
|
|
29165
29299
|
this.refreshOption();
|
|
29166
29300
|
}
|
|
29167
29301
|
setTimeout(function () {
|
|
29168
|
-
var value =
|
|
29169
|
-
multiple =
|
|
29170
|
-
var currOption = findOption(
|
|
29171
|
-
|
|
29302
|
+
var value = _this7.value,
|
|
29303
|
+
multiple = _this7.multiple;
|
|
29304
|
+
var currOption = findOption(_this7, multiple && value ? value[0] : value);
|
|
29305
|
+
_this7.visiblePanel = true;
|
|
29172
29306
|
if (currOption) {
|
|
29173
|
-
|
|
29174
|
-
|
|
29307
|
+
_this7.setCurrentOption(currOption);
|
|
29308
|
+
_this7.scrollToOption(currOption);
|
|
29175
29309
|
}
|
|
29176
|
-
|
|
29310
|
+
_this7.handleFocusSearch();
|
|
29177
29311
|
}, 10);
|
|
29178
29312
|
this.updateZindex();
|
|
29179
29313
|
this.updatePlacement();
|
|
29180
29314
|
}
|
|
29181
29315
|
},
|
|
29182
29316
|
hideOptionPanel: function hideOptionPanel() {
|
|
29183
|
-
var
|
|
29317
|
+
var _this8 = this;
|
|
29184
29318
|
this.searchValue = '';
|
|
29185
29319
|
this.searchLoading = false;
|
|
29186
29320
|
this.visiblePanel = false;
|
|
29187
29321
|
this.hidePanelTimeout = setTimeout(function () {
|
|
29188
|
-
|
|
29189
|
-
|
|
29322
|
+
_this8.animatVisible = false;
|
|
29323
|
+
_this8.searchValue = '';
|
|
29190
29324
|
}, 350);
|
|
29191
29325
|
},
|
|
29192
29326
|
updatePlacement: function updatePlacement() {
|
|
29193
|
-
var
|
|
29327
|
+
var _this9 = this;
|
|
29194
29328
|
return this.$nextTick().then(function () {
|
|
29195
|
-
var $refs =
|
|
29196
|
-
transfer =
|
|
29197
|
-
placement =
|
|
29198
|
-
panelIndex =
|
|
29329
|
+
var $refs = _this9.$refs,
|
|
29330
|
+
transfer = _this9.transfer,
|
|
29331
|
+
placement = _this9.placement,
|
|
29332
|
+
panelIndex = _this9.panelIndex;
|
|
29199
29333
|
var targetElem = $refs.input.$el;
|
|
29200
29334
|
var panelElem = $refs.panel;
|
|
29201
29335
|
if (panelElem && targetElem) {
|
|
@@ -29259,9 +29393,9 @@ function renderOpts(h, _vm) {
|
|
|
29259
29393
|
}
|
|
29260
29394
|
}
|
|
29261
29395
|
}
|
|
29262
|
-
|
|
29263
|
-
|
|
29264
|
-
return
|
|
29396
|
+
_this9.panelStyle = panelStyle;
|
|
29397
|
+
_this9.panelPlacement = panelPlacement;
|
|
29398
|
+
return _this9.$nextTick();
|
|
29265
29399
|
}
|
|
29266
29400
|
});
|
|
29267
29401
|
},
|
|
@@ -32260,6 +32394,9 @@ var Keyboard = {
|
|
|
32260
32394
|
|
|
32261
32395
|
|
|
32262
32396
|
|
|
32397
|
+
|
|
32398
|
+
|
|
32399
|
+
|
|
32263
32400
|
|
|
32264
32401
|
|
|
32265
32402
|
|
|
@@ -32346,8 +32483,9 @@ function validErrorRuleValue(rule, val) {
|
|
|
32346
32483
|
*/
|
|
32347
32484
|
handleValidError: function handleValidError(params) {
|
|
32348
32485
|
var _this = this;
|
|
32486
|
+
var validOpts = this.validOpts;
|
|
32349
32487
|
return new Promise(function (resolve) {
|
|
32350
|
-
if (
|
|
32488
|
+
if (validOpts.autoPos === false) {
|
|
32351
32489
|
_this.emitEvent('valid-error', params);
|
|
32352
32490
|
resolve();
|
|
32353
32491
|
} else {
|
|
@@ -32362,6 +32500,19 @@ function validErrorRuleValue(rule, val) {
|
|
|
32362
32500
|
}
|
|
32363
32501
|
});
|
|
32364
32502
|
},
|
|
32503
|
+
handleErrMsgMode: function handleErrMsgMode(validErrMaps) {
|
|
32504
|
+
var validOpts = this.validOpts;
|
|
32505
|
+
if (validOpts.msgMode === 'single') {
|
|
32506
|
+
var keys = Object.keys(validErrMaps);
|
|
32507
|
+
var resMaps = validErrMaps;
|
|
32508
|
+
if (keys.length) {
|
|
32509
|
+
var firstKey = keys[0];
|
|
32510
|
+
resMaps[firstKey] = validErrMaps[firstKey];
|
|
32511
|
+
}
|
|
32512
|
+
return resMaps;
|
|
32513
|
+
}
|
|
32514
|
+
return validErrMaps;
|
|
32515
|
+
},
|
|
32365
32516
|
/**
|
|
32366
32517
|
* 对表格数据进行校验
|
|
32367
32518
|
* 如果不指定数据,则默认只校验临时变动的数据,例如新增或修改
|
|
@@ -32376,6 +32527,7 @@ function validErrorRuleValue(rule, val) {
|
|
|
32376
32527
|
var validRest = {};
|
|
32377
32528
|
var editRules = this.editRules,
|
|
32378
32529
|
afterFullData = this.afterFullData,
|
|
32530
|
+
visibleColumn = this.visibleColumn,
|
|
32379
32531
|
treeConfig = this.treeConfig,
|
|
32380
32532
|
treeOpts = this.treeOpts;
|
|
32381
32533
|
var childrenField = treeOpts.children || treeOpts.childrenField;
|
|
@@ -32396,6 +32548,7 @@ function validErrorRuleValue(rule, val) {
|
|
|
32396
32548
|
this.lastCallTime = Date.now();
|
|
32397
32549
|
this.validRuleErr = false; // 如果为快速校验,当存在某列校验不通过时将终止执行
|
|
32398
32550
|
this.clearValidate();
|
|
32551
|
+
var validErrMaps = {};
|
|
32399
32552
|
if (editRules) {
|
|
32400
32553
|
var columns = this.getColumns();
|
|
32401
32554
|
var handleVaild = function handleVaild(row) {
|
|
@@ -32419,6 +32572,12 @@ function validErrorRuleValue(rule, val) {
|
|
|
32419
32572
|
if (!validRest[column.property]) {
|
|
32420
32573
|
validRest[column.property] = [];
|
|
32421
32574
|
}
|
|
32575
|
+
validErrMaps["".concat(getRowid(_this2, row), ":").concat(column.id)] = {
|
|
32576
|
+
column: column,
|
|
32577
|
+
row: row,
|
|
32578
|
+
rule: rule,
|
|
32579
|
+
content: rule.content
|
|
32580
|
+
};
|
|
32422
32581
|
validRest[column.property].push(rest);
|
|
32423
32582
|
if (!isFull) {
|
|
32424
32583
|
_this2.validRuleErr = true;
|
|
@@ -32439,6 +32598,7 @@ function validErrorRuleValue(rule, val) {
|
|
|
32439
32598
|
}
|
|
32440
32599
|
return Promise.all(rowValids).then(function () {
|
|
32441
32600
|
var ruleProps = Object.keys(validRest);
|
|
32601
|
+
_this2.validErrorMaps = _this2.handleErrMsgMode(validErrMaps);
|
|
32442
32602
|
return _this2.$nextTick().then(function () {
|
|
32443
32603
|
if (ruleProps.length) {
|
|
32444
32604
|
return Promise.reject(validRest[ruleProps[0]][0]);
|
|
@@ -32474,20 +32634,21 @@ function validErrorRuleValue(rule, val) {
|
|
|
32474
32634
|
* 将表格滚动到可视区
|
|
32475
32635
|
* 由于提示信息至少需要占一行,定位向上偏移一行
|
|
32476
32636
|
*/
|
|
32477
|
-
var row = firstErrParams.row;
|
|
32478
|
-
var rowIndex = afterFullData.indexOf(row);
|
|
32479
|
-
var locatRow = rowIndex > 0 ? afterFullData[rowIndex - 1] : row;
|
|
32480
32637
|
if (_this2.validOpts.autoPos === false) {
|
|
32481
32638
|
finish();
|
|
32482
32639
|
} else {
|
|
32483
|
-
|
|
32484
|
-
|
|
32485
|
-
|
|
32486
|
-
|
|
32487
|
-
|
|
32640
|
+
var row = firstErrParams.row;
|
|
32641
|
+
var column = firstErrParams.column;
|
|
32642
|
+
var rowIndex = afterFullData.indexOf(row);
|
|
32643
|
+
var columnIndex = visibleColumn.indexOf(column);
|
|
32644
|
+
var locatRow = rowIndex > 0 ? afterFullData[rowIndex - 1] : row;
|
|
32645
|
+
var locatColumn = columnIndex > 0 ? visibleColumn[rowIndex - 1] : column;
|
|
32646
|
+
_this2.scrollToRow(locatRow, locatColumn).then(posAndFinish);
|
|
32488
32647
|
}
|
|
32489
32648
|
});
|
|
32490
32649
|
});
|
|
32650
|
+
} else {
|
|
32651
|
+
this.validErrorMaps = {};
|
|
32491
32652
|
}
|
|
32492
32653
|
return this.$nextTick().then(function () {
|
|
32493
32654
|
if (cb) {
|
|
@@ -32615,41 +32776,82 @@ function validErrorRuleValue(rule, val) {
|
|
|
32615
32776
|
}
|
|
32616
32777
|
});
|
|
32617
32778
|
},
|
|
32618
|
-
_clearValidate: function _clearValidate() {
|
|
32779
|
+
_clearValidate: function _clearValidate(rows, fieldOrColumn) {
|
|
32780
|
+
var _this4 = this;
|
|
32781
|
+
var validOpts = this.validOpts,
|
|
32782
|
+
validErrorMaps = this.validErrorMaps;
|
|
32619
32783
|
var validTip = this.$refs.validTip;
|
|
32620
|
-
|
|
32621
|
-
|
|
32622
|
-
|
|
32623
|
-
column: null,
|
|
32624
|
-
content: '',
|
|
32625
|
-
rule: null
|
|
32784
|
+
var rowList = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(rows) ? rows : rows ? [rows] : [];
|
|
32785
|
+
var colList = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(fieldOrColumn) ? fieldOrColumn : (fieldOrColumn ? [fieldOrColumn] : []).map(function (column) {
|
|
32786
|
+
return handleFieldOrColumn(_this4, column);
|
|
32626
32787
|
});
|
|
32627
|
-
|
|
32788
|
+
var validErrMaps = {};
|
|
32789
|
+
if (validTip && validTip.reactData.visible) {
|
|
32628
32790
|
validTip.close();
|
|
32629
32791
|
}
|
|
32792
|
+
// 如果是单个提示模式
|
|
32793
|
+
if (validOpts.msgMode === 'single') {
|
|
32794
|
+
this.validErrorMaps = {};
|
|
32795
|
+
return this.$nextTick();
|
|
32796
|
+
}
|
|
32797
|
+
if (rowList.length && colList.length) {
|
|
32798
|
+
validErrMaps = Object.assign({}, validErrorMaps);
|
|
32799
|
+
rowList.forEach(function (row) {
|
|
32800
|
+
colList.forEach(function (column) {
|
|
32801
|
+
var vaildKey = "".concat(getRowid(_this4, row), ":").concat(column.id);
|
|
32802
|
+
if (validErrMaps[vaildKey]) {
|
|
32803
|
+
delete validErrMaps[vaildKey];
|
|
32804
|
+
}
|
|
32805
|
+
});
|
|
32806
|
+
});
|
|
32807
|
+
} else if (rowList.length) {
|
|
32808
|
+
var rowidList = rowList.map(function (row) {
|
|
32809
|
+
return "".concat(getRowid(_this4, row));
|
|
32810
|
+
});
|
|
32811
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(validErrorMaps, function (item, key) {
|
|
32812
|
+
if (rowidList.indexOf(key.split(':')[0]) > -1) {
|
|
32813
|
+
validErrMaps[key] = item;
|
|
32814
|
+
}
|
|
32815
|
+
});
|
|
32816
|
+
} else if (colList.length) {
|
|
32817
|
+
var colidList = colList.map(function (column) {
|
|
32818
|
+
return "".concat(column.id);
|
|
32819
|
+
});
|
|
32820
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(validErrorMaps, function (item, key) {
|
|
32821
|
+
if (colidList.indexOf(key.split(':')[1]) > -1) {
|
|
32822
|
+
validErrMaps[key] = item;
|
|
32823
|
+
}
|
|
32824
|
+
});
|
|
32825
|
+
}
|
|
32826
|
+
this.validErrorMaps = validErrMaps;
|
|
32630
32827
|
return this.$nextTick();
|
|
32631
32828
|
},
|
|
32632
32829
|
/**
|
|
32633
32830
|
* 触发校验
|
|
32634
32831
|
*/
|
|
32635
32832
|
triggerValidate: function triggerValidate(type) {
|
|
32636
|
-
var
|
|
32833
|
+
var _this5 = this;
|
|
32637
32834
|
var editConfig = this.editConfig,
|
|
32638
32835
|
editStore = this.editStore,
|
|
32639
32836
|
editRules = this.editRules,
|
|
32640
|
-
|
|
32837
|
+
editOpts = this.editOpts,
|
|
32838
|
+
validOpts = this.validOpts;
|
|
32641
32839
|
var actived = editStore.actived;
|
|
32642
|
-
|
|
32840
|
+
// 检查清除校验消息
|
|
32841
|
+
if (editRules && validOpts.msgMode === 'single') {
|
|
32842
|
+
this.validErrorMaps = {};
|
|
32843
|
+
}
|
|
32844
|
+
|
|
32845
|
+
// 校验单元格
|
|
32846
|
+
if (editConfig && editRules && actived.row) {
|
|
32643
32847
|
var _actived$args = actived.args,
|
|
32644
32848
|
row = _actived$args.row,
|
|
32645
32849
|
column = _actived$args.column,
|
|
32646
32850
|
cell = _actived$args.cell;
|
|
32647
32851
|
if (this.hasCellRules(type, row, column)) {
|
|
32648
32852
|
return this.validCellRules(type, row, column).then(function () {
|
|
32649
|
-
if (
|
|
32650
|
-
|
|
32651
|
-
_this4.clearValidate();
|
|
32652
|
-
}
|
|
32853
|
+
if (editOpts.mode === 'row') {
|
|
32854
|
+
_this5.clearValidate(row, column);
|
|
32653
32855
|
}
|
|
32654
32856
|
}).catch(function (_ref2) {
|
|
32655
32857
|
var rule = _ref2.rule;
|
|
@@ -32661,7 +32863,7 @@ function validErrorRuleValue(rule, val) {
|
|
|
32661
32863
|
column: column,
|
|
32662
32864
|
cell: cell
|
|
32663
32865
|
};
|
|
32664
|
-
|
|
32866
|
+
_this5.showValidTooltip(rest);
|
|
32665
32867
|
return Promise.reject(rest);
|
|
32666
32868
|
}
|
|
32667
32869
|
return Promise.resolve();
|
|
@@ -32674,9 +32876,10 @@ function validErrorRuleValue(rule, val) {
|
|
|
32674
32876
|
* 弹出校验错误提示
|
|
32675
32877
|
*/
|
|
32676
32878
|
showValidTooltip: function showValidTooltip(params) {
|
|
32677
|
-
var _this5 = this;
|
|
32678
32879
|
var $refs = this.$refs,
|
|
32679
32880
|
height = this.height,
|
|
32881
|
+
validStore = this.validStore,
|
|
32882
|
+
validErrorMaps = this.validErrorMaps,
|
|
32680
32883
|
tableData = this.tableData,
|
|
32681
32884
|
validOpts = this.validOpts;
|
|
32682
32885
|
var rule = params.rule,
|
|
@@ -32685,19 +32888,29 @@ function validErrorRuleValue(rule, val) {
|
|
|
32685
32888
|
cell = params.cell;
|
|
32686
32889
|
var validTip = $refs.validTip;
|
|
32687
32890
|
var content = rule.content;
|
|
32688
|
-
|
|
32689
|
-
|
|
32690
|
-
|
|
32891
|
+
validStore.visible = true;
|
|
32892
|
+
if (validOpts.msgMode === 'single') {
|
|
32893
|
+
this.validErrorMaps = _defineProperty({}, "".concat(getRowid(this, row), ":").concat(column.id), {
|
|
32691
32894
|
column: column,
|
|
32895
|
+
row: row,
|
|
32692
32896
|
rule: rule,
|
|
32693
|
-
content: content
|
|
32694
|
-
visible: true
|
|
32897
|
+
content: content
|
|
32695
32898
|
});
|
|
32696
|
-
|
|
32899
|
+
} else {
|
|
32900
|
+
this.validErrorMaps = Object.assign({}, validErrorMaps, _defineProperty({}, "".concat(getRowid(this, row), ":").concat(column.id), {
|
|
32901
|
+
column: column,
|
|
32902
|
+
row: row,
|
|
32903
|
+
rule: rule,
|
|
32904
|
+
content: content
|
|
32905
|
+
}));
|
|
32906
|
+
}
|
|
32907
|
+
this.emitEvent('valid-error', params, null);
|
|
32908
|
+
if (validTip) {
|
|
32697
32909
|
if (validTip && (validOpts.message === 'tooltip' || validOpts.message === 'default' && !height && tableData.length < 2)) {
|
|
32698
32910
|
return validTip.open(cell, content);
|
|
32699
32911
|
}
|
|
32700
|
-
}
|
|
32912
|
+
}
|
|
32913
|
+
return this.$nextTick();
|
|
32701
32914
|
}
|
|
32702
32915
|
}
|
|
32703
32916
|
});
|
|
@@ -33443,7 +33656,6 @@ Object.keys(packages_table.methods).forEach(function (name) {
|
|
|
33443
33656
|
tableLoading: false,
|
|
33444
33657
|
isZMax: false,
|
|
33445
33658
|
tableData: [],
|
|
33446
|
-
pendingRecords: [],
|
|
33447
33659
|
filterData: [],
|
|
33448
33660
|
formData: {},
|
|
33449
33661
|
sortData: [],
|
|
@@ -33510,7 +33722,6 @@ Object.keys(packages_table.methods).forEach(function (name) {
|
|
|
33510
33722
|
if (proxyConfig) {
|
|
33511
33723
|
tableProps.loading = loading || tableLoading;
|
|
33512
33724
|
tableProps.data = tableData;
|
|
33513
|
-
tableProps.rowClassName = this.handleRowClassName;
|
|
33514
33725
|
if (proxyOpts.seq && isEnableConf(pagerConfig)) {
|
|
33515
33726
|
tableProps.seqConfig = Object.assign({}, seqConfig, {
|
|
33516
33727
|
startIndex: (tablePage.currentPage - 1) * tablePage.pageSize
|
|
@@ -33518,9 +33729,7 @@ Object.keys(packages_table.methods).forEach(function (name) {
|
|
|
33518
33729
|
}
|
|
33519
33730
|
}
|
|
33520
33731
|
if (editConfig) {
|
|
33521
|
-
tableProps.editConfig = Object.assign({}, editConfig
|
|
33522
|
-
beforeEditMethod: this.handleBeforeEditMethod
|
|
33523
|
-
});
|
|
33732
|
+
tableProps.editConfig = Object.assign({}, editConfig);
|
|
33524
33733
|
}
|
|
33525
33734
|
return tableProps;
|
|
33526
33735
|
}
|
|
@@ -33682,27 +33891,6 @@ Object.keys(packages_table.methods).forEach(function (name) {
|
|
|
33682
33891
|
var parentPaddingSize = isZMax || height !== 'auto' ? 0 : getPaddingTopBottomSize($el.parentNode);
|
|
33683
33892
|
return parentPaddingSize + getPaddingTopBottomSize($el) + getOffsetHeight(formWrapper) + getOffsetHeight(toolbarWrapper) + getOffsetHeight(topWrapper) + getOffsetHeight(bottomWrapper) + getOffsetHeight(pagerWrapper);
|
|
33684
33893
|
},
|
|
33685
|
-
handleRowClassName: function handleRowClassName(params) {
|
|
33686
|
-
var rowClassName = this.rowClassName;
|
|
33687
|
-
var clss = [];
|
|
33688
|
-
if (this.pendingRecords.some(function (item) {
|
|
33689
|
-
return item === params.row;
|
|
33690
|
-
})) {
|
|
33691
|
-
clss.push('row--pending');
|
|
33692
|
-
}
|
|
33693
|
-
clss.push(rowClassName ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(rowClassName) ? rowClassName(params) : rowClassName : '');
|
|
33694
|
-
return clss;
|
|
33695
|
-
},
|
|
33696
|
-
handleBeforeEditMethod: function handleBeforeEditMethod(params) {
|
|
33697
|
-
var editConfig = this.editConfig;
|
|
33698
|
-
var beforeEditMethod = editConfig ? editConfig.beforeEditMethod || editConfig.activeMethod : null;
|
|
33699
|
-
if (this.pendingRecords.indexOf(params.row) === -1) {
|
|
33700
|
-
return !beforeEditMethod || beforeEditMethod(_objectSpread2(_objectSpread2({}, params), {}, {
|
|
33701
|
-
$grid: this
|
|
33702
|
-
}));
|
|
33703
|
-
}
|
|
33704
|
-
return false;
|
|
33705
|
-
},
|
|
33706
33894
|
initToolbar: function initToolbar() {
|
|
33707
33895
|
var _this3 = this;
|
|
33708
33896
|
this.$nextTick(function () {
|
|
@@ -33827,11 +34015,20 @@ Object.keys(packages_table.methods).forEach(function (name) {
|
|
|
33827
34015
|
switch (code) {
|
|
33828
34016
|
case 'insert':
|
|
33829
34017
|
return this.insert();
|
|
33830
|
-
case '
|
|
34018
|
+
case 'insert_edit':
|
|
33831
34019
|
return this.insert().then(function (_ref2) {
|
|
33832
34020
|
var row = _ref2.row;
|
|
33833
|
-
return _this5.
|
|
34021
|
+
return _this5.setEditRow(row);
|
|
33834
34022
|
});
|
|
34023
|
+
|
|
34024
|
+
// 已废弃
|
|
34025
|
+
case 'insert_actived':
|
|
34026
|
+
return this.insert().then(function (_ref3) {
|
|
34027
|
+
var row = _ref3.row;
|
|
34028
|
+
return _this5.setEditRow(row);
|
|
34029
|
+
});
|
|
34030
|
+
// 已废弃
|
|
34031
|
+
|
|
33835
34032
|
case 'mark_cancel':
|
|
33836
34033
|
this.triggerPendingEvent(code);
|
|
33837
34034
|
break;
|
|
@@ -33892,7 +34089,6 @@ Object.keys(packages_table.methods).forEach(function (name) {
|
|
|
33892
34089
|
filterList = $xetable.getCheckedFilters();
|
|
33893
34090
|
} else {
|
|
33894
34091
|
if (isReload) {
|
|
33895
|
-
this.pendingRecords = [];
|
|
33896
34092
|
$xetable.clearAll();
|
|
33897
34093
|
} else {
|
|
33898
34094
|
sortList = $xetable.getSortColumns();
|
|
@@ -33978,9 +34174,7 @@ Object.keys(packages_table.methods).forEach(function (name) {
|
|
|
33978
34174
|
_this5.tableLoading = true;
|
|
33979
34175
|
return Promise.resolve((beforeDelete || _ajaxMethods).apply(void 0, _toConsumableArray(_applyArgs))).then(function (rest) {
|
|
33980
34176
|
_this5.tableLoading = false;
|
|
33981
|
-
|
|
33982
|
-
return removeRecords.indexOf(row) === -1;
|
|
33983
|
-
});
|
|
34177
|
+
$xetable.setPendingRow(removeRecords, false);
|
|
33984
34178
|
if (isMsg) {
|
|
33985
34179
|
// 检测弹窗模块
|
|
33986
34180
|
if (false) {}
|
|
@@ -34033,9 +34227,7 @@ Object.keys(packages_table.methods).forEach(function (name) {
|
|
|
34033
34227
|
{
|
|
34034
34228
|
var _ajaxMethods2 = ajax.save;
|
|
34035
34229
|
if (_ajaxMethods2) {
|
|
34036
|
-
var _body =
|
|
34037
|
-
pendingRecords: this.pendingRecords
|
|
34038
|
-
}, this.getRecordset());
|
|
34230
|
+
var _body = this.getRecordset();
|
|
34039
34231
|
var insertRecords = _body.insertRecords,
|
|
34040
34232
|
_removeRecords = _body.removeRecords,
|
|
34041
34233
|
updateRecords = _body.updateRecords,
|
|
@@ -34074,7 +34266,7 @@ Object.keys(packages_table.methods).forEach(function (name) {
|
|
|
34074
34266
|
_this5.tableLoading = true;
|
|
34075
34267
|
return Promise.resolve((beforeSave || _ajaxMethods2).apply(void 0, _toConsumableArray(_applyArgs2))).then(function (rest) {
|
|
34076
34268
|
_this5.tableLoading = false;
|
|
34077
|
-
|
|
34269
|
+
$xetable.clearPendingRow();
|
|
34078
34270
|
if (isMsg) {
|
|
34079
34271
|
// 检测弹窗模块
|
|
34080
34272
|
if (false) {}
|
|
@@ -34191,9 +34383,6 @@ Object.keys(packages_table.methods).forEach(function (name) {
|
|
|
34191
34383
|
});
|
|
34192
34384
|
return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isUndefined(itemIndex) ? itemList : itemList[itemIndex];
|
|
34193
34385
|
},
|
|
34194
|
-
getPendingRecords: function getPendingRecords() {
|
|
34195
|
-
return this.pendingRecords;
|
|
34196
|
-
},
|
|
34197
34386
|
triggerToolbarCommitEvent: function triggerToolbarCommitEvent(params, evnt) {
|
|
34198
34387
|
var _this6 = this;
|
|
34199
34388
|
var code = params.code;
|
|
@@ -34226,28 +34415,10 @@ Object.keys(packages_table.methods).forEach(function (name) {
|
|
|
34226
34415
|
});
|
|
34227
34416
|
},
|
|
34228
34417
|
triggerPendingEvent: function triggerPendingEvent(code) {
|
|
34229
|
-
var
|
|
34230
|
-
isMsg = this.isMsg;
|
|
34418
|
+
var isMsg = this.isMsg;
|
|
34231
34419
|
var selectRecords = this.getCheckboxRecords();
|
|
34232
34420
|
if (selectRecords.length) {
|
|
34233
|
-
|
|
34234
|
-
var minus = [];
|
|
34235
|
-
selectRecords.forEach(function (data) {
|
|
34236
|
-
if (pendingRecords.some(function (item) {
|
|
34237
|
-
return data === item;
|
|
34238
|
-
})) {
|
|
34239
|
-
minus.push(data);
|
|
34240
|
-
} else {
|
|
34241
|
-
plus.push(data);
|
|
34242
|
-
}
|
|
34243
|
-
});
|
|
34244
|
-
if (minus.length) {
|
|
34245
|
-
this.pendingRecords = pendingRecords.filter(function (item) {
|
|
34246
|
-
return minus.indexOf(item) === -1;
|
|
34247
|
-
}).concat(plus);
|
|
34248
|
-
} else if (plus.length) {
|
|
34249
|
-
this.pendingRecords = pendingRecords.concat(plus);
|
|
34250
|
-
}
|
|
34421
|
+
this.togglePendingRow(selectRecords);
|
|
34251
34422
|
this.clearCheckboxRow();
|
|
34252
34423
|
} else {
|
|
34253
34424
|
if (isMsg) {
|
|
@@ -34410,8 +34581,10 @@ Object.keys(packages_table.methods).forEach(function (name) {
|
|
|
34410
34581
|
});
|
|
34411
34582
|
},
|
|
34412
34583
|
getProxyInfo: function getProxyInfo() {
|
|
34413
|
-
var
|
|
34584
|
+
var $refs = this.$refs,
|
|
34585
|
+
sortData = this.sortData,
|
|
34414
34586
|
proxyConfig = this.proxyConfig;
|
|
34587
|
+
var $xetable = $refs.xTable;
|
|
34415
34588
|
if (proxyConfig) {
|
|
34416
34589
|
return {
|
|
34417
34590
|
data: this.tableData,
|
|
@@ -34420,7 +34593,7 @@ Object.keys(packages_table.methods).forEach(function (name) {
|
|
|
34420
34593
|
sort: sortData.length ? sortData[0] : {},
|
|
34421
34594
|
sorts: sortData,
|
|
34422
34595
|
pager: this.tablePage,
|
|
34423
|
-
pendingRecords:
|
|
34596
|
+
pendingRecords: $xetable ? $xetable.getPendingRecords() : []
|
|
34424
34597
|
};
|
|
34425
34598
|
}
|
|
34426
34599
|
return null;
|
|
@@ -36294,7 +36467,7 @@ var autoTxtElem;
|
|
|
36294
36467
|
autoTxtElem.className = ['vxe-textarea--autosize', size ? "size--".concat(size) : ''].join(' ');
|
|
36295
36468
|
autoTxtElem.style.width = "".concat(textElem.clientWidth, "px");
|
|
36296
36469
|
autoTxtElem.style.padding = textStyle.padding;
|
|
36297
|
-
autoTxtElem.
|
|
36470
|
+
autoTxtElem.innerText = ('' + (inputValue || ' ')).replace(/\n$/, '\n ');
|
|
36298
36471
|
}
|
|
36299
36472
|
},
|
|
36300
36473
|
handleResize: function handleResize() {
|
|
@@ -37091,7 +37264,7 @@ function renderContent(h, _vm) {
|
|
|
37091
37264
|
return h('div', {
|
|
37092
37265
|
class: ['vxe-table--tooltip-wrapper', "theme--".concat(theme), popupClassName ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(popupClassName) ? popupClassName({
|
|
37093
37266
|
$tooltip: this
|
|
37094
|
-
}) : popupClassName : '', (_ref = {}, _defineProperty(_ref, "size--".concat(vSize), vSize), _defineProperty(_ref, "placement--".concat(tipStore.placement), tipStore.placement), _defineProperty(_ref, 'is--enterable', enterable), _defineProperty(_ref, 'is--visible', visible), _defineProperty(_ref, 'is--arrow', isArrow), _defineProperty(_ref, 'is--
|
|
37267
|
+
}) : popupClassName : '', (_ref = {}, _defineProperty(_ref, "size--".concat(vSize), vSize), _defineProperty(_ref, "placement--".concat(tipStore.placement), tipStore.placement), _defineProperty(_ref, 'is--enterable', enterable), _defineProperty(_ref, 'is--visible', visible), _defineProperty(_ref, 'is--arrow', isArrow), _defineProperty(_ref, 'is--active', tipActive), _ref)],
|
|
37095
37268
|
style: tipStore.style,
|
|
37096
37269
|
ref: 'tipWrapper',
|
|
37097
37270
|
on: on
|
|
@@ -39296,7 +39469,8 @@ var List = Object.assign(list, {
|
|
|
39296
39469
|
},
|
|
39297
39470
|
render: function render(h) {
|
|
39298
39471
|
var _ref, _ref2;
|
|
39299
|
-
var
|
|
39472
|
+
var _e = this._e,
|
|
39473
|
+
$scopedSlots = this.$scopedSlots,
|
|
39300
39474
|
inited = this.inited,
|
|
39301
39475
|
className = this.className,
|
|
39302
39476
|
popupClassName = this.popupClassName,
|
|
@@ -39310,7 +39484,9 @@ var List = Object.assign(list, {
|
|
|
39310
39484
|
panelStyle = this.panelStyle,
|
|
39311
39485
|
panelPlacement = this.panelPlacement;
|
|
39312
39486
|
var defaultSlot = $scopedSlots.default;
|
|
39313
|
-
var
|
|
39487
|
+
var headerSlot = $scopedSlots.header;
|
|
39488
|
+
var footerSlot = $scopedSlots.footer;
|
|
39489
|
+
var dropdownSlot = $scopedSlots.dropdown;
|
|
39314
39490
|
return h('div', {
|
|
39315
39491
|
class: ['vxe-pulldown', className ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(className) ? className({
|
|
39316
39492
|
$pulldown: this
|
|
@@ -39329,11 +39505,21 @@ var List = Object.assign(list, {
|
|
|
39329
39505
|
placement: panelPlacement
|
|
39330
39506
|
},
|
|
39331
39507
|
style: panelStyle
|
|
39332
|
-
},
|
|
39333
|
-
class: 'vxe-pulldown--wrapper'
|
|
39334
|
-
}, !inited || destroyOnClose && !visiblePanel && !animatVisible ? [] :
|
|
39508
|
+
}, [h('div', {
|
|
39509
|
+
class: 'vxe-pulldown--panel-wrapper'
|
|
39510
|
+
}, !inited || destroyOnClose && !visiblePanel && !animatVisible ? [] : [headerSlot ? h('div', {
|
|
39511
|
+
class: 'vxe-pulldown--panel-header'
|
|
39512
|
+
}, headerSlot.call(this, {
|
|
39513
|
+
$pulldown: this
|
|
39514
|
+
})) : _e(), h('div', {
|
|
39515
|
+
class: 'vxe-pulldown--panel-body'
|
|
39516
|
+
}, dropdownSlot ? dropdownSlot.call(this, {
|
|
39517
|
+
$pulldown: this
|
|
39518
|
+
}, h) : []), footerSlot ? h('div', {
|
|
39519
|
+
class: 'vxe-pulldown--panel-footer'
|
|
39520
|
+
}, footerSlot.call(this, {
|
|
39335
39521
|
$pulldown: this
|
|
39336
|
-
}
|
|
39522
|
+
})) : _e()])])]);
|
|
39337
39523
|
},
|
|
39338
39524
|
methods: {
|
|
39339
39525
|
handleGlobalMousewheelEvent: function handleGlobalMousewheelEvent(evnt) {
|