vxe-table 4.15.4 → 4.15.6
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/README.en.md +2 -6
- package/README.ja-JP.md +2 -6
- package/README.md +8 -10
- package/README.zh-TW.md +2 -6
- package/es/grid/src/emits.js +16 -0
- package/es/grid/src/grid.js +77 -62
- package/es/grid/src/props.js +7 -0
- package/es/style.css +1 -1
- package/es/table/index.js +0 -8
- package/es/table/module/custom/hook.js +3 -0
- package/es/table/module/edit/hook.js +3 -0
- package/es/table/module/export/hook.js +6 -1
- package/es/table/module/filter/hook.js +3 -0
- package/es/table/module/menu/hook.js +3 -0
- package/es/table/module/validator/hook.js +3 -0
- package/es/table/src/emits.js +1 -1
- package/es/table/src/header.js +2 -2
- package/es/table/src/props.js +1 -1
- package/es/table/src/table.js +161 -63
- package/es/table/src/util.js +1 -14
- package/es/toolbar/src/toolbar.js +2 -2
- package/es/ui/index.js +13 -4
- package/es/ui/src/log.js +1 -1
- package/lib/grid/src/emits.js +8 -0
- package/lib/grid/src/emits.min.js +1 -0
- package/lib/grid/src/grid.js +78 -54
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/grid/src/props.js +24 -0
- package/lib/grid/src/props.min.js +1 -0
- package/lib/index.umd.js +12073 -12008
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/index.js +0 -8
- package/lib/table/index.min.js +1 -1
- package/lib/table/module/custom/hook.js +3 -0
- package/lib/table/module/custom/hook.min.js +1 -1
- package/lib/table/module/edit/hook.js +3 -0
- package/lib/table/module/edit/hook.min.js +1 -1
- package/lib/table/module/export/hook.js +8 -1
- package/lib/table/module/export/hook.min.js +1 -1
- package/lib/table/module/filter/hook.js +3 -0
- package/lib/table/module/filter/hook.min.js +1 -1
- package/lib/table/module/menu/hook.js +3 -0
- package/lib/table/module/menu/hook.min.js +1 -1
- package/lib/table/module/validator/hook.js +3 -0
- package/lib/table/module/validator/hook.min.js +1 -1
- package/lib/table/src/emits.js +2 -2
- package/lib/table/src/emits.min.js +1 -1
- package/lib/table/src/header.js +2 -2
- package/lib/table/src/props.js +2 -2
- package/lib/table/src/props.min.js +1 -1
- package/lib/table/src/table.js +33 -26
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +1 -14
- package/lib/table/src/util.min.js +1 -1
- package/lib/toolbar/src/toolbar.js +2 -0
- package/lib/toolbar/src/toolbar.min.js +1 -1
- package/lib/ui/index.js +12 -3
- 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 +1 -1
- package/packages/grid/src/emits.ts +19 -0
- package/packages/grid/src/grid.ts +89 -85
- package/packages/grid/src/props.ts +23 -0
- package/packages/table/index.ts +0 -8
- package/packages/table/module/custom/hook.ts +3 -0
- package/packages/table/module/edit/hook.ts +3 -0
- package/packages/table/module/export/hook.ts +8 -3
- package/packages/table/module/filter/hook.ts +3 -0
- package/packages/table/module/menu/hook.ts +3 -0
- package/packages/table/module/validator/hook.ts +3 -0
- package/packages/table/src/emits.ts +2 -2
- package/packages/table/src/header.ts +5 -5
- package/packages/table/src/props.ts +1 -1
- package/packages/table/src/table.ts +167 -66
- package/packages/table/src/util.ts +1 -14
- package/packages/toolbar/src/toolbar.ts +2 -2
- package/packages/ui/index.ts +12 -2
- package/packages/ui/src/dom.ts +1 -1
- package/styles/cssvar.scss +0 -2
- /package/es/{iconfont.1754457119712.ttf → iconfont.1754905357789.ttf} +0 -0
- /package/es/{iconfont.1754457119712.woff → iconfont.1754905357789.woff} +0 -0
- /package/es/{iconfont.1754457119712.woff2 → iconfont.1754905357789.woff2} +0 -0
- /package/lib/{iconfont.1754457119712.ttf → iconfont.1754905357789.ttf} +0 -0
- /package/lib/{iconfont.1754457119712.woff → iconfont.1754905357789.woff} +0 -0
- /package/lib/{iconfont.1754457119712.woff2 → iconfont.1754905357789.woff2} +0 -0
|
@@ -256,6 +256,7 @@ hooks.add('tableExportModule', {
|
|
|
256
256
|
const { props, reactData, internalData } = $xeTable;
|
|
257
257
|
const { computeTreeOpts, computePrintOpts, computeExportOpts, computeImportOpts, computeCustomOpts, computeSeqOpts, computeRadioOpts, computeCheckboxOpts, computeColumnOpts } = $xeTable.getComputeMaps();
|
|
258
258
|
const $xeGrid = inject('$xeGrid', null);
|
|
259
|
+
const $xeGantt = inject('$xeGantt', null);
|
|
259
260
|
const hasTreeChildren = (row) => {
|
|
260
261
|
const treeOpts = computeTreeOpts.value;
|
|
261
262
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
@@ -1297,6 +1298,7 @@ hooks.add('tableExportModule', {
|
|
|
1297
1298
|
const params = {
|
|
1298
1299
|
$table: $xeTable,
|
|
1299
1300
|
$grid: $xeGrid,
|
|
1301
|
+
$gantt: $xeGantt,
|
|
1300
1302
|
sort: sortData.length ? sortData[0] : {},
|
|
1301
1303
|
sorts: sortData,
|
|
1302
1304
|
filters: gridReactData.filterData,
|
|
@@ -1306,7 +1308,7 @@ hooks.add('tableExportModule', {
|
|
|
1306
1308
|
return Promise.resolve((beforeQueryAll || ajaxMethods)(params))
|
|
1307
1309
|
.then(rest => {
|
|
1308
1310
|
const listProp = resConfigs.list;
|
|
1309
|
-
handleOptions.data = (listProp ? (XEUtils.isFunction(listProp) ? listProp({ data: rest, $grid: $xeGrid }) : XEUtils.get(rest, listProp)) : rest) || [];
|
|
1311
|
+
handleOptions.data = (listProp ? (XEUtils.isFunction(listProp) ? listProp({ data: rest, $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt }) : XEUtils.get(rest, listProp)) : rest) || [];
|
|
1310
1312
|
if (afterQueryAll) {
|
|
1311
1313
|
afterQueryAll(params);
|
|
1312
1314
|
}
|
|
@@ -1550,5 +1552,8 @@ hooks.add('tableExportModule', {
|
|
|
1550
1552
|
},
|
|
1551
1553
|
setupGrid($xeGrid) {
|
|
1552
1554
|
return $xeGrid.extendTableMethods(tableExportMethodKeys);
|
|
1555
|
+
},
|
|
1556
|
+
setupGantt($xeGantt) {
|
|
1557
|
+
return $xeGantt.extendTableMethods(tableExportMethodKeys);
|
|
1553
1558
|
}
|
|
1554
1559
|
});
|
package/es/table/src/emits.js
CHANGED
package/es/table/src/header.js
CHANGED
package/es/table/src/props.js
CHANGED
package/es/table/src/table.js
CHANGED
|
@@ -12,13 +12,21 @@ import Cell from './cell';
|
|
|
12
12
|
import TableBodyComponent from './body';
|
|
13
13
|
import TableHeaderComponent from './header';
|
|
14
14
|
import TableFooterComponent from './footer';
|
|
15
|
-
import tableProps from './props';
|
|
16
|
-
import tableEmits from './emits';
|
|
15
|
+
import { tableProps } from './props';
|
|
16
|
+
import { tableEmits } from './emits';
|
|
17
17
|
import TableCustomPanelComponent from '../module/custom/panel';
|
|
18
18
|
import TableFilterPanelComponent from '../module/filter/panel';
|
|
19
19
|
import TableImportPanelComponent from '../module/export/import-panel';
|
|
20
20
|
import TableExportPanelComponent from '../module/export/export-panel';
|
|
21
21
|
import TableMenuPanelComponent from '../module/menu/panel';
|
|
22
|
+
import '../module/filter/hook';
|
|
23
|
+
import '../module/menu/hook';
|
|
24
|
+
import '../module/edit/hook';
|
|
25
|
+
import '../module/export/hook';
|
|
26
|
+
import '../module/keyboard/hook';
|
|
27
|
+
import '../module/validator/hook';
|
|
28
|
+
import '../module/custom/hook';
|
|
29
|
+
import '../render';
|
|
22
30
|
const { getConfig, getIcon, getI18n, renderer, formats, createEvent, globalResize, interceptor, hooks, globalEvents, GLOBAL_EVENT_KEYS, useFns, renderEmptyElement } = VxeUI;
|
|
23
31
|
const supportMaxRow = 5e6;
|
|
24
32
|
const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
@@ -62,6 +70,12 @@ export default defineVxeComponent({
|
|
|
62
70
|
lastScrollTime: 0,
|
|
63
71
|
// 行高
|
|
64
72
|
rowHeight: 0,
|
|
73
|
+
// 表头高度
|
|
74
|
+
tHeaderHeight: 0,
|
|
75
|
+
// 表体高度
|
|
76
|
+
tBodyHeight: 0,
|
|
77
|
+
// 表尾高度
|
|
78
|
+
tFooterHeight: 0,
|
|
65
79
|
// 表格父容器的高度
|
|
66
80
|
parentHeight: 0,
|
|
67
81
|
// 是否使用分组表头
|
|
@@ -319,6 +333,7 @@ export default defineVxeComponent({
|
|
|
319
333
|
const refScrollXSpaceElem = ref();
|
|
320
334
|
const refScrollYSpaceElem = ref();
|
|
321
335
|
const $xeGrid = inject('$xeGrid', null);
|
|
336
|
+
const $xeGantt = inject('$xeGantt', null);
|
|
322
337
|
let $xeToolbar;
|
|
323
338
|
const computeTableId = computed(() => {
|
|
324
339
|
const { id } = props;
|
|
@@ -797,6 +812,8 @@ export default defineVxeComponent({
|
|
|
797
812
|
getRefMaps: () => refMaps,
|
|
798
813
|
getComputeMaps: () => computeMaps,
|
|
799
814
|
xeGrid: $xeGrid,
|
|
815
|
+
xeGantt: $xeGantt,
|
|
816
|
+
// 已废弃
|
|
800
817
|
xegrid: $xeGrid
|
|
801
818
|
};
|
|
802
819
|
const eqCellValue = (row1, row2, field) => {
|
|
@@ -1750,12 +1767,17 @@ export default defineVxeComponent({
|
|
|
1750
1767
|
const calcCellAutoHeight = (rowRest, wrapperEl) => {
|
|
1751
1768
|
const cellElemList = wrapperEl.querySelectorAll(`.vxe-cell--wrapper[rowid="${rowRest.rowid}"]`);
|
|
1752
1769
|
let colHeight = rowRest.height;
|
|
1770
|
+
let firstCellStyle = null;
|
|
1771
|
+
let topBottomPadding = 0;
|
|
1753
1772
|
for (let i = 0; i < cellElemList.length; i++) {
|
|
1754
|
-
const
|
|
1755
|
-
const
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1773
|
+
const wrapperElem = cellElemList[i];
|
|
1774
|
+
const cellElem = wrapperElem.parentElement;
|
|
1775
|
+
if (!firstCellStyle) {
|
|
1776
|
+
firstCellStyle = getComputedStyle(cellElem);
|
|
1777
|
+
topBottomPadding = firstCellStyle ? Math.ceil(XEUtils.toNumber(firstCellStyle.paddingTop) + XEUtils.toNumber(firstCellStyle.paddingBottom)) : 0;
|
|
1778
|
+
}
|
|
1779
|
+
const cellHeight = wrapperElem ? wrapperElem.clientHeight : 0;
|
|
1780
|
+
colHeight = Math.max(colHeight, Math.ceil(cellHeight + topBottomPadding));
|
|
1759
1781
|
}
|
|
1760
1782
|
return colHeight;
|
|
1761
1783
|
};
|
|
@@ -2135,14 +2157,15 @@ export default defineVxeComponent({
|
|
|
2135
2157
|
};
|
|
2136
2158
|
const updateStyle = () => {
|
|
2137
2159
|
const { showHeaderOverflow: allColumnHeaderOverflow, showFooterOverflow: allColumnFooterOverflow, mouseConfig, spanMethod, footerSpanMethod } = props;
|
|
2138
|
-
const { isGroup, currentRow, tableColumn, scrollXLoad, scrollYLoad, overflowX, scrollbarWidth, overflowY, scrollbarHeight, scrollXWidth, columnStore, editStore, isAllOverflow, expandColumn, isColLoading } = reactData;
|
|
2139
|
-
const { visibleColumn, tableHeight,
|
|
2160
|
+
const { isGroup, currentRow, tableColumn, scrollXLoad, scrollYLoad, overflowX, scrollbarWidth, overflowY, scrollbarHeight, scrollXWidth, columnStore, editStore, isAllOverflow, expandColumn, isColLoading, tHeaderHeight, tFooterHeight } = reactData;
|
|
2161
|
+
const { visibleColumn, tableHeight, elemStore, customHeight, customMinHeight, customMaxHeight } = internalData;
|
|
2162
|
+
const $xeGanttView = internalData.xeGanttView;
|
|
2140
2163
|
const el = refElem.value;
|
|
2141
|
-
if (!el) {
|
|
2164
|
+
if (!el || !el.clientHeight) {
|
|
2142
2165
|
return;
|
|
2143
2166
|
}
|
|
2144
2167
|
const containerList = ['main', 'left', 'right'];
|
|
2145
|
-
|
|
2168
|
+
let osbWidth = overflowY ? scrollbarWidth : 0;
|
|
2146
2169
|
const osbHeight = overflowX ? scrollbarHeight : 0;
|
|
2147
2170
|
const emptyPlaceholderElem = refEmptyPlaceholder.value;
|
|
2148
2171
|
const mouseOpts = computeMouseOpts.value;
|
|
@@ -2150,36 +2173,45 @@ export default defineVxeComponent({
|
|
|
2150
2173
|
const bodyWrapperElem = getRefElem(elemStore['main-body-wrapper']);
|
|
2151
2174
|
const bodyTableElem = getRefElem(elemStore['main-body-table']);
|
|
2152
2175
|
if (emptyPlaceholderElem) {
|
|
2153
|
-
emptyPlaceholderElem.style.top = `${
|
|
2176
|
+
emptyPlaceholderElem.style.top = `${tHeaderHeight}px`;
|
|
2154
2177
|
emptyPlaceholderElem.style.height = bodyWrapperElem ? `${bodyWrapperElem.offsetHeight - osbHeight}px` : '';
|
|
2155
2178
|
}
|
|
2156
|
-
|
|
2179
|
+
const scrollbarXToTop = computeScrollbarXToTop.value;
|
|
2180
|
+
const scrollbarYToLeft = computeScrollbarYToLeft.value;
|
|
2181
|
+
const xScrollbarVisible = overflowX ? 'visible' : 'hidden';
|
|
2182
|
+
let yScrollbarVisible = overflowY ? 'visible' : 'hidden';
|
|
2183
|
+
if ($xeGanttView) {
|
|
2184
|
+
if (!scrollbarYToLeft) {
|
|
2185
|
+
osbWidth = 0;
|
|
2186
|
+
yScrollbarVisible = 'hidden';
|
|
2187
|
+
}
|
|
2188
|
+
}
|
|
2189
|
+
let tbHeight = 0;
|
|
2157
2190
|
let bodyMaxHeight = 0;
|
|
2158
|
-
const bodyMinHeight = customMinHeight -
|
|
2191
|
+
const bodyMinHeight = customMinHeight - tHeaderHeight - tFooterHeight - osbHeight;
|
|
2159
2192
|
if (customMaxHeight) {
|
|
2160
|
-
bodyMaxHeight = Math.max(bodyMinHeight, customMaxHeight -
|
|
2193
|
+
bodyMaxHeight = Math.max(bodyMinHeight, customMaxHeight - tHeaderHeight - tFooterHeight - osbHeight);
|
|
2161
2194
|
}
|
|
2162
2195
|
if (customHeight) {
|
|
2163
|
-
|
|
2196
|
+
tbHeight = customHeight - tHeaderHeight - tFooterHeight - osbHeight;
|
|
2164
2197
|
}
|
|
2165
|
-
if (!
|
|
2198
|
+
if (!tbHeight) {
|
|
2166
2199
|
if (bodyTableElem) {
|
|
2167
|
-
|
|
2200
|
+
tbHeight = bodyTableElem.clientHeight;
|
|
2168
2201
|
}
|
|
2169
2202
|
}
|
|
2170
|
-
if (
|
|
2203
|
+
if (tbHeight) {
|
|
2171
2204
|
if (bodyMaxHeight) {
|
|
2172
|
-
|
|
2205
|
+
tbHeight = Math.min(bodyMaxHeight, tbHeight);
|
|
2173
2206
|
}
|
|
2174
|
-
|
|
2207
|
+
tbHeight = Math.max(bodyMinHeight, tbHeight);
|
|
2175
2208
|
}
|
|
2176
|
-
const scrollbarXToTop = computeScrollbarXToTop.value;
|
|
2177
2209
|
const xLeftCornerEl = refScrollXLeftCornerElem.value;
|
|
2178
2210
|
const xRightCornerEl = refScrollXRightCornerElem.value;
|
|
2179
2211
|
const scrollXVirtualEl = refScrollXVirtualElem.value;
|
|
2180
2212
|
if (scrollXVirtualEl) {
|
|
2181
2213
|
scrollXVirtualEl.style.height = `${osbHeight}px`;
|
|
2182
|
-
scrollXVirtualEl.style.visibility =
|
|
2214
|
+
scrollXVirtualEl.style.visibility = xScrollbarVisible;
|
|
2183
2215
|
}
|
|
2184
2216
|
const xWrapperEl = refScrollXWrapperElem.value;
|
|
2185
2217
|
if (xWrapperEl) {
|
|
@@ -2197,30 +2229,31 @@ export default defineVxeComponent({
|
|
|
2197
2229
|
const scrollYVirtualEl = refScrollYVirtualElem.value;
|
|
2198
2230
|
if (scrollYVirtualEl) {
|
|
2199
2231
|
scrollYVirtualEl.style.width = `${osbWidth}px`;
|
|
2200
|
-
scrollYVirtualEl.style.height = `${
|
|
2201
|
-
scrollYVirtualEl.style.visibility =
|
|
2232
|
+
scrollYVirtualEl.style.height = `${tbHeight + tHeaderHeight + tFooterHeight}px`;
|
|
2233
|
+
scrollYVirtualEl.style.visibility = yScrollbarVisible;
|
|
2202
2234
|
}
|
|
2203
2235
|
const yTopCornerEl = refScrollYTopCornerElem.value;
|
|
2204
2236
|
if (yTopCornerEl) {
|
|
2205
|
-
yTopCornerEl.style.height = `${
|
|
2206
|
-
yTopCornerEl.style.display = overflowY &&
|
|
2237
|
+
yTopCornerEl.style.height = `${tHeaderHeight}px`;
|
|
2238
|
+
yTopCornerEl.style.display = overflowY && tHeaderHeight ? 'block' : '';
|
|
2207
2239
|
}
|
|
2208
2240
|
const yWrapperEl = refScrollYWrapperElem.value;
|
|
2209
2241
|
if (yWrapperEl) {
|
|
2210
|
-
yWrapperEl.style.height = `${
|
|
2211
|
-
yWrapperEl.style.top = `${
|
|
2242
|
+
yWrapperEl.style.height = `${tbHeight}px`;
|
|
2243
|
+
yWrapperEl.style.top = `${tHeaderHeight}px`;
|
|
2212
2244
|
}
|
|
2213
2245
|
const yBottomCornerEl = refScrollYBottomCornerElem.value;
|
|
2214
2246
|
if (yBottomCornerEl) {
|
|
2215
|
-
yBottomCornerEl.style.height = `${
|
|
2216
|
-
yBottomCornerEl.style.top = `${
|
|
2217
|
-
yBottomCornerEl.style.display = overflowY &&
|
|
2247
|
+
yBottomCornerEl.style.height = `${tFooterHeight}px`;
|
|
2248
|
+
yBottomCornerEl.style.top = `${tHeaderHeight + tbHeight}px`;
|
|
2249
|
+
yBottomCornerEl.style.display = overflowY && tFooterHeight ? 'block' : '';
|
|
2218
2250
|
}
|
|
2219
2251
|
const rowExpandEl = refRowExpandElem.value;
|
|
2220
2252
|
if (rowExpandEl) {
|
|
2221
|
-
rowExpandEl.style.height = `${
|
|
2222
|
-
rowExpandEl.style.top = `${
|
|
2253
|
+
rowExpandEl.style.height = `${tbHeight}px`;
|
|
2254
|
+
rowExpandEl.style.top = `${tHeaderHeight}px`;
|
|
2223
2255
|
}
|
|
2256
|
+
reactData.tBodyHeight = tbHeight;
|
|
2224
2257
|
containerList.forEach((name, index) => {
|
|
2225
2258
|
const fixedType = index > 0 ? name : '';
|
|
2226
2259
|
const layoutList = ['header', 'body', 'footer'];
|
|
@@ -2284,7 +2317,7 @@ export default defineVxeComponent({
|
|
|
2284
2317
|
}
|
|
2285
2318
|
}
|
|
2286
2319
|
if (currScrollElem) {
|
|
2287
|
-
currScrollElem.style.height = `${
|
|
2320
|
+
currScrollElem.style.height = `${tHeaderHeight}px`;
|
|
2288
2321
|
}
|
|
2289
2322
|
if (tableElem) {
|
|
2290
2323
|
tableElem.style.width = tWidth ? `${tWidth}px` : '';
|
|
@@ -2293,15 +2326,15 @@ export default defineVxeComponent({
|
|
|
2293
2326
|
else if (layout === 'body') {
|
|
2294
2327
|
if (currScrollElem) {
|
|
2295
2328
|
currScrollElem.style.maxHeight = customMaxHeight ? `${bodyMaxHeight}px` : '';
|
|
2296
|
-
currScrollElem.style.height = customHeight ? `${
|
|
2329
|
+
currScrollElem.style.height = customHeight ? `${tbHeight}px` : '';
|
|
2297
2330
|
currScrollElem.style.minHeight = `${bodyMinHeight}px`;
|
|
2298
2331
|
}
|
|
2299
2332
|
// 如果是固定列
|
|
2300
2333
|
if (fixedWrapperElem) {
|
|
2301
2334
|
if (wrapperElem) {
|
|
2302
|
-
wrapperElem.style.top = `${
|
|
2335
|
+
wrapperElem.style.top = `${tHeaderHeight}px`;
|
|
2303
2336
|
}
|
|
2304
|
-
fixedWrapperElem.style.height = `${customHeight > 0 ? customHeight : (tableHeight +
|
|
2337
|
+
fixedWrapperElem.style.height = `${customHeight > 0 ? customHeight : (tableHeight + tHeaderHeight + tFooterHeight + osbHeight)}px`;
|
|
2305
2338
|
fixedWrapperElem.style.width = `${fixedColumn.reduce((previous, column) => previous + column.renderWidth, 0)}px`;
|
|
2306
2339
|
}
|
|
2307
2340
|
let renderColumnList = tableColumn;
|
|
@@ -2378,11 +2411,11 @@ export default defineVxeComponent({
|
|
|
2378
2411
|
}
|
|
2379
2412
|
}
|
|
2380
2413
|
if (currScrollElem) {
|
|
2381
|
-
currScrollElem.style.height = `${
|
|
2414
|
+
currScrollElem.style.height = `${tFooterHeight}px`;
|
|
2382
2415
|
// 如果是固定列
|
|
2383
2416
|
if (fixedWrapperElem) {
|
|
2384
2417
|
if (wrapperElem) {
|
|
2385
|
-
wrapperElem.style.top = `${customHeight > 0 ? customHeight -
|
|
2418
|
+
wrapperElem.style.top = `${customHeight > 0 ? customHeight - tFooterHeight - osbHeight : tableHeight + tHeaderHeight}px`;
|
|
2386
2419
|
}
|
|
2387
2420
|
}
|
|
2388
2421
|
}
|
|
@@ -2398,6 +2431,9 @@ export default defineVxeComponent({
|
|
|
2398
2431
|
if (mouseConfig && mouseOpts.selected && editStore.selected.row && editStore.selected.column) {
|
|
2399
2432
|
$xeTable.addCellSelectedClass();
|
|
2400
2433
|
}
|
|
2434
|
+
if ($xeGanttView) {
|
|
2435
|
+
$xeGanttView.handleUpdateStyle();
|
|
2436
|
+
}
|
|
2401
2437
|
return nextTick();
|
|
2402
2438
|
};
|
|
2403
2439
|
const checkValidate = (type) => {
|
|
@@ -2973,13 +3009,13 @@ export default defineVxeComponent({
|
|
|
2973
3009
|
if (xHandleEl) {
|
|
2974
3010
|
reactData.scrollbarHeight = scrollbarOpts.height || (xHandleEl.offsetHeight - xHandleEl.clientHeight) || 14;
|
|
2975
3011
|
}
|
|
2976
|
-
const
|
|
2977
|
-
const
|
|
3012
|
+
const hHeight = headerTableElem ? headerTableElem.clientHeight : 0;
|
|
3013
|
+
const fHeight = footerTableElem ? footerTableElem.clientHeight : 0;
|
|
2978
3014
|
internalData.tableHeight = bodyWrapperElem.offsetHeight;
|
|
2979
|
-
|
|
2980
|
-
|
|
3015
|
+
reactData.tHeaderHeight = hHeight;
|
|
3016
|
+
reactData.tFooterHeight = fHeight;
|
|
2981
3017
|
reactData.overflowX = overflowX;
|
|
2982
|
-
reactData.parentHeight = Math.max(
|
|
3018
|
+
reactData.parentHeight = Math.max(hHeight + fHeight + 20, $xeTable.getParentHeight());
|
|
2983
3019
|
}
|
|
2984
3020
|
if (overflowX) {
|
|
2985
3021
|
$xeTable.checkScrolling();
|
|
@@ -3032,6 +3068,7 @@ export default defineVxeComponent({
|
|
|
3032
3068
|
};
|
|
3033
3069
|
const handleLazyRecalculate = (reFull, reWidth, reHeight) => {
|
|
3034
3070
|
return new Promise(resolve => {
|
|
3071
|
+
const $xeGanttView = internalData.xeGanttView;
|
|
3035
3072
|
const { rceTimeout, rceRunTime } = internalData;
|
|
3036
3073
|
const resizeOpts = computeResizeOpts.value;
|
|
3037
3074
|
const refreshDelay = resizeOpts.refreshDelay || 20;
|
|
@@ -3054,6 +3091,9 @@ export default defineVxeComponent({
|
|
|
3054
3091
|
else {
|
|
3055
3092
|
resolve(handleRecalculateStyle(reFull, reWidth, reHeight));
|
|
3056
3093
|
}
|
|
3094
|
+
if ($xeGanttView) {
|
|
3095
|
+
$xeGanttView.handleLazyRecalculate();
|
|
3096
|
+
}
|
|
3057
3097
|
internalData.rceTimeout = setTimeout(() => {
|
|
3058
3098
|
internalData.rceTimeout = undefined;
|
|
3059
3099
|
handleRecalculateStyle(reFull, reWidth, reHeight);
|
|
@@ -4010,6 +4050,17 @@ export default defineVxeComponent({
|
|
|
4010
4050
|
};
|
|
4011
4051
|
requestAnimationFrame(step);
|
|
4012
4052
|
};
|
|
4053
|
+
const syncGanttScrollTop = (scrollTop) => {
|
|
4054
|
+
const $xeGanttView = internalData.xeGanttView;
|
|
4055
|
+
if ($xeGanttView) {
|
|
4056
|
+
const ganttInternalData = $xeGanttView.internalData;
|
|
4057
|
+
const { elemStore: ganttElemStore } = ganttInternalData;
|
|
4058
|
+
const ganttBodyScrollElem = getRefElem(ganttElemStore['main-body-scroll']);
|
|
4059
|
+
if (ganttBodyScrollElem) {
|
|
4060
|
+
ganttBodyScrollElem.scrollTop = scrollTop;
|
|
4061
|
+
}
|
|
4062
|
+
}
|
|
4063
|
+
};
|
|
4013
4064
|
const dispatchEvent = (type, params, evnt) => {
|
|
4014
4065
|
emit(type, createEvent(evnt, { $table: $xeTable, $grid: $xeGrid }, params));
|
|
4015
4066
|
};
|
|
@@ -5190,6 +5241,25 @@ export default defineVxeComponent({
|
|
|
5190
5241
|
});
|
|
5191
5242
|
return rest;
|
|
5192
5243
|
},
|
|
5244
|
+
recalcRowHeight(rowOrId) {
|
|
5245
|
+
const { fullAllDataRowIdData } = internalData;
|
|
5246
|
+
const rows = XEUtils.isArray(rowOrId) ? rowOrId : [rowOrId];
|
|
5247
|
+
const el = refElem.value;
|
|
5248
|
+
if (el) {
|
|
5249
|
+
const { handleGetRowId } = createHandleGetRowId($xeTable);
|
|
5250
|
+
el.setAttribute('data-calc-row', 'Y');
|
|
5251
|
+
rows.forEach(row => {
|
|
5252
|
+
const rowid = XEUtils.isString(row) || XEUtils.isNumber(row) ? row : handleGetRowId(row);
|
|
5253
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
5254
|
+
if (rowRest) {
|
|
5255
|
+
rowRest.resizeHeight = calcCellAutoHeight(rowRest, el);
|
|
5256
|
+
}
|
|
5257
|
+
el.removeAttribute('data-calc-row');
|
|
5258
|
+
});
|
|
5259
|
+
reactData.calcCellHeightFlag++;
|
|
5260
|
+
}
|
|
5261
|
+
return nextTick();
|
|
5262
|
+
},
|
|
5193
5263
|
setRowHeight(rowOrId, height) {
|
|
5194
5264
|
const { fullAllDataRowIdData } = internalData;
|
|
5195
5265
|
let status = false;
|
|
@@ -6883,11 +6953,18 @@ export default defineVxeComponent({
|
|
|
6883
6953
|
internalData.isActivated = false;
|
|
6884
6954
|
return nextTick();
|
|
6885
6955
|
},
|
|
6956
|
+
/**
|
|
6957
|
+
* 已废弃,被 connectToolbar 替换
|
|
6958
|
+
* @deprecated
|
|
6959
|
+
*/
|
|
6960
|
+
connect($toolbar) {
|
|
6961
|
+
return $xeTable.connectToolbar($toolbar);
|
|
6962
|
+
},
|
|
6886
6963
|
/**
|
|
6887
6964
|
* 连接工具栏
|
|
6888
6965
|
* @param $toolbar
|
|
6889
6966
|
*/
|
|
6890
|
-
|
|
6967
|
+
connectToolbar($toolbar) {
|
|
6891
6968
|
if ($toolbar) {
|
|
6892
6969
|
$xeToolbar = $toolbar;
|
|
6893
6970
|
$xeToolbar.syncUpdate({ collectColumn: internalData.collectColumn, $table: $xeTable });
|
|
@@ -7819,6 +7896,7 @@ export default defineVxeComponent({
|
|
|
7819
7896
|
handleTableData(force) {
|
|
7820
7897
|
const { scrollYLoad } = reactData;
|
|
7821
7898
|
const { scrollYStore, fullDataRowIdData } = internalData;
|
|
7899
|
+
const $xeGanttView = internalData.xeGanttView;
|
|
7822
7900
|
let fullList = internalData.afterFullData;
|
|
7823
7901
|
// 是否进行数据处理
|
|
7824
7902
|
if (force) {
|
|
@@ -7839,6 +7917,9 @@ export default defineVxeComponent({
|
|
|
7839
7917
|
});
|
|
7840
7918
|
reactData.tableData = tableData;
|
|
7841
7919
|
internalData.visibleDataRowIdData = visibleDataRowIdMaps;
|
|
7920
|
+
if ($xeGanttView) {
|
|
7921
|
+
$xeGanttView.updateViewData();
|
|
7922
|
+
}
|
|
7842
7923
|
return nextTick();
|
|
7843
7924
|
},
|
|
7844
7925
|
/**
|
|
@@ -8173,6 +8254,7 @@ export default defineVxeComponent({
|
|
|
8173
8254
|
evnt.stopPropagation();
|
|
8174
8255
|
evnt.preventDefault();
|
|
8175
8256
|
const { row } = params;
|
|
8257
|
+
const { showOverflow } = props;
|
|
8176
8258
|
const { overflowX, scrollbarWidth, overflowY, scrollbarHeight } = reactData;
|
|
8177
8259
|
const { elemStore, fullAllDataRowIdData } = internalData;
|
|
8178
8260
|
const osbWidth = overflowY ? scrollbarWidth : 0;
|
|
@@ -8201,7 +8283,10 @@ export default defineVxeComponent({
|
|
|
8201
8283
|
return;
|
|
8202
8284
|
}
|
|
8203
8285
|
const defaultRowHeight = computeDefaultRowHeight.value;
|
|
8204
|
-
|
|
8286
|
+
let currCellHeight = rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight;
|
|
8287
|
+
if (!showOverflow) {
|
|
8288
|
+
currCellHeight = tdEl.clientHeight;
|
|
8289
|
+
}
|
|
8205
8290
|
const tableRect = tableEl.getBoundingClientRect();
|
|
8206
8291
|
const trRect = trEl.getBoundingClientRect();
|
|
8207
8292
|
const targetOffsetY = dragClientY - trRect.y - trEl.clientHeight;
|
|
@@ -10351,6 +10436,7 @@ export default defineVxeComponent({
|
|
|
10351
10436
|
}
|
|
10352
10437
|
setScrollTop(yHandleEl, scrollTop);
|
|
10353
10438
|
setScrollTop(rowExpandEl, scrollTop);
|
|
10439
|
+
syncGanttScrollTop(scrollTop);
|
|
10354
10440
|
if (scrollYLoad) {
|
|
10355
10441
|
$xeTable.triggerScrollYEvent(evnt);
|
|
10356
10442
|
}
|
|
@@ -10539,6 +10625,7 @@ export default defineVxeComponent({
|
|
|
10539
10625
|
setScrollTop(leftScrollElem, currTopNum);
|
|
10540
10626
|
setScrollTop(rightScrollElem, currTopNum);
|
|
10541
10627
|
setScrollTop(rowExpandEl, currTopNum);
|
|
10628
|
+
syncGanttScrollTop(currTopNum);
|
|
10542
10629
|
if (scrollYLoad) {
|
|
10543
10630
|
$xeTable.triggerScrollYEvent(evnt);
|
|
10544
10631
|
}
|
|
@@ -10556,6 +10643,7 @@ export default defineVxeComponent({
|
|
|
10556
10643
|
setScrollTop(leftScrollElem, currTopNum);
|
|
10557
10644
|
setScrollTop(rightScrollElem, currTopNum);
|
|
10558
10645
|
setScrollTop(rowExpandEl, currTopNum);
|
|
10646
|
+
syncGanttScrollTop(currTopNum);
|
|
10559
10647
|
if (scrollYLoad) {
|
|
10560
10648
|
$xeTable.triggerScrollYEvent(evnt);
|
|
10561
10649
|
}
|
|
@@ -10629,6 +10717,7 @@ export default defineVxeComponent({
|
|
|
10629
10717
|
setScrollTop(leftScrollElem, scrollTop);
|
|
10630
10718
|
setScrollTop(rightScrollElem, scrollTop);
|
|
10631
10719
|
setScrollTop(rowExpandEl, scrollTop);
|
|
10720
|
+
syncGanttScrollTop(scrollTop);
|
|
10632
10721
|
if (scrollYLoad) {
|
|
10633
10722
|
$xeTable.triggerScrollYEvent(evnt);
|
|
10634
10723
|
}
|
|
@@ -10668,6 +10757,7 @@ export default defineVxeComponent({
|
|
|
10668
10757
|
updateScrollXSpace() {
|
|
10669
10758
|
const { scrollXLoad, overflowX, scrollXWidth } = reactData;
|
|
10670
10759
|
const { visibleColumn, scrollXStore, elemStore, fullColumnIdData } = internalData;
|
|
10760
|
+
const $xeGanttView = internalData.xeGanttView;
|
|
10671
10761
|
const mouseOpts = computeMouseOpts.value;
|
|
10672
10762
|
const tableBody = refTableBody.value;
|
|
10673
10763
|
const tableBodyElem = tableBody ? tableBody.$el : null;
|
|
@@ -10729,10 +10819,13 @@ export default defineVxeComponent({
|
|
|
10729
10819
|
if (scrollXSpaceEl) {
|
|
10730
10820
|
scrollXSpaceEl.style.width = `${ySpaceWidth}px`;
|
|
10731
10821
|
}
|
|
10822
|
+
calcScrollbar();
|
|
10732
10823
|
if (isScrollXBig && mouseOpts.area) {
|
|
10733
10824
|
errLog('vxe.error.notProp', ['mouse-config.area']);
|
|
10734
10825
|
}
|
|
10735
|
-
|
|
10826
|
+
if ($xeGanttView) {
|
|
10827
|
+
$xeGanttView.updateScrollXSpace();
|
|
10828
|
+
}
|
|
10736
10829
|
return nextTick().then(() => {
|
|
10737
10830
|
updateStyle();
|
|
10738
10831
|
});
|
|
@@ -10742,6 +10835,7 @@ export default defineVxeComponent({
|
|
|
10742
10835
|
updateScrollYSpace() {
|
|
10743
10836
|
const { isAllOverflow, overflowY, scrollYLoad, expandColumn } = reactData;
|
|
10744
10837
|
const { scrollYStore, elemStore, isResizeCellHeight, afterFullData, fullAllDataRowIdData, rowExpandedMaps } = internalData;
|
|
10838
|
+
const $xeGanttView = internalData.xeGanttView;
|
|
10745
10839
|
const { startIndex } = scrollYStore;
|
|
10746
10840
|
const mouseOpts = computeMouseOpts.value;
|
|
10747
10841
|
const expandOpts = computeExpandOpts.value;
|
|
@@ -10837,10 +10931,13 @@ export default defineVxeComponent({
|
|
|
10837
10931
|
reactData.scrollYTop = scrollYTop;
|
|
10838
10932
|
reactData.scrollYHeight = scrollYHeight;
|
|
10839
10933
|
reactData.isScrollYBig = isScrollYBig;
|
|
10934
|
+
calcScrollbar();
|
|
10840
10935
|
if (isScrollYBig && mouseOpts.area) {
|
|
10841
10936
|
errLog('vxe.error.notProp', ['mouse-config.area']);
|
|
10842
10937
|
}
|
|
10843
|
-
|
|
10938
|
+
if ($xeGanttView) {
|
|
10939
|
+
$xeGanttView.updateScrollYSpace();
|
|
10940
|
+
}
|
|
10844
10941
|
return nextTick().then(() => {
|
|
10845
10942
|
updateStyle();
|
|
10846
10943
|
});
|
|
@@ -10946,6 +11043,13 @@ export default defineVxeComponent({
|
|
|
10946
11043
|
return getRowid($xeTable, row1) === getRowid($xeTable, row2);
|
|
10947
11044
|
}
|
|
10948
11045
|
return false;
|
|
11046
|
+
},
|
|
11047
|
+
handleConnectGanttView($ganttView) {
|
|
11048
|
+
if ($ganttView && $ganttView.connectUpdate) {
|
|
11049
|
+
$ganttView.connectUpdate({ $table: $xeTable });
|
|
11050
|
+
internalData.xeGanttView = $ganttView;
|
|
11051
|
+
}
|
|
11052
|
+
return nextTick();
|
|
10949
11053
|
}
|
|
10950
11054
|
};
|
|
10951
11055
|
// 检测对应模块是否安装
|
|
@@ -11637,28 +11741,22 @@ export default defineVxeComponent({
|
|
|
11637
11741
|
tableMethods.refreshColumn();
|
|
11638
11742
|
});
|
|
11639
11743
|
});
|
|
11640
|
-
const
|
|
11744
|
+
const reLayoutFlag = ref(0);
|
|
11641
11745
|
watch(computeSize, () => {
|
|
11642
|
-
|
|
11746
|
+
reLayoutFlag.value++;
|
|
11643
11747
|
});
|
|
11644
11748
|
watch(() => props.showHeader, () => {
|
|
11645
|
-
|
|
11749
|
+
reLayoutFlag.value++;
|
|
11646
11750
|
});
|
|
11647
11751
|
watch(() => props.showFooter, () => {
|
|
11648
|
-
|
|
11752
|
+
reLayoutFlag.value++;
|
|
11649
11753
|
});
|
|
11650
11754
|
watch(() => reactData.overflowX, () => {
|
|
11651
|
-
|
|
11755
|
+
reLayoutFlag.value++;
|
|
11652
11756
|
});
|
|
11653
11757
|
watch(() => reactData.overflowY, () => {
|
|
11654
|
-
|
|
11655
|
-
});
|
|
11656
|
-
watch(reScrollFlag, () => {
|
|
11657
|
-
nextTick(() => {
|
|
11658
|
-
tableMethods.recalculate(true).then(() => tableMethods.refreshScroll());
|
|
11659
|
-
});
|
|
11758
|
+
reLayoutFlag.value++;
|
|
11660
11759
|
});
|
|
11661
|
-
const reLayoutFlag = ref(0);
|
|
11662
11760
|
watch(() => props.height, () => {
|
|
11663
11761
|
reLayoutFlag.value++;
|
|
11664
11762
|
});
|
|
@@ -11675,7 +11773,7 @@ export default defineVxeComponent({
|
|
|
11675
11773
|
reLayoutFlag.value++;
|
|
11676
11774
|
});
|
|
11677
11775
|
watch(reLayoutFlag, () => {
|
|
11678
|
-
|
|
11776
|
+
$xeTable.recalculate(true);
|
|
11679
11777
|
});
|
|
11680
11778
|
const footFlag = ref(0);
|
|
11681
11779
|
watch(() => props.footerData ? props.footerData.length : -1, () => {
|
|
@@ -11685,7 +11783,7 @@ export default defineVxeComponent({
|
|
|
11685
11783
|
footFlag.value++;
|
|
11686
11784
|
});
|
|
11687
11785
|
watch(footFlag, () => {
|
|
11688
|
-
|
|
11786
|
+
$xeTable.updateFooter();
|
|
11689
11787
|
});
|
|
11690
11788
|
watch(() => props.syncResize, (value) => {
|
|
11691
11789
|
if (value) {
|