vxe-table 3.14.0 → 3.14.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/style.css +1 -1
- package/es/table/module/edit/mixin.js +95 -65
- package/es/table/module/keyboard/mixin.js +3 -2
- package/es/table/module/validator/mixin.js +2 -5
- package/es/table/src/body.js +6 -7
- package/es/table/src/methods.js +301 -286
- package/es/table/src/table.js +21 -15
- package/es/ui/index.js +1 -1
- package/es/ui/src/dom.js +0 -1
- package/es/ui/src/log.js +1 -1
- package/lib/index.umd.js +501 -498
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/module/edit/mixin.js +108 -99
- package/lib/table/module/edit/mixin.min.js +1 -1
- package/lib/table/module/keyboard/mixin.js +2 -1
- package/lib/table/module/keyboard/mixin.min.js +1 -1
- package/lib/table/module/validator/mixin.js +3 -9
- package/lib/table/module/validator/mixin.min.js +1 -1
- package/lib/table/src/body.js +6 -7
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/methods.js +352 -355
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +21 -15
- package/lib/table/src/table.min.js +1 -1
- package/lib/ui/index.js +1 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/dom.js +0 -2
- package/lib/ui/src/dom.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/package.json +2 -2
- package/packages/table/module/edit/mixin.ts +129 -89
- package/packages/table/module/keyboard/mixin.ts +4 -2
- package/packages/table/module/validator/mixin.ts +3 -6
- package/packages/table/src/body.ts +6 -7
- package/packages/table/src/methods.ts +345 -301
- package/packages/table/src/table.ts +24 -18
- package/packages/table/src/util.ts +2 -2
- package/packages/ui/src/dom.ts +0 -2
- /package/es/{iconfont.1742955973002.ttf → iconfont.1743125678150.ttf} +0 -0
- /package/es/{iconfont.1742955973002.woff → iconfont.1743125678150.woff} +0 -0
- /package/es/{iconfont.1742955973002.woff2 → iconfont.1743125678150.woff2} +0 -0
- /package/lib/{iconfont.1742955973002.ttf → iconfont.1743125678150.ttf} +0 -0
- /package/lib/{iconfont.1742955973002.woff → iconfont.1743125678150.woff} +0 -0
- /package/lib/{iconfont.1742955973002.woff2 → iconfont.1743125678150.woff2} +0 -0
package/lib/index.umd.js
CHANGED
|
@@ -2220,7 +2220,7 @@ function getClass(property, params) {
|
|
|
2220
2220
|
;// CONCATENATED MODULE: ./packages/ui/index.ts
|
|
2221
2221
|
|
|
2222
2222
|
|
|
2223
|
-
const version = "3.14.
|
|
2223
|
+
const version = "3.14.2";
|
|
2224
2224
|
core_.VxeUI.version = version;
|
|
2225
2225
|
core_.VxeUI.tableVersion = version;
|
|
2226
2226
|
core_.VxeUI.setConfig({
|
|
@@ -2661,7 +2661,6 @@ var es_array_push = __webpack_require__(4114);
|
|
|
2661
2661
|
;// CONCATENATED MODULE: ./packages/ui/src/dom.ts
|
|
2662
2662
|
|
|
2663
2663
|
const reClsMap = {};
|
|
2664
|
-
const browse = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().browse();
|
|
2665
2664
|
let tpImgEl;
|
|
2666
2665
|
function initTpImg() {
|
|
2667
2666
|
if (!tpImgEl) {
|
|
@@ -2844,7 +2843,7 @@ function isNodeElement(elem) {
|
|
|
2844
2843
|
const {
|
|
2845
2844
|
log: log_log
|
|
2846
2845
|
} = core_.VxeUI;
|
|
2847
|
-
const log_version = `table v${"3.14.
|
|
2846
|
+
const log_version = `table v${"3.14.2"}`;
|
|
2848
2847
|
const warnLog = log_log.create('warn', log_version);
|
|
2849
2848
|
const errLog = log_log.create('error', log_version);
|
|
2850
2849
|
;// CONCATENATED MODULE: ./packages/table/src/columnInfo.ts
|
|
@@ -5174,6 +5173,7 @@ const {
|
|
|
5174
5173
|
interceptor: methods_interceptor,
|
|
5175
5174
|
createEvent
|
|
5176
5175
|
} = core_.VxeUI;
|
|
5176
|
+
const browseObj = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().browse();
|
|
5177
5177
|
const supportMaxRow = 5e6;
|
|
5178
5178
|
const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
5179
5179
|
const maxYHeight = 5e6;
|
|
@@ -5525,14 +5525,14 @@ const updateScrollYStatus = ($xeTable, fullData) => {
|
|
|
5525
5525
|
const {
|
|
5526
5526
|
treeConfig
|
|
5527
5527
|
} = props;
|
|
5528
|
-
const
|
|
5528
|
+
const virtualYOpts = $xeTable.computeVirtualYOpts;
|
|
5529
5529
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
5530
5530
|
const {
|
|
5531
5531
|
transform
|
|
5532
5532
|
} = treeOpts;
|
|
5533
5533
|
const allList = fullData || internalData.tableFullData;
|
|
5534
5534
|
// 如果gt为0,则总是启用
|
|
5535
|
-
const scrollYLoad = (transform || !treeConfig) && !!
|
|
5535
|
+
const scrollYLoad = (transform || !treeConfig) && !!virtualYOpts.enabled && virtualYOpts.gt > -1 && (virtualYOpts.gt === 0 || virtualYOpts.gt < allList.length);
|
|
5536
5536
|
reactData.scrollYLoad = scrollYLoad;
|
|
5537
5537
|
return scrollYLoad;
|
|
5538
5538
|
};
|
|
@@ -5693,7 +5693,6 @@ function updateStyle($xeTable) {
|
|
|
5693
5693
|
const reactData = $xeTable;
|
|
5694
5694
|
const internalData = $xeTable;
|
|
5695
5695
|
const {
|
|
5696
|
-
border,
|
|
5697
5696
|
showHeaderOverflow: allColumnHeaderOverflow,
|
|
5698
5697
|
showFooterOverflow: allColumnFooterOverflow,
|
|
5699
5698
|
mouseConfig,
|
|
@@ -5872,36 +5871,6 @@ function updateStyle($xeTable) {
|
|
|
5872
5871
|
if (tableElem) {
|
|
5873
5872
|
tableElem.style.width = tWidth ? `${tWidth}px` : '';
|
|
5874
5873
|
}
|
|
5875
|
-
const listElem = getRefElem(elemStore[`${name}-${layout}-list`]);
|
|
5876
|
-
if (isGroup && listElem) {
|
|
5877
|
-
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(listElem.querySelectorAll('.col--group'), thElem => {
|
|
5878
|
-
const colNode = $xeTable.getColumnNode(thElem);
|
|
5879
|
-
if (colNode) {
|
|
5880
|
-
const column = colNode.item;
|
|
5881
|
-
const {
|
|
5882
|
-
showHeaderOverflow
|
|
5883
|
-
} = column;
|
|
5884
|
-
const cellOverflow = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(showHeaderOverflow) ? showHeaderOverflow : allColumnHeaderOverflow;
|
|
5885
|
-
const showEllipsis = cellOverflow === 'ellipsis';
|
|
5886
|
-
const showTitle = cellOverflow === 'title';
|
|
5887
|
-
const showTooltip = cellOverflow === true || cellOverflow === 'tooltip';
|
|
5888
|
-
const hasEllipsis = showTitle || showTooltip || showEllipsis;
|
|
5889
|
-
let childWidth = 0;
|
|
5890
|
-
let countChild = 0;
|
|
5891
|
-
if (hasEllipsis) {
|
|
5892
|
-
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(column.children, item => {
|
|
5893
|
-
if (!item.children || !column.children.length) {
|
|
5894
|
-
countChild++;
|
|
5895
|
-
}
|
|
5896
|
-
childWidth += item.renderWidth;
|
|
5897
|
-
}, {
|
|
5898
|
-
children: 'children'
|
|
5899
|
-
});
|
|
5900
|
-
}
|
|
5901
|
-
thElem.style.width = hasEllipsis ? `${childWidth - countChild - (border ? 2 : 0)}px` : '';
|
|
5902
|
-
}
|
|
5903
|
-
});
|
|
5904
|
-
}
|
|
5905
5874
|
} else if (layout === 'body') {
|
|
5906
5875
|
if (currScrollElem) {
|
|
5907
5876
|
currScrollElem.style.maxHeight = customMaxHeight ? `${bodyMaxHeight}px` : '';
|
|
@@ -5947,7 +5916,7 @@ function updateStyle($xeTable) {
|
|
|
5947
5916
|
if (tableElem) {
|
|
5948
5917
|
tableElem.style.width = tWidth ? `${tWidth}px` : '';
|
|
5949
5918
|
// 兼容性处理
|
|
5950
|
-
tableElem.style.paddingRight = osbWidth && fixedType && (
|
|
5919
|
+
tableElem.style.paddingRight = osbWidth && fixedType && (browseObj['-moz'] || browseObj.safari) ? `${osbWidth}px` : '';
|
|
5951
5920
|
}
|
|
5952
5921
|
const emptyBlockElem = getRefElem(elemStore[`${name}-${layout}-emptyBlock`]);
|
|
5953
5922
|
if (emptyBlockElem) {
|
|
@@ -6020,6 +5989,134 @@ function handleChangeCell($xeTable, evnt, params) {
|
|
|
6020
5989
|
$xeTable.handleEdit(params, evnt).then(() => checkValidate($xeTable, 'change')).catch(e => e);
|
|
6021
5990
|
});
|
|
6022
5991
|
}
|
|
5992
|
+
function handleDefaultSort($xeTable) {
|
|
5993
|
+
const props = $xeTable;
|
|
5994
|
+
const {
|
|
5995
|
+
sortConfig
|
|
5996
|
+
} = props;
|
|
5997
|
+
if (sortConfig) {
|
|
5998
|
+
const sortOpts = $xeTable.computeSortOpts;
|
|
5999
|
+
let {
|
|
6000
|
+
defaultSort
|
|
6001
|
+
} = sortOpts;
|
|
6002
|
+
if (defaultSort) {
|
|
6003
|
+
if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(defaultSort)) {
|
|
6004
|
+
defaultSort = [defaultSort];
|
|
6005
|
+
}
|
|
6006
|
+
if (defaultSort.length) {
|
|
6007
|
+
(sortConfig.multiple ? defaultSort : defaultSort.slice(0, 1)).forEach((item, index) => {
|
|
6008
|
+
const {
|
|
6009
|
+
field,
|
|
6010
|
+
order
|
|
6011
|
+
} = item;
|
|
6012
|
+
if (field && order) {
|
|
6013
|
+
const column = $xeTable.getColumnByField(field);
|
|
6014
|
+
if (column && column.sortable) {
|
|
6015
|
+
column.order = order;
|
|
6016
|
+
column.sortTime = Date.now() + index;
|
|
6017
|
+
}
|
|
6018
|
+
}
|
|
6019
|
+
});
|
|
6020
|
+
if (!sortOpts.remote) {
|
|
6021
|
+
$xeTable.handleTableData(true).then(updateStyle);
|
|
6022
|
+
}
|
|
6023
|
+
}
|
|
6024
|
+
}
|
|
6025
|
+
}
|
|
6026
|
+
}
|
|
6027
|
+
/**
|
|
6028
|
+
* 处理默认勾选
|
|
6029
|
+
*/
|
|
6030
|
+
function handleDefaultSelectionChecked($xeTable) {
|
|
6031
|
+
const props = $xeTable;
|
|
6032
|
+
const internalData = $xeTable;
|
|
6033
|
+
const {
|
|
6034
|
+
checkboxConfig
|
|
6035
|
+
} = props;
|
|
6036
|
+
if (checkboxConfig) {
|
|
6037
|
+
const {
|
|
6038
|
+
fullDataRowIdData
|
|
6039
|
+
} = internalData;
|
|
6040
|
+
const checkboxOpts = $xeTable.computeCheckboxOpts;
|
|
6041
|
+
const {
|
|
6042
|
+
checkAll,
|
|
6043
|
+
checkRowKeys
|
|
6044
|
+
} = checkboxOpts;
|
|
6045
|
+
if (checkAll) {
|
|
6046
|
+
handleCheckedAllCheckboxRow($xeTable, true, true);
|
|
6047
|
+
} else if (checkRowKeys) {
|
|
6048
|
+
const defSelection = [];
|
|
6049
|
+
checkRowKeys.forEach(rowid => {
|
|
6050
|
+
if (fullDataRowIdData[rowid]) {
|
|
6051
|
+
defSelection.push(fullDataRowIdData[rowid].row);
|
|
6052
|
+
}
|
|
6053
|
+
});
|
|
6054
|
+
handleCheckedCheckboxRow($xeTable, defSelection, true, true);
|
|
6055
|
+
}
|
|
6056
|
+
}
|
|
6057
|
+
}
|
|
6058
|
+
/**
|
|
6059
|
+
* 处理单选框默认勾选
|
|
6060
|
+
*/
|
|
6061
|
+
function handleDefaultRadioChecked($xeTable) {
|
|
6062
|
+
const props = $xeTable;
|
|
6063
|
+
const internalData = $xeTable;
|
|
6064
|
+
const {
|
|
6065
|
+
radioConfig
|
|
6066
|
+
} = props;
|
|
6067
|
+
if (radioConfig) {
|
|
6068
|
+
const {
|
|
6069
|
+
fullDataRowIdData
|
|
6070
|
+
} = internalData;
|
|
6071
|
+
const radioOpts = $xeTable.computeRadioOpts;
|
|
6072
|
+
const {
|
|
6073
|
+
checkRowKey: rowid,
|
|
6074
|
+
reserve
|
|
6075
|
+
} = radioOpts;
|
|
6076
|
+
if (rowid) {
|
|
6077
|
+
if (fullDataRowIdData[rowid]) {
|
|
6078
|
+
handleCheckedRadioRow(fullDataRowIdData[rowid].row, true);
|
|
6079
|
+
}
|
|
6080
|
+
if (reserve) {
|
|
6081
|
+
const rowkey = getRowkey($xeTable);
|
|
6082
|
+
internalData.radioReserveRow = {
|
|
6083
|
+
[rowkey]: rowid
|
|
6084
|
+
};
|
|
6085
|
+
}
|
|
6086
|
+
}
|
|
6087
|
+
}
|
|
6088
|
+
}
|
|
6089
|
+
/**
|
|
6090
|
+
* 处理默认展开行
|
|
6091
|
+
*/
|
|
6092
|
+
function handleDefaultRowExpand($xeTable) {
|
|
6093
|
+
const props = $xeTable;
|
|
6094
|
+
const internalData = $xeTable;
|
|
6095
|
+
const {
|
|
6096
|
+
expandConfig
|
|
6097
|
+
} = props;
|
|
6098
|
+
if (expandConfig) {
|
|
6099
|
+
const {
|
|
6100
|
+
fullDataRowIdData
|
|
6101
|
+
} = internalData;
|
|
6102
|
+
const expandOpts = $xeTable.computeExpandOpts;
|
|
6103
|
+
const {
|
|
6104
|
+
expandAll,
|
|
6105
|
+
expandRowKeys
|
|
6106
|
+
} = expandOpts;
|
|
6107
|
+
if (expandAll) {
|
|
6108
|
+
$xeTable.setAllRowExpand(true);
|
|
6109
|
+
} else if (expandRowKeys) {
|
|
6110
|
+
const defExpandeds = [];
|
|
6111
|
+
expandRowKeys.forEach(rowid => {
|
|
6112
|
+
if (fullDataRowIdData[rowid]) {
|
|
6113
|
+
defExpandeds.push(fullDataRowIdData[rowid].row);
|
|
6114
|
+
}
|
|
6115
|
+
});
|
|
6116
|
+
$xeTable.setRowExpand(defExpandeds, true);
|
|
6117
|
+
}
|
|
6118
|
+
}
|
|
6119
|
+
}
|
|
6023
6120
|
function handleRadioReserveRow($xeTable, row) {
|
|
6024
6121
|
const internalData = $xeTable;
|
|
6025
6122
|
const radioOpts = $xeTable.computeRadioOpts;
|
|
@@ -6582,21 +6679,19 @@ function calculateMergerOffsetIndex(list, offsetItem, type) {
|
|
|
6582
6679
|
}
|
|
6583
6680
|
}
|
|
6584
6681
|
function setMerges($xeTable, merges, mList, rowList) {
|
|
6585
|
-
const props = $xeTable
|
|
6682
|
+
// const props = $xeTable
|
|
6586
6683
|
const internalData = $xeTable;
|
|
6587
6684
|
if (merges) {
|
|
6588
|
-
const {
|
|
6589
|
-
treeConfig
|
|
6590
|
-
} = props;
|
|
6685
|
+
// const { treeConfig } = props
|
|
6591
6686
|
const {
|
|
6592
6687
|
visibleColumn
|
|
6593
6688
|
} = internalData;
|
|
6594
6689
|
if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(merges)) {
|
|
6595
6690
|
merges = [merges];
|
|
6596
6691
|
}
|
|
6597
|
-
if (treeConfig && merges.length) {
|
|
6598
|
-
|
|
6599
|
-
}
|
|
6692
|
+
// if (treeConfig && merges.length) {
|
|
6693
|
+
// errLog('vxe.error.noTree', ['merge-cells | merge-footer-items'])
|
|
6694
|
+
// }
|
|
6600
6695
|
merges.forEach(item => {
|
|
6601
6696
|
let {
|
|
6602
6697
|
row,
|
|
@@ -6641,22 +6736,20 @@ function setMerges($xeTable, merges, mList, rowList) {
|
|
|
6641
6736
|
}
|
|
6642
6737
|
}
|
|
6643
6738
|
function removeMerges($xeTable, merges, mList, rowList) {
|
|
6644
|
-
const props = $xeTable
|
|
6739
|
+
// const props = $xeTable
|
|
6645
6740
|
const internalData = $xeTable;
|
|
6646
6741
|
const rest = [];
|
|
6647
6742
|
if (merges) {
|
|
6648
|
-
const {
|
|
6649
|
-
treeConfig
|
|
6650
|
-
} = props;
|
|
6743
|
+
// const { treeConfig } = props
|
|
6651
6744
|
const {
|
|
6652
6745
|
visibleColumn
|
|
6653
6746
|
} = internalData;
|
|
6654
6747
|
if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(merges)) {
|
|
6655
6748
|
merges = [merges];
|
|
6656
6749
|
}
|
|
6657
|
-
if (treeConfig && merges.length) {
|
|
6658
|
-
|
|
6659
|
-
}
|
|
6750
|
+
// if (treeConfig && merges.length) {
|
|
6751
|
+
// errLog('vxe.error.noTree', ['merge-cells | merge-footer-items'])
|
|
6752
|
+
// }
|
|
6660
6753
|
merges.forEach(item => {
|
|
6661
6754
|
let {
|
|
6662
6755
|
row,
|
|
@@ -7143,7 +7236,7 @@ function hideDropTip($xeTable) {
|
|
|
7143
7236
|
* @param {Event} evnt 事件
|
|
7144
7237
|
* @param {Row} row 行对象
|
|
7145
7238
|
*/
|
|
7146
|
-
function handleTooltip($xeTable, evnt, tdEl, overflowElem, params) {
|
|
7239
|
+
function handleTooltip($xeTable, evnt, tdEl, overflowElem, tipElem, params) {
|
|
7147
7240
|
const reactData = $xeTable;
|
|
7148
7241
|
const tipOverEl = overflowElem || tdEl;
|
|
7149
7242
|
if (!tipOverEl) {
|
|
@@ -7165,7 +7258,8 @@ function handleTooltip($xeTable, evnt, tdEl, overflowElem, params) {
|
|
|
7165
7258
|
const customContent = contentMethod ? contentMethod(params) : null;
|
|
7166
7259
|
const useCustom = contentMethod && !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(customContent);
|
|
7167
7260
|
const content = useCustom ? customContent : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toString(column.type === 'html' ? tipOverEl.innerText : tipOverEl.textContent).trim();
|
|
7168
|
-
|
|
7261
|
+
const isOver = tipOverEl.scrollWidth > tipOverEl.clientWidth;
|
|
7262
|
+
if (content && (showAll || useCustom || isOver)) {
|
|
7169
7263
|
Object.assign(tooltipStore, {
|
|
7170
7264
|
row,
|
|
7171
7265
|
column,
|
|
@@ -7175,7 +7269,7 @@ function handleTooltip($xeTable, evnt, tdEl, overflowElem, params) {
|
|
|
7175
7269
|
$xeTable.$nextTick(() => {
|
|
7176
7270
|
const $tooltip = $xeTable.$refs.refTooltip;
|
|
7177
7271
|
if ($tooltip && $tooltip.open) {
|
|
7178
|
-
$tooltip.open(tipOverEl, formatText(content));
|
|
7272
|
+
$tooltip.open(isOver ? tipOverEl : tipElem, formatText(content));
|
|
7179
7273
|
}
|
|
7180
7274
|
});
|
|
7181
7275
|
}
|
|
@@ -7192,7 +7286,7 @@ function handleScrollToRowColumn($xeTable, fieldOrColumn, row) {
|
|
|
7192
7286
|
}
|
|
7193
7287
|
return $xeTable.$nextTick();
|
|
7194
7288
|
}
|
|
7195
|
-
|
|
7289
|
+
function handleRowExpandReserve($xeTable, row, expanded) {
|
|
7196
7290
|
const internalData = $xeTable;
|
|
7197
7291
|
const {
|
|
7198
7292
|
rowExpandedReserveRowMap
|
|
@@ -7206,7 +7300,25 @@ const handleRowExpandReserve = ($xeTable, row, expanded) => {
|
|
|
7206
7300
|
delete rowExpandedReserveRowMap[rowid];
|
|
7207
7301
|
}
|
|
7208
7302
|
}
|
|
7209
|
-
}
|
|
7303
|
+
}
|
|
7304
|
+
function handleDefaultMergeCells($xeTable) {
|
|
7305
|
+
const props = $xeTable;
|
|
7306
|
+
const {
|
|
7307
|
+
mergeCells
|
|
7308
|
+
} = props;
|
|
7309
|
+
if (mergeCells) {
|
|
7310
|
+
$xeTable.setMergeCells(mergeCells);
|
|
7311
|
+
}
|
|
7312
|
+
}
|
|
7313
|
+
function handleDefaultMergeFooterItems($xeTable) {
|
|
7314
|
+
const props = $xeTable;
|
|
7315
|
+
const {
|
|
7316
|
+
mergeFooterItems
|
|
7317
|
+
} = props;
|
|
7318
|
+
if (mergeFooterItems) {
|
|
7319
|
+
$xeTable.setMergeFooterItems(mergeFooterItems);
|
|
7320
|
+
}
|
|
7321
|
+
}
|
|
7210
7322
|
// 计算可视渲染相关数据
|
|
7211
7323
|
function computeScrollLoad($xeTable) {
|
|
7212
7324
|
const reactData = $xeTable;
|
|
@@ -7304,6 +7416,26 @@ function handleRecalculateLayout($xeTable, reFull) {
|
|
|
7304
7416
|
}
|
|
7305
7417
|
});
|
|
7306
7418
|
}
|
|
7419
|
+
/**
|
|
7420
|
+
* 处理数据加载默认行为
|
|
7421
|
+
* 默认执行一次,除非被重置
|
|
7422
|
+
*/
|
|
7423
|
+
function handleLoadDefaults($xeTable) {
|
|
7424
|
+
handleDefaultSelectionChecked($xeTable);
|
|
7425
|
+
handleDefaultRadioChecked($xeTable);
|
|
7426
|
+
handleDefaultRowExpand($xeTable);
|
|
7427
|
+
handleDefaultTreeExpand($xeTable);
|
|
7428
|
+
handleDefaultMergeCells($xeTable);
|
|
7429
|
+
handleDefaultMergeFooterItems($xeTable);
|
|
7430
|
+
$xeTable.$nextTick(() => setTimeout(() => $xeTable.recalculate()));
|
|
7431
|
+
}
|
|
7432
|
+
/**
|
|
7433
|
+
* 处理初始化的默认行为
|
|
7434
|
+
* 只会执行一次
|
|
7435
|
+
*/
|
|
7436
|
+
function handleInitDefaults($xeTable) {
|
|
7437
|
+
handleDefaultSort($xeTable);
|
|
7438
|
+
}
|
|
7307
7439
|
function handleTableColumn($xeTable) {
|
|
7308
7440
|
const reactData = $xeTable;
|
|
7309
7441
|
const internalData = $xeTable;
|
|
@@ -7395,7 +7527,7 @@ function parseColumns($xeTable, isReset) {
|
|
|
7395
7527
|
isGroup,
|
|
7396
7528
|
columnStore
|
|
7397
7529
|
} = reactData;
|
|
7398
|
-
const
|
|
7530
|
+
const virtualXOpts = $xeTable.computeVirtualXOpts;
|
|
7399
7531
|
const {
|
|
7400
7532
|
collectColumn,
|
|
7401
7533
|
tableFullColumn,
|
|
@@ -7456,7 +7588,7 @@ function parseColumns($xeTable, isReset) {
|
|
|
7456
7588
|
}
|
|
7457
7589
|
const visibleColumn = leftList.concat(centerList).concat(rightList);
|
|
7458
7590
|
// 如果gt为0,则总是启用
|
|
7459
|
-
const scrollXLoad = !!
|
|
7591
|
+
const scrollXLoad = !!virtualXOpts.enabled && virtualXOpts.gt > -1 && (virtualXOpts.gt === 0 || virtualXOpts.gt < tableFullColumn.length);
|
|
7460
7592
|
reactData.hasFixedColumn = leftList.length > 0 || rightList.length > 0;
|
|
7461
7593
|
Object.assign(columnStore, {
|
|
7462
7594
|
leftList,
|
|
@@ -8110,21 +8242,26 @@ const Methods = {
|
|
|
8110
8242
|
*/
|
|
8111
8243
|
loadTableData(datas, isReset) {
|
|
8112
8244
|
const $xeTable = this;
|
|
8245
|
+
const props = $xeTable;
|
|
8113
8246
|
const reactData = $xeTable;
|
|
8114
8247
|
const internalData = $xeTable;
|
|
8115
8248
|
const {
|
|
8116
8249
|
keepSource,
|
|
8117
|
-
treeConfig
|
|
8118
|
-
|
|
8119
|
-
|
|
8250
|
+
treeConfig
|
|
8251
|
+
} = props;
|
|
8252
|
+
const {
|
|
8253
|
+
scrollYLoad: oldScrollYLoad
|
|
8254
|
+
} = reactData;
|
|
8255
|
+
const {
|
|
8120
8256
|
scrollYStore,
|
|
8121
8257
|
scrollXStore,
|
|
8122
8258
|
lastScrollLeft,
|
|
8123
|
-
lastScrollTop
|
|
8124
|
-
|
|
8125
|
-
|
|
8126
|
-
|
|
8127
|
-
|
|
8259
|
+
lastScrollTop
|
|
8260
|
+
} = internalData;
|
|
8261
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
8262
|
+
const {
|
|
8263
|
+
transform
|
|
8264
|
+
} = treeOpts;
|
|
8128
8265
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
8129
8266
|
let treeData = [];
|
|
8130
8267
|
let fullData = datas ? datas.slice(0) : [];
|
|
@@ -8133,7 +8270,7 @@ const Methods = {
|
|
|
8133
8270
|
}
|
|
8134
8271
|
if (treeConfig) {
|
|
8135
8272
|
// 树结构自动转换
|
|
8136
|
-
if (
|
|
8273
|
+
if (transform) {
|
|
8137
8274
|
if (!treeOpts.rowField) {
|
|
8138
8275
|
errLog('vxe.error.reqProp', ['table.tree-config.rowField']);
|
|
8139
8276
|
}
|
|
@@ -8171,8 +8308,8 @@ const Methods = {
|
|
|
8171
8308
|
scrollXStore.endIndex = 1;
|
|
8172
8309
|
reactData.isRowLoading = true;
|
|
8173
8310
|
reactData.scrollVMLoading = false;
|
|
8174
|
-
|
|
8175
|
-
|
|
8311
|
+
internalData.insertRowMaps = {};
|
|
8312
|
+
internalData.removeRowMaps = {};
|
|
8176
8313
|
const sYLoad = updateScrollYStatus($xeTable, fullData);
|
|
8177
8314
|
reactData.isDragColMove = false;
|
|
8178
8315
|
reactData.isDragRowMove = false;
|
|
@@ -8190,15 +8327,15 @@ const Methods = {
|
|
|
8190
8327
|
if (keepSource) {
|
|
8191
8328
|
$xeTable.cacheSourceMap(fullData);
|
|
8192
8329
|
}
|
|
8193
|
-
if (
|
|
8194
|
-
|
|
8195
|
-
|
|
8330
|
+
if ($xeTable.clearCellAreas && props.mouseConfig) {
|
|
8331
|
+
$xeTable.clearCellAreas();
|
|
8332
|
+
$xeTable.clearCopyCellArea();
|
|
8196
8333
|
}
|
|
8197
|
-
|
|
8198
|
-
|
|
8199
|
-
|
|
8200
|
-
|
|
8201
|
-
return
|
|
8334
|
+
$xeTable.clearMergeCells();
|
|
8335
|
+
$xeTable.clearMergeFooterItems();
|
|
8336
|
+
$xeTable.handleTableData(true);
|
|
8337
|
+
$xeTable.updateFooter();
|
|
8338
|
+
return $xeTable.$nextTick().then(() => {
|
|
8202
8339
|
updateHeight($xeTable);
|
|
8203
8340
|
updateStyle($xeTable);
|
|
8204
8341
|
}).then(() => {
|
|
@@ -8211,45 +8348,47 @@ const Methods = {
|
|
|
8211
8348
|
if (sYLoad) {
|
|
8212
8349
|
// if (showOverflow) {
|
|
8213
8350
|
// if (!rowOpts.height) {
|
|
8214
|
-
// const errColumn =
|
|
8351
|
+
// const errColumn = internalData.tableFullColumn.find((column: any) => column.showOverflow === false)
|
|
8215
8352
|
// if (errColumn) {
|
|
8216
8353
|
// errLog('vxe.error.errProp', [`column[field="${errColumn.field}"].show-overflow=false`, 'show-overflow=true'])
|
|
8217
8354
|
// }
|
|
8218
8355
|
// }
|
|
8219
8356
|
// }
|
|
8220
|
-
if (!(
|
|
8357
|
+
if (!(props.height || props.maxHeight)) {
|
|
8221
8358
|
errLog('vxe.error.reqProp', ['table.height | table.max-height | table.scroll-y={enabled: false}']);
|
|
8222
8359
|
}
|
|
8223
|
-
// if (!
|
|
8360
|
+
// if (!props.showOverflow) {
|
|
8224
8361
|
// warnLog('vxe.error.reqProp', ['table.show-overflow'])
|
|
8225
8362
|
// }
|
|
8226
|
-
if (
|
|
8363
|
+
if (props.spanMethod) {
|
|
8227
8364
|
errLog('vxe.error.scrollErrProp', ['table.span-method']);
|
|
8228
8365
|
}
|
|
8229
8366
|
}
|
|
8230
8367
|
handleReserveStatus($xeTable);
|
|
8231
|
-
|
|
8368
|
+
$xeTable.checkSelectionStatus();
|
|
8232
8369
|
return new Promise(resolve => {
|
|
8233
|
-
this.$nextTick().then(() =>
|
|
8370
|
+
this.$nextTick().then(() => $xeTable.recalculate()).then(() => {
|
|
8234
8371
|
let targetScrollLeft = lastScrollLeft;
|
|
8235
8372
|
let targetScrollTop = lastScrollTop;
|
|
8373
|
+
const virtualXOpts = $xeTable.computeVirtualXOpts;
|
|
8374
|
+
const virtualYOpts = $xeTable.computeVirtualYOpts;
|
|
8236
8375
|
// 是否在更新数据之后自动滚动重置滚动条
|
|
8237
|
-
if (
|
|
8376
|
+
if (virtualXOpts.scrollToLeftOnChange) {
|
|
8238
8377
|
targetScrollLeft = 0;
|
|
8239
8378
|
}
|
|
8240
|
-
if (
|
|
8379
|
+
if (virtualYOpts.scrollToTopOnChange) {
|
|
8241
8380
|
targetScrollTop = 0;
|
|
8242
8381
|
}
|
|
8243
8382
|
reactData.isRowLoading = false;
|
|
8244
8383
|
calcCellHeight($xeTable);
|
|
8245
8384
|
// 是否变更虚拟滚动
|
|
8246
8385
|
if (oldScrollYLoad === sYLoad) {
|
|
8247
|
-
restoreScrollLocation(
|
|
8386
|
+
restoreScrollLocation($xeTable, targetScrollLeft, targetScrollTop).then(() => {
|
|
8248
8387
|
resolve();
|
|
8249
8388
|
});
|
|
8250
8389
|
} else {
|
|
8251
8390
|
setTimeout(() => {
|
|
8252
|
-
restoreScrollLocation(
|
|
8391
|
+
restoreScrollLocation($xeTable, targetScrollLeft, targetScrollTop).then(() => {
|
|
8253
8392
|
resolve();
|
|
8254
8393
|
});
|
|
8255
8394
|
});
|
|
@@ -8263,6 +8402,7 @@ const Methods = {
|
|
|
8263
8402
|
* @param {Array} datas 数据
|
|
8264
8403
|
*/
|
|
8265
8404
|
loadData(datas) {
|
|
8405
|
+
const $xeTable = this;
|
|
8266
8406
|
const {
|
|
8267
8407
|
initStatus
|
|
8268
8408
|
} = this;
|
|
@@ -8270,7 +8410,7 @@ const Methods = {
|
|
|
8270
8410
|
this.inited = true;
|
|
8271
8411
|
this.initStatus = true;
|
|
8272
8412
|
if (!initStatus) {
|
|
8273
|
-
|
|
8413
|
+
handleLoadDefaults($xeTable);
|
|
8274
8414
|
}
|
|
8275
8415
|
return this.recalculate();
|
|
8276
8416
|
});
|
|
@@ -8280,12 +8420,13 @@ const Methods = {
|
|
|
8280
8420
|
* @param {Array} datas 数据
|
|
8281
8421
|
*/
|
|
8282
8422
|
reloadData(datas) {
|
|
8423
|
+
const $xeTable = this;
|
|
8283
8424
|
return this.clearAll().then(() => {
|
|
8284
8425
|
this.inited = true;
|
|
8285
8426
|
this.initStatus = true;
|
|
8286
8427
|
return this.loadTableData(datas, true);
|
|
8287
8428
|
}).then(() => {
|
|
8288
|
-
|
|
8429
|
+
handleLoadDefaults($xeTable);
|
|
8289
8430
|
return this.recalculate();
|
|
8290
8431
|
});
|
|
8291
8432
|
},
|
|
@@ -8481,18 +8622,24 @@ const Methods = {
|
|
|
8481
8622
|
internalData.tableSourceData = sourceData;
|
|
8482
8623
|
},
|
|
8483
8624
|
getParams() {
|
|
8484
|
-
|
|
8625
|
+
const $xeTable = this;
|
|
8626
|
+
const props = $xeTable;
|
|
8627
|
+
return props.params;
|
|
8485
8628
|
},
|
|
8486
8629
|
loadTreeChildren(row, childRecords) {
|
|
8487
8630
|
const $xeTable = this;
|
|
8631
|
+
const props = $xeTable;
|
|
8632
|
+
const internalData = $xeTable;
|
|
8633
|
+
const {
|
|
8634
|
+
keepSource
|
|
8635
|
+
} = props;
|
|
8488
8636
|
const {
|
|
8489
|
-
keepSource,
|
|
8490
8637
|
tableSourceData,
|
|
8491
|
-
treeOpts,
|
|
8492
8638
|
fullDataRowIdData,
|
|
8493
8639
|
fullAllDataRowIdData,
|
|
8494
8640
|
sourceDataRowIdData
|
|
8495
|
-
} =
|
|
8641
|
+
} = internalData;
|
|
8642
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
8496
8643
|
const {
|
|
8497
8644
|
transform,
|
|
8498
8645
|
mapChildrenField
|
|
@@ -8551,20 +8698,24 @@ const Methods = {
|
|
|
8551
8698
|
* @param {Element} tr 元素
|
|
8552
8699
|
*/
|
|
8553
8700
|
getRowNode(tr) {
|
|
8701
|
+
const $xeTable = this;
|
|
8702
|
+
const internalData = $xeTable;
|
|
8554
8703
|
if (tr) {
|
|
8555
8704
|
const {
|
|
8556
8705
|
fullAllDataRowIdData
|
|
8557
|
-
} =
|
|
8706
|
+
} = internalData;
|
|
8558
8707
|
const rowid = tr.getAttribute('rowid');
|
|
8559
|
-
|
|
8560
|
-
|
|
8561
|
-
|
|
8562
|
-
|
|
8563
|
-
|
|
8564
|
-
|
|
8565
|
-
|
|
8566
|
-
|
|
8567
|
-
|
|
8708
|
+
if (rowid) {
|
|
8709
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
8710
|
+
if (rowRest) {
|
|
8711
|
+
return {
|
|
8712
|
+
rowid: rowRest.rowid,
|
|
8713
|
+
item: rowRest.row,
|
|
8714
|
+
index: rowRest.index,
|
|
8715
|
+
items: rowRest.items,
|
|
8716
|
+
parent: rowRest.parent
|
|
8717
|
+
};
|
|
8718
|
+
}
|
|
8568
8719
|
}
|
|
8569
8720
|
}
|
|
8570
8721
|
return null;
|
|
@@ -8574,10 +8725,12 @@ const Methods = {
|
|
|
8574
8725
|
* @param {Element} cell 元素
|
|
8575
8726
|
*/
|
|
8576
8727
|
getColumnNode(cell) {
|
|
8728
|
+
const $xeTable = this;
|
|
8729
|
+
const internalData = $xeTable;
|
|
8577
8730
|
if (cell) {
|
|
8578
8731
|
const {
|
|
8579
8732
|
fullColumnIdData
|
|
8580
|
-
} =
|
|
8733
|
+
} = internalData;
|
|
8581
8734
|
const colid = cell.getAttribute('colid');
|
|
8582
8735
|
if (colid) {
|
|
8583
8736
|
const colRest = fullColumnIdData[colid];
|
|
@@ -8669,20 +8822,23 @@ const Methods = {
|
|
|
8669
8822
|
* @param {Row} records 行数据
|
|
8670
8823
|
*/
|
|
8671
8824
|
defineField(records) {
|
|
8825
|
+
const $xeTable = this;
|
|
8826
|
+
const props = $xeTable;
|
|
8827
|
+
const internalData = $xeTable;
|
|
8672
8828
|
const {
|
|
8673
|
-
|
|
8674
|
-
|
|
8675
|
-
|
|
8676
|
-
|
|
8677
|
-
|
|
8678
|
-
|
|
8829
|
+
treeConfig
|
|
8830
|
+
} = props;
|
|
8831
|
+
const expandOpts = $xeTable.computeExpandOpts;
|
|
8832
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
8833
|
+
const radioOpts = $xeTable.computeRadioOpts;
|
|
8834
|
+
const checkboxOpts = $xeTable.computeCheckboxOpts;
|
|
8679
8835
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
8680
|
-
const rowkey = getRowkey(
|
|
8836
|
+
const rowkey = getRowkey($xeTable);
|
|
8681
8837
|
if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(records)) {
|
|
8682
8838
|
records = [records || {}];
|
|
8683
8839
|
}
|
|
8684
8840
|
return records.map(record => {
|
|
8685
|
-
|
|
8841
|
+
internalData.tableFullColumn.forEach(column => {
|
|
8686
8842
|
const {
|
|
8687
8843
|
field,
|
|
8688
8844
|
editRender
|
|
@@ -8726,8 +8882,9 @@ const Methods = {
|
|
|
8726
8882
|
* @param {Array} records 新数据
|
|
8727
8883
|
*/
|
|
8728
8884
|
createData(records) {
|
|
8729
|
-
|
|
8730
|
-
|
|
8885
|
+
const $xeTable = this;
|
|
8886
|
+
return $xeTable.$nextTick().then(() => {
|
|
8887
|
+
return $xeTable.defineField(records);
|
|
8731
8888
|
});
|
|
8732
8889
|
},
|
|
8733
8890
|
/**
|
|
@@ -8736,11 +8893,12 @@ const Methods = {
|
|
|
8736
8893
|
* @param {Array/Object} records 新数据
|
|
8737
8894
|
*/
|
|
8738
8895
|
createRow(records) {
|
|
8896
|
+
const $xeTable = this;
|
|
8739
8897
|
const isArr = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(records);
|
|
8740
8898
|
if (!isArr) {
|
|
8741
8899
|
records = [records];
|
|
8742
8900
|
}
|
|
8743
|
-
return
|
|
8901
|
+
return $xeTable.createData(records).then(rows => isArr ? rows : rows[0]);
|
|
8744
8902
|
},
|
|
8745
8903
|
/**
|
|
8746
8904
|
* 还原数据
|
|
@@ -8758,20 +8916,15 @@ const Methods = {
|
|
|
8758
8916
|
keepSource,
|
|
8759
8917
|
treeConfig
|
|
8760
8918
|
} = props;
|
|
8761
|
-
const {
|
|
8762
|
-
editStore
|
|
8763
|
-
} = reactData;
|
|
8764
8919
|
const {
|
|
8765
8920
|
fullAllDataRowIdData,
|
|
8766
8921
|
fullDataRowIdData,
|
|
8767
8922
|
tableSourceData,
|
|
8768
8923
|
sourceDataRowIdData,
|
|
8769
8924
|
tableFullData,
|
|
8770
|
-
afterFullData
|
|
8925
|
+
afterFullData,
|
|
8926
|
+
removeRowMaps
|
|
8771
8927
|
} = internalData;
|
|
8772
|
-
const removeTempMaps = {
|
|
8773
|
-
...editStore.removeMaps
|
|
8774
|
-
};
|
|
8775
8928
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
8776
8929
|
const {
|
|
8777
8930
|
transform
|
|
@@ -8809,7 +8962,9 @@ const Methods = {
|
|
|
8809
8962
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().destructuring(row, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().clone(oRow, true));
|
|
8810
8963
|
}
|
|
8811
8964
|
if (!fullDataRowIdData[rowid] && $xeTable.isRemoveByRow(row)) {
|
|
8812
|
-
|
|
8965
|
+
if (removeRowMaps[rowid]) {
|
|
8966
|
+
delete removeRowMaps[rowid];
|
|
8967
|
+
}
|
|
8813
8968
|
tableFullData.unshift(row);
|
|
8814
8969
|
afterFullData.unshift(row);
|
|
8815
8970
|
reDelFlag = true;
|
|
@@ -8821,7 +8976,7 @@ const Methods = {
|
|
|
8821
8976
|
}
|
|
8822
8977
|
if (rows) {
|
|
8823
8978
|
if (reDelFlag) {
|
|
8824
|
-
|
|
8979
|
+
reactData.removeRowFlag++;
|
|
8825
8980
|
$xeTable.updateFooter();
|
|
8826
8981
|
$xeTable.cacheRowMap(false);
|
|
8827
8982
|
$xeTable.handleTableData(treeConfig && transform);
|
|
@@ -8850,10 +9005,12 @@ const Methods = {
|
|
|
8850
9005
|
* @param {String} field 字段名
|
|
8851
9006
|
*/
|
|
8852
9007
|
clearData(rows, field) {
|
|
9008
|
+
const $xeTable = this;
|
|
9009
|
+
const internalData = $xeTable;
|
|
8853
9010
|
const {
|
|
8854
9011
|
tableFullData,
|
|
8855
9012
|
visibleColumn
|
|
8856
|
-
} =
|
|
9013
|
+
} = internalData;
|
|
8857
9014
|
if (!arguments.length) {
|
|
8858
9015
|
rows = tableFullData;
|
|
8859
9016
|
} else if (rows && !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(rows)) {
|
|
@@ -8870,7 +9027,7 @@ const Methods = {
|
|
|
8870
9027
|
});
|
|
8871
9028
|
});
|
|
8872
9029
|
}
|
|
8873
|
-
return
|
|
9030
|
+
return $xeTable.$nextTick();
|
|
8874
9031
|
},
|
|
8875
9032
|
getCellElement(row, fieldOrColumn) {
|
|
8876
9033
|
const $xeTable = this;
|
|
@@ -8971,20 +9128,16 @@ const Methods = {
|
|
|
8971
9128
|
isInsertByRow(row) {
|
|
8972
9129
|
const $xeTable = this;
|
|
8973
9130
|
const reactData = $xeTable;
|
|
8974
|
-
const
|
|
8975
|
-
editStore
|
|
8976
|
-
} = reactData;
|
|
9131
|
+
const internalData = $xeTable;
|
|
8977
9132
|
const rowid = getRowid($xeTable, row);
|
|
8978
|
-
return !!
|
|
9133
|
+
return !!reactData.insertRowFlag && !!internalData.insertRowMaps[rowid];
|
|
8979
9134
|
},
|
|
8980
9135
|
isRemoveByRow(row) {
|
|
8981
9136
|
const $xeTable = this;
|
|
8982
9137
|
const reactData = $xeTable;
|
|
8983
|
-
const
|
|
8984
|
-
editStore
|
|
8985
|
-
} = reactData;
|
|
9138
|
+
const internalData = $xeTable;
|
|
8986
9139
|
const rowid = getRowid($xeTable, row);
|
|
8987
|
-
return !!
|
|
9140
|
+
return !!reactData.removeRowFlag && !!internalData.removeRowMaps[rowid];
|
|
8988
9141
|
},
|
|
8989
9142
|
/**
|
|
8990
9143
|
* 删除所有新增的临时数据
|
|
@@ -8992,11 +9145,8 @@ const Methods = {
|
|
|
8992
9145
|
*/
|
|
8993
9146
|
removeInsertRow() {
|
|
8994
9147
|
const $xeTable = this;
|
|
8995
|
-
const
|
|
8996
|
-
|
|
8997
|
-
editStore
|
|
8998
|
-
} = reactData;
|
|
8999
|
-
editStore.insertMaps = {};
|
|
9148
|
+
const internalData = $xeTable;
|
|
9149
|
+
internalData.insertRowMaps = {};
|
|
9000
9150
|
return $xeTable.remove($xeTable.getInsertRecords());
|
|
9001
9151
|
},
|
|
9002
9152
|
/**
|
|
@@ -9044,14 +9194,19 @@ const Methods = {
|
|
|
9044
9194
|
* @param {Number} columnIndex 索引
|
|
9045
9195
|
*/
|
|
9046
9196
|
getColumns(columnIndex) {
|
|
9047
|
-
const
|
|
9048
|
-
|
|
9197
|
+
const $xeTable = this;
|
|
9198
|
+
const internalData = $xeTable;
|
|
9199
|
+
const {
|
|
9200
|
+
visibleColumn
|
|
9201
|
+
} = internalData;
|
|
9202
|
+
return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isUndefined(columnIndex) ? visibleColumn.slice(0) : visibleColumn[columnIndex];
|
|
9049
9203
|
},
|
|
9050
9204
|
/**
|
|
9051
9205
|
* 根据列获取列的唯一主键
|
|
9052
9206
|
*/
|
|
9053
9207
|
getColid(fieldOrColumn) {
|
|
9054
|
-
const
|
|
9208
|
+
const $xeTable = this;
|
|
9209
|
+
const column = handleFieldOrColumn($xeTable, fieldOrColumn);
|
|
9055
9210
|
return column ? column.id : null;
|
|
9056
9211
|
},
|
|
9057
9212
|
/**
|
|
@@ -9059,7 +9214,11 @@ const Methods = {
|
|
|
9059
9214
|
* @param {String} colid 列主键
|
|
9060
9215
|
*/
|
|
9061
9216
|
getColumnById(colid) {
|
|
9062
|
-
const
|
|
9217
|
+
const $xeTable = this;
|
|
9218
|
+
const internalData = $xeTable;
|
|
9219
|
+
const {
|
|
9220
|
+
fullColumnIdData
|
|
9221
|
+
} = internalData;
|
|
9063
9222
|
return fullColumnIdData[colid] ? fullColumnIdData[colid].column : null;
|
|
9064
9223
|
},
|
|
9065
9224
|
/**
|
|
@@ -9067,7 +9226,11 @@ const Methods = {
|
|
|
9067
9226
|
* @param {String} field 字段名
|
|
9068
9227
|
*/
|
|
9069
9228
|
getColumnByField(field) {
|
|
9070
|
-
const
|
|
9229
|
+
const $xeTable = this;
|
|
9230
|
+
const internalData = $xeTable;
|
|
9231
|
+
const {
|
|
9232
|
+
fullColumnFieldData
|
|
9233
|
+
} = internalData;
|
|
9071
9234
|
return fullColumnFieldData[field] ? fullColumnFieldData[field].column : null;
|
|
9072
9235
|
},
|
|
9073
9236
|
getParentColumn(fieldOrColumn) {
|
|
@@ -9080,11 +9243,14 @@ const Methods = {
|
|
|
9080
9243
|
* 收集到的全量列、全量表头列、处理条件之后的全量表头列、当前渲染中的表头列
|
|
9081
9244
|
*/
|
|
9082
9245
|
getTableColumn() {
|
|
9246
|
+
const $xeTable = this;
|
|
9247
|
+
const reactData = $xeTable;
|
|
9248
|
+
const internalData = $xeTable;
|
|
9083
9249
|
return {
|
|
9084
|
-
collectColumn:
|
|
9085
|
-
fullColumn:
|
|
9086
|
-
visibleColumn:
|
|
9087
|
-
tableColumn:
|
|
9250
|
+
collectColumn: internalData.collectColumn.slice(0),
|
|
9251
|
+
fullColumn: internalData.tableFullColumn.slice(0),
|
|
9252
|
+
visibleColumn: internalData.visibleColumn.slice(0),
|
|
9253
|
+
tableColumn: reactData.tableColumn.slice(0)
|
|
9088
9254
|
};
|
|
9089
9255
|
},
|
|
9090
9256
|
/**
|
|
@@ -9615,16 +9781,21 @@ const Methods = {
|
|
|
9615
9781
|
* 如果存在排序,继续处理
|
|
9616
9782
|
*/
|
|
9617
9783
|
getTableData() {
|
|
9784
|
+
const $xeTable = this;
|
|
9785
|
+
const props = $xeTable;
|
|
9786
|
+
const reactData = $xeTable;
|
|
9787
|
+
const internalData = $xeTable;
|
|
9788
|
+
const {
|
|
9789
|
+
tableData,
|
|
9790
|
+
footerTableData
|
|
9791
|
+
} = reactData;
|
|
9618
9792
|
const {
|
|
9619
|
-
treeConfig,
|
|
9620
9793
|
tableFullData,
|
|
9621
9794
|
afterFullData,
|
|
9622
|
-
tableData,
|
|
9623
|
-
footerTableData,
|
|
9624
9795
|
tableFullTreeData
|
|
9625
|
-
} =
|
|
9796
|
+
} = internalData;
|
|
9626
9797
|
return {
|
|
9627
|
-
fullData: treeConfig ? tableFullTreeData.slice(0) : tableFullData.slice(0),
|
|
9798
|
+
fullData: props.treeConfig ? tableFullTreeData.slice(0) : tableFullData.slice(0),
|
|
9628
9799
|
visibleData: afterFullData.slice(0),
|
|
9629
9800
|
tableData: tableData.slice(0),
|
|
9630
9801
|
footerData: footerTableData.slice(0)
|
|
@@ -9673,37 +9844,15 @@ const Methods = {
|
|
|
9673
9844
|
*/
|
|
9674
9845
|
handleLoadDefaults() {
|
|
9675
9846
|
const $xeTable = this;
|
|
9676
|
-
|
|
9677
|
-
this.handleDefaultSelectionChecked();
|
|
9678
|
-
}
|
|
9679
|
-
if (this.radioConfig) {
|
|
9680
|
-
this.handleDefaultRadioChecked();
|
|
9681
|
-
}
|
|
9682
|
-
if (this.expandConfig) {
|
|
9683
|
-
this.handleDefaultRowExpand();
|
|
9684
|
-
}
|
|
9685
|
-
if (this.treeConfig) {
|
|
9686
|
-
handleDefaultTreeExpand($xeTable);
|
|
9687
|
-
}
|
|
9688
|
-
if (this.mergeCells) {
|
|
9689
|
-
this.handleDefaultMergeCells();
|
|
9690
|
-
}
|
|
9691
|
-
if (this.mergeFooterItems) {
|
|
9692
|
-
this.handleDefaultMergeFooterItems();
|
|
9693
|
-
}
|
|
9694
|
-
this.$nextTick(() => setTimeout(this.recalculate));
|
|
9847
|
+
handleLoadDefaults($xeTable);
|
|
9695
9848
|
},
|
|
9696
9849
|
/**
|
|
9697
9850
|
* 处理初始化的默认行为
|
|
9698
9851
|
* 只会执行一次
|
|
9699
9852
|
*/
|
|
9700
9853
|
handleInitDefaults() {
|
|
9701
|
-
const
|
|
9702
|
-
|
|
9703
|
-
} = this;
|
|
9704
|
-
if (sortConfig) {
|
|
9705
|
-
this.handleDefaultSort();
|
|
9706
|
-
}
|
|
9854
|
+
const $xeTable = this;
|
|
9855
|
+
handleInitDefaults($xeTable);
|
|
9707
9856
|
},
|
|
9708
9857
|
/**
|
|
9709
9858
|
* 设置为固定列
|
|
@@ -9862,79 +10011,37 @@ const Methods = {
|
|
|
9862
10011
|
*/
|
|
9863
10012
|
resetColumn(options) {
|
|
9864
10013
|
warnLog('vxe.error.delFunc', ['resetColumn', 'resetCustom']);
|
|
9865
|
-
return this.resetCustom(options);
|
|
9866
|
-
},
|
|
9867
|
-
handleCustom() {
|
|
9868
|
-
const
|
|
9869
|
-
|
|
9870
|
-
|
|
9871
|
-
|
|
9872
|
-
|
|
9873
|
-
|
|
9874
|
-
|
|
9875
|
-
|
|
9876
|
-
|
|
9877
|
-
|
|
9878
|
-
|
|
9879
|
-
|
|
9880
|
-
this.analyColumnWidth();
|
|
9881
|
-
return this.refreshColumn(true);
|
|
9882
|
-
},
|
|
9883
|
-
handleCustomRestore(storeData) {
|
|
9884
|
-
const $xeTable = this;
|
|
9885
|
-
const reactData = $xeTable;
|
|
9886
|
-
const internalData = $xeTable;
|
|
9887
|
-
let {
|
|
9888
|
-
collectColumn
|
|
9889
|
-
} = internalData;
|
|
9890
|
-
const {
|
|
9891
|
-
resizableData,
|
|
9892
|
-
sortData,
|
|
9893
|
-
visibleData,
|
|
9894
|
-
fixedData
|
|
9895
|
-
} = storeData;
|
|
9896
|
-
let hasCustomSort = false;
|
|
9897
|
-
// 处理还原
|
|
9898
|
-
if (resizableData || sortData || visibleData || fixedData) {
|
|
9899
|
-
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(collectColumn, (column, index, items, path, parentRow) => {
|
|
9900
|
-
const colKey = column.getKey();
|
|
9901
|
-
// 支持一级
|
|
9902
|
-
if (!parentRow) {
|
|
9903
|
-
if (fixedData && fixedData[colKey] !== undefined) {
|
|
9904
|
-
column.fixed = fixedData[colKey];
|
|
9905
|
-
}
|
|
9906
|
-
if (sortData && external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(sortData[colKey])) {
|
|
9907
|
-
hasCustomSort = true;
|
|
9908
|
-
column.renderSortNumber = sortData[colKey];
|
|
9909
|
-
}
|
|
9910
|
-
}
|
|
9911
|
-
if (resizableData && external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(resizableData[colKey])) {
|
|
9912
|
-
column.resizeWidth = resizableData[colKey];
|
|
9913
|
-
}
|
|
9914
|
-
if (visibleData && external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(visibleData[colKey])) {
|
|
9915
|
-
column.visible = visibleData[colKey];
|
|
9916
|
-
}
|
|
9917
|
-
});
|
|
9918
|
-
// 如果自定义了顺序
|
|
9919
|
-
if (hasCustomSort) {
|
|
9920
|
-
collectColumn = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().orderBy(collectColumn, 'renderSortNumber');
|
|
9921
|
-
internalData.collectColumn = collectColumn;
|
|
9922
|
-
internalData.tableFullColumn = getColumnList(collectColumn);
|
|
10014
|
+
return this.resetCustom(options);
|
|
10015
|
+
},
|
|
10016
|
+
handleCustom() {
|
|
10017
|
+
const $xeTable = this;
|
|
10018
|
+
const props = $xeTable;
|
|
10019
|
+
const {
|
|
10020
|
+
mouseConfig
|
|
10021
|
+
} = props;
|
|
10022
|
+
if (mouseConfig) {
|
|
10023
|
+
if ($xeTable.clearSelected) {
|
|
10024
|
+
$xeTable.clearSelected();
|
|
10025
|
+
}
|
|
10026
|
+
if ($xeTable.clearCellAreas) {
|
|
10027
|
+
$xeTable.clearCellAreas();
|
|
10028
|
+
$xeTable.clearCopyCellArea();
|
|
9923
10029
|
}
|
|
9924
|
-
reactData.isCustomStatus = true;
|
|
9925
|
-
} else {
|
|
9926
|
-
reactData.isCustomStatus = false;
|
|
9927
10030
|
}
|
|
10031
|
+
$xeTable.analyColumnWidth();
|
|
10032
|
+
return $xeTable.refreshColumn(true);
|
|
9928
10033
|
},
|
|
9929
10034
|
/**
|
|
9930
10035
|
* 还原自定义列操作状态
|
|
9931
10036
|
*/
|
|
9932
10037
|
restoreCustomStorage() {
|
|
10038
|
+
const $xeTable = this;
|
|
10039
|
+
const props = $xeTable;
|
|
9933
10040
|
const {
|
|
9934
|
-
|
|
9935
|
-
|
|
9936
|
-
|
|
9937
|
-
|
|
10041
|
+
customConfig
|
|
10042
|
+
} = props;
|
|
10043
|
+
const tableId = $xeTable.computeTableId;
|
|
10044
|
+
const customOpts = $xeTable.computeCustomOpts;
|
|
9938
10045
|
const {
|
|
9939
10046
|
storage,
|
|
9940
10047
|
restoreStore
|
|
@@ -9960,10 +10067,10 @@ const Methods = {
|
|
|
9960
10067
|
if (!storeData) {
|
|
9961
10068
|
return;
|
|
9962
10069
|
}
|
|
9963
|
-
return
|
|
10070
|
+
return handleCustomRestore($xeTable, storeData);
|
|
9964
10071
|
}).catch(e => e);
|
|
9965
10072
|
} else {
|
|
9966
|
-
return
|
|
10073
|
+
return handleCustomRestore($xeTable, storeData);
|
|
9967
10074
|
}
|
|
9968
10075
|
}
|
|
9969
10076
|
},
|
|
@@ -11473,7 +11580,7 @@ const Methods = {
|
|
|
11473
11580
|
return;
|
|
11474
11581
|
}
|
|
11475
11582
|
if (tooltipStore.column !== column || !tooltipStore.visible) {
|
|
11476
|
-
handleTooltip($xeTable, evnt, thEl, thEl.querySelector('.vxe-cell--title') || cellEl, params);
|
|
11583
|
+
handleTooltip($xeTable, evnt, thEl, thEl.querySelector('.vxe-cell--wrapper'), thEl.querySelector('.vxe-cell--title') || cellEl, params);
|
|
11477
11584
|
}
|
|
11478
11585
|
},
|
|
11479
11586
|
/**
|
|
@@ -11514,7 +11621,7 @@ const Methods = {
|
|
|
11514
11621
|
}
|
|
11515
11622
|
}
|
|
11516
11623
|
if (tooltipStore.column !== column || tooltipStore.row !== row || !tooltipStore.visible) {
|
|
11517
|
-
handleTooltip($xeTable, evnt, tdEl, tdEl.querySelector('.vxe-cell--label') || tdEl.querySelector('.vxe-cell--wrapper'), params);
|
|
11624
|
+
handleTooltip($xeTable, evnt, tdEl, tdEl.querySelector('.vxe-cell--wrapper'), tdEl.querySelector('.vxe-cell--label') || tdEl.querySelector('.vxe-cell--wrapper'), params);
|
|
11518
11625
|
}
|
|
11519
11626
|
},
|
|
11520
11627
|
/**
|
|
@@ -11532,7 +11639,7 @@ const Methods = {
|
|
|
11532
11639
|
const tdEl = evnt.currentTarget;
|
|
11533
11640
|
handleTargetEnterEvent($xeTable, tooltipStore.column !== column || !!tooltipStore.row);
|
|
11534
11641
|
if (tooltipStore.column !== column || !tooltipStore.visible) {
|
|
11535
|
-
handleTooltip($xeTable, evnt, tdEl, tdEl.querySelector('.vxe-cell--label') || tdEl.querySelector('.vxe-cell--wrapper'), params);
|
|
11642
|
+
handleTooltip($xeTable, evnt, tdEl, tdEl.querySelector('.vxe-cell--wrapper'), tdEl.querySelector('.vxe-cell--label') || tdEl.querySelector('.vxe-cell--wrapper'), params);
|
|
11536
11643
|
}
|
|
11537
11644
|
},
|
|
11538
11645
|
openTooltip(target, content) {
|
|
@@ -11621,31 +11728,6 @@ const Methods = {
|
|
|
11621
11728
|
}
|
|
11622
11729
|
return [];
|
|
11623
11730
|
},
|
|
11624
|
-
/**
|
|
11625
|
-
* 处理默认勾选
|
|
11626
|
-
*/
|
|
11627
|
-
handleDefaultSelectionChecked() {
|
|
11628
|
-
const $xeTable = this;
|
|
11629
|
-
const {
|
|
11630
|
-
fullDataRowIdData,
|
|
11631
|
-
checkboxOpts
|
|
11632
|
-
} = this;
|
|
11633
|
-
const {
|
|
11634
|
-
checkAll,
|
|
11635
|
-
checkRowKeys
|
|
11636
|
-
} = checkboxOpts;
|
|
11637
|
-
if (checkAll) {
|
|
11638
|
-
handleCheckedAllCheckboxRow($xeTable, true, true);
|
|
11639
|
-
} else if (checkRowKeys) {
|
|
11640
|
-
const defSelection = [];
|
|
11641
|
-
checkRowKeys.forEach(rowid => {
|
|
11642
|
-
if (fullDataRowIdData[rowid]) {
|
|
11643
|
-
defSelection.push(fullDataRowIdData[rowid].row);
|
|
11644
|
-
}
|
|
11645
|
-
});
|
|
11646
|
-
handleCheckedCheckboxRow($xeTable, defSelection, true, true);
|
|
11647
|
-
}
|
|
11648
|
-
},
|
|
11649
11731
|
handleCheckedCheckboxRow(rows, value, isForce) {
|
|
11650
11732
|
const $xeTable = this;
|
|
11651
11733
|
return handleCheckedCheckboxRow($xeTable, rows, value, isForce);
|
|
@@ -12344,31 +12426,6 @@ const Methods = {
|
|
|
12344
12426
|
reactData.updateCheckboxFlag++;
|
|
12345
12427
|
return this.$nextTick();
|
|
12346
12428
|
},
|
|
12347
|
-
/**
|
|
12348
|
-
* 处理单选框默认勾选
|
|
12349
|
-
*/
|
|
12350
|
-
handleDefaultRadioChecked() {
|
|
12351
|
-
const $xeTable = this;
|
|
12352
|
-
const {
|
|
12353
|
-
radioOpts,
|
|
12354
|
-
fullDataRowIdData
|
|
12355
|
-
} = this;
|
|
12356
|
-
const {
|
|
12357
|
-
checkRowKey: rowid,
|
|
12358
|
-
reserve
|
|
12359
|
-
} = radioOpts;
|
|
12360
|
-
if (rowid) {
|
|
12361
|
-
if (fullDataRowIdData[rowid]) {
|
|
12362
|
-
handleCheckedRadioRow($xeTable, fullDataRowIdData[rowid].row, true);
|
|
12363
|
-
}
|
|
12364
|
-
if (reserve) {
|
|
12365
|
-
const rowkey = getRowkey(this);
|
|
12366
|
-
this.radioReserveRow = {
|
|
12367
|
-
[rowkey]: rowid
|
|
12368
|
-
};
|
|
12369
|
-
}
|
|
12370
|
-
}
|
|
12371
|
-
},
|
|
12372
12429
|
/**
|
|
12373
12430
|
* 单选,行选中事件
|
|
12374
12431
|
*/
|
|
@@ -12831,39 +12888,6 @@ const Methods = {
|
|
|
12831
12888
|
}
|
|
12832
12889
|
this.emitEvent('cell-dblclick', params, evnt);
|
|
12833
12890
|
},
|
|
12834
|
-
handleDefaultSort() {
|
|
12835
|
-
const $xeTable = this;
|
|
12836
|
-
const {
|
|
12837
|
-
sortConfig,
|
|
12838
|
-
sortOpts
|
|
12839
|
-
} = this;
|
|
12840
|
-
let {
|
|
12841
|
-
defaultSort
|
|
12842
|
-
} = sortOpts;
|
|
12843
|
-
if (defaultSort) {
|
|
12844
|
-
if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(defaultSort)) {
|
|
12845
|
-
defaultSort = [defaultSort];
|
|
12846
|
-
}
|
|
12847
|
-
if (defaultSort.length) {
|
|
12848
|
-
(sortConfig.multiple ? defaultSort : defaultSort.slice(0, 1)).forEach((item, index) => {
|
|
12849
|
-
const {
|
|
12850
|
-
field,
|
|
12851
|
-
order
|
|
12852
|
-
} = item;
|
|
12853
|
-
if (field && order) {
|
|
12854
|
-
const column = this.getColumnByField(field);
|
|
12855
|
-
if (column && column.sortable) {
|
|
12856
|
-
column.order = order;
|
|
12857
|
-
column.sortTime = Date.now() + index;
|
|
12858
|
-
}
|
|
12859
|
-
}
|
|
12860
|
-
});
|
|
12861
|
-
if (!sortOpts.remote) {
|
|
12862
|
-
this.handleTableData(true).then(() => updateStyle($xeTable));
|
|
12863
|
-
}
|
|
12864
|
-
}
|
|
12865
|
-
}
|
|
12866
|
-
},
|
|
12867
12891
|
handleColumnSortEvent(evnt, column) {
|
|
12868
12892
|
const $xeTable = this;
|
|
12869
12893
|
const props = $xeTable;
|
|
@@ -14179,30 +14203,6 @@ const Methods = {
|
|
|
14179
14203
|
toggleRowExpand(row) {
|
|
14180
14204
|
return this.setRowExpand(row, !this.isRowExpandByRow(row));
|
|
14181
14205
|
},
|
|
14182
|
-
/**
|
|
14183
|
-
* 处理默认展开行
|
|
14184
|
-
*/
|
|
14185
|
-
handleDefaultRowExpand() {
|
|
14186
|
-
const {
|
|
14187
|
-
expandOpts,
|
|
14188
|
-
fullDataRowIdData
|
|
14189
|
-
} = this;
|
|
14190
|
-
const {
|
|
14191
|
-
expandAll,
|
|
14192
|
-
expandRowKeys
|
|
14193
|
-
} = expandOpts;
|
|
14194
|
-
if (expandAll) {
|
|
14195
|
-
this.setAllRowExpand(true);
|
|
14196
|
-
} else if (expandRowKeys) {
|
|
14197
|
-
const defExpandeds = [];
|
|
14198
|
-
expandRowKeys.forEach(rowid => {
|
|
14199
|
-
if (fullDataRowIdData[rowid]) {
|
|
14200
|
-
defExpandeds.push(fullDataRowIdData[rowid].row);
|
|
14201
|
-
}
|
|
14202
|
-
});
|
|
14203
|
-
this.setRowExpand(defExpandeds, true);
|
|
14204
|
-
}
|
|
14205
|
-
},
|
|
14206
14206
|
/**
|
|
14207
14207
|
* 设置所有行的展开与否
|
|
14208
14208
|
* @param {Boolean} expanded 是否展开
|
|
@@ -14891,8 +14891,8 @@ const Methods = {
|
|
|
14891
14891
|
*/
|
|
14892
14892
|
triggerScrollXEvent() {
|
|
14893
14893
|
const $xeTable = this;
|
|
14894
|
-
const
|
|
14895
|
-
if (
|
|
14894
|
+
const virtualXOpts = $xeTable.computeVirtualXOpts;
|
|
14895
|
+
if (virtualXOpts.immediate) {
|
|
14896
14896
|
loadScrollXData($xeTable);
|
|
14897
14897
|
} else {
|
|
14898
14898
|
lazyScrollXData($xeTable);
|
|
@@ -14903,8 +14903,8 @@ const Methods = {
|
|
|
14903
14903
|
*/
|
|
14904
14904
|
triggerScrollYEvent() {
|
|
14905
14905
|
const $xeTable = this;
|
|
14906
|
-
const
|
|
14907
|
-
if (
|
|
14906
|
+
const virtualYOpts = $xeTable.computeVirtualYOpts;
|
|
14907
|
+
if (virtualYOpts.immediate) {
|
|
14908
14908
|
loadScrollYData($xeTable);
|
|
14909
14909
|
} else {
|
|
14910
14910
|
lazyScrollYData($xeTable);
|
|
@@ -15155,8 +15155,8 @@ const Methods = {
|
|
|
15155
15155
|
return;
|
|
15156
15156
|
}
|
|
15157
15157
|
const wheelSpeed = getWheelSpeed(reactData.lastScrollTime);
|
|
15158
|
-
const deltaTop =
|
|
15159
|
-
const deltaLeft = Math.ceil((shiftKey ? deltaY : deltaX) * wheelSpeed);
|
|
15158
|
+
const deltaTop = shiftKey ? 0 : Math.ceil(deltaY * wheelSpeed);
|
|
15159
|
+
const deltaLeft = Math.ceil((shiftKey ? deltaY || deltaX : deltaX) * wheelSpeed);
|
|
15160
15160
|
const isTopWheel = deltaTop < 0;
|
|
15161
15161
|
const currScrollTop = bodyScrollElem.scrollTop;
|
|
15162
15162
|
// 如果滚动位置已经是顶部或底部,则不需要触发
|
|
@@ -15729,9 +15729,6 @@ const Methods = {
|
|
|
15729
15729
|
}
|
|
15730
15730
|
});
|
|
15731
15731
|
},
|
|
15732
|
-
handleDefaultMergeCells() {
|
|
15733
|
-
this.setMergeCells(this.mergeCells);
|
|
15734
|
-
},
|
|
15735
15732
|
/**
|
|
15736
15733
|
* 设置合并单元格
|
|
15737
15734
|
* @param {TableMergeConfig[]} merges { row: Row|number, column: ColumnInfo|number, rowspan: number, colspan: number }
|
|
@@ -15779,9 +15776,6 @@ const Methods = {
|
|
|
15779
15776
|
return updateStyle($xeTable);
|
|
15780
15777
|
});
|
|
15781
15778
|
},
|
|
15782
|
-
handleDefaultMergeFooterItems() {
|
|
15783
|
-
this.setMergeFooterItems(this.mergeFooterItems);
|
|
15784
|
-
},
|
|
15785
15779
|
setMergeFooterItems(merges) {
|
|
15786
15780
|
const $xeTable = this;
|
|
15787
15781
|
if (this.footerSpanMethod) {
|
|
@@ -16446,9 +16440,12 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
|
|
|
16446
16440
|
} = createHandleGetRowId($xeTable);
|
|
16447
16441
|
tableData.forEach((row, $rowIndex) => {
|
|
16448
16442
|
const trOn = {};
|
|
16443
|
+
const rowid = handleGetRowId(row);
|
|
16444
|
+
const rowRest = fullAllDataRowIdData[rowid] || {};
|
|
16449
16445
|
let rowIndex = $rowIndex;
|
|
16450
|
-
|
|
16451
|
-
|
|
16446
|
+
let rowLevel = 0;
|
|
16447
|
+
let seq = -1;
|
|
16448
|
+
let _rowIndex = -1;
|
|
16452
16449
|
// 当前行事件
|
|
16453
16450
|
if (rowOpts.isHover || highlightHoverRow) {
|
|
16454
16451
|
trOn.mouseenter = evnt => {
|
|
@@ -16467,11 +16464,6 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
|
|
|
16467
16464
|
$xeTable.clearHoverRow();
|
|
16468
16465
|
};
|
|
16469
16466
|
}
|
|
16470
|
-
const rowid = handleGetRowId(row);
|
|
16471
|
-
const rowRest = fullAllDataRowIdData[rowid] || {};
|
|
16472
|
-
let rowLevel = 0;
|
|
16473
|
-
let seq = -1;
|
|
16474
|
-
let _rowIndex = 0;
|
|
16475
16467
|
if (rowRest) {
|
|
16476
16468
|
rowLevel = rowRest.level;
|
|
16477
16469
|
if (treeConfig && transform && seqMode === 'increasing') {
|
|
@@ -16479,6 +16471,7 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
|
|
|
16479
16471
|
} else {
|
|
16480
16472
|
seq = rowRest.seq;
|
|
16481
16473
|
}
|
|
16474
|
+
rowIndex = rowRest.index;
|
|
16482
16475
|
_rowIndex = rowRest._index;
|
|
16483
16476
|
}
|
|
16484
16477
|
const params = {
|
|
@@ -21127,6 +21120,7 @@ const {
|
|
|
21127
21120
|
renderer: edit_mixin_renderer,
|
|
21128
21121
|
getI18n: mixin_getI18n
|
|
21129
21122
|
} = core_.VxeUI;
|
|
21123
|
+
const mixin_browseObj = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().browse();
|
|
21130
21124
|
function getEditColumnModel(row, column) {
|
|
21131
21125
|
const {
|
|
21132
21126
|
model,
|
|
@@ -21179,14 +21173,15 @@ function syncActivedCell($xeTable) {
|
|
|
21179
21173
|
}
|
|
21180
21174
|
}
|
|
21181
21175
|
}
|
|
21182
|
-
function insertTreeRow(
|
|
21176
|
+
function insertTreeRow($xeTable, newRecords, isAppend) {
|
|
21177
|
+
const internalData = $xeTable;
|
|
21183
21178
|
const {
|
|
21184
21179
|
tableFullTreeData,
|
|
21185
21180
|
afterFullData,
|
|
21186
21181
|
fullDataRowIdData,
|
|
21187
|
-
fullAllDataRowIdData
|
|
21188
|
-
|
|
21189
|
-
|
|
21182
|
+
fullAllDataRowIdData
|
|
21183
|
+
} = internalData;
|
|
21184
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
21190
21185
|
const {
|
|
21191
21186
|
rowField,
|
|
21192
21187
|
parentField,
|
|
@@ -21196,7 +21191,7 @@ function insertTreeRow(_vm, newRecords, isAppend) {
|
|
|
21196
21191
|
const funcName = isAppend ? 'push' : 'unshift';
|
|
21197
21192
|
newRecords.forEach(item => {
|
|
21198
21193
|
const parentRowId = item[parentField];
|
|
21199
|
-
const rowid = getRowid(
|
|
21194
|
+
const rowid = getRowid($xeTable, item);
|
|
21200
21195
|
const matchObj = parentRowId ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findTree(tableFullTreeData, item => parentRowId === item[rowField], {
|
|
21201
21196
|
children: mapChildrenField
|
|
21202
21197
|
}) : null;
|
|
@@ -21204,7 +21199,7 @@ function insertTreeRow(_vm, newRecords, isAppend) {
|
|
|
21204
21199
|
const {
|
|
21205
21200
|
item: parentRow
|
|
21206
21201
|
} = matchObj;
|
|
21207
|
-
const parentRest = fullAllDataRowIdData[getRowid(
|
|
21202
|
+
const parentRest = fullAllDataRowIdData[getRowid($xeTable, parentRow)];
|
|
21208
21203
|
const parentLevel = parentRest ? parentRest.level : 0;
|
|
21209
21204
|
let parentChilds = parentRow[childrenField];
|
|
21210
21205
|
let mapChilds = parentRow[mapChildrenField];
|
|
@@ -21271,15 +21266,15 @@ function handleInsertRowAt($xeTable, records, targetRow, isInsertNextRow) {
|
|
|
21271
21266
|
treeConfig
|
|
21272
21267
|
} = props;
|
|
21273
21268
|
const {
|
|
21274
|
-
mergeList
|
|
21275
|
-
editStore
|
|
21269
|
+
mergeList
|
|
21276
21270
|
} = reactData;
|
|
21277
21271
|
const {
|
|
21278
21272
|
tableFullTreeData,
|
|
21279
21273
|
afterFullData,
|
|
21280
21274
|
tableFullData,
|
|
21281
21275
|
fullDataRowIdData,
|
|
21282
|
-
fullAllDataRowIdData
|
|
21276
|
+
fullAllDataRowIdData,
|
|
21277
|
+
insertRowMaps
|
|
21283
21278
|
} = internalData;
|
|
21284
21279
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
21285
21280
|
const {
|
|
@@ -21484,13 +21479,11 @@ function handleInsertRowAt($xeTable, records, targetRow, isInsertNextRow) {
|
|
|
21484
21479
|
}
|
|
21485
21480
|
}
|
|
21486
21481
|
}
|
|
21487
|
-
const {
|
|
21488
|
-
insertMaps
|
|
21489
|
-
} = editStore;
|
|
21490
21482
|
newRecords.forEach(newRow => {
|
|
21491
21483
|
const rowid = getRowid($xeTable, newRow);
|
|
21492
|
-
|
|
21484
|
+
insertRowMaps[rowid] = newRow;
|
|
21493
21485
|
});
|
|
21486
|
+
reactData.insertRowFlag++;
|
|
21494
21487
|
$xeTable.cacheRowMap(false);
|
|
21495
21488
|
$xeTable.updateScrollYStatus();
|
|
21496
21489
|
$xeTable.handleTableData(treeConfig && transform);
|
|
@@ -21499,7 +21492,7 @@ function handleInsertRowAt($xeTable, records, targetRow, isInsertNextRow) {
|
|
|
21499
21492
|
}
|
|
21500
21493
|
$xeTable.updateFooter();
|
|
21501
21494
|
$xeTable.checkSelectionStatus();
|
|
21502
|
-
if (
|
|
21495
|
+
if (reactData.scrollYLoad) {
|
|
21503
21496
|
$xeTable.updateScrollYSpace();
|
|
21504
21497
|
}
|
|
21505
21498
|
return $xeTable.$nextTick().then(() => {
|
|
@@ -21797,7 +21790,9 @@ function handleEditCell($xeTable, row, fieldOrColumn, isPos) {
|
|
|
21797
21790
|
selectCheckboxMaps,
|
|
21798
21791
|
afterFullData,
|
|
21799
21792
|
tableFullData,
|
|
21800
|
-
pendingRowMaps
|
|
21793
|
+
pendingRowMaps,
|
|
21794
|
+
insertRowMaps,
|
|
21795
|
+
removeRowMaps
|
|
21801
21796
|
} = internalData;
|
|
21802
21797
|
const checkboxOpts = $xeTable.computeCheckboxOpts;
|
|
21803
21798
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
@@ -21807,10 +21802,8 @@ function handleEditCell($xeTable, row, fieldOrColumn, isPos) {
|
|
|
21807
21802
|
} = treeOpts;
|
|
21808
21803
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
21809
21804
|
const {
|
|
21810
|
-
actived
|
|
21811
|
-
removeMaps
|
|
21805
|
+
actived
|
|
21812
21806
|
} = editStore;
|
|
21813
|
-
const insertDataRowMaps = Object.assign({}, editStore.insertMaps);
|
|
21814
21807
|
const {
|
|
21815
21808
|
checkField
|
|
21816
21809
|
} = checkboxOpts;
|
|
@@ -21824,7 +21817,7 @@ function handleEditCell($xeTable, row, fieldOrColumn, isPos) {
|
|
|
21824
21817
|
rows.forEach(row => {
|
|
21825
21818
|
if (!$xeTable.isInsertByRow(row)) {
|
|
21826
21819
|
const rowid = getRowid($xeTable, row);
|
|
21827
|
-
|
|
21820
|
+
removeRowMaps[rowid] = row;
|
|
21828
21821
|
}
|
|
21829
21822
|
});
|
|
21830
21823
|
// 如果绑定了多选属性,则更新状态
|
|
@@ -21899,14 +21892,15 @@ function handleEditCell($xeTable, row, fieldOrColumn, isPos) {
|
|
|
21899
21892
|
// 从新增中移除已删除的数据
|
|
21900
21893
|
rows.forEach(row => {
|
|
21901
21894
|
const rowid = getRowid($xeTable, row);
|
|
21902
|
-
if (
|
|
21903
|
-
delete
|
|
21895
|
+
if (insertRowMaps[rowid]) {
|
|
21896
|
+
delete insertRowMaps[rowid];
|
|
21904
21897
|
}
|
|
21905
21898
|
if (pendingRowMaps[rowid]) {
|
|
21906
21899
|
delete pendingRowMaps[rowid];
|
|
21907
21900
|
}
|
|
21908
21901
|
});
|
|
21909
|
-
|
|
21902
|
+
reactData.removeRowFlag++;
|
|
21903
|
+
reactData.insertRowFlag++;
|
|
21910
21904
|
reactData.pendingRowFlag++;
|
|
21911
21905
|
$xeTable.updateFooter();
|
|
21912
21906
|
$xeTable.cacheRowMap(false);
|
|
@@ -21980,19 +21974,13 @@ function handleEditCell($xeTable, row, fieldOrColumn, isPos) {
|
|
|
21980
21974
|
*/
|
|
21981
21975
|
_getInsertRecords() {
|
|
21982
21976
|
const $xeTable = this;
|
|
21983
|
-
const reactData = $xeTable;
|
|
21984
21977
|
const internalData = $xeTable;
|
|
21985
21978
|
const {
|
|
21986
|
-
|
|
21987
|
-
|
|
21988
|
-
const {
|
|
21989
|
-
fullAllDataRowIdData
|
|
21979
|
+
fullAllDataRowIdData,
|
|
21980
|
+
insertRowMaps
|
|
21990
21981
|
} = internalData;
|
|
21991
|
-
const {
|
|
21992
|
-
insertMaps
|
|
21993
|
-
} = editStore;
|
|
21994
21982
|
const insertRecords = [];
|
|
21995
|
-
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(
|
|
21983
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(insertRowMaps, (row, rowid) => {
|
|
21996
21984
|
if (fullAllDataRowIdData[rowid]) {
|
|
21997
21985
|
insertRecords.push(row);
|
|
21998
21986
|
}
|
|
@@ -22004,15 +21992,12 @@ function handleEditCell($xeTable, row, fieldOrColumn, isPos) {
|
|
|
22004
21992
|
*/
|
|
22005
21993
|
_getRemoveRecords() {
|
|
22006
21994
|
const $xeTable = this;
|
|
22007
|
-
const
|
|
22008
|
-
const {
|
|
22009
|
-
editStore
|
|
22010
|
-
} = reactData;
|
|
21995
|
+
const internalData = $xeTable;
|
|
22011
21996
|
const {
|
|
22012
|
-
|
|
22013
|
-
} =
|
|
21997
|
+
removeRowMaps
|
|
21998
|
+
} = internalData;
|
|
22014
21999
|
const removeRecords = [];
|
|
22015
|
-
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(
|
|
22000
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(removeRowMaps, row => {
|
|
22016
22001
|
removeRecords.push(row);
|
|
22017
22002
|
});
|
|
22018
22003
|
return removeRecords;
|
|
@@ -22024,29 +22009,22 @@ function handleEditCell($xeTable, row, fieldOrColumn, isPos) {
|
|
|
22024
22009
|
*/
|
|
22025
22010
|
_getUpdateRecords() {
|
|
22026
22011
|
const $xeTable = this;
|
|
22012
|
+
const props = $xeTable;
|
|
22013
|
+
const internalData = $xeTable;
|
|
22027
22014
|
const {
|
|
22028
22015
|
keepSource,
|
|
22029
|
-
|
|
22030
|
-
|
|
22031
|
-
|
|
22032
|
-
|
|
22033
|
-
|
|
22034
|
-
|
|
22016
|
+
treeConfig
|
|
22017
|
+
} = props;
|
|
22018
|
+
const {
|
|
22019
|
+
tableFullData
|
|
22020
|
+
} = internalData;
|
|
22021
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
22035
22022
|
if (keepSource) {
|
|
22036
|
-
|
|
22037
|
-
actived
|
|
22038
|
-
} = editStore;
|
|
22039
|
-
const {
|
|
22040
|
-
row,
|
|
22041
|
-
column
|
|
22042
|
-
} = actived;
|
|
22043
|
-
if (row || column) {
|
|
22044
|
-
syncActivedCell($xeTable);
|
|
22045
|
-
}
|
|
22023
|
+
syncActivedCell($xeTable);
|
|
22046
22024
|
if (treeConfig) {
|
|
22047
|
-
return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().filterTree(tableFullData, row => isUpdateByRow(row), treeOpts);
|
|
22025
|
+
return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().filterTree(tableFullData, row => $xeTable.isUpdateByRow(row), treeOpts);
|
|
22048
22026
|
}
|
|
22049
|
-
return tableFullData.filter(row => isUpdateByRow(row));
|
|
22027
|
+
return tableFullData.filter(row => $xeTable.isUpdateByRow(row));
|
|
22050
22028
|
}
|
|
22051
22029
|
return [];
|
|
22052
22030
|
},
|
|
@@ -22095,51 +22073,58 @@ function handleEditCell($xeTable, row, fieldOrColumn, isPos) {
|
|
|
22095
22073
|
return handleClearEdit($xeTable, evnt, targetRow);
|
|
22096
22074
|
},
|
|
22097
22075
|
_getActiveRecord() {
|
|
22076
|
+
const $xeTable = this;
|
|
22098
22077
|
if (true) {
|
|
22099
22078
|
warnLog('vxe.error.delFunc', ['getActiveRecord', 'getEditRecord']);
|
|
22100
22079
|
}
|
|
22101
22080
|
// 即将废弃
|
|
22102
|
-
return
|
|
22081
|
+
return $xeTable.getEditRecord();
|
|
22103
22082
|
},
|
|
22104
22083
|
_getEditRecord() {
|
|
22084
|
+
const $xeTable = this;
|
|
22085
|
+
const reactData = $xeTable;
|
|
22086
|
+
const internalData = $xeTable;
|
|
22105
22087
|
const {
|
|
22106
|
-
|
|
22107
|
-
|
|
22108
|
-
afterFullData
|
|
22109
|
-
} = this;
|
|
22088
|
+
editStore
|
|
22089
|
+
} = reactData;
|
|
22110
22090
|
const {
|
|
22111
|
-
|
|
22112
|
-
} =
|
|
22091
|
+
afterFullData
|
|
22092
|
+
} = internalData;
|
|
22093
|
+
const el = $xeTable.$refs.refElem;
|
|
22113
22094
|
const {
|
|
22114
22095
|
args,
|
|
22115
22096
|
row
|
|
22116
|
-
} = actived;
|
|
22117
|
-
if (args &&
|
|
22097
|
+
} = editStore.actived;
|
|
22098
|
+
if (args && $xeTable.findRowIndexOf(afterFullData, row) > -1 && el.querySelectorAll('.vxe-body--column.col--active').length) {
|
|
22118
22099
|
return Object.assign({}, args);
|
|
22119
22100
|
}
|
|
22120
22101
|
return null;
|
|
22121
22102
|
},
|
|
22122
22103
|
_isActiveByRow(row) {
|
|
22104
|
+
const $xeTable = this;
|
|
22123
22105
|
if (true) {
|
|
22124
22106
|
warnLog('vxe.error.delFunc', ['isActiveByRow', 'isEditByRow']);
|
|
22125
22107
|
}
|
|
22126
22108
|
// 即将废弃
|
|
22127
|
-
return
|
|
22109
|
+
return $xeTable.isEditByRow(row);
|
|
22128
22110
|
},
|
|
22129
22111
|
/**
|
|
22130
22112
|
* 判断行是否为激活编辑状态
|
|
22131
22113
|
* @param {Row} row 行对象
|
|
22132
22114
|
*/
|
|
22133
22115
|
_isEditByRow(row) {
|
|
22134
|
-
|
|
22116
|
+
const $xeTable = this;
|
|
22117
|
+
const reactData = $xeTable;
|
|
22118
|
+
const {
|
|
22119
|
+
editStore
|
|
22120
|
+
} = reactData;
|
|
22121
|
+
return editStore.actived.row === row;
|
|
22135
22122
|
},
|
|
22136
22123
|
/**
|
|
22137
22124
|
* 处理聚焦
|
|
22138
22125
|
*/
|
|
22139
22126
|
handleFocus(params) {
|
|
22140
|
-
const
|
|
22141
|
-
editOpts
|
|
22142
|
-
} = this;
|
|
22127
|
+
const $xeTable = this;
|
|
22143
22128
|
const {
|
|
22144
22129
|
row,
|
|
22145
22130
|
column,
|
|
@@ -22148,6 +22133,7 @@ function handleEditCell($xeTable, row, fieldOrColumn, isPos) {
|
|
|
22148
22133
|
const {
|
|
22149
22134
|
editRender
|
|
22150
22135
|
} = column;
|
|
22136
|
+
const editOpts = $xeTable.computeEditOpts;
|
|
22151
22137
|
if (isEnableConf(editRender)) {
|
|
22152
22138
|
const compRender = edit_mixin_renderer.get(editRender.name);
|
|
22153
22139
|
let autoFocus = editRender.autofocus || editRender.autoFocus;
|
|
@@ -22163,7 +22149,7 @@ function handleEditCell($xeTable, row, fieldOrColumn, isPos) {
|
|
|
22163
22149
|
}
|
|
22164
22150
|
// 如果指定了聚焦 class
|
|
22165
22151
|
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(autoFocus)) {
|
|
22166
|
-
inputElem = autoFocus.call(
|
|
22152
|
+
inputElem = autoFocus.call($xeTable, params);
|
|
22167
22153
|
} else if (autoFocus) {
|
|
22168
22154
|
if (autoFocus === true) {
|
|
22169
22155
|
// 自动匹配模式,会自动匹配第一个可输入元素
|
|
@@ -22181,7 +22167,7 @@ function handleEditCell($xeTable, row, fieldOrColumn, isPos) {
|
|
|
22181
22167
|
inputElem.select();
|
|
22182
22168
|
} else {
|
|
22183
22169
|
// 保持一致行为,光标移到末端
|
|
22184
|
-
if (
|
|
22170
|
+
if (mixin_browseObj.msie) {
|
|
22185
22171
|
const textRange = inputElem.createTextRange();
|
|
22186
22172
|
textRange.collapse(false);
|
|
22187
22173
|
textRange.select();
|
|
@@ -22192,18 +22178,19 @@ function handleEditCell($xeTable, row, fieldOrColumn, isPos) {
|
|
|
22192
22178
|
if (editOpts.autoPos) {
|
|
22193
22179
|
if (!column.fixed) {
|
|
22194
22180
|
// 显示到可视区中
|
|
22195
|
-
|
|
22181
|
+
$xeTable.scrollToRow(row, column);
|
|
22196
22182
|
}
|
|
22197
22183
|
}
|
|
22198
22184
|
}
|
|
22199
22185
|
}
|
|
22200
22186
|
},
|
|
22201
22187
|
_setActiveRow(row) {
|
|
22188
|
+
const $xeTable = this;
|
|
22202
22189
|
if (true) {
|
|
22203
22190
|
warnLog('vxe.error.delFunc', ['setActiveRow', 'setEditRow']);
|
|
22204
22191
|
}
|
|
22205
22192
|
// 即将废弃
|
|
22206
|
-
return
|
|
22193
|
+
return $xeTable.setEditRow(row);
|
|
22207
22194
|
},
|
|
22208
22195
|
/**
|
|
22209
22196
|
* 激活行编辑
|
|
@@ -22215,7 +22202,7 @@ function handleEditCell($xeTable, row, fieldOrColumn, isPos) {
|
|
|
22215
22202
|
if (fieldOrColumn) {
|
|
22216
22203
|
isPos = true;
|
|
22217
22204
|
if (fieldOrColumn !== true) {
|
|
22218
|
-
column = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(fieldOrColumn) ?
|
|
22205
|
+
column = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(fieldOrColumn) ? $xeTable.getColumnByField(fieldOrColumn) : fieldOrColumn;
|
|
22219
22206
|
}
|
|
22220
22207
|
}
|
|
22221
22208
|
return handleEditCell($xeTable, row, column, isPos);
|
|
@@ -22238,39 +22225,44 @@ function handleEditCell($xeTable, row, fieldOrColumn, isPos) {
|
|
|
22238
22225
|
* 只对 trigger=dblclick 有效,选中单元格
|
|
22239
22226
|
*/
|
|
22240
22227
|
_setSelectCell(row, fieldOrColumn) {
|
|
22228
|
+
const $xeTable = this;
|
|
22229
|
+
const reactData = $xeTable;
|
|
22241
22230
|
const {
|
|
22242
|
-
tableData
|
|
22243
|
-
|
|
22244
|
-
|
|
22245
|
-
|
|
22246
|
-
const column = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(fieldOrColumn) ? this.getColumnByField(fieldOrColumn) : fieldOrColumn;
|
|
22231
|
+
tableData
|
|
22232
|
+
} = reactData;
|
|
22233
|
+
const editOpts = $xeTable.computeEditOpts;
|
|
22234
|
+
const column = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(fieldOrColumn) ? $xeTable.getColumnByField(fieldOrColumn) : fieldOrColumn;
|
|
22247
22235
|
if (row && column && editOpts.trigger !== 'manual') {
|
|
22248
|
-
const rowIndex =
|
|
22236
|
+
const rowIndex = $xeTable.findRowIndexOf(tableData, row);
|
|
22249
22237
|
if (rowIndex > -1) {
|
|
22250
|
-
const cell =
|
|
22238
|
+
const cell = $xeTable.getCellElement(row, column);
|
|
22251
22239
|
const params = {
|
|
22252
22240
|
row,
|
|
22253
22241
|
rowIndex,
|
|
22254
22242
|
column,
|
|
22255
|
-
columnIndex:
|
|
22243
|
+
columnIndex: $xeTable.getColumnIndex(column),
|
|
22256
22244
|
cell
|
|
22257
22245
|
};
|
|
22258
|
-
|
|
22246
|
+
$xeTable.handleSelected(params, {});
|
|
22259
22247
|
}
|
|
22260
22248
|
}
|
|
22261
|
-
return
|
|
22249
|
+
return $xeTable.$nextTick();
|
|
22262
22250
|
},
|
|
22263
22251
|
/**
|
|
22264
22252
|
* 处理选中源
|
|
22265
22253
|
*/
|
|
22266
22254
|
handleSelected(params, evnt) {
|
|
22267
22255
|
const $xeTable = this;
|
|
22256
|
+
const props = $xeTable;
|
|
22257
|
+
const reactData = $xeTable;
|
|
22258
|
+
const {
|
|
22259
|
+
mouseConfig
|
|
22260
|
+
} = props;
|
|
22268
22261
|
const {
|
|
22269
|
-
mouseConfig,
|
|
22270
|
-
mouseOpts,
|
|
22271
|
-
editOpts,
|
|
22272
22262
|
editStore
|
|
22273
|
-
} =
|
|
22263
|
+
} = reactData;
|
|
22264
|
+
const mouseOpts = $xeTable.computeMouseOpts;
|
|
22265
|
+
const editOpts = $xeTable.computeEditOpts;
|
|
22274
22266
|
const {
|
|
22275
22267
|
actived,
|
|
22276
22268
|
selected
|
|
@@ -22284,22 +22276,24 @@ function handleEditCell($xeTable, row, fieldOrColumn, isPos) {
|
|
|
22284
22276
|
if (isMouseSelected && (selected.row !== row || selected.column !== column)) {
|
|
22285
22277
|
if (actived.row !== row || (editOpts.mode === 'cell' ? actived.column !== column : false)) {
|
|
22286
22278
|
handleClearEdit($xeTable, evnt);
|
|
22287
|
-
|
|
22288
|
-
|
|
22289
|
-
|
|
22279
|
+
$xeTable.clearSelected();
|
|
22280
|
+
if ($xeTable.clearCellAreas) {
|
|
22281
|
+
$xeTable.clearCellAreas();
|
|
22282
|
+
$xeTable.clearCopyCellArea();
|
|
22283
|
+
}
|
|
22290
22284
|
selected.args = params;
|
|
22291
22285
|
selected.row = row;
|
|
22292
22286
|
selected.column = column;
|
|
22293
22287
|
if (isMouseSelected) {
|
|
22294
22288
|
this.addCellSelectedClass();
|
|
22295
22289
|
}
|
|
22296
|
-
|
|
22290
|
+
$xeTable.focus();
|
|
22297
22291
|
if (evnt) {
|
|
22298
|
-
|
|
22292
|
+
$xeTable.dispatchEvent('cell-selected', params, evnt);
|
|
22299
22293
|
}
|
|
22300
22294
|
}
|
|
22301
22295
|
}
|
|
22302
|
-
return
|
|
22296
|
+
return $xeTable.$nextTick();
|
|
22303
22297
|
};
|
|
22304
22298
|
return selectMethod();
|
|
22305
22299
|
},
|
|
@@ -22307,10 +22301,15 @@ function handleEditCell($xeTable, row, fieldOrColumn, isPos) {
|
|
|
22307
22301
|
* 获取选中的单元格
|
|
22308
22302
|
*/
|
|
22309
22303
|
_getSelectedCell() {
|
|
22304
|
+
const $xeTable = this;
|
|
22305
|
+
const reactData = $xeTable;
|
|
22306
|
+
const {
|
|
22307
|
+
editStore
|
|
22308
|
+
} = reactData;
|
|
22310
22309
|
const {
|
|
22311
22310
|
args,
|
|
22312
22311
|
column
|
|
22313
|
-
} =
|
|
22312
|
+
} = editStore.selected;
|
|
22314
22313
|
if (args && column) {
|
|
22315
22314
|
return Object.assign({}, args);
|
|
22316
22315
|
}
|
|
@@ -22321,14 +22320,17 @@ function handleEditCell($xeTable, row, fieldOrColumn, isPos) {
|
|
|
22321
22320
|
*/
|
|
22322
22321
|
_clearSelected() {
|
|
22323
22322
|
const $xeTable = this;
|
|
22323
|
+
const reactData = $xeTable;
|
|
22324
|
+
const {
|
|
22325
|
+
editStore
|
|
22326
|
+
} = reactData;
|
|
22324
22327
|
const {
|
|
22325
22328
|
selected
|
|
22326
|
-
} =
|
|
22329
|
+
} = editStore;
|
|
22327
22330
|
selected.row = null;
|
|
22328
22331
|
selected.column = null;
|
|
22329
|
-
this.reColTitleSdCls();
|
|
22330
22332
|
removeCellSelectedClass($xeTable);
|
|
22331
|
-
return
|
|
22333
|
+
return $xeTable.$nextTick();
|
|
22332
22334
|
},
|
|
22333
22335
|
reColTitleSdCls() {
|
|
22334
22336
|
const headerElem = this.elemStore['main-header-list'];
|
|
@@ -24295,10 +24297,11 @@ const convertToRows = originColumns => {
|
|
|
24295
24297
|
|
|
24296
24298
|
|
|
24297
24299
|
|
|
24300
|
+
const keyboard_mixin_browseObj = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().browse();
|
|
24298
24301
|
function getTargetOffset(target, container) {
|
|
24299
24302
|
let offsetTop = 0;
|
|
24300
24303
|
let offsetLeft = 0;
|
|
24301
|
-
const triggerCheckboxLabel = !
|
|
24304
|
+
const triggerCheckboxLabel = !keyboard_mixin_browseObj.firefox && hasClass(target, 'vxe-checkbox--label');
|
|
24302
24305
|
if (triggerCheckboxLabel) {
|
|
24303
24306
|
const checkboxLabelStyle = getComputedStyle(target);
|
|
24304
24307
|
offsetTop -= external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(checkboxLabelStyle.paddingTop);
|
|
@@ -25048,23 +25051,17 @@ function validErrorRuleValue(rule, val) {
|
|
|
25048
25051
|
beginValidate(rows, cols, cb, isFull) {
|
|
25049
25052
|
const $xeTable = this;
|
|
25050
25053
|
const props = $xeTable;
|
|
25051
|
-
const reactData = $xeTable;
|
|
25052
25054
|
const internalData = $xeTable;
|
|
25053
25055
|
const validRest = {};
|
|
25054
25056
|
const {
|
|
25055
25057
|
editRules,
|
|
25056
25058
|
treeConfig
|
|
25057
25059
|
} = props;
|
|
25058
|
-
const {
|
|
25059
|
-
editStore
|
|
25060
|
-
} = reactData;
|
|
25061
25060
|
const {
|
|
25062
25061
|
afterFullData,
|
|
25063
|
-
pendingRowMaps
|
|
25062
|
+
pendingRowMaps,
|
|
25063
|
+
removeRowMaps
|
|
25064
25064
|
} = internalData;
|
|
25065
|
-
const {
|
|
25066
|
-
removeMaps
|
|
25067
|
-
} = editStore;
|
|
25068
25065
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
25069
25066
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
25070
25067
|
let validList;
|
|
@@ -25090,7 +25087,7 @@ function validErrorRuleValue(rule, val) {
|
|
|
25090
25087
|
const handleVaild = row => {
|
|
25091
25088
|
const rowid = getRowid($xeTable, row);
|
|
25092
25089
|
// 是否删除
|
|
25093
|
-
if (
|
|
25090
|
+
if (removeRowMaps[rowid]) {
|
|
25094
25091
|
return;
|
|
25095
25092
|
}
|
|
25096
25093
|
// 是否标记删除
|
|
@@ -26347,9 +26344,7 @@ function renderBody(h, $xeTable) {
|
|
|
26347
26344
|
focused: {
|
|
26348
26345
|
row: null,
|
|
26349
26346
|
column: null
|
|
26350
|
-
}
|
|
26351
|
-
insertMaps: {},
|
|
26352
|
-
removeMaps: {}
|
|
26347
|
+
}
|
|
26353
26348
|
},
|
|
26354
26349
|
// 存放 tooltip 相关信息
|
|
26355
26350
|
tooltipStore: {
|
|
@@ -26469,24 +26464,24 @@ function renderBody(h, $xeTable) {
|
|
|
26469
26464
|
}, table_getConfig().table.validConfig, this.validConfig);
|
|
26470
26465
|
},
|
|
26471
26466
|
sXOpts() {
|
|
26472
|
-
return this.
|
|
26467
|
+
return this.computeVirtualXOpts;
|
|
26473
26468
|
},
|
|
26474
26469
|
computeSXOpts() {
|
|
26475
26470
|
return this.computeVirtualXOpts;
|
|
26476
26471
|
},
|
|
26477
26472
|
computeScrollXThreshold() {
|
|
26478
26473
|
const $xeTable = this;
|
|
26479
|
-
const
|
|
26474
|
+
const virtualXOpts = $xeTable.computeVirtualXOpts;
|
|
26480
26475
|
const {
|
|
26481
26476
|
threshold
|
|
26482
|
-
} =
|
|
26477
|
+
} = virtualXOpts;
|
|
26483
26478
|
if (threshold) {
|
|
26484
26479
|
return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(threshold);
|
|
26485
26480
|
}
|
|
26486
26481
|
return 0;
|
|
26487
26482
|
},
|
|
26488
26483
|
sYOpts() {
|
|
26489
|
-
return this.
|
|
26484
|
+
return this.computeVirtualYOpts;
|
|
26490
26485
|
},
|
|
26491
26486
|
computeSYOpts() {
|
|
26492
26487
|
return this.computeVirtualYOpts;
|
|
@@ -26518,10 +26513,10 @@ function renderBody(h, $xeTable) {
|
|
|
26518
26513
|
},
|
|
26519
26514
|
computeScrollYThreshold() {
|
|
26520
26515
|
const $xeTable = this;
|
|
26521
|
-
const
|
|
26516
|
+
const virtualYOpts = $xeTable.computeVirtualYOpts;
|
|
26522
26517
|
const {
|
|
26523
26518
|
threshold
|
|
26524
|
-
} =
|
|
26519
|
+
} = virtualYOpts;
|
|
26525
26520
|
if (threshold) {
|
|
26526
26521
|
return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(threshold);
|
|
26527
26522
|
}
|
|
@@ -27001,6 +26996,9 @@ function renderBody(h, $xeTable) {
|
|
|
27001
26996
|
const $xeTable = this;
|
|
27002
26997
|
const $xeTabs = $xeTable.$xeTabs;
|
|
27003
26998
|
return $xeTabs ? $xeTabs.reactData.resizeFlag : null;
|
|
26999
|
+
},
|
|
27000
|
+
computeVxeLanguage() {
|
|
27001
|
+
return core_.VxeUI.getLanguage();
|
|
27004
27002
|
}
|
|
27005
27003
|
},
|
|
27006
27004
|
watch: {
|
|
@@ -27080,6 +27078,9 @@ function renderBody(h, $xeTable) {
|
|
|
27080
27078
|
computeScrollbarYToLeft() {
|
|
27081
27079
|
this.reLayoutFlag++;
|
|
27082
27080
|
},
|
|
27081
|
+
computeVxeLanguage() {
|
|
27082
|
+
this.reLayoutFlag++;
|
|
27083
|
+
},
|
|
27083
27084
|
reLayoutFlag() {
|
|
27084
27085
|
const $xeTable = this;
|
|
27085
27086
|
$xeTable.$nextTick(() => $xeTable.recalculate(true));
|
|
@@ -27173,11 +27174,11 @@ function renderBody(h, $xeTable) {
|
|
|
27173
27174
|
tableFullColumn: [],
|
|
27174
27175
|
// 渲染所有列
|
|
27175
27176
|
visibleColumn: [],
|
|
27176
|
-
//
|
|
27177
|
+
// 总的缓存数据集
|
|
27177
27178
|
fullAllDataRowIdData: {},
|
|
27178
|
-
|
|
27179
|
+
// 渲染中缓存数据
|
|
27180
|
+
sourceDataRowIdData: {},
|
|
27179
27181
|
fullDataRowIdData: {},
|
|
27180
|
-
fullColumnMap: new Map(),
|
|
27181
27182
|
fullColumnIdData: {},
|
|
27182
27183
|
fullColumnFieldData: {},
|
|
27183
27184
|
// 已展开的行集合
|
|
@@ -27192,6 +27193,10 @@ function renderBody(h, $xeTable) {
|
|
|
27192
27193
|
selectCheckboxMaps: {},
|
|
27193
27194
|
// 已标记的对象集
|
|
27194
27195
|
pendingRowMaps: {},
|
|
27196
|
+
// 已新增的临时行
|
|
27197
|
+
insertRowMaps: {},
|
|
27198
|
+
// 已删除行
|
|
27199
|
+
removeRowMaps: {},
|
|
27195
27200
|
swYSize: 0,
|
|
27196
27201
|
swYInterval: 0,
|
|
27197
27202
|
swYTotal: 0
|
|
@@ -27207,7 +27212,6 @@ function renderBody(h, $xeTable) {
|
|
|
27207
27212
|
scrollXStore,
|
|
27208
27213
|
scrollYStore
|
|
27209
27214
|
} = internalData;
|
|
27210
|
-
const sYOpts = $xeTable.computeSYOpts;
|
|
27211
27215
|
const editOpts = $xeTable.computeEditOpts;
|
|
27212
27216
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
27213
27217
|
const radioOpts = $xeTable.computeRadioOpts;
|
|
@@ -27367,8 +27371,7 @@ function renderBody(h, $xeTable) {
|
|
|
27367
27371
|
Object.assign(scrollYStore, {
|
|
27368
27372
|
startIndex: 0,
|
|
27369
27373
|
endIndex: 1,
|
|
27370
|
-
visibleSize: 0
|
|
27371
|
-
adaptive: sYOpts.adaptive !== false
|
|
27374
|
+
visibleSize: 0
|
|
27372
27375
|
});
|
|
27373
27376
|
Object.assign(scrollXStore, {
|
|
27374
27377
|
startIndex: 0,
|