vxe-table 4.23.12 → 4.23.14
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/dist/all.esm.js +4789 -4773
- package/dist/all.esm.min.js +3 -3
- package/es/colgroup/index.d.ts +18 -18
- package/es/column/index.d.ts +18 -18
- package/es/grid/index.d.ts +126 -126
- package/es/grid/src/emits.d.ts +1 -1
- package/es/grid/src/emits.js +3 -3
- package/es/grid/src/grid.d.ts +20 -20
- package/es/grid/src/grid.js +10 -10
- package/es/grid/src/props.d.ts +2 -2
- package/es/grid/src/props.js +4 -4
- package/es/index.esm.js +1 -0
- package/es/index.js +1 -0
- package/es/table/index.d.ts +118 -118
- package/es/table/module/custom/panel.js +1588 -1585
- package/es/table/module/export/export-panel.js +587 -584
- package/es/table/module/export/import-panel.js +258 -255
- package/es/table/module/filter/hook.js +1 -15
- package/es/table/module/filter/panel.js +281 -278
- package/es/table/module/menu/panel.js +225 -222
- package/es/table/src/body.js +895 -892
- package/es/table/src/column.d.ts +3 -3
- package/es/table/src/emits.d.ts +1 -1
- package/es/table/src/emits.js +2 -2
- package/es/table/src/footer.js +341 -338
- package/es/table/src/group.d.ts +3 -3
- package/es/table/src/header.js +539 -536
- package/es/table/src/props.d.ts +2 -2
- package/es/table/src/props.js +2 -2
- package/es/table/src/table.d.ts +19 -19
- package/es/table/src/table.js +15 -10
- package/es/table/src/util.d.ts +1 -1
- package/es/toolbar/index.d.ts +18 -18
- package/es/toolbar/src/toolbar.d.ts +3 -3
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/es/ui/src/vn.d.ts +1 -1
- package/lib/colgroup/index.d.ts +760 -0
- package/lib/column/index.d.ts +760 -0
- package/lib/components.d.ts +13 -0
- package/lib/grid/index.d.ts +2824 -0
- package/lib/grid/src/emits.d.ts +2 -0
- package/lib/grid/src/emits.js +2 -2
- package/lib/grid/src/grid.d.ts +556 -0
- package/lib/grid/src/grid.js +6 -6
- package/lib/grid/src/props.d.ts +200 -0
- package/lib/grid/src/props.js +3 -3
- package/lib/index.common.js +1 -0
- package/lib/index.d.ts +3 -0
- package/lib/index.js +1 -0
- package/lib/index.umd.js +4789 -4773
- package/lib/index.umd.min.js +3 -3
- package/lib/locale/ar-EG.umd.d.ts +908 -0
- package/lib/locale/de-DE.umd.d.ts +908 -0
- package/lib/locale/en-US.umd.d.ts +908 -0
- package/lib/locale/es-ES.umd.d.ts +908 -0
- package/lib/locale/fr-FR.umd.d.ts +908 -0
- package/lib/locale/hu-HU.umd.d.ts +908 -0
- package/lib/locale/hy-AM.umd.d.ts +908 -0
- package/lib/locale/id-ID.umd.d.ts +908 -0
- package/lib/locale/it-IT.umd.d.ts +908 -0
- package/lib/locale/ja-JP.umd.d.ts +908 -0
- package/lib/locale/ko-KR.umd.d.ts +908 -0
- package/lib/locale/lang/ar-EG.d.ts +908 -0
- package/lib/locale/lang/ar-EG.umd.d.ts +908 -0
- package/lib/locale/lang/de-DE.d.ts +908 -0
- package/lib/locale/lang/de-DE.umd.d.ts +908 -0
- package/lib/locale/lang/en-US.d.ts +908 -0
- package/lib/locale/lang/en-US.umd.d.ts +908 -0
- package/lib/locale/lang/es-ES.d.ts +908 -0
- package/lib/locale/lang/es-ES.umd.d.ts +908 -0
- package/lib/locale/lang/fr-FR.d.ts +908 -0
- package/lib/locale/lang/fr-FR.umd.d.ts +908 -0
- package/lib/locale/lang/hu-HU.d.ts +908 -0
- package/lib/locale/lang/hu-HU.umd.d.ts +908 -0
- package/lib/locale/lang/hy-AM.d.ts +908 -0
- package/lib/locale/lang/hy-AM.umd.d.ts +908 -0
- package/lib/locale/lang/id-ID.d.ts +908 -0
- package/lib/locale/lang/id-ID.umd.d.ts +908 -0
- package/lib/locale/lang/it-IT.d.ts +908 -0
- package/lib/locale/lang/it-IT.umd.d.ts +908 -0
- package/lib/locale/lang/ja-JP.d.ts +908 -0
- package/lib/locale/lang/ja-JP.umd.d.ts +908 -0
- package/lib/locale/lang/ko-KR.d.ts +908 -0
- package/lib/locale/lang/ko-KR.umd.d.ts +908 -0
- package/lib/locale/lang/ms-MY.d.ts +908 -0
- package/lib/locale/lang/ms-MY.umd.d.ts +908 -0
- package/lib/locale/lang/nb-NO.d.ts +908 -0
- package/lib/locale/lang/nb-NO.umd.d.ts +908 -0
- package/lib/locale/lang/pt-BR.d.ts +908 -0
- package/lib/locale/lang/pt-BR.umd.d.ts +908 -0
- package/lib/locale/lang/ru-RU.d.ts +908 -0
- package/lib/locale/lang/ru-RU.umd.d.ts +908 -0
- package/lib/locale/lang/th-TH.d.ts +908 -0
- package/lib/locale/lang/th-TH.umd.d.ts +908 -0
- package/lib/locale/lang/ug-CN.d.ts +908 -0
- package/lib/locale/lang/ug-CN.umd.d.ts +908 -0
- package/lib/locale/lang/uk-UA.d.ts +908 -0
- package/lib/locale/lang/uk-UA.umd.d.ts +908 -0
- package/lib/locale/lang/uz-UZ.d.ts +908 -0
- package/lib/locale/lang/uz-UZ.umd.d.ts +908 -0
- package/lib/locale/lang/vi-VN.d.ts +908 -0
- package/lib/locale/lang/vi-VN.umd.d.ts +908 -0
- package/lib/locale/lang/zh-CHT.d.ts +908 -0
- package/lib/locale/lang/zh-CHT.umd.d.ts +908 -0
- package/lib/locale/lang/zh-CN.d.ts +908 -0
- package/lib/locale/lang/zh-CN.umd.d.ts +908 -0
- package/lib/locale/lang/zh-HK.d.ts +908 -0
- package/lib/locale/lang/zh-HK.umd.d.ts +908 -0
- package/lib/locale/lang/zh-MO.d.ts +908 -0
- package/lib/locale/lang/zh-MO.umd.d.ts +908 -0
- package/lib/locale/lang/zh-TC.d.ts +908 -0
- package/lib/locale/lang/zh-TC.umd.d.ts +908 -0
- package/lib/locale/lang/zh-TW.d.ts +908 -0
- package/lib/locale/lang/zh-TW.umd.d.ts +908 -0
- package/lib/locale/ms-MY.umd.d.ts +908 -0
- package/lib/locale/nb-NO.umd.d.ts +908 -0
- package/lib/locale/pt-BR.umd.d.ts +908 -0
- package/lib/locale/ru-RU.umd.d.ts +908 -0
- package/lib/locale/th-TH.umd.d.ts +908 -0
- package/lib/locale/ug-CN.umd.d.ts +908 -0
- package/lib/locale/uk-UA.umd.d.ts +908 -0
- package/lib/locale/uz-UZ.umd.d.ts +908 -0
- package/lib/locale/vi-VN.umd.d.ts +908 -0
- package/lib/locale/zh-CHT.umd.d.ts +908 -0
- package/lib/locale/zh-CN.umd.d.ts +908 -0
- package/lib/locale/zh-HK.umd.d.ts +908 -0
- package/lib/locale/zh-MO.umd.d.ts +908 -0
- package/lib/locale/zh-TC.umd.d.ts +908 -0
- package/lib/locale/zh-TW.umd.d.ts +908 -0
- package/lib/table/index.d.ts +2672 -0
- package/lib/table/module/custom/hook.d.ts +1 -0
- package/lib/table/module/custom/panel.d.ts +17 -0
- package/lib/table/module/custom/panel.js +1588 -1585
- package/lib/table/module/edit/hook.d.ts +1 -0
- package/lib/table/module/export/export-panel.d.ts +27 -0
- package/lib/table/module/export/export-panel.js +587 -584
- package/lib/table/module/export/hook.d.ts +1 -0
- package/lib/table/module/export/import-panel.d.ts +27 -0
- package/lib/table/module/export/import-panel.js +258 -255
- package/lib/table/module/export/util.d.ts +5 -0
- package/lib/table/module/filter/hook.d.ts +1 -0
- package/lib/table/module/filter/hook.js +1 -15
- package/lib/table/module/filter/panel.d.ts +16 -0
- package/lib/table/module/filter/panel.js +281 -278
- package/lib/table/module/keyboard/hook.d.ts +1 -0
- package/lib/table/module/menu/hook.d.ts +1 -0
- package/lib/table/module/menu/panel.d.ts +2 -0
- package/lib/table/module/menu/panel.js +225 -222
- package/lib/table/module/validator/hook.d.ts +1 -0
- package/lib/table/render/index.d.ts +1 -0
- package/lib/table/src/body.d.ts +24 -0
- package/lib/table/src/body.js +895 -892
- package/lib/table/src/cell.d.ts +192 -0
- package/lib/table/src/column.d.ts +263 -0
- package/lib/table/src/columnInfo.d.ts +13 -0
- package/lib/table/src/emits.d.ts +2 -0
- package/lib/table/src/emits.js +2 -2
- package/lib/table/src/footer.d.ts +45 -0
- package/lib/table/src/footer.js +341 -338
- package/lib/table/src/group.d.ts +178 -0
- package/lib/table/src/header.d.ts +26 -0
- package/lib/table/src/header.js +539 -536
- package/lib/table/src/props.d.ts +238 -0
- package/lib/table/src/props.js +2 -2
- package/lib/table/src/store.d.ts +6 -0
- package/lib/table/src/table.d.ts +539 -0
- package/lib/table/src/table.js +13 -8
- package/lib/table/src/use/cell-view.d.ts +10 -0
- package/lib/table/src/use/index.d.ts +1 -0
- package/lib/table/src/util.d.ts +74 -0
- package/lib/toolbar/index.d.ts +340 -0
- package/lib/toolbar/src/toolbar.d.ts +75 -0
- package/lib/ui/index.d.ts +85 -0
- package/lib/ui/index.js +1 -1
- package/lib/ui/src/anime.d.ts +10 -0
- package/lib/ui/src/comp.d.ts +2 -0
- package/lib/ui/src/dom.d.ts +80 -0
- package/lib/ui/src/log.d.ts +6 -0
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/utils.d.ts +23 -0
- package/lib/ui/src/vn.d.ts +7 -0
- package/lib/v-x-e-table/index.d.ts +2 -0
- package/lib/vxe-colgroup/index.d.ts +3 -0
- package/lib/vxe-column/index.d.ts +3 -0
- package/lib/vxe-grid/index.d.ts +3 -0
- package/lib/vxe-table/index.d.ts +3 -0
- package/lib/vxe-toolbar/index.d.ts +3 -0
- package/lib/vxe-ui/index.d.ts +3 -0
- package/package.json +7 -7
- package/packages/grid/src/emits.ts +2 -2
- package/packages/grid/src/grid.ts +8 -8
- package/packages/grid/src/props.ts +3 -3
- package/packages/index.ts +2 -2
- package/packages/table/module/custom/panel.ts +2 -2
- package/packages/table/module/export/export-panel.ts +2 -2
- package/packages/table/module/export/import-panel.ts +2 -2
- package/packages/table/module/filter/hook.ts +1 -15
- package/packages/table/module/filter/panel.ts +2 -2
- package/packages/table/module/menu/panel.ts +2 -2
- package/packages/table/src/body.ts +2 -2
- package/packages/table/src/emits.ts +1 -1
- package/packages/table/src/footer.ts +2 -2
- package/packages/table/src/header.ts +2 -2
- package/packages/table/src/props.ts +1 -1
- package/packages/table/src/table.ts +21 -33
- /package/dist/{iconfont.1793090564415.ttf → iconfont.1793683456086.ttf} +0 -0
- /package/dist/{iconfont.1793090564415.woff → iconfont.1793683456086.woff} +0 -0
- /package/dist/{iconfont.1793090564415.woff2 → iconfont.1793683456086.woff2} +0 -0
- /package/es/{iconfont.1793090564415.ttf → iconfont.1793683456086.ttf} +0 -0
- /package/es/{iconfont.1793090564415.woff → iconfont.1793683456086.woff} +0 -0
- /package/es/{iconfont.1793090564415.woff2 → iconfont.1793683456086.woff2} +0 -0
- /package/lib/{iconfont.1793090564415.ttf → iconfont.1793683456086.ttf} +0 -0
- /package/lib/{iconfont.1793090564415.woff → iconfont.1793683456086.woff} +0 -0
- /package/lib/{iconfont.1793090564415.woff2 → iconfont.1793683456086.woff2} +0 -0
package/es/table/src/body.js
CHANGED
|
@@ -9,250 +9,268 @@ import { getSlotVNs } from "../../ui/src/vn";
|
|
|
9
9
|
const { getI18n, renderer, renderEmptyElement } = VxeUI;
|
|
10
10
|
const sourceType = "table";
|
|
11
11
|
const renderType = "body";
|
|
12
|
-
var body_default =
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
const
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
12
|
+
var body_default = (
|
|
13
|
+
/* define-vxe-component start */
|
|
14
|
+
defineVxeComponent({
|
|
15
|
+
name: "VxeTableBody",
|
|
16
|
+
props: {
|
|
17
|
+
tableData: Array,
|
|
18
|
+
tableColumn: Array,
|
|
19
|
+
fixedColumn: Array,
|
|
20
|
+
fixedType: {
|
|
21
|
+
type: String,
|
|
22
|
+
default: ""
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
setup(props) {
|
|
26
|
+
const $xeTable = inject("$xeTable", {});
|
|
27
|
+
const { xID, props: tableProps, context: tableContext, reactData: tableReactData, internalData: tableInternalData } = $xeTable;
|
|
28
|
+
const {
|
|
29
|
+
computeEditOpts,
|
|
30
|
+
computeMouseOpts,
|
|
31
|
+
computeCellOffsetWidth,
|
|
32
|
+
computeAreaOpts,
|
|
33
|
+
computeDefaultRowHeight,
|
|
34
|
+
computeEmptyOpts,
|
|
35
|
+
computeTooltipOpts,
|
|
36
|
+
computeRadioOpts,
|
|
37
|
+
computeExpandOpts,
|
|
38
|
+
computeTreeOpts,
|
|
39
|
+
computeCheckboxOpts,
|
|
40
|
+
computeCellOpts,
|
|
41
|
+
computeValidOpts,
|
|
42
|
+
computeRowOpts,
|
|
43
|
+
computeColumnOpts,
|
|
44
|
+
computeRowDragOpts,
|
|
45
|
+
computeResizableOpts,
|
|
46
|
+
computeVirtualXOpts,
|
|
47
|
+
computeVirtualYOpts,
|
|
48
|
+
computeIsBodyRenderOptimize,
|
|
49
|
+
computeRendererOpts
|
|
50
|
+
} = $xeTable.getComputeMaps();
|
|
51
|
+
const refElem = ref();
|
|
52
|
+
const refBodyScroll = ref();
|
|
53
|
+
const refBodyTable = ref();
|
|
54
|
+
const refBodyColgroup = ref();
|
|
55
|
+
const refBodyTBody = ref();
|
|
56
|
+
const refBodyXSpace = ref();
|
|
57
|
+
const refBodyYSpace = ref();
|
|
58
|
+
const refBodyEmptyBlock = ref();
|
|
59
|
+
const isVMScrollProcess = () => {
|
|
60
|
+
const { delayHover } = tableProps;
|
|
61
|
+
const { isDragResize } = tableReactData;
|
|
62
|
+
const { lastSTime } = tableInternalData;
|
|
63
|
+
return !!(isDragResize || lastSTime && Date.now() < lastSTime + delayHover);
|
|
64
|
+
};
|
|
65
|
+
const renderLine = (rowid, params, cellHeight) => {
|
|
66
|
+
const { column } = params;
|
|
67
|
+
const { treeConfig } = tableProps;
|
|
68
|
+
const cellOpts = computeCellOpts.value;
|
|
69
|
+
const rowOpts = computeRowOpts.value;
|
|
70
|
+
const defaultRowHeight = computeDefaultRowHeight.value;
|
|
71
|
+
const treeOpts = computeTreeOpts.value;
|
|
72
|
+
const { slots, treeNode } = column;
|
|
73
|
+
const { fullAllDataRowIdData } = tableInternalData;
|
|
74
|
+
if (treeConfig && treeNode && (treeOpts.showLine || treeOpts.line)) {
|
|
75
|
+
if (slots && slots.line) {
|
|
76
|
+
return $xeTable.callSlot(slots.line, params);
|
|
77
|
+
}
|
|
78
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
79
|
+
let rLevel = 0;
|
|
80
|
+
let prevRow = null;
|
|
81
|
+
let parentRow = null;
|
|
82
|
+
let lineHeight = "";
|
|
83
|
+
if (rowRest) {
|
|
84
|
+
rLevel = rowRest.level;
|
|
85
|
+
prevRow = rowRest.items[rowRest.treeIndex - 1];
|
|
86
|
+
parentRow = rowRest.parent;
|
|
87
|
+
}
|
|
88
|
+
if (!rLevel && !treeOpts.showRootLine) {
|
|
89
|
+
return [];
|
|
90
|
+
}
|
|
91
|
+
if (prevRow) {
|
|
92
|
+
const prevRowRest = fullAllDataRowIdData[getRowid($xeTable, prevRow)] || {};
|
|
93
|
+
lineHeight = `${prevRowRest.lineHeight || 0}px`;
|
|
94
|
+
} else if (rLevel && parentRow) {
|
|
95
|
+
const parentRowRest = fullAllDataRowIdData[getRowid($xeTable, parentRow)] || {};
|
|
96
|
+
lineHeight = `calc(-1em + ${Math.floor(cellHeight / 2 + getCellRestHeight(parentRowRest, cellOpts, rowOpts, defaultRowHeight) / 2)}px)`;
|
|
97
|
+
}
|
|
98
|
+
return [
|
|
99
|
+
h(
|
|
100
|
+
"div",
|
|
101
|
+
{
|
|
102
|
+
key: "tl",
|
|
103
|
+
class: "vxe-tree--line-wrapper"
|
|
104
|
+
},
|
|
105
|
+
[
|
|
106
|
+
h("div", {
|
|
107
|
+
class: "vxe-tree--line",
|
|
108
|
+
style: {
|
|
109
|
+
height: lineHeight,
|
|
110
|
+
bottom: `-${Math.floor(cellHeight / 2)}px`,
|
|
111
|
+
left: `calc(${rLevel * treeOpts.indent}px + 1em)`
|
|
112
|
+
}
|
|
113
|
+
})
|
|
114
|
+
]
|
|
115
|
+
)
|
|
116
|
+
];
|
|
75
117
|
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
118
|
+
return [];
|
|
119
|
+
};
|
|
120
|
+
const renderTdColumn = (seq, rowid, fixedType, isOptimizeMode, rowLevel, row, rowIndex, $rowIndex, _rowIndex, column, $columnIndex, columns, items) => {
|
|
121
|
+
const $xeGrid = $xeTable.xeGrid;
|
|
122
|
+
const $xeGantt = $xeTable.xeGantt;
|
|
123
|
+
const { columnKey, resizable: allResizable, showOverflow: allShowOverflow, border, height, treeConfig, cellClassName: allCellClassName, cellStyle, align: allAlign, spanMethod, mouseConfig, editConfig, editRules, tooltipConfig, padding: allPadding } = tableProps;
|
|
124
|
+
const { tableData, tableColumn, dragRow, overflowX, overflowY, scrollXLoad, scrollYLoad, mergeBodyFlag, calcCellHeightFlag, resizeHeightFlag, resizeWidthFlag, editStore, isAllOverflow, validErrorMaps, currColFlag } = tableReactData;
|
|
125
|
+
const { fullAllDataRowIdData, fullColumnIdData, mergeBodyCellMaps, visibleColumn, afterFullData, mergeBodyList, scrollXStore, scrollYStore, keepUpdateFieldMaps, currentCol } = tableInternalData;
|
|
126
|
+
const cellOpts = computeCellOpts.value;
|
|
127
|
+
const validOpts = computeValidOpts.value;
|
|
128
|
+
const checkboxOpts = computeCheckboxOpts.value;
|
|
129
|
+
const editOpts = computeEditOpts.value;
|
|
130
|
+
const tooltipOpts = computeTooltipOpts.value;
|
|
131
|
+
const resizableOpts = computeResizableOpts.value;
|
|
132
|
+
const virtualXOpts = computeVirtualXOpts.value;
|
|
133
|
+
const virtualYOpts = computeVirtualYOpts.value;
|
|
134
|
+
const rendererOpts = computeRendererOpts.value;
|
|
135
|
+
const { isAllColumnDrag, isAllRowDrag } = resizableOpts;
|
|
136
|
+
const rowOpts = computeRowOpts.value;
|
|
137
|
+
const rowDragOpts = computeRowDragOpts.value;
|
|
138
|
+
const defaultRowHeight = computeDefaultRowHeight.value;
|
|
139
|
+
const customCellHeight = calcCellHeightFlag ? cellOpts.height || rowOpts.height : 0;
|
|
140
|
+
const { disabledMethod: dragDisabledMethod, isCrossDrag, isPeerDrag } = rowDragOpts;
|
|
141
|
+
const columnOpts = computeColumnOpts.value;
|
|
142
|
+
const mouseOpts = computeMouseOpts.value;
|
|
143
|
+
const areaOpts = computeAreaOpts.value;
|
|
144
|
+
const cellOffsetWidth = computeCellOffsetWidth.value;
|
|
145
|
+
const { selectCellToRow } = areaOpts;
|
|
146
|
+
const { field, type, cellRender, editRender, align, showOverflow, className, treeNode, rowResize, padding, verticalAlign, slots } = column;
|
|
147
|
+
const { verticalAlign: allVerticalAlign, minHeight, maxHeight } = cellOpts;
|
|
148
|
+
const { actived } = editStore;
|
|
149
|
+
const rowRest = fullAllDataRowIdData[rowid] || {};
|
|
150
|
+
const colid = column.id;
|
|
151
|
+
const colRest = fullColumnIdData[colid] || {};
|
|
152
|
+
const renderOpts = editRender || cellRender;
|
|
153
|
+
const compConf = renderOpts && renderOpts.name ? rendererOpts[renderOpts.name] || renderer.get(renderOpts.name) : null;
|
|
154
|
+
const compCellClassName = compConf ? compConf.tableCellClassName || compConf.cellClassName : null;
|
|
155
|
+
const compCellStyle = compConf ? compConf.tableCellStyle || compConf.cellStyle : "";
|
|
156
|
+
const showAllTip = tooltipOpts.showAll;
|
|
157
|
+
const columnIndex = colRest.index;
|
|
158
|
+
const _columnIndex = colRest._index;
|
|
159
|
+
const isEdit = isEnableConf(editRender);
|
|
160
|
+
const resizeHeight = resizeHeightFlag ? rowRest.resizeHeight : 0;
|
|
161
|
+
let fixedHiddenColumn = overflowX && (fixedType ? column.fixed !== fixedType : !!column.fixed);
|
|
162
|
+
const cellPadding = getDefaultConfig(padding, allPadding === null ? cellOpts.padding : allPadding);
|
|
163
|
+
const isAllCellPadding = cellPadding === true;
|
|
164
|
+
const isCellPaddingTop = cellPadding ? isAllCellPadding || cellPadding.top !== false : false;
|
|
165
|
+
const isCellPaddingBottom = cellPadding ? isAllCellPadding || cellPadding.bottom !== false : false;
|
|
166
|
+
const isCellPaddingLeft = cellPadding ? isAllCellPadding || cellPadding.left !== false : false;
|
|
167
|
+
const isCellPaddingRight = cellPadding ? isAllCellPadding || cellPadding.right !== false : false;
|
|
168
|
+
const cellOverflow = getDefaultConfig(showOverflow, allShowOverflow);
|
|
169
|
+
const showEllipsis = (cellOverflow === true ? tooltipOpts.mode : cellOverflow) === "ellipsis";
|
|
170
|
+
const showTitle = (cellOverflow === true ? tooltipOpts.mode : cellOverflow) === "title";
|
|
171
|
+
const showTooltip = (cellOverflow === true ? tooltipOpts.mode : cellOverflow) === "tooltip";
|
|
172
|
+
const hasEllipsis = isAllOverflow || showTitle || showTooltip || showEllipsis;
|
|
173
|
+
const showResizable = XEUtils.isBoolean(column.resizable) ? column.resizable : columnOpts.resizable || allResizable;
|
|
174
|
+
const isCsHeight = !!customCellHeight;
|
|
175
|
+
const isRsHeight = resizeHeight > 0;
|
|
176
|
+
let isDirty;
|
|
177
|
+
const tdOns = {};
|
|
178
|
+
const cellAlign = align || (compConf ? compConf.tableCellAlign : "") || allAlign;
|
|
179
|
+
const cellVerticalAlign = XEUtils.eqNull(verticalAlign) ? allVerticalAlign : verticalAlign;
|
|
180
|
+
const errorValidItem = validErrorMaps[`${rowid}:${colid}`];
|
|
181
|
+
const showValidTip = editRules && validOpts.showErrorMessage && (validOpts.message === "default" ? height || tableData.length > 1 : validOpts.message === "inline");
|
|
182
|
+
const tdAttrs = { colid };
|
|
183
|
+
const cellParams = {
|
|
184
|
+
$table: $xeTable,
|
|
185
|
+
$grid: $xeGrid,
|
|
186
|
+
$gantt: $xeGantt,
|
|
187
|
+
isEdit: false,
|
|
188
|
+
seq,
|
|
189
|
+
rowid,
|
|
190
|
+
row,
|
|
191
|
+
rowIndex,
|
|
192
|
+
$rowIndex,
|
|
193
|
+
_rowIndex,
|
|
194
|
+
column,
|
|
195
|
+
columnIndex,
|
|
196
|
+
$columnIndex,
|
|
197
|
+
_columnIndex,
|
|
198
|
+
fixed: fixedType,
|
|
199
|
+
source: sourceType,
|
|
200
|
+
type: renderType,
|
|
201
|
+
isHidden: !!fixedHiddenColumn,
|
|
202
|
+
level: rowLevel,
|
|
203
|
+
visibleData: afterFullData,
|
|
204
|
+
data: tableData,
|
|
205
|
+
items
|
|
206
|
+
};
|
|
207
|
+
let isRowDragCell = false;
|
|
208
|
+
let isDisabledDrag = false;
|
|
209
|
+
if (rowOpts.drag) {
|
|
210
|
+
isRowDragCell = rowDragOpts.trigger === "row" || column.dragSort && rowDragOpts.trigger === "cell";
|
|
85
211
|
}
|
|
86
|
-
if (
|
|
87
|
-
|
|
212
|
+
if (isRowDragCell) {
|
|
213
|
+
isDisabledDrag = !!(dragDisabledMethod && dragDisabledMethod(cellParams));
|
|
88
214
|
}
|
|
89
|
-
if (
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
215
|
+
if (showTitle || showTooltip || showAllTip || tooltipConfig) {
|
|
216
|
+
tdOns.onMouseover = (evnt) => {
|
|
217
|
+
if (!isVMScrollProcess()) {
|
|
218
|
+
if (showTitle) {
|
|
219
|
+
updateCellTitle(evnt.currentTarget, column);
|
|
220
|
+
} else if (showTooltip || showAllTip) {
|
|
221
|
+
$xeTable.triggerBodyTooltipEvent(evnt, cellParams);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
$xeTable.dispatchEvent("cell-mouseenter", Object.assign({ cell: evnt.currentTarget }, cellParams), evnt);
|
|
225
|
+
};
|
|
95
226
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
},
|
|
103
|
-
[
|
|
104
|
-
h("div", {
|
|
105
|
-
class: "vxe-tree--line",
|
|
106
|
-
style: {
|
|
107
|
-
height: lineHeight,
|
|
108
|
-
bottom: `-${Math.floor(cellHeight / 2)}px`,
|
|
109
|
-
left: `calc(${rLevel * treeOpts.indent}px + 1em)`
|
|
110
|
-
}
|
|
111
|
-
})
|
|
112
|
-
]
|
|
113
|
-
)
|
|
114
|
-
];
|
|
115
|
-
}
|
|
116
|
-
return [];
|
|
117
|
-
};
|
|
118
|
-
const renderTdColumn = (seq, rowid, fixedType, isOptimizeMode, rowLevel, row, rowIndex, $rowIndex, _rowIndex, column, $columnIndex, columns, items) => {
|
|
119
|
-
const $xeGrid = $xeTable.xeGrid;
|
|
120
|
-
const $xeGantt = $xeTable.xeGantt;
|
|
121
|
-
const { columnKey, resizable: allResizable, showOverflow: allShowOverflow, border, height, treeConfig, cellClassName: allCellClassName, cellStyle, align: allAlign, spanMethod, mouseConfig, editConfig, editRules, tooltipConfig, padding: allPadding } = tableProps;
|
|
122
|
-
const { tableData, tableColumn, dragRow, overflowX, overflowY, scrollXLoad, scrollYLoad, mergeBodyFlag, calcCellHeightFlag, resizeHeightFlag, resizeWidthFlag, editStore, isAllOverflow, validErrorMaps, currColFlag } = tableReactData;
|
|
123
|
-
const { fullAllDataRowIdData, fullColumnIdData, mergeBodyCellMaps, visibleColumn, afterFullData, mergeBodyList, scrollXStore, scrollYStore, keepUpdateFieldMaps, currentCol } = tableInternalData;
|
|
124
|
-
const cellOpts = computeCellOpts.value;
|
|
125
|
-
const validOpts = computeValidOpts.value;
|
|
126
|
-
const checkboxOpts = computeCheckboxOpts.value;
|
|
127
|
-
const editOpts = computeEditOpts.value;
|
|
128
|
-
const tooltipOpts = computeTooltipOpts.value;
|
|
129
|
-
const resizableOpts = computeResizableOpts.value;
|
|
130
|
-
const virtualXOpts = computeVirtualXOpts.value;
|
|
131
|
-
const virtualYOpts = computeVirtualYOpts.value;
|
|
132
|
-
const rendererOpts = computeRendererOpts.value;
|
|
133
|
-
const { isAllColumnDrag, isAllRowDrag } = resizableOpts;
|
|
134
|
-
const rowOpts = computeRowOpts.value;
|
|
135
|
-
const rowDragOpts = computeRowDragOpts.value;
|
|
136
|
-
const defaultRowHeight = computeDefaultRowHeight.value;
|
|
137
|
-
const customCellHeight = calcCellHeightFlag ? cellOpts.height || rowOpts.height : 0;
|
|
138
|
-
const { disabledMethod: dragDisabledMethod, isCrossDrag, isPeerDrag } = rowDragOpts;
|
|
139
|
-
const columnOpts = computeColumnOpts.value;
|
|
140
|
-
const mouseOpts = computeMouseOpts.value;
|
|
141
|
-
const areaOpts = computeAreaOpts.value;
|
|
142
|
-
const cellOffsetWidth = computeCellOffsetWidth.value;
|
|
143
|
-
const { selectCellToRow } = areaOpts;
|
|
144
|
-
const { field, type, cellRender, editRender, align, showOverflow, className, treeNode, rowResize, padding, verticalAlign, slots } = column;
|
|
145
|
-
const { verticalAlign: allVerticalAlign, minHeight, maxHeight } = cellOpts;
|
|
146
|
-
const { actived } = editStore;
|
|
147
|
-
const rowRest = fullAllDataRowIdData[rowid] || {};
|
|
148
|
-
const colid = column.id;
|
|
149
|
-
const colRest = fullColumnIdData[colid] || {};
|
|
150
|
-
const renderOpts = editRender || cellRender;
|
|
151
|
-
const compConf = renderOpts && renderOpts.name ? rendererOpts[renderOpts.name] || renderer.get(renderOpts.name) : null;
|
|
152
|
-
const compCellClassName = compConf ? compConf.tableCellClassName || compConf.cellClassName : null;
|
|
153
|
-
const compCellStyle = compConf ? compConf.tableCellStyle || compConf.cellStyle : "";
|
|
154
|
-
const showAllTip = tooltipOpts.showAll;
|
|
155
|
-
const columnIndex = colRest.index;
|
|
156
|
-
const _columnIndex = colRest._index;
|
|
157
|
-
const isEdit = isEnableConf(editRender);
|
|
158
|
-
const resizeHeight = resizeHeightFlag ? rowRest.resizeHeight : 0;
|
|
159
|
-
let fixedHiddenColumn = overflowX && (fixedType ? column.fixed !== fixedType : !!column.fixed);
|
|
160
|
-
const cellPadding = getDefaultConfig(padding, allPadding === null ? cellOpts.padding : allPadding);
|
|
161
|
-
const isAllCellPadding = cellPadding === true;
|
|
162
|
-
const isCellPaddingTop = cellPadding ? isAllCellPadding || cellPadding.top !== false : false;
|
|
163
|
-
const isCellPaddingBottom = cellPadding ? isAllCellPadding || cellPadding.bottom !== false : false;
|
|
164
|
-
const isCellPaddingLeft = cellPadding ? isAllCellPadding || cellPadding.left !== false : false;
|
|
165
|
-
const isCellPaddingRight = cellPadding ? isAllCellPadding || cellPadding.right !== false : false;
|
|
166
|
-
const cellOverflow = getDefaultConfig(showOverflow, allShowOverflow);
|
|
167
|
-
const showEllipsis = (cellOverflow === true ? tooltipOpts.mode : cellOverflow) === "ellipsis";
|
|
168
|
-
const showTitle = (cellOverflow === true ? tooltipOpts.mode : cellOverflow) === "title";
|
|
169
|
-
const showTooltip = (cellOverflow === true ? tooltipOpts.mode : cellOverflow) === "tooltip";
|
|
170
|
-
const hasEllipsis = isAllOverflow || showTitle || showTooltip || showEllipsis;
|
|
171
|
-
const showResizable = XEUtils.isBoolean(column.resizable) ? column.resizable : columnOpts.resizable || allResizable;
|
|
172
|
-
const isCsHeight = !!customCellHeight;
|
|
173
|
-
const isRsHeight = resizeHeight > 0;
|
|
174
|
-
let isDirty;
|
|
175
|
-
const tdOns = {};
|
|
176
|
-
const cellAlign = align || (compConf ? compConf.tableCellAlign : "") || allAlign;
|
|
177
|
-
const cellVerticalAlign = XEUtils.eqNull(verticalAlign) ? allVerticalAlign : verticalAlign;
|
|
178
|
-
const errorValidItem = validErrorMaps[`${rowid}:${colid}`];
|
|
179
|
-
const showValidTip = editRules && validOpts.showErrorMessage && (validOpts.message === "default" ? height || tableData.length > 1 : validOpts.message === "inline");
|
|
180
|
-
const tdAttrs = { colid };
|
|
181
|
-
const cellParams = {
|
|
182
|
-
$table: $xeTable,
|
|
183
|
-
$grid: $xeGrid,
|
|
184
|
-
$gantt: $xeGantt,
|
|
185
|
-
isEdit: false,
|
|
186
|
-
seq,
|
|
187
|
-
rowid,
|
|
188
|
-
row,
|
|
189
|
-
rowIndex,
|
|
190
|
-
$rowIndex,
|
|
191
|
-
_rowIndex,
|
|
192
|
-
column,
|
|
193
|
-
columnIndex,
|
|
194
|
-
$columnIndex,
|
|
195
|
-
_columnIndex,
|
|
196
|
-
fixed: fixedType,
|
|
197
|
-
source: sourceType,
|
|
198
|
-
type: renderType,
|
|
199
|
-
isHidden: !!fixedHiddenColumn,
|
|
200
|
-
level: rowLevel,
|
|
201
|
-
visibleData: afterFullData,
|
|
202
|
-
data: tableData,
|
|
203
|
-
items
|
|
204
|
-
};
|
|
205
|
-
let isRowDragCell = false;
|
|
206
|
-
let isDisabledDrag = false;
|
|
207
|
-
if (rowOpts.drag) {
|
|
208
|
-
isRowDragCell = rowDragOpts.trigger === "row" || column.dragSort && rowDragOpts.trigger === "cell";
|
|
209
|
-
}
|
|
210
|
-
if (isRowDragCell) {
|
|
211
|
-
isDisabledDrag = !!(dragDisabledMethod && dragDisabledMethod(cellParams));
|
|
212
|
-
}
|
|
213
|
-
if (showTitle || showTooltip || showAllTip || tooltipConfig) {
|
|
214
|
-
tdOns.onMouseover = (evnt) => {
|
|
215
|
-
if (!isVMScrollProcess()) {
|
|
216
|
-
if (showTitle) {
|
|
217
|
-
updateCellTitle(evnt.currentTarget, column);
|
|
218
|
-
} else if (showTooltip || showAllTip) {
|
|
219
|
-
$xeTable.triggerBodyTooltipEvent(evnt, cellParams);
|
|
227
|
+
if (showTooltip || showAllTip || tooltipConfig) {
|
|
228
|
+
tdOns.onMouseleave = (evnt) => {
|
|
229
|
+
if (!isVMScrollProcess()) {
|
|
230
|
+
if (showTooltip || showAllTip) {
|
|
231
|
+
$xeTable.handleTargetLeaveEvent(evnt);
|
|
232
|
+
}
|
|
220
233
|
}
|
|
221
|
-
|
|
222
|
-
|
|
234
|
+
$xeTable.dispatchEvent("cell-mouseleave", Object.assign({ cell: evnt.currentTarget }, cellParams), evnt);
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
if (isRowDragCell || checkboxOpts.range || hasEnableConf(mouseConfig, mouseOpts)) {
|
|
238
|
+
tdOns.onMousedown = (evnt) => {
|
|
239
|
+
$xeTable.triggerCellMousedownEvent(evnt, cellParams);
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
if (isRowDragCell) {
|
|
243
|
+
tdOns.onMouseup = $xeTable.triggerCellMouseupEvent;
|
|
244
|
+
}
|
|
245
|
+
tdOns.onClick = (evnt) => {
|
|
246
|
+
$xeTable.triggerCellClickEvent(evnt, cellParams);
|
|
223
247
|
};
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
248
|
+
tdOns.onDblclick = (evnt) => {
|
|
249
|
+
$xeTable.triggerCellDblclickEvent(evnt, cellParams);
|
|
250
|
+
};
|
|
251
|
+
let isMergeCell = false;
|
|
252
|
+
let mergeColspan = 1;
|
|
253
|
+
let mergeRowspan = 1;
|
|
254
|
+
if (mergeBodyFlag && mergeBodyList.length) {
|
|
255
|
+
const spanRest = mergeBodyCellMaps[`${_rowIndex}:${_columnIndex}`];
|
|
256
|
+
if (spanRest) {
|
|
257
|
+
const { rowspan, colspan } = spanRest;
|
|
258
|
+
if (!rowspan || !colspan) {
|
|
259
|
+
return renderEmptyElement($xeTable);
|
|
260
|
+
}
|
|
261
|
+
if (rowspan > 1) {
|
|
262
|
+
isMergeCell = true;
|
|
263
|
+
mergeRowspan = rowspan;
|
|
264
|
+
tdAttrs.rowspan = rowspan;
|
|
265
|
+
}
|
|
266
|
+
if (colspan > 1) {
|
|
267
|
+
isMergeCell = true;
|
|
268
|
+
mergeColspan = colspan;
|
|
269
|
+
tdAttrs.colspan = colspan;
|
|
230
270
|
}
|
|
231
271
|
}
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
}
|
|
235
|
-
if (isRowDragCell || checkboxOpts.range || hasEnableConf(mouseConfig, mouseOpts)) {
|
|
236
|
-
tdOns.onMousedown = (evnt) => {
|
|
237
|
-
$xeTable.triggerCellMousedownEvent(evnt, cellParams);
|
|
238
|
-
};
|
|
239
|
-
}
|
|
240
|
-
if (isRowDragCell) {
|
|
241
|
-
tdOns.onMouseup = $xeTable.triggerCellMouseupEvent;
|
|
242
|
-
}
|
|
243
|
-
tdOns.onClick = (evnt) => {
|
|
244
|
-
$xeTable.triggerCellClickEvent(evnt, cellParams);
|
|
245
|
-
};
|
|
246
|
-
tdOns.onDblclick = (evnt) => {
|
|
247
|
-
$xeTable.triggerCellDblclickEvent(evnt, cellParams);
|
|
248
|
-
};
|
|
249
|
-
let isMergeCell = false;
|
|
250
|
-
let mergeColspan = 1;
|
|
251
|
-
let mergeRowspan = 1;
|
|
252
|
-
if (mergeBodyFlag && mergeBodyList.length) {
|
|
253
|
-
const spanRest = mergeBodyCellMaps[`${_rowIndex}:${_columnIndex}`];
|
|
254
|
-
if (spanRest) {
|
|
255
|
-
const { rowspan, colspan } = spanRest;
|
|
272
|
+
} else if (spanMethod) {
|
|
273
|
+
const { rowspan = 1, colspan = 1 } = spanMethod(cellParams) || {};
|
|
256
274
|
if (!rowspan || !colspan) {
|
|
257
275
|
return renderEmptyElement($xeTable);
|
|
258
276
|
}
|
|
@@ -267,115 +285,65 @@ var body_default = defineVxeComponent({
|
|
|
267
285
|
tdAttrs.colspan = colspan;
|
|
268
286
|
}
|
|
269
287
|
}
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
}
|
|
275
|
-
if (rowspan > 1) {
|
|
276
|
-
isMergeCell = true;
|
|
277
|
-
mergeRowspan = rowspan;
|
|
278
|
-
tdAttrs.rowspan = rowspan;
|
|
279
|
-
}
|
|
280
|
-
if (colspan > 1) {
|
|
281
|
-
isMergeCell = true;
|
|
282
|
-
mergeColspan = colspan;
|
|
283
|
-
tdAttrs.colspan = colspan;
|
|
288
|
+
if (fixedHiddenColumn && isMergeCell) {
|
|
289
|
+
if (tdAttrs.colspan > 1 || tdAttrs.rowspan > 1) {
|
|
290
|
+
fixedHiddenColumn = false;
|
|
291
|
+
}
|
|
284
292
|
}
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
if (tdAttrs.colspan > 1 || tdAttrs.rowspan > 1) {
|
|
288
|
-
fixedHiddenColumn = false;
|
|
293
|
+
if (!fixedHiddenColumn && editConfig && (editOpts.showStatus || editOpts.showUpdateStatus) && keepUpdateFieldMaps[field]) {
|
|
294
|
+
isDirty = $xeTable.isUpdateByRow(row, field);
|
|
289
295
|
}
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
isVNPreEmptyStatus = true;
|
|
303
|
-
} else if (overflowX && scrollXLoad && tableColumn.length > 10 && !virtualXOpts.immediate && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
|
|
304
|
-
isVNPreEmptyStatus = true;
|
|
296
|
+
const isVNAutoHeight = !hasEllipsis && (scrollYLoad || scrollXLoad);
|
|
297
|
+
let cellHeight = getCellRestHeight(rowRest, cellOpts, rowOpts, defaultRowHeight);
|
|
298
|
+
const isLastColumn = $columnIndex === columns.length - 1;
|
|
299
|
+
const isAutoCellWidth = !column.resizeWidth && (column.minWidth === "auto" || column.width === "auto");
|
|
300
|
+
let isVNPreEmptyStatus = false;
|
|
301
|
+
if (!isMergeCell) {
|
|
302
|
+
if (!dragRow || getRowid($xeTable, dragRow) !== rowid) {
|
|
303
|
+
if (overflowY && scrollYLoad && tableData.length > 16 && !treeConfig && !virtualYOpts.immediate && (_rowIndex < scrollYStore.visibleStartIndex - scrollYStore.preloadSize || _rowIndex > scrollYStore.visibleEndIndex + scrollYStore.preloadSize)) {
|
|
304
|
+
isVNPreEmptyStatus = true;
|
|
305
|
+
} else if (overflowX && scrollXLoad && tableColumn.length > 10 && !virtualXOpts.immediate && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
|
|
306
|
+
isVNPreEmptyStatus = true;
|
|
307
|
+
}
|
|
305
308
|
}
|
|
306
309
|
}
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
310
|
+
if (mergeRowspan > 1) {
|
|
311
|
+
const mEndRow = afterFullData[_rowIndex + mergeRowspan - 1];
|
|
312
|
+
if (mEndRow) {
|
|
313
|
+
const meRowRest = fullAllDataRowIdData[getRowid($xeTable, mEndRow)];
|
|
314
|
+
if (meRowRest) {
|
|
315
|
+
cellHeight += meRowRest.oTop + getCellRestHeight(meRowRest, cellOpts, rowOpts, defaultRowHeight) - rowRest.oTop - getCellRestHeight(rowRest, cellOpts, rowOpts, defaultRowHeight);
|
|
316
|
+
}
|
|
314
317
|
}
|
|
315
318
|
}
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
319
|
+
const tcStyle = {};
|
|
320
|
+
if (maxHeight) {
|
|
321
|
+
tcStyle.maxHeight = maxHeight + "px";
|
|
322
|
+
}
|
|
323
|
+
if (hasEllipsis && resizeWidthFlag) {
|
|
324
|
+
let mergeColWidth = 0;
|
|
325
|
+
if (mergeColspan > 1) {
|
|
326
|
+
for (let index = 1; index < mergeColspan; index++) {
|
|
327
|
+
const nextColumn = visibleColumn[columnIndex + index];
|
|
328
|
+
if (nextColumn) {
|
|
329
|
+
mergeColWidth += nextColumn.renderWidth;
|
|
330
|
+
}
|
|
328
331
|
}
|
|
329
332
|
}
|
|
333
|
+
tcStyle.width = column.renderWidth + mergeColWidth - cellOffsetWidth + "px";
|
|
330
334
|
}
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
} else {
|
|
336
|
-
tcStyle.minHeight = cellHeight + "px";
|
|
337
|
-
}
|
|
338
|
-
if (minHeight) {
|
|
339
|
-
tcStyle.minHeight = minHeight + "px";
|
|
340
|
-
}
|
|
341
|
-
const tdVNs = [];
|
|
342
|
-
if (fixedHiddenColumn && isAllOverflow) {
|
|
343
|
-
tdVNs.push(
|
|
344
|
-
h("div", {
|
|
345
|
-
key: "tc",
|
|
346
|
-
class: [
|
|
347
|
-
"vxe-cell",
|
|
348
|
-
{
|
|
349
|
-
"c--title": showTitle,
|
|
350
|
-
"c--tooltip": showTooltip,
|
|
351
|
-
"c--ellipsis": showEllipsis
|
|
352
|
-
}
|
|
353
|
-
],
|
|
354
|
-
style: tcStyle
|
|
355
|
-
})
|
|
356
|
-
);
|
|
357
|
-
} else {
|
|
358
|
-
if (treeConfig) {
|
|
359
|
-
tdVNs.push(...renderLine(rowid, cellParams, cellHeight));
|
|
335
|
+
if (scrollYLoad || scrollXLoad || hasEllipsis || isCsHeight || isRsHeight) {
|
|
336
|
+
tcStyle.height = cellHeight + "px";
|
|
337
|
+
} else {
|
|
338
|
+
tcStyle.minHeight = cellHeight + "px";
|
|
360
339
|
}
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
clVNs.push(
|
|
364
|
-
h(
|
|
365
|
-
"div",
|
|
366
|
-
{
|
|
367
|
-
colid,
|
|
368
|
-
rowid,
|
|
369
|
-
class: "vxe-cell--wrapper vxe-body-cell--wrapper"
|
|
370
|
-
},
|
|
371
|
-
column.renderCell(cellParams)
|
|
372
|
-
)
|
|
373
|
-
);
|
|
340
|
+
if (minHeight) {
|
|
341
|
+
tcStyle.minHeight = minHeight + "px";
|
|
374
342
|
}
|
|
375
|
-
tdVNs
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
{
|
|
343
|
+
const tdVNs = [];
|
|
344
|
+
if (fixedHiddenColumn && isAllOverflow) {
|
|
345
|
+
tdVNs.push(
|
|
346
|
+
h("div", {
|
|
379
347
|
key: "tc",
|
|
380
348
|
class: [
|
|
381
349
|
"vxe-cell",
|
|
@@ -385,349 +353,76 @@ var body_default = defineVxeComponent({
|
|
|
385
353
|
"c--ellipsis": showEllipsis
|
|
386
354
|
}
|
|
387
355
|
],
|
|
388
|
-
style: tcStyle
|
|
389
|
-
|
|
390
|
-
},
|
|
391
|
-
clVNs
|
|
392
|
-
)
|
|
393
|
-
);
|
|
394
|
-
if (showValidTip && errorValidItem) {
|
|
395
|
-
const errRule = errorValidItem.rule;
|
|
396
|
-
const validSlot = slots ? slots.valid : null;
|
|
397
|
-
const validParams = { ...cellParams, ...errorValidItem, rule: errorValidItem };
|
|
398
|
-
tdVNs.push(
|
|
399
|
-
h(
|
|
400
|
-
"div",
|
|
401
|
-
{
|
|
402
|
-
key: "tcv",
|
|
403
|
-
class: ["vxe-cell--valid-error-tip", getPropClass(validOpts.className, validParams)],
|
|
404
|
-
style: errRule && errRule.maxWidth ? {
|
|
405
|
-
width: errRule.maxWidth + "px"
|
|
406
|
-
} : null
|
|
407
|
-
},
|
|
408
|
-
[
|
|
409
|
-
h(
|
|
410
|
-
"div",
|
|
411
|
-
{
|
|
412
|
-
class: `vxe-cell--valid-error-wrapper vxe-cell--valid-error-theme-${validOpts.theme || "normal"}`
|
|
413
|
-
},
|
|
414
|
-
[
|
|
415
|
-
validSlot ? $xeTable.callSlot(validSlot, validParams) : [
|
|
416
|
-
h(
|
|
417
|
-
"span",
|
|
418
|
-
{
|
|
419
|
-
class: "vxe-cell--valid-error-msg"
|
|
420
|
-
},
|
|
421
|
-
errorValidItem.content
|
|
422
|
-
)
|
|
423
|
-
]
|
|
424
|
-
]
|
|
425
|
-
)
|
|
426
|
-
]
|
|
427
|
-
)
|
|
356
|
+
style: tcStyle
|
|
357
|
+
})
|
|
428
358
|
);
|
|
429
|
-
}
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
if (hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area && !_columnIndex && selectCellToRow) {
|
|
433
|
-
showAreaRowStatus = true;
|
|
434
|
-
}
|
|
435
|
-
if (!fixedHiddenColumn && showResizable && isAllColumnDrag) {
|
|
436
|
-
tdVNs.push(
|
|
437
|
-
h("div", {
|
|
438
|
-
key: "tcc",
|
|
439
|
-
class: [
|
|
440
|
-
"vxe-cell--col-resizable",
|
|
441
|
-
{
|
|
442
|
-
"is--line": !border || border === "none"
|
|
443
|
-
}
|
|
444
|
-
],
|
|
445
|
-
onMousedown: (evnt) => $xeTable.handleColResizeMousedownEvent(evnt, fixedType, cellParams),
|
|
446
|
-
onDblclick: (evnt) => $xeTable.handleColResizeDblclickEvent(evnt, cellParams)
|
|
447
|
-
})
|
|
448
|
-
);
|
|
449
|
-
}
|
|
450
|
-
if ((rowResize || isAllRowDrag) && rowOpts.resizable) {
|
|
451
|
-
tdVNs.push(
|
|
452
|
-
h("div", {
|
|
453
|
-
key: "tcr",
|
|
454
|
-
class: "vxe-cell--row-resizable",
|
|
455
|
-
onMousedown: (evnt) => $xeTable.handleRowResizeMousedownEvent(evnt, cellParams),
|
|
456
|
-
onDblclick: (evnt) => $xeTable.handleRowResizeDblclickEvent(evnt, cellParams)
|
|
457
|
-
})
|
|
458
|
-
);
|
|
459
|
-
}
|
|
460
|
-
return h(
|
|
461
|
-
"td",
|
|
462
|
-
{
|
|
463
|
-
class: [
|
|
464
|
-
"vxe-table--column vxe-body--column",
|
|
465
|
-
colid,
|
|
466
|
-
cellVerticalAlign ? `col--vertical-${cellVerticalAlign}` : "",
|
|
467
|
-
cellAlign ? `col--${cellAlign}` : "",
|
|
468
|
-
type ? `col--${type}` : "",
|
|
469
|
-
{
|
|
470
|
-
"col--last": isLastColumn,
|
|
471
|
-
"col--tree-node": treeNode,
|
|
472
|
-
"col--edit": isEdit,
|
|
473
|
-
"col--ellipsis": hasEllipsis,
|
|
474
|
-
"col--cs-height": isCsHeight,
|
|
475
|
-
"col--rs-height": isRsHeight,
|
|
476
|
-
"col--to-row": showAreaRowStatus,
|
|
477
|
-
"col--auto-height": isVNAutoHeight,
|
|
478
|
-
"col--max-height": maxHeight,
|
|
479
|
-
"fixed--width": !isAutoCellWidth,
|
|
480
|
-
"fixed--hidden": fixedHiddenColumn,
|
|
481
|
-
"is--pg-top": isCellPaddingTop,
|
|
482
|
-
"is--pg-bottom": isCellPaddingBottom,
|
|
483
|
-
"is--pg-left": isCellPaddingLeft,
|
|
484
|
-
"is--pg-right": isCellPaddingRight,
|
|
485
|
-
"is--progress": fixedHiddenColumn && isAllOverflow || isVNPreEmptyStatus,
|
|
486
|
-
"is--drag-cell": isRowDragCell && (isCrossDrag || isPeerDrag || !rowLevel),
|
|
487
|
-
"is--drag-disabled": isDisabledDrag,
|
|
488
|
-
"col--dirty": isDirty,
|
|
489
|
-
"col--active": editConfig && isEdit && actived.row === row && (actived.column === column || editOpts.mode === "row"),
|
|
490
|
-
"col--valid-error": !!errorValidItem,
|
|
491
|
-
"show--valid-bg": errorValidItem && validOpts.showErrorBackground,
|
|
492
|
-
"col--current": currColFlag && currentCol === column
|
|
493
|
-
},
|
|
494
|
-
getPropClass(compCellClassName, cellParams),
|
|
495
|
-
getPropClass(className, cellParams),
|
|
496
|
-
getPropClass(allCellClassName, cellParams)
|
|
497
|
-
],
|
|
498
|
-
key: columnKey || scrollXLoad || scrollYLoad || columnOpts.useKey || rowOpts.useKey || columnOpts.drag ? colid : $columnIndex,
|
|
499
|
-
...tdAttrs,
|
|
500
|
-
style: Object.assign({}, XEUtils.isFunction(compCellStyle) ? compCellStyle(cellParams) : compCellStyle, XEUtils.isFunction(cellStyle) ? cellStyle(cellParams) : cellStyle),
|
|
501
|
-
...tdOns
|
|
502
|
-
},
|
|
503
|
-
isOptimizeMode && fixedHiddenColumn ? [] : tdVNs
|
|
504
|
-
);
|
|
505
|
-
};
|
|
506
|
-
const renderRows = (fixedType, isOptimizeMode, tableData, tableColumn) => {
|
|
507
|
-
const $xeGrid = $xeTable.xeGrid;
|
|
508
|
-
const $xeGantt = $xeTable.xeGantt;
|
|
509
|
-
const { stripe, rowKey, highlightHoverRow, rowClassName, rowStyle, editConfig, treeConfig } = tableProps;
|
|
510
|
-
const { hasFixedColumn, treeExpandedFlag, scrollYLoad, isAllOverflow, rowExpandedFlag, expandColumn, selectRadioRow, pendingRowFlag, rowExpandHeightFlag, isRowGroupStatus } = tableReactData;
|
|
511
|
-
const { fullAllDataRowIdData, fullColumnIdData, treeExpandedMaps, pendingRowMaps, rowExpandedMaps, currentRow } = tableInternalData;
|
|
512
|
-
const checkboxOpts = computeCheckboxOpts.value;
|
|
513
|
-
const radioOpts = computeRadioOpts.value;
|
|
514
|
-
const treeOpts = computeTreeOpts.value;
|
|
515
|
-
const editOpts = computeEditOpts.value;
|
|
516
|
-
const rowOpts = computeRowOpts.value;
|
|
517
|
-
const columnOpts = computeColumnOpts.value;
|
|
518
|
-
const { transform, seqMode } = treeOpts;
|
|
519
|
-
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
520
|
-
const rows = [];
|
|
521
|
-
const { handleGetRowId } = createHandleGetRowId($xeTable);
|
|
522
|
-
const isDeepRow = treeConfig || isRowGroupStatus;
|
|
523
|
-
tableData.forEach((row, $rowIndex) => {
|
|
524
|
-
const rowid = handleGetRowId(row);
|
|
525
|
-
const rowRest = fullAllDataRowIdData[rowid] || {};
|
|
526
|
-
let rowIndex = $rowIndex;
|
|
527
|
-
let rowLevel = 0;
|
|
528
|
-
let seq = -1;
|
|
529
|
-
let _rowIndex = -1;
|
|
530
|
-
const hasRowGroupAggregate = isRowGroupStatus && row.isAggregate;
|
|
531
|
-
const trOn = {};
|
|
532
|
-
if (rowOpts.isHover || highlightHoverRow) {
|
|
533
|
-
trOn.onMouseover = (evnt) => {
|
|
534
|
-
if (isVMScrollProcess()) {
|
|
535
|
-
return;
|
|
536
|
-
}
|
|
537
|
-
$xeTable.triggerHoverEvent(evnt, { row, rowIndex });
|
|
538
|
-
};
|
|
539
|
-
trOn.onMouseleave = () => {
|
|
540
|
-
if (isVMScrollProcess()) {
|
|
541
|
-
return;
|
|
542
|
-
}
|
|
543
|
-
$xeTable.clearHoverRow();
|
|
544
|
-
};
|
|
545
|
-
}
|
|
546
|
-
if (rowRest) {
|
|
547
|
-
rowIndex = rowRest.index;
|
|
548
|
-
_rowIndex = rowRest._index;
|
|
549
|
-
rowLevel = rowRest.level;
|
|
550
|
-
seq = rowRest.seq;
|
|
551
|
-
if (hasRowGroupAggregate || treeConfig && transform && seqMode === "increasing") {
|
|
552
|
-
seq = rowRest._index + 1;
|
|
553
|
-
} else if (treeConfig && seqMode === "fixed") {
|
|
554
|
-
seq = rowRest._tIndex + 1;
|
|
359
|
+
} else {
|
|
360
|
+
if (treeConfig) {
|
|
361
|
+
tdVNs.push(...renderLine(rowid, cellParams, cellHeight));
|
|
555
362
|
}
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
seq,
|
|
560
|
-
rowid,
|
|
561
|
-
fixed: fixedType,
|
|
562
|
-
type: renderType,
|
|
563
|
-
level: rowLevel,
|
|
564
|
-
row,
|
|
565
|
-
rowIndex,
|
|
566
|
-
$rowIndex,
|
|
567
|
-
_rowIndex
|
|
568
|
-
};
|
|
569
|
-
const isExpandRow = expandColumn && !!rowExpandedFlag && !!rowExpandedMaps[rowid];
|
|
570
|
-
let isExpandTree = false;
|
|
571
|
-
let rowChildren = [];
|
|
572
|
-
let isNewRow = false;
|
|
573
|
-
if (editConfig) {
|
|
574
|
-
isNewRow = $xeTable.isInsertByRow(row);
|
|
575
|
-
}
|
|
576
|
-
if (treeConfig && !scrollYLoad && !transform) {
|
|
577
|
-
rowChildren = row[childrenField];
|
|
578
|
-
isExpandTree = !!treeExpandedFlag && rowChildren && rowChildren.length > 0 && !!treeExpandedMaps[rowid];
|
|
579
|
-
}
|
|
580
|
-
if (rowOpts.drag && !isRowGroupStatus && (!treeConfig || transform)) {
|
|
581
|
-
trOn.onDragstart = $xeTable.handleRowDragDragstartEvent;
|
|
582
|
-
trOn.onDragend = $xeTable.handleRowDragDragendEvent;
|
|
583
|
-
trOn.onDragover = $xeTable.handleRowDragDragoverEvent;
|
|
584
|
-
}
|
|
585
|
-
const trClass = [
|
|
586
|
-
"vxe-body--row",
|
|
587
|
-
isDeepRow ? `row--level-${rowLevel}` : "",
|
|
588
|
-
{
|
|
589
|
-
"row--stripe": stripe && (_rowIndex + 1) % 2 === 0,
|
|
590
|
-
"is--new": isNewRow,
|
|
591
|
-
"is--expand-row": isExpandRow,
|
|
592
|
-
"is--expand-tree": isExpandTree,
|
|
593
|
-
"row--new": isNewRow && (editOpts.showStatus || editOpts.showInsertStatus),
|
|
594
|
-
"row--radio": radioOpts.highlight && $xeTable.eqRow(selectRadioRow, row),
|
|
595
|
-
"row--checked": checkboxOpts.highlight && $xeTable.isCheckedByCheckboxRow(row),
|
|
596
|
-
"row--pending": !!pendingRowFlag && !!pendingRowMaps[rowid],
|
|
597
|
-
"row--group": hasRowGroupAggregate,
|
|
598
|
-
"row--current": currentRow && rowid === getRowid($xeTable, currentRow)
|
|
599
|
-
},
|
|
600
|
-
getPropClass(rowClassName, params)
|
|
601
|
-
];
|
|
602
|
-
const tdVNs = tableColumn.map((column, $columnIndex) => {
|
|
603
|
-
return renderTdColumn(seq, rowid, fixedType, isOptimizeMode, rowLevel, row, rowIndex, $rowIndex, _rowIndex, column, $columnIndex, tableColumn, tableData);
|
|
604
|
-
});
|
|
605
|
-
rows.push(
|
|
606
|
-
h(
|
|
607
|
-
"tr",
|
|
608
|
-
{
|
|
609
|
-
class: trClass,
|
|
610
|
-
rowid,
|
|
611
|
-
style: rowStyle ? XEUtils.isFunction(rowStyle) ? rowStyle(params) : rowStyle : null,
|
|
612
|
-
key: rowKey || rowOpts.useKey || rowOpts.drag || columnOpts.drag || isRowGroupStatus || treeConfig ? rowid : $rowIndex,
|
|
613
|
-
...trOn
|
|
614
|
-
},
|
|
615
|
-
tdVNs
|
|
616
|
-
)
|
|
617
|
-
);
|
|
618
|
-
if (isExpandRow) {
|
|
619
|
-
const expandOpts = computeExpandOpts.value;
|
|
620
|
-
const { height: expandHeight, padding, mode: expandMode } = expandOpts;
|
|
621
|
-
if (expandMode === "fixed") {
|
|
622
|
-
const currExpHeight = rowRest.expandHeight;
|
|
623
|
-
let expHeight = 0;
|
|
624
|
-
if (rowExpandHeightFlag) {
|
|
625
|
-
if (currExpHeight || expandHeight) {
|
|
626
|
-
expHeight = (currExpHeight || expandHeight || 0) + 1;
|
|
627
|
-
}
|
|
628
|
-
}
|
|
629
|
-
rows.push(
|
|
363
|
+
const clVNs = [];
|
|
364
|
+
if (!isVNPreEmptyStatus) {
|
|
365
|
+
clVNs.push(
|
|
630
366
|
h(
|
|
631
|
-
"
|
|
367
|
+
"div",
|
|
632
368
|
{
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
369
|
+
colid,
|
|
370
|
+
rowid,
|
|
371
|
+
class: "vxe-cell--wrapper vxe-body-cell--wrapper"
|
|
636
372
|
},
|
|
637
|
-
|
|
638
|
-
h("td", {
|
|
639
|
-
class: "vxe-body--row-expanded-place-column",
|
|
640
|
-
colspan: tableColumn.length,
|
|
641
|
-
style: {
|
|
642
|
-
height: `${expHeight}px`
|
|
643
|
-
}
|
|
644
|
-
})
|
|
645
|
-
]
|
|
373
|
+
column.renderCell(cellParams)
|
|
646
374
|
)
|
|
647
375
|
);
|
|
648
|
-
}
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
column: expandColumn,
|
|
674
|
-
columnIndex,
|
|
675
|
-
$columnIndex,
|
|
676
|
-
_columnIndex,
|
|
677
|
-
fixed: fixedType,
|
|
678
|
-
source: sourceType,
|
|
679
|
-
type: renderType,
|
|
680
|
-
level: rowLevel,
|
|
681
|
-
row,
|
|
682
|
-
rowid,
|
|
683
|
-
rowIndex,
|
|
684
|
-
$rowIndex,
|
|
685
|
-
_rowIndex,
|
|
686
|
-
isHidden: false,
|
|
687
|
-
isEdit: false,
|
|
688
|
-
visibleData: [],
|
|
689
|
-
data: [],
|
|
690
|
-
items: []
|
|
691
|
-
};
|
|
692
|
-
rows.push(
|
|
376
|
+
}
|
|
377
|
+
tdVNs.push(
|
|
378
|
+
h(
|
|
379
|
+
"div",
|
|
380
|
+
{
|
|
381
|
+
key: "tc",
|
|
382
|
+
class: [
|
|
383
|
+
"vxe-cell",
|
|
384
|
+
{
|
|
385
|
+
"c--title": showTitle,
|
|
386
|
+
"c--tooltip": showTooltip,
|
|
387
|
+
"c--ellipsis": showEllipsis
|
|
388
|
+
}
|
|
389
|
+
],
|
|
390
|
+
style: tcStyle,
|
|
391
|
+
title: showTitle ? $xeTable.getCellLabel(row, column) : null
|
|
392
|
+
},
|
|
393
|
+
clVNs
|
|
394
|
+
)
|
|
395
|
+
);
|
|
396
|
+
if (showValidTip && errorValidItem) {
|
|
397
|
+
const errRule = errorValidItem.rule;
|
|
398
|
+
const validSlot = slots ? slots.valid : null;
|
|
399
|
+
const validParams = { ...cellParams, ...errorValidItem, rule: errorValidItem };
|
|
400
|
+
tdVNs.push(
|
|
693
401
|
h(
|
|
694
|
-
"
|
|
402
|
+
"div",
|
|
695
403
|
{
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
],
|
|
702
|
-
key: `expand_${rowid}`
|
|
404
|
+
key: "tcv",
|
|
405
|
+
class: ["vxe-cell--valid-error-tip", getPropClass(validOpts.className, validParams)],
|
|
406
|
+
style: errRule && errRule.maxWidth ? {
|
|
407
|
+
width: errRule.maxWidth + "px"
|
|
408
|
+
} : null
|
|
703
409
|
},
|
|
704
410
|
[
|
|
705
411
|
h(
|
|
706
|
-
"
|
|
412
|
+
"div",
|
|
707
413
|
{
|
|
708
|
-
class:
|
|
709
|
-
"vxe-body--expanded-column",
|
|
710
|
-
{
|
|
711
|
-
"fixed--hidden": fixedType && !hasFixedColumn,
|
|
712
|
-
"col--ellipsis": hasEllipsis
|
|
713
|
-
}
|
|
714
|
-
],
|
|
715
|
-
colspan: tableColumn.length
|
|
414
|
+
class: `vxe-cell--valid-error-wrapper vxe-cell--valid-error-theme-${validOpts.theme || "normal"}`
|
|
716
415
|
},
|
|
717
416
|
[
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
"vxe-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
style: cellStyle
|
|
728
|
-
},
|
|
729
|
-
[expandColumn.renderData(expandParams)]
|
|
730
|
-
)
|
|
417
|
+
validSlot ? $xeTable.callSlot(validSlot, validParams) : [
|
|
418
|
+
h(
|
|
419
|
+
"span",
|
|
420
|
+
{
|
|
421
|
+
class: "vxe-cell--valid-error-msg"
|
|
422
|
+
},
|
|
423
|
+
errorValidItem.content
|
|
424
|
+
)
|
|
425
|
+
]
|
|
731
426
|
]
|
|
732
427
|
)
|
|
733
428
|
]
|
|
@@ -735,256 +430,564 @@ var body_default = defineVxeComponent({
|
|
|
735
430
|
);
|
|
736
431
|
}
|
|
737
432
|
}
|
|
738
|
-
|
|
739
|
-
|
|
433
|
+
let showAreaRowStatus = false;
|
|
434
|
+
if (hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area && !_columnIndex && selectCellToRow) {
|
|
435
|
+
showAreaRowStatus = true;
|
|
740
436
|
}
|
|
437
|
+
if (!fixedHiddenColumn && showResizable && isAllColumnDrag) {
|
|
438
|
+
tdVNs.push(
|
|
439
|
+
h("div", {
|
|
440
|
+
key: "tcc",
|
|
441
|
+
class: [
|
|
442
|
+
"vxe-cell--col-resizable",
|
|
443
|
+
{
|
|
444
|
+
"is--line": !border || border === "none"
|
|
445
|
+
}
|
|
446
|
+
],
|
|
447
|
+
onMousedown: (evnt) => $xeTable.handleColResizeMousedownEvent(evnt, fixedType, cellParams),
|
|
448
|
+
onDblclick: (evnt) => $xeTable.handleColResizeDblclickEvent(evnt, cellParams)
|
|
449
|
+
})
|
|
450
|
+
);
|
|
451
|
+
}
|
|
452
|
+
if ((rowResize || isAllRowDrag) && rowOpts.resizable) {
|
|
453
|
+
tdVNs.push(
|
|
454
|
+
h("div", {
|
|
455
|
+
key: "tcr",
|
|
456
|
+
class: "vxe-cell--row-resizable",
|
|
457
|
+
onMousedown: (evnt) => $xeTable.handleRowResizeMousedownEvent(evnt, cellParams),
|
|
458
|
+
onDblclick: (evnt) => $xeTable.handleRowResizeDblclickEvent(evnt, cellParams)
|
|
459
|
+
})
|
|
460
|
+
);
|
|
461
|
+
}
|
|
462
|
+
return h(
|
|
463
|
+
"td",
|
|
464
|
+
{
|
|
465
|
+
class: [
|
|
466
|
+
"vxe-table--column vxe-body--column",
|
|
467
|
+
colid,
|
|
468
|
+
cellVerticalAlign ? `col--vertical-${cellVerticalAlign}` : "",
|
|
469
|
+
cellAlign ? `col--${cellAlign}` : "",
|
|
470
|
+
type ? `col--${type}` : "",
|
|
471
|
+
{
|
|
472
|
+
"col--last": isLastColumn,
|
|
473
|
+
"col--tree-node": treeNode,
|
|
474
|
+
"col--edit": isEdit,
|
|
475
|
+
"col--ellipsis": hasEllipsis,
|
|
476
|
+
"col--cs-height": isCsHeight,
|
|
477
|
+
"col--rs-height": isRsHeight,
|
|
478
|
+
"col--to-row": showAreaRowStatus,
|
|
479
|
+
"col--auto-height": isVNAutoHeight,
|
|
480
|
+
"col--max-height": maxHeight,
|
|
481
|
+
"fixed--width": !isAutoCellWidth,
|
|
482
|
+
"fixed--hidden": fixedHiddenColumn,
|
|
483
|
+
"is--pg-top": isCellPaddingTop,
|
|
484
|
+
"is--pg-bottom": isCellPaddingBottom,
|
|
485
|
+
"is--pg-left": isCellPaddingLeft,
|
|
486
|
+
"is--pg-right": isCellPaddingRight,
|
|
487
|
+
"is--progress": fixedHiddenColumn && isAllOverflow || isVNPreEmptyStatus,
|
|
488
|
+
"is--drag-cell": isRowDragCell && (isCrossDrag || isPeerDrag || !rowLevel),
|
|
489
|
+
"is--drag-disabled": isDisabledDrag,
|
|
490
|
+
"col--dirty": isDirty,
|
|
491
|
+
"col--active": editConfig && isEdit && actived.row === row && (actived.column === column || editOpts.mode === "row"),
|
|
492
|
+
"col--valid-error": !!errorValidItem,
|
|
493
|
+
"show--valid-bg": errorValidItem && validOpts.showErrorBackground,
|
|
494
|
+
"col--current": currColFlag && currentCol === column
|
|
495
|
+
},
|
|
496
|
+
getPropClass(compCellClassName, cellParams),
|
|
497
|
+
getPropClass(className, cellParams),
|
|
498
|
+
getPropClass(allCellClassName, cellParams)
|
|
499
|
+
],
|
|
500
|
+
key: columnKey || scrollXLoad || scrollYLoad || columnOpts.useKey || rowOpts.useKey || columnOpts.drag ? colid : $columnIndex,
|
|
501
|
+
...tdAttrs,
|
|
502
|
+
style: Object.assign({}, XEUtils.isFunction(compCellStyle) ? compCellStyle(cellParams) : compCellStyle, XEUtils.isFunction(cellStyle) ? cellStyle(cellParams) : cellStyle),
|
|
503
|
+
...tdOns
|
|
504
|
+
},
|
|
505
|
+
isOptimizeMode && fixedHiddenColumn ? [] : tdVNs
|
|
506
|
+
);
|
|
507
|
+
};
|
|
508
|
+
const renderRows = (fixedType, isOptimizeMode, tableData, tableColumn) => {
|
|
509
|
+
const $xeGrid = $xeTable.xeGrid;
|
|
510
|
+
const $xeGantt = $xeTable.xeGantt;
|
|
511
|
+
const { stripe, rowKey, highlightHoverRow, rowClassName, rowStyle, editConfig, treeConfig } = tableProps;
|
|
512
|
+
const { hasFixedColumn, treeExpandedFlag, scrollYLoad, isAllOverflow, rowExpandedFlag, expandColumn, selectRadioRow, pendingRowFlag, rowExpandHeightFlag, isRowGroupStatus } = tableReactData;
|
|
513
|
+
const { fullAllDataRowIdData, fullColumnIdData, treeExpandedMaps, pendingRowMaps, rowExpandedMaps, currentRow } = tableInternalData;
|
|
514
|
+
const checkboxOpts = computeCheckboxOpts.value;
|
|
515
|
+
const radioOpts = computeRadioOpts.value;
|
|
516
|
+
const treeOpts = computeTreeOpts.value;
|
|
517
|
+
const editOpts = computeEditOpts.value;
|
|
518
|
+
const rowOpts = computeRowOpts.value;
|
|
519
|
+
const columnOpts = computeColumnOpts.value;
|
|
520
|
+
const { transform, seqMode } = treeOpts;
|
|
521
|
+
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
522
|
+
const rows = [];
|
|
523
|
+
const { handleGetRowId } = createHandleGetRowId($xeTable);
|
|
524
|
+
const isDeepRow = treeConfig || isRowGroupStatus;
|
|
525
|
+
tableData.forEach((row, $rowIndex) => {
|
|
526
|
+
const rowid = handleGetRowId(row);
|
|
527
|
+
const rowRest = fullAllDataRowIdData[rowid] || {};
|
|
528
|
+
let rowIndex = $rowIndex;
|
|
529
|
+
let rowLevel = 0;
|
|
530
|
+
let seq = -1;
|
|
531
|
+
let _rowIndex = -1;
|
|
532
|
+
const hasRowGroupAggregate = isRowGroupStatus && row.isAggregate;
|
|
533
|
+
const trOn = {};
|
|
534
|
+
if (rowOpts.isHover || highlightHoverRow) {
|
|
535
|
+
trOn.onMouseover = (evnt) => {
|
|
536
|
+
if (isVMScrollProcess()) {
|
|
537
|
+
return;
|
|
538
|
+
}
|
|
539
|
+
$xeTable.triggerHoverEvent(evnt, { row, rowIndex });
|
|
540
|
+
};
|
|
541
|
+
trOn.onMouseleave = () => {
|
|
542
|
+
if (isVMScrollProcess()) {
|
|
543
|
+
return;
|
|
544
|
+
}
|
|
545
|
+
$xeTable.clearHoverRow();
|
|
546
|
+
};
|
|
547
|
+
}
|
|
548
|
+
if (rowRest) {
|
|
549
|
+
rowIndex = rowRest.index;
|
|
550
|
+
_rowIndex = rowRest._index;
|
|
551
|
+
rowLevel = rowRest.level;
|
|
552
|
+
seq = rowRest.seq;
|
|
553
|
+
if (hasRowGroupAggregate || treeConfig && transform && seqMode === "increasing") {
|
|
554
|
+
seq = rowRest._index + 1;
|
|
555
|
+
} else if (treeConfig && seqMode === "fixed") {
|
|
556
|
+
seq = rowRest._tIndex + 1;
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
const params = {
|
|
560
|
+
$table: $xeTable,
|
|
561
|
+
seq,
|
|
562
|
+
rowid,
|
|
563
|
+
fixed: fixedType,
|
|
564
|
+
type: renderType,
|
|
565
|
+
level: rowLevel,
|
|
566
|
+
row,
|
|
567
|
+
rowIndex,
|
|
568
|
+
$rowIndex,
|
|
569
|
+
_rowIndex
|
|
570
|
+
};
|
|
571
|
+
const isExpandRow = expandColumn && !!rowExpandedFlag && !!rowExpandedMaps[rowid];
|
|
572
|
+
let isExpandTree = false;
|
|
573
|
+
let rowChildren = [];
|
|
574
|
+
let isNewRow = false;
|
|
575
|
+
if (editConfig) {
|
|
576
|
+
isNewRow = $xeTable.isInsertByRow(row);
|
|
577
|
+
}
|
|
578
|
+
if (treeConfig && !scrollYLoad && !transform) {
|
|
579
|
+
rowChildren = row[childrenField];
|
|
580
|
+
isExpandTree = !!treeExpandedFlag && rowChildren && rowChildren.length > 0 && !!treeExpandedMaps[rowid];
|
|
581
|
+
}
|
|
582
|
+
if (rowOpts.drag && !isRowGroupStatus && (!treeConfig || transform)) {
|
|
583
|
+
trOn.onDragstart = $xeTable.handleRowDragDragstartEvent;
|
|
584
|
+
trOn.onDragend = $xeTable.handleRowDragDragendEvent;
|
|
585
|
+
trOn.onDragover = $xeTable.handleRowDragDragoverEvent;
|
|
586
|
+
}
|
|
587
|
+
const trClass = [
|
|
588
|
+
"vxe-body--row",
|
|
589
|
+
isDeepRow ? `row--level-${rowLevel}` : "",
|
|
590
|
+
{
|
|
591
|
+
"row--stripe": stripe && (_rowIndex + 1) % 2 === 0,
|
|
592
|
+
"is--new": isNewRow,
|
|
593
|
+
"is--expand-row": isExpandRow,
|
|
594
|
+
"is--expand-tree": isExpandTree,
|
|
595
|
+
"row--new": isNewRow && (editOpts.showStatus || editOpts.showInsertStatus),
|
|
596
|
+
"row--radio": radioOpts.highlight && $xeTable.eqRow(selectRadioRow, row),
|
|
597
|
+
"row--checked": checkboxOpts.highlight && $xeTable.isCheckedByCheckboxRow(row),
|
|
598
|
+
"row--pending": !!pendingRowFlag && !!pendingRowMaps[rowid],
|
|
599
|
+
"row--group": hasRowGroupAggregate,
|
|
600
|
+
"row--current": currentRow && rowid === getRowid($xeTable, currentRow)
|
|
601
|
+
},
|
|
602
|
+
getPropClass(rowClassName, params)
|
|
603
|
+
];
|
|
604
|
+
const tdVNs = tableColumn.map((column, $columnIndex) => {
|
|
605
|
+
return renderTdColumn(seq, rowid, fixedType, isOptimizeMode, rowLevel, row, rowIndex, $rowIndex, _rowIndex, column, $columnIndex, tableColumn, tableData);
|
|
606
|
+
});
|
|
607
|
+
rows.push(
|
|
608
|
+
h(
|
|
609
|
+
"tr",
|
|
610
|
+
{
|
|
611
|
+
class: trClass,
|
|
612
|
+
rowid,
|
|
613
|
+
style: rowStyle ? XEUtils.isFunction(rowStyle) ? rowStyle(params) : rowStyle : null,
|
|
614
|
+
key: rowKey || rowOpts.useKey || rowOpts.drag || columnOpts.drag || isRowGroupStatus || treeConfig ? rowid : $rowIndex,
|
|
615
|
+
...trOn
|
|
616
|
+
},
|
|
617
|
+
tdVNs
|
|
618
|
+
)
|
|
619
|
+
);
|
|
620
|
+
if (isExpandRow) {
|
|
621
|
+
const expandOpts = computeExpandOpts.value;
|
|
622
|
+
const { height: expandHeight, padding, mode: expandMode } = expandOpts;
|
|
623
|
+
if (expandMode === "fixed") {
|
|
624
|
+
const currExpHeight = rowRest.expandHeight;
|
|
625
|
+
let expHeight = 0;
|
|
626
|
+
if (rowExpandHeightFlag) {
|
|
627
|
+
if (currExpHeight || expandHeight) {
|
|
628
|
+
expHeight = (currExpHeight || expandHeight || 0) + 1;
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
rows.push(
|
|
632
|
+
h(
|
|
633
|
+
"tr",
|
|
634
|
+
{
|
|
635
|
+
class: "vxe-body--row-expanded-place",
|
|
636
|
+
key: `expand_${rowid}`,
|
|
637
|
+
rowid
|
|
638
|
+
},
|
|
639
|
+
[
|
|
640
|
+
h("td", {
|
|
641
|
+
class: "vxe-body--row-expanded-place-column",
|
|
642
|
+
colspan: tableColumn.length,
|
|
643
|
+
style: {
|
|
644
|
+
height: `${expHeight}px`
|
|
645
|
+
}
|
|
646
|
+
})
|
|
647
|
+
]
|
|
648
|
+
)
|
|
649
|
+
);
|
|
650
|
+
} else {
|
|
651
|
+
const cellStyle = {};
|
|
652
|
+
if (expandHeight) {
|
|
653
|
+
cellStyle.height = `${expandHeight}px`;
|
|
654
|
+
}
|
|
655
|
+
if (treeConfig) {
|
|
656
|
+
cellStyle.paddingLeft = `${rowLevel * treeOpts.indent + 30}px`;
|
|
657
|
+
}
|
|
658
|
+
const { showOverflow } = expandColumn || {};
|
|
659
|
+
const colid = expandColumn.id;
|
|
660
|
+
const colRest = fullColumnIdData[colid] || {};
|
|
661
|
+
const hasEllipsis = XEUtils.eqNull(showOverflow) ? isAllOverflow : showOverflow;
|
|
662
|
+
let columnIndex = -1;
|
|
663
|
+
let $columnIndex = -1;
|
|
664
|
+
let _columnIndex = -1;
|
|
665
|
+
if (colRest) {
|
|
666
|
+
columnIndex = colRest.index;
|
|
667
|
+
$columnIndex = colRest.$index;
|
|
668
|
+
_columnIndex = colRest._index;
|
|
669
|
+
}
|
|
670
|
+
const expandParams = {
|
|
671
|
+
$table: $xeTable,
|
|
672
|
+
$grid: $xeGrid,
|
|
673
|
+
$gantt: $xeGantt,
|
|
674
|
+
seq,
|
|
675
|
+
column: expandColumn,
|
|
676
|
+
columnIndex,
|
|
677
|
+
$columnIndex,
|
|
678
|
+
_columnIndex,
|
|
679
|
+
fixed: fixedType,
|
|
680
|
+
source: sourceType,
|
|
681
|
+
type: renderType,
|
|
682
|
+
level: rowLevel,
|
|
683
|
+
row,
|
|
684
|
+
rowid,
|
|
685
|
+
rowIndex,
|
|
686
|
+
$rowIndex,
|
|
687
|
+
_rowIndex,
|
|
688
|
+
isHidden: false,
|
|
689
|
+
isEdit: false,
|
|
690
|
+
visibleData: [],
|
|
691
|
+
data: [],
|
|
692
|
+
items: []
|
|
693
|
+
};
|
|
694
|
+
rows.push(
|
|
695
|
+
h(
|
|
696
|
+
"tr",
|
|
697
|
+
{
|
|
698
|
+
class: [
|
|
699
|
+
"vxe-body--expanded-row",
|
|
700
|
+
{
|
|
701
|
+
"is--padding": padding
|
|
702
|
+
}
|
|
703
|
+
],
|
|
704
|
+
key: `expand_${rowid}`
|
|
705
|
+
},
|
|
706
|
+
[
|
|
707
|
+
h(
|
|
708
|
+
"td",
|
|
709
|
+
{
|
|
710
|
+
class: [
|
|
711
|
+
"vxe-body--expanded-column",
|
|
712
|
+
{
|
|
713
|
+
"fixed--hidden": fixedType && !hasFixedColumn,
|
|
714
|
+
"col--ellipsis": hasEllipsis
|
|
715
|
+
}
|
|
716
|
+
],
|
|
717
|
+
colspan: tableColumn.length
|
|
718
|
+
},
|
|
719
|
+
[
|
|
720
|
+
h(
|
|
721
|
+
"div",
|
|
722
|
+
{
|
|
723
|
+
class: [
|
|
724
|
+
"vxe-body--expanded-cell",
|
|
725
|
+
{
|
|
726
|
+
"is--ellipsis": expandHeight
|
|
727
|
+
}
|
|
728
|
+
],
|
|
729
|
+
style: cellStyle
|
|
730
|
+
},
|
|
731
|
+
[expandColumn.renderData(expandParams)]
|
|
732
|
+
)
|
|
733
|
+
]
|
|
734
|
+
)
|
|
735
|
+
]
|
|
736
|
+
)
|
|
737
|
+
);
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
if (isExpandTree) {
|
|
741
|
+
rows.push(...renderRows(fixedType, isOptimizeMode, rowChildren, tableColumn));
|
|
742
|
+
}
|
|
743
|
+
});
|
|
744
|
+
return rows;
|
|
745
|
+
};
|
|
746
|
+
onMounted(() => {
|
|
747
|
+
nextTick(() => {
|
|
748
|
+
const { fixedType } = props;
|
|
749
|
+
const { elemStore } = tableInternalData;
|
|
750
|
+
const prefix = `${fixedType || "main"}-body-`;
|
|
751
|
+
elemStore[`${prefix}wrapper`] = refElem;
|
|
752
|
+
elemStore[`${prefix}scroll`] = refBodyScroll;
|
|
753
|
+
elemStore[`${prefix}table`] = refBodyTable;
|
|
754
|
+
elemStore[`${prefix}colgroup`] = refBodyColgroup;
|
|
755
|
+
elemStore[`${prefix}list`] = refBodyTBody;
|
|
756
|
+
elemStore[`${prefix}xSpace`] = refBodyXSpace;
|
|
757
|
+
elemStore[`${prefix}ySpace`] = refBodyYSpace;
|
|
758
|
+
elemStore[`${prefix}emptyBlock`] = refBodyEmptyBlock;
|
|
759
|
+
});
|
|
741
760
|
});
|
|
742
|
-
|
|
743
|
-
};
|
|
744
|
-
onMounted(() => {
|
|
745
|
-
nextTick(() => {
|
|
761
|
+
onUnmounted(() => {
|
|
746
762
|
const { fixedType } = props;
|
|
747
763
|
const { elemStore } = tableInternalData;
|
|
748
764
|
const prefix = `${fixedType || "main"}-body-`;
|
|
749
|
-
elemStore[`${prefix}wrapper`] =
|
|
750
|
-
elemStore[`${prefix}scroll`] =
|
|
751
|
-
elemStore[`${prefix}table`] =
|
|
752
|
-
elemStore[`${prefix}colgroup`] =
|
|
753
|
-
elemStore[`${prefix}list`] =
|
|
754
|
-
elemStore[`${prefix}xSpace`] =
|
|
755
|
-
elemStore[`${prefix}ySpace`] =
|
|
756
|
-
elemStore[`${prefix}emptyBlock`] =
|
|
765
|
+
elemStore[`${prefix}wrapper`] = null;
|
|
766
|
+
elemStore[`${prefix}scroll`] = null;
|
|
767
|
+
elemStore[`${prefix}table`] = null;
|
|
768
|
+
elemStore[`${prefix}colgroup`] = null;
|
|
769
|
+
elemStore[`${prefix}list`] = null;
|
|
770
|
+
elemStore[`${prefix}xSpace`] = null;
|
|
771
|
+
elemStore[`${prefix}ySpace`] = null;
|
|
772
|
+
elemStore[`${prefix}emptyBlock`] = null;
|
|
757
773
|
});
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
const $xeGrid = $xeTable.xeGrid;
|
|
775
|
-
const $xeGantt = $xeTable.xeGantt;
|
|
776
|
-
const { fixedColumn, fixedType, tableColumn } = props;
|
|
777
|
-
const { mouseConfig } = tableProps;
|
|
778
|
-
const { isGroup, tableData, isColLoading, overflowX, scrollXLoad, scrollYLoad, dragRow, dragCol } = tableReactData;
|
|
779
|
-
const { visibleColumn, fullAllDataRowIdData, fullColumnIdData } = tableInternalData;
|
|
780
|
-
const emptyOpts = computeEmptyOpts.value;
|
|
781
|
-
const mouseOpts = computeMouseOpts.value;
|
|
782
|
-
const isBodyRenderOptimize = computeIsBodyRenderOptimize.value;
|
|
783
|
-
let renderDataList = tableData;
|
|
784
|
-
let renderColumnList = tableColumn;
|
|
785
|
-
const isOptimizeMode = isBodyRenderOptimize;
|
|
786
|
-
if (!isColLoading && (fixedType || !overflowX)) {
|
|
787
|
-
renderColumnList = visibleColumn;
|
|
788
|
-
}
|
|
789
|
-
if (fixedType) {
|
|
790
|
-
if (isOptimizeMode) {
|
|
791
|
-
renderColumnList = fixedColumn || [];
|
|
774
|
+
const renderVN = () => {
|
|
775
|
+
const { slots } = tableContext;
|
|
776
|
+
const $xeGrid = $xeTable.xeGrid;
|
|
777
|
+
const $xeGantt = $xeTable.xeGantt;
|
|
778
|
+
const { fixedColumn, fixedType, tableColumn } = props;
|
|
779
|
+
const { mouseConfig } = tableProps;
|
|
780
|
+
const { isGroup, tableData, isColLoading, overflowX, scrollXLoad, scrollYLoad, dragRow, dragCol } = tableReactData;
|
|
781
|
+
const { visibleColumn, fullAllDataRowIdData, fullColumnIdData } = tableInternalData;
|
|
782
|
+
const emptyOpts = computeEmptyOpts.value;
|
|
783
|
+
const mouseOpts = computeMouseOpts.value;
|
|
784
|
+
const isBodyRenderOptimize = computeIsBodyRenderOptimize.value;
|
|
785
|
+
let renderDataList = tableData;
|
|
786
|
+
let renderColumnList = tableColumn;
|
|
787
|
+
const isOptimizeMode = isBodyRenderOptimize;
|
|
788
|
+
if (!isColLoading && (fixedType || !overflowX)) {
|
|
789
|
+
renderColumnList = visibleColumn;
|
|
792
790
|
}
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
const
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
const
|
|
805
|
-
const
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
791
|
+
if (fixedType) {
|
|
792
|
+
if (isOptimizeMode) {
|
|
793
|
+
renderColumnList = fixedColumn || [];
|
|
794
|
+
}
|
|
795
|
+
}
|
|
796
|
+
if (scrollYLoad && dragRow) {
|
|
797
|
+
if (renderDataList.length > 2) {
|
|
798
|
+
const dRowRest = fullAllDataRowIdData[getRowid($xeTable, dragRow)];
|
|
799
|
+
if (dRowRest) {
|
|
800
|
+
const drIndex = dRowRest._index;
|
|
801
|
+
const firstRow = renderDataList[0];
|
|
802
|
+
const lastRow = renderDataList[renderDataList.length - 1];
|
|
803
|
+
const firstRowRest = fullAllDataRowIdData[getRowid($xeTable, firstRow)];
|
|
804
|
+
const lastRowRest = fullAllDataRowIdData[getRowid($xeTable, lastRow)];
|
|
805
|
+
if (firstRowRest && lastRowRest) {
|
|
806
|
+
const frIndex = firstRowRest._index;
|
|
807
|
+
const lrIndex = lastRowRest._index;
|
|
808
|
+
if (drIndex < frIndex) {
|
|
809
|
+
renderDataList = [dragRow].concat(renderDataList);
|
|
810
|
+
} else if (drIndex > lrIndex) {
|
|
811
|
+
renderDataList = renderDataList.concat([dragRow]);
|
|
812
|
+
}
|
|
810
813
|
}
|
|
811
814
|
}
|
|
812
815
|
}
|
|
813
816
|
}
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
817
|
+
if (!fixedType && !isGroup) {
|
|
818
|
+
if (scrollXLoad && dragCol) {
|
|
819
|
+
if (renderColumnList.length > 2) {
|
|
820
|
+
const dCowRest = fullColumnIdData[dragCol.id];
|
|
821
|
+
if (dCowRest) {
|
|
822
|
+
const dcIndex = dCowRest._index;
|
|
823
|
+
const firstCol = renderColumnList[0];
|
|
824
|
+
const lastCol = renderColumnList[renderColumnList.length - 1];
|
|
825
|
+
const firstColRest = fullColumnIdData[firstCol.id];
|
|
826
|
+
const lastColRest = fullColumnIdData[lastCol.id];
|
|
827
|
+
if (firstColRest && lastColRest) {
|
|
828
|
+
const fcIndex = firstColRest._index;
|
|
829
|
+
const lcIndex = lastColRest._index;
|
|
830
|
+
if (dcIndex < fcIndex) {
|
|
831
|
+
renderColumnList = [dragCol].concat(renderColumnList);
|
|
832
|
+
} else if (dcIndex > lcIndex) {
|
|
833
|
+
renderColumnList = renderColumnList.concat([dragCol]);
|
|
834
|
+
}
|
|
832
835
|
}
|
|
833
836
|
}
|
|
834
837
|
}
|
|
835
838
|
}
|
|
836
839
|
}
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
emptyContent = $xeTable.callSlot(emptySlot, emptyParams);
|
|
843
|
-
} else {
|
|
844
|
-
const rendererOpts = computeRendererOpts.value;
|
|
845
|
-
const compConf = emptyOpts.name ? rendererOpts[emptyOpts.name] || renderer.get(emptyOpts.name) : null;
|
|
846
|
-
const rtEmptyView = compConf ? compConf.renderTableEmpty || compConf.renderTableEmptyView || compConf.renderEmpty : null;
|
|
847
|
-
if (rtEmptyView) {
|
|
848
|
-
emptyContent = getSlotVNs(rtEmptyView(emptyOpts, emptyParams));
|
|
840
|
+
let emptyContent;
|
|
841
|
+
const emptySlot = slots ? slots.empty : null;
|
|
842
|
+
const emptyParams = { $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt };
|
|
843
|
+
if (emptySlot) {
|
|
844
|
+
emptyContent = $xeTable.callSlot(emptySlot, emptyParams);
|
|
849
845
|
} else {
|
|
850
|
-
|
|
846
|
+
const rendererOpts = computeRendererOpts.value;
|
|
847
|
+
const compConf = emptyOpts.name ? rendererOpts[emptyOpts.name] || renderer.get(emptyOpts.name) : null;
|
|
848
|
+
const rtEmptyView = compConf ? compConf.renderTableEmpty || compConf.renderTableEmptyView || compConf.renderEmpty : null;
|
|
849
|
+
if (rtEmptyView) {
|
|
850
|
+
emptyContent = getSlotVNs(rtEmptyView(emptyOpts, emptyParams));
|
|
851
|
+
} else {
|
|
852
|
+
emptyContent = tableProps.emptyText || getI18n("vxe.table.emptyText");
|
|
853
|
+
}
|
|
851
854
|
}
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
}
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
width: `${column.renderWidth}px`
|
|
905
|
-
}
|
|
906
|
-
});
|
|
907
|
-
})
|
|
908
|
-
),
|
|
909
|
-
/**
|
|
910
|
-
* 内容
|
|
911
|
-
*/
|
|
912
|
-
h(
|
|
913
|
-
"tbody",
|
|
914
|
-
{
|
|
915
|
-
ref: refBodyTBody
|
|
916
|
-
},
|
|
917
|
-
renderRows(fixedType, isOptimizeMode, renderDataList, renderColumnList)
|
|
918
|
-
)
|
|
919
|
-
]
|
|
920
|
-
),
|
|
921
|
-
h("div", {
|
|
922
|
-
class: "vxe-table--checkbox-range"
|
|
923
|
-
}),
|
|
924
|
-
hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area ? h(
|
|
925
|
-
"div",
|
|
926
|
-
{
|
|
927
|
-
class: "vxe-table--cell-area",
|
|
928
|
-
xid: xID
|
|
929
|
-
},
|
|
930
|
-
[
|
|
931
|
-
h(
|
|
932
|
-
"span",
|
|
933
|
-
{
|
|
934
|
-
class: "vxe-table--cell-main-area"
|
|
935
|
-
},
|
|
936
|
-
mouseOpts.extension ? [
|
|
937
|
-
h("span", {
|
|
938
|
-
class: "vxe-table--cell-main-area-btn",
|
|
939
|
-
onMousedown(evnt) {
|
|
940
|
-
if ($xeTable.triggerCellAreaExtendMousedownEvent) {
|
|
941
|
-
$xeTable.triggerCellAreaExtendMousedownEvent(evnt, { $table: $xeTable, fixed: fixedType, type: renderType });
|
|
855
|
+
return h(
|
|
856
|
+
"div",
|
|
857
|
+
{
|
|
858
|
+
ref: refElem,
|
|
859
|
+
class: ["vxe-table--body-wrapper", fixedType ? `fixed-${fixedType}--wrapper` : "body--wrapper"],
|
|
860
|
+
xid: xID
|
|
861
|
+
},
|
|
862
|
+
[
|
|
863
|
+
h(
|
|
864
|
+
"div",
|
|
865
|
+
{
|
|
866
|
+
ref: refBodyScroll,
|
|
867
|
+
class: "vxe-table--body-inner-wrapper",
|
|
868
|
+
onScroll(evnt) {
|
|
869
|
+
$xeTable.triggerBodyScrollEvent(evnt, fixedType);
|
|
870
|
+
}
|
|
871
|
+
},
|
|
872
|
+
[
|
|
873
|
+
fixedType ? renderEmptyElement($xeTable) : h("div", {
|
|
874
|
+
ref: refBodyXSpace,
|
|
875
|
+
class: "vxe-body--x-space"
|
|
876
|
+
}),
|
|
877
|
+
h("div", {
|
|
878
|
+
ref: refBodyYSpace,
|
|
879
|
+
class: "vxe-body--y-space"
|
|
880
|
+
}),
|
|
881
|
+
h(
|
|
882
|
+
"table",
|
|
883
|
+
{
|
|
884
|
+
ref: refBodyTable,
|
|
885
|
+
class: "vxe-table--body",
|
|
886
|
+
xid: xID,
|
|
887
|
+
cellspacing: 0,
|
|
888
|
+
cellpadding: 0,
|
|
889
|
+
border: 0,
|
|
890
|
+
xvm: isOptimizeMode ? "1" : null
|
|
891
|
+
},
|
|
892
|
+
[
|
|
893
|
+
/**
|
|
894
|
+
* 列宽
|
|
895
|
+
*/
|
|
896
|
+
h(
|
|
897
|
+
"colgroup",
|
|
898
|
+
{
|
|
899
|
+
ref: refBodyColgroup
|
|
900
|
+
},
|
|
901
|
+
renderColumnList.map((column, $columnIndex) => {
|
|
902
|
+
return h("col", {
|
|
903
|
+
name: column.id,
|
|
904
|
+
key: $columnIndex,
|
|
905
|
+
style: {
|
|
906
|
+
width: `${column.renderWidth}px`
|
|
942
907
|
}
|
|
943
|
-
}
|
|
908
|
+
});
|
|
944
909
|
})
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
910
|
+
),
|
|
911
|
+
/**
|
|
912
|
+
* 内容
|
|
913
|
+
*/
|
|
914
|
+
h(
|
|
915
|
+
"tbody",
|
|
916
|
+
{
|
|
917
|
+
ref: refBodyTBody
|
|
918
|
+
},
|
|
919
|
+
renderRows(fixedType, isOptimizeMode, renderDataList, renderColumnList)
|
|
920
|
+
)
|
|
921
|
+
]
|
|
922
|
+
),
|
|
923
|
+
h("div", {
|
|
924
|
+
class: "vxe-table--checkbox-range"
|
|
925
|
+
}),
|
|
926
|
+
hasEnableConf(mouseConfig, mouseOpts) && mouseOpts.area ? h(
|
|
927
|
+
"div",
|
|
928
|
+
{
|
|
929
|
+
class: "vxe-table--cell-area",
|
|
930
|
+
xid: xID
|
|
931
|
+
},
|
|
932
|
+
[
|
|
933
|
+
h(
|
|
934
|
+
"span",
|
|
935
|
+
{
|
|
936
|
+
class: "vxe-table--cell-main-area"
|
|
937
|
+
},
|
|
938
|
+
mouseOpts.extension ? [
|
|
939
|
+
h("span", {
|
|
940
|
+
class: "vxe-table--cell-main-area-btn",
|
|
941
|
+
onMousedown(evnt) {
|
|
942
|
+
if ($xeTable.triggerCellAreaExtendMousedownEvent) {
|
|
943
|
+
$xeTable.triggerCellAreaExtendMousedownEvent(evnt, { $table: $xeTable, fixed: fixedType, type: renderType });
|
|
944
|
+
}
|
|
945
|
+
}
|
|
946
|
+
})
|
|
947
|
+
] : []
|
|
948
|
+
),
|
|
949
|
+
h("span", {
|
|
950
|
+
class: "vxe-table--cell-clip-area"
|
|
951
|
+
}),
|
|
952
|
+
h("span", {
|
|
953
|
+
class: "vxe-table--cell-extend-area"
|
|
954
|
+
}),
|
|
955
|
+
h("span", {
|
|
956
|
+
class: "vxe-table--cell-multi-area"
|
|
957
|
+
}),
|
|
958
|
+
h("span", {
|
|
959
|
+
class: "vxe-table--cell-active-area"
|
|
960
|
+
}),
|
|
961
|
+
h("span", {
|
|
962
|
+
class: "vxe-table--cell-row-status-area"
|
|
963
|
+
})
|
|
964
|
+
]
|
|
965
|
+
) : renderEmptyElement($xeTable),
|
|
966
|
+
!fixedType ? h(
|
|
967
|
+
"div",
|
|
968
|
+
{
|
|
969
|
+
class: "vxe-table--empty-block",
|
|
970
|
+
ref: refBodyEmptyBlock
|
|
971
|
+
},
|
|
972
|
+
[
|
|
973
|
+
h(
|
|
974
|
+
"div",
|
|
975
|
+
{
|
|
976
|
+
class: "vxe-table--empty-content"
|
|
977
|
+
},
|
|
978
|
+
emptyContent
|
|
979
|
+
)
|
|
980
|
+
]
|
|
981
|
+
) : renderEmptyElement($xeTable)
|
|
982
|
+
]
|
|
983
|
+
)
|
|
984
|
+
]
|
|
985
|
+
);
|
|
986
|
+
};
|
|
987
|
+
return renderVN;
|
|
988
|
+
}
|
|
989
|
+
})
|
|
990
|
+
);
|
|
988
991
|
export {
|
|
989
992
|
body_default as default
|
|
990
993
|
};
|