vxe-table 4.16.0 → 4.16.2
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 +1 -1
- package/es/index.css +1 -1
- package/es/index.min.css +1 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/edit/hook.js +55 -17
- package/es/table/src/column.js +2 -0
- package/es/table/src/columnInfo.js +1 -0
- package/es/table/src/emits.js +5 -0
- package/es/table/src/header.js +47 -16
- package/es/table/src/props.js +11 -3
- package/es/table/src/store.js +8 -0
- package/es/table/src/table.js +579 -87
- package/es/table/src/util.js +70 -2
- package/es/table/style.css +11 -17
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +2 -2
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +11 -17
- package/es/vxe-table/style.min.css +1 -1
- package/lib/grid/src/grid.js +1 -1
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.css +1 -1
- package/lib/index.min.css +1 -1
- package/lib/index.umd.js +265 -65
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/module/edit/hook.js +54 -15
- package/lib/table/module/edit/hook.min.js +1 -1
- package/lib/table/src/column.js +2 -0
- package/lib/table/src/column.min.js +1 -1
- package/lib/table/src/columnInfo.js +1 -0
- package/lib/table/src/columnInfo.min.js +1 -1
- package/lib/table/src/emits.js +1 -1
- package/lib/table/src/emits.min.js +1 -1
- package/lib/table/src/header.js +62 -13
- package/lib/table/src/header.min.js +1 -1
- package/lib/table/src/props.js +11 -3
- package/lib/table/src/props.min.js +1 -1
- package/lib/table/src/store.js +15 -0
- package/lib/table/src/store.min.js +1 -0
- package/lib/table/src/table.js +45 -25
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +74 -2
- package/lib/table/src/util.min.js +1 -1
- package/lib/table/style/style.css +11 -17
- package/lib/table/style/style.min.css +1 -1
- package/lib/ui/index.js +2 -2
- 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/lib/vxe-table/style/style.css +11 -17
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/grid/src/grid.ts +1 -1
- package/packages/table/module/edit/hook.ts +55 -19
- package/packages/table/src/column.ts +2 -0
- package/packages/table/src/columnInfo.ts +1 -0
- package/packages/table/src/emits.ts +6 -0
- package/packages/table/src/header.ts +49 -17
- package/packages/table/src/props.ts +11 -3
- package/packages/table/src/store.ts +14 -0
- package/packages/table/src/table.ts +583 -83
- package/packages/table/src/util.ts +76 -2
- package/packages/ui/index.ts +1 -1
- package/styles/components/table.scss +33 -55
- /package/es/{iconfont.1756083655214.ttf → iconfont.1756452373591.ttf} +0 -0
- /package/es/{iconfont.1756083655214.woff → iconfont.1756452373591.woff} +0 -0
- /package/es/{iconfont.1756083655214.woff2 → iconfont.1756452373591.woff2} +0 -0
- /package/lib/{iconfont.1756083655214.ttf → iconfont.1756452373591.ttf} +0 -0
- /package/lib/{iconfont.1756083655214.woff → iconfont.1756452373591.woff} +0 -0
- /package/lib/{iconfont.1756083655214.woff2 → iconfont.1756452373591.woff2} +0 -0
|
@@ -111,14 +111,18 @@ hooks.add('tableEditModule', {
|
|
|
111
111
|
const handleInsertRowAt = (records: any, targetRow: any, isInsertNextRow?: boolean) => {
|
|
112
112
|
const { treeConfig } = props
|
|
113
113
|
const { isRowGroupStatus } = reactData
|
|
114
|
-
const { tableFullTreeData, afterFullData, mergeBodyList, tableFullData, fullDataRowIdData, fullAllDataRowIdData, insertRowMaps } = internalData
|
|
114
|
+
const { tableFullTreeData, afterFullData, mergeBodyList, tableFullData, fullDataRowIdData, fullAllDataRowIdData, insertRowMaps, removeRowMaps } = internalData
|
|
115
115
|
const treeOpts = computeTreeOpts.value
|
|
116
|
-
const { transform, rowField, mapChildrenField } = treeOpts
|
|
116
|
+
const { transform, parentField, rowField, mapChildrenField } = treeOpts
|
|
117
117
|
const childrenField = treeOpts.children || treeOpts.childrenField
|
|
118
118
|
if (!XEUtils.isArray(records)) {
|
|
119
119
|
records = [records]
|
|
120
120
|
}
|
|
121
121
|
const newRecords: any[] = reactive($xeTable.defineField(records.map((record: any) => Object.assign(treeConfig && transform ? { [mapChildrenField]: [], [childrenField]: [] } : {}, record))))
|
|
122
|
+
let treeRecords: any[] = []
|
|
123
|
+
if (treeConfig && transform) {
|
|
124
|
+
treeRecords = XEUtils.toArrayTree(newRecords, { key: rowField, parentKey: parentField, children: childrenField })
|
|
125
|
+
}
|
|
122
126
|
if (XEUtils.eqNull(targetRow)) {
|
|
123
127
|
// 如果为虚拟树
|
|
124
128
|
if (treeConfig && transform) {
|
|
@@ -178,26 +182,33 @@ hooks.add('tableEditModule', {
|
|
|
178
182
|
const parentMapChilds = parentRow ? parentRow[mapChildrenField] : tableFullTreeData
|
|
179
183
|
const parentRest = fullAllDataRowIdData[getRowid($xeTable, parentRow)]
|
|
180
184
|
const parentLevel = parentRest ? parentRest.level : 0
|
|
181
|
-
|
|
182
|
-
const rowid = getRowid($xeTable, item)
|
|
183
|
-
if (item[treeOpts.parentField]) {
|
|
184
|
-
if (parentRow && item[treeOpts.parentField] !== parentRow[rowField]) {
|
|
185
|
-
errLog('vxe.error.errProp', [`${treeOpts.parentField}=${item[treeOpts.parentField]}`, `${treeOpts.parentField}=${parentRow[rowField]}`])
|
|
186
|
-
}
|
|
187
|
-
}
|
|
185
|
+
treeRecords.forEach((row, i) => {
|
|
188
186
|
if (parentRow) {
|
|
189
|
-
|
|
187
|
+
if (row[parentField] !== parentRow[rowField]) {
|
|
188
|
+
row[parentField] = parentRow[rowField]
|
|
189
|
+
errLog('vxe.error.errProp', [`${parentField}=${row[parentField]}`, `${parentField}=${parentRow[rowField]}`])
|
|
190
|
+
}
|
|
191
|
+
} else {
|
|
192
|
+
if (row[parentField] !== null) {
|
|
193
|
+
row[parentField] = null
|
|
194
|
+
errLog('vxe.error.errProp', [`${parentField}=${row[parentField]}`, 'null'])
|
|
195
|
+
}
|
|
190
196
|
}
|
|
191
197
|
let targetIndex = matchMapObj.index + i
|
|
192
198
|
if (isInsertNextRow) {
|
|
193
199
|
targetIndex = targetIndex + 1
|
|
194
200
|
}
|
|
195
|
-
parentMapChilds.splice(targetIndex, 0,
|
|
201
|
+
parentMapChilds.splice(targetIndex, 0, row)
|
|
202
|
+
})
|
|
203
|
+
XEUtils.eachTree(treeRecords, (item) => {
|
|
204
|
+
const rowid = getRowid($xeTable, item)
|
|
196
205
|
const rest = { row: item, rowid, seq: -1, index: -1, _index: -1, $index: -1, treeIndex: -1, _tIndex: -1, items: parentMapChilds, parent: parentRow, level: parentLevel + 1, height: 0, resizeHeight: 0, oTop: 0, expandHeight: 0 }
|
|
206
|
+
if (item[childrenField]) {
|
|
207
|
+
item[mapChildrenField] = item[childrenField]
|
|
208
|
+
}
|
|
197
209
|
fullDataRowIdData[rowid] = rest
|
|
198
210
|
fullAllDataRowIdData[rowid] = rest
|
|
199
|
-
})
|
|
200
|
-
|
|
211
|
+
}, { children: childrenField })
|
|
201
212
|
// 源
|
|
202
213
|
if (parentRow) {
|
|
203
214
|
const matchObj = XEUtils.findTree(tableFullTreeData, item => targetRow[rowField] === item[rowField], { children: childrenField })
|
|
@@ -207,7 +218,7 @@ hooks.add('tableEditModule', {
|
|
|
207
218
|
if (isInsertNextRow) {
|
|
208
219
|
targetIndex = targetIndex + 1
|
|
209
220
|
}
|
|
210
|
-
parentChilds.splice(targetIndex, 0, ...
|
|
221
|
+
parentChilds.splice(targetIndex, 0, ...treeRecords)
|
|
211
222
|
}
|
|
212
223
|
}
|
|
213
224
|
} else {
|
|
@@ -259,10 +270,27 @@ hooks.add('tableEditModule', {
|
|
|
259
270
|
}
|
|
260
271
|
}
|
|
261
272
|
}
|
|
262
|
-
|
|
273
|
+
|
|
274
|
+
const handleStatus = (newRow: any) => {
|
|
263
275
|
const rowid = getRowid($xeTable, newRow)
|
|
264
|
-
|
|
265
|
-
|
|
276
|
+
// 如果是被删除的数据,则还原状态
|
|
277
|
+
if (removeRowMaps[rowid]) {
|
|
278
|
+
delete removeRowMaps[rowid]
|
|
279
|
+
if (insertRowMaps[rowid]) {
|
|
280
|
+
delete insertRowMaps[rowid]
|
|
281
|
+
}
|
|
282
|
+
} else {
|
|
283
|
+
insertRowMaps[rowid] = newRow
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
// 如果为虚拟树
|
|
287
|
+
if (treeConfig && transform) {
|
|
288
|
+
XEUtils.eachTree(treeRecords, handleStatus, { children: mapChildrenField })
|
|
289
|
+
} else {
|
|
290
|
+
newRecords.forEach(handleStatus)
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
reactData.removeRowFlag++
|
|
266
294
|
reactData.insertRowFlag++
|
|
267
295
|
$xeTable.cacheRowMap(false)
|
|
268
296
|
$xeTable.updateScrollYStatus()
|
|
@@ -737,7 +765,12 @@ hooks.add('tableEditModule', {
|
|
|
737
765
|
const { editStore } = reactData
|
|
738
766
|
const { row, column } = editStore.actived
|
|
739
767
|
if (column && row) {
|
|
740
|
-
return {
|
|
768
|
+
return {
|
|
769
|
+
row,
|
|
770
|
+
rowIndex: $xeTable.getRowIndex(row),
|
|
771
|
+
column,
|
|
772
|
+
columnIndex: $xeTable.getColumnIndex(column)
|
|
773
|
+
}
|
|
741
774
|
}
|
|
742
775
|
return null
|
|
743
776
|
},
|
|
@@ -748,7 +781,10 @@ hooks.add('tableEditModule', {
|
|
|
748
781
|
const { editStore } = reactData
|
|
749
782
|
const { row, column } = editStore.selected
|
|
750
783
|
if (row && column) {
|
|
751
|
-
return {
|
|
784
|
+
return {
|
|
785
|
+
row,
|
|
786
|
+
column
|
|
787
|
+
}
|
|
752
788
|
}
|
|
753
789
|
return null
|
|
754
790
|
},
|
|
@@ -56,6 +56,8 @@ export const columnProps = {
|
|
|
56
56
|
footerClassName: [String, Function] as PropType<VxeColumnPropTypes.FooterClassName>,
|
|
57
57
|
// 格式化显示内容
|
|
58
58
|
formatter: [Function, Array, String] as PropType<VxeColumnPropTypes.Formatter<any>>,
|
|
59
|
+
// 格式化表头显示内容
|
|
60
|
+
headerFormatter: [Function, Array, String] as PropType<VxeColumnPropTypes.HeaderFormatter>,
|
|
59
61
|
// 格式化表尾显示内容
|
|
60
62
|
footerFormatter: [Function, Array, String] as PropType<VxeColumnPropTypes.FooterFormatter>,
|
|
61
63
|
// 是否显示间距
|
|
@@ -87,6 +87,7 @@ export class ColumnInfo {
|
|
|
87
87
|
headerClassName: _vm.headerClassName,
|
|
88
88
|
footerClassName: _vm.footerClassName,
|
|
89
89
|
formatter: formatter,
|
|
90
|
+
headerFormatter: _vm.headerFormatter,
|
|
90
91
|
footerFormatter: _vm.footerFormatter,
|
|
91
92
|
padding: _vm.padding,
|
|
92
93
|
verticalAlign: _vm.verticalAlign,
|
|
@@ -9,6 +9,10 @@ export const tableEmits: VxeTableEmits = [
|
|
|
9
9
|
'copy',
|
|
10
10
|
'cut',
|
|
11
11
|
|
|
12
|
+
'columns-change',
|
|
13
|
+
'data-change',
|
|
14
|
+
'footer-data-change',
|
|
15
|
+
|
|
12
16
|
'current-change', // 已废弃
|
|
13
17
|
|
|
14
18
|
'current-row-change',
|
|
@@ -58,6 +62,8 @@ export const tableEmits: VxeTableEmits = [
|
|
|
58
62
|
'row-dragstart',
|
|
59
63
|
'row-dragover',
|
|
60
64
|
'row-dragend',
|
|
65
|
+
'row-remove-dragend',
|
|
66
|
+
'row-insert-dragend',
|
|
61
67
|
'column-dragstart',
|
|
62
68
|
'column-dragover',
|
|
63
69
|
'column-dragend',
|
|
@@ -2,7 +2,7 @@ import { h, ref, Ref, PropType, inject, nextTick, watch, onMounted, onUnmounted
|
|
|
2
2
|
import { defineVxeComponent } from '../../ui/src/comp'
|
|
3
3
|
import XEUtils from 'xe-utils'
|
|
4
4
|
import { VxeUI } from '../../ui'
|
|
5
|
-
import { getCalcHeight, convertHeaderColumnToRows } from './util'
|
|
5
|
+
import { getCalcHeight, convertHeaderColumnToRows, convertHeaderToGridRows } from './util'
|
|
6
6
|
|
|
7
7
|
import type { VxeTablePrivateMethods, VxeTableConstructor, VxeTableMethods, VxeTableDefines, VxeColumnPropTypes } from '../../../types'
|
|
8
8
|
|
|
@@ -28,7 +28,7 @@ export default defineVxeComponent({
|
|
|
28
28
|
const { xID, props: tableProps, reactData: tableReactData, internalData: tableInternalData } = $xeTable
|
|
29
29
|
const { computeColumnOpts, computeColumnDragOpts, computeCellOpts, computeMouseOpts, computeHeaderCellOpts, computeDefaultRowHeight, computeVirtualXOpts } = $xeTable.getComputeMaps()
|
|
30
30
|
|
|
31
|
-
const headerColumn = ref
|
|
31
|
+
const headerColumn = ref<VxeTableDefines.ColumnInfo[][]>([])
|
|
32
32
|
|
|
33
33
|
const refElem = ref() as Ref<HTMLDivElement>
|
|
34
34
|
const refHeaderScroll = ref() as Ref<HTMLDivElement>
|
|
@@ -39,18 +39,28 @@ export default defineVxeComponent({
|
|
|
39
39
|
const refHeaderBorderRepair = ref() as Ref<HTMLDivElement>
|
|
40
40
|
|
|
41
41
|
const uploadColumn = () => {
|
|
42
|
+
const { showCustomHeader } = tableProps
|
|
43
|
+
const { collectColumn, visibleColumn } = tableInternalData
|
|
44
|
+
const { tableGroupColumn } = props
|
|
42
45
|
const { isGroup } = tableReactData
|
|
43
|
-
|
|
46
|
+
let spanColumns: VxeTableDefines.ColumnInfo[][] = isGroup ? convertHeaderColumnToRows(tableGroupColumn) : []
|
|
47
|
+
let visibleColgroups: VxeTableDefines.ColumnInfo[][] = []
|
|
48
|
+
if (showCustomHeader && spanColumns.length > 1) {
|
|
49
|
+
visibleColgroups = convertHeaderToGridRows(spanColumns)
|
|
50
|
+
spanColumns = visibleColgroups
|
|
51
|
+
}
|
|
52
|
+
headerColumn.value = spanColumns
|
|
53
|
+
$xeTable.dispatchEvent('columns-change', { visibleColgroups, collectColumn, visibleColumn }, null)
|
|
44
54
|
}
|
|
45
55
|
|
|
46
|
-
const renderRows = (isGroup: boolean, isOptimizeMode: boolean,
|
|
56
|
+
const renderRows = (isGroup: boolean, isOptimizeMode: boolean, headerGroups: VxeTableDefines.ColumnInfo[][], $rowIndex: number, cols: VxeTableDefines.ColumnInfo[]) => {
|
|
47
57
|
const $xeGrid = $xeTable.xeGrid
|
|
48
58
|
const $xeGantt = $xeTable.xeGantt
|
|
49
59
|
|
|
50
60
|
const { fixedType } = props
|
|
51
|
-
const { resizable: allResizable, columnKey, headerCellClassName, headerCellStyle, showHeaderOverflow: allColumnHeaderOverflow, headerAlign: allHeaderAlign, align: allAlign, mouseConfig } = tableProps
|
|
52
|
-
const { currentColumn, dragCol, scrollXLoad, scrollYLoad, overflowX, tableColumn } = tableReactData
|
|
53
|
-
const { fullColumnIdData, scrollXStore } = tableInternalData
|
|
61
|
+
const { resizable: allResizable, columnKey, showCustomHeader, headerCellClassName, headerCellStyle, showHeaderOverflow: allColumnHeaderOverflow, headerAlign: allHeaderAlign, align: allAlign, mouseConfig } = tableProps
|
|
62
|
+
const { currentColumn, dragCol, scrollXLoad, scrollYLoad, overflowX, mergeHeadFlag, tableColumn } = tableReactData
|
|
63
|
+
const { fullColumnIdData, scrollXStore, mergeHeaderList, mergeHeaderCellMaps } = tableInternalData
|
|
54
64
|
const virtualXOpts = computeVirtualXOpts.value
|
|
55
65
|
const columnOpts = computeColumnOpts.value
|
|
56
66
|
const columnDragOpts = computeColumnDragOpts.value
|
|
@@ -59,6 +69,7 @@ export default defineVxeComponent({
|
|
|
59
69
|
const headerCellOpts = computeHeaderCellOpts.value
|
|
60
70
|
const currCellHeight = getCalcHeight(headerCellOpts.height) || defaultRowHeight
|
|
61
71
|
const { disabledMethod: dragDisabledMethod, isCrossDrag, isPeerDrag } = columnDragOpts
|
|
72
|
+
const isLastRow = $rowIndex === headerGroups.length - 1
|
|
62
73
|
|
|
63
74
|
return cols.map((column, $columnIndex) => {
|
|
64
75
|
const { type, showHeaderOverflow, headerAlign, align, filters, headerClassName, editRender, cellRender } = column
|
|
@@ -101,10 +112,32 @@ export default defineVxeComponent({
|
|
|
101
112
|
hasFilter
|
|
102
113
|
}
|
|
103
114
|
const thAttrs: Record<string, string | number | null> = {
|
|
104
|
-
colid
|
|
105
|
-
|
|
106
|
-
|
|
115
|
+
colid
|
|
116
|
+
}
|
|
117
|
+
let isMergeCell = false
|
|
118
|
+
// 合并行或列
|
|
119
|
+
if (!showCustomHeader) {
|
|
120
|
+
thAttrs.colspan = column.colSpan > 1 ? column.colSpan : null
|
|
121
|
+
thAttrs.rowspan = column.rowSpan > 1 ? column.rowSpan : null
|
|
122
|
+
}
|
|
123
|
+
if (mergeHeadFlag && mergeHeaderList.length && (showCustomHeader || isLastRow)) {
|
|
124
|
+
const spanRest = mergeHeaderCellMaps[`${$rowIndex}:${showCustomHeader ? $columnIndex : _columnIndex}`]
|
|
125
|
+
if (spanRest) {
|
|
126
|
+
const { rowspan, colspan } = spanRest
|
|
127
|
+
if (!rowspan || !colspan) {
|
|
128
|
+
return null
|
|
129
|
+
}
|
|
130
|
+
if (rowspan > 1) {
|
|
131
|
+
isMergeCell = true
|
|
132
|
+
thAttrs.rowspan = rowspan
|
|
133
|
+
}
|
|
134
|
+
if (colspan > 1) {
|
|
135
|
+
isMergeCell = true
|
|
136
|
+
thAttrs.colspan = colspan
|
|
137
|
+
}
|
|
138
|
+
}
|
|
107
139
|
}
|
|
140
|
+
|
|
108
141
|
const thOns: any = {
|
|
109
142
|
onClick: (evnt: MouseEvent) => $xeTable.triggerHeaderCellClickEvent(evnt, cellParams),
|
|
110
143
|
onDblclick: (evnt: MouseEvent) => $xeTable.triggerHeaderCellDblclickEvent(evnt, cellParams)
|
|
@@ -132,7 +165,7 @@ export default defineVxeComponent({
|
|
|
132
165
|
const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto')
|
|
133
166
|
|
|
134
167
|
let isVNPreEmptyStatus = false
|
|
135
|
-
if (isOptimizeMode && overflowX && !isGroup) {
|
|
168
|
+
if (isOptimizeMode && overflowX && !isGroup && !isMergeCell) {
|
|
136
169
|
if (!dragCol || dragCol.id !== colid) {
|
|
137
170
|
if (scrollXLoad && tableColumn.length > 10 && !column.fixed && !virtualXOpts.immediate && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
|
|
138
171
|
isVNPreEmptyStatus = true
|
|
@@ -148,7 +181,7 @@ export default defineVxeComponent({
|
|
|
148
181
|
}
|
|
149
182
|
|
|
150
183
|
return h('th', {
|
|
151
|
-
class: ['vxe-table--column vxe-header--column', colid, {
|
|
184
|
+
class: ['vxe-table--column vxe-header--column', colid, fixedHiddenColumn ? 'fixed--hidden' : 'fixed--visible', {
|
|
152
185
|
[`col--${headAlign}`]: headAlign,
|
|
153
186
|
[`col--${type}`]: type,
|
|
154
187
|
'col--last': isLastColumn,
|
|
@@ -156,7 +189,6 @@ export default defineVxeComponent({
|
|
|
156
189
|
'col--group': isColGroup,
|
|
157
190
|
'col--ellipsis': hasEllipsis,
|
|
158
191
|
'fixed--width': !isAutoCellWidth,
|
|
159
|
-
'fixed--hidden': fixedHiddenColumn,
|
|
160
192
|
'is--padding': isPadding,
|
|
161
193
|
'is--sortable': column.sortable,
|
|
162
194
|
'col--filter': !!filters,
|
|
@@ -171,7 +203,7 @@ export default defineVxeComponent({
|
|
|
171
203
|
style: headerCellStyle ? (XEUtils.isFunction(headerCellStyle) ? headerCellStyle(cellParams) : headerCellStyle) : null,
|
|
172
204
|
...thAttrs,
|
|
173
205
|
...thOns,
|
|
174
|
-
key: columnKey || scrollXLoad || scrollYLoad || columnOpts.useKey || columnOpts.drag || isColGroup ? colid : $columnIndex
|
|
206
|
+
key: showCustomHeader ? `${colid}${$columnIndex}` : (columnKey || scrollXLoad || scrollYLoad || columnOpts.useKey || columnOpts.drag || isColGroup ? colid : $columnIndex)
|
|
175
207
|
}, [
|
|
176
208
|
h('div', {
|
|
177
209
|
class: ['vxe-cell', {
|
|
@@ -191,7 +223,7 @@ export default defineVxeComponent({
|
|
|
191
223
|
/**
|
|
192
224
|
* 列宽拖动
|
|
193
225
|
*/
|
|
194
|
-
!fixedHiddenColumn && showResizable
|
|
226
|
+
!fixedHiddenColumn && showResizable && (!showCustomHeader || isLastRow)
|
|
195
227
|
? h('div', {
|
|
196
228
|
class: 'vxe-cell--col-resizable',
|
|
197
229
|
onMousedown: (evnt: MouseEvent) => $xeTable.handleColResizeMousedownEvent(evnt, fixedType, cellParams),
|
|
@@ -216,7 +248,7 @@ export default defineVxeComponent({
|
|
|
216
248
|
headerRowClassName ? (XEUtils.isFunction(headerRowClassName) ? headerRowClassName(params) : headerRowClassName) : ''
|
|
217
249
|
],
|
|
218
250
|
style: headerRowStyle ? (XEUtils.isFunction(headerRowStyle) ? headerRowStyle(params) : headerRowStyle) : null
|
|
219
|
-
}, renderRows(isGroup, isOptimizeMode,
|
|
251
|
+
}, renderRows(isGroup, isOptimizeMode, headerGroups, $rowIndex, cols))
|
|
220
252
|
})
|
|
221
253
|
}
|
|
222
254
|
|
|
@@ -227,7 +259,7 @@ export default defineVxeComponent({
|
|
|
227
259
|
const { visibleColumn, fullColumnIdData } = tableInternalData
|
|
228
260
|
|
|
229
261
|
const mouseOpts = computeMouseOpts.value
|
|
230
|
-
let renderHeaderList = headerColumn.value
|
|
262
|
+
let renderHeaderList = headerColumn.value || []
|
|
231
263
|
let renderColumnList = tableColumn as VxeTableDefines.ColumnInfo[]
|
|
232
264
|
let isOptimizeMode = false
|
|
233
265
|
|
|
@@ -15,7 +15,7 @@ export const tableProps = {
|
|
|
15
15
|
// 表格的最小高度
|
|
16
16
|
minHeight: {
|
|
17
17
|
type: [Number, String] as PropType<VxeTablePropTypes.MinHeight>,
|
|
18
|
-
default: () =>
|
|
18
|
+
default: () => null
|
|
19
19
|
},
|
|
20
20
|
// 表格的最大高度
|
|
21
21
|
maxHeight: [Number, String] as PropType<VxeTablePropTypes.MaxHeight>,
|
|
@@ -134,9 +134,17 @@ export const tableProps = {
|
|
|
134
134
|
headerRowStyle: [Object, Function] as PropType<VxeTablePropTypes.HeaderRowStyle>,
|
|
135
135
|
// 给表尾行附加样式
|
|
136
136
|
footerRowStyle: [Object, Function] as PropType<VxeTablePropTypes.FooterRowStyle>,
|
|
137
|
-
//
|
|
137
|
+
// 用于分组表头,显示为自定义列头,配合 mergeHeaderCells 灵活实现自定义合并
|
|
138
|
+
showCustomHeader: {
|
|
139
|
+
type: Boolean as PropType<VxeTablePropTypes.ShowCustomHeader>,
|
|
140
|
+
default: () => getConfig().table.showCustomHeader
|
|
141
|
+
},
|
|
142
|
+
// 临时合并指定的表头单元格
|
|
143
|
+
mergeHeaderCells: Array as PropType<VxeTablePropTypes.MergeHeaderCells>,
|
|
144
|
+
// 临时合并指定的单元格
|
|
138
145
|
mergeCells: Array as PropType<VxeTablePropTypes.MergeCells>,
|
|
139
|
-
//
|
|
146
|
+
// 临时合并指定的表尾单元格
|
|
147
|
+
mergeFooterCells: Array as PropType<VxeTablePropTypes.MergeFooterCells>,
|
|
140
148
|
mergeFooterItems: Array as PropType<VxeTablePropTypes.MergeFooterItems>,
|
|
141
149
|
// 自定义合并行或列的方法
|
|
142
150
|
spanMethod: Function as PropType<VxeTablePropTypes.SpanMethod>,
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { reactive } from 'vue'
|
|
2
|
+
|
|
3
|
+
interface CrossTableDragRowObj {
|
|
4
|
+
row: any
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
// 跨表拖拽
|
|
8
|
+
export const crossTableDragRowInfo: CrossTableDragRowObj = reactive({
|
|
9
|
+
row: null
|
|
10
|
+
})
|
|
11
|
+
|
|
12
|
+
export function getCrossTableDragRowInfo () {
|
|
13
|
+
return crossTableDragRowInfo
|
|
14
|
+
}
|