vxe-table 3.18.0 → 3.18.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/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/mixin.js +58 -20
- package/es/table/module/filter/mixin.js +12 -10
- package/es/table/module/menu/mixin.js +16 -9
- package/es/table/module/validator/mixin.js +4 -2
- package/es/table/src/column.js +2 -0
- package/es/table/src/columnInfo.js +1 -0
- package/es/table/src/footer.js +7 -5
- package/es/table/src/header.js +67 -28
- package/es/table/src/methods.js +577 -85
- package/es/table/src/props.js +23 -6
- package/es/table/src/store.js +8 -0
- package/es/table/src/table.js +67 -26
- package/es/table/src/util.js +70 -2
- package/es/table/style.css +11 -17
- 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 +11 -17
- 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 +1002 -200
- 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/mixin.js +55 -16
- package/lib/table/module/edit/mixin.min.js +1 -1
- package/lib/table/module/filter/mixin.js +12 -10
- package/lib/table/module/filter/mixin.min.js +1 -1
- package/lib/table/module/menu/mixin.js +20 -13
- package/lib/table/module/menu/mixin.min.js +1 -1
- package/lib/table/module/validator/mixin.js +4 -2
- package/lib/table/module/validator/mixin.min.js +1 -1
- package/lib/table/src/column.js +2 -0
- package/lib/table/src/column.min.js +1 -1
- package/lib/table/src/columnInfo.js +1 -0
- package/lib/table/src/columnInfo.min.js +1 -1
- package/lib/table/src/footer.js +7 -5
- package/lib/table/src/header.js +82 -25
- package/lib/table/src/header.min.js +1 -1
- package/lib/table/src/methods.js +647 -94
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/props.js +11 -3
- package/lib/table/src/props.min.js +1 -1
- package/lib/table/src/store.js +15 -0
- package/lib/table/src/store.min.js +1 -0
- package/lib/table/src/table.js +74 -25
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +74 -2
- package/lib/table/src/util.min.js +1 -1
- package/lib/table/style/style.css +11 -17
- 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 +11 -17
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +1 -1
- package/packages/table/module/edit/mixin.ts +59 -23
- package/packages/table/module/filter/mixin.ts +17 -13
- package/packages/table/module/menu/mixin.ts +16 -9
- package/packages/table/module/validator/mixin.ts +8 -4
- package/packages/table/src/column.ts +4 -2
- package/packages/table/src/columnInfo.ts +1 -0
- package/packages/table/src/footer.ts +11 -9
- package/packages/table/src/header.ts +76 -34
- package/packages/table/src/methods.ts +607 -90
- package/packages/table/src/props.ts +29 -12
- package/packages/table/src/store.ts +15 -0
- package/packages/table/src/table.ts +79 -24
- package/packages/table/src/util.ts +76 -2
- package/styles/components/table.scss +33 -55
- /package/es/{iconfont.1756083626568.ttf → iconfont.1756452257212.ttf} +0 -0
- /package/es/{iconfont.1756083626568.woff → iconfont.1756452257212.woff} +0 -0
- /package/es/{iconfont.1756083626568.woff2 → iconfont.1756452257212.woff2} +0 -0
- /package/lib/{iconfont.1756083626568.ttf → iconfont.1756452257212.ttf} +0 -0
- /package/lib/{iconfont.1756083626568.woff → iconfont.1756452257212.woff} +0 -0
- /package/lib/{iconfont.1756083626568.woff2 → iconfont.1756452257212.woff2} +0 -0
package/lib/index.umd.js
CHANGED
|
@@ -2002,7 +2002,7 @@ function getClass(property, params) {
|
|
|
2002
2002
|
;// CONCATENATED MODULE: ./packages/ui/index.ts
|
|
2003
2003
|
|
|
2004
2004
|
|
|
2005
|
-
const version = "3.18.
|
|
2005
|
+
const version = "3.18.2";
|
|
2006
2006
|
core_.VxeUI.version = version;
|
|
2007
2007
|
core_.VxeUI.tableVersion = version;
|
|
2008
2008
|
core_.VxeUI.setConfig({
|
|
@@ -2678,7 +2678,7 @@ function isNodeElement(elem) {
|
|
|
2678
2678
|
const {
|
|
2679
2679
|
log: log_log
|
|
2680
2680
|
} = core_.VxeUI;
|
|
2681
|
-
const log_version = `table v${"3.18.
|
|
2681
|
+
const log_version = `table v${"3.18.2"}`;
|
|
2682
2682
|
const warnLog = log_log.create('warn', log_version);
|
|
2683
2683
|
const errLog = log_log.create('error', log_version);
|
|
2684
2684
|
;// CONCATENATED MODULE: ./packages/table/src/columnInfo.ts
|
|
@@ -2781,6 +2781,7 @@ class ColumnInfo {
|
|
|
2781
2781
|
headerClassName: _vm.headerClassName,
|
|
2782
2782
|
footerClassName: _vm.footerClassName,
|
|
2783
2783
|
formatter,
|
|
2784
|
+
headerFormatter: _vm.headerFormatter,
|
|
2784
2785
|
footerFormatter: _vm.footerFormatter,
|
|
2785
2786
|
padding: _vm.padding,
|
|
2786
2787
|
verticalAlign: _vm.verticalAlign,
|
|
@@ -2971,14 +2972,19 @@ function createInternalData() {
|
|
|
2971
2972
|
sourceDataRowIdData: {},
|
|
2972
2973
|
fullColumnIdData: {},
|
|
2973
2974
|
fullColumnFieldData: {},
|
|
2975
|
+
// 合并表头单元格的数据
|
|
2976
|
+
mergeHeaderList: [],
|
|
2977
|
+
mergeHeaderMaps: {},
|
|
2978
|
+
// 已合并单元格数据集合
|
|
2979
|
+
mergeHeaderCellMaps: {},
|
|
2974
2980
|
// 合并单元格的数据
|
|
2975
2981
|
mergeBodyList: [],
|
|
2976
2982
|
mergeBodyMaps: {},
|
|
2983
|
+
// 已合并单元格数据集合
|
|
2984
|
+
mergeBodyCellMaps: {},
|
|
2977
2985
|
// 合并表尾的数据
|
|
2978
2986
|
mergeFooterList: [],
|
|
2979
2987
|
mergeFooterMaps: {},
|
|
2980
|
-
// 已合并单元格数据集合
|
|
2981
|
-
mergeBodyCellMaps: {},
|
|
2982
2988
|
// 已合并表尾数据集合
|
|
2983
2989
|
mergeFooterCellMaps: {},
|
|
2984
2990
|
// 已展开的行集合
|
|
@@ -3069,6 +3075,72 @@ const convertHeaderColumnToRows = originColumns => {
|
|
|
3069
3075
|
});
|
|
3070
3076
|
return rows;
|
|
3071
3077
|
};
|
|
3078
|
+
function convertHeaderToGridRows(spanColumns) {
|
|
3079
|
+
const rSize = spanColumns.length;
|
|
3080
|
+
const cSize = spanColumns[0].reduce((sum, cell) => sum + cell.colSpan, 0);
|
|
3081
|
+
const occupiedRows = [];
|
|
3082
|
+
const fullRows = [];
|
|
3083
|
+
for (let rIndex = 0; rIndex < rSize; rIndex++) {
|
|
3084
|
+
const oCols = [];
|
|
3085
|
+
const dCols = [];
|
|
3086
|
+
for (let cIndex = 0; cIndex < cSize; cIndex++) {
|
|
3087
|
+
oCols.push(false);
|
|
3088
|
+
dCols.push('');
|
|
3089
|
+
}
|
|
3090
|
+
occupiedRows.push(oCols);
|
|
3091
|
+
fullRows.push(dCols);
|
|
3092
|
+
}
|
|
3093
|
+
for (let rIndex = 0; rIndex < rSize; rIndex++) {
|
|
3094
|
+
let currColIndex = 0;
|
|
3095
|
+
for (const column of spanColumns[rIndex]) {
|
|
3096
|
+
const {
|
|
3097
|
+
colSpan,
|
|
3098
|
+
rowSpan
|
|
3099
|
+
} = column;
|
|
3100
|
+
let startColIndex = -1;
|
|
3101
|
+
for (let ccIndex = currColIndex; ccIndex <= cSize - colSpan; ccIndex++) {
|
|
3102
|
+
let oFlag = true;
|
|
3103
|
+
for (let csIndex = 0; csIndex < colSpan; csIndex++) {
|
|
3104
|
+
if (occupiedRows[rIndex][ccIndex + csIndex]) {
|
|
3105
|
+
oFlag = false;
|
|
3106
|
+
break;
|
|
3107
|
+
}
|
|
3108
|
+
}
|
|
3109
|
+
if (oFlag) {
|
|
3110
|
+
startColIndex = ccIndex;
|
|
3111
|
+
break;
|
|
3112
|
+
}
|
|
3113
|
+
}
|
|
3114
|
+
if (startColIndex === -1) {
|
|
3115
|
+
for (let j = 0; j <= cSize - colSpan; j++) {
|
|
3116
|
+
let oFlag = true;
|
|
3117
|
+
for (let k = 0; k < colSpan; k++) {
|
|
3118
|
+
if (occupiedRows[rIndex][j + k]) {
|
|
3119
|
+
oFlag = false;
|
|
3120
|
+
break;
|
|
3121
|
+
}
|
|
3122
|
+
}
|
|
3123
|
+
if (oFlag) {
|
|
3124
|
+
startColIndex = j;
|
|
3125
|
+
break;
|
|
3126
|
+
}
|
|
3127
|
+
}
|
|
3128
|
+
if (startColIndex === -1) {
|
|
3129
|
+
// error
|
|
3130
|
+
break;
|
|
3131
|
+
}
|
|
3132
|
+
}
|
|
3133
|
+
for (let srIndex = rIndex; srIndex < rIndex + rowSpan; srIndex++) {
|
|
3134
|
+
for (let scIndex = startColIndex; scIndex < startColIndex + colSpan; scIndex++) {
|
|
3135
|
+
occupiedRows[srIndex][scIndex] = true;
|
|
3136
|
+
fullRows[srIndex][scIndex] = column;
|
|
3137
|
+
}
|
|
3138
|
+
}
|
|
3139
|
+
currColIndex = startColIndex + colSpan;
|
|
3140
|
+
}
|
|
3141
|
+
}
|
|
3142
|
+
return fullRows;
|
|
3143
|
+
}
|
|
3072
3144
|
function restoreScrollLocation($xeTable, scrollLeft, scrollTop) {
|
|
3073
3145
|
const internalData = $xeTable;
|
|
3074
3146
|
if (scrollLeft || scrollTop) {
|
|
@@ -5163,6 +5235,8 @@ const columnProps = {
|
|
|
5163
5235
|
footerClassName: [String, Function],
|
|
5164
5236
|
// 格式化显示内容
|
|
5165
5237
|
formatter: [Function, Array, String],
|
|
5238
|
+
// 格式化表头显示内容
|
|
5239
|
+
headerFormatter: [Function, Array, String],
|
|
5166
5240
|
// 格式化表尾显示内容
|
|
5167
5241
|
footerFormatter: [Function, Array, String],
|
|
5168
5242
|
// 是否显示间距
|
|
@@ -5392,7 +5466,7 @@ const tableProps = {
|
|
|
5392
5466
|
// 表格的最小高度
|
|
5393
5467
|
minHeight: {
|
|
5394
5468
|
type: [Number, String],
|
|
5395
|
-
default: () =>
|
|
5469
|
+
default: () => null
|
|
5396
5470
|
},
|
|
5397
5471
|
// 表格的最大高度
|
|
5398
5472
|
maxHeight: [Number, String],
|
|
@@ -5511,9 +5585,17 @@ const tableProps = {
|
|
|
5511
5585
|
headerRowStyle: [Object, Function],
|
|
5512
5586
|
// 给表尾行附加样式
|
|
5513
5587
|
footerRowStyle: [Object, Function],
|
|
5514
|
-
//
|
|
5588
|
+
// 用于分组表头,显示为自定义列头,配合 mergeHeaderCells 灵活实现自定义合并
|
|
5589
|
+
showCustomHeader: {
|
|
5590
|
+
type: Boolean,
|
|
5591
|
+
default: () => props_getConfig().table.showCustomHeader
|
|
5592
|
+
},
|
|
5593
|
+
// 临时合并指定的表头单元格
|
|
5594
|
+
mergeHeaderCells: Array,
|
|
5595
|
+
// 临时合并指定的单元格
|
|
5515
5596
|
mergeCells: Array,
|
|
5516
|
-
//
|
|
5597
|
+
// 临时合并指定的表尾单元格
|
|
5598
|
+
mergeFooterCells: Array,
|
|
5517
5599
|
mergeFooterItems: Array,
|
|
5518
5600
|
// 自定义合并行或列的方法
|
|
5519
5601
|
spanMethod: Function,
|
|
@@ -5730,6 +5812,15 @@ function clearColAnimate(elem, clss) {
|
|
|
5730
5812
|
}
|
|
5731
5813
|
}, 500);
|
|
5732
5814
|
}
|
|
5815
|
+
;// CONCATENATED MODULE: ./packages/table/src/store.ts
|
|
5816
|
+
// 跨表拖拽
|
|
5817
|
+
const crossTableDragRowGlobal = {
|
|
5818
|
+
row: null
|
|
5819
|
+
};
|
|
5820
|
+
function getCrossTableDragRowInfo($xeTable) {
|
|
5821
|
+
const crossTableDragRowInfo = $xeTable.crossTableDragRowInfo;
|
|
5822
|
+
return crossTableDragRowInfo;
|
|
5823
|
+
}
|
|
5733
5824
|
;// CONCATENATED MODULE: ./packages/table/src/methods.ts
|
|
5734
5825
|
|
|
5735
5826
|
|
|
@@ -5741,6 +5832,7 @@ function clearColAnimate(elem, clss) {
|
|
|
5741
5832
|
|
|
5742
5833
|
|
|
5743
5834
|
|
|
5835
|
+
|
|
5744
5836
|
const {
|
|
5745
5837
|
getConfig: methods_getConfig,
|
|
5746
5838
|
getI18n: methods_getI18n,
|
|
@@ -5754,6 +5846,7 @@ const supportMaxRow = 5e6;
|
|
|
5754
5846
|
const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
5755
5847
|
const maxYHeight = 5e6;
|
|
5756
5848
|
const maxXWidth = 5e6;
|
|
5849
|
+
let crossTableDragRowObj = null;
|
|
5757
5850
|
function eqCellValue(row1, row2, field) {
|
|
5758
5851
|
const val1 = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row1, field);
|
|
5759
5852
|
const val2 = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row2, field);
|
|
@@ -7001,20 +7094,25 @@ function updateStyle($xeTable) {
|
|
|
7001
7094
|
emptyPlaceholderElem.style.top = `${tHeaderHeight}px`;
|
|
7002
7095
|
emptyPlaceholderElem.style.height = bodyWrapperElem ? `${bodyWrapperElem.offsetHeight - osbHeight}px` : '';
|
|
7003
7096
|
}
|
|
7097
|
+
const scrollbarXConf = scrollbarOpts.x || {};
|
|
7004
7098
|
const scrollbarXToTop = $xeTable.computeScrollbarXToTop;
|
|
7099
|
+
const scrollbarYConf = scrollbarOpts.y || {};
|
|
7005
7100
|
const scrollbarYToLeft = $xeTable.computeScrollbarYToLeft;
|
|
7006
7101
|
let xScrollbarVisible = overflowX ? 'visible' : 'hidden';
|
|
7007
|
-
if ($xeGanttView) {
|
|
7102
|
+
if (scrollbarXConf.visible === 'visible' || $xeGanttView) {
|
|
7008
7103
|
osbHeight = scrollbarHeight;
|
|
7009
7104
|
xScrollbarVisible = 'visible';
|
|
7010
|
-
} else if (
|
|
7105
|
+
} else if (scrollbarXConf.visible === 'hidden' || scrollbarXConf.visible === false) {
|
|
7011
7106
|
osbHeight = 0;
|
|
7012
7107
|
xScrollbarVisible = 'hidden';
|
|
7013
7108
|
}
|
|
7014
7109
|
let yScrollbarVisible = overflowY ? 'visible' : 'hidden';
|
|
7015
|
-
if (
|
|
7110
|
+
if (scrollbarYConf.visible === 'hidden' || scrollbarYConf.visible === false || $xeGanttView && !scrollbarYToLeft) {
|
|
7016
7111
|
osbWidth = 0;
|
|
7017
7112
|
yScrollbarVisible = 'hidden';
|
|
7113
|
+
} else if (scrollbarYConf.visible === 'visible') {
|
|
7114
|
+
osbWidth = scrollbarWidth;
|
|
7115
|
+
yScrollbarVisible = 'visible';
|
|
7018
7116
|
}
|
|
7019
7117
|
let tbHeight = 0;
|
|
7020
7118
|
let bodyMaxHeight = 0;
|
|
@@ -7054,7 +7152,7 @@ function updateStyle($xeTable) {
|
|
|
7054
7152
|
}
|
|
7055
7153
|
if (xRightCornerEl) {
|
|
7056
7154
|
xRightCornerEl.style.width = scrollbarXToTop ? '' : `${osbWidth}px`;
|
|
7057
|
-
xRightCornerEl.style.display = scrollbarXToTop ? '' :
|
|
7155
|
+
xRightCornerEl.style.display = scrollbarXToTop ? '' : xScrollbarVisible === 'visible' ? 'block' : '';
|
|
7058
7156
|
}
|
|
7059
7157
|
const scrollYVirtualEl = $xeTable.$refs.refScrollYVirtualElem;
|
|
7060
7158
|
if (scrollYVirtualEl) {
|
|
@@ -7065,7 +7163,7 @@ function updateStyle($xeTable) {
|
|
|
7065
7163
|
const yTopCornerEl = $xeTable.$refs.refScrollYTopCornerElem;
|
|
7066
7164
|
if (yTopCornerEl) {
|
|
7067
7165
|
yTopCornerEl.style.height = `${tHeaderHeight}px`;
|
|
7068
|
-
yTopCornerEl.style.display =
|
|
7166
|
+
yTopCornerEl.style.display = tHeaderHeight && yScrollbarVisible === 'visible' ? 'block' : '';
|
|
7069
7167
|
}
|
|
7070
7168
|
const yWrapperEl = $xeTable.$refs.refScrollYWrapperElem;
|
|
7071
7169
|
if (yWrapperEl) {
|
|
@@ -7076,7 +7174,7 @@ function updateStyle($xeTable) {
|
|
|
7076
7174
|
if (yBottomCornerEl) {
|
|
7077
7175
|
yBottomCornerEl.style.height = `${tFooterHeight}px`;
|
|
7078
7176
|
yBottomCornerEl.style.top = `${tHeaderHeight + tbHeight}px`;
|
|
7079
|
-
yBottomCornerEl.style.display =
|
|
7177
|
+
yBottomCornerEl.style.display = tFooterHeight && yScrollbarVisible === 'visible' ? 'block' : '';
|
|
7080
7178
|
}
|
|
7081
7179
|
const rowExpandEl = $xeTable.$refs.refRowExpandElem;
|
|
7082
7180
|
if (rowExpandEl) {
|
|
@@ -8104,15 +8202,71 @@ function handleBodyMerge($xeTable, merges) {
|
|
|
8104
8202
|
});
|
|
8105
8203
|
}
|
|
8106
8204
|
}
|
|
8107
|
-
function
|
|
8205
|
+
function removeBodyMerges($xeTable, merges) {
|
|
8206
|
+
const internalData = $xeTable;
|
|
8207
|
+
const {
|
|
8208
|
+
mergeBodyList,
|
|
8209
|
+
fullColumnIdData,
|
|
8210
|
+
fullAllDataRowIdData,
|
|
8211
|
+
mergeBodyMaps
|
|
8212
|
+
} = internalData;
|
|
8213
|
+
const rest = [];
|
|
8214
|
+
if (merges) {
|
|
8215
|
+
const {
|
|
8216
|
+
handleGetRowId
|
|
8217
|
+
} = createHandleGetRowId($xeTable);
|
|
8218
|
+
if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(merges)) {
|
|
8219
|
+
merges = [merges];
|
|
8220
|
+
}
|
|
8221
|
+
merges.forEach(item => {
|
|
8222
|
+
const {
|
|
8223
|
+
row: margeRow,
|
|
8224
|
+
col: margeCol
|
|
8225
|
+
} = item;
|
|
8226
|
+
let mergeRowIndex = -1;
|
|
8227
|
+
let mergeColumnIndex = -1;
|
|
8228
|
+
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(margeRow)) {
|
|
8229
|
+
mergeRowIndex = margeRow;
|
|
8230
|
+
} else {
|
|
8231
|
+
const rowid = margeRow ? handleGetRowId(margeRow) : null;
|
|
8232
|
+
const rowRest = rowid ? fullAllDataRowIdData[rowid] : null;
|
|
8233
|
+
if (rowRest) {
|
|
8234
|
+
mergeRowIndex = rowRest._index;
|
|
8235
|
+
}
|
|
8236
|
+
}
|
|
8237
|
+
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(margeCol)) {
|
|
8238
|
+
mergeColumnIndex = margeCol;
|
|
8239
|
+
} else {
|
|
8240
|
+
const colid = margeCol ? margeCol.id : null;
|
|
8241
|
+
const colRest = colid ? fullColumnIdData[colid] : null;
|
|
8242
|
+
if (colRest) {
|
|
8243
|
+
mergeColumnIndex = colRest._index;
|
|
8244
|
+
}
|
|
8245
|
+
}
|
|
8246
|
+
const mcIndex = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findIndexOf(mergeBodyList, item => item.row === mergeRowIndex && item.col === mergeColumnIndex);
|
|
8247
|
+
if (mcIndex > -1) {
|
|
8248
|
+
const rItems = mergeBodyList.splice(mcIndex, 1);
|
|
8249
|
+
const item = rItems[0];
|
|
8250
|
+
if (item) {
|
|
8251
|
+
rest.push(rItems[0]);
|
|
8252
|
+
if (mergeBodyMaps[`${mergeRowIndex}:${mergeColumnIndex}`]) {
|
|
8253
|
+
delete mergeBodyMaps[`${mergeRowIndex}:${mergeColumnIndex}`];
|
|
8254
|
+
}
|
|
8255
|
+
}
|
|
8256
|
+
}
|
|
8257
|
+
});
|
|
8258
|
+
}
|
|
8259
|
+
return rest;
|
|
8260
|
+
}
|
|
8261
|
+
function handleHeaderMerge($xeTable, merges) {
|
|
8108
8262
|
const reactData = $xeTable;
|
|
8109
8263
|
const internalData = $xeTable;
|
|
8110
8264
|
const {
|
|
8111
8265
|
footerTableData
|
|
8112
8266
|
} = reactData;
|
|
8113
8267
|
const {
|
|
8114
|
-
|
|
8115
|
-
|
|
8268
|
+
mergeHeaderList,
|
|
8269
|
+
mergeHeaderMaps,
|
|
8116
8270
|
fullColumnIdData
|
|
8117
8271
|
} = internalData;
|
|
8118
8272
|
if (merges) {
|
|
@@ -8146,7 +8300,7 @@ function handleFooterMerge($xeTable, merges) {
|
|
|
8146
8300
|
if (rowspan > 1 || colspan > 1) {
|
|
8147
8301
|
const row = footerTableData[mergeRowIndex];
|
|
8148
8302
|
const column = visibleColumn[mergeColumnIndex];
|
|
8149
|
-
let mergeItem =
|
|
8303
|
+
let mergeItem = mergeHeaderMaps[`${mergeRowIndex}:${mergeColumnIndex}`];
|
|
8150
8304
|
if (mergeItem) {
|
|
8151
8305
|
mergeItem.rowspan = rowspan;
|
|
8152
8306
|
mergeItem.colspan = colspan;
|
|
@@ -8163,27 +8317,23 @@ function handleFooterMerge($xeTable, merges) {
|
|
|
8163
8317
|
_rowspan: rowspan,
|
|
8164
8318
|
_colspan: colspan
|
|
8165
8319
|
};
|
|
8166
|
-
|
|
8167
|
-
|
|
8320
|
+
mergeHeaderMaps[`${mergeRowIndex}:${mergeColumnIndex}`] = mergeItem;
|
|
8321
|
+
mergeHeaderList.push(mergeItem);
|
|
8168
8322
|
}
|
|
8169
8323
|
}
|
|
8170
8324
|
}
|
|
8171
8325
|
});
|
|
8172
8326
|
}
|
|
8173
8327
|
}
|
|
8174
|
-
function
|
|
8328
|
+
function removeHeaderMerges($xeTable, merges) {
|
|
8175
8329
|
const internalData = $xeTable;
|
|
8176
8330
|
const {
|
|
8177
|
-
|
|
8331
|
+
mergeHeaderList,
|
|
8178
8332
|
fullColumnIdData,
|
|
8179
|
-
|
|
8180
|
-
mergeBodyMaps
|
|
8333
|
+
mergeHeaderMaps
|
|
8181
8334
|
} = internalData;
|
|
8182
8335
|
const rest = [];
|
|
8183
8336
|
if (merges) {
|
|
8184
|
-
const {
|
|
8185
|
-
handleGetRowId
|
|
8186
|
-
} = createHandleGetRowId($xeTable);
|
|
8187
8337
|
if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(merges)) {
|
|
8188
8338
|
merges = [merges];
|
|
8189
8339
|
}
|
|
@@ -8192,17 +8342,8 @@ function removeBodyMerges($xeTable, merges) {
|
|
|
8192
8342
|
row: margeRow,
|
|
8193
8343
|
col: margeCol
|
|
8194
8344
|
} = item;
|
|
8195
|
-
|
|
8345
|
+
const mergeRowIndex = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(margeRow) ? margeRow : -1;
|
|
8196
8346
|
let mergeColumnIndex = -1;
|
|
8197
|
-
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(margeRow)) {
|
|
8198
|
-
mergeRowIndex = margeRow;
|
|
8199
|
-
} else {
|
|
8200
|
-
const rowid = margeRow ? handleGetRowId(margeRow) : null;
|
|
8201
|
-
const rowRest = rowid ? fullAllDataRowIdData[rowid] : null;
|
|
8202
|
-
if (rowRest) {
|
|
8203
|
-
mergeRowIndex = rowRest._index;
|
|
8204
|
-
}
|
|
8205
|
-
}
|
|
8206
8347
|
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(margeCol)) {
|
|
8207
8348
|
mergeColumnIndex = margeCol;
|
|
8208
8349
|
} else {
|
|
@@ -8212,14 +8353,14 @@ function removeBodyMerges($xeTable, merges) {
|
|
|
8212
8353
|
mergeColumnIndex = colRest._index;
|
|
8213
8354
|
}
|
|
8214
8355
|
}
|
|
8215
|
-
const mcIndex = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findIndexOf(
|
|
8356
|
+
const mcIndex = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findIndexOf(mergeHeaderList, item => item.row === mergeRowIndex && item.col === mergeColumnIndex);
|
|
8216
8357
|
if (mcIndex > -1) {
|
|
8217
|
-
const rItems =
|
|
8358
|
+
const rItems = mergeHeaderList.splice(mcIndex, 1);
|
|
8218
8359
|
const item = rItems[0];
|
|
8219
8360
|
if (item) {
|
|
8220
|
-
rest.push(
|
|
8221
|
-
if (
|
|
8222
|
-
delete
|
|
8361
|
+
rest.push(item);
|
|
8362
|
+
if (mergeHeaderMaps[`${mergeRowIndex}:${mergeColumnIndex}`]) {
|
|
8363
|
+
delete mergeHeaderMaps[`${mergeRowIndex}:${mergeColumnIndex}`];
|
|
8223
8364
|
}
|
|
8224
8365
|
}
|
|
8225
8366
|
}
|
|
@@ -8227,6 +8368,73 @@ function removeBodyMerges($xeTable, merges) {
|
|
|
8227
8368
|
}
|
|
8228
8369
|
return rest;
|
|
8229
8370
|
}
|
|
8371
|
+
function handleFooterMerge($xeTable, merges) {
|
|
8372
|
+
const reactData = $xeTable;
|
|
8373
|
+
const internalData = $xeTable;
|
|
8374
|
+
const {
|
|
8375
|
+
footerTableData
|
|
8376
|
+
} = reactData;
|
|
8377
|
+
const {
|
|
8378
|
+
mergeFooterList,
|
|
8379
|
+
mergeFooterMaps,
|
|
8380
|
+
fullColumnIdData
|
|
8381
|
+
} = internalData;
|
|
8382
|
+
if (merges) {
|
|
8383
|
+
const {
|
|
8384
|
+
visibleColumn
|
|
8385
|
+
} = internalData;
|
|
8386
|
+
if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(merges)) {
|
|
8387
|
+
merges = [merges];
|
|
8388
|
+
}
|
|
8389
|
+
merges.forEach(item => {
|
|
8390
|
+
let {
|
|
8391
|
+
row: margeRow,
|
|
8392
|
+
col: margeCol,
|
|
8393
|
+
rowspan,
|
|
8394
|
+
colspan
|
|
8395
|
+
} = item;
|
|
8396
|
+
const mergeRowIndex = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(margeRow) ? margeRow : -1;
|
|
8397
|
+
let mergeColumnIndex = -1;
|
|
8398
|
+
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(margeCol)) {
|
|
8399
|
+
mergeColumnIndex = margeCol;
|
|
8400
|
+
} else {
|
|
8401
|
+
const colid = margeCol ? margeCol.id : null;
|
|
8402
|
+
const colRest = colid ? fullColumnIdData[colid] : null;
|
|
8403
|
+
if (colRest) {
|
|
8404
|
+
mergeColumnIndex = colRest._index;
|
|
8405
|
+
}
|
|
8406
|
+
}
|
|
8407
|
+
if (mergeRowIndex > -1 && mergeColumnIndex > -1 && (rowspan || colspan)) {
|
|
8408
|
+
rowspan = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(rowspan) || 1;
|
|
8409
|
+
colspan = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(colspan) || 1;
|
|
8410
|
+
if (rowspan > 1 || colspan > 1) {
|
|
8411
|
+
const row = footerTableData[mergeRowIndex];
|
|
8412
|
+
const column = visibleColumn[mergeColumnIndex];
|
|
8413
|
+
let mergeItem = mergeFooterMaps[`${mergeRowIndex}:${mergeColumnIndex}`];
|
|
8414
|
+
if (mergeItem) {
|
|
8415
|
+
mergeItem.rowspan = rowspan;
|
|
8416
|
+
mergeItem.colspan = colspan;
|
|
8417
|
+
mergeItem._rowspan = rowspan;
|
|
8418
|
+
mergeItem._colspan = colspan;
|
|
8419
|
+
} else {
|
|
8420
|
+
mergeItem = {
|
|
8421
|
+
row: mergeRowIndex,
|
|
8422
|
+
col: mergeColumnIndex,
|
|
8423
|
+
rowspan,
|
|
8424
|
+
colspan,
|
|
8425
|
+
_row: row,
|
|
8426
|
+
_col: column,
|
|
8427
|
+
_rowspan: rowspan,
|
|
8428
|
+
_colspan: colspan
|
|
8429
|
+
};
|
|
8430
|
+
mergeFooterMaps[`${mergeRowIndex}:${mergeColumnIndex}`] = mergeItem;
|
|
8431
|
+
mergeFooterList.push(mergeItem);
|
|
8432
|
+
}
|
|
8433
|
+
}
|
|
8434
|
+
}
|
|
8435
|
+
});
|
|
8436
|
+
}
|
|
8437
|
+
}
|
|
8230
8438
|
function removeFooterMerges($xeTable, merges) {
|
|
8231
8439
|
const internalData = $xeTable;
|
|
8232
8440
|
const {
|
|
@@ -8354,10 +8562,26 @@ function clearAllSort($xeTable) {
|
|
|
8354
8562
|
function calcTableHeight($xeTable, key) {
|
|
8355
8563
|
const props = $xeTable;
|
|
8356
8564
|
const reactData = $xeTable;
|
|
8565
|
+
const {
|
|
8566
|
+
editConfig
|
|
8567
|
+
} = props;
|
|
8357
8568
|
const {
|
|
8358
8569
|
parentHeight
|
|
8359
8570
|
} = reactData;
|
|
8360
|
-
|
|
8571
|
+
let val = props[key];
|
|
8572
|
+
if (key === 'minHeight') {
|
|
8573
|
+
const defMinHeight = methods_getConfig().table.minHeight;
|
|
8574
|
+
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(val)) {
|
|
8575
|
+
if (eqEmptyValue(defMinHeight)) {
|
|
8576
|
+
// 编辑模式默认最小高度
|
|
8577
|
+
if (isEnableConf(editConfig)) {
|
|
8578
|
+
val = 144;
|
|
8579
|
+
}
|
|
8580
|
+
} else {
|
|
8581
|
+
val = defMinHeight;
|
|
8582
|
+
}
|
|
8583
|
+
}
|
|
8584
|
+
}
|
|
8361
8585
|
let num = 0;
|
|
8362
8586
|
if (val) {
|
|
8363
8587
|
if (val === '100%' || val === 'auto') {
|
|
@@ -8587,6 +8811,11 @@ function handleTargetEnterEvent($xeTable, isClear) {
|
|
|
8587
8811
|
}
|
|
8588
8812
|
}
|
|
8589
8813
|
}
|
|
8814
|
+
function clearCrossTableDragStatus($xeTable) {
|
|
8815
|
+
const crossTableDragRowInfo = getCrossTableDragRowInfo($xeTable);
|
|
8816
|
+
crossTableDragRowObj = null;
|
|
8817
|
+
crossTableDragRowInfo.row = null;
|
|
8818
|
+
}
|
|
8590
8819
|
function clearDragStatus($xeTable) {
|
|
8591
8820
|
const reactData = $xeTable;
|
|
8592
8821
|
const {
|
|
@@ -8597,6 +8826,7 @@ function clearDragStatus($xeTable) {
|
|
|
8597
8826
|
clearColDropOrigin($xeTable);
|
|
8598
8827
|
clearRowDropOrigin($xeTable);
|
|
8599
8828
|
hideDropTip($xeTable);
|
|
8829
|
+
clearCrossTableDragStatus($xeTable);
|
|
8600
8830
|
reactData.dragRow = null;
|
|
8601
8831
|
reactData.dragCol = null;
|
|
8602
8832
|
}
|
|
@@ -8801,6 +9031,26 @@ function hideDropTip($xeTable) {
|
|
|
8801
9031
|
cdLineEl.style.display = '';
|
|
8802
9032
|
}
|
|
8803
9033
|
}
|
|
9034
|
+
function clearRowDragData($xeTable) {
|
|
9035
|
+
const $xeGantt = $xeTable.$xeGantt;
|
|
9036
|
+
const reactData = $xeTable;
|
|
9037
|
+
const internalData = $xeTable;
|
|
9038
|
+
let wrapperEl = $xeTable.$refs.refElem;
|
|
9039
|
+
const dtClss = ['.vxe-body--row'];
|
|
9040
|
+
if ($xeGantt) {
|
|
9041
|
+
const ganttContainerElem = $xeGantt.$refs.refGanttContainerElem;
|
|
9042
|
+
if (ganttContainerElem) {
|
|
9043
|
+
wrapperEl = ganttContainerElem;
|
|
9044
|
+
}
|
|
9045
|
+
dtClss.push('.vxe-gantt-view--body-row', '.vxe-gantt-view--chart-row');
|
|
9046
|
+
}
|
|
9047
|
+
hideDropTip($xeTable);
|
|
9048
|
+
clearRowDropOrigin($xeTable);
|
|
9049
|
+
clearRowAnimate(wrapperEl, dtClss);
|
|
9050
|
+
internalData.prevDragToChild = false;
|
|
9051
|
+
reactData.dragRow = null;
|
|
9052
|
+
reactData.dragCol = null;
|
|
9053
|
+
}
|
|
8804
9054
|
/**
|
|
8805
9055
|
* 处理显示 tooltip
|
|
8806
9056
|
* @param {Event} evnt 事件
|
|
@@ -8880,13 +9130,24 @@ function handleDefaultMergeCells($xeTable) {
|
|
|
8880
9130
|
$xeTable.setMergeCells(mergeCells);
|
|
8881
9131
|
}
|
|
8882
9132
|
}
|
|
9133
|
+
function handleDefaultMergeHeaderItems($xeTable) {
|
|
9134
|
+
const props = $xeTable;
|
|
9135
|
+
const {
|
|
9136
|
+
mergeHeaderCells
|
|
9137
|
+
} = props;
|
|
9138
|
+
if (mergeHeaderCells) {
|
|
9139
|
+
$xeTable.setMergeHeaderCells(mergeHeaderCells);
|
|
9140
|
+
}
|
|
9141
|
+
}
|
|
8883
9142
|
function handleDefaultMergeFooterItems($xeTable) {
|
|
8884
9143
|
const props = $xeTable;
|
|
8885
9144
|
const {
|
|
9145
|
+
mergeFooterCells,
|
|
8886
9146
|
mergeFooterItems
|
|
8887
9147
|
} = props;
|
|
8888
|
-
|
|
8889
|
-
|
|
9148
|
+
const mFooterCells = mergeFooterCells || mergeFooterItems;
|
|
9149
|
+
if (mFooterCells) {
|
|
9150
|
+
$xeTable.setMergeFooterCells(mFooterCells);
|
|
8890
9151
|
}
|
|
8891
9152
|
}
|
|
8892
9153
|
// 计算可视渲染相关数据
|
|
@@ -9392,6 +9653,10 @@ function loadTableData($xeTable, datas, isReset) {
|
|
|
9392
9653
|
}
|
|
9393
9654
|
handleReserveStatus($xeTable);
|
|
9394
9655
|
$xeTable.checkSelectionStatus();
|
|
9656
|
+
$xeTable.dispatchEvent('data-change', {
|
|
9657
|
+
visibleColumn: internalData.visibleColumn,
|
|
9658
|
+
visibleData: internalData.afterFullData
|
|
9659
|
+
}, null);
|
|
9395
9660
|
return new Promise(resolve => {
|
|
9396
9661
|
$xeTable.$nextTick().then(() => handleRecalculateStyle($xeTable, false, false, false)).then(() => {
|
|
9397
9662
|
handleRecalculateStyle($xeTable, false, true, true);
|
|
@@ -9448,6 +9713,7 @@ function handleLoadDefaults($xeTable) {
|
|
|
9448
9713
|
handleDefaultTreeExpand($xeTable);
|
|
9449
9714
|
handleDefaultRowGroupExpand($xeTable);
|
|
9450
9715
|
handleDefaultMergeCells($xeTable);
|
|
9716
|
+
handleDefaultMergeHeaderItems($xeTable);
|
|
9451
9717
|
handleDefaultMergeFooterItems($xeTable);
|
|
9452
9718
|
$xeTable.$nextTick(() => setTimeout(() => $xeTable.recalculate()));
|
|
9453
9719
|
}
|
|
@@ -11362,7 +11628,9 @@ const Methods = {
|
|
|
11362
11628
|
}
|
|
11363
11629
|
}
|
|
11364
11630
|
}
|
|
11365
|
-
|
|
11631
|
+
const rest = $xeTable.handleRowDragSwapEvent(null, true, dragRow, prevDragRow, dragPos || defPos, dragToChild === true);
|
|
11632
|
+
clearRowDragData($xeTable);
|
|
11633
|
+
return rest;
|
|
11366
11634
|
},
|
|
11367
11635
|
/**
|
|
11368
11636
|
* 获取表格的全量列
|
|
@@ -12946,7 +13214,7 @@ const Methods = {
|
|
|
12946
13214
|
// 如果点击了当前表格之外
|
|
12947
13215
|
!getEventTargetNode(evnt, $el).flag) {
|
|
12948
13216
|
setTimeout(() => {
|
|
12949
|
-
|
|
13217
|
+
$xeTable.handleClearEdit(evnt).then(() => {
|
|
12950
13218
|
// 如果存在校验,点击了表格之外则清除
|
|
12951
13219
|
if (!this.isActivated && editRules && validOpts.autoClear) {
|
|
12952
13220
|
this.validErrorMaps = {};
|
|
@@ -12961,17 +13229,17 @@ const Methods = {
|
|
|
12961
13229
|
}
|
|
12962
13230
|
} else if (mouseConfig) {
|
|
12963
13231
|
if (!getEventTargetNode(evnt, $el).flag && !($xeGGWrapper && getEventTargetNode(evnt, $xeGGWrapper.$el).flag) && !(tableMenu && getEventTargetNode(evnt, tableMenu.$el).flag) && !($toolbar && getEventTargetNode(evnt, $toolbar.$el).flag)) {
|
|
12964
|
-
if (
|
|
12965
|
-
|
|
13232
|
+
if ($xeTable.clearSelected) {
|
|
13233
|
+
$xeTable.clearSelected();
|
|
12966
13234
|
}
|
|
12967
13235
|
if (areaOpts.autoClear) {
|
|
12968
|
-
if (
|
|
12969
|
-
const cellAreas =
|
|
13236
|
+
if ($xeTable.getCellAreas) {
|
|
13237
|
+
const cellAreas = $xeTable.getCellAreas();
|
|
12970
13238
|
if (cellAreas && cellAreas.length && !getEventTargetNode(evnt, document.body, 'vxe-table--ignore-areas-clear').flag) {
|
|
12971
|
-
|
|
12972
|
-
|
|
12973
|
-
|
|
12974
|
-
|
|
13239
|
+
$xeTable.preventEvent(evnt, 'event.clearAreas', {}, () => {
|
|
13240
|
+
$xeTable.clearCellAreas();
|
|
13241
|
+
$xeTable.clearCopyCellArea();
|
|
13242
|
+
$xeTable.dispatchEvent('clear-cell-area-selection', {
|
|
12975
13243
|
cellAreas
|
|
12976
13244
|
}, evnt);
|
|
12977
13245
|
});
|
|
@@ -13010,6 +13278,7 @@ const Methods = {
|
|
|
13010
13278
|
* 表格键盘事件
|
|
13011
13279
|
*/
|
|
13012
13280
|
keydownEvent(evnt) {
|
|
13281
|
+
const $xeTable = this;
|
|
13013
13282
|
const {
|
|
13014
13283
|
filterStore,
|
|
13015
13284
|
ctxMenuStore,
|
|
@@ -13028,7 +13297,7 @@ const Methods = {
|
|
|
13028
13297
|
const isEsc = keyCode === 27;
|
|
13029
13298
|
if (isEsc) {
|
|
13030
13299
|
this.preventEvent(evnt, 'event.keydown', null, () => {
|
|
13031
|
-
|
|
13300
|
+
$xeTable.dispatchEvent('keydown-start', {}, evnt);
|
|
13032
13301
|
if (keyboardConfig && mouseConfig && mouseOpts.area && this.handleKeyboardCellAreaEvent) {
|
|
13033
13302
|
this.handleKeyboardCellAreaEvent(evnt);
|
|
13034
13303
|
} else if (actived.row || filterStore.visible || ctxMenuStore.visible) {
|
|
@@ -13048,8 +13317,8 @@ const Methods = {
|
|
|
13048
13317
|
}
|
|
13049
13318
|
}
|
|
13050
13319
|
}
|
|
13051
|
-
|
|
13052
|
-
|
|
13320
|
+
$xeTable.dispatchEvent('keydown', {}, evnt);
|
|
13321
|
+
$xeTable.dispatchEvent('keydown-end', {}, evnt);
|
|
13053
13322
|
});
|
|
13054
13323
|
}
|
|
13055
13324
|
},
|
|
@@ -13390,6 +13659,7 @@ const Methods = {
|
|
|
13390
13659
|
}
|
|
13391
13660
|
},
|
|
13392
13661
|
handleGlobalPasteEvent(evnt) {
|
|
13662
|
+
const $xeTable = this;
|
|
13393
13663
|
const {
|
|
13394
13664
|
isActivated,
|
|
13395
13665
|
keyboardConfig,
|
|
@@ -13408,10 +13678,11 @@ const Methods = {
|
|
|
13408
13678
|
this.handlePasteCellAreaEvent(evnt);
|
|
13409
13679
|
}
|
|
13410
13680
|
}
|
|
13411
|
-
|
|
13681
|
+
$xeTable.dispatchEvent('paste', {}, evnt);
|
|
13412
13682
|
}
|
|
13413
13683
|
},
|
|
13414
13684
|
handleGlobalCopyEvent(evnt) {
|
|
13685
|
+
const $xeTable = this;
|
|
13415
13686
|
const {
|
|
13416
13687
|
isActivated,
|
|
13417
13688
|
keyboardConfig,
|
|
@@ -13430,10 +13701,11 @@ const Methods = {
|
|
|
13430
13701
|
this.handleCopyCellAreaEvent(evnt);
|
|
13431
13702
|
}
|
|
13432
13703
|
}
|
|
13433
|
-
|
|
13704
|
+
$xeTable.dispatchEvent('copy', {}, evnt);
|
|
13434
13705
|
}
|
|
13435
13706
|
},
|
|
13436
13707
|
handleGlobalCutEvent(evnt) {
|
|
13708
|
+
const $xeTable = this;
|
|
13437
13709
|
const {
|
|
13438
13710
|
isActivated,
|
|
13439
13711
|
keyboardConfig,
|
|
@@ -13452,7 +13724,7 @@ const Methods = {
|
|
|
13452
13724
|
this.handleCutCellAreaEvent(evnt);
|
|
13453
13725
|
}
|
|
13454
13726
|
}
|
|
13455
|
-
|
|
13727
|
+
$xeTable.dispatchEvent('cut', {}, evnt);
|
|
13456
13728
|
}
|
|
13457
13729
|
},
|
|
13458
13730
|
handleGlobalResizeEvent() {
|
|
@@ -13475,6 +13747,16 @@ const Methods = {
|
|
|
13475
13747
|
internalData.mergeBodyCellMaps = buildMergeData(mergeBodyList);
|
|
13476
13748
|
reactData.mergeBodyFlag++;
|
|
13477
13749
|
},
|
|
13750
|
+
handleUpdateHeaderMerge() {
|
|
13751
|
+
const $xeTable = this;
|
|
13752
|
+
const reactData = $xeTable;
|
|
13753
|
+
const internalData = $xeTable;
|
|
13754
|
+
const {
|
|
13755
|
+
mergeHeaderList
|
|
13756
|
+
} = internalData;
|
|
13757
|
+
internalData.mergeHeaderCellMaps = buildMergeData(mergeHeaderList);
|
|
13758
|
+
reactData.mergeHeadFlag++;
|
|
13759
|
+
},
|
|
13478
13760
|
handleUpdateFooterMerge() {
|
|
13479
13761
|
const $xeTable = this;
|
|
13480
13762
|
const reactData = $xeTable;
|
|
@@ -14858,7 +15140,8 @@ const Methods = {
|
|
|
14858
15140
|
return $xeTable.$nextTick();
|
|
14859
15141
|
},
|
|
14860
15142
|
triggerHeaderCellDblclickEvent(evnt, params) {
|
|
14861
|
-
this
|
|
15143
|
+
const $xeTable = this;
|
|
15144
|
+
$xeTable.dispatchEvent('header-cell-dblclick', Object.assign({
|
|
14862
15145
|
cell: evnt.currentTarget
|
|
14863
15146
|
}, params), evnt);
|
|
14864
15147
|
},
|
|
@@ -15076,7 +15359,7 @@ const Methods = {
|
|
|
15076
15359
|
}
|
|
15077
15360
|
}
|
|
15078
15361
|
}
|
|
15079
|
-
|
|
15362
|
+
$xeTable.dispatchEvent('cell-dblclick', params, evnt);
|
|
15080
15363
|
},
|
|
15081
15364
|
handleColumnSortEvent(evnt, column) {
|
|
15082
15365
|
const $xeTable = this;
|
|
@@ -15569,15 +15852,276 @@ const Methods = {
|
|
|
15569
15852
|
status: true
|
|
15570
15853
|
};
|
|
15571
15854
|
});
|
|
15572
|
-
}).catch(() => {
|
|
15573
|
-
return errRest;
|
|
15574
|
-
});
|
|
15855
|
+
}).catch(() => {
|
|
15856
|
+
return errRest;
|
|
15857
|
+
});
|
|
15858
|
+
}
|
|
15859
|
+
return Promise.resolve(errRest);
|
|
15860
|
+
},
|
|
15861
|
+
/**
|
|
15862
|
+
* 处理跨表拖拽完成
|
|
15863
|
+
*/
|
|
15864
|
+
handleCrossTableRowDragFinishEvent(evnt) {
|
|
15865
|
+
const $xeTable = this;
|
|
15866
|
+
const $xeGantt = $xeTable.$xeGantt;
|
|
15867
|
+
const reactData = $xeTable;
|
|
15868
|
+
const internalData = $xeTable;
|
|
15869
|
+
const crossTableDragRowInfo = getCrossTableDragRowInfo($xeTable);
|
|
15870
|
+
const {
|
|
15871
|
+
tableData
|
|
15872
|
+
} = reactData;
|
|
15873
|
+
const {
|
|
15874
|
+
fullAllDataRowIdData
|
|
15875
|
+
} = internalData;
|
|
15876
|
+
const rowOpts = $xeTable.computeRowOpts;
|
|
15877
|
+
const cellOpts = $xeTable.computeCellOpts;
|
|
15878
|
+
const defaultRowHeight = $xeTable.computeDefaultRowHeight;
|
|
15879
|
+
const rowDragOpts = $xeTable.computeRowDragOpts;
|
|
15880
|
+
const {
|
|
15881
|
+
animation,
|
|
15882
|
+
isCrossTableDrag
|
|
15883
|
+
} = rowDragOpts;
|
|
15884
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
15885
|
+
const {
|
|
15886
|
+
mapChildrenField
|
|
15887
|
+
} = treeOpts;
|
|
15888
|
+
const el = $xeTable.$refs.refElem;
|
|
15889
|
+
if (isCrossTableDrag && crossTableDragRowObj && crossTableDragRowInfo) {
|
|
15890
|
+
const {
|
|
15891
|
+
row: dragRow
|
|
15892
|
+
} = crossTableDragRowInfo;
|
|
15893
|
+
if (dragRow) {
|
|
15894
|
+
const dragRowid = getRowid($xeTable, dragRow);
|
|
15895
|
+
const dragRowRest = fullAllDataRowIdData[dragRowid];
|
|
15896
|
+
let dragRowHeight = 0;
|
|
15897
|
+
let rsIndex = -1;
|
|
15898
|
+
if (dragRowRest) {
|
|
15899
|
+
if (animation) {
|
|
15900
|
+
dragRowHeight = getCellRestHeight(dragRowRest, cellOpts, rowOpts, defaultRowHeight);
|
|
15901
|
+
}
|
|
15902
|
+
rsIndex = dragRowRest.$index;
|
|
15903
|
+
}
|
|
15904
|
+
const dragRangeList = rsIndex > -1 && rsIndex < tableData.length - 1 ? tableData.slice(rsIndex + 1) : [];
|
|
15905
|
+
const dragList = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toTreeArray([dragRow], {
|
|
15906
|
+
updated: true,
|
|
15907
|
+
children: mapChildrenField
|
|
15908
|
+
});
|
|
15909
|
+
$xeTable.remove(dragList).then(() => {
|
|
15910
|
+
if (animation && dragRowHeight && dragRangeList.length) {
|
|
15911
|
+
const $xeGanttView = internalData.xeGanttView;
|
|
15912
|
+
let wrapperEl = el;
|
|
15913
|
+
if ($xeGantt && $xeGanttView) {
|
|
15914
|
+
const ganttContainerElem = $xeGantt.$refs.refGanttContainerElem;
|
|
15915
|
+
if (ganttContainerElem) {
|
|
15916
|
+
wrapperEl = ganttContainerElem;
|
|
15917
|
+
}
|
|
15918
|
+
}
|
|
15919
|
+
const dtClss = [];
|
|
15920
|
+
dragRangeList.forEach(row => {
|
|
15921
|
+
const rowid = getRowid($xeTable, row);
|
|
15922
|
+
dtClss.push(`.vxe-body--row[rowid="${rowid}"]`);
|
|
15923
|
+
if ($xeGantt) {
|
|
15924
|
+
dtClss.push(`.vxe-gantt-view--body-row[rowid="${rowid}"]`, `.vxe-gantt-view--chart-row[rowid="${rowid}"]`);
|
|
15925
|
+
}
|
|
15926
|
+
});
|
|
15927
|
+
const dtTrList = wrapperEl.querySelectorAll(dtClss.join(','));
|
|
15928
|
+
moveRowAnimateToTb(dtTrList, dragRowHeight);
|
|
15929
|
+
}
|
|
15930
|
+
});
|
|
15931
|
+
$xeTable.dispatchEvent('row-remove-dragend', {
|
|
15932
|
+
row: dragRow
|
|
15933
|
+
}, evnt);
|
|
15934
|
+
clearRowDragData($xeTable);
|
|
15935
|
+
clearCrossTableDragStatus($xeTable);
|
|
15936
|
+
}
|
|
15937
|
+
}
|
|
15938
|
+
},
|
|
15939
|
+
/**
|
|
15940
|
+
* 处理跨表拖至新的空表
|
|
15941
|
+
*/
|
|
15942
|
+
handleCrossTableRowDragoverEmptyEvent(evnt) {
|
|
15943
|
+
const $xeTable = this;
|
|
15944
|
+
const reactData = $xeTable;
|
|
15945
|
+
const internalData = $xeTable;
|
|
15946
|
+
const {
|
|
15947
|
+
tableData
|
|
15948
|
+
} = reactData;
|
|
15949
|
+
const rowDragOpts = $xeTable.computeRowDragOpts;
|
|
15950
|
+
const {
|
|
15951
|
+
isCrossTableDrag
|
|
15952
|
+
} = rowDragOpts;
|
|
15953
|
+
if (isCrossTableDrag && crossTableDragRowObj && !tableData.length) {
|
|
15954
|
+
const {
|
|
15955
|
+
$oldTable
|
|
15956
|
+
} = crossTableDragRowObj;
|
|
15957
|
+
if ($oldTable && $oldTable.xID !== $xeTable.xID) {
|
|
15958
|
+
evnt.preventDefault();
|
|
15959
|
+
crossTableDragRowObj.$newTable = $xeTable;
|
|
15960
|
+
internalData.prevDragRow = null;
|
|
15961
|
+
}
|
|
15962
|
+
}
|
|
15963
|
+
},
|
|
15964
|
+
/**
|
|
15965
|
+
* 处理跨表拖插入
|
|
15966
|
+
*/
|
|
15967
|
+
handleCrossTableRowDragInsertEvent(evnt) {
|
|
15968
|
+
const $xeTable = this;
|
|
15969
|
+
const $xeGantt = $xeTable.$xeGantt;
|
|
15970
|
+
const props = $xeTable;
|
|
15971
|
+
const reactData = $xeTable;
|
|
15972
|
+
const internalData = $xeTable;
|
|
15973
|
+
const crossTableDragRowInfo = getCrossTableDragRowInfo($xeTable);
|
|
15974
|
+
const {
|
|
15975
|
+
treeConfig
|
|
15976
|
+
} = props;
|
|
15977
|
+
const {
|
|
15978
|
+
prevDragRow,
|
|
15979
|
+
prevDragPos,
|
|
15980
|
+
prevDragToChild
|
|
15981
|
+
} = internalData;
|
|
15982
|
+
const rowDragOpts = $xeTable.computeRowDragOpts;
|
|
15983
|
+
const {
|
|
15984
|
+
animation,
|
|
15985
|
+
isSelfToChildDrag,
|
|
15986
|
+
isCrossTableDrag,
|
|
15987
|
+
dragEndMethod,
|
|
15988
|
+
dragToChildMethod
|
|
15989
|
+
} = rowDragOpts;
|
|
15990
|
+
const rowOpts = $xeTable.computeRowOpts;
|
|
15991
|
+
const cellOpts = $xeTable.computeCellOpts;
|
|
15992
|
+
const defaultRowHeight = $xeTable.computeDefaultRowHeight;
|
|
15993
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
15994
|
+
const {
|
|
15995
|
+
parentField,
|
|
15996
|
+
mapChildrenField
|
|
15997
|
+
} = treeOpts;
|
|
15998
|
+
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
15999
|
+
// 跨表拖拽
|
|
16000
|
+
if (isCrossTableDrag && crossTableDragRowObj && crossTableDragRowInfo) {
|
|
16001
|
+
const {
|
|
16002
|
+
row: oldRow
|
|
16003
|
+
} = crossTableDragRowInfo;
|
|
16004
|
+
const {
|
|
16005
|
+
$oldTable
|
|
16006
|
+
} = crossTableDragRowObj;
|
|
16007
|
+
const el = $xeTable.$refs.refElem;
|
|
16008
|
+
if ($oldTable && oldRow) {
|
|
16009
|
+
const dragRow = oldRow;
|
|
16010
|
+
let dragOffsetIndex = -1;
|
|
16011
|
+
if (prevDragRow) {
|
|
16012
|
+
dragOffsetIndex = prevDragPos === 'bottom' ? 1 : 0;
|
|
16013
|
+
}
|
|
16014
|
+
const dragParams = {
|
|
16015
|
+
oldRow: dragRow,
|
|
16016
|
+
newRow: prevDragRow,
|
|
16017
|
+
dragRow,
|
|
16018
|
+
dragPos: prevDragPos,
|
|
16019
|
+
dragToChild: !!prevDragToChild,
|
|
16020
|
+
offsetIndex: dragOffsetIndex
|
|
16021
|
+
};
|
|
16022
|
+
const isDragToChildFlag = isSelfToChildDrag && dragToChildMethod ? dragToChildMethod(dragParams) : prevDragToChild;
|
|
16023
|
+
const errRest = {
|
|
16024
|
+
status: false
|
|
16025
|
+
};
|
|
16026
|
+
Promise.resolve(dragEndMethod ? dragEndMethod(dragParams) : true).then(status => {
|
|
16027
|
+
if (!status) {
|
|
16028
|
+
return errRest;
|
|
16029
|
+
}
|
|
16030
|
+
let insertRest = Promise.resolve();
|
|
16031
|
+
if (treeConfig) {
|
|
16032
|
+
const dragList = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toTreeArray([dragRow], {
|
|
16033
|
+
updated: true,
|
|
16034
|
+
children: mapChildrenField
|
|
16035
|
+
});
|
|
16036
|
+
$oldTable.handleCrossTableRowDragFinishEvent(evnt);
|
|
16037
|
+
if (prevDragRow) {
|
|
16038
|
+
dragRow[parentField] = prevDragRow[parentField];
|
|
16039
|
+
} else {
|
|
16040
|
+
dragRow[parentField] = null;
|
|
16041
|
+
}
|
|
16042
|
+
dragList.forEach(row => {
|
|
16043
|
+
row[childrenField] = undefined;
|
|
16044
|
+
row[mapChildrenField] = undefined;
|
|
16045
|
+
});
|
|
16046
|
+
if (prevDragRow) {
|
|
16047
|
+
if (prevDragPos === 'bottom') {
|
|
16048
|
+
insertRest = $xeTable.insertNextAt(dragList, prevDragRow);
|
|
16049
|
+
} else {
|
|
16050
|
+
insertRest = $xeTable.insertAt(dragList, prevDragRow);
|
|
16051
|
+
}
|
|
16052
|
+
} else {
|
|
16053
|
+
insertRest = $xeTable.insert(dragList);
|
|
16054
|
+
}
|
|
16055
|
+
} else {
|
|
16056
|
+
$oldTable.handleCrossTableRowDragFinishEvent(evnt);
|
|
16057
|
+
if (prevDragRow) {
|
|
16058
|
+
if (prevDragPos === 'bottom') {
|
|
16059
|
+
insertRest = $xeTable.insertNextAt(dragRow, prevDragRow);
|
|
16060
|
+
} else {
|
|
16061
|
+
insertRest = $xeTable.insertAt(dragRow, prevDragRow);
|
|
16062
|
+
}
|
|
16063
|
+
} else {
|
|
16064
|
+
insertRest = $xeTable.insert(dragRow);
|
|
16065
|
+
}
|
|
16066
|
+
}
|
|
16067
|
+
$xeTable.dispatchEvent('row-insert-dragend', {
|
|
16068
|
+
oldRow,
|
|
16069
|
+
newRow: prevDragRow,
|
|
16070
|
+
dragRow,
|
|
16071
|
+
dragPos: prevDragPos,
|
|
16072
|
+
dragToChild: isDragToChildFlag,
|
|
16073
|
+
offsetIndex: dragOffsetIndex
|
|
16074
|
+
}, evnt);
|
|
16075
|
+
clearRowDragData($xeTable);
|
|
16076
|
+
insertRest.then(() => {
|
|
16077
|
+
const {
|
|
16078
|
+
tableData
|
|
16079
|
+
} = reactData;
|
|
16080
|
+
const {
|
|
16081
|
+
fullAllDataRowIdData
|
|
16082
|
+
} = internalData;
|
|
16083
|
+
const oldRowid = getRowid($xeTable, dragRow);
|
|
16084
|
+
const oldRowRest = fullAllDataRowIdData[oldRowid];
|
|
16085
|
+
let dragRowHeight = 0;
|
|
16086
|
+
let rsIndex = -1;
|
|
16087
|
+
if (oldRowRest) {
|
|
16088
|
+
if (animation) {
|
|
16089
|
+
dragRowHeight = getCellRestHeight(oldRowRest, cellOpts, rowOpts, defaultRowHeight);
|
|
16090
|
+
}
|
|
16091
|
+
rsIndex = oldRowRest.$index;
|
|
16092
|
+
}
|
|
16093
|
+
const dragRangeList = rsIndex > -1 ? tableData.slice(rsIndex) : [];
|
|
16094
|
+
if (animation && dragRowHeight && dragRangeList.length) {
|
|
16095
|
+
const $xeGanttView = internalData.xeGanttView;
|
|
16096
|
+
let wrapperEl = el;
|
|
16097
|
+
if ($xeGantt && $xeGanttView) {
|
|
16098
|
+
const ganttContainerElem = $xeGantt.$refs.refGanttContainerElem;
|
|
16099
|
+
if (ganttContainerElem) {
|
|
16100
|
+
wrapperEl = ganttContainerElem;
|
|
16101
|
+
}
|
|
16102
|
+
}
|
|
16103
|
+
const dtClss = [];
|
|
16104
|
+
dragRangeList.forEach(row => {
|
|
16105
|
+
const rowid = getRowid($xeTable, row);
|
|
16106
|
+
dtClss.push(`.vxe-body--row[rowid="${rowid}"]`);
|
|
16107
|
+
if ($xeGantt) {
|
|
16108
|
+
dtClss.push(`.vxe-gantt-view--body-row[rowid="${rowid}"]`, `.vxe-gantt-view--chart-row[rowid="${rowid}"]`);
|
|
16109
|
+
}
|
|
16110
|
+
});
|
|
16111
|
+
const dtTrList = wrapperEl.querySelectorAll(dtClss.join(','));
|
|
16112
|
+
moveRowAnimateToTb(dtTrList, -dragRowHeight);
|
|
16113
|
+
}
|
|
16114
|
+
});
|
|
16115
|
+
});
|
|
16116
|
+
}
|
|
15575
16117
|
}
|
|
15576
|
-
|
|
16118
|
+
},
|
|
16119
|
+
hideCrossTableRowDropClearStatus() {
|
|
16120
|
+
const $xeTable = this;
|
|
16121
|
+
hideDropTip($xeTable);
|
|
15577
16122
|
},
|
|
15578
16123
|
handleRowDragDragendEvent(evnt) {
|
|
15579
16124
|
const $xeTable = this;
|
|
15580
|
-
const $xeGantt = $xeTable.$xeGantt;
|
|
15581
16125
|
const props = $xeTable;
|
|
15582
16126
|
const reactData = $xeTable;
|
|
15583
16127
|
const internalData = $xeTable;
|
|
@@ -15600,7 +16144,23 @@ const Methods = {
|
|
|
15600
16144
|
prevDragRow,
|
|
15601
16145
|
prevDragPos
|
|
15602
16146
|
} = internalData;
|
|
15603
|
-
|
|
16147
|
+
const rowDragOpts = $xeTable.computeRowDragOpts;
|
|
16148
|
+
const {
|
|
16149
|
+
isCrossTableDrag,
|
|
16150
|
+
isCrossDrag
|
|
16151
|
+
} = rowDragOpts;
|
|
16152
|
+
// 跨表拖拽
|
|
16153
|
+
if (isCrossTableDrag && crossTableDragRowObj) {
|
|
16154
|
+
const {
|
|
16155
|
+
$newTable
|
|
16156
|
+
} = crossTableDragRowObj;
|
|
16157
|
+
if ($newTable && $newTable.xID !== $xeTable.xID) {
|
|
16158
|
+
if (!treeConfig || isCrossDrag) {
|
|
16159
|
+
$newTable.handleCrossTableRowDragInsertEvent(evnt);
|
|
16160
|
+
}
|
|
16161
|
+
return;
|
|
16162
|
+
}
|
|
16163
|
+
}
|
|
15604
16164
|
if (treeConfig && lazy && prevDragToChild) {
|
|
15605
16165
|
// 懒加载
|
|
15606
16166
|
const newRowid = getRowid($xeTable, prevDragRow);
|
|
@@ -15615,20 +16175,8 @@ const Methods = {
|
|
|
15615
16175
|
} else {
|
|
15616
16176
|
$xeTable.handleRowDragSwapEvent(evnt, true, dragRow, prevDragRow, prevDragPos, prevDragToChild);
|
|
15617
16177
|
}
|
|
15618
|
-
|
|
15619
|
-
|
|
15620
|
-
const ganttContainerElem = $xeGantt.$refs.refGanttContainerElem;
|
|
15621
|
-
if (ganttContainerElem) {
|
|
15622
|
-
wrapperEl = ganttContainerElem;
|
|
15623
|
-
}
|
|
15624
|
-
dtClss.push('.vxe-gantt-view--body-row', '.vxe-gantt-view--chart-row');
|
|
15625
|
-
}
|
|
15626
|
-
hideDropTip($xeTable);
|
|
15627
|
-
clearRowDropOrigin($xeTable);
|
|
15628
|
-
clearRowAnimate(wrapperEl, dtClss);
|
|
15629
|
-
internalData.prevDragToChild = false;
|
|
15630
|
-
reactData.dragRow = null;
|
|
15631
|
-
reactData.dragCol = null;
|
|
16178
|
+
clearRowDragData($xeTable);
|
|
16179
|
+
clearCrossTableDragStatus($xeTable);
|
|
15632
16180
|
},
|
|
15633
16181
|
handleRowDragDragoverEvent(evnt) {
|
|
15634
16182
|
const $xeTable = this;
|
|
@@ -15655,9 +16203,10 @@ const Methods = {
|
|
|
15655
16203
|
const {
|
|
15656
16204
|
isPeerDrag,
|
|
15657
16205
|
isCrossDrag,
|
|
15658
|
-
isToChildDrag
|
|
16206
|
+
isToChildDrag,
|
|
16207
|
+
isCrossTableDrag
|
|
15659
16208
|
} = rowDragOpts;
|
|
15660
|
-
if (!dragRow) {
|
|
16209
|
+
if (!dragRow && !(isCrossTableDrag && (!treeConfig || isCrossDrag) && crossTableDragRowObj)) {
|
|
15661
16210
|
evnt.preventDefault();
|
|
15662
16211
|
return;
|
|
15663
16212
|
}
|
|
@@ -15666,18 +16215,40 @@ const Methods = {
|
|
|
15666
16215
|
const rowid = trEl.getAttribute('rowid') || '';
|
|
15667
16216
|
const rest = fullAllDataRowIdData[rowid];
|
|
15668
16217
|
if (rest) {
|
|
16218
|
+
evnt.preventDefault();
|
|
15669
16219
|
const row = rest.row;
|
|
15670
16220
|
const rowid = getRowid($xeTable, row);
|
|
15671
16221
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
15672
|
-
evnt.preventDefault();
|
|
15673
|
-
const {
|
|
15674
|
-
dragRow
|
|
15675
|
-
} = reactData;
|
|
15676
16222
|
const offsetY = evnt.clientY - trEl.getBoundingClientRect().y;
|
|
15677
16223
|
const dragPos = offsetY < trEl.clientHeight / 2 ? 'top' : 'bottom';
|
|
15678
|
-
internalData.prevDragToChild = !!(treeConfig && transform && isToChildDrag && isControlKey);
|
|
16224
|
+
internalData.prevDragToChild = !!(treeConfig && transform && isCrossDrag && isToChildDrag && isControlKey);
|
|
15679
16225
|
internalData.prevDragRow = row;
|
|
15680
16226
|
internalData.prevDragPos = dragPos;
|
|
16227
|
+
// 跨表拖拽
|
|
16228
|
+
if (isCrossTableDrag && (!treeConfig || isCrossDrag) && crossTableDragRowObj) {
|
|
16229
|
+
const {
|
|
16230
|
+
$oldTable,
|
|
16231
|
+
$newTable
|
|
16232
|
+
} = crossTableDragRowObj;
|
|
16233
|
+
if ($oldTable) {
|
|
16234
|
+
const oldTableReactData = $oldTable;
|
|
16235
|
+
if ($oldTable.xID === $xeTable.xID) {
|
|
16236
|
+
if ($newTable) {
|
|
16237
|
+
$newTable.hideCrossTableRowDropClearStatus();
|
|
16238
|
+
}
|
|
16239
|
+
reactData.isCrossDragRow = false;
|
|
16240
|
+
oldTableReactData.isCrossDragRow = false;
|
|
16241
|
+
crossTableDragRowObj.$newTable = null;
|
|
16242
|
+
} else if (!treeConfig || isCrossDrag) {
|
|
16243
|
+
$oldTable.hideCrossTableRowDropClearStatus();
|
|
16244
|
+
oldTableReactData.isCrossDragRow = true;
|
|
16245
|
+
reactData.dragTipText = oldTableReactData.dragTipText;
|
|
16246
|
+
crossTableDragRowObj.$newTable = $xeTable;
|
|
16247
|
+
showDropTip($xeTable, evnt, trEl, null, true, dragPos);
|
|
16248
|
+
return;
|
|
16249
|
+
}
|
|
16250
|
+
}
|
|
16251
|
+
}
|
|
15681
16252
|
if ($xeTable.eqRow(dragRow, row) || isControlKey && treeConfig && lazy && row[hasChildField] && rowRest && !rowRest.treeLoaded || !isCrossDrag && treeConfig && transform && (isPeerDrag ? dragRow[parentField] !== row[parentField] : rest.level)) {
|
|
15682
16253
|
showDropTip($xeTable, evnt, trEl, null, false, dragPos);
|
|
15683
16254
|
return;
|
|
@@ -15694,12 +16265,14 @@ const Methods = {
|
|
|
15694
16265
|
const $xeTable = this;
|
|
15695
16266
|
const props = $xeTable;
|
|
15696
16267
|
const reactData = $xeTable;
|
|
16268
|
+
const crossTableDragRowInfo = getCrossTableDragRowInfo($xeTable);
|
|
15697
16269
|
evnt.stopPropagation();
|
|
15698
16270
|
const {
|
|
15699
16271
|
dragConfig
|
|
15700
16272
|
} = props;
|
|
15701
16273
|
const rowDragOpts = $xeTable.computeRowDragOpts;
|
|
15702
16274
|
const {
|
|
16275
|
+
isCrossTableDrag,
|
|
15703
16276
|
trigger,
|
|
15704
16277
|
dragStartMethod
|
|
15705
16278
|
} = rowDragOpts;
|
|
@@ -15715,10 +16288,19 @@ const Methods = {
|
|
|
15715
16288
|
trEl.draggable = false;
|
|
15716
16289
|
reactData.dragRow = null;
|
|
15717
16290
|
reactData.dragCol = null;
|
|
16291
|
+
clearCrossTableDragStatus($xeTable);
|
|
15718
16292
|
hideDropTip($xeTable);
|
|
15719
16293
|
return;
|
|
15720
16294
|
}
|
|
16295
|
+
if (isCrossTableDrag) {
|
|
16296
|
+
crossTableDragRowInfo.row = row;
|
|
16297
|
+
crossTableDragRowObj = {
|
|
16298
|
+
$oldTable: $xeTable,
|
|
16299
|
+
$newTable: null
|
|
16300
|
+
};
|
|
16301
|
+
}
|
|
15721
16302
|
reactData.dragRow = row;
|
|
16303
|
+
reactData.isCrossDragRow = false;
|
|
15722
16304
|
reactData.dragCol = null;
|
|
15723
16305
|
trEl.draggable = true;
|
|
15724
16306
|
updateRowDropOrigin($xeTable, row);
|
|
@@ -16064,6 +16646,7 @@ const Methods = {
|
|
|
16064
16646
|
internalData.prevDragToChild = false;
|
|
16065
16647
|
reactData.dragRow = null;
|
|
16066
16648
|
reactData.dragCol = null;
|
|
16649
|
+
clearCrossTableDragStatus($xeTable);
|
|
16067
16650
|
},
|
|
16068
16651
|
handleHeaderCellDragDragoverEvent(evnt) {
|
|
16069
16652
|
const $xeTable = this;
|
|
@@ -16157,11 +16740,13 @@ const Methods = {
|
|
|
16157
16740
|
reactData.dragRow = null;
|
|
16158
16741
|
reactData.dragCol = null;
|
|
16159
16742
|
hideDropTip($xeTable);
|
|
16743
|
+
clearCrossTableDragStatus($xeTable);
|
|
16160
16744
|
return;
|
|
16161
16745
|
}
|
|
16162
16746
|
reactData.dragCol = column;
|
|
16163
16747
|
reactData.dragRow = null;
|
|
16164
16748
|
thEl.draggable = true;
|
|
16749
|
+
clearCrossTableDragStatus($xeTable);
|
|
16165
16750
|
updateColDropOrigin($xeTable, column);
|
|
16166
16751
|
updateColDropTipContent($xeTable, thEl);
|
|
16167
16752
|
$xeTable.dispatchEvent('column-dragstart', params, evnt);
|
|
@@ -16171,6 +16756,7 @@ const Methods = {
|
|
|
16171
16756
|
const reactData = $xeTable;
|
|
16172
16757
|
clearColDropOrigin($xeTable);
|
|
16173
16758
|
hideDropTip($xeTable);
|
|
16759
|
+
clearCrossTableDragStatus($xeTable);
|
|
16174
16760
|
reactData.dragRow = null;
|
|
16175
16761
|
reactData.dragCol = null;
|
|
16176
16762
|
},
|
|
@@ -18402,6 +18988,10 @@ const Methods = {
|
|
|
18402
18988
|
}
|
|
18403
18989
|
reactData.footerTableData = footData;
|
|
18404
18990
|
$xeTable.handleUpdateFooterMerge();
|
|
18991
|
+
$xeTable.dispatchEvent('footer-data-change', {
|
|
18992
|
+
visibleColumn: internalData.visibleColumn,
|
|
18993
|
+
footData
|
|
18994
|
+
}, null);
|
|
18405
18995
|
return $xeTable.$nextTick();
|
|
18406
18996
|
},
|
|
18407
18997
|
/**
|
|
@@ -18488,45 +19078,101 @@ const Methods = {
|
|
|
18488
19078
|
return updateStyle($xeTable);
|
|
18489
19079
|
});
|
|
18490
19080
|
},
|
|
18491
|
-
|
|
19081
|
+
setMergeHeaderCells(merges) {
|
|
19082
|
+
const $xeTable = this;
|
|
19083
|
+
handleHeaderMerge($xeTable, merges);
|
|
19084
|
+
$xeTable.handleUpdateHeaderMerge();
|
|
19085
|
+
return $xeTable.$nextTick().then(() => {
|
|
19086
|
+
return updateStyle($xeTable);
|
|
19087
|
+
});
|
|
19088
|
+
},
|
|
19089
|
+
/**
|
|
19090
|
+
* 移除表头单元格合并 [{row:Row|number, col:ColumnInfo|number}]
|
|
19091
|
+
*/
|
|
19092
|
+
removeMergeHeaderCells(merges) {
|
|
19093
|
+
const $xeTable = this;
|
|
19094
|
+
const rest = removeHeaderMerges($xeTable, merges);
|
|
19095
|
+
$xeTable.handleUpdateHeaderMerge();
|
|
19096
|
+
return $xeTable.$nextTick().then(() => {
|
|
19097
|
+
updateStyle($xeTable);
|
|
19098
|
+
return rest;
|
|
19099
|
+
});
|
|
19100
|
+
},
|
|
19101
|
+
/**
|
|
19102
|
+
* 获取所有被合并的表头单元格
|
|
19103
|
+
*/
|
|
19104
|
+
getMergeHeaderCells() {
|
|
19105
|
+
const $xeTable = this;
|
|
19106
|
+
const internalData = $xeTable;
|
|
19107
|
+
return internalData.mergeHeaderList.slice(0);
|
|
19108
|
+
},
|
|
19109
|
+
/**
|
|
19110
|
+
* 清除所有表头单元格合并
|
|
19111
|
+
*/
|
|
19112
|
+
clearMergeHeaderCells() {
|
|
19113
|
+
const $xeTable = this;
|
|
19114
|
+
const reactData = $xeTable;
|
|
19115
|
+
const internalData = $xeTable;
|
|
19116
|
+
internalData.mergeHeaderList = [];
|
|
19117
|
+
internalData.mergeHeaderMaps = {};
|
|
19118
|
+
internalData.mergeHeaderCellMaps = {};
|
|
19119
|
+
reactData.mergeHeadFlag++;
|
|
19120
|
+
return $xeTable.$nextTick().then(() => {
|
|
19121
|
+
return updateStyle($xeTable);
|
|
19122
|
+
});
|
|
19123
|
+
},
|
|
19124
|
+
setMergeFooterCells(merges) {
|
|
18492
19125
|
const $xeTable = this;
|
|
18493
19126
|
const props = $xeTable;
|
|
18494
19127
|
if (props.footerSpanMethod) {
|
|
18495
|
-
errLog('vxe.error.errConflicts', ['merge-footer-items', 'footer-span-method']);
|
|
19128
|
+
errLog('vxe.error.errConflicts', ['merge-footer-cells | merge-footer-items', 'footer-span-method']);
|
|
18496
19129
|
}
|
|
18497
19130
|
handleFooterMerge($xeTable, merges);
|
|
18498
19131
|
$xeTable.handleUpdateFooterMerge();
|
|
18499
19132
|
return $xeTable.$nextTick().then(() => {
|
|
18500
|
-
$xeTable.updateCellAreas();
|
|
18501
19133
|
return updateStyle($xeTable);
|
|
18502
19134
|
});
|
|
18503
19135
|
},
|
|
18504
|
-
|
|
19136
|
+
setMergeFooterItems(merges) {
|
|
19137
|
+
const $xeTable = this;
|
|
19138
|
+
// errLog('vxe.error.delFunc', ['setMergeFooterItems', 'setMergeFooterCells'])
|
|
19139
|
+
return $xeTable.setMergeFooterCells(merges);
|
|
19140
|
+
},
|
|
19141
|
+
removeMergeFooterCells(merges) {
|
|
18505
19142
|
const $xeTable = this;
|
|
18506
19143
|
const props = $xeTable;
|
|
18507
19144
|
if (props.footerSpanMethod) {
|
|
18508
|
-
errLog('vxe.error.errConflicts', ['merge-footer-items', 'footer-span-method']);
|
|
19145
|
+
errLog('vxe.error.errConflicts', ['merge-footer-cells | merge-footer-items', 'footer-span-method']);
|
|
18509
19146
|
}
|
|
18510
19147
|
const rest = removeFooterMerges($xeTable, merges);
|
|
18511
19148
|
$xeTable.handleUpdateFooterMerge();
|
|
18512
19149
|
return $xeTable.$nextTick().then(() => {
|
|
18513
|
-
$xeTable.updateCellAreas();
|
|
18514
19150
|
updateStyle($xeTable);
|
|
18515
19151
|
return rest;
|
|
18516
19152
|
});
|
|
18517
19153
|
},
|
|
19154
|
+
removeMergeFooterItems(merges) {
|
|
19155
|
+
const $xeTable = this;
|
|
19156
|
+
// errLog('vxe.error.delFunc', ['removeMergeFooterItems', 'removeMergeFooterCells'])
|
|
19157
|
+
return $xeTable.removeMergeFooterCells(merges);
|
|
19158
|
+
},
|
|
18518
19159
|
/**
|
|
18519
19160
|
* 获取所有被合并的表尾
|
|
18520
19161
|
*/
|
|
18521
|
-
|
|
19162
|
+
getMergeFooterCells() {
|
|
18522
19163
|
const $xeTable = this;
|
|
18523
19164
|
const internalData = $xeTable;
|
|
18524
19165
|
return internalData.mergeFooterList.slice(0);
|
|
18525
19166
|
},
|
|
19167
|
+
getMergeFooterItems() {
|
|
19168
|
+
const $xeTable = this;
|
|
19169
|
+
// errLog('vxe.error.delFunc', ['getMergeFooterItems', 'getMergeFooterCells'])
|
|
19170
|
+
return $xeTable.getMergeFooterCells();
|
|
19171
|
+
},
|
|
18526
19172
|
/**
|
|
18527
19173
|
* 清除所有表尾合并
|
|
18528
19174
|
*/
|
|
18529
|
-
|
|
19175
|
+
clearMergeFooterCells() {
|
|
18530
19176
|
const $xeTable = this;
|
|
18531
19177
|
const reactData = $xeTable;
|
|
18532
19178
|
const internalData = $xeTable;
|
|
@@ -18538,6 +19184,11 @@ const Methods = {
|
|
|
18538
19184
|
return updateStyle($xeTable);
|
|
18539
19185
|
});
|
|
18540
19186
|
},
|
|
19187
|
+
clearMergeFooterItems() {
|
|
19188
|
+
const $xeTable = this;
|
|
19189
|
+
// errLog('vxe.error.delFunc', ['clearMergeFooterItems', 'clearMergeFooterCells'])
|
|
19190
|
+
return $xeTable.clearMergeFooterCells();
|
|
19191
|
+
},
|
|
18541
19192
|
handleUpdateAggData() {
|
|
18542
19193
|
const $xeTable = this;
|
|
18543
19194
|
const internalData = $xeTable;
|
|
@@ -18575,14 +19226,7 @@ const Methods = {
|
|
|
18575
19226
|
// 已废弃,使用 dispatchEvent
|
|
18576
19227
|
emitEvent(type, params, evnt) {
|
|
18577
19228
|
const $xeTable = this;
|
|
18578
|
-
|
|
18579
|
-
const $xeGantt = $xeTable.$xeGantt;
|
|
18580
|
-
$xeTable.$emit(type, createEvent(evnt, {
|
|
18581
|
-
$table: $xeTable,
|
|
18582
|
-
$grid: $xeGrid,
|
|
18583
|
-
$gantt: $xeGantt,
|
|
18584
|
-
$event: evnt
|
|
18585
|
-
}));
|
|
19229
|
+
$xeTable.dispatchEvent(type, params, evnt);
|
|
18586
19230
|
},
|
|
18587
19231
|
focus() {
|
|
18588
19232
|
this.isActivated = true;
|
|
@@ -19682,7 +20326,7 @@ const {
|
|
|
19682
20326
|
renderEmptyElement: header_renderEmptyElement
|
|
19683
20327
|
} = core_.VxeUI;
|
|
19684
20328
|
const cellType = 'header';
|
|
19685
|
-
|
|
20329
|
+
function header_renderRows(h, _vm, isGroup, isOptimizeMode, headerGroups, $rowIndex, cols) {
|
|
19686
20330
|
const props = _vm;
|
|
19687
20331
|
const $xeTable = _vm.$parent;
|
|
19688
20332
|
const $xeGrid = $xeTable.$xeGrid;
|
|
@@ -19696,6 +20340,7 @@ const header_renderRows = (h, _vm, isGroup, isOptimizeMode, cols, $rowIndex) =>
|
|
|
19696
20340
|
const {
|
|
19697
20341
|
resizable: allResizable,
|
|
19698
20342
|
columnKey,
|
|
20343
|
+
showCustomHeader,
|
|
19699
20344
|
headerCellClassName,
|
|
19700
20345
|
headerCellStyle,
|
|
19701
20346
|
showHeaderOverflow: allColumnHeaderOverflow,
|
|
@@ -19709,11 +20354,14 @@ const header_renderRows = (h, _vm, isGroup, isOptimizeMode, cols, $rowIndex) =>
|
|
|
19709
20354
|
scrollXLoad,
|
|
19710
20355
|
scrollYLoad,
|
|
19711
20356
|
overflowX,
|
|
20357
|
+
mergeHeadFlag,
|
|
19712
20358
|
tableColumn
|
|
19713
20359
|
} = tableReactData;
|
|
19714
20360
|
const {
|
|
19715
20361
|
fullColumnIdData,
|
|
19716
|
-
scrollXStore
|
|
20362
|
+
scrollXStore,
|
|
20363
|
+
mergeHeaderList,
|
|
20364
|
+
mergeHeaderCellMaps
|
|
19717
20365
|
} = tableInternalData;
|
|
19718
20366
|
const virtualXOpts = $xeTable.computeVirtualXOpts;
|
|
19719
20367
|
const columnOpts = $xeTable.computeColumnOpts;
|
|
@@ -19727,6 +20375,7 @@ const header_renderRows = (h, _vm, isGroup, isOptimizeMode, cols, $rowIndex) =>
|
|
|
19727
20375
|
isCrossDrag,
|
|
19728
20376
|
isPeerDrag
|
|
19729
20377
|
} = columnDragOpts;
|
|
20378
|
+
const isLastRow = $rowIndex === headerGroups.length - 1;
|
|
19730
20379
|
return cols.map((column, $columnIndex) => {
|
|
19731
20380
|
const {
|
|
19732
20381
|
type,
|
|
@@ -19759,7 +20408,7 @@ const header_renderRows = (h, _vm, isGroup, isOptimizeMode, cols, $rowIndex) =>
|
|
|
19759
20408
|
hasFilter = filters.some(item => item.checked);
|
|
19760
20409
|
}
|
|
19761
20410
|
const columnIndex = colRest.index;
|
|
19762
|
-
const _columnIndex = colRest._index;
|
|
20411
|
+
const _columnIndex = showCustomHeader ? $columnIndex : colRest._index;
|
|
19763
20412
|
const cellParams = {
|
|
19764
20413
|
$table: $xeTable,
|
|
19765
20414
|
$grid: $xeGrid,
|
|
@@ -19776,10 +20425,34 @@ const header_renderRows = (h, _vm, isGroup, isOptimizeMode, cols, $rowIndex) =>
|
|
|
19776
20425
|
hasFilter
|
|
19777
20426
|
};
|
|
19778
20427
|
const thAttrs = {
|
|
19779
|
-
colid
|
|
19780
|
-
colspan: column.colSpan > 1 ? column.colSpan : null,
|
|
19781
|
-
rowspan: column.rowSpan > 1 ? column.rowSpan : null
|
|
20428
|
+
colid
|
|
19782
20429
|
};
|
|
20430
|
+
let isMergeCell = false;
|
|
20431
|
+
// 合并行或列
|
|
20432
|
+
if (!showCustomHeader) {
|
|
20433
|
+
thAttrs.colspan = column.colSpan > 1 ? column.colSpan : null;
|
|
20434
|
+
thAttrs.rowspan = column.rowSpan > 1 ? column.rowSpan : null;
|
|
20435
|
+
}
|
|
20436
|
+
if (mergeHeadFlag && mergeHeaderList.length && (showCustomHeader || isLastRow)) {
|
|
20437
|
+
const spanRest = mergeHeaderCellMaps[`${$rowIndex}:${showCustomHeader ? $columnIndex : _columnIndex}`];
|
|
20438
|
+
if (spanRest) {
|
|
20439
|
+
const {
|
|
20440
|
+
rowspan,
|
|
20441
|
+
colspan
|
|
20442
|
+
} = spanRest;
|
|
20443
|
+
if (!rowspan || !colspan) {
|
|
20444
|
+
return null;
|
|
20445
|
+
}
|
|
20446
|
+
if (rowspan > 1) {
|
|
20447
|
+
isMergeCell = true;
|
|
20448
|
+
thAttrs.rowspan = rowspan;
|
|
20449
|
+
}
|
|
20450
|
+
if (colspan > 1) {
|
|
20451
|
+
isMergeCell = true;
|
|
20452
|
+
thAttrs.colspan = colspan;
|
|
20453
|
+
}
|
|
20454
|
+
}
|
|
20455
|
+
}
|
|
19783
20456
|
const thOns = {
|
|
19784
20457
|
click: evnt => $xeTable.triggerHeaderCellClickEvent(evnt, cellParams),
|
|
19785
20458
|
dblclick: evnt => $xeTable.triggerHeaderCellDblclickEvent(evnt, cellParams)
|
|
@@ -19806,7 +20479,7 @@ const header_renderRows = (h, _vm, isGroup, isOptimizeMode, cols, $rowIndex) =>
|
|
|
19806
20479
|
const showResizable = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(column.resizable) ? column.resizable : columnOpts.resizable || allResizable;
|
|
19807
20480
|
const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto');
|
|
19808
20481
|
let isVNPreEmptyStatus = false;
|
|
19809
|
-
if (isOptimizeMode && overflowX && !isGroup) {
|
|
20482
|
+
if (isOptimizeMode && overflowX && !isGroup && !isMergeCell) {
|
|
19810
20483
|
if (!dragCol || dragCol.id !== colid) {
|
|
19811
20484
|
if (scrollXLoad && tableColumn.length > 10 && !column.fixed && !virtualXOpts.immediate && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
|
|
19812
20485
|
isVNPreEmptyStatus = true;
|
|
@@ -19820,7 +20493,7 @@ const header_renderRows = (h, _vm, isGroup, isOptimizeMode, cols, $rowIndex) =>
|
|
|
19820
20493
|
tcStyle.minHeight = `${currCellHeight}px`;
|
|
19821
20494
|
}
|
|
19822
20495
|
return h('th', {
|
|
19823
|
-
class: ['vxe-table--column vxe-header--column', colid, {
|
|
20496
|
+
class: ['vxe-table--column vxe-header--column', colid, fixedHiddenColumn ? 'fixed--hidden' : 'fixed--visible', {
|
|
19824
20497
|
[`col--${headAlign}`]: headAlign,
|
|
19825
20498
|
[`col--${type}`]: type,
|
|
19826
20499
|
'col--last': isLastColumn,
|
|
@@ -19828,7 +20501,6 @@ const header_renderRows = (h, _vm, isGroup, isOptimizeMode, cols, $rowIndex) =>
|
|
|
19828
20501
|
'col--group': isColGroup,
|
|
19829
20502
|
'col--ellipsis': hasEllipsis,
|
|
19830
20503
|
'fixed--width': !isAutoCellWidth,
|
|
19831
|
-
'fixed--hidden': fixedHiddenColumn,
|
|
19832
20504
|
'is--padding': isPadding,
|
|
19833
20505
|
'is--sortable': column.sortable,
|
|
19834
20506
|
'col--filter': !!filters,
|
|
@@ -19840,7 +20512,7 @@ const header_renderRows = (h, _vm, isGroup, isOptimizeMode, cols, $rowIndex) =>
|
|
|
19840
20512
|
attrs: thAttrs,
|
|
19841
20513
|
style: headerCellStyle ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(headerCellStyle) ? headerCellStyle(cellParams) : headerCellStyle : undefined,
|
|
19842
20514
|
on: thOns,
|
|
19843
|
-
key: columnKey || scrollXLoad || scrollYLoad || columnOpts.useKey || columnOpts.drag || isColGroup ? colid : $columnIndex
|
|
20515
|
+
key: showCustomHeader ? `${colid}${$columnIndex}` : columnKey || scrollXLoad || scrollYLoad || columnOpts.useKey || columnOpts.drag || isColGroup ? colid : $columnIndex
|
|
19844
20516
|
}, [h('div', {
|
|
19845
20517
|
class: ['vxe-cell', {
|
|
19846
20518
|
'c--title': showTitle,
|
|
@@ -19855,9 +20527,9 @@ const header_renderRows = (h, _vm, isGroup, isOptimizeMode, cols, $rowIndex) =>
|
|
|
19855
20527
|
class: 'vxe-cell--wrapper vxe-header-cell--wrapper'
|
|
19856
20528
|
}, column.renderHeader(h, cellParams))]),
|
|
19857
20529
|
/**
|
|
19858
|
-
|
|
19859
|
-
|
|
19860
|
-
!fixedHiddenColumn && showResizable ? h('div', {
|
|
20530
|
+
* 列宽拖动
|
|
20531
|
+
*/
|
|
20532
|
+
!fixedHiddenColumn && showResizable && (!showCustomHeader || isLastRow) ? h('div', {
|
|
19861
20533
|
class: 'vxe-cell--col-resizable',
|
|
19862
20534
|
on: {
|
|
19863
20535
|
mousedown: evnt => $xeTable.handleColResizeMousedownEvent(evnt, fixedType, cellParams),
|
|
@@ -19865,7 +20537,7 @@ const header_renderRows = (h, _vm, isGroup, isOptimizeMode, cols, $rowIndex) =>
|
|
|
19865
20537
|
}
|
|
19866
20538
|
}) : header_renderEmptyElement($xeTable)]);
|
|
19867
20539
|
});
|
|
19868
|
-
}
|
|
20540
|
+
}
|
|
19869
20541
|
function renderHeads(h, _vm, isGroup, isOptimizeMode, headerGroups) {
|
|
19870
20542
|
const props = _vm;
|
|
19871
20543
|
const $xeTable = _vm.$parent;
|
|
@@ -19888,7 +20560,7 @@ function renderHeads(h, _vm, isGroup, isOptimizeMode, headerGroups) {
|
|
|
19888
20560
|
key: $rowIndex,
|
|
19889
20561
|
class: ['vxe-header--row', headerRowClassName ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(headerRowClassName) ? headerRowClassName(params) : headerRowClassName : ''],
|
|
19890
20562
|
style: headerRowStyle ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(headerRowStyle) ? headerRowStyle(params) : headerRowStyle : undefined
|
|
19891
|
-
}, header_renderRows(h, _vm, isGroup, isOptimizeMode,
|
|
20563
|
+
}, header_renderRows(h, _vm, isGroup, isOptimizeMode, headerGroups, $rowIndex, cols));
|
|
19892
20564
|
});
|
|
19893
20565
|
}
|
|
19894
20566
|
/* harmony default export */ var header = ({
|
|
@@ -19910,11 +20582,13 @@ function renderHeads(h, _vm, isGroup, isOptimizeMode, headerGroups) {
|
|
|
19910
20582
|
},
|
|
19911
20583
|
watch: {
|
|
19912
20584
|
tableColumn() {
|
|
19913
|
-
this
|
|
20585
|
+
const _vm = this;
|
|
20586
|
+
_vm.uploadColumn();
|
|
19914
20587
|
}
|
|
19915
20588
|
},
|
|
19916
20589
|
created() {
|
|
19917
|
-
this
|
|
20590
|
+
const _vm = this;
|
|
20591
|
+
_vm.uploadColumn();
|
|
19918
20592
|
},
|
|
19919
20593
|
mounted() {
|
|
19920
20594
|
const _vm = this;
|
|
@@ -19937,8 +20611,9 @@ function renderHeads(h, _vm, isGroup, isOptimizeMode, headerGroups) {
|
|
|
19937
20611
|
elemStore[`${prefix}repair`] = _vm.$refs.refHeaderBorderRepair;
|
|
19938
20612
|
},
|
|
19939
20613
|
destroyed() {
|
|
19940
|
-
const
|
|
19941
|
-
const
|
|
20614
|
+
const _vm = this;
|
|
20615
|
+
const props = _vm;
|
|
20616
|
+
const $xeTable = _vm.$parent;
|
|
19942
20617
|
const internalData = $xeTable;
|
|
19943
20618
|
const {
|
|
19944
20619
|
fixedType
|
|
@@ -19956,8 +20631,9 @@ function renderHeads(h, _vm, isGroup, isOptimizeMode, headerGroups) {
|
|
|
19956
20631
|
elemStore[`${prefix}repair`] = null;
|
|
19957
20632
|
},
|
|
19958
20633
|
render(h) {
|
|
19959
|
-
const
|
|
19960
|
-
const
|
|
20634
|
+
const _vm = this;
|
|
20635
|
+
const props = _vm;
|
|
20636
|
+
const $xeTable = _vm.$parent;
|
|
19961
20637
|
const tableProps = $xeTable;
|
|
19962
20638
|
const tableReactData = $xeTable;
|
|
19963
20639
|
const tableInternalData = $xeTable;
|
|
@@ -19971,7 +20647,7 @@ function renderHeads(h, _vm, isGroup, isOptimizeMode, headerGroups) {
|
|
|
19971
20647
|
} = props;
|
|
19972
20648
|
const {
|
|
19973
20649
|
headerColumn
|
|
19974
|
-
} =
|
|
20650
|
+
} = _vm;
|
|
19975
20651
|
const {
|
|
19976
20652
|
mouseConfig,
|
|
19977
20653
|
showHeaderOverflow: allColumnHeaderOverflow,
|
|
@@ -20090,7 +20766,7 @@ function renderHeads(h, _vm, isGroup, isOptimizeMode, headerGroups) {
|
|
|
20090
20766
|
*/
|
|
20091
20767
|
h('thead', {
|
|
20092
20768
|
ref: 'refHeaderTHead'
|
|
20093
|
-
}, renderHeads(h,
|
|
20769
|
+
}, renderHeads(h, _vm, isGroup, isOptimizeMode, renderHeaderList))]), mouseConfig && mouseOpts.area ? h('div', {
|
|
20094
20770
|
class: 'vxe-table--cell-area'
|
|
20095
20771
|
}, [h('span', {
|
|
20096
20772
|
class: 'vxe-table--cell-main-area'
|
|
@@ -20108,12 +20784,37 @@ function renderHeads(h, _vm, isGroup, isOptimizeMode, headerGroups) {
|
|
|
20108
20784
|
},
|
|
20109
20785
|
methods: {
|
|
20110
20786
|
uploadColumn() {
|
|
20111
|
-
const
|
|
20787
|
+
const _vm = this;
|
|
20788
|
+
const $xeTable = _vm.$parent;
|
|
20789
|
+
const tableProps = $xeTable;
|
|
20112
20790
|
const tableReactData = $xeTable;
|
|
20791
|
+
const tableInternalData = $xeTable;
|
|
20792
|
+
const props = _vm;
|
|
20793
|
+
const {
|
|
20794
|
+
showCustomHeader
|
|
20795
|
+
} = tableProps;
|
|
20796
|
+
const {
|
|
20797
|
+
collectColumn,
|
|
20798
|
+
visibleColumn
|
|
20799
|
+
} = tableInternalData;
|
|
20800
|
+
const {
|
|
20801
|
+
tableGroupColumn
|
|
20802
|
+
} = props;
|
|
20113
20803
|
const {
|
|
20114
20804
|
isGroup
|
|
20115
20805
|
} = tableReactData;
|
|
20116
|
-
|
|
20806
|
+
let spanColumns = isGroup ? convertHeaderColumnToRows(tableGroupColumn) : [];
|
|
20807
|
+
let visibleColgroups = [];
|
|
20808
|
+
if (showCustomHeader && spanColumns.length > 1) {
|
|
20809
|
+
visibleColgroups = convertHeaderToGridRows(spanColumns);
|
|
20810
|
+
spanColumns = visibleColgroups;
|
|
20811
|
+
}
|
|
20812
|
+
_vm.headerColumn = spanColumns;
|
|
20813
|
+
$xeTable.dispatchEvent('columns-change', {
|
|
20814
|
+
visibleColgroups,
|
|
20815
|
+
collectColumn,
|
|
20816
|
+
visibleColumn
|
|
20817
|
+
}, null);
|
|
20117
20818
|
}
|
|
20118
20819
|
}
|
|
20119
20820
|
});
|
|
@@ -20411,8 +21112,9 @@ function footer_renderHeads(h, _vm, isOptimizeMode, renderColumnList) {
|
|
|
20411
21112
|
elemStore[`${prefix}xSpace`] = _vm.$refs.refFooterXSpace;
|
|
20412
21113
|
},
|
|
20413
21114
|
destroyed() {
|
|
20414
|
-
const
|
|
20415
|
-
const
|
|
21115
|
+
const _vm = this;
|
|
21116
|
+
const props = _vm;
|
|
21117
|
+
const $xeTable = _vm.$parent;
|
|
20416
21118
|
const tableInternalData = $xeTable;
|
|
20417
21119
|
const {
|
|
20418
21120
|
fixedType
|
|
@@ -20429,8 +21131,9 @@ function footer_renderHeads(h, _vm, isOptimizeMode, renderColumnList) {
|
|
|
20429
21131
|
elemStore[`${prefix}xSpace`] = null;
|
|
20430
21132
|
},
|
|
20431
21133
|
render(h) {
|
|
20432
|
-
const
|
|
20433
|
-
const
|
|
21134
|
+
const _vm = this;
|
|
21135
|
+
const props = _vm;
|
|
21136
|
+
const $xeTable = _vm.$parent;
|
|
20434
21137
|
const tableProps = $xeTable;
|
|
20435
21138
|
const tableReactData = $xeTable;
|
|
20436
21139
|
const tableInternalData = $xeTable;
|
|
@@ -20549,7 +21252,7 @@ function footer_renderHeads(h, _vm, isOptimizeMode, renderColumnList) {
|
|
|
20549
21252
|
*/
|
|
20550
21253
|
h('tfoot', {
|
|
20551
21254
|
ref: 'refFooterTFoot'
|
|
20552
|
-
}, footer_renderHeads(h,
|
|
21255
|
+
}, footer_renderHeads(h, _vm, isOptimizeMode, renderColumnList))])])]);
|
|
20553
21256
|
}
|
|
20554
21257
|
});
|
|
20555
21258
|
;// CONCATENATED MODULE: ./packages/table/module/custom/panel.ts
|
|
@@ -23041,6 +23744,7 @@ const {
|
|
|
23041
23744
|
* @param column
|
|
23042
23745
|
*/
|
|
23043
23746
|
_openFilter(fieldOrColumn) {
|
|
23747
|
+
const $xeTable = this;
|
|
23044
23748
|
const column = handleFieldOrColumn(this, fieldOrColumn);
|
|
23045
23749
|
if (column && column.filters) {
|
|
23046
23750
|
const {
|
|
@@ -23049,7 +23753,7 @@ const {
|
|
|
23049
23753
|
const {
|
|
23050
23754
|
fixed
|
|
23051
23755
|
} = column;
|
|
23052
|
-
return
|
|
23756
|
+
return $xeTable.scrollToColumn(column).then(() => {
|
|
23053
23757
|
const headerWrapperElem = elemStore[`${fixed || 'main'}-header-wrapper`] || elemStore['main-header-wrapper'];
|
|
23054
23758
|
if (headerWrapperElem) {
|
|
23055
23759
|
const filterBtnElem = headerWrapperElem.querySelector(`.vxe-header--column.${column.id} .vxe-cell--filter`);
|
|
@@ -23057,7 +23761,7 @@ const {
|
|
|
23057
23761
|
}
|
|
23058
23762
|
});
|
|
23059
23763
|
}
|
|
23060
|
-
return
|
|
23764
|
+
return $xeTable.$nextTick();
|
|
23061
23765
|
},
|
|
23062
23766
|
/**
|
|
23063
23767
|
* 修改筛选条件列表
|
|
@@ -23278,9 +23982,9 @@ const {
|
|
|
23278
23982
|
datas.push(item.data);
|
|
23279
23983
|
}
|
|
23280
23984
|
});
|
|
23281
|
-
const filterList =
|
|
23985
|
+
const filterList = $xeTable.getCheckedFilters();
|
|
23282
23986
|
const params = {
|
|
23283
|
-
$table:
|
|
23987
|
+
$table: $xeTable,
|
|
23284
23988
|
$event: evnt,
|
|
23285
23989
|
column,
|
|
23286
23990
|
field,
|
|
@@ -23292,21 +23996,21 @@ const {
|
|
|
23292
23996
|
};
|
|
23293
23997
|
// 如果是服务端筛选,则跳过本地筛选处理
|
|
23294
23998
|
if (!filterOpts.remote) {
|
|
23295
|
-
|
|
23296
|
-
|
|
23999
|
+
$xeTable.handleTableData(true);
|
|
24000
|
+
$xeTable.checkSelectionStatus();
|
|
23297
24001
|
}
|
|
23298
|
-
if (mouseConfig && mouseOpts.area &&
|
|
24002
|
+
if (mouseConfig && mouseOpts.area && $xeTable.handleFilterEvent) {
|
|
23299
24003
|
$xeTable.handleFilterEvent(evnt, params);
|
|
23300
24004
|
}
|
|
23301
24005
|
if (evnt) {
|
|
23302
|
-
$xeTable.
|
|
24006
|
+
$xeTable.dispatchEvent('filter-change', params, evnt);
|
|
23303
24007
|
}
|
|
23304
24008
|
$xeTable.closeFilter();
|
|
23305
24009
|
return $xeTable.updateFooter().then(() => {
|
|
23306
24010
|
const {
|
|
23307
24011
|
scrollXLoad,
|
|
23308
24012
|
scrollYLoad
|
|
23309
|
-
} =
|
|
24013
|
+
} = reactData;
|
|
23310
24014
|
if (oldScrollXLoad || scrollXLoad || oldScrollYLoad || scrollYLoad) {
|
|
23311
24015
|
if (oldScrollXLoad || scrollXLoad) {
|
|
23312
24016
|
$xeTable.updateScrollXSpace();
|
|
@@ -23341,6 +24045,7 @@ const {
|
|
|
23341
24045
|
$xeTable.handleColumnConfirmFilter(column, evnt);
|
|
23342
24046
|
},
|
|
23343
24047
|
handleClearFilter(column) {
|
|
24048
|
+
const $xeTable = this;
|
|
23344
24049
|
if (column) {
|
|
23345
24050
|
const {
|
|
23346
24051
|
filters,
|
|
@@ -23360,7 +24065,7 @@ const {
|
|
|
23360
24065
|
filterResetMethod({
|
|
23361
24066
|
options: filters,
|
|
23362
24067
|
column,
|
|
23363
|
-
$table:
|
|
24068
|
+
$table: $xeTable
|
|
23364
24069
|
});
|
|
23365
24070
|
}
|
|
23366
24071
|
}
|
|
@@ -23563,26 +24268,33 @@ const {
|
|
|
23563
24268
|
};
|
|
23564
24269
|
if (columnTargetNode.flag) {
|
|
23565
24270
|
const cell = columnTargetNode.targetElem;
|
|
23566
|
-
const
|
|
24271
|
+
const columnNodeRest = $xeTable.getColumnNode(cell);
|
|
24272
|
+
const column = columnNodeRest ? columnNodeRest.item : null;
|
|
23567
24273
|
let typePrefix = `${layout}-`;
|
|
23568
|
-
|
|
23569
|
-
|
|
23570
|
-
|
|
23571
|
-
|
|
23572
|
-
|
|
24274
|
+
if (column) {
|
|
24275
|
+
Object.assign(params, {
|
|
24276
|
+
column,
|
|
24277
|
+
columnIndex: $xeTable.getColumnIndex(column),
|
|
24278
|
+
cell
|
|
24279
|
+
});
|
|
24280
|
+
}
|
|
23573
24281
|
if (layout === 'body') {
|
|
23574
|
-
const
|
|
24282
|
+
const rowNodeRest = $xeTable.getRowNode(cell.parentNode);
|
|
24283
|
+
const row = rowNodeRest ? rowNodeRest.item : null;
|
|
23575
24284
|
typePrefix = '';
|
|
23576
|
-
|
|
23577
|
-
|
|
24285
|
+
if (row) {
|
|
24286
|
+
params.row = row;
|
|
24287
|
+
params.rowIndex = $xeTable.getRowIndex(row);
|
|
24288
|
+
}
|
|
23578
24289
|
}
|
|
24290
|
+
const eventType = `${typePrefix}cell-menu`;
|
|
23579
24291
|
this.handleOpenMenuEvent(evnt, layout, params);
|
|
23580
24292
|
// 在 v4 中废弃事件 cell-context-menu、header-cell-context-menu、footer-cell-context-menu
|
|
23581
24293
|
if (this.$listeners[`${typePrefix}cell-context-menu`]) {
|
|
23582
24294
|
warnLog('vxe.error.delEvent', [`${typePrefix}cell-context-menu`, `${typePrefix}cell-menu`]);
|
|
23583
|
-
|
|
24295
|
+
$xeTable.dispatchEvent(`${typePrefix}cell-context-menu`, params, evnt);
|
|
23584
24296
|
} else {
|
|
23585
|
-
|
|
24297
|
+
$xeTable.dispatchEvent(eventType, params, evnt);
|
|
23586
24298
|
}
|
|
23587
24299
|
return;
|
|
23588
24300
|
} else if (getEventTargetNode(evnt, this.$el, `vxe-table--${layout}-wrapper`, target => target.getAttribute('xid') === tId).flag) {
|
|
@@ -23765,9 +24477,9 @@ const {
|
|
|
23765
24477
|
// 在 v4 中废弃事件 context-menu-click
|
|
23766
24478
|
if (this.$listeners['context-menu-click']) {
|
|
23767
24479
|
warnLog('vxe.error.delEvent', ['context-menu-click', 'menu-click']);
|
|
23768
|
-
|
|
24480
|
+
$xeTable.dispatchEvent('context-menu-click', params, evnt);
|
|
23769
24481
|
} else {
|
|
23770
|
-
|
|
24482
|
+
$xeTable.dispatchEvent('menu-click', params, evnt);
|
|
23771
24483
|
}
|
|
23772
24484
|
this.closeMenu();
|
|
23773
24485
|
}
|
|
@@ -23944,11 +24656,13 @@ function handleInsertRowAt($xeTable, records, targetRow, isInsertNextRow) {
|
|
|
23944
24656
|
tableFullData,
|
|
23945
24657
|
fullDataRowIdData,
|
|
23946
24658
|
fullAllDataRowIdData,
|
|
23947
|
-
insertRowMaps
|
|
24659
|
+
insertRowMaps,
|
|
24660
|
+
removeRowMaps
|
|
23948
24661
|
} = internalData;
|
|
23949
24662
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
23950
24663
|
const {
|
|
23951
24664
|
transform,
|
|
24665
|
+
parentField,
|
|
23952
24666
|
rowField,
|
|
23953
24667
|
mapChildrenField
|
|
23954
24668
|
} = treeOpts;
|
|
@@ -23960,6 +24674,14 @@ function handleInsertRowAt($xeTable, records, targetRow, isInsertNextRow) {
|
|
|
23960
24674
|
[mapChildrenField]: [],
|
|
23961
24675
|
[childrenField]: []
|
|
23962
24676
|
} : {}, record)));
|
|
24677
|
+
let treeRecords = [];
|
|
24678
|
+
if (treeConfig && transform) {
|
|
24679
|
+
treeRecords = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toArrayTree(newRecords, {
|
|
24680
|
+
key: rowField,
|
|
24681
|
+
parentKey: parentField,
|
|
24682
|
+
children: childrenField
|
|
24683
|
+
});
|
|
24684
|
+
}
|
|
23963
24685
|
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(targetRow)) {
|
|
23964
24686
|
// 如果为虚拟树
|
|
23965
24687
|
if (treeConfig && transform) {
|
|
@@ -24057,21 +24779,26 @@ function handleInsertRowAt($xeTable, records, targetRow, isInsertNextRow) {
|
|
|
24057
24779
|
const parentMapChilds = parentRow ? parentRow[mapChildrenField] : tableFullTreeData;
|
|
24058
24780
|
const parentRest = fullAllDataRowIdData[getRowid($xeTable, parentRow)];
|
|
24059
24781
|
const parentLevel = parentRest ? parentRest.level : 0;
|
|
24060
|
-
|
|
24061
|
-
const rowid = getRowid($xeTable, item);
|
|
24062
|
-
if (item[treeOpts.parentField]) {
|
|
24063
|
-
if (parentRow && item[treeOpts.parentField] !== parentRow[rowField]) {
|
|
24064
|
-
errLog('vxe.error.errProp', [`${treeOpts.parentField}=${item[treeOpts.parentField]}`, `${treeOpts.parentField}=${parentRow[rowField]}`]);
|
|
24065
|
-
}
|
|
24066
|
-
}
|
|
24782
|
+
treeRecords.forEach((row, i) => {
|
|
24067
24783
|
if (parentRow) {
|
|
24068
|
-
|
|
24784
|
+
if (row[parentField] !== parentRow[rowField]) {
|
|
24785
|
+
row[parentField] = parentRow[rowField];
|
|
24786
|
+
errLog('vxe.error.errProp', [`${parentField}=${row[parentField]}`, `${parentField}=${parentRow[rowField]}`]);
|
|
24787
|
+
}
|
|
24788
|
+
} else {
|
|
24789
|
+
if (row[parentField] !== null) {
|
|
24790
|
+
row[parentField] = null;
|
|
24791
|
+
errLog('vxe.error.errProp', [`${parentField}=${row[parentField]}`, 'null']);
|
|
24792
|
+
}
|
|
24069
24793
|
}
|
|
24070
24794
|
let targetIndex = matchMapObj.index + i;
|
|
24071
24795
|
if (isInsertNextRow) {
|
|
24072
24796
|
targetIndex = targetIndex + 1;
|
|
24073
24797
|
}
|
|
24074
|
-
parentMapChilds.splice(targetIndex, 0,
|
|
24798
|
+
parentMapChilds.splice(targetIndex, 0, row);
|
|
24799
|
+
});
|
|
24800
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(treeRecords, item => {
|
|
24801
|
+
const rowid = getRowid($xeTable, item);
|
|
24075
24802
|
const rest = {
|
|
24076
24803
|
row: item,
|
|
24077
24804
|
rowid,
|
|
@@ -24089,8 +24816,13 @@ function handleInsertRowAt($xeTable, records, targetRow, isInsertNextRow) {
|
|
|
24089
24816
|
oTop: 0,
|
|
24090
24817
|
expandHeight: 0
|
|
24091
24818
|
};
|
|
24819
|
+
if (item[childrenField]) {
|
|
24820
|
+
item[mapChildrenField] = item[childrenField];
|
|
24821
|
+
}
|
|
24092
24822
|
fullDataRowIdData[rowid] = rest;
|
|
24093
24823
|
fullAllDataRowIdData[rowid] = rest;
|
|
24824
|
+
}, {
|
|
24825
|
+
children: childrenField
|
|
24094
24826
|
});
|
|
24095
24827
|
// 源
|
|
24096
24828
|
if (parentRow) {
|
|
@@ -24103,7 +24835,7 @@ function handleInsertRowAt($xeTable, records, targetRow, isInsertNextRow) {
|
|
|
24103
24835
|
if (isInsertNextRow) {
|
|
24104
24836
|
targetIndex = targetIndex + 1;
|
|
24105
24837
|
}
|
|
24106
|
-
parentChilds.splice(targetIndex, 0, ...
|
|
24838
|
+
parentChilds.splice(targetIndex, 0, ...treeRecords);
|
|
24107
24839
|
}
|
|
24108
24840
|
}
|
|
24109
24841
|
} else {
|
|
@@ -24134,7 +24866,7 @@ function handleInsertRowAt($xeTable, records, targetRow, isInsertNextRow) {
|
|
|
24134
24866
|
afIndex = Math.min(afterFullData.length, afIndex + 1);
|
|
24135
24867
|
}
|
|
24136
24868
|
if (afIndex === -1) {
|
|
24137
|
-
throw new Error(
|
|
24869
|
+
throw new Error(mixin_getI18n('vxe.error.unableInsert'));
|
|
24138
24870
|
}
|
|
24139
24871
|
afterFullData.splice(afIndex, 0, ...newRecords);
|
|
24140
24872
|
const tfIndex = $xeTable.findRowIndexOf(tableFullData, targetRow);
|
|
@@ -24158,10 +24890,27 @@ function handleInsertRowAt($xeTable, records, targetRow, isInsertNextRow) {
|
|
|
24158
24890
|
}
|
|
24159
24891
|
}
|
|
24160
24892
|
}
|
|
24161
|
-
|
|
24893
|
+
const handleStatus = newRow => {
|
|
24162
24894
|
const rowid = getRowid($xeTable, newRow);
|
|
24163
|
-
|
|
24164
|
-
|
|
24895
|
+
// 如果是被删除的数据,则还原状态
|
|
24896
|
+
if (removeRowMaps[rowid]) {
|
|
24897
|
+
delete removeRowMaps[rowid];
|
|
24898
|
+
if (insertRowMaps[rowid]) {
|
|
24899
|
+
delete insertRowMaps[rowid];
|
|
24900
|
+
}
|
|
24901
|
+
} else {
|
|
24902
|
+
insertRowMaps[rowid] = newRow;
|
|
24903
|
+
}
|
|
24904
|
+
};
|
|
24905
|
+
// 如果为虚拟树
|
|
24906
|
+
if (treeConfig && transform) {
|
|
24907
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(treeRecords, handleStatus, {
|
|
24908
|
+
children: mapChildrenField
|
|
24909
|
+
});
|
|
24910
|
+
} else {
|
|
24911
|
+
newRecords.forEach(handleStatus);
|
|
24912
|
+
}
|
|
24913
|
+
reactData.removeRowFlag++;
|
|
24165
24914
|
reactData.insertRowFlag++;
|
|
24166
24915
|
$xeTable.cacheRowMap(false);
|
|
24167
24916
|
$xeTable.updateScrollYStatus();
|
|
@@ -24812,7 +25561,9 @@ function handleEditCell($xeTable, row, fieldOrColumn, isPos) {
|
|
|
24812
25561
|
if (column && row) {
|
|
24813
25562
|
return {
|
|
24814
25563
|
row,
|
|
24815
|
-
|
|
25564
|
+
rowIndex: $xeTable.getRowIndex(row),
|
|
25565
|
+
column,
|
|
25566
|
+
columnIndex: $xeTable.getColumnIndex(column)
|
|
24816
25567
|
};
|
|
24817
25568
|
}
|
|
24818
25569
|
return null;
|
|
@@ -27783,12 +28534,13 @@ function checkRuleStatus(rule, val) {
|
|
|
27783
28534
|
* 聚焦到校验通过的单元格并弹出校验错误提示
|
|
27784
28535
|
*/
|
|
27785
28536
|
handleValidError(params) {
|
|
28537
|
+
const $xeTable = this;
|
|
27786
28538
|
const {
|
|
27787
28539
|
validOpts
|
|
27788
28540
|
} = this;
|
|
27789
28541
|
return new Promise(resolve => {
|
|
27790
28542
|
if (validOpts.autoPos === false) {
|
|
27791
|
-
|
|
28543
|
+
$xeTable.dispatchEvent('valid-error', params, null);
|
|
27792
28544
|
resolve();
|
|
27793
28545
|
} else {
|
|
27794
28546
|
this.handleEdit(params, {
|
|
@@ -28201,6 +28953,7 @@ function checkRuleStatus(rule, val) {
|
|
|
28201
28953
|
* 弹出校验错误提示
|
|
28202
28954
|
*/
|
|
28203
28955
|
showValidTooltip(params) {
|
|
28956
|
+
const $xeTable = this;
|
|
28204
28957
|
const {
|
|
28205
28958
|
$refs,
|
|
28206
28959
|
height,
|
|
@@ -28237,7 +28990,7 @@ function checkRuleStatus(rule, val) {
|
|
|
28237
28990
|
}
|
|
28238
28991
|
});
|
|
28239
28992
|
}
|
|
28240
|
-
|
|
28993
|
+
$xeTable.dispatchEvent('valid-error', params, null);
|
|
28241
28994
|
if (validTip) {
|
|
28242
28995
|
if (validTip && (validOpts.message === 'tooltip' || validOpts.message === 'default' && !height && tableData.length < 2)) {
|
|
28243
28996
|
return validTip.open(cell, content);
|
|
@@ -28700,6 +29453,7 @@ function emitCustomEvent($xeTable, type, evnt) {
|
|
|
28700
29453
|
|
|
28701
29454
|
|
|
28702
29455
|
|
|
29456
|
+
|
|
28703
29457
|
|
|
28704
29458
|
|
|
28705
29459
|
const {
|
|
@@ -28719,12 +29473,19 @@ function handleUpdateMergeBodyCells($xeTable, merges) {
|
|
|
28719
29473
|
internalData.mergeBodyCellMaps = {};
|
|
28720
29474
|
$xeTable.setMergeCells(merges);
|
|
28721
29475
|
}
|
|
29476
|
+
function handleUpdateMergeHeaderCells($xeTable, merges) {
|
|
29477
|
+
const internalData = $xeTable;
|
|
29478
|
+
internalData.mergeHeaderList = [];
|
|
29479
|
+
internalData.mergeHeaderMaps = {};
|
|
29480
|
+
internalData.mergeHeaderCellMaps = {};
|
|
29481
|
+
$xeTable.setMergeHeaderCells(merges);
|
|
29482
|
+
}
|
|
28722
29483
|
function handleUpdateMergeFooterCells($xeTable, merges) {
|
|
28723
29484
|
const internalData = $xeTable;
|
|
28724
29485
|
internalData.mergeFooterList = [];
|
|
28725
29486
|
internalData.mergeFooterMaps = {};
|
|
28726
29487
|
internalData.mergeFooterCellMaps = {};
|
|
28727
|
-
$xeTable.
|
|
29488
|
+
$xeTable.setMergeFooterCells(merges);
|
|
28728
29489
|
}
|
|
28729
29490
|
function handleKeyField($xeTable) {
|
|
28730
29491
|
const internalData = $xeTable;
|
|
@@ -28811,6 +29572,7 @@ function renderEmptyBody(h, $xeTable) {
|
|
|
28811
29572
|
const renderDragTipContents = (h, $xeTable) => {
|
|
28812
29573
|
const props = $xeTable;
|
|
28813
29574
|
const reactData = $xeTable;
|
|
29575
|
+
const crossTableDragRowInfo = getCrossTableDragRowInfo($xeTable);
|
|
28814
29576
|
const {
|
|
28815
29577
|
dragConfig
|
|
28816
29578
|
} = props;
|
|
@@ -28825,9 +29587,10 @@ const renderDragTipContents = (h, $xeTable) => {
|
|
|
28825
29587
|
const rTipSlot = rowDragSlots.tip || (dragConfig && dragConfig.slots ? dragConfig.slots.rowTip : null);
|
|
28826
29588
|
const columnDragSlots = columnDragOpts.slots || {};
|
|
28827
29589
|
const cTipSlot = columnDragSlots.tip;
|
|
28828
|
-
|
|
29590
|
+
const dRow = dragRow || (rowDragOpts.isCrossTableDrag ? crossTableDragRowInfo.row : null);
|
|
29591
|
+
if (dRow && rTipSlot) {
|
|
28829
29592
|
return $xeTable.callSlot(rTipSlot, {
|
|
28830
|
-
row:
|
|
29593
|
+
row: dRow
|
|
28831
29594
|
}, h);
|
|
28832
29595
|
}
|
|
28833
29596
|
if (dragCol && cTipSlot) {
|
|
@@ -28839,6 +29602,7 @@ const renderDragTipContents = (h, $xeTable) => {
|
|
|
28839
29602
|
};
|
|
28840
29603
|
const table_renderDragTip = (h, $xeTable) => {
|
|
28841
29604
|
const reactData = $xeTable;
|
|
29605
|
+
const crossTableDragRowInfo = getCrossTableDragRowInfo($xeTable);
|
|
28842
29606
|
const {
|
|
28843
29607
|
dragRow,
|
|
28844
29608
|
dragCol
|
|
@@ -28847,6 +29611,7 @@ const table_renderDragTip = (h, $xeTable) => {
|
|
|
28847
29611
|
const columnOpts = $xeTable.computeColumnOpts;
|
|
28848
29612
|
const rowDragOpts = $xeTable.computeRowDragOpts;
|
|
28849
29613
|
const columnDragOpts = $xeTable.computeColumnDragOpts;
|
|
29614
|
+
const dRow = dragRow || (rowDragOpts.isCrossTableDrag ? crossTableDragRowInfo.row : null);
|
|
28850
29615
|
if (rowOpts.drag || columnOpts.drag) {
|
|
28851
29616
|
return h('div', {
|
|
28852
29617
|
class: 'vxe-table--drag-wrapper'
|
|
@@ -28860,7 +29625,7 @@ const table_renderDragTip = (h, $xeTable) => {
|
|
|
28860
29625
|
class: ['vxe-table--drag-col-line', {
|
|
28861
29626
|
'is--guides': columnDragOpts.showGuidesStatus
|
|
28862
29627
|
}]
|
|
28863
|
-
}),
|
|
29628
|
+
}), dRow && rowDragOpts.showDragTip || dragCol && columnDragOpts.showDragTip ? h('div', {
|
|
28864
29629
|
ref: 'refDragTipElem',
|
|
28865
29630
|
class: 'vxe-table--drag-sort-tip'
|
|
28866
29631
|
}, [h('div', {
|
|
@@ -28868,7 +29633,7 @@ const table_renderDragTip = (h, $xeTable) => {
|
|
|
28868
29633
|
}, [h('div', {
|
|
28869
29634
|
class: 'vxe-table--drag-sort-tip-status'
|
|
28870
29635
|
}, [h('span', {
|
|
28871
|
-
class: ['vxe-table--drag-sort-tip-normal-status',
|
|
29636
|
+
class: ['vxe-table--drag-sort-tip-normal-status', dRow ? table_getIcon().TABLE_DRAG_STATUS_ROW : table_getIcon().TABLE_DRAG_STATUS_COLUMN]
|
|
28872
29637
|
}), h('span', {
|
|
28873
29638
|
class: ['vxe-table--drag-sort-tip-sub-status', table_getIcon().TABLE_DRAG_STATUS_SUB_ROW]
|
|
28874
29639
|
}), h('span', {
|
|
@@ -29027,7 +29792,9 @@ function renderScrollX(h, $xeTable) {
|
|
|
29027
29792
|
}, [h('div', {
|
|
29028
29793
|
ref: 'refScrollXSpaceElem',
|
|
29029
29794
|
class: 'vxe-table--scroll-x-space'
|
|
29030
|
-
})])
|
|
29795
|
+
})]), h('div', {
|
|
29796
|
+
class: 'vxe-table--scroll-x-handle-appearance'
|
|
29797
|
+
})]), h('div', {
|
|
29031
29798
|
ref: 'refScrollXRightCornerElem',
|
|
29032
29799
|
class: 'vxe-table--scroll-x-right-corner'
|
|
29033
29800
|
})]);
|
|
@@ -29144,9 +29911,7 @@ function renderBody(h, $xeTable) {
|
|
|
29144
29911
|
},
|
|
29145
29912
|
data() {
|
|
29146
29913
|
const xID = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().uniqueId();
|
|
29147
|
-
|
|
29148
|
-
xID,
|
|
29149
|
-
tId: xID,
|
|
29914
|
+
const reactData = {
|
|
29150
29915
|
// 低性能的静态列
|
|
29151
29916
|
staticColumns: [],
|
|
29152
29917
|
// 渲染的列分组
|
|
@@ -29167,6 +29932,8 @@ function renderBody(h, $xeTable) {
|
|
|
29167
29932
|
scrollbarWidth: 0,
|
|
29168
29933
|
// 横向滚动条的高度
|
|
29169
29934
|
scrollbarHeight: 0,
|
|
29935
|
+
// 最后滚动时间戳
|
|
29936
|
+
lastScrollTime: 0,
|
|
29170
29937
|
// 行高
|
|
29171
29938
|
rowHeight: 0,
|
|
29172
29939
|
// 表格父容器的高度
|
|
@@ -29192,9 +29959,13 @@ function renderBody(h, $xeTable) {
|
|
|
29192
29959
|
expandColumn: null,
|
|
29193
29960
|
checkboxColumn: null,
|
|
29194
29961
|
radioColumn: null,
|
|
29195
|
-
hasFixedColumn: false,
|
|
29196
29962
|
// 树节点列信息
|
|
29197
29963
|
treeNodeColumn: null,
|
|
29964
|
+
hasFixedColumn: false,
|
|
29965
|
+
// 刷新列标识,当列筛选被改变时,触发表格刷新数据
|
|
29966
|
+
upDataFlag: 0,
|
|
29967
|
+
// 刷新列标识,当列的特定属性被改变时,触发表格刷新列
|
|
29968
|
+
reColumnFlag: 0,
|
|
29198
29969
|
// 初始化标识
|
|
29199
29970
|
initStore: {
|
|
29200
29971
|
filter: false,
|
|
@@ -29202,11 +29973,6 @@ function renderBody(h, $xeTable) {
|
|
|
29202
29973
|
export: false,
|
|
29203
29974
|
custom: false
|
|
29204
29975
|
},
|
|
29205
|
-
customColumnList: [],
|
|
29206
|
-
// 刷新列标识,当列筛选被改变时,触发表格刷新数据
|
|
29207
|
-
upDataFlag: 0,
|
|
29208
|
-
// 刷新列标识,当列的特定属性被改变时,触发表格刷新列
|
|
29209
|
-
reColumnFlag: 0,
|
|
29210
29976
|
// 自定义列相关的信息
|
|
29211
29977
|
customStore: {
|
|
29212
29978
|
btnEl: null,
|
|
@@ -29220,6 +29986,7 @@ function renderBody(h, $xeTable) {
|
|
|
29220
29986
|
oldFixedMaps: {},
|
|
29221
29987
|
oldVisibleMaps: {}
|
|
29222
29988
|
},
|
|
29989
|
+
customColumnList: [],
|
|
29223
29990
|
// 当前选中的筛选列
|
|
29224
29991
|
filterStore: {
|
|
29225
29992
|
isAllSelected: false,
|
|
@@ -29288,6 +30055,7 @@ function renderBody(h, $xeTable) {
|
|
|
29288
30055
|
tooltipStore: {
|
|
29289
30056
|
row: null,
|
|
29290
30057
|
column: null,
|
|
30058
|
+
content: null,
|
|
29291
30059
|
visible: false,
|
|
29292
30060
|
currOpts: {}
|
|
29293
30061
|
},
|
|
@@ -29320,8 +30088,8 @@ function renderBody(h, $xeTable) {
|
|
|
29320
30088
|
columns: [],
|
|
29321
30089
|
isPrint: false,
|
|
29322
30090
|
hasFooter: false,
|
|
29323
|
-
hasTree: false,
|
|
29324
30091
|
hasMerge: false,
|
|
30092
|
+
hasTree: false,
|
|
29325
30093
|
hasColgroup: false,
|
|
29326
30094
|
visible: false
|
|
29327
30095
|
},
|
|
@@ -29352,6 +30120,7 @@ function renderBody(h, $xeTable) {
|
|
|
29352
30120
|
pendingRowFlag: 1,
|
|
29353
30121
|
insertRowFlag: 1,
|
|
29354
30122
|
removeRowFlag: 1,
|
|
30123
|
+
mergeHeadFlag: 1,
|
|
29355
30124
|
mergeBodyFlag: 1,
|
|
29356
30125
|
mergeFootFlag: 1,
|
|
29357
30126
|
rowHeightStore: {
|
|
@@ -29368,22 +30137,30 @@ function renderBody(h, $xeTable) {
|
|
|
29368
30137
|
scrollXLeft: 0,
|
|
29369
30138
|
scrollXWidth: 0,
|
|
29370
30139
|
isScrollXBig: false,
|
|
30140
|
+
lazScrollLoading: false,
|
|
29371
30141
|
rowExpandHeightFlag: 1,
|
|
29372
30142
|
calcCellHeightFlag: 1,
|
|
29373
30143
|
resizeHeightFlag: 1,
|
|
29374
30144
|
resizeWidthFlag: 1,
|
|
29375
30145
|
isCustomStatus: false,
|
|
29376
|
-
|
|
30146
|
+
isCrossDragRow: false,
|
|
29377
30147
|
dragRow: null,
|
|
29378
|
-
|
|
30148
|
+
isCrossDragCol: false,
|
|
29379
30149
|
dragCol: null,
|
|
29380
30150
|
dragTipText: '',
|
|
29381
30151
|
isDragResize: false,
|
|
29382
30152
|
isRowLoading: false,
|
|
29383
|
-
isColLoading: false
|
|
30153
|
+
isColLoading: false
|
|
30154
|
+
};
|
|
30155
|
+
return {
|
|
30156
|
+
xID,
|
|
30157
|
+
...reactData,
|
|
30158
|
+
// 私有属性
|
|
29384
30159
|
reScrollFlag: 0,
|
|
29385
30160
|
reLayoutFlag: 0,
|
|
29386
|
-
footFlag: 0
|
|
30161
|
+
footFlag: 0,
|
|
30162
|
+
mergeFooteCellFlag: 0,
|
|
30163
|
+
crossTableDragRowInfo: crossTableDragRowGlobal
|
|
29387
30164
|
};
|
|
29388
30165
|
},
|
|
29389
30166
|
computed: {
|
|
@@ -30147,9 +30924,21 @@ function renderBody(h, $xeTable) {
|
|
|
30147
30924
|
const $xeTable = this;
|
|
30148
30925
|
handleUpdateMergeBodyCells($xeTable, value);
|
|
30149
30926
|
},
|
|
30150
|
-
|
|
30927
|
+
mergeHeaderCells(value) {
|
|
30928
|
+
const $xeTable = this;
|
|
30929
|
+
handleUpdateMergeHeaderCells($xeTable, value);
|
|
30930
|
+
},
|
|
30931
|
+
mergeFooterCells() {
|
|
30932
|
+
this.mergeFooteCellFlag++;
|
|
30933
|
+
},
|
|
30934
|
+
mergeFooterItems() {
|
|
30935
|
+
this.mergeFooteCellFlag++;
|
|
30936
|
+
},
|
|
30937
|
+
mergeFooteCellFlag() {
|
|
30151
30938
|
const $xeTable = this;
|
|
30152
|
-
|
|
30939
|
+
const props = $xeTable;
|
|
30940
|
+
const mFooterCells = props.mergeFooterCells || props.mergeFooterItems;
|
|
30941
|
+
handleUpdateMergeFooterCells($xeTable, mFooterCells || []);
|
|
30153
30942
|
},
|
|
30154
30943
|
computeRowGroupFields(val) {
|
|
30155
30944
|
const $xeTable = this;
|
|
@@ -30207,6 +30996,7 @@ function renderBody(h, $xeTable) {
|
|
|
30207
30996
|
const currentColumnOpts = $xeTable.computeCurrentColumnOpts;
|
|
30208
30997
|
const keyboardOpts = $xeTable.computeKeyboardOpts;
|
|
30209
30998
|
const aggregateOpts = $xeTable.computeAggregateOpts;
|
|
30999
|
+
const rowDragOpts = $xeTable.computeRowDragOpts;
|
|
30210
31000
|
const {
|
|
30211
31001
|
groupFields
|
|
30212
31002
|
} = aggregateOpts;
|
|
@@ -30314,7 +31104,10 @@ function renderBody(h, $xeTable) {
|
|
|
30314
31104
|
}
|
|
30315
31105
|
}
|
|
30316
31106
|
if (treeConfig && rowOpts.drag && !treeOpts.transform) {
|
|
30317
|
-
warnLog('vxe.error.notSupportProp', ['
|
|
31107
|
+
warnLog('vxe.error.notSupportProp', ['row-config.drag', 'tree-config.transform=false', 'tree-config.transform=true']);
|
|
31108
|
+
}
|
|
31109
|
+
if (treeConfig && rowDragOpts.isCrossTableDrag && !rowDragOpts.isCrossDrag) {
|
|
31110
|
+
errLog('vxe.error.reqSupportProp', ['tree-config & row-drag-config.isCrossTableDrag', 'row-drag-config.isCrossDrag']);
|
|
30318
31111
|
}
|
|
30319
31112
|
if (props.dragConfig) {
|
|
30320
31113
|
warnLog('vxe.error.delProp', ['drag-config', 'row-drag-config']);
|
|
@@ -30641,6 +31434,7 @@ function renderBody(h, $xeTable) {
|
|
|
30641
31434
|
rightList
|
|
30642
31435
|
} = columnStore;
|
|
30643
31436
|
const loadingSlot = slots.loading;
|
|
31437
|
+
const rowDragOpts = $xeTable.computeRowDragOpts;
|
|
30644
31438
|
const tableTipConfig = $xeTable.computeTableTipConfig;
|
|
30645
31439
|
const validTipConfig = $xeTable.computeValidTipConfig;
|
|
30646
31440
|
const validOpts = $xeTable.computeValidOpts;
|
|
@@ -30660,6 +31454,13 @@ function renderBody(h, $xeTable) {
|
|
|
30660
31454
|
const columnDragOpts = $xeTable.computeColumnDragOpts;
|
|
30661
31455
|
const scrollbarXToTop = $xeTable.computeScrollbarXToTop;
|
|
30662
31456
|
const scrollbarYToLeft = $xeTable.computeScrollbarYToLeft;
|
|
31457
|
+
const {
|
|
31458
|
+
isCrossTableDrag
|
|
31459
|
+
} = rowDragOpts;
|
|
31460
|
+
const rwOns = {};
|
|
31461
|
+
if (isCrossTableDrag && !tableData.length) {
|
|
31462
|
+
rwOns.onDragover = $xeTable.handleCrossTableRowDragoverEmptyEvent;
|
|
31463
|
+
}
|
|
30663
31464
|
return h('div', {
|
|
30664
31465
|
ref: 'refElem',
|
|
30665
31466
|
class: ['vxe-table', 'vxe-table--render-default', `tid_${xID}`, `border--${tableBorder}`, `sx-pos--${scrollbarXToTop ? 'top' : 'bottom'}`, `sy-pos--${scrollbarYToLeft ? 'left' : 'right'}`, {
|
|
@@ -30719,7 +31520,8 @@ function renderBody(h, $xeTable) {
|
|
|
30719
31520
|
class: 'vxe-table-var-mini'
|
|
30720
31521
|
})]), h('div', {
|
|
30721
31522
|
key: 'tw',
|
|
30722
|
-
class: 'vxe-table--render-wrapper'
|
|
31523
|
+
class: 'vxe-table--render-wrapper',
|
|
31524
|
+
on: rwOns
|
|
30723
31525
|
}, scrollbarXToTop ? [renderScrollX(h, $xeTable), renderBody(h, $xeTable)] : [renderBody(h, $xeTable), renderScrollX(h, $xeTable)]),
|
|
30724
31526
|
/**
|
|
30725
31527
|
* 空数据
|