vxe-table 4.15.5 → 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.
Files changed (80) hide show
  1. package/README.md +6 -4
  2. package/es/grid/src/emits.js +16 -0
  3. package/es/grid/src/grid.js +77 -62
  4. package/es/grid/src/props.js +7 -0
  5. package/es/style.css +1 -1
  6. package/es/table/index.js +0 -8
  7. package/es/table/module/custom/hook.js +3 -0
  8. package/es/table/module/edit/hook.js +3 -0
  9. package/es/table/module/export/hook.js +6 -1
  10. package/es/table/module/filter/hook.js +3 -0
  11. package/es/table/module/menu/hook.js +3 -0
  12. package/es/table/module/validator/hook.js +3 -0
  13. package/es/table/src/emits.js +1 -1
  14. package/es/table/src/props.js +1 -1
  15. package/es/table/src/table.js +119 -43
  16. package/es/table/src/util.js +0 -4
  17. package/es/toolbar/src/toolbar.js +2 -2
  18. package/es/ui/index.js +13 -4
  19. package/es/ui/src/log.js +1 -1
  20. package/lib/grid/src/emits.js +8 -0
  21. package/lib/grid/src/emits.min.js +1 -0
  22. package/lib/grid/src/grid.js +78 -54
  23. package/lib/grid/src/grid.min.js +1 -1
  24. package/lib/grid/src/props.js +24 -0
  25. package/lib/grid/src/props.min.js +1 -0
  26. package/lib/index.umd.js +12069 -11995
  27. package/lib/index.umd.min.js +1 -1
  28. package/lib/style.css +1 -1
  29. package/lib/table/index.js +0 -8
  30. package/lib/table/index.min.js +1 -1
  31. package/lib/table/module/custom/hook.js +3 -0
  32. package/lib/table/module/custom/hook.min.js +1 -1
  33. package/lib/table/module/edit/hook.js +3 -0
  34. package/lib/table/module/edit/hook.min.js +1 -1
  35. package/lib/table/module/export/hook.js +8 -1
  36. package/lib/table/module/export/hook.min.js +1 -1
  37. package/lib/table/module/filter/hook.js +3 -0
  38. package/lib/table/module/filter/hook.min.js +1 -1
  39. package/lib/table/module/menu/hook.js +3 -0
  40. package/lib/table/module/menu/hook.min.js +1 -1
  41. package/lib/table/module/validator/hook.js +3 -0
  42. package/lib/table/module/validator/hook.min.js +1 -1
  43. package/lib/table/src/emits.js +2 -2
  44. package/lib/table/src/emits.min.js +1 -1
  45. package/lib/table/src/props.js +2 -2
  46. package/lib/table/src/props.min.js +1 -1
  47. package/lib/table/src/table.js +29 -22
  48. package/lib/table/src/table.min.js +1 -1
  49. package/lib/table/src/util.js +0 -4
  50. package/lib/table/src/util.min.js +1 -1
  51. package/lib/toolbar/src/toolbar.js +2 -0
  52. package/lib/toolbar/src/toolbar.min.js +1 -1
  53. package/lib/ui/index.js +12 -3
  54. package/lib/ui/index.min.js +1 -1
  55. package/lib/ui/src/log.js +1 -1
  56. package/lib/ui/src/log.min.js +1 -1
  57. package/package.json +1 -1
  58. package/packages/grid/src/emits.ts +19 -0
  59. package/packages/grid/src/grid.ts +89 -85
  60. package/packages/grid/src/props.ts +23 -0
  61. package/packages/table/index.ts +0 -8
  62. package/packages/table/module/custom/hook.ts +3 -0
  63. package/packages/table/module/edit/hook.ts +3 -0
  64. package/packages/table/module/export/hook.ts +8 -3
  65. package/packages/table/module/filter/hook.ts +3 -0
  66. package/packages/table/module/menu/hook.ts +3 -0
  67. package/packages/table/module/validator/hook.ts +3 -0
  68. package/packages/table/src/emits.ts +2 -2
  69. package/packages/table/src/props.ts +1 -1
  70. package/packages/table/src/table.ts +125 -45
  71. package/packages/table/src/util.ts +0 -4
  72. package/packages/toolbar/src/toolbar.ts +2 -2
  73. package/packages/ui/index.ts +12 -2
  74. package/packages/ui/src/dom.ts +1 -1
  75. /package/es/{iconfont.1754615009926.ttf → iconfont.1754905357789.ttf} +0 -0
  76. /package/es/{iconfont.1754615009926.woff → iconfont.1754905357789.woff} +0 -0
  77. /package/es/{iconfont.1754615009926.woff2 → iconfont.1754905357789.woff2} +0 -0
  78. /package/lib/{iconfont.1754615009926.ttf → iconfont.1754905357789.ttf} +0 -0
  79. /package/lib/{iconfont.1754615009926.woff → iconfont.1754905357789.woff} +0 -0
  80. /package/lib/{iconfont.1754615009926.woff2 → iconfont.1754905357789.woff2} +0 -0
