vxe-table 3.12.8 → 3.12.10-beta.0
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 +6 -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/export/mixin.js +3 -3
- package/es/table/module/filter/mixin.js +3 -3
- package/es/table/module/keyboard/mixin.js +4 -4
- package/es/table/module/menu/mixin.js +2 -2
- package/es/table/module/validator/mixin.js +2 -2
- package/es/table/src/body.js +262 -363
- package/es/table/src/footer.js +135 -154
- package/es/table/src/header.js +120 -100
- package/es/table/src/methods.js +1175 -816
- package/es/table/src/props.js +9 -3
- package/es/table/src/table.js +187 -103
- package/es/table/src/util.js +35 -21
- package/es/table/style.css +146 -63
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +14 -4
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +146 -63
- package/es/vxe-table/style.min.css +1 -1
- package/lib/grid/src/grid.js +4 -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 +1920 -1599
- 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/export/mixin.js +3 -3
- package/lib/table/module/export/mixin.min.js +1 -1
- package/lib/table/module/filter/mixin.js +4 -4
- package/lib/table/module/filter/mixin.min.js +1 -1
- package/lib/table/module/keyboard/mixin.js +5 -5
- package/lib/table/module/keyboard/mixin.min.js +1 -1
- package/lib/table/module/menu/mixin.js +2 -2
- package/lib/table/module/menu/mixin.min.js +1 -1
- package/lib/table/module/validator/mixin.js +2 -2
- package/lib/table/module/validator/mixin.min.js +1 -1
- package/lib/table/src/body.js +205 -381
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/footer.js +124 -151
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/header.js +97 -74
- package/lib/table/src/header.min.js +1 -1
- package/lib/table/src/methods.js +1261 -875
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/props.js +9 -3
- package/lib/table/src/props.min.js +1 -1
- package/lib/table/src/table.js +171 -90
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +38 -22
- package/lib/table/src/util.min.js +1 -1
- package/lib/table/style/style.css +146 -63
- package/lib/table/style/style.min.css +1 -1
- package/lib/ui/index.js +14 -4
- 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 +146 -63
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/grid/src/grid.ts +6 -1
- package/packages/table/module/export/mixin.ts +3 -3
- package/packages/table/module/filter/mixin.ts +3 -3
- package/packages/table/module/keyboard/mixin.ts +4 -4
- package/packages/table/module/menu/mixin.ts +2 -2
- package/packages/table/module/validator/mixin.ts +2 -2
- package/packages/table/src/body.ts +296 -436
- package/packages/table/src/footer.ts +148 -164
- package/packages/table/src/header.ts +135 -111
- package/packages/table/src/methods.ts +1249 -873
- package/packages/table/src/props.ts +9 -3
- package/packages/table/src/table.ts +195 -146
- package/packages/table/src/util.ts +40 -23
- package/packages/ui/index.ts +13 -3
- package/styles/components/table.scss +164 -74
- /package/es/{iconfont.1736406699090.ttf → iconfont.1736688976404.ttf} +0 -0
- /package/es/{iconfont.1736406699090.woff → iconfont.1736688976404.woff} +0 -0
- /package/es/{iconfont.1736406699090.woff2 → iconfont.1736688976404.woff2} +0 -0
- /package/lib/{iconfont.1736406699090.ttf → iconfont.1736688976404.ttf} +0 -0
- /package/lib/{iconfont.1736406699090.woff → iconfont.1736688976404.woff} +0 -0
- /package/lib/{iconfont.1736406699090.woff2 → iconfont.1736688976404.woff2} +0 -0
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { CreateElement } from 'vue'
|
|
1
|
+
import { PropType, CreateElement } from 'vue'
|
|
2
2
|
import XEUtils from 'xe-utils'
|
|
3
3
|
import { VxeUI } from '../../ui'
|
|
4
4
|
import { getClass } from '../../ui/src/utils'
|
|
5
|
-
import { updateCellTitle
|
|
5
|
+
import { updateCellTitle } from '../../ui/src/dom'
|
|
6
6
|
|
|
7
|
-
import type { VxeTableDefines } from '../../../types'
|
|
7
|
+
import type { VxeTableDefines, VxeTableConstructor, VxeTablePrivateMethods, TableReactData, TableInternalData, VxeComponentStyleType } from '../../../types'
|
|
8
8
|
|
|
9
9
|
const renderType = 'footer'
|
|
10
10
|
|
|
11
11
|
const { renderer, renderEmptyElement } = VxeUI
|
|
12
12
|
|
|
13
|
-
function mergeFooterMethod (mergeFooterList:
|
|
13
|
+
function mergeFooterMethod (mergeFooterList: VxeTableDefines.MergeItem[], _rowIndex: number, _columnIndex: number) {
|
|
14
14
|
for (let mIndex = 0; mIndex < mergeFooterList.length; mIndex++) {
|
|
15
15
|
const { row: mergeRowIndex, col: mergeColIndex, rowspan: mergeRowspan, colspan: mergeColspan } = mergeFooterList[mIndex]
|
|
16
16
|
if (mergeColIndex > -1 && mergeRowIndex > -1 && mergeRowspan && mergeColspan) {
|
|
@@ -25,17 +25,27 @@ function mergeFooterMethod (mergeFooterList: any, _rowIndex: any, _columnIndex:
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
function renderRows (h: CreateElement, _vm: any, tableColumn: VxeTableDefines.ColumnInfo[], footerTableData: any[], row: any, $rowIndex: number, _rowIndex: number) {
|
|
28
|
-
const
|
|
29
|
-
const
|
|
28
|
+
const props = _vm
|
|
29
|
+
const $xeTable = _vm.$parent as VxeTableConstructor & VxeTablePrivateMethods
|
|
30
|
+
const tableProps = $xeTable
|
|
31
|
+
const tableReactData = $xeTable as unknown as TableReactData
|
|
32
|
+
const tableInternalData = $xeTable as unknown as TableInternalData
|
|
33
|
+
|
|
34
|
+
const { fixedType } = props
|
|
35
|
+
const { footerCellClassName, footerCellStyle, footerAlign: allFooterAlign, footerSpanMethod, align: allAlign, columnKey, showFooterOverflow: allColumnFooterOverflow } = tableProps
|
|
36
|
+
const { scrollXLoad, scrollYLoad, overflowX, currentColumn, mergeFooterList } = tableReactData
|
|
37
|
+
const { scrollXStore } = tableInternalData
|
|
38
|
+
const tooltipOpts = $xeTable.computeTooltipOpts
|
|
39
|
+
const columnOpts = $xeTable.computeColumnOpts
|
|
30
40
|
|
|
31
41
|
return tableColumn.map((column: any, $columnIndex: any) => {
|
|
32
42
|
const { type, showFooterOverflow, footerAlign, align, footerClassName, editRender, cellRender } = column
|
|
33
43
|
const renderOpts = editRender || cellRender
|
|
34
44
|
const compConf = renderOpts ? renderer.get(renderOpts.name) : null
|
|
35
|
-
const showAllTip = tooltipOpts.showAll
|
|
45
|
+
const showAllTip = tooltipOpts.showAll
|
|
36
46
|
const isColGroup = column.children && column.children.length
|
|
37
47
|
const fixedHiddenColumn = fixedType ? column.fixed !== fixedType && !isColGroup : column.fixed && overflowX
|
|
38
|
-
const footOverflow = XEUtils.
|
|
48
|
+
const footOverflow = XEUtils.eqNull(showFooterOverflow) ? allColumnFooterOverflow : showFooterOverflow
|
|
39
49
|
const footAlign = footerAlign || (compConf ? compConf.tableFooterCellAlign : '') || allFooterAlign || align || (compConf ? compConf.tableCellAlign : '') || allAlign
|
|
40
50
|
let showEllipsis = footOverflow === 'ellipsis'
|
|
41
51
|
const showTitle = footOverflow === 'title'
|
|
@@ -43,13 +53,14 @@ function renderRows (h: CreateElement, _vm: any, tableColumn: VxeTableDefines.Co
|
|
|
43
53
|
let hasEllipsis = showTitle || showTooltip || showEllipsis
|
|
44
54
|
const attrs: any = { colid: column.id }
|
|
45
55
|
const tfOns: any = {}
|
|
46
|
-
const columnIndex = $
|
|
47
|
-
const _columnIndex = $
|
|
56
|
+
const columnIndex = $xeTable.getColumnIndex(column)
|
|
57
|
+
const _columnIndex = $xeTable.getVTColumnIndex(column)
|
|
48
58
|
const itemIndex = _columnIndex
|
|
49
|
-
const cellParams = {
|
|
50
|
-
$table: $
|
|
51
|
-
$grid: $
|
|
59
|
+
const cellParams: VxeTableDefines.CellRenderFooterParams = {
|
|
60
|
+
$table: $xeTable,
|
|
61
|
+
$grid: $xeTable.xegrid,
|
|
52
62
|
row,
|
|
63
|
+
rowIndex: _rowIndex,
|
|
53
64
|
_rowIndex,
|
|
54
65
|
$rowIndex,
|
|
55
66
|
column,
|
|
@@ -62,35 +73,31 @@ function renderRows (h: CreateElement, _vm: any, tableColumn: VxeTableDefines.Co
|
|
|
62
73
|
type: renderType,
|
|
63
74
|
data: footerTableData
|
|
64
75
|
}
|
|
65
|
-
//
|
|
76
|
+
// 纵向虚拟滚动不支持动态行高
|
|
66
77
|
if (scrollXLoad && !hasEllipsis) {
|
|
67
78
|
showEllipsis = hasEllipsis = true
|
|
68
79
|
}
|
|
69
80
|
if (showTitle || showTooltip || showAllTip) {
|
|
70
|
-
tfOns.mouseenter = (evnt:
|
|
81
|
+
tfOns.mouseenter = (evnt: MouseEvent) => {
|
|
71
82
|
if (showTitle) {
|
|
72
83
|
updateCellTitle(evnt.currentTarget, column)
|
|
73
84
|
} else if (showTooltip || showAllTip) {
|
|
74
|
-
$
|
|
85
|
+
$xeTable.triggerFooterTooltipEvent(evnt, cellParams)
|
|
75
86
|
}
|
|
76
87
|
}
|
|
77
88
|
}
|
|
78
89
|
if (showTooltip || showAllTip) {
|
|
79
|
-
tfOns.mouseleave = (evnt:
|
|
90
|
+
tfOns.mouseleave = (evnt: MouseEvent) => {
|
|
80
91
|
if (showTooltip || showAllTip) {
|
|
81
|
-
$
|
|
92
|
+
$xeTable.handleTargetLeaveEvent(evnt)
|
|
82
93
|
}
|
|
83
94
|
}
|
|
84
95
|
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
$xetable.emitEvent('footer-cell-click', Object.assign({ cell: evnt.currentTarget }, cellParams), evnt)
|
|
88
|
-
}
|
|
96
|
+
tfOns.click = (evnt: MouseEvent) => {
|
|
97
|
+
$xeTable.dispatchEvent('footer-cell-click', Object.assign({ cell: evnt.currentTarget }, cellParams), evnt)
|
|
89
98
|
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
$xetable.emitEvent('footer-cell-dblclick', Object.assign({ cell: evnt.currentTarget }, cellParams), evnt)
|
|
93
|
-
}
|
|
99
|
+
tfOns.dblclick = (evnt: MouseEvent) => {
|
|
100
|
+
$xeTable.dispatchEvent('footer-cell-dblclick', Object.assign({ cell: evnt.currentTarget }, cellParams), evnt)
|
|
94
101
|
}
|
|
95
102
|
// 合并行或列
|
|
96
103
|
if (mergeFooterList.length) {
|
|
@@ -122,6 +129,11 @@ function renderRows (h: CreateElement, _vm: any, tableColumn: VxeTableDefines.Co
|
|
|
122
129
|
}
|
|
123
130
|
const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto')
|
|
124
131
|
|
|
132
|
+
let isPreLoadStatus = false
|
|
133
|
+
if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex || _columnIndex > scrollXStore.visibleEndIndex)) {
|
|
134
|
+
isPreLoadStatus = true
|
|
135
|
+
}
|
|
136
|
+
|
|
125
137
|
return h('td', {
|
|
126
138
|
class: ['vxe-footer--column', column.id, {
|
|
127
139
|
[`col--${footAlign}`]: footAlign,
|
|
@@ -133,7 +145,7 @@ function renderRows (h: CreateElement, _vm: any, tableColumn: VxeTableDefines.Co
|
|
|
133
145
|
'col--current': currentColumn === column
|
|
134
146
|
}, getClass(footerClassName, cellParams), getClass(footerCellClassName, cellParams)],
|
|
135
147
|
attrs,
|
|
136
|
-
style: footerCellStyle ? (XEUtils.isFunction(footerCellStyle) ? footerCellStyle(cellParams) : footerCellStyle) :
|
|
148
|
+
style: footerCellStyle ? (XEUtils.isFunction(footerCellStyle) ? footerCellStyle(cellParams) : footerCellStyle) as VxeComponentStyleType : undefined,
|
|
137
149
|
on: tfOns,
|
|
138
150
|
key: columnKey || scrollXLoad || scrollYLoad || columnOpts.useKey || columnOpts.drag ? column.id : $columnIndex
|
|
139
151
|
}, [
|
|
@@ -143,29 +155,25 @@ function renderRows (h: CreateElement, _vm: any, tableColumn: VxeTableDefines.Co
|
|
|
143
155
|
'c--tooltip': showTooltip,
|
|
144
156
|
'c--ellipsis': showEllipsis
|
|
145
157
|
}]
|
|
146
|
-
}, column.renderFooter(h, cellParams))
|
|
158
|
+
}, isPreLoadStatus ? [] : column.renderFooter(h, cellParams))
|
|
147
159
|
])
|
|
148
|
-
})
|
|
149
|
-
? [
|
|
150
|
-
h('td', {
|
|
151
|
-
key: `gr${$rowIndex}`,
|
|
152
|
-
class: 'vxe-footer--gutter col--gutter'
|
|
153
|
-
})
|
|
154
|
-
]
|
|
155
|
-
: [])
|
|
160
|
+
})
|
|
156
161
|
}
|
|
157
162
|
|
|
158
163
|
function renderHeads (h: CreateElement, _vm: any, renderColumnList: VxeTableDefines.ColumnInfo[]) {
|
|
159
|
-
const $xeTable = _vm.$parent
|
|
160
164
|
const props = _vm
|
|
165
|
+
const $xeTable = _vm.$parent as VxeTableConstructor & VxeTablePrivateMethods
|
|
166
|
+
const tableProps = $xeTable
|
|
167
|
+
const tableReactData = $xeTable as unknown as TableReactData
|
|
161
168
|
|
|
169
|
+
const { fixedType, footerTableData } = props
|
|
170
|
+
|
|
171
|
+
const { footerRowClassName, footerRowStyle } = tableProps
|
|
172
|
+
const { isDragColMove } = tableReactData
|
|
162
173
|
const columnOpts = $xeTable.computeColumnOpts
|
|
163
174
|
const columnDragOpts = $xeTable.computeColumnDragOpts
|
|
164
175
|
|
|
165
|
-
|
|
166
|
-
const { footerRowClassName, footerRowStyle, isDragColMove } = $xeTable
|
|
167
|
-
|
|
168
|
-
return footerTableData.map((row: any, $rowIndex: any) => {
|
|
176
|
+
return (footerTableData as any[][]).map((row, $rowIndex) => {
|
|
169
177
|
const _rowIndex = $rowIndex
|
|
170
178
|
const rowParams = { $table: $xeTable, row, _rowIndex, $rowIndex, fixed: fixedType, type: renderType }
|
|
171
179
|
|
|
@@ -179,7 +187,7 @@ function renderHeads (h: CreateElement, _vm: any, renderColumnList: VxeTableDefi
|
|
|
179
187
|
'vxe-footer--row',
|
|
180
188
|
footerRowClassName ? XEUtils.isFunction(footerRowClassName) ? footerRowClassName(rowParams) : footerRowClassName : ''
|
|
181
189
|
],
|
|
182
|
-
style: footerRowStyle ? (XEUtils.isFunction(footerRowStyle) ? footerRowStyle(rowParams) : footerRowStyle) :
|
|
190
|
+
style: footerRowStyle ? (XEUtils.isFunction(footerRowStyle) ? footerRowStyle(rowParams) : footerRowStyle) as VxeComponentStyleType : undefined
|
|
183
191
|
}
|
|
184
192
|
}, renderRows(h, _vm, renderColumnList, footerTableData, row, $rowIndex, _rowIndex))
|
|
185
193
|
}
|
|
@@ -189,7 +197,7 @@ function renderHeads (h: CreateElement, _vm: any, renderColumnList: VxeTableDefi
|
|
|
189
197
|
'vxe-footer--row',
|
|
190
198
|
footerRowClassName ? XEUtils.isFunction(footerRowClassName) ? footerRowClassName(rowParams) : footerRowClassName : ''
|
|
191
199
|
],
|
|
192
|
-
style: footerRowStyle ? (XEUtils.isFunction(footerRowStyle) ? footerRowStyle(rowParams) : footerRowStyle) :
|
|
200
|
+
style: footerRowStyle ? (XEUtils.isFunction(footerRowStyle) ? footerRowStyle(rowParams) : footerRowStyle) as VxeComponentStyleType : undefined
|
|
193
201
|
}, renderRows(h, _vm, renderColumnList, footerTableData, row, $rowIndex, _rowIndex))
|
|
194
202
|
})
|
|
195
203
|
}
|
|
@@ -197,27 +205,49 @@ function renderHeads (h: CreateElement, _vm: any, renderColumnList: VxeTableDefi
|
|
|
197
205
|
export default {
|
|
198
206
|
name: 'VxeTableFooter',
|
|
199
207
|
props: {
|
|
200
|
-
footerTableData:
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
208
|
+
footerTableData: {
|
|
209
|
+
type: Array as PropType<any[][]>,
|
|
210
|
+
default: () => []
|
|
211
|
+
},
|
|
212
|
+
tableColumn: {
|
|
213
|
+
type: Array as PropType<VxeTableDefines.ColumnInfo[]>,
|
|
214
|
+
default: () => []
|
|
215
|
+
},
|
|
216
|
+
fixedColumn: {
|
|
217
|
+
type: Array as PropType<VxeTableDefines.ColumnInfo[]>,
|
|
218
|
+
default: () => []
|
|
219
|
+
},
|
|
220
|
+
fixedType: {
|
|
221
|
+
type: String as PropType<'right' | 'left' | ''>,
|
|
222
|
+
default: null
|
|
223
|
+
}
|
|
205
224
|
},
|
|
206
225
|
mounted (this: any) {
|
|
207
|
-
const
|
|
208
|
-
const
|
|
226
|
+
const _vm = this
|
|
227
|
+
const props = _vm
|
|
228
|
+
const $xeTable = _vm.$parent as VxeTableConstructor & VxeTablePrivateMethods
|
|
229
|
+
const tableInternalData = $xeTable as unknown as TableInternalData
|
|
230
|
+
|
|
231
|
+
const { fixedType } = props
|
|
232
|
+
const { elemStore } = tableInternalData
|
|
209
233
|
const prefix = `${fixedType || 'main'}-footer-`
|
|
210
|
-
elemStore[`${prefix}wrapper`] =
|
|
211
|
-
elemStore[`${prefix}
|
|
212
|
-
elemStore[`${prefix}
|
|
213
|
-
elemStore[`${prefix}
|
|
214
|
-
elemStore[`${prefix}
|
|
234
|
+
elemStore[`${prefix}wrapper`] = _vm.$refs.refElem
|
|
235
|
+
elemStore[`${prefix}scroll`] = _vm.$refs.refFooterScroll
|
|
236
|
+
elemStore[`${prefix}table`] = _vm.$refs.refFooterTable
|
|
237
|
+
elemStore[`${prefix}colgroup`] = _vm.$refs.refFooterColgroup
|
|
238
|
+
elemStore[`${prefix}list`] = _vm.$refs.refFooterTFoot
|
|
239
|
+
elemStore[`${prefix}xSpace`] = _vm.$refs.refFooterXSpace
|
|
215
240
|
},
|
|
216
241
|
destroyed () {
|
|
217
|
-
const
|
|
218
|
-
const
|
|
242
|
+
const props = this
|
|
243
|
+
const $xeTable = this.$parent as VxeTableConstructor & VxeTablePrivateMethods
|
|
244
|
+
const tableInternalData = $xeTable as unknown as TableInternalData
|
|
245
|
+
|
|
246
|
+
const { fixedType } = props
|
|
247
|
+
const { elemStore } = tableInternalData
|
|
219
248
|
const prefix = `${fixedType || 'main'}-footer-`
|
|
220
249
|
elemStore[`${prefix}wrapper`] = null
|
|
250
|
+
elemStore[`${prefix}scroll`] = null
|
|
221
251
|
elemStore[`${prefix}table`] = null
|
|
222
252
|
elemStore[`${prefix}colgroup`] = null
|
|
223
253
|
elemStore[`${prefix}list`] = null
|
|
@@ -225,32 +255,33 @@ export default {
|
|
|
225
255
|
},
|
|
226
256
|
render (h: CreateElement) {
|
|
227
257
|
const props = this
|
|
228
|
-
const $xeTable = this.$parent
|
|
258
|
+
const $xeTable = this.$parent as VxeTableConstructor & VxeTablePrivateMethods
|
|
229
259
|
const tableProps = $xeTable
|
|
230
|
-
const tableReactData = $xeTable
|
|
231
|
-
const tableInternalData = $xeTable
|
|
260
|
+
const tableReactData = $xeTable as unknown as TableReactData
|
|
261
|
+
const tableInternalData = $xeTable as unknown as TableInternalData
|
|
232
262
|
|
|
233
|
-
const {
|
|
234
|
-
const { fixedType, fixedColumn, tableColumn } = props
|
|
263
|
+
const { xID } = $xeTable
|
|
235
264
|
|
|
265
|
+
const { fixedType, fixedColumn, tableColumn } = props
|
|
236
266
|
const { spanMethod, footerSpanMethod, showFooterOverflow: allColumnFooterOverflow } = tableProps
|
|
237
267
|
const { visibleColumn, fullColumnIdData } = tableInternalData
|
|
238
|
-
const { isGroup, scrollXLoad, scrollYLoad,
|
|
239
|
-
|
|
240
|
-
let renderColumnList = tableColumn
|
|
268
|
+
const { isGroup, scrollXLoad, scrollYLoad, dragCol } = tableReactData
|
|
241
269
|
|
|
270
|
+
let renderColumnList = tableColumn as VxeTableDefines.ColumnInfo[]
|
|
271
|
+
let isOptimizeMode = false
|
|
242
272
|
// 如果是使用优化模式
|
|
243
|
-
if (
|
|
244
|
-
|
|
245
|
-
if (scrollXLoad || scrollYLoad || allColumnFooterOverflow) {
|
|
273
|
+
if (scrollXLoad || scrollYLoad || allColumnFooterOverflow) {
|
|
274
|
+
if (spanMethod || footerSpanMethod) {
|
|
246
275
|
// 如果不支持优化模式
|
|
247
|
-
if (spanMethod || footerSpanMethod) {
|
|
248
|
-
renderColumnList = visibleColumn
|
|
249
|
-
} else {
|
|
250
|
-
renderColumnList = fixedColumn || []
|
|
251
|
-
}
|
|
252
276
|
} else {
|
|
253
|
-
|
|
277
|
+
isOptimizeMode = true
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
if (fixedType) {
|
|
282
|
+
renderColumnList = visibleColumn
|
|
283
|
+
if (isOptimizeMode) {
|
|
284
|
+
renderColumnList = fixedColumn || []
|
|
254
285
|
}
|
|
255
286
|
}
|
|
256
287
|
|
|
@@ -279,106 +310,59 @@ export default {
|
|
|
279
310
|
}
|
|
280
311
|
}
|
|
281
312
|
|
|
282
|
-
const ons: Record<string, any> = {}
|
|
283
|
-
if (!fixedType) {
|
|
284
|
-
ons.scroll = this.scrollEvent
|
|
285
|
-
}
|
|
286
|
-
|
|
287
313
|
return h('div', {
|
|
314
|
+
ref: 'refElem',
|
|
288
315
|
class: ['vxe-table--footer-wrapper', fixedType ? `fixed-${fixedType}--wrapper` : 'body--wrapper'],
|
|
289
316
|
attrs: {
|
|
290
|
-
xid:
|
|
291
|
-
}
|
|
292
|
-
on: ons
|
|
317
|
+
xid: xID
|
|
318
|
+
}
|
|
293
319
|
}, [
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
:
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
attrs: {
|
|
303
|
-
xid: tId,
|
|
304
|
-
cellspacing: 0,
|
|
305
|
-
cellpadding: 0,
|
|
306
|
-
border: 0
|
|
307
|
-
},
|
|
308
|
-
ref: 'table'
|
|
320
|
+
h('div', {
|
|
321
|
+
ref: 'refFooterScroll',
|
|
322
|
+
class: 'vxe-table--footer-inner-wrapper',
|
|
323
|
+
on: {
|
|
324
|
+
scroll (evnt: Event) {
|
|
325
|
+
$xeTable.triggerFooterScrollEvent(evnt, fixedType)
|
|
326
|
+
}
|
|
327
|
+
}
|
|
309
328
|
}, [
|
|
329
|
+
fixedType
|
|
330
|
+
? renderEmptyElement($xeTable)
|
|
331
|
+
: h('div', {
|
|
332
|
+
ref: 'refFooterXSpace',
|
|
333
|
+
class: 'vxe-body--x-space'
|
|
334
|
+
}),
|
|
335
|
+
h('table', {
|
|
336
|
+
ref: 'refFooterTable',
|
|
337
|
+
class: 'vxe-table--footer',
|
|
338
|
+
attrs: {
|
|
339
|
+
xid: xID,
|
|
340
|
+
cellspacing: 0,
|
|
341
|
+
cellpadding: 0,
|
|
342
|
+
border: 0
|
|
343
|
+
}
|
|
344
|
+
}, [
|
|
310
345
|
/**
|
|
311
346
|
* 列宽
|
|
312
347
|
*/
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
h('col', {
|
|
325
|
-
attrs: {
|
|
326
|
-
name: 'col_gutter'
|
|
327
|
-
}
|
|
328
|
-
})
|
|
329
|
-
]
|
|
330
|
-
: [])),
|
|
331
|
-
/**
|
|
348
|
+
h('colgroup', {
|
|
349
|
+
ref: 'refFooterColgroup'
|
|
350
|
+
}, renderColumnList.map((column, $columnIndex) => {
|
|
351
|
+
return h('col', {
|
|
352
|
+
attrs: {
|
|
353
|
+
name: column.id
|
|
354
|
+
},
|
|
355
|
+
key: $columnIndex
|
|
356
|
+
})
|
|
357
|
+
})),
|
|
358
|
+
/**
|
|
332
359
|
* 底部
|
|
333
360
|
*/
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
361
|
+
h('tfoot', {
|
|
362
|
+
ref: 'refFooterTFoot'
|
|
363
|
+
}, renderHeads(h, this, renderColumnList))
|
|
364
|
+
])
|
|
337
365
|
])
|
|
338
366
|
])
|
|
339
|
-
}
|
|
340
|
-
methods: {
|
|
341
|
-
/**
|
|
342
|
-
* 滚动处理
|
|
343
|
-
* 如果存在列固定左侧,同步更新滚动状态
|
|
344
|
-
* 如果存在列固定右侧,同步更新滚动状态
|
|
345
|
-
*/
|
|
346
|
-
scrollEvent (evnt: any) {
|
|
347
|
-
const $xeTable = this.$parent
|
|
348
|
-
const tableInternalData = $xeTable
|
|
349
|
-
|
|
350
|
-
const { inVirtualScroll, inBodyScroll } = tableInternalData
|
|
351
|
-
if (inVirtualScroll) {
|
|
352
|
-
return
|
|
353
|
-
}
|
|
354
|
-
if (inBodyScroll) {
|
|
355
|
-
return
|
|
356
|
-
}
|
|
357
|
-
const { fixedType } = this
|
|
358
|
-
const { tableHeader, tableBody, tableFooter } = $xeTable.$refs
|
|
359
|
-
const headerElem = tableHeader ? tableHeader.$el as HTMLDivElement : null
|
|
360
|
-
const footerElem = tableFooter ? tableFooter.$el as HTMLDivElement : null
|
|
361
|
-
if (!footerElem) {
|
|
362
|
-
return
|
|
363
|
-
}
|
|
364
|
-
const bodyElem = tableBody ? tableBody.$el as HTMLDivElement : null
|
|
365
|
-
if (!bodyElem) {
|
|
366
|
-
return
|
|
367
|
-
}
|
|
368
|
-
const xHandleEl = $xeTable.$refs.refScrollXHandleElem as HTMLDivElement
|
|
369
|
-
const scrollLeft = footerElem.scrollLeft
|
|
370
|
-
const isRollX = true
|
|
371
|
-
const isRollY = false
|
|
372
|
-
const scrollTop = bodyElem.scrollTop
|
|
373
|
-
tableInternalData.inFooterScroll = true
|
|
374
|
-
setScrollLeft(xHandleEl, scrollLeft)
|
|
375
|
-
setScrollLeft(headerElem, scrollLeft)
|
|
376
|
-
setScrollLeft(bodyElem, scrollLeft)
|
|
377
|
-
$xeTable.triggerScrollXEvent(evnt)
|
|
378
|
-
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
|
|
379
|
-
type: renderType,
|
|
380
|
-
fixed: fixedType
|
|
381
|
-
})
|
|
382
|
-
}
|
|
383
|
-
} as any
|
|
367
|
+
}
|
|
384
368
|
} as any
|