vxe-table 3.14.0-beta.9 → 3.14.1
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 +62 -42
- 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 +103 -68
- 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 -5
- package/es/table/render/index.js +2 -2
- package/es/table/src/body.js +43 -25
- 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 +12 -7
- package/es/table/src/group.js +6 -5
- package/es/table/src/header.js +15 -9
- package/es/table/src/methods.js +1047 -971
- package/es/table/src/props.js +4 -0
- package/es/table/src/table.js +100 -64
- package/es/table/src/util.js +55 -20
- 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 +69 -59
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.umd.js +2006 -1686
- 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 +119 -105
- 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 +4 -10
- package/lib/table/module/validator/mixin.min.js +1 -1
- package/lib/table/render/index.js +3 -2
- package/lib/table/render/index.min.js +1 -1
- package/lib/table/src/body.js +51 -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 +12 -5
- 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 +1219 -1151
- 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 +108 -67
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +62 -21
- 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 +75 -51
- 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 +139 -95
- 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 +3 -6
- package/packages/table/render/index.ts +2 -2
- package/packages/table/src/body.ts +43 -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 +12 -7
- package/packages/table/src/group.ts +9 -5
- package/packages/table/src/header.ts +16 -9
- package/packages/table/src/methods.ts +1174 -1027
- package/packages/table/src/props.ts +16 -12
- package/packages/table/src/table.ts +117 -70
- package/packages/table/src/util.ts +65 -23
- package/packages/toolbar/src/toolbar.ts +3 -3
- package/packages/ui/index.ts +1 -0
- /package/es/{iconfont.1741336976538.ttf → iconfont.1743045564244.ttf} +0 -0
- /package/es/{iconfont.1741336976538.woff → iconfont.1743045564244.woff} +0 -0
- /package/es/{iconfont.1741336976538.woff2 → iconfont.1743045564244.woff2} +0 -0
- /package/lib/{iconfont.1741336976538.ttf → iconfont.1743045564244.ttf} +0 -0
- /package/lib/{iconfont.1741336976538.woff → iconfont.1743045564244.woff} +0 -0
- /package/lib/{iconfont.1741336976538.woff2 → iconfont.1743045564244.woff2} +0 -0
|
@@ -5,7 +5,7 @@ import { scrollToView } from '../../../ui/src/dom'
|
|
|
5
5
|
import { handleFieldOrColumn, getRowid } from '../../src/util'
|
|
6
6
|
import { warnLog, errLog } from '../../../ui/src/log'
|
|
7
7
|
|
|
8
|
-
import type { VxeTableDefines,
|
|
8
|
+
import type { VxeTableDefines, TableInternalData } from '../../../../types'
|
|
9
9
|
|
|
10
10
|
const { getConfig, validators } = VxeUI
|
|
11
11
|
|
|
@@ -156,14 +156,11 @@ export default {
|
|
|
156
156
|
beginValidate (rows: any, cols: VxeTableDefines.ColumnInfo[] | null, cb: any, isFull: any) {
|
|
157
157
|
const $xeTable = this
|
|
158
158
|
const props = $xeTable
|
|
159
|
-
const reactData = $xeTable as unknown as TableReactData
|
|
160
159
|
const internalData = $xeTable as unknown as TableInternalData
|
|
161
160
|
|
|
162
161
|
const validRest: any = {}
|
|
163
162
|
const { editRules, treeConfig } = props
|
|
164
|
-
const {
|
|
165
|
-
const { afterFullData } = internalData
|
|
166
|
-
const { removeMaps } = editStore
|
|
163
|
+
const { afterFullData, pendingRowMaps, removeRowMaps } = internalData
|
|
167
164
|
const treeOpts = $xeTable.computeTreeOpts
|
|
168
165
|
const childrenField = treeOpts.children || treeOpts.childrenField
|
|
169
166
|
let validList
|
|
@@ -189,7 +186,7 @@ export default {
|
|
|
189
186
|
const handleVaild = (row: any) => {
|
|
190
187
|
const rowid = getRowid($xeTable, row)
|
|
191
188
|
// 是否删除
|
|
192
|
-
if (
|
|
189
|
+
if (removeRowMaps[rowid]) {
|
|
193
190
|
return
|
|
194
191
|
}
|
|
195
192
|
// 是否标记删除
|
|
@@ -8,7 +8,7 @@ import { errLog } from '../../ui/src/log'
|
|
|
8
8
|
|
|
9
9
|
import type { VxeGlobalRendererHandles, VxeColumnPropTypes, VxeTableConstructor, VxeTablePrivateMethods } from '../../../types'
|
|
10
10
|
|
|
11
|
-
const { getConfig, renderer, getI18n } = VxeUI
|
|
11
|
+
const { getConfig, renderer, getI18n, getComponent } = VxeUI
|
|
12
12
|
|
|
13
13
|
const componentDefaultModelProp = 'value'
|
|
14
14
|
|
|
@@ -48,7 +48,7 @@ function getOldComponent ({ name }: any) {
|
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
function getDefaultComponent ({ name }: any) {
|
|
51
|
-
return name
|
|
51
|
+
return getComponent(name) || name
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
function handleConfirmFilter (params: any, checked: any, option: any) {
|
|
@@ -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,
|
|
@@ -277,6 +279,18 @@ function renderTdColumn (
|
|
|
277
279
|
}
|
|
278
280
|
|
|
279
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
|
+
}
|
|
280
294
|
if (scrollYLoad || hasEllipsis || isCsHeight || isRsHeight) {
|
|
281
295
|
tcStyle.height = `${cellHeight}px`
|
|
282
296
|
} else {
|
|
@@ -299,7 +313,7 @@ function renderTdColumn (
|
|
|
299
313
|
} else {
|
|
300
314
|
// 渲染单元格
|
|
301
315
|
tdVNs.push(
|
|
302
|
-
...renderLine(h, _vm, cellParams, cellHeight),
|
|
316
|
+
...renderLine(h, _vm, rowid, cellParams, cellHeight),
|
|
303
317
|
h('div', {
|
|
304
318
|
key: 'tc',
|
|
305
319
|
class: ['vxe-cell', {
|
|
@@ -436,8 +450,8 @@ function renderRows (h: CreateElement, _vm: any, fixedType: 'left' | 'right' | '
|
|
|
436
450
|
const tableInternalData = $xeTable as unknown as TableInternalData
|
|
437
451
|
|
|
438
452
|
const { stripe, rowKey, highlightHoverRow, rowClassName, rowStyle, editConfig, treeConfig } = tableProps
|
|
439
|
-
const { hasFixedColumn,
|
|
440
|
-
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
|
|
441
455
|
const checkboxOpts = $xeTable.computeCheckboxOpts
|
|
442
456
|
const radioOpts = $xeTable.computeRadioOpts
|
|
443
457
|
const treeOpts = $xeTable.computeTreeOpts
|
|
@@ -448,11 +462,15 @@ function renderRows (h: CreateElement, _vm: any, fixedType: 'left' | 'right' | '
|
|
|
448
462
|
const { transform, seqMode } = treeOpts
|
|
449
463
|
const childrenField = treeOpts.children || treeOpts.childrenField
|
|
450
464
|
const rows: any[] = []
|
|
465
|
+
const { handleGetRowId } = createHandleGetRowId($xeTable)
|
|
451
466
|
tableData.forEach((row, $rowIndex) => {
|
|
452
467
|
const trOn: Record<string, any> = {}
|
|
468
|
+
const rowid = handleGetRowId(row)
|
|
469
|
+
const rowRest = fullAllDataRowIdData[rowid] || {}
|
|
453
470
|
let rowIndex = $rowIndex
|
|
454
|
-
|
|
455
|
-
|
|
471
|
+
let rowLevel = 0
|
|
472
|
+
let seq: string | number = -1
|
|
473
|
+
let _rowIndex = -1
|
|
456
474
|
// 当前行事件
|
|
457
475
|
if (rowOpts.isHover || highlightHoverRow) {
|
|
458
476
|
trOn.mouseenter = (evnt: MouseEvent) => {
|
|
@@ -468,11 +486,6 @@ function renderRows (h: CreateElement, _vm: any, fixedType: 'left' | 'right' | '
|
|
|
468
486
|
$xeTable.clearHoverRow()
|
|
469
487
|
}
|
|
470
488
|
}
|
|
471
|
-
const rowid = getRowid($xeTable, row)
|
|
472
|
-
const rowRest = fullAllDataRowIdData[rowid]
|
|
473
|
-
let rowLevel = 0
|
|
474
|
-
let seq: string | number = -1
|
|
475
|
-
let _rowIndex = 0
|
|
476
489
|
if (rowRest) {
|
|
477
490
|
rowLevel = rowRest.level
|
|
478
491
|
if (treeConfig && transform && seqMode === 'increasing') {
|
|
@@ -480,11 +493,12 @@ function renderRows (h: CreateElement, _vm: any, fixedType: 'left' | 'right' | '
|
|
|
480
493
|
} else {
|
|
481
494
|
seq = rowRest.seq
|
|
482
495
|
}
|
|
496
|
+
rowIndex = rowRest.index
|
|
483
497
|
_rowIndex = rowRest._index
|
|
484
498
|
}
|
|
485
499
|
const params = { $table: $xeTable, seq, rowid, fixed: fixedType, type: renderType, level: rowLevel, row, rowIndex, $rowIndex, _rowIndex }
|
|
486
500
|
// 行是否被展开
|
|
487
|
-
const isExpandRow = expandColumn && !!rowExpandedMaps[rowid]
|
|
501
|
+
const isExpandRow = expandColumn && !!rowExpandedFlag && !!rowExpandedMaps[rowid]
|
|
488
502
|
// 树节点是否被展开
|
|
489
503
|
let isExpandTree = false
|
|
490
504
|
let rowChildren = []
|
|
@@ -495,7 +509,7 @@ function renderRows (h: CreateElement, _vm: any, fixedType: 'left' | 'right' | '
|
|
|
495
509
|
}
|
|
496
510
|
if (treeConfig && !scrollYLoad && !transform) {
|
|
497
511
|
rowChildren = row[childrenField]
|
|
498
|
-
isExpandTree = rowChildren && rowChildren.length && !!treeExpandedMaps[rowid]
|
|
512
|
+
isExpandTree = !!treeExpandedFlag && rowChildren && rowChildren.length > 0 && !!treeExpandedMaps[rowid]
|
|
499
513
|
}
|
|
500
514
|
// 拖拽行事件
|
|
501
515
|
if (rowOpts.drag && (!treeConfig || transform)) {
|
|
@@ -514,7 +528,7 @@ function renderRows (h: CreateElement, _vm: any, fixedType: 'left' | 'right' | '
|
|
|
514
528
|
'row--new': isNewRow && (editOpts.showStatus || editOpts.showInsertStatus),
|
|
515
529
|
'row--radio': radioOpts.highlight && selectRadioRow === row,
|
|
516
530
|
'row--checked': checkboxOpts.highlight && $xeTable.isCheckedByCheckboxRow(row),
|
|
517
|
-
'row--pending': !!pendingRowMaps[rowid]
|
|
531
|
+
'row--pending': !!pendingRowFlag && !!pendingRowMaps[rowid]
|
|
518
532
|
},
|
|
519
533
|
rowClassName ? (XEUtils.isFunction(rowClassName) ? rowClassName(params) : rowClassName) : ''
|
|
520
534
|
]
|
|
@@ -670,6 +684,7 @@ export default {
|
|
|
670
684
|
const tableProps = $xeTable
|
|
671
685
|
const tableReactData = $xeTable as unknown as TableReactData
|
|
672
686
|
const tableInternalData = $xeTable as unknown as TableInternalData
|
|
687
|
+
const $xeGrid = $xeTable.$xeGrid
|
|
673
688
|
|
|
674
689
|
const { xID, $scopedSlots } = $xeTable
|
|
675
690
|
const { fixedColumn, fixedType, tableColumn } = props
|
|
@@ -695,7 +710,7 @@ export default {
|
|
|
695
710
|
}
|
|
696
711
|
}
|
|
697
712
|
|
|
698
|
-
if (fixedType || !overflowX) {
|
|
713
|
+
if (!isColLoading && (fixedType || !overflowX)) {
|
|
699
714
|
renderColumnList = visibleColumn
|
|
700
715
|
}
|
|
701
716
|
|
|
@@ -755,7 +770,7 @@ export default {
|
|
|
755
770
|
|
|
756
771
|
let emptyContent
|
|
757
772
|
if ($scopedSlots.empty) {
|
|
758
|
-
emptyContent = $scopedSlots.empty.call(this, { $table: $xeTable, $grid: $
|
|
773
|
+
emptyContent = $scopedSlots.empty.call(this, { $table: $xeTable, $grid: $xeGrid })
|
|
759
774
|
} else {
|
|
760
775
|
const compConf = emptyOpts.name ? renderer.get(emptyOpts.name) : null
|
|
761
776
|
const rtEmptyView = compConf ? (compConf.renderTableEmpty || compConf.renderTableEmptyView || compConf.renderEmpty) : null
|
|
@@ -814,7 +829,10 @@ export default {
|
|
|
814
829
|
attrs: {
|
|
815
830
|
name: column.id
|
|
816
831
|
},
|
|
817
|
-
key: $columnIndex
|
|
832
|
+
key: $columnIndex,
|
|
833
|
+
style: {
|
|
834
|
+
width: `${column.renderWidth}px`
|
|
835
|
+
}
|
|
818
836
|
})
|
|
819
837
|
})),
|
|
820
838
|
/**
|
|
@@ -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,
|
|
@@ -314,7 +316,7 @@ export default {
|
|
|
314
316
|
const { fixedType, fixedColumn, tableColumn } = props
|
|
315
317
|
const { spanMethod, footerSpanMethod, showFooterOverflow: allColumnFooterOverflow } = tableProps
|
|
316
318
|
const { visibleColumn, fullColumnIdData } = tableInternalData
|
|
317
|
-
const { isGroup, overflowX, scrollXLoad, scrollYLoad, dragCol } = tableReactData
|
|
319
|
+
const { isGroup, isColLoading, overflowX, scrollXLoad, scrollYLoad, dragCol } = tableReactData
|
|
318
320
|
|
|
319
321
|
let renderColumnList = tableColumn as VxeTableDefines.ColumnInfo[]
|
|
320
322
|
let isOptimizeMode = false
|
|
@@ -327,7 +329,7 @@ export default {
|
|
|
327
329
|
}
|
|
328
330
|
}
|
|
329
331
|
|
|
330
|
-
if (fixedType || !overflowX) {
|
|
332
|
+
if (!isColLoading && (fixedType || !overflowX)) {
|
|
331
333
|
renderColumnList = visibleColumn
|
|
332
334
|
}
|
|
333
335
|
|
|
@@ -404,7 +406,10 @@ export default {
|
|
|
404
406
|
attrs: {
|
|
405
407
|
name: column.id
|
|
406
408
|
},
|
|
407
|
-
key: $columnIndex
|
|
409
|
+
key: $columnIndex,
|
|
410
|
+
style: {
|
|
411
|
+
width: `${column.renderWidth}px`
|
|
412
|
+
}
|
|
408
413
|
})
|
|
409
414
|
})),
|
|
410
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
|