@@ -12,14 +12,23 @@ 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
22
 
23
+ import '../module/filter/hook'
24
+ import '../module/menu/hook'
25
+ import '../module/edit/hook'
26
+ import '../module/export/hook'
27
+ import '../module/keyboard/hook'
28
+ import '../module/validator/hook'
29
+ import '../module/custom/hook'
30
+ import '../render'
31
+
23
32
  import type { VxeTooltipInstance, VxeTabsConstructor, VxeTabsPrivateMethods, ValueOf, VxeComponentSlotType } from 'vxe-pc-ui'
24
33
  import type { VxeGridConstructor, VxeGridPrivateMethods, VxeTableConstructor, TableReactData, VxeTablePropTypes, VxeToolbarConstructor, TablePrivateMethods, VxeTablePrivateRef, VxeTablePrivateComputed, VxeTablePrivateMethods, TableMethods, VxeTableMethods, VxeTableDefines, VxeTableEmits, VxeTableProps, VxeColumnPropTypes, VxeTableCustomPanelConstructor } from '../../../types'
25
34
 
@@ -74,6 +83,12 @@ export default defineVxeComponent({
74
83
  lastScrollTime: 0,
75
84
  // 行高
76
85
  rowHeight: 0,
86
+ // 表头高度
87
+ tHeaderHeight: 0,
88
+ // 表体高度
89
+ tBodyHeight: 0,
90
+ // 表尾高度
91
+ tFooterHeight: 0,
77
92
  // 表格父容器的高度
78
93
  parentHeight: 0,
79
94
  // 是否使用分组表头
@@ -350,6 +365,7 @@ export default defineVxeComponent({
350
365
  const refScrollYSpaceElem = ref<HTMLDivElement>()
351
366
 
352
367
  const $xeGrid = inject<(VxeGridConstructor & VxeGridPrivateMethods) | null>('$xeGrid', null)
368
+ const $xeGantt = inject('$xeGantt', null)
353
369
  let $xeToolbar: VxeToolbarConstructor
354
370
 
355
371
  const computeTableId = computed(() => {
@@ -901,6 +917,9 @@ export default defineVxeComponent({
901
917
  getComputeMaps: () => computeMaps,
902
918
 
903
919
  xeGrid: $xeGrid,
920
+ xeGantt: $xeGantt,
921
+
922
+ // 已废弃
904
923
  xegrid: $xeGrid
905
924
  } as unknown as VxeTableConstructor & VxeTableMethods & VxeTablePrivateMethods
906
925
 
@@ -2263,14 +2282,15 @@ export default defineVxeComponent({
2263
2282
 
2264
2283
  const updateStyle = () => {
2265
2284
  const { showHeaderOverflow: allColumnHeaderOverflow, showFooterOverflow: allColumnFooterOverflow, mouseConfig, spanMethod, footerSpanMethod } = props
2266
- const { isGroup, currentRow, tableColumn, scrollXLoad, scrollYLoad, overflowX, scrollbarWidth, overflowY, scrollbarHeight, scrollXWidth, columnStore, editStore, isAllOverflow, expandColumn, isColLoading } = reactData
2267
- const { visibleColumn, tableHeight, headerHeight, footerHeight, elemStore, customHeight, customMinHeight, customMaxHeight } = internalData
2285
+ const { isGroup, currentRow, tableColumn, scrollXLoad, scrollYLoad, overflowX, scrollbarWidth, overflowY, scrollbarHeight, scrollXWidth, columnStore, editStore, isAllOverflow, expandColumn, isColLoading, tHeaderHeight, tFooterHeight } = reactData
2286
+ const { visibleColumn, tableHeight, elemStore, customHeight, customMinHeight, customMaxHeight } = internalData
2287
+ const $xeGanttView = internalData.xeGanttView
2268
2288
  const el = refElem.value
2269
- if (!el) {
2289
+ if (!el || !el.clientHeight) {
2270
2290
  return
2271
2291
  }
2272
2292
  const containerList = ['main', 'left', 'right']
2273
- const osbWidth = overflowY ? scrollbarWidth : 0
2293
+ let osbWidth = overflowY ? scrollbarWidth : 0
2274
2294
  const osbHeight = overflowX ? scrollbarHeight : 0
2275
2295
  const emptyPlaceholderElem = refEmptyPlaceholder.value
2276
2296
  const mouseOpts = computeMouseOpts.value
@@ -2278,39 +2298,49 @@ export default defineVxeComponent({
2278
2298
  const bodyWrapperElem = getRefElem(elemStore['main-body-wrapper'])
2279
2299
  const bodyTableElem = getRefElem(elemStore['main-body-table'])
2280
2300
  if (emptyPlaceholderElem) {
2281
- emptyPlaceholderElem.style.top = `${headerHeight}px`
2301
+ emptyPlaceholderElem.style.top = `${tHeaderHeight}px`
2282
2302
  emptyPlaceholderElem.style.height = bodyWrapperElem ? `${bodyWrapperElem.offsetHeight - osbHeight}px` : ''
2283
2303
  }
2284
2304
 
2285
- let bodyHeight = 0
2305
+ const scrollbarXToTop = computeScrollbarXToTop.value
2306
+ const scrollbarYToLeft = computeScrollbarYToLeft.value
2307
+
2308
+ const xScrollbarVisible = overflowX ? 'visible' : 'hidden'
2309
+ let yScrollbarVisible = overflowY ? 'visible' : 'hidden'
2310
+ if ($xeGanttView) {
2311
+ if (!scrollbarYToLeft) {
2312
+ osbWidth = 0
2313
+ yScrollbarVisible = 'hidden'
2314
+ }
2315
+ }
2316
+
2317
+ let tbHeight = 0
2286
2318
  let bodyMaxHeight = 0
2287
- const bodyMinHeight = customMinHeight - headerHeight - footerHeight - osbHeight
2319
+ const bodyMinHeight = customMinHeight - tHeaderHeight - tFooterHeight - osbHeight
2288
2320
  if (customMaxHeight) {
2289
- bodyMaxHeight = Math.max(bodyMinHeight, customMaxHeight - headerHeight - footerHeight - osbHeight)
2321
+ bodyMaxHeight = Math.max(bodyMinHeight, customMaxHeight - tHeaderHeight - tFooterHeight - osbHeight)
2290
2322
  }
2291
2323
  if (customHeight) {
2292
- bodyHeight = customHeight - headerHeight - footerHeight - osbHeight
2324
+ tbHeight = customHeight - tHeaderHeight - tFooterHeight - osbHeight
2293
2325
  }
2294
- if (!bodyHeight) {
2326
+ if (!tbHeight) {
2295
2327
  if (bodyTableElem) {
2296
- bodyHeight = bodyTableElem.clientHeight
2328
+ tbHeight = bodyTableElem.clientHeight
2297
2329
  }
2298
2330
  }
2299
- if (bodyHeight) {
2331
+ if (tbHeight) {
2300
2332
  if (bodyMaxHeight) {
2301
- bodyHeight = Math.min(bodyMaxHeight, bodyHeight)
2333
+ tbHeight = Math.min(bodyMaxHeight, tbHeight)
2302
2334
  }
2303
- bodyHeight = Math.max(bodyMinHeight, bodyHeight)
2335
+ tbHeight = Math.max(bodyMinHeight, tbHeight)
2304
2336
  }
2305
2337
 
2306
- const scrollbarXToTop = computeScrollbarXToTop.value
2307
-
2308
2338
  const xLeftCornerEl = refScrollXLeftCornerElem.value
2309
2339
  const xRightCornerEl = refScrollXRightCornerElem.value
2310
2340
  const scrollXVirtualEl = refScrollXVirtualElem.value
2311
2341
  if (scrollXVirtualEl) {
2312
2342
  scrollXVirtualEl.style.height = `${osbHeight}px`
2313
- scrollXVirtualEl.style.visibility = overflowX ? 'visible' : 'hidden'
2343
+ scrollXVirtualEl.style.visibility = xScrollbarVisible
2314
2344
  }
2315
2345
  const xWrapperEl = refScrollXWrapperElem.value
2316
2346
  if (xWrapperEl) {
@@ -2329,32 +2359,34 @@ export default defineVxeComponent({
2329
2359
  const scrollYVirtualEl = refScrollYVirtualElem.value
2330
2360
  if (scrollYVirtualEl) {
2331
2361
  scrollYVirtualEl.style.width = `${osbWidth}px`
2332
- scrollYVirtualEl.style.height = `${bodyHeight + headerHeight + footerHeight}px`
2333
- scrollYVirtualEl.style.visibility = overflowY ? 'visible' : 'hidden'
2362
+ scrollYVirtualEl.style.height = `${tbHeight + tHeaderHeight + tFooterHeight}px`
2363
+ scrollYVirtualEl.style.visibility = yScrollbarVisible
2334
2364
  }
2335
2365
  const yTopCornerEl = refScrollYTopCornerElem.value
2336
2366
  if (yTopCornerEl) {
2337
- yTopCornerEl.style.height = `${headerHeight}px`
2338
- yTopCornerEl.style.display = overflowY && headerHeight ? 'block' : ''
2367
+ yTopCornerEl.style.height = `${tHeaderHeight}px`
2368
+ yTopCornerEl.style.display = overflowY && tHeaderHeight ? 'block' : ''
2339
2369
  }
2340
2370
  const yWrapperEl = refScrollYWrapperElem.value
2341
2371
  if (yWrapperEl) {
2342
- yWrapperEl.style.height = `${bodyHeight}px`
2343
- yWrapperEl.style.top = `${headerHeight}px`
2372
+ yWrapperEl.style.height = `${tbHeight}px`
2373
+ yWrapperEl.style.top = `${tHeaderHeight}px`
2344
2374
  }
2345
2375
  const yBottomCornerEl = refScrollYBottomCornerElem.value
2346
2376
  if (yBottomCornerEl) {
2347
- yBottomCornerEl.style.height = `${footerHeight}px`
2348
- yBottomCornerEl.style.top = `${headerHeight + bodyHeight}px`
2349
- yBottomCornerEl.style.display = overflowY && footerHeight ? 'block' : ''
2377
+ yBottomCornerEl.style.height = `${tFooterHeight}px`
2378
+ yBottomCornerEl.style.top = `${tHeaderHeight + tbHeight}px`
2379
+ yBottomCornerEl.style.display = overflowY && tFooterHeight ? 'block' : ''
2350
2380
  }
2351
2381
 
2352
2382
  const rowExpandEl = refRowExpandElem.value
2353
2383
  if (rowExpandEl) {
2354
- rowExpandEl.style.height = `${bodyHeight}px`
2355
- rowExpandEl.style.top = `${headerHeight}px`
2384
+ rowExpandEl.style.height = `${tbHeight}px`
2385
+ rowExpandEl.style.top = `${tHeaderHeight}px`
2356
2386
  }
2357
2387
 
2388
+ reactData.tBodyHeight = tbHeight
2389
+
2358
2390
  containerList.forEach((name, index) => {
2359
2391
  const fixedType = index > 0 ? name : ''
2360
2392
  const layoutList = ['header', 'body', 'footer']
@@ -2420,7 +2452,7 @@ export default defineVxeComponent({
2420
2452
  }
2421
2453
 
2422
2454
  if (currScrollElem) {
2423
- currScrollElem.style.height = `${headerHeight}px`
2455
+ currScrollElem.style.height = `${tHeaderHeight}px`
2424
2456
  }
2425
2457
 
2426
2458
  if (tableElem) {
@@ -2429,16 +2461,16 @@ export default defineVxeComponent({
2429
2461
  } else if (layout === 'body') {
2430
2462
  if (currScrollElem) {
2431
2463
  currScrollElem.style.maxHeight = customMaxHeight ? `${bodyMaxHeight}px` : ''
2432
- currScrollElem.style.height = customHeight ? `${bodyHeight}px` : ''
2464
+ currScrollElem.style.height = customHeight ? `${tbHeight}px` : ''
2433
2465
  currScrollElem.style.minHeight = `${bodyMinHeight}px`
2434
2466
  }
2435
2467
 
2436
2468
  // 如果是固定列
2437
2469
  if (fixedWrapperElem) {
2438
2470
  if (wrapperElem) {
2439
- wrapperElem.style.top = `${headerHeight}px`
2471
+ wrapperElem.style.top = `${tHeaderHeight}px`
2440
2472
  }
2441
- fixedWrapperElem.style.height = `${customHeight > 0 ? customHeight : (tableHeight + headerHeight + footerHeight + osbHeight)}px`
2473
+ fixedWrapperElem.style.height = `${customHeight > 0 ? customHeight : (tableHeight + tHeaderHeight + tFooterHeight + osbHeight)}px`
2442
2474
  fixedWrapperElem.style.width = `${fixedColumn.reduce((previous, column) => previous + column.renderWidth, 0)}px`
2443
2475
  }
2444
2476
 
@@ -2521,11 +2553,11 @@ export default defineVxeComponent({
2521
2553
  }
2522
2554
 
2523
2555
  if (currScrollElem) {
2524
- currScrollElem.style.height = `${footerHeight}px`
2556
+ currScrollElem.style.height = `${tFooterHeight}px`
2525
2557
  // 如果是固定列
2526
2558
  if (fixedWrapperElem) {
2527
2559
  if (wrapperElem) {
2528
- wrapperElem.style.top = `${customHeight > 0 ? customHeight - footerHeight - osbHeight : tableHeight + headerHeight}px`
2560
+ wrapperElem.style.top = `${customHeight > 0 ? customHeight - tFooterHeight - osbHeight : tableHeight + tHeaderHeight}px`
2529
2561
  }
2530
2562
  }
2531
2563
  }
@@ -2541,6 +2573,9 @@ export default defineVxeComponent({
2541
2573
  if (mouseConfig && mouseOpts.selected && editStore.selected.row && editStore.selected.column) {
2542
2574
  $xeTable.addCellSelectedClass()
2543
2575
  }
2576
+ if ($xeGanttView) {
2577
+ $xeGanttView.handleUpdateStyle()
2578
+ }
2544
2579
  return nextTick()
2545
2580
  }
2546
2581
 
@@ -3126,14 +3161,13 @@ export default defineVxeComponent({
3126
3161
  reactData.scrollbarHeight = scrollbarOpts.height || (xHandleEl.offsetHeight - xHandleEl.clientHeight) || 14
3127
3162
  }
3128
3163
 
3129
- const headerHeight = headerTableElem ? headerTableElem.clientHeight : 0
3130
- const footerHeight = footerTableElem ? footerTableElem.clientHeight : 0
3164
+ const hHeight = headerTableElem ? headerTableElem.clientHeight : 0
3165
+ const fHeight = footerTableElem ? footerTableElem.clientHeight : 0
3131
3166
  internalData.tableHeight = bodyWrapperElem.offsetHeight
3132
- internalData.headerHeight = headerHeight
3133
- internalData.footerHeight = footerHeight
3134
-
3167
+ reactData.tHeaderHeight = hHeight
3168
+ reactData.tFooterHeight = fHeight
3135
3169
  reactData.overflowX = overflowX
3136
- reactData.parentHeight = Math.max(internalData.headerHeight + footerHeight + 20, $xeTable.getParentHeight())
3170
+ reactData.parentHeight = Math.max(hHeight + fHeight + 20, $xeTable.getParentHeight())
3137
3171
  }
3138
3172
  if (overflowX) {
3139
3173
  $xeTable.checkScrolling()
@@ -3188,6 +3222,7 @@ export default defineVxeComponent({
3188
3222
 
3189
3223
  const handleLazyRecalculate = (reFull: boolean, reWidth: boolean, reHeight: boolean) => {
3190
3224
  return new Promise<void>(resolve => {
3225
+ const $xeGanttView = internalData.xeGanttView
3191
3226
  const { rceTimeout, rceRunTime } = internalData
3192
3227
  const resizeOpts = computeResizeOpts.value
3193
3228
  const refreshDelay = resizeOpts.refreshDelay || 20
@@ -3212,6 +3247,9 @@ export default defineVxeComponent({
3212
3247
  handleRecalculateStyle(reFull, reWidth, reHeight)
3213
3248
  )
3214
3249
  }
3250
+ if ($xeGanttView) {
3251
+ $xeGanttView.handleLazyRecalculate()
3252
+ }
3215
3253
  internalData.rceTimeout = setTimeout(() => {
3216
3254
  internalData.rceTimeout = undefined
3217
3255
  handleRecalculateStyle(reFull, reWidth, reHeight)
@@ -4187,6 +4225,18 @@ export default defineVxeComponent({
4187
4225
  requestAnimationFrame(step)
4188
4226
  }
4189
4227
 
4228
+ const syncGanttScrollTop = (scrollTop: number) => {
4229
+ const $xeGanttView = internalData.xeGanttView
4230
+ if ($xeGanttView) {
4231
+ const ganttInternalData = $xeGanttView.internalData
4232
+ const { elemStore: ganttElemStore } = ganttInternalData
4233
+ const ganttBodyScrollElem = getRefElem(ganttElemStore['main-body-scroll'])
4234
+ if (ganttBodyScrollElem) {
4235
+ ganttBodyScrollElem.scrollTop = scrollTop
4236
+ }
4237
+ }
4238
+ }
4239
+
4190
4240
  const dispatchEvent = (type: ValueOf<VxeTableEmits>, params: Record<string, any>, evnt: Event | null) => {
4191
4241
  emit(type, createEvent(evnt, { $table: $xeTable, $grid: $xeGrid }, params))
4192
4242
  }
@@ -7070,11 +7120,18 @@ export default defineVxeComponent({
7070
7120
  internalData.isActivated = false
7071
7121
  return nextTick()
7072
7122
  },
7123
+ /**
7124
+ * 已废弃,被 connectToolbar 替换
7125
+ * @deprecated
7126
+ */
7127
+ connect ($toolbar) {
7128
+ return $xeTable.connectToolbar($toolbar)
7129
+ },
7073
7130
  /**
7074
7131
  * 连接工具栏
7075
7132
  * @param $toolbar
7076
7133
  */
7077
- connect ($toolbar) {
7134
+ connectToolbar ($toolbar) {
7078
7135
  if ($toolbar) {
7079
7136
  $xeToolbar = $toolbar
7080
7137
  $xeToolbar.syncUpdate({ collectColumn: internalData.collectColumn, $table: $xeTable })
@@ -7989,6 +8046,7 @@ export default defineVxeComponent({
7989
8046
  handleTableData (force?: boolean) {
7990
8047
  const { scrollYLoad } = reactData
7991
8048
  const { scrollYStore, fullDataRowIdData } = internalData
8049
+ const $xeGanttView = internalData.xeGanttView
7992
8050
  let fullList: any[] = internalData.afterFullData
7993
8051
  // 是否进行数据处理
7994
8052
  if (force) {
@@ -8009,6 +8067,9 @@ export default defineVxeComponent({
8009
8067
  })
8010
8068
  reactData.tableData = tableData
8011
8069
  internalData.visibleDataRowIdData = visibleDataRowIdMaps
8070
+ if ($xeGanttView) {
8071
+ $xeGanttView.updateViewData()
8072
+ }
8012
8073
  return nextTick()
8013
8074
  },
8014
8075
  /**
@@ -10534,6 +10595,7 @@ export default defineVxeComponent({
10534
10595
  }
10535
10596
  setScrollTop(yHandleEl, scrollTop)
10536
10597
  setScrollTop(rowExpandEl, scrollTop)
10598
+ syncGanttScrollTop(scrollTop)
10537
10599
  if (scrollYLoad) {
10538
10600
  $xeTable.triggerScrollYEvent(evnt)
10539
10601
  }
@@ -10727,6 +10789,7 @@ export default defineVxeComponent({
10727
10789
  setScrollTop(leftScrollElem, currTopNum)
10728
10790
  setScrollTop(rightScrollElem, currTopNum)
10729
10791
  setScrollTop(rowExpandEl, currTopNum)
10792
+ syncGanttScrollTop(currTopNum)
10730
10793
  if (scrollYLoad) {
10731
10794
  $xeTable.triggerScrollYEvent(evnt)
10732
10795
  }
@@ -10743,6 +10806,7 @@ export default defineVxeComponent({
10743
10806
  setScrollTop(leftScrollElem, currTopNum)
10744
10807
  setScrollTop(rightScrollElem, currTopNum)
10745
10808
  setScrollTop(rowExpandEl, currTopNum)
10809
+ syncGanttScrollTop(currTopNum)
10746
10810
  if (scrollYLoad) {
10747
10811
  $xeTable.triggerScrollYEvent(evnt)
10748
10812
  }
@@ -10817,6 +10881,7 @@ export default defineVxeComponent({
10817
10881
  setScrollTop(leftScrollElem, scrollTop)
10818
10882
  setScrollTop(rightScrollElem, scrollTop)
10819
10883
  setScrollTop(rowExpandEl, scrollTop)
10884
+ syncGanttScrollTop(scrollTop)
10820
10885
  if (scrollYLoad) {
10821
10886
  $xeTable.triggerScrollYEvent(evnt)
10822
10887
  }
@@ -10856,6 +10921,7 @@ export default defineVxeComponent({
10856
10921
  updateScrollXSpace () {
10857
10922
  const { scrollXLoad, overflowX, scrollXWidth } = reactData
10858
10923
  const { visibleColumn, scrollXStore, elemStore, fullColumnIdData } = internalData
10924
+ const $xeGanttView = internalData.xeGanttView
10859
10925
  const mouseOpts = computeMouseOpts.value
10860
10926
  const tableBody = refTableBody.value
10861
10927
  const tableBodyElem = tableBody ? tableBody.$el as HTMLDivElement : null
@@ -10924,10 +10990,13 @@ export default defineVxeComponent({
10924
10990
  scrollXSpaceEl.style.width = `${ySpaceWidth}px`
10925
10991
  }
10926
10992
 
10993
+ calcScrollbar()
10927
10994
  if (isScrollXBig && mouseOpts.area) {
10928
10995
  errLog('vxe.error.notProp', ['mouse-config.area'])
10929
10996
  }
10930
- calcScrollbar()
10997
+ if ($xeGanttView) {
10998
+ $xeGanttView.updateScrollXSpace()
10999
+ }
10931
11000
  return nextTick().then(() => {
10932
11001
  updateStyle()
10933
11002
  })
@@ -10937,6 +11006,7 @@ export default defineVxeComponent({
10937
11006
  updateScrollYSpace () {
10938
11007
  const { isAllOverflow, overflowY, scrollYLoad, expandColumn } = reactData
10939
11008
  const { scrollYStore, elemStore, isResizeCellHeight, afterFullData, fullAllDataRowIdData, rowExpandedMaps } = internalData
11009
+ const $xeGanttView = internalData.xeGanttView
10940
11010
  const { startIndex } = scrollYStore
10941
11011
  const mouseOpts = computeMouseOpts.value
10942
11012
  const expandOpts = computeExpandOpts.value
@@ -11034,10 +11104,13 @@ export default defineVxeComponent({
11034
11104
  reactData.scrollYHeight = scrollYHeight
11035
11105
  reactData.isScrollYBig = isScrollYBig
11036
11106
 
11107
+ calcScrollbar()
11037
11108
  if (isScrollYBig && mouseOpts.area) {
11038
11109
  errLog('vxe.error.notProp', ['mouse-config.area'])
11039
11110
  }
11040
- calcScrollbar()
11111
+ if ($xeGanttView) {
11112
+ $xeGanttView.updateScrollYSpace()
11113
+ }
11041
11114
  return nextTick().then(() => {
11042
11115
  updateStyle()
11043
11116
  })
@@ -11140,6 +11213,13 @@ export default defineVxeComponent({
11140
11213
  return getRowid($xeTable, row1) === getRowid($xeTable, row2)
11141
11214
  }
11142
11215
  return false
11216
+ },
11217
+ handleConnectGanttView ($ganttView) {
11218
+ if ($ganttView && $ganttView.connectUpdate) {
11219
+ $ganttView.connectUpdate({ $table: $xeTable })
11220
+ internalData.xeGanttView = $ganttView as any
11221
+ }
11222
+ return nextTick()
11143
11223
  }
11144
11224
  }
11145
11225
 
@@ -36,10 +36,6 @@ export function createInternalData (): TableInternalData {
36
36
  tableWidth: 0,
37
37
  // 表格高度
38
38
  tableHeight: 0,
39
- // 表头高度
40
- headerHeight: 0,
41
- // 表尾高度
42
- footerHeight: 0,
43
39
  customHeight: 0,
44
40
  customMinHeight: 0,
45
41
  customMaxHeight: 0,
@@ -310,7 +310,7 @@ export default defineVxeComponent({
310
310
  $xeGrid.triggerToolbarBtnEvent(item, $event)
311
311
  } else {
312
312
  const gCommandOpts = commands.get(code)
313
- const params = { code, button: item, $table: $table!, $grid: $xeGrid, $event }
313
+ const params = { code, button: item, $table: $table as VxeTableConstructor, $grid: $xeGrid, $gantt: null, $event }
314
314
  if (gCommandOpts) {
315
315
  const tCommandMethod = gCommandOpts.tableCommandMethod || gCommandOpts.commandMethod
316
316
  if (tCommandMethod) {
@@ -336,7 +336,7 @@ export default defineVxeComponent({
336
336
  $xeGrid.triggerToolbarTolEvent(item, $event)
337
337
  } else {
338
338
  const gCommandOpts = commands.get(code)
339
- const params = { code, button: null, tool: item, $table: $table!, $grid: $xeGrid, $event }
339
+ const params = { code, button: null, tool: item, $table: $table as VxeTableConstructor, $grid: $xeGrid, $gantt: null, $event }
340
340
  if (gCommandOpts) {
341
341
  const tCommandMethod = gCommandOpts.tableCommandMethod || gCommandOpts.commandMethod
342
342
  if (tCommandMethod) {
@@ -239,7 +239,15 @@ VxeUI.setConfig({
239
239
  },
240
240
  scrollbarConfig: {
241
241
  // width: 14,
242
- // height: 14
242
+ // height: 14,
243
+ x: {
244
+ // position: 'bottom',
245
+ visible: true
246
+ },
247
+ y: {
248
+ // position: 'right',
249
+ visible: true
250
+ }
243
251
  }
244
252
  },
245
253
  // export: {
@@ -292,7 +300,9 @@ VxeUI.setConfig({
292
300
  // types: ['csv', 'html', 'xml', 'txt']
293
301
  // },
294
302
  // buttons: []
295
- }
303
+ },
304
+
305
+ gantt: {}
296
306
  })
297
307
 
298
308
  const iconPrefix = 'vxe-table-icon-'
@@ -100,7 +100,7 @@ export function getDomNode () {
100
100
  }
101
101
  }
102
102
 
103
- export function getOffsetHeight (elem: HTMLElement) {
103
+ export function getOffsetHeight (elem?: HTMLElement) {
104
104
  return elem ? elem.offsetHeight : 0
105
105
  }
106
106