vxe-table 3.14.0-beta.3 → 3.14.0-beta.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/grid/src/grid.js +79 -50
- package/es/locale/lang/ar-EG.js +7 -1
- package/es/locale/lang/de-DE.js +7 -1
- package/es/locale/lang/en-US.js +7 -1
- package/es/locale/lang/es-ES.js +7 -1
- package/es/locale/lang/fr-FR.js +7 -1
- package/es/locale/lang/hu-HU.js +7 -1
- package/es/locale/lang/hy-AM.js +7 -1
- package/es/locale/lang/id-ID.js +7 -1
- package/es/locale/lang/it-IT.js +7 -1
- package/es/locale/lang/ja-JP.js +7 -1
- package/es/locale/lang/ko-KR.js +7 -1
- package/es/locale/lang/nb-NO.js +7 -1
- package/es/locale/lang/pt-BR.js +7 -1
- package/es/locale/lang/ru-RU.js +7 -1
- package/es/locale/lang/th-TH.js +7 -1
- package/es/locale/lang/ug-CN.js +7 -1
- package/es/locale/lang/uk-UA.js +7 -1
- package/es/locale/lang/vi-VN.js +7 -1
- package/es/locale/lang/zh-CHT.js +7 -1
- package/es/locale/lang/zh-CN.js +7 -1
- package/es/style.css +1 -1
- package/es/table/module/custom/mixin.js +4 -2
- package/es/table/module/custom/panel.js +24 -23
- package/es/table/module/edit/mixin.js +17 -11
- package/es/table/module/export/export-panel.js +5 -4
- package/es/table/module/export/import-panel.js +8 -7
- package/es/table/module/export/mixin.js +30 -27
- package/es/table/module/filter/panel.js +21 -10
- package/es/table/module/keyboard/mixin.js +141 -41
- package/es/table/module/menu/mixin.js +6 -3
- package/es/table/module/menu/panel.js +7 -7
- package/es/table/module/validator/mixin.js +2 -2
- package/es/table/render/index.js +14 -5
- package/es/table/src/body.js +50 -26
- package/es/table/src/cell.js +27 -22
- package/es/table/src/column.js +11 -9
- package/es/table/src/columnInfo.js +6 -6
- package/es/table/src/footer.js +19 -9
- package/es/table/src/group.js +6 -5
- package/es/table/src/header.js +15 -9
- package/es/table/src/methods.js +1008 -789
- package/es/table/src/props.js +4 -0
- package/es/table/src/table.js +85 -49
- package/es/table/src/util.js +84 -19
- package/es/toolbar/src/toolbar.js +3 -3
- package/es/ui/index.js +2 -1
- package/es/ui/src/log.js +1 -1
- package/helper/vetur/attributes.json +1 -1
- package/helper/vetur/tags.json +1 -1
- package/lib/grid/src/grid.js +86 -67
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.umd.js +1907 -1344
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/ar-EG.js +7 -1
- package/lib/locale/lang/ar-EG.min.js +1 -1
- package/lib/locale/lang/de-DE.js +7 -1
- package/lib/locale/lang/de-DE.min.js +1 -1
- package/lib/locale/lang/en-US.js +7 -1
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +7 -1
- package/lib/locale/lang/es-ES.js +7 -1
- package/lib/locale/lang/es-ES.min.js +1 -1
- package/lib/locale/lang/es-ES.umd.js +7 -1
- package/lib/locale/lang/fr-FR.js +7 -1
- package/lib/locale/lang/fr-FR.min.js +1 -1
- package/lib/locale/lang/hu-HU.js +7 -1
- package/lib/locale/lang/hu-HU.min.js +1 -1
- package/lib/locale/lang/hu-HU.umd.js +7 -1
- package/lib/locale/lang/hy-AM.js +7 -1
- package/lib/locale/lang/hy-AM.min.js +1 -1
- package/lib/locale/lang/id-ID.js +7 -1
- package/lib/locale/lang/id-ID.min.js +1 -1
- package/lib/locale/lang/it-IT.js +7 -1
- package/lib/locale/lang/it-IT.min.js +1 -1
- package/lib/locale/lang/ja-JP.js +7 -1
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +7 -1
- package/lib/locale/lang/ko-KR.js +7 -1
- package/lib/locale/lang/ko-KR.min.js +1 -1
- package/lib/locale/lang/ko-KR.umd.js +7 -1
- package/lib/locale/lang/nb-NO.js +7 -1
- package/lib/locale/lang/nb-NO.min.js +1 -1
- package/lib/locale/lang/pt-BR.js +7 -1
- package/lib/locale/lang/pt-BR.min.js +1 -1
- package/lib/locale/lang/pt-BR.umd.js +7 -1
- package/lib/locale/lang/ru-RU.js +7 -1
- package/lib/locale/lang/ru-RU.min.js +1 -1
- package/lib/locale/lang/ru-RU.umd.js +7 -1
- package/lib/locale/lang/th-TH.js +7 -1
- package/lib/locale/lang/th-TH.min.js +1 -1
- package/lib/locale/lang/ug-CN.js +7 -1
- package/lib/locale/lang/ug-CN.min.js +1 -1
- package/lib/locale/lang/uk-UA.js +7 -1
- package/lib/locale/lang/uk-UA.min.js +1 -1
- package/lib/locale/lang/uk-UA.umd.js +7 -1
- package/lib/locale/lang/vi-VN.js +7 -1
- package/lib/locale/lang/vi-VN.min.js +1 -1
- package/lib/locale/lang/zh-CHT.js +7 -1
- package/lib/locale/lang/zh-CHT.min.js +1 -1
- package/lib/locale/lang/zh-CHT.umd.js +7 -1
- package/lib/locale/lang/zh-CN.js +7 -1
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +7 -1
- package/lib/style.css +1 -1
- package/lib/table/module/custom/mixin.js +5 -3
- package/lib/table/module/custom/mixin.min.js +1 -1
- package/lib/table/module/custom/panel.js +22 -29
- package/lib/table/module/custom/panel.min.js +1 -1
- package/lib/table/module/edit/mixin.js +19 -13
- package/lib/table/module/edit/mixin.min.js +1 -1
- package/lib/table/module/export/export-panel.js +5 -4
- package/lib/table/module/export/export-panel.min.js +1 -1
- package/lib/table/module/export/import-panel.js +8 -7
- package/lib/table/module/export/import-panel.min.js +1 -1
- package/lib/table/module/export/mixin.js +35 -34
- package/lib/table/module/export/mixin.min.js +1 -1
- package/lib/table/module/filter/panel.js +16 -16
- package/lib/table/module/filter/panel.min.js +1 -1
- package/lib/table/module/keyboard/mixin.js +149 -47
- package/lib/table/module/keyboard/mixin.min.js +1 -1
- package/lib/table/module/menu/mixin.js +6 -3
- package/lib/table/module/menu/mixin.min.js +1 -1
- package/lib/table/module/menu/panel.js +7 -7
- package/lib/table/module/menu/panel.min.js +1 -1
- package/lib/table/module/validator/mixin.js +3 -3
- package/lib/table/module/validator/mixin.min.js +1 -1
- package/lib/table/render/index.js +18 -5
- package/lib/table/render/index.min.js +1 -1
- package/lib/table/src/body.js +57 -25
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/cell.js +39 -23
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/column.js +11 -9
- package/lib/table/src/column.min.js +1 -1
- package/lib/table/src/columnInfo.js +6 -6
- package/lib/table/src/columnInfo.min.js +1 -1
- package/lib/table/src/footer.js +19 -7
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/group.js +6 -5
- package/lib/table/src/group.min.js +1 -1
- package/lib/table/src/header.js +16 -8
- package/lib/table/src/header.min.js +1 -1
- package/lib/table/src/methods.js +1166 -919
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/props.js +4 -0
- package/lib/table/src/props.min.js +1 -1
- package/lib/table/src/table.js +93 -52
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +96 -20
- package/lib/table/src/util.min.js +1 -1
- package/lib/toolbar/src/toolbar.js +3 -3
- package/lib/ui/index.js +2 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/package.json +2 -2
- package/packages/grid/src/grid.ts +93 -59
- package/packages/locale/lang/ar-EG.ts +7 -1
- package/packages/locale/lang/de-DE.ts +7 -1
- package/packages/locale/lang/en-US.ts +7 -1
- package/packages/locale/lang/es-ES.ts +7 -1
- package/packages/locale/lang/fr-FR.ts +7 -1
- package/packages/locale/lang/hu-HU.ts +7 -1
- package/packages/locale/lang/hy-AM.ts +7 -1
- package/packages/locale/lang/id-ID.ts +7 -1
- package/packages/locale/lang/it-IT.ts +7 -1
- package/packages/locale/lang/ja-JP.ts +7 -1
- package/packages/locale/lang/ko-KR.ts +7 -1
- package/packages/locale/lang/nb-NO.ts +7 -1
- package/packages/locale/lang/pt-BR.ts +7 -1
- package/packages/locale/lang/ru-RU.ts +7 -1
- package/packages/locale/lang/th-TH.ts +7 -1
- package/packages/locale/lang/ug-CN.ts +7 -1
- package/packages/locale/lang/uk-UA.ts +7 -1
- package/packages/locale/lang/vi-VN.ts +7 -1
- package/packages/locale/lang/zh-CHT.ts +7 -1
- package/packages/locale/lang/zh-CN.ts +7 -1
- package/packages/table/module/custom/mixin.ts +6 -3
- package/packages/table/module/custom/panel.ts +42 -37
- package/packages/table/module/edit/mixin.ts +20 -14
- package/packages/table/module/export/export-panel.ts +8 -5
- package/packages/table/module/export/import-panel.ts +11 -7
- package/packages/table/module/export/mixin.ts +37 -32
- package/packages/table/module/filter/panel.ts +25 -10
- package/packages/table/module/keyboard/mixin.ts +155 -49
- package/packages/table/module/menu/mixin.ts +12 -6
- package/packages/table/module/menu/panel.ts +10 -7
- package/packages/table/module/validator/mixin.ts +2 -2
- package/packages/table/render/index.ts +14 -5
- package/packages/table/src/body.ts +49 -25
- package/packages/table/src/cell.ts +27 -22
- package/packages/table/src/column.ts +14 -10
- package/packages/table/src/columnInfo.ts +9 -6
- package/packages/table/src/footer.ts +19 -9
- package/packages/table/src/group.ts +9 -5
- package/packages/table/src/header.ts +16 -9
- package/packages/table/src/methods.ts +1110 -830
- package/packages/table/src/props.ts +16 -12
- package/packages/table/src/table.ts +99 -52
- package/packages/table/src/util.ts +95 -19
- package/packages/toolbar/src/toolbar.ts +3 -3
- package/packages/ui/index.ts +1 -0
- /package/es/{iconfont.1741160631070.ttf → iconfont.1742890796110.ttf} +0 -0
- /package/es/{iconfont.1741160631070.woff → iconfont.1742890796110.woff} +0 -0
- /package/es/{iconfont.1741160631070.woff2 → iconfont.1742890796110.woff2} +0 -0
- /package/lib/{iconfont.1741160631070.ttf → iconfont.1742890796110.ttf} +0 -0
- /package/lib/{iconfont.1741160631070.woff → iconfont.1742890796110.woff} +0 -0
- /package/lib/{iconfont.1741160631070.woff2 → iconfont.1742890796110.woff2} +0 -0
|
@@ -2,7 +2,7 @@ import { PropType, CreateElement } from 'vue'
|
|
|
2
2
|
import XEUtils from 'xe-utils'
|
|
3
3
|
import { VxeUI } from '../../ui'
|
|
4
4
|
import { isEnableConf, getClass } from '../../ui/src/utils'
|
|
5
|
-
import { getOffsetSize, calcTreeLine, mergeBodyMethod, getRowid } from './util'
|
|
5
|
+
import { getOffsetSize, calcTreeLine, mergeBodyMethod, getRowid, createHandleGetRowId } from './util'
|
|
6
6
|
import { updateCellTitle } from '../../ui/src/dom'
|
|
7
7
|
import { getSlotVNs } from '../../ui/src/vn'
|
|
8
8
|
|
|
@@ -22,7 +22,7 @@ const isVMScrollProcess = ($xeTable: VxeTableConstructor & VxeTablePrivateMethod
|
|
|
22
22
|
return !!(isDragResize || (lastScrollTime && Date.now() < lastScrollTime + (delayHover as number)))
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
function renderLine (h: CreateElement, _vm: any, params: VxeTableDefines.CellRenderBodyParams, cellHeight: number) {
|
|
25
|
+
function renderLine (h: CreateElement, _vm: any, rowid: string, params: VxeTableDefines.CellRenderBodyParams, cellHeight: number) {
|
|
26
26
|
const $xeTable = _vm.$parent as VxeTableConstructor & VxeTablePrivateMethods
|
|
27
27
|
const tableProps = $xeTable
|
|
28
28
|
const tableInternalData = $xeTable as unknown as TableInternalData
|
|
@@ -36,7 +36,6 @@ function renderLine (h: CreateElement, _vm: any, params: VxeTableDefines.CellRen
|
|
|
36
36
|
if (slots && (slots as any).line) {
|
|
37
37
|
return $xeTable.callSlot((slots as any).line, params, h)
|
|
38
38
|
}
|
|
39
|
-
const rowid = getRowid($xeTable, row)
|
|
40
39
|
const rest = fullAllDataRowIdData[rowid]
|
|
41
40
|
let rLevel = 0
|
|
42
41
|
let prevRow = null
|
|
@@ -89,10 +88,11 @@ function renderTdColumn (
|
|
|
89
88
|
const tableProps = $xeTable
|
|
90
89
|
const tableReactData = $xeTable as unknown as TableReactData
|
|
91
90
|
const tableInternalData = $xeTable as unknown as TableInternalData
|
|
91
|
+
const $xeGrid = $xeTable.$xeGrid
|
|
92
92
|
|
|
93
|
-
const { fullAllDataRowIdData } = tableInternalData
|
|
93
|
+
const { fullAllDataRowIdData, fullColumnIdData, visibleColumn } = tableInternalData
|
|
94
94
|
const { columnKey, resizable: allResizable, showOverflow: allShowOverflow, border, height, cellClassName: allCellClassName, cellStyle, align: allAlign, spanMethod, mouseConfig, editConfig, editRules, tooltipConfig, padding: allPadding } = tableProps
|
|
95
|
-
const { tableData, dragRow, overflowX, currentColumn, scrollXLoad, scrollYLoad, calcCellHeightFlag, resizeHeightFlag, mergeList, editStore, isAllOverflow, validErrorMaps } = tableReactData
|
|
95
|
+
const { tableData, dragRow, overflowX, currentColumn, scrollXLoad, scrollYLoad, calcCellHeightFlag, resizeHeightFlag, resizeWidthFlag, mergeList, editStore, isAllOverflow, validErrorMaps } = tableReactData
|
|
96
96
|
const { afterFullData, scrollXStore, scrollYStore } = tableInternalData
|
|
97
97
|
const cellOpts = $xeTable.computeCellOpts
|
|
98
98
|
const validOpts = $xeTable.computeValidOpts
|
|
@@ -108,19 +108,21 @@ function renderTdColumn (
|
|
|
108
108
|
const columnOpts = $xeTable.computeColumnOpts
|
|
109
109
|
const mouseOpts = $xeTable.computeMouseOpts
|
|
110
110
|
const areaOpts = $xeTable.computeAreaOpts
|
|
111
|
+
const cellOffsetWidth = $xeTable.computeCellOffsetWidth
|
|
111
112
|
const { selectCellToRow } = areaOpts
|
|
112
113
|
const { type, cellRender, editRender, align, showOverflow, className, treeNode, rowResize, padding, verticalAlign, slots } = column
|
|
113
114
|
const { verticalAlign: allVerticalAlign } = cellOpts
|
|
114
115
|
const { actived } = editStore
|
|
115
|
-
const rowRest = fullAllDataRowIdData[rowid]
|
|
116
|
+
const rowRest = fullAllDataRowIdData[rowid] || {}
|
|
116
117
|
const colid = column.id
|
|
118
|
+
const colRest = fullColumnIdData[colid] || {}
|
|
117
119
|
const renderOpts = editRender || cellRender
|
|
118
120
|
const compConf = renderOpts ? renderer.get(renderOpts.name) : null
|
|
119
121
|
const compCellClassName = compConf ? (compConf.tableCellClassName || compConf.cellClassName) : null
|
|
120
122
|
const compCellStyle = compConf ? (compConf.tableCellStyle || compConf.cellStyle) : ''
|
|
121
123
|
const showAllTip = tooltipOpts.showAll
|
|
122
|
-
const columnIndex =
|
|
123
|
-
const _columnIndex =
|
|
124
|
+
const columnIndex = colRest.index
|
|
125
|
+
const _columnIndex = colRest._index
|
|
124
126
|
const isEdit = isEnableConf(editRender)
|
|
125
127
|
const resizeHeight = resizeHeightFlag ? rowRest.resizeHeight : 0
|
|
126
128
|
let fixedHiddenColumn = fixedType ? column.fixed !== fixedType : column.fixed && overflowX
|
|
@@ -144,7 +146,7 @@ function renderTdColumn (
|
|
|
144
146
|
$table: VxeTableConstructor<any> & VxeTablePrivateMethods
|
|
145
147
|
} = {
|
|
146
148
|
$table: $xeTable,
|
|
147
|
-
$grid: $
|
|
149
|
+
$grid: $xeGrid,
|
|
148
150
|
isEdit: false,
|
|
149
151
|
seq,
|
|
150
152
|
rowid,
|
|
@@ -217,6 +219,7 @@ function renderTdColumn (
|
|
|
217
219
|
tdOns.dblclick = (evnt: MouseEvent) => {
|
|
218
220
|
$xeTable.triggerCellDblclickEvent(evnt, cellParams)
|
|
219
221
|
}
|
|
222
|
+
let isMergeCell = false
|
|
220
223
|
// 合并行或列
|
|
221
224
|
if (mergeList.length) {
|
|
222
225
|
const spanRest = mergeBodyMethod(mergeList, _rowIndex, _columnIndex)
|
|
@@ -226,9 +229,11 @@ function renderTdColumn (
|
|
|
226
229
|
return null
|
|
227
230
|
}
|
|
228
231
|
if (rowspan > 1) {
|
|
232
|
+
isMergeCell = true
|
|
229
233
|
tdAttrs.rowspan = rowspan
|
|
230
234
|
}
|
|
231
235
|
if (colspan > 1) {
|
|
236
|
+
isMergeCell = true
|
|
232
237
|
tdAttrs.colspan = colspan
|
|
233
238
|
}
|
|
234
239
|
}
|
|
@@ -263,15 +268,29 @@ function renderTdColumn (
|
|
|
263
268
|
const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto')
|
|
264
269
|
|
|
265
270
|
let isVNPreEmptyStatus = false
|
|
266
|
-
if (!
|
|
267
|
-
if (
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
+
if (!isMergeCell) {
|
|
272
|
+
if (!dragRow || getRowid($xeTable, dragRow) !== rowid) {
|
|
273
|
+
if (scrollYLoad && (_rowIndex < scrollYStore.visibleStartIndex - scrollYStore.preloadSize || _rowIndex > scrollYStore.visibleEndIndex + scrollYStore.preloadSize)) {
|
|
274
|
+
isVNPreEmptyStatus = true
|
|
275
|
+
} else if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
|
|
276
|
+
isVNPreEmptyStatus = true
|
|
277
|
+
}
|
|
271
278
|
}
|
|
272
279
|
}
|
|
273
280
|
|
|
274
281
|
const tcStyle: Record<string, string> = {}
|
|
282
|
+
if (hasEllipsis && resizeWidthFlag) {
|
|
283
|
+
let tsColspan = tdAttrs.colspan || 0
|
|
284
|
+
if (tsColspan > 1) {
|
|
285
|
+
for (let index = 1; index < tsColspan; index++) {
|
|
286
|
+
const nextColumn = visibleColumn[columnIndex + index]
|
|
287
|
+
if (nextColumn) {
|
|
288
|
+
tsColspan += nextColumn.renderWidth
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
tcStyle.width = `${column.renderWidth - (cellOffsetWidth * tsColspan)}px`
|
|
293
|
+
}
|
|
275
294
|
if (scrollYLoad || hasEllipsis || isCsHeight || isRsHeight) {
|
|
276
295
|
tcStyle.height = `${cellHeight}px`
|
|
277
296
|
} else {
|
|
@@ -294,7 +313,7 @@ function renderTdColumn (
|
|
|
294
313
|
} else {
|
|
295
314
|
// 渲染单元格
|
|
296
315
|
tdVNs.push(
|
|
297
|
-
...renderLine(h, _vm, cellParams, cellHeight),
|
|
316
|
+
...renderLine(h, _vm, rowid, cellParams, cellHeight),
|
|
298
317
|
h('div', {
|
|
299
318
|
key: 'tc',
|
|
300
319
|
class: ['vxe-cell', {
|
|
@@ -431,8 +450,8 @@ function renderRows (h: CreateElement, _vm: any, fixedType: 'left' | 'right' | '
|
|
|
431
450
|
const tableInternalData = $xeTable as unknown as TableInternalData
|
|
432
451
|
|
|
433
452
|
const { stripe, rowKey, highlightHoverRow, rowClassName, rowStyle, editConfig, treeConfig } = tableProps
|
|
434
|
-
const { hasFixedColumn,
|
|
435
|
-
const { fullAllDataRowIdData } = tableInternalData
|
|
453
|
+
const { hasFixedColumn, treeExpandedFlag, isColLoading, scrollXLoad, scrollYLoad, isAllOverflow, rowExpandedFlag, expandColumn, selectRadioRow, pendingRowFlag, isDragColMove, rowExpandHeightFlag } = tableReactData
|
|
454
|
+
const { fullAllDataRowIdData, treeExpandedMaps, pendingRowMaps, rowExpandedMaps } = tableInternalData
|
|
436
455
|
const checkboxOpts = $xeTable.computeCheckboxOpts
|
|
437
456
|
const radioOpts = $xeTable.computeRadioOpts
|
|
438
457
|
const treeOpts = $xeTable.computeTreeOpts
|
|
@@ -443,6 +462,7 @@ function renderRows (h: CreateElement, _vm: any, fixedType: 'left' | 'right' | '
|
|
|
443
462
|
const { transform, seqMode } = treeOpts
|
|
444
463
|
const childrenField = treeOpts.children || treeOpts.childrenField
|
|
445
464
|
const rows: any[] = []
|
|
465
|
+
const { handleGetRowId } = createHandleGetRowId($xeTable)
|
|
446
466
|
tableData.forEach((row, $rowIndex) => {
|
|
447
467
|
const trOn: Record<string, any> = {}
|
|
448
468
|
let rowIndex = $rowIndex
|
|
@@ -463,8 +483,8 @@ function renderRows (h: CreateElement, _vm: any, fixedType: 'left' | 'right' | '
|
|
|
463
483
|
$xeTable.clearHoverRow()
|
|
464
484
|
}
|
|
465
485
|
}
|
|
466
|
-
const rowid =
|
|
467
|
-
const rowRest = fullAllDataRowIdData[rowid]
|
|
486
|
+
const rowid = handleGetRowId(row)
|
|
487
|
+
const rowRest = fullAllDataRowIdData[rowid] || {}
|
|
468
488
|
let rowLevel = 0
|
|
469
489
|
let seq: string | number = -1
|
|
470
490
|
let _rowIndex = 0
|
|
@@ -479,7 +499,7 @@ function renderRows (h: CreateElement, _vm: any, fixedType: 'left' | 'right' | '
|
|
|
479
499
|
}
|
|
480
500
|
const params = { $table: $xeTable, seq, rowid, fixed: fixedType, type: renderType, level: rowLevel, row, rowIndex, $rowIndex, _rowIndex }
|
|
481
501
|
// 行是否被展开
|
|
482
|
-
const isExpandRow = expandColumn && !!rowExpandedMaps[rowid]
|
|
502
|
+
const isExpandRow = expandColumn && !!rowExpandedFlag && !!rowExpandedMaps[rowid]
|
|
483
503
|
// 树节点是否被展开
|
|
484
504
|
let isExpandTree = false
|
|
485
505
|
let rowChildren = []
|
|
@@ -490,7 +510,7 @@ function renderRows (h: CreateElement, _vm: any, fixedType: 'left' | 'right' | '
|
|
|
490
510
|
}
|
|
491
511
|
if (treeConfig && !scrollYLoad && !transform) {
|
|
492
512
|
rowChildren = row[childrenField]
|
|
493
|
-
isExpandTree = rowChildren && rowChildren.length && !!treeExpandedMaps[rowid]
|
|
513
|
+
isExpandTree = !!treeExpandedFlag && rowChildren && rowChildren.length > 0 && !!treeExpandedMaps[rowid]
|
|
494
514
|
}
|
|
495
515
|
// 拖拽行事件
|
|
496
516
|
if (rowOpts.drag && (!treeConfig || transform)) {
|
|
@@ -509,7 +529,7 @@ function renderRows (h: CreateElement, _vm: any, fixedType: 'left' | 'right' | '
|
|
|
509
529
|
'row--new': isNewRow && (editOpts.showStatus || editOpts.showInsertStatus),
|
|
510
530
|
'row--radio': radioOpts.highlight && selectRadioRow === row,
|
|
511
531
|
'row--checked': checkboxOpts.highlight && $xeTable.isCheckedByCheckboxRow(row),
|
|
512
|
-
'row--pending': !!pendingRowMaps[rowid]
|
|
532
|
+
'row--pending': !!pendingRowFlag && !!pendingRowMaps[rowid]
|
|
513
533
|
},
|
|
514
534
|
rowClassName ? (XEUtils.isFunction(rowClassName) ? rowClassName(params) : rowClassName) : ''
|
|
515
535
|
]
|
|
@@ -665,6 +685,7 @@ export default {
|
|
|
665
685
|
const tableProps = $xeTable
|
|
666
686
|
const tableReactData = $xeTable as unknown as TableReactData
|
|
667
687
|
const tableInternalData = $xeTable as unknown as TableInternalData
|
|
688
|
+
const $xeGrid = $xeTable.$xeGrid
|
|
668
689
|
|
|
669
690
|
const { xID, $scopedSlots } = $xeTable
|
|
670
691
|
const { fixedColumn, fixedType, tableColumn } = props
|
|
@@ -690,7 +711,7 @@ export default {
|
|
|
690
711
|
}
|
|
691
712
|
}
|
|
692
713
|
|
|
693
|
-
if (fixedType || !overflowX) {
|
|
714
|
+
if (!isColLoading && (fixedType || !overflowX)) {
|
|
694
715
|
renderColumnList = visibleColumn
|
|
695
716
|
}
|
|
696
717
|
|
|
@@ -750,7 +771,7 @@ export default {
|
|
|
750
771
|
|
|
751
772
|
let emptyContent
|
|
752
773
|
if ($scopedSlots.empty) {
|
|
753
|
-
emptyContent = $scopedSlots.empty.call(this, { $table: $xeTable, $grid: $
|
|
774
|
+
emptyContent = $scopedSlots.empty.call(this, { $table: $xeTable, $grid: $xeGrid })
|
|
754
775
|
} else {
|
|
755
776
|
const compConf = emptyOpts.name ? renderer.get(emptyOpts.name) : null
|
|
756
777
|
const rtEmptyView = compConf ? (compConf.renderTableEmpty || compConf.renderTableEmptyView || compConf.renderEmpty) : null
|
|
@@ -809,7 +830,10 @@ export default {
|
|
|
809
830
|
attrs: {
|
|
810
831
|
name: column.id
|
|
811
832
|
},
|
|
812
|
-
key: $columnIndex
|
|
833
|
+
key: $columnIndex,
|
|
834
|
+
style: {
|
|
835
|
+
width: `${column.renderWidth}px`
|
|
836
|
+
}
|
|
813
837
|
})
|
|
814
838
|
})),
|
|
815
839
|
/**
|
|
@@ -323,7 +323,7 @@ function renderFooterHandle (h: CreateElement, params: VxeTableDefines.CellRende
|
|
|
323
323
|
}
|
|
324
324
|
|
|
325
325
|
export const Cell = {
|
|
326
|
-
createColumn ($
|
|
326
|
+
createColumn ($xeTable: VxeTableConstructor & VxeTablePrivateMethods, _vm: any) {
|
|
327
327
|
const { type } = _vm
|
|
328
328
|
const renConfs: any = {
|
|
329
329
|
renderHeader: renderHeaderHandle,
|
|
@@ -333,7 +333,7 @@ export const Cell = {
|
|
|
333
333
|
if (type === 'expand') {
|
|
334
334
|
renConfs.renderData = Cell.renderExpandData
|
|
335
335
|
}
|
|
336
|
-
return createColumn($
|
|
336
|
+
return createColumn($xeTable, _vm, renConfs)
|
|
337
337
|
},
|
|
338
338
|
/**
|
|
339
339
|
* 列头标题
|
|
@@ -402,8 +402,8 @@ export const Cell = {
|
|
|
402
402
|
const { $table, isHidden } = params
|
|
403
403
|
const tableReactData = $table as unknown as TableReactData
|
|
404
404
|
const tableInternalData = $table as unknown as TableInternalData
|
|
405
|
-
const {
|
|
406
|
-
const { fullAllDataRowIdData } = tableInternalData
|
|
405
|
+
const { treeExpandedFlag } = tableReactData
|
|
406
|
+
const { fullAllDataRowIdData, treeExpandedMaps, treeExpandLazyLoadedMaps } = tableInternalData
|
|
407
407
|
const treeOpts = $table.computeTreeOpts
|
|
408
408
|
const { row, column, level } = params
|
|
409
409
|
const { slots } = column
|
|
@@ -423,7 +423,7 @@ export const Cell = {
|
|
|
423
423
|
}
|
|
424
424
|
if (!isHidden) {
|
|
425
425
|
const rowid = getRowid($table, row)
|
|
426
|
-
isActive = !!treeExpandedMaps[rowid]
|
|
426
|
+
isActive = !!treeExpandedFlag && !!treeExpandedMaps[rowid]
|
|
427
427
|
if (lazy) {
|
|
428
428
|
const rest = fullAllDataRowIdData[rowid]
|
|
429
429
|
isLazyLoading = !!treeExpandLazyLoadedMaps[rowid]
|
|
@@ -580,7 +580,8 @@ export const Cell = {
|
|
|
580
580
|
const headerSlot = slots ? slots.header : null
|
|
581
581
|
const titleSlot = slots ? slots.title : null
|
|
582
582
|
const checkboxOpts = $table.computeCheckboxOpts
|
|
583
|
-
const headerTitle =
|
|
583
|
+
const { checkStrictly, showHeader, headerTitle } = checkboxOpts
|
|
584
|
+
const colTitle = column.getTitle()
|
|
584
585
|
const ons: Record<string, any> = {}
|
|
585
586
|
if (!isHidden) {
|
|
586
587
|
ons.click = (evnt: any) => {
|
|
@@ -593,11 +594,11 @@ export const Cell = {
|
|
|
593
594
|
if (headerSlot) {
|
|
594
595
|
return renderHeaderCellBaseVNs(h, params, renderTitleContent(h, checkboxParams, $table.callSlot(headerSlot, checkboxParams, h)))
|
|
595
596
|
}
|
|
596
|
-
if (
|
|
597
|
+
if (checkStrictly ? !showHeader : showHeader === false) {
|
|
597
598
|
return renderHeaderCellBaseVNs(h, params, renderTitleContent(h, checkboxParams, [
|
|
598
599
|
h('span', {
|
|
599
600
|
class: 'vxe-checkbox--label'
|
|
600
|
-
}, titleSlot ? $table.callSlot(titleSlot, checkboxParams, h) :
|
|
601
|
+
}, titleSlot ? $table.callSlot(titleSlot, checkboxParams, h) : colTitle)
|
|
601
602
|
]))
|
|
602
603
|
}
|
|
603
604
|
return renderHeaderCellBaseVNs(h, params,
|
|
@@ -609,18 +610,18 @@ export const Cell = {
|
|
|
609
610
|
'is--indeterminate': isAllCheckboxIndeterminate
|
|
610
611
|
}],
|
|
611
612
|
attrs: {
|
|
612
|
-
title: getI18n('vxe.table.allTitle')
|
|
613
|
+
title: XEUtils.eqNull(headerTitle) ? getI18n('vxe.table.allTitle') : `${headerTitle || ''}`
|
|
613
614
|
},
|
|
614
615
|
on: ons
|
|
615
616
|
}, [
|
|
616
617
|
h('span', {
|
|
617
618
|
class: ['vxe-checkbox--icon', isAllCheckboxIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : (isAllCheckboxSelected ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED)]
|
|
618
619
|
})
|
|
619
|
-
].concat(titleSlot ||
|
|
620
|
+
].concat(titleSlot || colTitle
|
|
620
621
|
? [
|
|
621
622
|
h('span', {
|
|
622
623
|
class: 'vxe-checkbox--label'
|
|
623
|
-
}, titleSlot ? $table.callSlot(titleSlot, checkboxParams, h) :
|
|
624
|
+
}, titleSlot ? $table.callSlot(titleSlot, checkboxParams, h) : colTitle)
|
|
624
625
|
]
|
|
625
626
|
: []))
|
|
626
627
|
])
|
|
@@ -630,8 +631,10 @@ export const Cell = {
|
|
|
630
631
|
const { $table, row, column, isHidden } = params
|
|
631
632
|
const tableProps = $table
|
|
632
633
|
const tableReactData = $table as unknown as TableReactData
|
|
634
|
+
const tableInternalData = $table as unknown as TableInternalData
|
|
633
635
|
const { treeConfig } = tableProps
|
|
634
|
-
const {
|
|
636
|
+
const { updateCheckboxFlag } = tableReactData
|
|
637
|
+
const { selectCheckboxMaps, treeIndeterminateRowMaps } = tableInternalData
|
|
635
638
|
const checkboxOpts = $table.computeCheckboxOpts
|
|
636
639
|
const { labelField, checkMethod, visibleMethod } = checkboxOpts
|
|
637
640
|
const { slots } = column
|
|
@@ -644,7 +647,7 @@ export const Cell = {
|
|
|
644
647
|
const ons: Record<string, any> = {}
|
|
645
648
|
if (!isHidden) {
|
|
646
649
|
const rowid = getRowid($table, row)
|
|
647
|
-
isChecked = !!selectCheckboxMaps[rowid]
|
|
650
|
+
isChecked = !!updateCheckboxFlag && !!selectCheckboxMaps[rowid]
|
|
648
651
|
ons.click = (evnt: any) => {
|
|
649
652
|
if (!isDisabled && isVisible) {
|
|
650
653
|
$table.triggerCheckRowEvent(evnt, params, !isChecked)
|
|
@@ -654,7 +657,7 @@ export const Cell = {
|
|
|
654
657
|
isDisabled = !checkMethod({ row })
|
|
655
658
|
}
|
|
656
659
|
if (treeConfig) {
|
|
657
|
-
indeterminate = !!
|
|
660
|
+
indeterminate = !!treeIndeterminateRowMaps[rowid]
|
|
658
661
|
}
|
|
659
662
|
}
|
|
660
663
|
const checkboxParams = { ...params, checked: isChecked, disabled: isDisabled, visible: isVisible, indeterminate }
|
|
@@ -695,8 +698,10 @@ export const Cell = {
|
|
|
695
698
|
const { $table, row, column, isHidden } = params
|
|
696
699
|
const tableProps = $table
|
|
697
700
|
const tableReactData = $table as unknown as TableReactData
|
|
701
|
+
const tableInternalData = $table as unknown as TableInternalData
|
|
698
702
|
const { treeConfig } = tableProps
|
|
699
|
-
const {
|
|
703
|
+
const { updateCheckboxFlag } = tableReactData
|
|
704
|
+
const { treeIndeterminateRowMaps } = tableInternalData
|
|
700
705
|
const checkboxOpts = $table.computeCheckboxOpts
|
|
701
706
|
const { labelField, checkField, checkMethod, visibleMethod } = checkboxOpts
|
|
702
707
|
const indeterminateField = checkboxOpts.indeterminateField || checkboxOpts.halfField
|
|
@@ -710,7 +715,7 @@ export const Cell = {
|
|
|
710
715
|
const ons: Record<string, any> = {}
|
|
711
716
|
if (!isHidden) {
|
|
712
717
|
const rowid = getRowid($table, row)
|
|
713
|
-
isChecked = XEUtils.get(row, checkField)
|
|
718
|
+
isChecked = !!updateCheckboxFlag && XEUtils.get(row, checkField)
|
|
714
719
|
ons.click = (evnt: any) => {
|
|
715
720
|
if (!isDisabled && isVisible) {
|
|
716
721
|
$table.triggerCheckRowEvent(evnt, params, !isChecked)
|
|
@@ -720,7 +725,7 @@ export const Cell = {
|
|
|
720
725
|
isDisabled = !checkMethod({ row })
|
|
721
726
|
}
|
|
722
727
|
if (treeConfig) {
|
|
723
|
-
isIndeterminate = !!
|
|
728
|
+
isIndeterminate = !!treeIndeterminateRowMaps[rowid]
|
|
724
729
|
}
|
|
725
730
|
}
|
|
726
731
|
const checkboxParams = { ...params, checked: isChecked, disabled: isDisabled, visible: isVisible, indeterminate: isIndeterminate }
|
|
@@ -763,8 +768,8 @@ export const Cell = {
|
|
|
763
768
|
*/
|
|
764
769
|
renderExpandCell (h: CreateElement, params: VxeTableDefines.CellRenderBodyParams & { $table: VxeTableConstructor & VxeTablePrivateMethods }) {
|
|
765
770
|
const { $table, isHidden, row, column } = params
|
|
766
|
-
const
|
|
767
|
-
const { rowExpandedMaps, rowExpandLazyLoadedMaps } =
|
|
771
|
+
const tableInternalData = $table as unknown as TableInternalData
|
|
772
|
+
const { rowExpandedMaps, rowExpandLazyLoadedMaps } = tableInternalData
|
|
768
773
|
const expandOpts = $table.computeExpandOpts
|
|
769
774
|
const { lazy, labelField, iconLoaded, showIcon, iconOpen, iconClose, visibleMethod } = expandOpts
|
|
770
775
|
const { slots } = column
|
|
@@ -871,7 +876,7 @@ export const Cell = {
|
|
|
871
876
|
renderSortIcon (h: CreateElement, params: (VxeTableDefines.CellRenderHeaderParams | VxeTableDefines.CellRenderHeaderParams) & { $table: VxeTableConstructor & VxeTablePrivateMethods }) {
|
|
872
877
|
const { $table, column } = params
|
|
873
878
|
const sortOpts = $table.computeSortOpts
|
|
874
|
-
const { showIcon, allowBtn, iconLayout, iconAsc, iconDesc, iconVisibleMethod } = sortOpts
|
|
879
|
+
const { showIcon, allowBtn, ascTitle, descTitle, iconLayout, iconAsc, iconDesc, iconVisibleMethod } = sortOpts
|
|
875
880
|
if (showIcon && (!iconVisibleMethod || iconVisibleMethod(params))) {
|
|
876
881
|
return [
|
|
877
882
|
h('span', {
|
|
@@ -882,7 +887,7 @@ export const Cell = {
|
|
|
882
887
|
'sort--active': column.order === 'asc'
|
|
883
888
|
}],
|
|
884
889
|
attrs: {
|
|
885
|
-
title: getI18n('vxe.table.sortAsc')
|
|
890
|
+
title: XEUtils.eqNull(ascTitle) ? getI18n('vxe.table.sortAsc') : `${ascTitle || ''}`
|
|
886
891
|
},
|
|
887
892
|
on: allowBtn
|
|
888
893
|
? {
|
|
@@ -898,7 +903,7 @@ export const Cell = {
|
|
|
898
903
|
'sort--active': column.order === 'desc'
|
|
899
904
|
}],
|
|
900
905
|
attrs: {
|
|
901
|
-
title: getI18n('vxe.table.sortDesc')
|
|
906
|
+
title: XEUtils.eqNull(descTitle) ? getI18n('vxe.table.sortDesc') : `${descTitle || ''}`
|
|
902
907
|
},
|
|
903
908
|
on: allowBtn
|
|
904
909
|
? {
|
|
@@ -3,7 +3,7 @@ import Cell from './cell'
|
|
|
3
3
|
import { defineVxeComponent } from '../../ui/src/comp'
|
|
4
4
|
import { assembleColumn, destroyColumn } from './util'
|
|
5
5
|
|
|
6
|
-
import type { VxeColumnPropTypes } from '../../../types'
|
|
6
|
+
import type { VxeColumnPropTypes, VxeTableConstructor, VxeTablePrivateMethods } from '../../../types'
|
|
7
7
|
|
|
8
8
|
export const columnProps = {
|
|
9
9
|
// 列唯一主键
|
|
@@ -136,13 +136,15 @@ export const columnProps = {
|
|
|
136
136
|
export const columnWatch: Record<string, any> = {}
|
|
137
137
|
Object.keys(columnProps).forEach(name => {
|
|
138
138
|
columnWatch[name] = function (value: any) {
|
|
139
|
+
const $xeTable = this.$xeTable as VxeTableConstructor & VxeTablePrivateMethods
|
|
140
|
+
|
|
139
141
|
this.columnConfig.update(name, value)
|
|
140
|
-
if (
|
|
142
|
+
if ($xeTable) {
|
|
141
143
|
if (name === 'filters') {
|
|
142
|
-
|
|
143
|
-
|
|
144
|
+
$xeTable.setFilter(this.columnConfig, value)
|
|
145
|
+
$xeTable.handleUpdateDataQueue()
|
|
144
146
|
} else if (['visible', 'fixed', 'width', 'minWidth', 'maxWidth'].includes(name)) {
|
|
145
|
-
|
|
147
|
+
$xeTable.handleRefreshColumnQueue()
|
|
146
148
|
}
|
|
147
149
|
}
|
|
148
150
|
}
|
|
@@ -153,21 +155,23 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
153
155
|
props: columnProps,
|
|
154
156
|
provide () {
|
|
155
157
|
return {
|
|
156
|
-
$
|
|
157
|
-
$
|
|
158
|
+
$xeColumn: this,
|
|
159
|
+
$xeGrid: null
|
|
158
160
|
}
|
|
159
161
|
},
|
|
160
162
|
inject: {
|
|
161
|
-
$
|
|
163
|
+
$xeTable: {
|
|
162
164
|
default: null
|
|
163
165
|
},
|
|
164
|
-
$
|
|
166
|
+
$xeColumn: {
|
|
165
167
|
default: null
|
|
166
168
|
}
|
|
167
169
|
},
|
|
168
170
|
watch: columnWatch,
|
|
169
171
|
created (this: any) {
|
|
170
|
-
|
|
172
|
+
const $xeTable = this.$xeTable as VxeTableConstructor & VxeTablePrivateMethods
|
|
173
|
+
|
|
174
|
+
this.columnConfig = this.createColumn($xeTable, this)
|
|
171
175
|
},
|
|
172
176
|
mounted () {
|
|
173
177
|
this.columnConfig.slots = this.$scopedSlots
|
|
@@ -4,16 +4,19 @@ import { toFilters } from './util'
|
|
|
4
4
|
import { getFuncText } from '../../ui/src/utils'
|
|
5
5
|
import { warnLog, errLog } from '../../ui/src/log'
|
|
6
6
|
|
|
7
|
+
import type { VxeTableConstructor, VxeTablePrivateMethods, VxeGridConstructor, GridPrivateMethods } from '../../../types'
|
|
8
|
+
|
|
7
9
|
const { getI18n, formats } = VxeUI
|
|
8
10
|
|
|
9
11
|
export class ColumnInfo {
|
|
10
12
|
/* eslint-disable @typescript-eslint/no-use-before-define */
|
|
11
|
-
constructor ($
|
|
12
|
-
const
|
|
13
|
-
const
|
|
13
|
+
constructor ($xeTable: VxeTableConstructor & VxeTablePrivateMethods, _vm: any, { renderHeader, renderCell, renderFooter, renderData }: any = {}) {
|
|
14
|
+
const tableProps = $xeTable
|
|
15
|
+
const $xeGrid = $xeTable.$xeGrid as VxeGridConstructor & GridPrivateMethods
|
|
16
|
+
|
|
17
|
+
const proxyOpts = $xeGrid ? $xeGrid.proxyOpts : null
|
|
14
18
|
const formatter = _vm.formatter
|
|
15
19
|
const visible = XEUtils.isBoolean(_vm.visible) ? _vm.visible : true
|
|
16
|
-
const tableProps = $xetable
|
|
17
20
|
|
|
18
21
|
const types = ['seq', 'checkbox', 'radio', 'expand', 'html']
|
|
19
22
|
if (_vm.type && types.indexOf(_vm.type) === -1) {
|
|
@@ -27,7 +30,7 @@ export class ColumnInfo {
|
|
|
27
30
|
}
|
|
28
31
|
if (_vm.type === 'expand') {
|
|
29
32
|
const { treeConfig } = tableProps
|
|
30
|
-
if (treeConfig && ($
|
|
33
|
+
if (treeConfig && ($xeTable.treeOpts.showLine || $xeTable.treeOpts.line)) {
|
|
31
34
|
errLog('vxe.error.errConflicts', ['tree-config.line', 'column.type=expand'])
|
|
32
35
|
}
|
|
33
36
|
}
|
|
@@ -144,7 +147,7 @@ export class ColumnInfo {
|
|
|
144
147
|
slots: _vm.slots
|
|
145
148
|
})
|
|
146
149
|
if (proxyOpts && proxyOpts.beforeColumn) {
|
|
147
|
-
proxyOpts.beforeColumn({ $grid: $
|
|
150
|
+
proxyOpts.beforeColumn({ $grid: $xeGrid, column: this })
|
|
148
151
|
}
|
|
149
152
|
}
|
|
150
153
|
|
|
@@ -31,11 +31,12 @@ function renderRows (h: CreateElement, _vm: any, tableColumn: VxeTableDefines.Co
|
|
|
31
31
|
const tableProps = $xeTable
|
|
32
32
|
const tableReactData = $xeTable as unknown as TableReactData
|
|
33
33
|
const tableInternalData = $xeTable as unknown as TableInternalData
|
|
34
|
+
const $xeGrid = $xeTable.$xeGrid
|
|
34
35
|
|
|
35
36
|
const { fixedType } = props
|
|
36
37
|
const { resizable: allResizable, border, footerCellClassName, footerCellStyle, footerAlign: allFooterAlign, footerSpanMethod, align: allAlign, columnKey, showFooterOverflow: allColumnFooterOverflow } = tableProps
|
|
37
38
|
const { scrollXLoad, scrollYLoad, overflowX, currentColumn, mergeFooterList } = tableReactData
|
|
38
|
-
const { scrollXStore } = tableInternalData
|
|
39
|
+
const { fullColumnIdData, scrollXStore } = tableInternalData
|
|
39
40
|
const tooltipOpts = $xeTable.computeTooltipOpts
|
|
40
41
|
const { isAllColumnDrag } = $xeTable.resizableOpts
|
|
41
42
|
const columnOpts = $xeTable.computeColumnOpts
|
|
@@ -47,6 +48,7 @@ function renderRows (h: CreateElement, _vm: any, tableColumn: VxeTableDefines.Co
|
|
|
47
48
|
return tableColumn.map((column: any, $columnIndex: any) => {
|
|
48
49
|
const { type, showFooterOverflow, footerAlign, align, footerClassName, editRender, cellRender } = column
|
|
49
50
|
const colid = column.id
|
|
51
|
+
const colRest = fullColumnIdData[colid] || {}
|
|
50
52
|
const renderOpts = editRender || cellRender
|
|
51
53
|
const compConf = renderOpts ? renderer.get(renderOpts.name) : null
|
|
52
54
|
const showAllTip = tooltipOpts.showAll
|
|
@@ -62,14 +64,14 @@ function renderRows (h: CreateElement, _vm: any, tableColumn: VxeTableDefines.Co
|
|
|
62
64
|
const showResizable = (XEUtils.isBoolean(column.resizable) ? column.resizable : (columnOpts.resizable || allResizable))
|
|
63
65
|
const attrs: any = { colid }
|
|
64
66
|
const tfOns: any = {}
|
|
65
|
-
const columnIndex =
|
|
66
|
-
const _columnIndex =
|
|
67
|
+
const columnIndex = colRest.index
|
|
68
|
+
const _columnIndex = colRest._index
|
|
67
69
|
const itemIndex = _columnIndex
|
|
68
70
|
const cellParams: VxeTableDefines.CellRenderFooterParams & {
|
|
69
71
|
$table: VxeTableConstructor<any> & VxeTablePrivateMethods
|
|
70
72
|
} = {
|
|
71
73
|
$table: $xeTable,
|
|
72
|
-
$grid: $
|
|
74
|
+
$grid: $xeGrid,
|
|
73
75
|
row,
|
|
74
76
|
rowIndex: _rowIndex,
|
|
75
77
|
_rowIndex,
|
|
@@ -110,6 +112,7 @@ function renderRows (h: CreateElement, _vm: any, tableColumn: VxeTableDefines.Co
|
|
|
110
112
|
tfOns.dblclick = (evnt: MouseEvent) => {
|
|
111
113
|
$xeTable.dispatchEvent('footer-cell-dblclick', Object.assign({ cell: evnt.currentTarget }, cellParams), evnt)
|
|
112
114
|
}
|
|
115
|
+
let isMergeCell = false
|
|
113
116
|
// 合并行或列
|
|
114
117
|
if (mergeFooterList.length) {
|
|
115
118
|
const spanRest = mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex)
|
|
@@ -119,9 +122,11 @@ function renderRows (h: CreateElement, _vm: any, tableColumn: VxeTableDefines.Co
|
|
|
119
122
|
return null
|
|
120
123
|
}
|
|
121
124
|
if (rowspan > 1) {
|
|
125
|
+
isMergeCell = true
|
|
122
126
|
attrs.rowspan = rowspan
|
|
123
127
|
}
|
|
124
128
|
if (colspan > 1) {
|
|
129
|
+
isMergeCell = true
|
|
125
130
|
attrs.colspan = colspan
|
|
126
131
|
}
|
|
127
132
|
}
|
|
@@ -142,8 +147,10 @@ function renderRows (h: CreateElement, _vm: any, tableColumn: VxeTableDefines.Co
|
|
|
142
147
|
const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto')
|
|
143
148
|
|
|
144
149
|
let isVNPreEmptyStatus = false
|
|
145
|
-
if (
|
|
146
|
-
|
|
150
|
+
if (!isMergeCell) {
|
|
151
|
+
if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
|
|
152
|
+
isVNPreEmptyStatus = true
|
|
153
|
+
}
|
|
147
154
|
}
|
|
148
155
|
|
|
149
156
|
const tcStyle: Record<string, string> = {}
|
|
@@ -309,7 +316,7 @@ export default {
|
|
|
309
316
|
const { fixedType, fixedColumn, tableColumn } = props
|
|
310
317
|
const { spanMethod, footerSpanMethod, showFooterOverflow: allColumnFooterOverflow } = tableProps
|
|
311
318
|
const { visibleColumn, fullColumnIdData } = tableInternalData
|
|
312
|
-
const { isGroup, overflowX, scrollXLoad, scrollYLoad, dragCol } = tableReactData
|
|
319
|
+
const { isGroup, isColLoading, overflowX, scrollXLoad, scrollYLoad, dragCol } = tableReactData
|
|
313
320
|
|
|
314
321
|
let renderColumnList = tableColumn as VxeTableDefines.ColumnInfo[]
|
|
315
322
|
let isOptimizeMode = false
|
|
@@ -322,7 +329,7 @@ export default {
|
|
|
322
329
|
}
|
|
323
330
|
}
|
|
324
331
|
|
|
325
|
-
if (fixedType || !overflowX) {
|
|
332
|
+
if (!isColLoading && (fixedType || !overflowX)) {
|
|
326
333
|
renderColumnList = visibleColumn
|
|
327
334
|
}
|
|
328
335
|
|
|
@@ -399,7 +406,10 @@ export default {
|
|
|
399
406
|
attrs: {
|
|
400
407
|
name: column.id
|
|
401
408
|
},
|
|
402
|
-
key: $columnIndex
|
|
409
|
+
key: $columnIndex,
|
|
410
|
+
style: {
|
|
411
|
+
width: `${column.renderWidth}px`
|
|
412
|
+
}
|
|
403
413
|
})
|
|
404
414
|
})),
|
|
405
415
|
/**
|
|
@@ -3,26 +3,30 @@ import { defineVxeComponent } from '../../ui/src/comp'
|
|
|
3
3
|
import { assembleColumn, destroyColumn } from './util'
|
|
4
4
|
import { columnProps, columnWatch } from './column'
|
|
5
5
|
|
|
6
|
+
import type { VxeTableConstructor, VxeTablePrivateMethods } from '../../../types'
|
|
7
|
+
|
|
6
8
|
export default /* define-vxe-component start */ defineVxeComponent({
|
|
7
9
|
name: 'VxeColgroup',
|
|
8
10
|
props: columnProps,
|
|
9
11
|
provide () {
|
|
10
12
|
return {
|
|
11
|
-
$
|
|
12
|
-
$
|
|
13
|
+
$xeColumn: this,
|
|
14
|
+
$xeGrid: null
|
|
13
15
|
}
|
|
14
16
|
},
|
|
15
17
|
inject: {
|
|
16
|
-
$
|
|
18
|
+
$xeTable: {
|
|
17
19
|
default: null
|
|
18
20
|
},
|
|
19
|
-
$
|
|
21
|
+
$xeColumn: {
|
|
20
22
|
default: null
|
|
21
23
|
}
|
|
22
24
|
},
|
|
23
25
|
watch: columnWatch,
|
|
24
26
|
created (this: any) {
|
|
25
|
-
|
|
27
|
+
const $xeTable = this.$xeTable as VxeTableConstructor & VxeTablePrivateMethods
|
|
28
|
+
|
|
29
|
+
this.columnConfig = this.createColumn($xeTable, this)
|
|
26
30
|
},
|
|
27
31
|
mounted () {
|
|
28
32
|
const { $scopedSlots } = this
|