vxe-table 4.23.19 → 4.23.20

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