vxe-table 4.12.5 → 4.13.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/grid/src/grid.js +2 -2
- package/es/style.css +1 -1
- package/es/table/module/edit/hook.js +10 -9
- package/es/table/module/export/hook.js +13 -11
- package/es/table/src/body.js +11 -13
- package/es/table/src/footer.js +3 -16
- package/es/table/src/table.js +186 -63
- package/es/table/src/util.js +0 -13
- package/es/ui/index.js +2 -2
- package/es/ui/src/log.js +1 -1
- package/lib/grid/src/grid.js +2 -2
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.umd.js +8504 -8547
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/module/edit/hook.js +9 -9
- package/lib/table/module/edit/hook.min.js +1 -1
- package/lib/table/module/export/hook.js +16 -13
- package/lib/table/module/export/hook.min.js +1 -1
- package/lib/table/src/body.js +14 -15
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/footer.js +4 -27
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/table.js +211 -63
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +0 -25
- package/lib/table/src/util.min.js +1 -1
- package/lib/ui/index.js +2 -2
- 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/package.json +2 -2
- package/packages/grid/src/grid.ts +2 -2
- package/packages/table/module/edit/hook.ts +10 -9
- package/packages/table/module/export/hook.ts +15 -13
- package/packages/table/src/body.ts +11 -13
- package/packages/table/src/footer.ts +3 -17
- package/packages/table/src/table.ts +184 -64
- package/packages/table/src/util.ts +0 -14
- package/packages/ui/index.ts +1 -1
- /package/es/{iconfont.1743479147314.ttf → iconfont.1743578564396.ttf} +0 -0
- /package/es/{iconfont.1743479147314.woff → iconfont.1743578564396.woff} +0 -0
- /package/es/{iconfont.1743479147314.woff2 → iconfont.1743578564396.woff2} +0 -0
- /package/lib/{iconfont.1743479147314.ttf → iconfont.1743578564396.ttf} +0 -0
- /package/lib/{iconfont.1743479147314.woff → iconfont.1743578564396.woff} +0 -0
- /package/lib/{iconfont.1743479147314.woff2 → iconfont.1743578564396.woff2} +0 -0
|
@@ -97,8 +97,7 @@ hooks.add('tableEditModule', {
|
|
|
97
97
|
};
|
|
98
98
|
const handleInsertRowAt = (records, targetRow, isInsertNextRow) => {
|
|
99
99
|
const { treeConfig } = props;
|
|
100
|
-
const {
|
|
101
|
-
const { tableFullTreeData, afterFullData, tableFullData, fullDataRowIdData, fullAllDataRowIdData, insertRowMaps } = internalData;
|
|
100
|
+
const { tableFullTreeData, afterFullData, mergeBodyList, tableFullData, fullDataRowIdData, fullAllDataRowIdData, insertRowMaps } = internalData;
|
|
102
101
|
const treeOpts = computeTreeOpts.value;
|
|
103
102
|
const { transform, rowField, mapChildrenField } = treeOpts;
|
|
104
103
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
@@ -121,7 +120,7 @@ hooks.add('tableEditModule', {
|
|
|
121
120
|
tableFullData.unshift(item);
|
|
122
121
|
});
|
|
123
122
|
// 刷新单元格合并
|
|
124
|
-
|
|
123
|
+
mergeBodyList.forEach((mergeItem) => {
|
|
125
124
|
const { row: mergeRowIndex } = mergeItem;
|
|
126
125
|
if (mergeRowIndex > 0) {
|
|
127
126
|
mergeItem.row = mergeRowIndex + newRecords.length;
|
|
@@ -145,7 +144,7 @@ hooks.add('tableEditModule', {
|
|
|
145
144
|
tableFullData.push(item);
|
|
146
145
|
});
|
|
147
146
|
// 刷新单元格合并
|
|
148
|
-
|
|
147
|
+
mergeBodyList.forEach((mergeItem) => {
|
|
149
148
|
const { row: mergeRowIndex, rowspan: mergeRowspan } = mergeItem;
|
|
150
149
|
if (mergeRowIndex + mergeRowspan > afterFullData.length) {
|
|
151
150
|
mergeItem.rowspan = mergeRowspan + newRecords.length;
|
|
@@ -233,7 +232,7 @@ hooks.add('tableEditModule', {
|
|
|
233
232
|
tableFullData.push(...newRecords);
|
|
234
233
|
}
|
|
235
234
|
// 刷新单元格合并
|
|
236
|
-
|
|
235
|
+
mergeBodyList.forEach((mergeItem) => {
|
|
237
236
|
const { row: mergeRowIndex, rowspan: mergeRowspan } = mergeItem;
|
|
238
237
|
if (mergeRowIndex > afIndex) {
|
|
239
238
|
mergeItem.row = mergeRowIndex + newRecords.length;
|
|
@@ -257,6 +256,7 @@ hooks.add('tableEditModule', {
|
|
|
257
256
|
$xeTable.updateAfterDataIndex();
|
|
258
257
|
}
|
|
259
258
|
$xeTable.updateFooter();
|
|
259
|
+
$xeTable.handleUpdateBodyMerge();
|
|
260
260
|
$xeTable.checkSelectionStatus();
|
|
261
261
|
if (reactData.scrollYLoad) {
|
|
262
262
|
$xeTable.updateScrollYSpace();
|
|
@@ -487,8 +487,8 @@ hooks.add('tableEditModule', {
|
|
|
487
487
|
*/
|
|
488
488
|
remove(rows) {
|
|
489
489
|
const { treeConfig } = props;
|
|
490
|
-
const {
|
|
491
|
-
const { tableFullTreeData, selectCheckboxMaps, afterFullData, tableFullData, pendingRowMaps, insertRowMaps, removeRowMaps } = internalData;
|
|
490
|
+
const { editStore } = reactData;
|
|
491
|
+
const { tableFullTreeData, selectCheckboxMaps, afterFullData, mergeBodyList, tableFullData, pendingRowMaps, insertRowMaps, removeRowMaps } = internalData;
|
|
492
492
|
const checkboxOpts = computeCheckboxOpts.value;
|
|
493
493
|
const treeOpts = computeTreeOpts.value;
|
|
494
494
|
const { transform, mapChildrenField } = treeOpts;
|
|
@@ -556,7 +556,7 @@ hooks.add('tableEditModule', {
|
|
|
556
556
|
const afIndex = $xeTable.findRowIndexOf(afterFullData, row);
|
|
557
557
|
if (afIndex > -1) {
|
|
558
558
|
// 刷新单元格合并
|
|
559
|
-
|
|
559
|
+
mergeBodyList.forEach((mergeItem) => {
|
|
560
560
|
const { row: mergeRowIndex, rowspan: mergeRowspan } = mergeItem;
|
|
561
561
|
if (mergeRowIndex > afIndex) {
|
|
562
562
|
mergeItem.row = mergeRowIndex - 1;
|
|
@@ -587,9 +587,10 @@ hooks.add('tableEditModule', {
|
|
|
587
587
|
reactData.removeRowFlag++;
|
|
588
588
|
reactData.insertRowFlag++;
|
|
589
589
|
reactData.pendingRowFlag++;
|
|
590
|
-
$xeTable.updateFooter();
|
|
591
590
|
$xeTable.cacheRowMap(false);
|
|
592
591
|
$xeTable.handleTableData(treeConfig && transform);
|
|
592
|
+
$xeTable.updateFooter();
|
|
593
|
+
$xeTable.handleUpdateBodyMerge();
|
|
593
594
|
if (!(treeConfig && transform)) {
|
|
594
595
|
$xeTable.updateAfterDataIndex();
|
|
595
596
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { inject, nextTick } from 'vue';
|
|
2
2
|
import XEUtils from 'xe-utils';
|
|
3
3
|
import { VxeUI } from '../../../ui';
|
|
4
|
-
import { isColumnInfo,
|
|
4
|
+
import { isColumnInfo, getCellValue } from '../../src/util';
|
|
5
5
|
import { parseFile, formatText, eqEmptyValue } from '../../../ui/src/utils';
|
|
6
6
|
import { hasClass } from '../../../ui/src/dom';
|
|
7
7
|
import { createHtmlPage, getExportBlobByContent } from './util';
|
|
@@ -512,7 +512,8 @@ hooks.add('tableExportModule', {
|
|
|
512
512
|
};
|
|
513
513
|
const toHtml = (opts, columns, datas) => {
|
|
514
514
|
const { id, border, treeConfig, headerAlign: allHeaderAlign, align: allAlign, footerAlign: allFooterAlign, showOverflow: allColumnOverflow, showHeaderOverflow: allColumnHeaderOverflow } = props;
|
|
515
|
-
const { isAllSelected, isIndeterminate
|
|
515
|
+
const { isAllSelected, isIndeterminate } = reactData;
|
|
516
|
+
const { mergeBodyCellMaps } = internalData;
|
|
516
517
|
const treeOpts = computeTreeOpts.value;
|
|
517
518
|
const { print: isPrint, isHeader, isFooter, isColgroup, isMerge, colgroups, original } = opts;
|
|
518
519
|
const allCls = 'check-all';
|
|
@@ -574,9 +575,10 @@ hooks.add('tableExportModule', {
|
|
|
574
575
|
if (treeConfig) {
|
|
575
576
|
datas.forEach((item) => {
|
|
576
577
|
tables.push('<tr>' + columns.map((column) => {
|
|
578
|
+
const colid = column.id;
|
|
577
579
|
const cellAlign = column.align || allAlign;
|
|
578
580
|
const classNames = hasEllipsis(column, 'showOverflow', allColumnOverflow) ? ['col--ellipsis'] : [];
|
|
579
|
-
const cellValue = item[
|
|
581
|
+
const cellValue = item[colid];
|
|
580
582
|
if (cellAlign) {
|
|
581
583
|
classNames.push(`col--${cellAlign}`);
|
|
582
584
|
}
|
|
@@ -612,10 +614,10 @@ hooks.add('tableExportModule', {
|
|
|
612
614
|
const cellValue = item[column.id];
|
|
613
615
|
let rowSpan = 1;
|
|
614
616
|
let colSpan = 1;
|
|
615
|
-
if (isMerge
|
|
617
|
+
if (isMerge) {
|
|
616
618
|
const _rowIndex = $xeTable.getVTRowIndex(item._row);
|
|
617
619
|
const _columnIndex = $xeTable.getVTColumnIndex(column);
|
|
618
|
-
const spanRest =
|
|
620
|
+
const spanRest = mergeBodyCellMaps[`${_rowIndex}:${_columnIndex}`];
|
|
619
621
|
if (spanRest) {
|
|
620
622
|
const { rowspan, colspan } = spanRest;
|
|
621
623
|
if (!rowspan || !colspan) {
|
|
@@ -952,15 +954,15 @@ hooks.add('tableExportModule', {
|
|
|
952
954
|
};
|
|
953
955
|
const handleExportAndPrint = (options, isPrint) => {
|
|
954
956
|
const { treeConfig, showHeader, showFooter } = props;
|
|
955
|
-
const { initStore,
|
|
956
|
-
const { collectColumn } = internalData;
|
|
957
|
+
const { initStore, isGroup, footerTableData, exportStore, exportParams } = reactData;
|
|
958
|
+
const { collectColumn, mergeBodyList, mergeFooterList } = internalData;
|
|
957
959
|
const exportOpts = computeExportOpts.value;
|
|
958
960
|
const hasTree = treeConfig;
|
|
959
961
|
const customOpts = computeCustomOpts.value;
|
|
960
962
|
const selectRecords = $xeTable.getCheckboxRecords();
|
|
961
963
|
const proxyOpts = $xeGrid ? $xeGrid.getComputeMaps().computeProxyOpts.value : {};
|
|
962
964
|
const hasFooter = !!footerTableData.length;
|
|
963
|
-
const hasMerge = !!(
|
|
965
|
+
const hasMerge = !!(mergeBodyList.length || mergeFooterList.length);
|
|
964
966
|
const defOpts = Object.assign({
|
|
965
967
|
message: true,
|
|
966
968
|
isHeader: showHeader,
|
|
@@ -1078,12 +1080,12 @@ hooks.add('tableExportModule', {
|
|
|
1078
1080
|
*/
|
|
1079
1081
|
exportData(options) {
|
|
1080
1082
|
const { treeConfig, showHeader, showFooter } = props;
|
|
1081
|
-
const {
|
|
1082
|
-
const { tableFullColumn, afterFullData, collectColumn } = internalData;
|
|
1083
|
+
const { isGroup } = reactData;
|
|
1084
|
+
const { tableFullColumn, afterFullData, collectColumn, mergeBodyList, mergeFooterList } = internalData;
|
|
1083
1085
|
const exportOpts = computeExportOpts.value;
|
|
1084
1086
|
const treeOpts = computeTreeOpts.value;
|
|
1085
1087
|
const proxyOpts = $xeGrid ? $xeGrid.getComputeMaps().computeProxyOpts.value : {};
|
|
1086
|
-
const hasMerge = !!(
|
|
1088
|
+
const hasMerge = !!(mergeBodyList.length || mergeFooterList.length);
|
|
1087
1089
|
const opts = Object.assign({
|
|
1088
1090
|
message: true,
|
|
1089
1091
|
isHeader: showHeader,
|
package/es/table/src/body.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent, TransitionGroup, h, ref, inject, nextTick, onMounted, onUnmounted } from 'vue';
|
|
2
2
|
import XEUtils from 'xe-utils';
|
|
3
3
|
import { VxeUI } from '../../ui';
|
|
4
|
-
import { getOffsetSize, calcTreeLine,
|
|
4
|
+
import { getOffsetSize, calcTreeLine, getRowid, createHandleGetRowId } from './util';
|
|
5
5
|
import { updateCellTitle, getPropClass } from '../../ui/src/dom';
|
|
6
6
|
import { isEnableConf } from '../../ui/src/utils';
|
|
7
7
|
import { getSlotVNs } from '../../ui/src/vn';
|
|
@@ -46,14 +46,13 @@ export default defineComponent({
|
|
|
46
46
|
if (slots && slots.line) {
|
|
47
47
|
return $xeTable.callSlot(slots.line, params);
|
|
48
48
|
}
|
|
49
|
-
const
|
|
49
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
50
50
|
let rLevel = 0;
|
|
51
51
|
let prevRow = null;
|
|
52
|
-
if (
|
|
53
|
-
rLevel =
|
|
54
|
-
prevRow =
|
|
52
|
+
if (rowRest) {
|
|
53
|
+
rLevel = rowRest.level;
|
|
54
|
+
prevRow = rowRest.items[rowRest.treeIndex - 1];
|
|
55
55
|
}
|
|
56
|
-
const isFirstRow = $xeTable.eqRow(afterFullData[0], row);
|
|
57
56
|
if (treeConfig && treeNode && (treeOpts.showLine || treeOpts.line)) {
|
|
58
57
|
return [
|
|
59
58
|
h('div', {
|
|
@@ -63,7 +62,7 @@ export default defineComponent({
|
|
|
63
62
|
h('div', {
|
|
64
63
|
class: 'vxe-tree--line',
|
|
65
64
|
style: {
|
|
66
|
-
height: `${
|
|
65
|
+
height: `${$xeTable.eqRow(afterFullData[0], row) ? 1 : calcTreeLine(params, prevRow)}px`,
|
|
67
66
|
bottom: `-${Math.floor(cellHeight / 2)}px`,
|
|
68
67
|
left: `${(rLevel * treeOpts.indent) + (rLevel ? 2 - getOffsetSize($xeTable) : 0) + 16}px`
|
|
69
68
|
}
|
|
@@ -78,10 +77,9 @@ export default defineComponent({
|
|
|
78
77
|
*/
|
|
79
78
|
const renderTdColumn = (seq, rowid, fixedType, isOptimizeMode, rowLevel, row, rowIndex, $rowIndex, _rowIndex, column, $columnIndex, columns, items) => {
|
|
80
79
|
const $xeGrid = $xeTable.xeGrid;
|
|
81
|
-
const { fullAllDataRowIdData, fullColumnIdData, visibleColumn } = tableInternalData;
|
|
82
80
|
const { columnKey, resizable: allResizable, showOverflow: allShowOverflow, border, height, cellClassName: allCellClassName, cellStyle, align: allAlign, spanMethod, mouseConfig, editConfig, editRules, tooltipConfig, padding: allPadding } = tableProps;
|
|
83
|
-
const { tableData, dragRow, overflowX, currentColumn, scrollXLoad, scrollYLoad, calcCellHeightFlag, resizeHeightFlag, resizeWidthFlag,
|
|
84
|
-
const { afterFullData, scrollXStore, scrollYStore } = tableInternalData;
|
|
81
|
+
const { tableData, dragRow, overflowX, currentColumn, scrollXLoad, scrollYLoad, mergeBodyFlag, calcCellHeightFlag, resizeHeightFlag, resizeWidthFlag, editStore, isAllOverflow, validErrorMaps } = tableReactData;
|
|
82
|
+
const { fullAllDataRowIdData, fullColumnIdData, mergeBodyCellMaps, visibleColumn, afterFullData, mergeBodyList, scrollXStore, scrollYStore } = tableInternalData;
|
|
85
83
|
const cellOpts = computeCellOpts.value;
|
|
86
84
|
const validOpts = computeValidOpts.value;
|
|
87
85
|
const checkboxOpts = computeCheckboxOpts.value;
|
|
@@ -209,8 +207,8 @@ export default defineComponent({
|
|
|
209
207
|
};
|
|
210
208
|
let isMergeCell = false;
|
|
211
209
|
// 合并行或列
|
|
212
|
-
if (
|
|
213
|
-
const spanRest =
|
|
210
|
+
if (mergeBodyFlag && mergeBodyList.length) {
|
|
211
|
+
const spanRest = mergeBodyCellMaps[`${_rowIndex}:${_columnIndex}`];
|
|
214
212
|
if (spanRest) {
|
|
215
213
|
const { rowspan, colspan } = spanRest;
|
|
216
214
|
if (!rowspan || !colspan) {
|
|
@@ -240,7 +238,7 @@ export default defineComponent({
|
|
|
240
238
|
}
|
|
241
239
|
}
|
|
242
240
|
// 如果被合并不可隐藏
|
|
243
|
-
if (fixedHiddenColumn &&
|
|
241
|
+
if (fixedHiddenColumn && isMergeCell) {
|
|
244
242
|
if (tdAttrs.colspan > 1 || tdAttrs.rowspan > 1) {
|
|
245
243
|
fixedHiddenColumn = false;
|
|
246
244
|
}
|
package/es/table/src/footer.js
CHANGED
|
@@ -5,19 +5,6 @@ import { updateCellTitle, getPropClass } from '../../ui/src/dom';
|
|
|
5
5
|
import { getCellHeight } from './util';
|
|
6
6
|
const { renderer, renderEmptyElement } = VxeUI;
|
|
7
7
|
const renderType = 'footer';
|
|
8
|
-
function mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex) {
|
|
9
|
-
for (let mIndex = 0; mIndex < mergeFooterList.length; mIndex++) {
|
|
10
|
-
const { row: mergeRowIndex, col: mergeColIndex, rowspan: mergeRowspan, colspan: mergeColspan } = mergeFooterList[mIndex];
|
|
11
|
-
if (mergeColIndex > -1 && mergeRowIndex > -1 && mergeRowspan && mergeColspan) {
|
|
12
|
-
if (mergeRowIndex === _rowIndex && mergeColIndex === _columnIndex) {
|
|
13
|
-
return { rowspan: mergeRowspan, colspan: mergeColspan };
|
|
14
|
-
}
|
|
15
|
-
if (_rowIndex >= mergeRowIndex && _rowIndex < mergeRowIndex + mergeRowspan && _columnIndex >= mergeColIndex && _columnIndex < mergeColIndex + mergeColspan) {
|
|
16
|
-
return { rowspan: 0, colspan: 0 };
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
8
|
export default defineComponent({
|
|
22
9
|
name: 'VxeTableFooter',
|
|
23
10
|
props: {
|
|
@@ -52,8 +39,8 @@ export default defineComponent({
|
|
|
52
39
|
const $xeGrid = $xeTable.xeGrid;
|
|
53
40
|
const { fixedType } = props;
|
|
54
41
|
const { resizable: allResizable, border, footerCellClassName, footerCellStyle, footerAlign: allFooterAlign, footerSpanMethod, align: allAlign, columnKey, showFooterOverflow: allColumnFooterOverflow } = tableProps;
|
|
55
|
-
const { scrollXLoad, scrollYLoad, overflowX, currentColumn
|
|
56
|
-
const { fullColumnIdData, scrollXStore } = tableInternalData;
|
|
42
|
+
const { scrollXLoad, scrollYLoad, overflowX, currentColumn } = tableReactData;
|
|
43
|
+
const { fullColumnIdData, mergeFooterList, mergeFooterCellMaps, scrollXStore } = tableInternalData;
|
|
57
44
|
const tooltipOpts = computeTooltipOpts.value;
|
|
58
45
|
const resizableOpts = computeResizableOpts.value;
|
|
59
46
|
const { isAllColumnDrag } = resizableOpts;
|
|
@@ -131,7 +118,7 @@ export default defineComponent({
|
|
|
131
118
|
let isMergeCell = false;
|
|
132
119
|
// 合并行或列
|
|
133
120
|
if (mergeFooterList.length) {
|
|
134
|
-
const spanRest =
|
|
121
|
+
const spanRest = mergeFooterCellMaps[`${_rowIndex}:${_columnIndex}`];
|
|
135
122
|
if (spanRest) {
|
|
136
123
|
const { rowspan, colspan } = spanRest;
|
|
137
124
|
if (!rowspan || !colspan) {
|