vxe-table 4.10.13 → 4.10.15-beta.0
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/index.css +1 -1
- package/es/index.min.css +1 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/edit/hook.js +138 -128
- package/es/table/src/body.js +57 -43
- package/es/table/src/table.js +236 -51
- package/es/table/style.css +26 -0
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +26 -0
- package/es/vxe-table/style.min.css +1 -1
- package/lib/index.css +1 -1
- package/lib/index.min.css +1 -1
- package/lib/index.umd.js +531 -265
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/module/edit/hook.js +169 -154
- package/lib/table/module/edit/hook.min.js +1 -1
- package/lib/table/src/body.js +65 -58
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/table.js +293 -49
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/style/style.css +26 -0
- package/lib/table/style/style.min.css +1 -1
- package/lib/ui/index.js +1 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/lib/vxe-table/style/style.css +26 -0
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/table/module/edit/hook.ts +141 -129
- package/packages/table/src/body.ts +60 -50
- package/packages/table/src/table.ts +247 -51
- package/styles/components/table.scss +26 -0
- /package/es/{iconfont.1739257038865.ttf → iconfont.1739426300784.ttf} +0 -0
- /package/es/{iconfont.1739257038865.woff → iconfont.1739426300784.woff} +0 -0
- /package/es/{iconfont.1739257038865.woff2 → iconfont.1739426300784.woff2} +0 -0
- /package/lib/{iconfont.1739257038865.ttf → iconfont.1739426300784.ttf} +0 -0
- /package/lib/{iconfont.1739257038865.woff → iconfont.1739426300784.woff} +0 -0
- /package/lib/{iconfont.1739257038865.woff2 → iconfont.1739426300784.woff2} +0 -0
package/lib/index.umd.js
CHANGED
|
@@ -3138,7 +3138,7 @@ function eqEmptyValue(cellValue) {
|
|
|
3138
3138
|
;// ./packages/ui/index.ts
|
|
3139
3139
|
|
|
3140
3140
|
|
|
3141
|
-
const version = "4.10.
|
|
3141
|
+
const version = "4.10.15-beta.0";
|
|
3142
3142
|
core_.VxeUI.version = version;
|
|
3143
3143
|
core_.VxeUI.tableVersion = version;
|
|
3144
3144
|
core_.VxeUI.setConfig({
|
|
@@ -3585,7 +3585,7 @@ var esnext_iterator_some = __webpack_require__(7550);
|
|
|
3585
3585
|
const {
|
|
3586
3586
|
log: log_log
|
|
3587
3587
|
} = core_.VxeUI;
|
|
3588
|
-
const log_version = `table v${"4.10.
|
|
3588
|
+
const log_version = `table v${"4.10.15-beta.0"}`;
|
|
3589
3589
|
const warnLog = log_log.create('warn', log_version);
|
|
3590
3590
|
const errLog = log_log.create('error', log_version);
|
|
3591
3591
|
;// ./packages/table/src/columnInfo.ts
|
|
@@ -6199,8 +6199,6 @@ const renderType = 'body';
|
|
|
6199
6199
|
computeColumnOpts,
|
|
6200
6200
|
computeRowDragOpts,
|
|
6201
6201
|
computeColumnDragOpts,
|
|
6202
|
-
computeLeftFixedWidth,
|
|
6203
|
-
computeRightFixedWidth,
|
|
6204
6202
|
computeResizableOpts
|
|
6205
6203
|
} = $xeTable.getComputeMaps();
|
|
6206
6204
|
const refElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
@@ -6641,7 +6639,8 @@ const renderType = 'body';
|
|
|
6641
6639
|
expandColumn,
|
|
6642
6640
|
selectRadioRow,
|
|
6643
6641
|
pendingRowMaps,
|
|
6644
|
-
isDragColMove
|
|
6642
|
+
isDragColMove,
|
|
6643
|
+
rowExpandHeightFlag
|
|
6645
6644
|
} = tableReactData;
|
|
6646
6645
|
const {
|
|
6647
6646
|
fullAllDataRowIdData
|
|
@@ -6683,18 +6682,18 @@ const renderType = 'body';
|
|
|
6683
6682
|
};
|
|
6684
6683
|
}
|
|
6685
6684
|
const rowid = getRowid($xeTable, row);
|
|
6686
|
-
const
|
|
6685
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
6687
6686
|
let rowLevel = 0;
|
|
6688
6687
|
let seq = -1;
|
|
6689
6688
|
let _rowIndex = 0;
|
|
6690
|
-
if (
|
|
6691
|
-
rowLevel =
|
|
6689
|
+
if (rowRest) {
|
|
6690
|
+
rowLevel = rowRest.level;
|
|
6692
6691
|
if (treeConfig && transform && seqMode === 'increasing') {
|
|
6693
|
-
seq =
|
|
6692
|
+
seq = rowRest._index + 1;
|
|
6694
6693
|
} else {
|
|
6695
|
-
seq =
|
|
6694
|
+
seq = rowRest.seq;
|
|
6696
6695
|
}
|
|
6697
|
-
_rowIndex =
|
|
6696
|
+
_rowIndex = rowRest._index;
|
|
6698
6697
|
}
|
|
6699
6698
|
const params = {
|
|
6700
6699
|
$table: $xeTable,
|
|
@@ -6762,52 +6761,63 @@ const renderType = 'body';
|
|
|
6762
6761
|
const expandOpts = computeExpandOpts.value;
|
|
6763
6762
|
const {
|
|
6764
6763
|
height: expandHeight,
|
|
6765
|
-
padding
|
|
6764
|
+
padding,
|
|
6765
|
+
mode: expandMode
|
|
6766
6766
|
} = expandOpts;
|
|
6767
|
-
|
|
6768
|
-
|
|
6769
|
-
|
|
6770
|
-
|
|
6771
|
-
|
|
6772
|
-
|
|
6767
|
+
if (expandMode === 'fixed') {
|
|
6768
|
+
rows.push((0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('tr', {
|
|
6769
|
+
class: 'vxe-body--row-expanded-place',
|
|
6770
|
+
key: `expand_${rowid}`,
|
|
6771
|
+
rowid
|
|
6772
|
+
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('td', {
|
|
6773
|
+
class: 'vxe-body--row-expanded-place-column',
|
|
6774
|
+
colspan: tableColumn.length,
|
|
6775
|
+
style: {
|
|
6776
|
+
height: `${rowExpandHeightFlag ? rowRest.expandHeight || expandHeight : 0}px`
|
|
6777
|
+
}
|
|
6778
|
+
})]));
|
|
6779
|
+
} else {
|
|
6780
|
+
const cellStyle = {};
|
|
6781
|
+
if (expandHeight) {
|
|
6782
|
+
cellStyle.height = `${expandHeight}px`;
|
|
6783
|
+
}
|
|
6784
|
+
if (treeConfig) {
|
|
6785
|
+
cellStyle.paddingLeft = `${rowLevel * treeOpts.indent + 30}px`;
|
|
6786
|
+
}
|
|
6787
|
+
const {
|
|
6788
|
+
showOverflow
|
|
6789
|
+
} = expandColumn;
|
|
6790
|
+
const hasEllipsis = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isUndefined(showOverflow) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNull(showOverflow) ? isAllOverflow : showOverflow;
|
|
6791
|
+
const expandParams = {
|
|
6792
|
+
$table: $xeTable,
|
|
6793
|
+
seq,
|
|
6794
|
+
column: expandColumn,
|
|
6795
|
+
fixed: fixedType,
|
|
6796
|
+
type: renderType,
|
|
6797
|
+
level: rowLevel,
|
|
6798
|
+
row,
|
|
6799
|
+
rowIndex,
|
|
6800
|
+
$rowIndex,
|
|
6801
|
+
_rowIndex
|
|
6802
|
+
};
|
|
6803
|
+
rows.push((0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('tr', {
|
|
6804
|
+
class: ['vxe-body--expanded-row', {
|
|
6805
|
+
'is--padding': padding
|
|
6806
|
+
}],
|
|
6807
|
+
key: `expand_${rowid}`
|
|
6808
|
+
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('td', {
|
|
6809
|
+
class: ['vxe-body--expanded-column', {
|
|
6810
|
+
'fixed--hidden': fixedType && !hasFixedColumn,
|
|
6811
|
+
'col--ellipsis': hasEllipsis
|
|
6812
|
+
}],
|
|
6813
|
+
colspan: tableColumn.length
|
|
6814
|
+
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
6815
|
+
class: ['vxe-body--expanded-cell', {
|
|
6816
|
+
'is--ellipsis': expandHeight
|
|
6817
|
+
}],
|
|
6818
|
+
style: cellStyle
|
|
6819
|
+
}, [expandColumn.renderData(expandParams)])])]));
|
|
6773
6820
|
}
|
|
6774
|
-
const {
|
|
6775
|
-
showOverflow
|
|
6776
|
-
} = expandColumn;
|
|
6777
|
-
const hasEllipsis = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isUndefined(showOverflow) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNull(showOverflow) ? isAllOverflow : showOverflow;
|
|
6778
|
-
const expandParams = {
|
|
6779
|
-
$table: $xeTable,
|
|
6780
|
-
seq,
|
|
6781
|
-
column: expandColumn,
|
|
6782
|
-
fixed: fixedType,
|
|
6783
|
-
type: renderType,
|
|
6784
|
-
level: rowLevel,
|
|
6785
|
-
row,
|
|
6786
|
-
rowIndex,
|
|
6787
|
-
$rowIndex,
|
|
6788
|
-
_rowIndex
|
|
6789
|
-
};
|
|
6790
|
-
rows.push((0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('tr', {
|
|
6791
|
-
class: ['vxe-body--expanded-row', {
|
|
6792
|
-
'is--padding': padding
|
|
6793
|
-
}],
|
|
6794
|
-
key: `expand_${rowid}`,
|
|
6795
|
-
style: rowStyle ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(rowStyle) ? rowStyle(expandParams) : rowStyle : null,
|
|
6796
|
-
...trOn
|
|
6797
|
-
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('td', {
|
|
6798
|
-
class: {
|
|
6799
|
-
'vxe-body--expanded-column': 1,
|
|
6800
|
-
'fixed--hidden': fixedType && !hasFixedColumn,
|
|
6801
|
-
'col--ellipsis': hasEllipsis
|
|
6802
|
-
},
|
|
6803
|
-
colspan: tableColumn.length
|
|
6804
|
-
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
6805
|
-
class: {
|
|
6806
|
-
'vxe-body--expanded-cell': 1,
|
|
6807
|
-
'is--ellipsis': expandHeight
|
|
6808
|
-
},
|
|
6809
|
-
style: cellStyle
|
|
6810
|
-
}, [expandColumn.renderData(expandParams)])])]));
|
|
6811
6821
|
}
|
|
6812
6822
|
// 如果是树形表格
|
|
6813
6823
|
if (isExpandTree) {
|
|
@@ -6888,14 +6898,13 @@ const renderType = 'body';
|
|
|
6888
6898
|
const emptyOpts = computeEmptyOpts.value;
|
|
6889
6899
|
const mouseOpts = computeMouseOpts.value;
|
|
6890
6900
|
const rowDragOpts = computeRowDragOpts.value;
|
|
6891
|
-
const
|
|
6892
|
-
const rightFixedWidth = computeRightFixedWidth.value;
|
|
6901
|
+
const expandOpts = computeExpandOpts.value;
|
|
6893
6902
|
let renderDataList = tableData;
|
|
6894
6903
|
let renderColumnList = tableColumn;
|
|
6895
6904
|
let isOptimizeMode = false;
|
|
6896
6905
|
// 如果是使用优化模式
|
|
6897
6906
|
if (scrollXLoad || scrollYLoad || isAllOverflow) {
|
|
6898
|
-
if (expandColumn || spanMethod || footerSpanMethod) {
|
|
6907
|
+
if (expandColumn && expandOpts.mode !== 'fixed' || spanMethod || footerSpanMethod) {
|
|
6899
6908
|
// 如果不支持优化模式
|
|
6900
6909
|
} else {
|
|
6901
6910
|
isOptimizeMode = true;
|
|
@@ -6976,9 +6985,6 @@ const renderType = 'body';
|
|
|
6976
6985
|
$xeTable.triggerBodyScrollEvent(evnt, fixedType);
|
|
6977
6986
|
}
|
|
6978
6987
|
};
|
|
6979
|
-
if (scrollYLoad || leftFixedWidth || rightFixedWidth) {
|
|
6980
|
-
ons.onWheel = $xeTable.triggerBodyWheelEvent;
|
|
6981
|
-
}
|
|
6982
6988
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
6983
6989
|
ref: refElem,
|
|
6984
6990
|
class: ['vxe-table--body-wrapper', fixedType ? `fixed-${fixedType}--wrapper` : 'body--wrapper'],
|
|
@@ -10551,8 +10557,9 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
10551
10557
|
mini: 36
|
|
10552
10558
|
},
|
|
10553
10559
|
scrollVMLoading: false,
|
|
10560
|
+
rowExpandHeightFlag: 1,
|
|
10554
10561
|
calcCellHeightFlag: 1,
|
|
10555
|
-
resizeHeightFlag:
|
|
10562
|
+
resizeHeightFlag: 1,
|
|
10556
10563
|
isCustomStatus: false,
|
|
10557
10564
|
isDragRowMove: false,
|
|
10558
10565
|
dragRow: null,
|
|
@@ -10669,6 +10676,8 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
10669
10676
|
const refDragTipElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
10670
10677
|
const refDragRowLineElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
10671
10678
|
const refDragColLineElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
10679
|
+
const refRowExpandElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
10680
|
+
const refRowExpandYSpaceElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
10672
10681
|
const refScrollXVirtualElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
10673
10682
|
const refScrollYVirtualElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
10674
10683
|
const refScrollXHandleElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
@@ -10930,6 +10939,26 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
10930
10939
|
const computeCustomOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
10931
10940
|
return Object.assign({}, table_getConfig().table.customConfig, props.customConfig);
|
|
10932
10941
|
});
|
|
10942
|
+
const computeTableRowExpandedList = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
10943
|
+
const {
|
|
10944
|
+
rowExpandedMaps,
|
|
10945
|
+
tableData,
|
|
10946
|
+
expandColumn
|
|
10947
|
+
} = reactData;
|
|
10948
|
+
const expandList = [];
|
|
10949
|
+
if (expandColumn) {
|
|
10950
|
+
const rowKeys = {};
|
|
10951
|
+
tableData.forEach(row => {
|
|
10952
|
+
rowKeys[getRowid($xeTable, row)] = true;
|
|
10953
|
+
});
|
|
10954
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(rowExpandedMaps, (row, rowid) => {
|
|
10955
|
+
if (rowKeys[rowid]) {
|
|
10956
|
+
expandList.push(row);
|
|
10957
|
+
}
|
|
10958
|
+
});
|
|
10959
|
+
}
|
|
10960
|
+
return expandList;
|
|
10961
|
+
});
|
|
10933
10962
|
const computeAutoWidthColumnList = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
10934
10963
|
const {
|
|
10935
10964
|
visibleColumn
|
|
@@ -11216,6 +11245,14 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
11216
11245
|
visibleSize: 6
|
|
11217
11246
|
};
|
|
11218
11247
|
};
|
|
11248
|
+
const calcVarRowHeightConfig = (sizeKey, sizeEl) => {
|
|
11249
|
+
const {
|
|
11250
|
+
rowHeightStore
|
|
11251
|
+
} = reactData;
|
|
11252
|
+
if (sizeEl && sizeEl.clientHeight) {
|
|
11253
|
+
rowHeightStore[sizeKey] = sizeEl.clientHeight;
|
|
11254
|
+
}
|
|
11255
|
+
};
|
|
11219
11256
|
const computeRowHeight = () => {
|
|
11220
11257
|
const {
|
|
11221
11258
|
isAllOverflow
|
|
@@ -11248,7 +11285,9 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
11248
11285
|
};
|
|
11249
11286
|
const handleVirtualYVisible = currScrollTop => {
|
|
11250
11287
|
const {
|
|
11251
|
-
isAllOverflow
|
|
11288
|
+
isAllOverflow,
|
|
11289
|
+
expandColumn,
|
|
11290
|
+
rowExpandedMaps
|
|
11252
11291
|
} = reactData;
|
|
11253
11292
|
const {
|
|
11254
11293
|
elemStore,
|
|
@@ -11256,6 +11295,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
11256
11295
|
afterFullData,
|
|
11257
11296
|
fullAllDataRowIdData
|
|
11258
11297
|
} = internalData;
|
|
11298
|
+
const expandOpts = computeExpandOpts.value;
|
|
11259
11299
|
const rowOpts = computeRowOpts.value;
|
|
11260
11300
|
const cellOpts = computeCellOpts.value;
|
|
11261
11301
|
const defaultRowHeight = computeDefaultRowHeight.value;
|
|
@@ -11268,7 +11308,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
11268
11308
|
let offsetTop = 0;
|
|
11269
11309
|
let visibleSize = 0;
|
|
11270
11310
|
const isCustomCellHeight = isResizeCellHeight || cellOpts.height || rowOpts.height;
|
|
11271
|
-
if (!isCustomCellHeight && isAllOverflow) {
|
|
11311
|
+
if (!isCustomCellHeight && !expandColumn && isAllOverflow) {
|
|
11272
11312
|
toVisibleIndex = Math.floor(scrollTop / defaultRowHeight);
|
|
11273
11313
|
visibleSize = Math.ceil(clientHeight / defaultRowHeight) + 1;
|
|
11274
11314
|
} else {
|
|
@@ -11286,6 +11326,10 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
11286
11326
|
break;
|
|
11287
11327
|
}
|
|
11288
11328
|
}
|
|
11329
|
+
// 是否展开行
|
|
11330
|
+
if (expandColumn && rowExpandedMaps[rowid]) {
|
|
11331
|
+
offsetTop += rowRest.expandHeight || expandOpts.height || 0;
|
|
11332
|
+
}
|
|
11289
11333
|
}
|
|
11290
11334
|
}
|
|
11291
11335
|
return {
|
|
@@ -11938,7 +11982,8 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
11938
11982
|
level: 0,
|
|
11939
11983
|
height: 0,
|
|
11940
11984
|
resizeHeight: 0,
|
|
11941
|
-
oTop: 0
|
|
11985
|
+
oTop: 0,
|
|
11986
|
+
expandHeight: 0
|
|
11942
11987
|
};
|
|
11943
11988
|
fullAllDataRowIdData[rowid] = rest;
|
|
11944
11989
|
fullDataRowIdData[rowid] = rest;
|
|
@@ -11988,7 +12033,8 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
11988
12033
|
level: 0,
|
|
11989
12034
|
height: 0,
|
|
11990
12035
|
resizeHeight: 0,
|
|
11991
|
-
oTop: 0
|
|
12036
|
+
oTop: 0,
|
|
12037
|
+
expandHeight: 0
|
|
11992
12038
|
};
|
|
11993
12039
|
fullAllDataRowIdData[rowid] = rest;
|
|
11994
12040
|
fullDataRowIdData[rowid] = rest;
|
|
@@ -12311,6 +12357,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
12311
12357
|
const emptyPlaceholderElem = refEmptyPlaceholder.value;
|
|
12312
12358
|
const cellOffsetWidth = computeCellOffsetWidth.value;
|
|
12313
12359
|
const mouseOpts = computeMouseOpts.value;
|
|
12360
|
+
const expandOpts = computeExpandOpts.value;
|
|
12314
12361
|
const bodyWrapperElem = getRefElem(elemStore['main-body-wrapper']);
|
|
12315
12362
|
const bodyTableElem = getRefElem(elemStore['main-body-table']);
|
|
12316
12363
|
if (emptyPlaceholderElem) {
|
|
@@ -12380,6 +12427,11 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
12380
12427
|
yBottomCornerEl.style.top = `${headerHeight + bodyHeight}px`;
|
|
12381
12428
|
yBottomCornerEl.style.display = footerHeight ? 'block' : '';
|
|
12382
12429
|
}
|
|
12430
|
+
const rowExpandEl = refRowExpandElem.value;
|
|
12431
|
+
if (rowExpandEl) {
|
|
12432
|
+
rowExpandEl.style.height = `${bodyHeight}px`;
|
|
12433
|
+
rowExpandEl.style.top = `${headerHeight}px`;
|
|
12434
|
+
}
|
|
12383
12435
|
containerList.forEach((name, index) => {
|
|
12384
12436
|
const fixedType = index > 0 ? name : '';
|
|
12385
12437
|
const layoutList = ['header', 'body', 'footer'];
|
|
@@ -12489,7 +12541,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
12489
12541
|
let isOptimizeMode = false;
|
|
12490
12542
|
// 如果是使用优化模式
|
|
12491
12543
|
if (scrollXLoad || scrollYLoad || isAllOverflow) {
|
|
12492
|
-
if (expandColumn || spanMethod || footerSpanMethod) {
|
|
12544
|
+
if (expandColumn && expandOpts.mode !== 'fixed' || spanMethod || footerSpanMethod) {
|
|
12493
12545
|
// 如果不支持优化模式
|
|
12494
12546
|
} else {
|
|
12495
12547
|
isOptimizeMode = true;
|
|
@@ -13255,15 +13307,25 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
13255
13307
|
if (!el || !el.clientWidth) {
|
|
13256
13308
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
13257
13309
|
}
|
|
13310
|
+
const varEl = refVarElem.value;
|
|
13311
|
+
if (varEl) {
|
|
13312
|
+
const [defEl, mediumEl, smallEl, miniEl] = varEl.children;
|
|
13313
|
+
calcVarRowHeightConfig('default', defEl);
|
|
13314
|
+
calcVarRowHeightConfig('medium', mediumEl);
|
|
13315
|
+
calcVarRowHeightConfig('small', smallEl);
|
|
13316
|
+
calcVarRowHeightConfig('mini', miniEl);
|
|
13317
|
+
}
|
|
13258
13318
|
calcCellWidth();
|
|
13259
13319
|
autoCellWidth();
|
|
13260
13320
|
updateStyle();
|
|
13321
|
+
updateRowExpandStyle();
|
|
13261
13322
|
return computeScrollLoad().then(() => {
|
|
13262
13323
|
if (reFull === true) {
|
|
13263
13324
|
// 初始化时需要在列计算之后再执行优化运算,达到最优显示效果
|
|
13264
13325
|
calcCellWidth();
|
|
13265
13326
|
autoCellWidth();
|
|
13266
13327
|
updateStyle();
|
|
13328
|
+
updateRowExpandStyle();
|
|
13267
13329
|
return computeScrollLoad();
|
|
13268
13330
|
}
|
|
13269
13331
|
});
|
|
@@ -14072,6 +14134,71 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
14072
14134
|
setTimeout(() => $xeTable.recalculate(true), 300);
|
|
14073
14135
|
});
|
|
14074
14136
|
};
|
|
14137
|
+
const updateRowExpandStyle = () => {
|
|
14138
|
+
const {
|
|
14139
|
+
expandColumn,
|
|
14140
|
+
scrollYLoad,
|
|
14141
|
+
rowExpandedMaps
|
|
14142
|
+
} = reactData;
|
|
14143
|
+
const expandOpts = computeExpandOpts.value;
|
|
14144
|
+
const rowOpts = computeRowOpts.value;
|
|
14145
|
+
const cellOpts = computeCellOpts.value;
|
|
14146
|
+
const defaultRowHeight = computeDefaultRowHeight.value;
|
|
14147
|
+
const {
|
|
14148
|
+
mode
|
|
14149
|
+
} = expandOpts;
|
|
14150
|
+
if (expandColumn && mode === 'fixed') {
|
|
14151
|
+
const {
|
|
14152
|
+
elemStore,
|
|
14153
|
+
afterFullData,
|
|
14154
|
+
fullAllDataRowIdData
|
|
14155
|
+
} = internalData;
|
|
14156
|
+
const rowExpandEl = refRowExpandElem.value;
|
|
14157
|
+
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
14158
|
+
if (rowExpandEl && bodyScrollElem) {
|
|
14159
|
+
let isUpdateHeight = false;
|
|
14160
|
+
if (scrollYLoad) {
|
|
14161
|
+
let offsetTop = 0;
|
|
14162
|
+
for (let rIndex = 0, rLen = afterFullData.length; rIndex < rLen; rIndex++) {
|
|
14163
|
+
const row = afterFullData[rIndex];
|
|
14164
|
+
const rowid = getRowid($xeTable, row);
|
|
14165
|
+
const rowRest = fullAllDataRowIdData[rowid] || {};
|
|
14166
|
+
rowRest.oTop = offsetTop;
|
|
14167
|
+
offsetTop += rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight;
|
|
14168
|
+
// 是否展开行
|
|
14169
|
+
if (expandColumn && rowExpandedMaps[rowid]) {
|
|
14170
|
+
offsetTop += rowRest.expandHeight || expandOpts.height || 0;
|
|
14171
|
+
}
|
|
14172
|
+
}
|
|
14173
|
+
}
|
|
14174
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(rowExpandEl.children, reEl => {
|
|
14175
|
+
const expandEl = reEl;
|
|
14176
|
+
const rowid = expandEl.getAttribute('rowid') || '';
|
|
14177
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
14178
|
+
if (rowRest) {
|
|
14179
|
+
const expandHeight = expandEl.offsetHeight + 1;
|
|
14180
|
+
if (scrollYLoad) {
|
|
14181
|
+
expandEl.style.top = toCssUnit(rowRest.oTop + (rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight));
|
|
14182
|
+
} else {
|
|
14183
|
+
const trEl = bodyScrollElem.querySelector(`.vxe-body--row[rowid="${rowid}"]`);
|
|
14184
|
+
if (trEl) {
|
|
14185
|
+
expandEl.style.top = toCssUnit(trEl.offsetTop + trEl.offsetHeight);
|
|
14186
|
+
}
|
|
14187
|
+
}
|
|
14188
|
+
if (!isUpdateHeight) {
|
|
14189
|
+
if (rowRest.expandHeight !== expandHeight) {
|
|
14190
|
+
isUpdateHeight = true;
|
|
14191
|
+
}
|
|
14192
|
+
}
|
|
14193
|
+
rowRest.expandHeight = expandHeight;
|
|
14194
|
+
}
|
|
14195
|
+
});
|
|
14196
|
+
if (isUpdateHeight) {
|
|
14197
|
+
reactData.rowExpandHeightFlag++;
|
|
14198
|
+
}
|
|
14199
|
+
}
|
|
14200
|
+
}
|
|
14201
|
+
};
|
|
14075
14202
|
tableMethods = {
|
|
14076
14203
|
dispatchEvent,
|
|
14077
14204
|
/**
|
|
@@ -14266,7 +14393,8 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
14266
14393
|
level: parentLevel + nodes.length,
|
|
14267
14394
|
height: 0,
|
|
14268
14395
|
resizeHeight: 0,
|
|
14269
|
-
oTop: 0
|
|
14396
|
+
oTop: 0,
|
|
14397
|
+
expandHeight: 0
|
|
14270
14398
|
};
|
|
14271
14399
|
fullDataRowIdData[rowid] = rest;
|
|
14272
14400
|
fullAllDataRowIdData[rowid] = rest;
|
|
@@ -15226,6 +15354,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
15226
15354
|
const el = refElem.value;
|
|
15227
15355
|
if (el && el.clientWidth) {
|
|
15228
15356
|
autoCellWidth();
|
|
15357
|
+
updateRowExpandStyle();
|
|
15229
15358
|
}
|
|
15230
15359
|
if (rceTimeout) {
|
|
15231
15360
|
clearTimeout(rceTimeout);
|
|
@@ -17811,7 +17940,8 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
17811
17940
|
level,
|
|
17812
17941
|
height: 0,
|
|
17813
17942
|
resizeHeight: 0,
|
|
17814
|
-
oTop: 0
|
|
17943
|
+
oTop: 0,
|
|
17944
|
+
expandHeight: 0
|
|
17815
17945
|
};
|
|
17816
17946
|
}
|
|
17817
17947
|
cacheItem.row = row;
|
|
@@ -20126,6 +20256,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20126
20256
|
direction,
|
|
20127
20257
|
...params
|
|
20128
20258
|
};
|
|
20259
|
+
updateRowExpandStyle();
|
|
20129
20260
|
checkLastSyncScroll(isRollX, isRollY);
|
|
20130
20261
|
if (rowOpts.isHover || highlightHoverRow) {
|
|
20131
20262
|
$xeTable.clearHoverRow();
|
|
@@ -20164,6 +20295,10 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20164
20295
|
}
|
|
20165
20296
|
},
|
|
20166
20297
|
triggerBodyScrollEvent(evnt, fixedType) {
|
|
20298
|
+
const {
|
|
20299
|
+
scrollYLoad,
|
|
20300
|
+
scrollXLoad
|
|
20301
|
+
} = reactData;
|
|
20167
20302
|
const {
|
|
20168
20303
|
elemStore,
|
|
20169
20304
|
intoRunScroll,
|
|
@@ -20183,6 +20318,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20183
20318
|
const rightScrollElem = getRefElem(elemStore['right-body-scroll']);
|
|
20184
20319
|
const headerScrollElem = getRefElem(elemStore['main-header-scroll']);
|
|
20185
20320
|
const footerScrollElem = getRefElem(elemStore['main-footer-scroll']);
|
|
20321
|
+
const rowExpandEl = refRowExpandElem.value;
|
|
20186
20322
|
if (inWheelScroll || inVirtualScroll || inHeaderScroll || inFooterScroll) {
|
|
20187
20323
|
return;
|
|
20188
20324
|
}
|
|
@@ -20229,13 +20365,18 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20229
20365
|
setScrollTop(rightScrollElem, scrollTop);
|
|
20230
20366
|
}
|
|
20231
20367
|
setScrollTop(yHandleEl, scrollTop);
|
|
20232
|
-
|
|
20368
|
+
setScrollTop(rowExpandEl, scrollTop);
|
|
20369
|
+
if (scrollYLoad) {
|
|
20370
|
+
$xeTable.triggerScrollYEvent(evnt);
|
|
20371
|
+
}
|
|
20233
20372
|
}
|
|
20234
20373
|
if (isRollX) {
|
|
20235
20374
|
setScrollLeft(xHandleEl, scrollLeft);
|
|
20236
20375
|
setScrollLeft(headerScrollElem, scrollLeft);
|
|
20237
20376
|
setScrollLeft(footerScrollElem, scrollLeft);
|
|
20238
|
-
|
|
20377
|
+
if (scrollXLoad) {
|
|
20378
|
+
$xeTable.triggerScrollXEvent(evnt);
|
|
20379
|
+
}
|
|
20239
20380
|
}
|
|
20240
20381
|
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
|
|
20241
20382
|
type: 'body',
|
|
@@ -20243,6 +20384,9 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20243
20384
|
});
|
|
20244
20385
|
},
|
|
20245
20386
|
triggerHeaderScrollEvent(evnt, fixedType) {
|
|
20387
|
+
const {
|
|
20388
|
+
scrollXLoad
|
|
20389
|
+
} = reactData;
|
|
20246
20390
|
const {
|
|
20247
20391
|
elemStore,
|
|
20248
20392
|
intoRunScroll,
|
|
@@ -20279,13 +20423,18 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20279
20423
|
setScrollLeft(xHandleEl, scrollLeft);
|
|
20280
20424
|
setScrollLeft(footerScrollElem, scrollLeft);
|
|
20281
20425
|
setScrollLeft(bodyScrollElem, scrollLeft);
|
|
20282
|
-
|
|
20426
|
+
if (scrollXLoad) {
|
|
20427
|
+
$xeTable.triggerScrollXEvent(evnt);
|
|
20428
|
+
}
|
|
20283
20429
|
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
|
|
20284
20430
|
type: 'header',
|
|
20285
20431
|
fixed: fixedType
|
|
20286
20432
|
});
|
|
20287
20433
|
},
|
|
20288
20434
|
triggerFooterScrollEvent(evnt, fixedType) {
|
|
20435
|
+
const {
|
|
20436
|
+
scrollXLoad
|
|
20437
|
+
} = reactData;
|
|
20289
20438
|
const {
|
|
20290
20439
|
elemStore,
|
|
20291
20440
|
intoRunScroll,
|
|
@@ -20322,7 +20471,9 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20322
20471
|
setScrollLeft(xHandleEl, scrollLeft);
|
|
20323
20472
|
setScrollLeft(headerScrollElem, scrollLeft);
|
|
20324
20473
|
setScrollLeft(bodyScrollElem, scrollLeft);
|
|
20325
|
-
|
|
20474
|
+
if (scrollXLoad) {
|
|
20475
|
+
$xeTable.triggerScrollXEvent(evnt);
|
|
20476
|
+
}
|
|
20326
20477
|
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
|
|
20327
20478
|
type: 'footer',
|
|
20328
20479
|
fixed: fixedType
|
|
@@ -20340,6 +20491,9 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20340
20491
|
const {
|
|
20341
20492
|
highlightHoverRow
|
|
20342
20493
|
} = src_props;
|
|
20494
|
+
const {
|
|
20495
|
+
scrollYLoad
|
|
20496
|
+
} = reactData;
|
|
20343
20497
|
const {
|
|
20344
20498
|
elemStore,
|
|
20345
20499
|
lastScrollTop,
|
|
@@ -20351,6 +20505,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20351
20505
|
const leftScrollElem = getRefElem(elemStore['left-body-scroll']);
|
|
20352
20506
|
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
20353
20507
|
const rightScrollElem = getRefElem(elemStore['right-body-scroll']);
|
|
20508
|
+
const rowExpandEl = refRowExpandElem.value;
|
|
20354
20509
|
if (!xHandleEl) {
|
|
20355
20510
|
return;
|
|
20356
20511
|
}
|
|
@@ -20386,25 +20541,21 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20386
20541
|
setScrollTop(bodyScrollElem, currTopNum);
|
|
20387
20542
|
setScrollTop(leftScrollElem, currTopNum);
|
|
20388
20543
|
setScrollTop(rightScrollElem, currTopNum);
|
|
20389
|
-
|
|
20544
|
+
setScrollTop(rowExpandEl, currTopNum);
|
|
20545
|
+
if (scrollYLoad) {
|
|
20546
|
+
$xeTable.triggerScrollYEvent(evnt);
|
|
20547
|
+
}
|
|
20390
20548
|
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, currTopNum, scrollLeft, {
|
|
20391
20549
|
type: 'table',
|
|
20392
20550
|
fixed: ''
|
|
20393
20551
|
});
|
|
20394
20552
|
});
|
|
20395
|
-
// internalData.inWheelScroll = true
|
|
20396
|
-
// setScrollTop(yHandleEl, scrollTop)
|
|
20397
|
-
// setScrollTop(bodyScrollElem, scrollTop)
|
|
20398
|
-
// setScrollTop(leftScrollElem, scrollTop)
|
|
20399
|
-
// setScrollTop(rightScrollElem, scrollTop)
|
|
20400
|
-
// loadScrollYData(scrollTop)
|
|
20401
|
-
// $xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
|
|
20402
|
-
// type: 'footer',
|
|
20403
|
-
// fixed: ''
|
|
20404
|
-
// })
|
|
20405
20553
|
}
|
|
20406
20554
|
},
|
|
20407
20555
|
triggerVirtualScrollXEvent(evnt) {
|
|
20556
|
+
const {
|
|
20557
|
+
scrollXLoad
|
|
20558
|
+
} = reactData;
|
|
20408
20559
|
const {
|
|
20409
20560
|
elemStore,
|
|
20410
20561
|
inWheelScroll,
|
|
@@ -20438,13 +20589,18 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20438
20589
|
setScrollLeft(bodyScrollElem, scrollLeft);
|
|
20439
20590
|
setScrollLeft(headerScrollElem, scrollLeft);
|
|
20440
20591
|
setScrollLeft(footerScrollElem, scrollLeft);
|
|
20441
|
-
|
|
20592
|
+
if (scrollXLoad) {
|
|
20593
|
+
$xeTable.triggerScrollXEvent(evnt);
|
|
20594
|
+
}
|
|
20442
20595
|
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
|
|
20443
20596
|
type: 'table',
|
|
20444
20597
|
fixed: ''
|
|
20445
20598
|
});
|
|
20446
20599
|
},
|
|
20447
20600
|
triggerVirtualScrollYEvent(evnt) {
|
|
20601
|
+
const {
|
|
20602
|
+
scrollYLoad
|
|
20603
|
+
} = reactData;
|
|
20448
20604
|
const {
|
|
20449
20605
|
elemStore,
|
|
20450
20606
|
inWheelScroll,
|
|
@@ -20462,6 +20618,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20462
20618
|
const leftScrollElem = getRefElem(elemStore['left-body-scroll']);
|
|
20463
20619
|
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
20464
20620
|
const rightScrollElem = getRefElem(elemStore['right-body-scroll']);
|
|
20621
|
+
const rowExpandEl = refRowExpandElem.value;
|
|
20465
20622
|
const xHandleEl = refScrollXHandleElem.value;
|
|
20466
20623
|
const wrapperEl = evnt.currentTarget;
|
|
20467
20624
|
const {
|
|
@@ -20478,7 +20635,10 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20478
20635
|
setScrollTop(bodyScrollElem, scrollTop);
|
|
20479
20636
|
setScrollTop(leftScrollElem, scrollTop);
|
|
20480
20637
|
setScrollTop(rightScrollElem, scrollTop);
|
|
20481
|
-
|
|
20638
|
+
setScrollTop(rowExpandEl, scrollTop);
|
|
20639
|
+
if (scrollYLoad) {
|
|
20640
|
+
$xeTable.triggerScrollYEvent(evnt);
|
|
20641
|
+
}
|
|
20482
20642
|
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
|
|
20483
20643
|
type: 'table',
|
|
20484
20644
|
fixed: ''
|
|
@@ -20572,7 +20732,9 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20572
20732
|
updateScrollYSpace() {
|
|
20573
20733
|
const {
|
|
20574
20734
|
isAllOverflow,
|
|
20575
|
-
scrollYLoad
|
|
20735
|
+
scrollYLoad,
|
|
20736
|
+
expandColumn,
|
|
20737
|
+
rowExpandedMaps
|
|
20576
20738
|
} = reactData;
|
|
20577
20739
|
const {
|
|
20578
20740
|
scrollYStore,
|
|
@@ -20584,6 +20746,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20584
20746
|
const {
|
|
20585
20747
|
startIndex
|
|
20586
20748
|
} = scrollYStore;
|
|
20749
|
+
const expandOpts = computeExpandOpts.value;
|
|
20587
20750
|
const rowOpts = computeRowOpts.value;
|
|
20588
20751
|
const cellOpts = computeCellOpts.value;
|
|
20589
20752
|
const defaultRowHeight = computeDefaultRowHeight.value;
|
|
@@ -20593,7 +20756,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20593
20756
|
let ySpaceHeight = 0;
|
|
20594
20757
|
if (scrollYLoad) {
|
|
20595
20758
|
const isCustomCellHeight = isResizeCellHeight || cellOpts.height || rowOpts.height;
|
|
20596
|
-
if (!isCustomCellHeight && isAllOverflow) {
|
|
20759
|
+
if (!isCustomCellHeight && !expandColumn && isAllOverflow) {
|
|
20597
20760
|
ySpaceHeight = afterFullData.length * defaultRowHeight;
|
|
20598
20761
|
topSpaceHeight = Math.max(0, startIndex * defaultRowHeight);
|
|
20599
20762
|
} else {
|
|
@@ -20602,12 +20765,20 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20602
20765
|
const rowid = getRowid($xeTable, row);
|
|
20603
20766
|
const rowRest = fullAllDataRowIdData[rowid] || {};
|
|
20604
20767
|
ySpaceHeight += rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight;
|
|
20768
|
+
// 是否展开行
|
|
20769
|
+
if (expandColumn && rowExpandedMaps[rowid]) {
|
|
20770
|
+
ySpaceHeight += rowRest.expandHeight || expandOpts.height || 0;
|
|
20771
|
+
}
|
|
20605
20772
|
}
|
|
20606
20773
|
for (let i = 0; i < startIndex; i++) {
|
|
20607
20774
|
const row = afterFullData[i];
|
|
20608
20775
|
const rowid = getRowid($xeTable, row);
|
|
20609
20776
|
const rowRest = fullAllDataRowIdData[rowid] || {};
|
|
20610
20777
|
topSpaceHeight += rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight;
|
|
20778
|
+
// 是否展开行
|
|
20779
|
+
if (expandColumn && rowExpandedMaps[rowid]) {
|
|
20780
|
+
topSpaceHeight += rowRest.expandHeight || expandOpts.height || 0;
|
|
20781
|
+
}
|
|
20611
20782
|
}
|
|
20612
20783
|
}
|
|
20613
20784
|
} else {
|
|
@@ -20632,6 +20803,10 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20632
20803
|
if (scrollYSpaceEl) {
|
|
20633
20804
|
scrollYSpaceEl.style.height = ySpaceHeight ? `${ySpaceHeight}px` : '';
|
|
20634
20805
|
}
|
|
20806
|
+
const rowExpandYSpaceEl = refRowExpandYSpaceElem.value;
|
|
20807
|
+
if (rowExpandYSpaceEl) {
|
|
20808
|
+
rowExpandYSpaceEl.style.height = ySpaceHeight ? `${ySpaceHeight}px` : '';
|
|
20809
|
+
}
|
|
20635
20810
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(() => {
|
|
20636
20811
|
updateStyle();
|
|
20637
20812
|
});
|
|
@@ -20641,6 +20816,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20641
20816
|
isAllOverflow
|
|
20642
20817
|
} = reactData;
|
|
20643
20818
|
handleTableColumn();
|
|
20819
|
+
$xeTable.updateScrollYSpace();
|
|
20644
20820
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(() => {
|
|
20645
20821
|
handleTableColumn();
|
|
20646
20822
|
$xeTable.updateScrollXSpace();
|
|
@@ -20651,6 +20827,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20651
20827
|
},
|
|
20652
20828
|
updateScrollYData() {
|
|
20653
20829
|
$xeTable.handleTableData();
|
|
20830
|
+
$xeTable.updateScrollYSpace();
|
|
20654
20831
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(() => {
|
|
20655
20832
|
$xeTable.handleTableData();
|
|
20656
20833
|
$xeTable.updateScrollYSpace();
|
|
@@ -20879,6 +21056,91 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20879
21056
|
}
|
|
20880
21057
|
return table_renderEmptyElement($xeTable);
|
|
20881
21058
|
};
|
|
21059
|
+
const renderRowExpandedVNs = () => {
|
|
21060
|
+
const {
|
|
21061
|
+
treeConfig
|
|
21062
|
+
} = props;
|
|
21063
|
+
const {
|
|
21064
|
+
expandColumn
|
|
21065
|
+
} = reactData;
|
|
21066
|
+
const tableRowExpandedList = computeTableRowExpandedList.value;
|
|
21067
|
+
const expandOpts = computeExpandOpts.value;
|
|
21068
|
+
const {
|
|
21069
|
+
mode
|
|
21070
|
+
} = expandOpts;
|
|
21071
|
+
if (mode !== 'fixed') {
|
|
21072
|
+
return table_renderEmptyElement($xeTable);
|
|
21073
|
+
}
|
|
21074
|
+
const expandVNs = [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
21075
|
+
key: 'repY',
|
|
21076
|
+
ref: refRowExpandYSpaceElem
|
|
21077
|
+
})];
|
|
21078
|
+
if (expandColumn) {
|
|
21079
|
+
tableRowExpandedList.forEach(row => {
|
|
21080
|
+
const expandOpts = computeExpandOpts.value;
|
|
21081
|
+
const {
|
|
21082
|
+
height: expandHeight,
|
|
21083
|
+
padding
|
|
21084
|
+
} = expandOpts;
|
|
21085
|
+
const {
|
|
21086
|
+
fullAllDataRowIdData
|
|
21087
|
+
} = internalData;
|
|
21088
|
+
const treeOpts = computeTreeOpts.value;
|
|
21089
|
+
const {
|
|
21090
|
+
transform,
|
|
21091
|
+
seqMode
|
|
21092
|
+
} = treeOpts;
|
|
21093
|
+
const cellStyle = {};
|
|
21094
|
+
const rowid = getRowid($xeTable, row);
|
|
21095
|
+
const rest = fullAllDataRowIdData[rowid];
|
|
21096
|
+
let rowLevel = 0;
|
|
21097
|
+
let seq = -1;
|
|
21098
|
+
let _rowIndex = 0;
|
|
21099
|
+
const rowIndex = $xeTable.getRowIndex(row);
|
|
21100
|
+
const $rowIndex = $xeTable.getVMRowIndex(row);
|
|
21101
|
+
if (rest) {
|
|
21102
|
+
rowLevel = rest.level;
|
|
21103
|
+
if (treeConfig && transform && seqMode === 'increasing') {
|
|
21104
|
+
seq = rest._index + 1;
|
|
21105
|
+
} else {
|
|
21106
|
+
seq = rest.seq;
|
|
21107
|
+
}
|
|
21108
|
+
_rowIndex = rest._index;
|
|
21109
|
+
}
|
|
21110
|
+
if (expandHeight) {
|
|
21111
|
+
cellStyle.height = `${expandHeight}px`;
|
|
21112
|
+
}
|
|
21113
|
+
if (treeConfig) {
|
|
21114
|
+
cellStyle.paddingLeft = `${rowLevel * treeOpts.indent + 30}px`;
|
|
21115
|
+
}
|
|
21116
|
+
const expandParams = {
|
|
21117
|
+
$table: $xeTable,
|
|
21118
|
+
seq,
|
|
21119
|
+
column: expandColumn,
|
|
21120
|
+
fixed: '',
|
|
21121
|
+
type: 'body',
|
|
21122
|
+
level: rowLevel,
|
|
21123
|
+
row,
|
|
21124
|
+
rowIndex,
|
|
21125
|
+
$rowIndex,
|
|
21126
|
+
_rowIndex
|
|
21127
|
+
};
|
|
21128
|
+
expandVNs.push((0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
21129
|
+
key: rowid,
|
|
21130
|
+
class: ['vxe-body--row-expanded-cell', {
|
|
21131
|
+
'is--padding': padding,
|
|
21132
|
+
'is--ellipsis': expandHeight
|
|
21133
|
+
}],
|
|
21134
|
+
rowid,
|
|
21135
|
+
style: cellStyle
|
|
21136
|
+
}, expandColumn.renderData(expandParams)));
|
|
21137
|
+
});
|
|
21138
|
+
}
|
|
21139
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
21140
|
+
ref: refRowExpandElem,
|
|
21141
|
+
class: 'vxe-table--row-expanded-wrapper'
|
|
21142
|
+
}, expandVNs);
|
|
21143
|
+
};
|
|
20882
21144
|
const renderScrollX = () => {
|
|
20883
21145
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
20884
21146
|
key: 'vsx',
|
|
@@ -20931,6 +21193,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20931
21193
|
} = props;
|
|
20932
21194
|
const {
|
|
20933
21195
|
overflowX,
|
|
21196
|
+
scrollYLoad,
|
|
20934
21197
|
tableData,
|
|
20935
21198
|
tableColumn,
|
|
20936
21199
|
tableGroupColumn,
|
|
@@ -20941,9 +21204,16 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20941
21204
|
leftList,
|
|
20942
21205
|
rightList
|
|
20943
21206
|
} = columnStore;
|
|
21207
|
+
const leftFixedWidth = computeLeftFixedWidth.value;
|
|
21208
|
+
const rightFixedWidth = computeRightFixedWidth.value;
|
|
21209
|
+
const ons = {};
|
|
21210
|
+
if (scrollYLoad || leftFixedWidth || rightFixedWidth) {
|
|
21211
|
+
ons.onWheel = $xeTable.triggerBodyWheelEvent;
|
|
21212
|
+
}
|
|
20944
21213
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
20945
21214
|
ref: refTableViewportElem,
|
|
20946
|
-
class: 'vxe-table--viewport-wrapper'
|
|
21215
|
+
class: 'vxe-table--viewport-wrapper',
|
|
21216
|
+
...ons
|
|
20947
21217
|
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
20948
21218
|
class: 'vxe-table--main-wrapper'
|
|
20949
21219
|
}, [
|
|
@@ -20973,7 +21243,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20973
21243
|
tableColumn
|
|
20974
21244
|
}) : table_renderEmptyElement($xeTable)]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
20975
21245
|
class: 'vxe-table--fixed-wrapper'
|
|
20976
|
-
}, [leftList && leftList.length && overflowX ? renderFixed('left') : table_renderEmptyElement($xeTable), rightList && rightList.length && overflowX ? renderFixed('right') : table_renderEmptyElement($xeTable)])]);
|
|
21246
|
+
}, [leftList && leftList.length && overflowX ? renderFixed('left') : table_renderEmptyElement($xeTable), rightList && rightList.length && overflowX ? renderFixed('right') : table_renderEmptyElement($xeTable)]), renderRowExpandedVNs()]);
|
|
20977
21247
|
};
|
|
20978
21248
|
const renderBody = () => {
|
|
20979
21249
|
const scrollbarYToLeft = computeScrollbarYToLeft.value;
|
|
@@ -21410,28 +21680,9 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
21410
21680
|
});
|
|
21411
21681
|
});
|
|
21412
21682
|
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.onMounted)(() => {
|
|
21413
|
-
const {
|
|
21414
|
-
rowHeightStore
|
|
21415
|
-
} = reactData;
|
|
21416
|
-
const varEl = refVarElem.value;
|
|
21417
21683
|
const columnOpts = computeColumnOpts.value;
|
|
21418
21684
|
const rowOpts = computeRowOpts.value;
|
|
21419
21685
|
const customOpts = computeCustomOpts.value;
|
|
21420
|
-
if (varEl) {
|
|
21421
|
-
const [defEl, mediumEl, smallEl, miniEl] = varEl.children;
|
|
21422
|
-
if (defEl) {
|
|
21423
|
-
rowHeightStore.default = defEl.clientHeight;
|
|
21424
|
-
}
|
|
21425
|
-
if (mediumEl) {
|
|
21426
|
-
rowHeightStore.medium = mediumEl.clientHeight;
|
|
21427
|
-
}
|
|
21428
|
-
if (smallEl) {
|
|
21429
|
-
rowHeightStore.small = smallEl.clientHeight;
|
|
21430
|
-
}
|
|
21431
|
-
if (miniEl) {
|
|
21432
|
-
rowHeightStore.mini = miniEl.clientHeight;
|
|
21433
|
-
}
|
|
21434
|
-
}
|
|
21435
21686
|
if (columnOpts.drag || rowOpts.drag || customOpts.allowSort) {
|
|
21436
21687
|
initTpImg();
|
|
21437
21688
|
}
|
|
@@ -22629,7 +22880,7 @@ edit_hook_hooks.add('tableEditModule', {
|
|
|
22629
22880
|
}
|
|
22630
22881
|
}
|
|
22631
22882
|
};
|
|
22632
|
-
|
|
22883
|
+
const syncActivedCell = () => {
|
|
22633
22884
|
const {
|
|
22634
22885
|
editStore,
|
|
22635
22886
|
tableColumn
|
|
@@ -22649,8 +22900,8 @@ edit_hook_hooks.add('tableEditModule', {
|
|
|
22649
22900
|
setEditColumnModel(row, column);
|
|
22650
22901
|
}
|
|
22651
22902
|
}
|
|
22652
|
-
}
|
|
22653
|
-
|
|
22903
|
+
};
|
|
22904
|
+
const insertTreeRow = (newRecords, isAppend) => {
|
|
22654
22905
|
const {
|
|
22655
22906
|
tableFullTreeData,
|
|
22656
22907
|
afterFullData,
|
|
@@ -22700,7 +22951,8 @@ edit_hook_hooks.add('tableEditModule', {
|
|
|
22700
22951
|
level: parentLevel + 1,
|
|
22701
22952
|
height: 0,
|
|
22702
22953
|
resizeHeight: 0,
|
|
22703
|
-
oTop: 0
|
|
22954
|
+
oTop: 0,
|
|
22955
|
+
expandHeight: 0
|
|
22704
22956
|
};
|
|
22705
22957
|
fullDataRowIdData[rowid] = rest;
|
|
22706
22958
|
fullAllDataRowIdData[rowid] = rest;
|
|
@@ -22725,13 +22977,14 @@ edit_hook_hooks.add('tableEditModule', {
|
|
|
22725
22977
|
level: 0,
|
|
22726
22978
|
height: 0,
|
|
22727
22979
|
resizeHeight: 0,
|
|
22728
|
-
oTop: 0
|
|
22980
|
+
oTop: 0,
|
|
22981
|
+
expandHeight: 0
|
|
22729
22982
|
};
|
|
22730
22983
|
fullDataRowIdData[rowid] = rest;
|
|
22731
22984
|
fullAllDataRowIdData[rowid] = rest;
|
|
22732
22985
|
}
|
|
22733
22986
|
});
|
|
22734
|
-
}
|
|
22987
|
+
};
|
|
22735
22988
|
const handleInsertRowAt = (records, targetRow, isInsertNextRow) => {
|
|
22736
22989
|
const {
|
|
22737
22990
|
treeConfig
|
|
@@ -22781,7 +23034,8 @@ edit_hook_hooks.add('tableEditModule', {
|
|
|
22781
23034
|
level: 0,
|
|
22782
23035
|
height: 0,
|
|
22783
23036
|
resizeHeight: 0,
|
|
22784
|
-
oTop: 0
|
|
23037
|
+
oTop: 0,
|
|
23038
|
+
expandHeight: 0
|
|
22785
23039
|
};
|
|
22786
23040
|
fullDataRowIdData[rowid] = rest;
|
|
22787
23041
|
fullAllDataRowIdData[rowid] = rest;
|
|
@@ -22819,7 +23073,8 @@ edit_hook_hooks.add('tableEditModule', {
|
|
|
22819
23073
|
level: 0,
|
|
22820
23074
|
height: 0,
|
|
22821
23075
|
resizeHeight: 0,
|
|
22822
|
-
oTop: 0
|
|
23076
|
+
oTop: 0,
|
|
23077
|
+
expandHeight: 0
|
|
22823
23078
|
};
|
|
22824
23079
|
fullDataRowIdData[rowid] = rest;
|
|
22825
23080
|
fullAllDataRowIdData[rowid] = rest;
|
|
@@ -22880,7 +23135,8 @@ edit_hook_hooks.add('tableEditModule', {
|
|
|
22880
23135
|
level: parentLevel + 1,
|
|
22881
23136
|
height: 0,
|
|
22882
23137
|
resizeHeight: 0,
|
|
22883
|
-
oTop: 0
|
|
23138
|
+
oTop: 0,
|
|
23139
|
+
expandHeight: 0
|
|
22884
23140
|
};
|
|
22885
23141
|
fullDataRowIdData[rowid] = rest;
|
|
22886
23142
|
fullAllDataRowIdData[rowid] = rest;
|
|
@@ -23050,6 +23306,160 @@ edit_hook_hooks.add('tableEditModule', {
|
|
|
23050
23306
|
}
|
|
23051
23307
|
});
|
|
23052
23308
|
};
|
|
23309
|
+
const handleEditActive = (params, evnt, isFocus) => {
|
|
23310
|
+
const {
|
|
23311
|
+
editConfig,
|
|
23312
|
+
mouseConfig
|
|
23313
|
+
} = props;
|
|
23314
|
+
const {
|
|
23315
|
+
editStore,
|
|
23316
|
+
tableColumn
|
|
23317
|
+
} = reactData;
|
|
23318
|
+
const editOpts = computeEditOpts.value;
|
|
23319
|
+
const {
|
|
23320
|
+
mode
|
|
23321
|
+
} = editOpts;
|
|
23322
|
+
const {
|
|
23323
|
+
actived,
|
|
23324
|
+
focused
|
|
23325
|
+
} = editStore;
|
|
23326
|
+
const {
|
|
23327
|
+
row,
|
|
23328
|
+
column
|
|
23329
|
+
} = params;
|
|
23330
|
+
const {
|
|
23331
|
+
editRender
|
|
23332
|
+
} = column;
|
|
23333
|
+
const cell = params.cell || $xeTable.getCellElement(row, column);
|
|
23334
|
+
const beforeEditMethod = editOpts.beforeEditMethod || editOpts.activeMethod;
|
|
23335
|
+
params.cell = cell;
|
|
23336
|
+
if (cell && isEnableConf(editConfig) && isEnableConf(editRender)) {
|
|
23337
|
+
// 激活编辑
|
|
23338
|
+
if (!$xeTable.isPendingByRow(row)) {
|
|
23339
|
+
if (actived.row !== row || (mode === 'cell' ? actived.column !== column : false)) {
|
|
23340
|
+
// 判断是否禁用编辑
|
|
23341
|
+
let type = 'edit-disabled';
|
|
23342
|
+
if (!beforeEditMethod || beforeEditMethod({
|
|
23343
|
+
...params,
|
|
23344
|
+
$table: $xeTable,
|
|
23345
|
+
$grid: $xeTable.xegrid
|
|
23346
|
+
})) {
|
|
23347
|
+
if (mouseConfig) {
|
|
23348
|
+
$xeTable.clearSelected();
|
|
23349
|
+
if ($xeTable.clearCellAreas) {
|
|
23350
|
+
$xeTable.clearCellAreas();
|
|
23351
|
+
$xeTable.clearCopyCellArea();
|
|
23352
|
+
}
|
|
23353
|
+
}
|
|
23354
|
+
$xeTable.closeTooltip();
|
|
23355
|
+
if (actived.column) {
|
|
23356
|
+
handleClearEdit(evnt);
|
|
23357
|
+
}
|
|
23358
|
+
type = 'edit-activated';
|
|
23359
|
+
column.renderHeight = cell.offsetHeight;
|
|
23360
|
+
actived.args = params;
|
|
23361
|
+
actived.row = row;
|
|
23362
|
+
actived.column = column;
|
|
23363
|
+
if (mode === 'row') {
|
|
23364
|
+
tableColumn.forEach(column => getEditColumnModel(row, column));
|
|
23365
|
+
} else {
|
|
23366
|
+
getEditColumnModel(row, column);
|
|
23367
|
+
}
|
|
23368
|
+
const afterEditMethod = editOpts.afterEditMethod;
|
|
23369
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => {
|
|
23370
|
+
if (isFocus) {
|
|
23371
|
+
$xeTable.handleFocus(params, evnt);
|
|
23372
|
+
}
|
|
23373
|
+
if (afterEditMethod) {
|
|
23374
|
+
afterEditMethod({
|
|
23375
|
+
...params,
|
|
23376
|
+
$table: $xeTable,
|
|
23377
|
+
$grid: $xeTable.xegrid
|
|
23378
|
+
});
|
|
23379
|
+
}
|
|
23380
|
+
});
|
|
23381
|
+
}
|
|
23382
|
+
$xeTable.dispatchEvent(type, {
|
|
23383
|
+
row,
|
|
23384
|
+
rowIndex: $xeTable.getRowIndex(row),
|
|
23385
|
+
$rowIndex: $xeTable.getVMRowIndex(row),
|
|
23386
|
+
column,
|
|
23387
|
+
columnIndex: $xeTable.getColumnIndex(column),
|
|
23388
|
+
$columnIndex: $xeTable.getVMColumnIndex(column)
|
|
23389
|
+
}, evnt);
|
|
23390
|
+
// v4已废弃
|
|
23391
|
+
if (type === 'edit-activated') {
|
|
23392
|
+
$xeTable.dispatchEvent('edit-actived', {
|
|
23393
|
+
row,
|
|
23394
|
+
rowIndex: $xeTable.getRowIndex(row),
|
|
23395
|
+
$rowIndex: $xeTable.getVMRowIndex(row),
|
|
23396
|
+
column,
|
|
23397
|
+
columnIndex: $xeTable.getColumnIndex(column),
|
|
23398
|
+
$columnIndex: $xeTable.getVMColumnIndex(column)
|
|
23399
|
+
}, evnt);
|
|
23400
|
+
}
|
|
23401
|
+
} else {
|
|
23402
|
+
const {
|
|
23403
|
+
column: oldColumn
|
|
23404
|
+
} = actived;
|
|
23405
|
+
if (mouseConfig) {
|
|
23406
|
+
$xeTable.clearSelected();
|
|
23407
|
+
if ($xeTable.clearCellAreas) {
|
|
23408
|
+
$xeTable.clearCellAreas();
|
|
23409
|
+
$xeTable.clearCopyCellArea();
|
|
23410
|
+
}
|
|
23411
|
+
}
|
|
23412
|
+
if (oldColumn !== column) {
|
|
23413
|
+
const {
|
|
23414
|
+
model: oldModel
|
|
23415
|
+
} = oldColumn;
|
|
23416
|
+
if (oldModel.update) {
|
|
23417
|
+
setCellValue(row, oldColumn, oldModel.value);
|
|
23418
|
+
}
|
|
23419
|
+
if ($xeTable.clearValidate) {
|
|
23420
|
+
$xeTable.clearValidate(row, column);
|
|
23421
|
+
}
|
|
23422
|
+
}
|
|
23423
|
+
column.renderHeight = cell.offsetHeight;
|
|
23424
|
+
actived.args = params;
|
|
23425
|
+
actived.column = column;
|
|
23426
|
+
if (isFocus) {
|
|
23427
|
+
setTimeout(() => {
|
|
23428
|
+
$xeTable.handleFocus(params, evnt);
|
|
23429
|
+
});
|
|
23430
|
+
}
|
|
23431
|
+
}
|
|
23432
|
+
focused.column = null;
|
|
23433
|
+
focused.row = null;
|
|
23434
|
+
$xeTable.focus();
|
|
23435
|
+
}
|
|
23436
|
+
}
|
|
23437
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
23438
|
+
};
|
|
23439
|
+
const handleEditCell = (row, fieldOrColumn, isPos) => {
|
|
23440
|
+
const {
|
|
23441
|
+
editConfig
|
|
23442
|
+
} = props;
|
|
23443
|
+
const column = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(fieldOrColumn) ? $xeTable.getColumnByField(fieldOrColumn) : fieldOrColumn;
|
|
23444
|
+
if (row && column && isEnableConf(editConfig) && isEnableConf(column.editRender)) {
|
|
23445
|
+
return Promise.resolve(isPos ? $xeTable.scrollToRow(row, column) : null).then(() => {
|
|
23446
|
+
const cell = $xeTable.getCellElement(row, column);
|
|
23447
|
+
if (cell) {
|
|
23448
|
+
handleEditActive({
|
|
23449
|
+
row,
|
|
23450
|
+
rowIndex: $xeTable.getRowIndex(row),
|
|
23451
|
+
column,
|
|
23452
|
+
columnIndex: $xeTable.getColumnIndex(column),
|
|
23453
|
+
cell,
|
|
23454
|
+
$table: $xeTable
|
|
23455
|
+
}, null, false);
|
|
23456
|
+
internalData._lastCallTime = Date.now();
|
|
23457
|
+
}
|
|
23458
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
23459
|
+
});
|
|
23460
|
+
}
|
|
23461
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
23462
|
+
};
|
|
23053
23463
|
editMethods = {
|
|
23054
23464
|
/**
|
|
23055
23465
|
* 往表格中插入临时数据
|
|
@@ -23444,7 +23854,7 @@ edit_hook_hooks.add('tableEditModule', {
|
|
|
23444
23854
|
if (fieldOrColumn) {
|
|
23445
23855
|
column = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(fieldOrColumn) ? $xeTable.getColumnByField(fieldOrColumn) : fieldOrColumn;
|
|
23446
23856
|
}
|
|
23447
|
-
return
|
|
23857
|
+
return handleEditCell(row, column, false);
|
|
23448
23858
|
},
|
|
23449
23859
|
setActiveCell(row, fieldOrColumn) {
|
|
23450
23860
|
if (true) {
|
|
@@ -23457,28 +23867,7 @@ edit_hook_hooks.add('tableEditModule', {
|
|
|
23457
23867
|
* 激活单元格编辑
|
|
23458
23868
|
*/
|
|
23459
23869
|
setEditCell(row, fieldOrColumn) {
|
|
23460
|
-
|
|
23461
|
-
editConfig
|
|
23462
|
-
} = props;
|
|
23463
|
-
const column = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(fieldOrColumn) ? $xeTable.getColumnByField(fieldOrColumn) : fieldOrColumn;
|
|
23464
|
-
if (row && column && isEnableConf(editConfig) && isEnableConf(column.editRender)) {
|
|
23465
|
-
return $xeTable.scrollToRow(row, column).then(() => {
|
|
23466
|
-
const cell = $xeTable.getCellElement(row, column);
|
|
23467
|
-
if (cell) {
|
|
23468
|
-
editPrivateMethods.handleEdit({
|
|
23469
|
-
row,
|
|
23470
|
-
rowIndex: $xeTable.getRowIndex(row),
|
|
23471
|
-
column,
|
|
23472
|
-
columnIndex: $xeTable.getColumnIndex(column),
|
|
23473
|
-
cell,
|
|
23474
|
-
$table: $xeTable
|
|
23475
|
-
});
|
|
23476
|
-
internalData._lastCallTime = Date.now();
|
|
23477
|
-
}
|
|
23478
|
-
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
23479
|
-
});
|
|
23480
|
-
}
|
|
23481
|
-
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
23870
|
+
return handleEditCell(row, fieldOrColumn, true);
|
|
23482
23871
|
},
|
|
23483
23872
|
/**
|
|
23484
23873
|
* 只对 trigger=dblclick 有效,选中单元格
|
|
@@ -23511,130 +23900,7 @@ edit_hook_hooks.add('tableEditModule', {
|
|
|
23511
23900
|
* 处理激活编辑
|
|
23512
23901
|
*/
|
|
23513
23902
|
handleEdit(params, evnt) {
|
|
23514
|
-
|
|
23515
|
-
editConfig,
|
|
23516
|
-
mouseConfig
|
|
23517
|
-
} = props;
|
|
23518
|
-
const {
|
|
23519
|
-
editStore,
|
|
23520
|
-
tableColumn
|
|
23521
|
-
} = reactData;
|
|
23522
|
-
const editOpts = computeEditOpts.value;
|
|
23523
|
-
const {
|
|
23524
|
-
mode
|
|
23525
|
-
} = editOpts;
|
|
23526
|
-
const {
|
|
23527
|
-
actived,
|
|
23528
|
-
focused
|
|
23529
|
-
} = editStore;
|
|
23530
|
-
const {
|
|
23531
|
-
row,
|
|
23532
|
-
column
|
|
23533
|
-
} = params;
|
|
23534
|
-
const {
|
|
23535
|
-
editRender
|
|
23536
|
-
} = column;
|
|
23537
|
-
const cell = params.cell || $xeTable.getCellElement(row, column);
|
|
23538
|
-
const beforeEditMethod = editOpts.beforeEditMethod || editOpts.activeMethod;
|
|
23539
|
-
params.cell = cell;
|
|
23540
|
-
if (cell && isEnableConf(editConfig) && isEnableConf(editRender)) {
|
|
23541
|
-
// 激活编辑
|
|
23542
|
-
if (!$xeTable.isPendingByRow(row)) {
|
|
23543
|
-
if (actived.row !== row || (mode === 'cell' ? actived.column !== column : false)) {
|
|
23544
|
-
// 判断是否禁用编辑
|
|
23545
|
-
let type = 'edit-disabled';
|
|
23546
|
-
if (!beforeEditMethod || beforeEditMethod({
|
|
23547
|
-
...params,
|
|
23548
|
-
$table: $xeTable,
|
|
23549
|
-
$grid: $xeTable.xegrid
|
|
23550
|
-
})) {
|
|
23551
|
-
if (mouseConfig) {
|
|
23552
|
-
editMethods.clearSelected();
|
|
23553
|
-
if ($xeTable.clearCellAreas) {
|
|
23554
|
-
$xeTable.clearCellAreas();
|
|
23555
|
-
$xeTable.clearCopyCellArea();
|
|
23556
|
-
}
|
|
23557
|
-
}
|
|
23558
|
-
$xeTable.closeTooltip();
|
|
23559
|
-
if (actived.column) {
|
|
23560
|
-
handleClearEdit(evnt);
|
|
23561
|
-
}
|
|
23562
|
-
type = 'edit-activated';
|
|
23563
|
-
column.renderHeight = cell.offsetHeight;
|
|
23564
|
-
actived.args = params;
|
|
23565
|
-
actived.row = row;
|
|
23566
|
-
actived.column = column;
|
|
23567
|
-
if (mode === 'row') {
|
|
23568
|
-
tableColumn.forEach(column => getEditColumnModel(row, column));
|
|
23569
|
-
} else {
|
|
23570
|
-
getEditColumnModel(row, column);
|
|
23571
|
-
}
|
|
23572
|
-
const afterEditMethod = editOpts.afterEditMethod;
|
|
23573
|
-
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => {
|
|
23574
|
-
editPrivateMethods.handleFocus(params, evnt);
|
|
23575
|
-
if (afterEditMethod) {
|
|
23576
|
-
afterEditMethod({
|
|
23577
|
-
...params,
|
|
23578
|
-
$table: $xeTable,
|
|
23579
|
-
$grid: $xeTable.xegrid
|
|
23580
|
-
});
|
|
23581
|
-
}
|
|
23582
|
-
});
|
|
23583
|
-
}
|
|
23584
|
-
$xeTable.dispatchEvent(type, {
|
|
23585
|
-
row,
|
|
23586
|
-
rowIndex: $xeTable.getRowIndex(row),
|
|
23587
|
-
$rowIndex: $xeTable.getVMRowIndex(row),
|
|
23588
|
-
column,
|
|
23589
|
-
columnIndex: $xeTable.getColumnIndex(column),
|
|
23590
|
-
$columnIndex: $xeTable.getVMColumnIndex(column)
|
|
23591
|
-
}, evnt);
|
|
23592
|
-
// v4已废弃
|
|
23593
|
-
if (type === 'edit-activated') {
|
|
23594
|
-
$xeTable.dispatchEvent('edit-actived', {
|
|
23595
|
-
row,
|
|
23596
|
-
rowIndex: $xeTable.getRowIndex(row),
|
|
23597
|
-
$rowIndex: $xeTable.getVMRowIndex(row),
|
|
23598
|
-
column,
|
|
23599
|
-
columnIndex: $xeTable.getColumnIndex(column),
|
|
23600
|
-
$columnIndex: $xeTable.getVMColumnIndex(column)
|
|
23601
|
-
}, evnt);
|
|
23602
|
-
}
|
|
23603
|
-
} else {
|
|
23604
|
-
const {
|
|
23605
|
-
column: oldColumn
|
|
23606
|
-
} = actived;
|
|
23607
|
-
if (mouseConfig) {
|
|
23608
|
-
editMethods.clearSelected();
|
|
23609
|
-
if ($xeTable.clearCellAreas) {
|
|
23610
|
-
$xeTable.clearCellAreas();
|
|
23611
|
-
$xeTable.clearCopyCellArea();
|
|
23612
|
-
}
|
|
23613
|
-
}
|
|
23614
|
-
if (oldColumn !== column) {
|
|
23615
|
-
const {
|
|
23616
|
-
model: oldModel
|
|
23617
|
-
} = oldColumn;
|
|
23618
|
-
if (oldModel.update) {
|
|
23619
|
-
setCellValue(row, oldColumn, oldModel.value);
|
|
23620
|
-
}
|
|
23621
|
-
if ($xeTable.clearValidate) {
|
|
23622
|
-
$xeTable.clearValidate(row, column);
|
|
23623
|
-
}
|
|
23624
|
-
}
|
|
23625
|
-
column.renderHeight = cell.offsetHeight;
|
|
23626
|
-
actived.args = params;
|
|
23627
|
-
actived.column = column;
|
|
23628
|
-
setTimeout(() => {
|
|
23629
|
-
editPrivateMethods.handleFocus(params, evnt);
|
|
23630
|
-
});
|
|
23631
|
-
}
|
|
23632
|
-
focused.column = null;
|
|
23633
|
-
focused.row = null;
|
|
23634
|
-
$xeTable.focus();
|
|
23635
|
-
}
|
|
23636
|
-
}
|
|
23637
|
-
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
23903
|
+
return handleEditActive(params, evnt, true);
|
|
23638
23904
|
},
|
|
23639
23905
|
/**
|
|
23640
23906
|
* @deprecated
|