vxe-table 4.10.6-beta.8 → 4.10.6
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/locale/lang/ar-EG.js +2 -1
- package/es/locale/lang/de-DE.js +2 -1
- package/es/locale/lang/en-US.js +4 -3
- package/es/locale/lang/es-ES.js +2 -1
- package/es/locale/lang/fr-FR.js +2 -1
- package/es/locale/lang/hu-HU.js +2 -1
- package/es/locale/lang/hy-AM.js +2 -1
- package/es/locale/lang/it-IT.js +2 -1
- package/es/locale/lang/ja-JP.js +2 -1
- package/es/locale/lang/ko-KR.js +2 -1
- package/es/locale/lang/nb-NO.js +2 -1
- package/es/locale/lang/pt-BR.js +2 -1
- package/es/locale/lang/ru-RU.js +4 -3
- package/es/locale/lang/th-TH.js +2 -1
- package/es/locale/lang/ug-CN.js +2 -1
- package/es/locale/lang/uk-UA.js +518 -517
- package/es/locale/lang/vi-VN.js +2 -1
- package/es/locale/lang/zh-CHT.js +2 -1
- package/es/locale/lang/zh-CN.js +2 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/edit/hook.js +7 -7
- package/es/table/module/export/hook.js +97 -62
- package/es/table/module/keyboard/hook.js +63 -27
- package/es/table/src/body.js +128 -81
- package/es/table/src/cell.js +41 -55
- package/es/table/src/column.js +13 -1
- package/es/table/src/columnInfo.js +3 -0
- package/es/table/src/emits.js +2 -0
- package/es/table/src/footer.js +48 -10
- package/es/table/src/header.js +70 -168
- package/es/table/src/props.js +14 -4
- package/es/table/src/table.js +884 -426
- package/es/table/src/util.js +77 -62
- package/es/table/style.css +253 -189
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +26 -11
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +253 -189
- 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 +1533 -917
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/ar-EG.js +2 -1
- package/lib/locale/lang/ar-EG.min.js +1 -1
- package/lib/locale/lang/de-DE.js +2 -1
- package/lib/locale/lang/de-DE.min.js +1 -1
- package/lib/locale/lang/en-US.js +4 -3
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +4 -3
- package/lib/locale/lang/es-ES.js +2 -1
- package/lib/locale/lang/es-ES.min.js +1 -1
- package/lib/locale/lang/es-ES.umd.js +2 -1
- package/lib/locale/lang/fr-FR.js +2 -1
- package/lib/locale/lang/fr-FR.min.js +1 -1
- package/lib/locale/lang/hu-HU.js +2 -1
- package/lib/locale/lang/hu-HU.min.js +1 -1
- package/lib/locale/lang/hu-HU.umd.js +2 -1
- package/lib/locale/lang/hy-AM.js +2 -1
- package/lib/locale/lang/hy-AM.min.js +1 -1
- package/lib/locale/lang/it-IT.js +2 -1
- package/lib/locale/lang/it-IT.min.js +1 -1
- package/lib/locale/lang/ja-JP.js +2 -1
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +2 -1
- package/lib/locale/lang/ko-KR.js +2 -1
- package/lib/locale/lang/ko-KR.min.js +1 -1
- package/lib/locale/lang/ko-KR.umd.js +2 -1
- package/lib/locale/lang/nb-NO.js +2 -1
- package/lib/locale/lang/nb-NO.min.js +1 -1
- package/lib/locale/lang/pt-BR.js +2 -1
- package/lib/locale/lang/pt-BR.min.js +1 -1
- package/lib/locale/lang/pt-BR.umd.js +2 -1
- package/lib/locale/lang/ru-RU.js +4 -3
- package/lib/locale/lang/ru-RU.min.js +1 -1
- package/lib/locale/lang/ru-RU.umd.js +4 -3
- package/lib/locale/lang/th-TH.js +2 -1
- package/lib/locale/lang/th-TH.min.js +1 -1
- package/lib/locale/lang/ug-CN.js +2 -1
- package/lib/locale/lang/ug-CN.min.js +1 -1
- package/lib/locale/lang/uk-UA.js +518 -517
- package/lib/locale/lang/uk-UA.min.js +1 -1
- package/lib/locale/lang/uk-UA.umd.js +518 -517
- package/lib/locale/lang/vi-VN.js +2 -1
- package/lib/locale/lang/vi-VN.min.js +1 -1
- package/lib/locale/lang/zh-CHT.js +2 -1
- package/lib/locale/lang/zh-CHT.min.js +1 -1
- package/lib/locale/lang/zh-CN.js +2 -1
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +2 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/module/edit/hook.js +7 -2
- package/lib/table/module/edit/hook.min.js +1 -1
- package/lib/table/module/export/hook.js +97 -57
- package/lib/table/module/export/hook.min.js +1 -1
- package/lib/table/module/keyboard/hook.js +71 -28
- package/lib/table/module/keyboard/hook.min.js +1 -1
- package/lib/table/src/body.js +129 -80
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/cell.js +32 -42
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/column.js +13 -1
- package/lib/table/src/column.min.js +1 -1
- package/lib/table/src/columnInfo.js +3 -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/footer.js +48 -8
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/header.js +54 -181
- package/lib/table/src/header.min.js +1 -1
- package/lib/table/src/props.js +14 -4
- package/lib/table/src/props.min.js +1 -1
- package/lib/table/src/table.js +935 -417
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +100 -82
- package/lib/table/src/util.min.js +1 -1
- package/lib/table/style/style.css +253 -189
- package/lib/table/style/style.min.css +1 -1
- package/lib/ui/index.js +26 -11
- 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 +253 -189
- 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/locale/lang/ar-EG.ts +2 -1
- package/packages/locale/lang/de-DE.ts +2 -1
- package/packages/locale/lang/en-US.ts +4 -3
- package/packages/locale/lang/es-ES.ts +2 -1
- package/packages/locale/lang/fr-FR.ts +2 -1
- package/packages/locale/lang/hu-HU.ts +2 -1
- package/packages/locale/lang/hy-AM.ts +2 -1
- package/packages/locale/lang/it-IT.ts +2 -1
- package/packages/locale/lang/ja-JP.ts +2 -1
- package/packages/locale/lang/ko-KR.ts +2 -1
- package/packages/locale/lang/nb-NO.ts +2 -1
- package/packages/locale/lang/pt-BR.ts +2 -1
- package/packages/locale/lang/ru-RU.ts +4 -3
- package/packages/locale/lang/th-TH.ts +2 -1
- package/packages/locale/lang/ug-CN.ts +2 -1
- package/packages/locale/lang/uk-UA.ts +518 -517
- package/packages/locale/lang/vi-VN.ts +2 -1
- package/packages/locale/lang/zh-CHT.ts +2 -1
- package/packages/locale/lang/zh-CN.ts +2 -1
- package/packages/table/module/edit/hook.ts +7 -7
- package/packages/table/module/export/hook.ts +118 -65
- package/packages/table/module/keyboard/hook.ts +59 -25
- package/packages/table/src/body.ts +148 -91
- package/packages/table/src/cell.ts +41 -63
- package/packages/table/src/column.ts +13 -1
- package/packages/table/src/columnInfo.ts +3 -0
- package/packages/table/src/emits.ts +5 -1
- package/packages/table/src/footer.ts +51 -11
- package/packages/table/src/header.ts +70 -168
- package/packages/table/src/props.ts +14 -5
- package/packages/table/src/table.ts +890 -428
- package/packages/table/src/util.ts +81 -62
- package/packages/ui/index.ts +25 -10
- package/styles/components/table.scss +319 -271
- package/styles/theme/base.scss +4 -6
- package/styles/theme/dark.scss +1 -0
- package/styles/theme/light.scss +1 -0
- package/styles/variable.scss +1 -1
- /package/es/{iconfont.1736840923205.ttf → iconfont.1738985856004.ttf} +0 -0
- /package/es/{iconfont.1736840923205.woff → iconfont.1738985856004.woff} +0 -0
- /package/es/{iconfont.1736840923205.woff2 → iconfont.1738985856004.woff2} +0 -0
- /package/lib/{iconfont.1736840923205.ttf → iconfont.1738985856004.ttf} +0 -0
- /package/lib/{iconfont.1736840923205.woff → iconfont.1738985856004.woff} +0 -0
- /package/lib/{iconfont.1736840923205.woff2 → iconfont.1738985856004.woff2} +0 -0
|
@@ -6,7 +6,7 @@ import { updateCellTitle, getPropClass } from '../../ui/src/dom'
|
|
|
6
6
|
import { isEnableConf } from '../../ui/src/utils'
|
|
7
7
|
import { getSlotVNs } from '../../ui/src/vn'
|
|
8
8
|
|
|
9
|
-
import type { VxeTablePrivateMethods, VxeTableConstructor, VxeTableDefines,
|
|
9
|
+
import type { VxeTablePrivateMethods, VxeTableConstructor, VxeTableDefines, VxeComponentSlotType } from '../../../types'
|
|
10
10
|
|
|
11
11
|
const { getI18n, renderer, renderEmptyElement } = VxeUI
|
|
12
12
|
|
|
@@ -24,10 +24,10 @@ export default defineComponent({
|
|
|
24
24
|
}
|
|
25
25
|
},
|
|
26
26
|
setup (props) {
|
|
27
|
-
const $xeTable = inject('$xeTable', {} as VxeTableConstructor &
|
|
27
|
+
const $xeTable = inject('$xeTable', {} as VxeTableConstructor & VxeTablePrivateMethods)
|
|
28
28
|
|
|
29
29
|
const { xID, props: tableProps, context: tableContext, reactData: tableReactData, internalData: tableInternalData } = $xeTable
|
|
30
|
-
const { computeEditOpts, computeMouseOpts, computeAreaOpts, computeDefaultRowHeight, computeEmptyOpts, computeTooltipOpts, computeRadioOpts, computeExpandOpts, computeTreeOpts, computeCheckboxOpts, computeCellOpts, computeValidOpts, computeRowOpts, computeColumnOpts, computeRowDragOpts, computeColumnDragOpts, computeLeftFixedWidth, computeRightFixedWidth } = $xeTable.getComputeMaps()
|
|
30
|
+
const { computeEditOpts, computeMouseOpts, computeAreaOpts, computeDefaultRowHeight, computeEmptyOpts, computeTooltipOpts, computeRadioOpts, computeExpandOpts, computeTreeOpts, computeCheckboxOpts, computeCellOpts, computeValidOpts, computeRowOpts, computeColumnOpts, computeRowDragOpts, computeColumnDragOpts, computeLeftFixedWidth, computeRightFixedWidth, computeResizableOpts } = $xeTable.getComputeMaps()
|
|
31
31
|
|
|
32
32
|
const refElem = ref() as Ref<HTMLDivElement>
|
|
33
33
|
const refBodyScroll = ref() as Ref<HTMLDivElement>
|
|
@@ -41,11 +41,11 @@ export default defineComponent({
|
|
|
41
41
|
// 滚动、拖动过程中不需要触发
|
|
42
42
|
const isVMScrollProcess = () => {
|
|
43
43
|
const { delayHover } = tableProps
|
|
44
|
-
const { lastScrollTime,
|
|
45
|
-
return !!(
|
|
44
|
+
const { lastScrollTime, isDragResize } = tableReactData
|
|
45
|
+
return !!(isDragResize || (lastScrollTime && Date.now() < lastScrollTime + (delayHover as number)))
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
const renderLine = (params: VxeTableDefines.CellRenderBodyParams) => {
|
|
48
|
+
const renderLine = (params: VxeTableDefines.CellRenderBodyParams, cellHeight: number) => {
|
|
49
49
|
const { row, column } = params
|
|
50
50
|
const { afterFullData } = tableInternalData
|
|
51
51
|
const { treeConfig } = tableProps
|
|
@@ -67,12 +67,14 @@ export default defineComponent({
|
|
|
67
67
|
if (treeConfig && treeNode && (treeOpts.showLine || treeOpts.line)) {
|
|
68
68
|
return [
|
|
69
69
|
h('div', {
|
|
70
|
+
key: 'tl',
|
|
70
71
|
class: 'vxe-tree--line-wrapper'
|
|
71
72
|
}, [
|
|
72
73
|
h('div', {
|
|
73
74
|
class: 'vxe-tree--line',
|
|
74
75
|
style: {
|
|
75
76
|
height: `${isFirstRow ? 1 : calcTreeLine(params, prevRow)}px`,
|
|
77
|
+
bottom: `-${Math.floor(cellHeight / 2)}px`,
|
|
76
78
|
left: `${(rLevel * treeOpts.indent) + (rLevel ? 2 - getOffsetSize($xeTable) : 0) + 16}px`
|
|
77
79
|
}
|
|
78
80
|
})
|
|
@@ -88,7 +90,7 @@ export default defineComponent({
|
|
|
88
90
|
const renderTdColumn = (
|
|
89
91
|
seq: number | string,
|
|
90
92
|
rowid: string,
|
|
91
|
-
fixedType:
|
|
93
|
+
fixedType: 'left' | 'right' | '',
|
|
92
94
|
isOptimizeMode: boolean,
|
|
93
95
|
rowLevel: number,
|
|
94
96
|
row: any,
|
|
@@ -101,26 +103,30 @@ export default defineComponent({
|
|
|
101
103
|
items: any[]
|
|
102
104
|
) => {
|
|
103
105
|
const { fullAllDataRowIdData } = tableInternalData
|
|
104
|
-
const { columnKey,
|
|
105
|
-
const { tableData, overflowX, currentColumn, scrollXLoad, scrollYLoad,
|
|
106
|
+
const { columnKey, resizable: allResizable, border, height, cellClassName: allCellClassName, cellStyle, align: allAlign, spanMethod, mouseConfig, editConfig, editRules, tooltipConfig, padding: allPadding } = tableProps
|
|
107
|
+
const { tableData, overflowX, currentColumn, scrollXLoad, scrollYLoad, calcCellHeightFlag, resizeHeightFlag, mergeList, editStore, isAllOverflow, validErrorMaps } = tableReactData
|
|
106
108
|
const { afterFullData, scrollXStore, scrollYStore } = tableInternalData
|
|
107
109
|
const cellOpts = computeCellOpts.value
|
|
108
110
|
const validOpts = computeValidOpts.value
|
|
109
111
|
const checkboxOpts = computeCheckboxOpts.value
|
|
110
112
|
const editOpts = computeEditOpts.value
|
|
111
113
|
const tooltipOpts = computeTooltipOpts.value
|
|
114
|
+
const resizableOpts = computeResizableOpts.value
|
|
115
|
+
const { isAllColumnDrag, isAllRowDrag } = resizableOpts
|
|
112
116
|
const rowOpts = computeRowOpts.value
|
|
113
117
|
const rowDragOpts = computeRowDragOpts.value
|
|
114
118
|
const defaultRowHeight = computeDefaultRowHeight.value
|
|
119
|
+
const customCellHeight = cellOpts.height || rowOpts.height
|
|
120
|
+
const currCellHeight = customCellHeight || defaultRowHeight
|
|
115
121
|
const { disabledMethod: dragDisabledMethod, isCrossDrag, isPeerDrag } = rowDragOpts
|
|
116
122
|
const columnOpts = computeColumnOpts.value
|
|
117
123
|
const mouseOpts = computeMouseOpts.value
|
|
118
124
|
const areaOpts = computeAreaOpts.value
|
|
119
125
|
const { selectCellToRow } = areaOpts
|
|
120
|
-
const { type, cellRender, editRender, align, showOverflow, className, treeNode, slots } = column
|
|
121
|
-
const { verticalAlign } = cellOpts
|
|
126
|
+
const { type, cellRender, editRender, align, showOverflow, className, treeNode, rowResize, padding, verticalAlign, slots } = column
|
|
127
|
+
const { verticalAlign: allVerticalAlign } = cellOpts
|
|
122
128
|
const { actived } = editStore
|
|
123
|
-
const
|
|
129
|
+
const rowRest = fullAllDataRowIdData[rowid]
|
|
124
130
|
const colid = column.id
|
|
125
131
|
const renderOpts = editRender || cellRender
|
|
126
132
|
const compConf = renderOpts ? renderer.get(renderOpts.name) : null
|
|
@@ -130,21 +136,27 @@ export default defineComponent({
|
|
|
130
136
|
const columnIndex = $xeTable.getColumnIndex(column)
|
|
131
137
|
const _columnIndex = $xeTable.getVTColumnIndex(column)
|
|
132
138
|
const isEdit = isEnableConf(editRender)
|
|
139
|
+
const resizeHeight = resizeHeightFlag ? rowRest.resizeHeight : 0
|
|
133
140
|
let fixedHiddenColumn = fixedType ? column.fixed !== fixedType : column.fixed && overflowX
|
|
134
|
-
const
|
|
141
|
+
const isCellPadding = XEUtils.eqNull(padding) ? (allPadding === null ? cellOpts.padding : allPadding) : padding
|
|
142
|
+
const cellOverflow = XEUtils.eqNull(showOverflow) ? isAllOverflow : showOverflow
|
|
135
143
|
const showEllipsis = cellOverflow === 'ellipsis'
|
|
136
144
|
const showTitle = cellOverflow === 'title'
|
|
137
145
|
const showTooltip = cellOverflow === true || cellOverflow === 'tooltip'
|
|
138
|
-
|
|
139
|
-
const
|
|
146
|
+
const hasEllipsis = isAllOverflow || showTitle || showTooltip || showEllipsis
|
|
147
|
+
const showResizable = (XEUtils.isBoolean(column.resizable) ? column.resizable : (columnOpts.resizable || allResizable))
|
|
148
|
+
const isCsHeight = !!customCellHeight
|
|
149
|
+
const isRsHeight = resizeHeight > 0
|
|
140
150
|
let isDirty
|
|
141
151
|
const tdOns: any = {}
|
|
142
|
-
const rest = fullAllDataRowIdData[rowid]
|
|
143
152
|
const cellAlign = align || (compConf ? compConf.tableCellAlign : '') || allAlign
|
|
153
|
+
const cellVerticalAlign = XEUtils.eqNull(verticalAlign) ? allVerticalAlign : verticalAlign
|
|
144
154
|
const errorValidItem = validErrorMaps[`${rowid}:${colid}`]
|
|
145
155
|
const showValidTip = editRules && validOpts.showMessage && (validOpts.message === 'default' ? (height || tableData.length > 1) : validOpts.message === 'inline')
|
|
146
|
-
const
|
|
147
|
-
const
|
|
156
|
+
const tdAttrs: any = { colid }
|
|
157
|
+
const cellParams: VxeTableDefines.CellRenderBodyParams & {
|
|
158
|
+
$table: VxeTableConstructor<any> & VxeTablePrivateMethods
|
|
159
|
+
} = {
|
|
148
160
|
$table: $xeTable,
|
|
149
161
|
$grid: $xeTable.xegrid,
|
|
150
162
|
isEdit: false,
|
|
@@ -172,7 +184,7 @@ export default defineComponent({
|
|
|
172
184
|
isRowDragCell = rowDragOpts.trigger === 'row' || (column.dragSort && rowDragOpts.trigger === 'cell')
|
|
173
185
|
}
|
|
174
186
|
if (isRowDragCell) {
|
|
175
|
-
isDisabledDrag = !!(dragDisabledMethod && dragDisabledMethod(
|
|
187
|
+
isDisabledDrag = !!(dragDisabledMethod && dragDisabledMethod(cellParams))
|
|
176
188
|
}
|
|
177
189
|
// hover 进入事件
|
|
178
190
|
if (showTitle || showTooltip || showAllTip || tooltipConfig) {
|
|
@@ -184,9 +196,9 @@ export default defineComponent({
|
|
|
184
196
|
updateCellTitle(evnt.currentTarget, column)
|
|
185
197
|
} else if (showTooltip || showAllTip) {
|
|
186
198
|
// 如果配置了显示 tooltip
|
|
187
|
-
$xeTable.triggerBodyTooltipEvent(evnt,
|
|
199
|
+
$xeTable.triggerBodyTooltipEvent(evnt, cellParams)
|
|
188
200
|
}
|
|
189
|
-
$xeTable.dispatchEvent('cell-mouseenter', Object.assign({ cell: evnt.currentTarget },
|
|
201
|
+
$xeTable.dispatchEvent('cell-mouseenter', Object.assign({ cell: evnt.currentTarget }, cellParams), evnt)
|
|
190
202
|
}
|
|
191
203
|
}
|
|
192
204
|
// hover 退出事件
|
|
@@ -198,13 +210,13 @@ export default defineComponent({
|
|
|
198
210
|
if (showTooltip || showAllTip) {
|
|
199
211
|
$xeTable.handleTargetLeaveEvent(evnt)
|
|
200
212
|
}
|
|
201
|
-
$xeTable.dispatchEvent('cell-mouseleave', Object.assign({ cell: evnt.currentTarget },
|
|
213
|
+
$xeTable.dispatchEvent('cell-mouseleave', Object.assign({ cell: evnt.currentTarget }, cellParams), evnt)
|
|
202
214
|
}
|
|
203
215
|
}
|
|
204
216
|
// 按下事件处理
|
|
205
217
|
if (isRowDragCell || checkboxOpts.range || mouseConfig) {
|
|
206
218
|
tdOns.onMousedown = (evnt: MouseEvent) => {
|
|
207
|
-
$xeTable.triggerCellMousedownEvent(evnt,
|
|
219
|
+
$xeTable.triggerCellMousedownEvent(evnt, cellParams)
|
|
208
220
|
}
|
|
209
221
|
}
|
|
210
222
|
// 拖拽列事件
|
|
@@ -213,11 +225,11 @@ export default defineComponent({
|
|
|
213
225
|
}
|
|
214
226
|
// 点击事件处理
|
|
215
227
|
tdOns.onClick = (evnt: MouseEvent) => {
|
|
216
|
-
$xeTable.triggerCellClickEvent(evnt,
|
|
228
|
+
$xeTable.triggerCellClickEvent(evnt, cellParams)
|
|
217
229
|
}
|
|
218
230
|
// 双击事件处理
|
|
219
231
|
tdOns.onDblclick = (evnt: MouseEvent) => {
|
|
220
|
-
$xeTable.triggerCellDblclickEvent(evnt,
|
|
232
|
+
$xeTable.triggerCellDblclickEvent(evnt, cellParams)
|
|
221
233
|
}
|
|
222
234
|
// 合并行或列
|
|
223
235
|
if (mergeList.length) {
|
|
@@ -228,28 +240,28 @@ export default defineComponent({
|
|
|
228
240
|
return null
|
|
229
241
|
}
|
|
230
242
|
if (rowspan > 1) {
|
|
231
|
-
|
|
243
|
+
tdAttrs.rowspan = rowspan
|
|
232
244
|
}
|
|
233
245
|
if (colspan > 1) {
|
|
234
|
-
|
|
246
|
+
tdAttrs.colspan = colspan
|
|
235
247
|
}
|
|
236
248
|
}
|
|
237
249
|
} else if (spanMethod) {
|
|
238
250
|
// 自定义合并行或列的方法
|
|
239
|
-
const { rowspan = 1, colspan = 1 } = spanMethod(
|
|
251
|
+
const { rowspan = 1, colspan = 1 } = spanMethod(cellParams) || {}
|
|
240
252
|
if (!rowspan || !colspan) {
|
|
241
253
|
return null
|
|
242
254
|
}
|
|
243
255
|
if (rowspan > 1) {
|
|
244
|
-
|
|
256
|
+
tdAttrs.rowspan = rowspan
|
|
245
257
|
}
|
|
246
258
|
if (colspan > 1) {
|
|
247
|
-
|
|
259
|
+
tdAttrs.colspan = colspan
|
|
248
260
|
}
|
|
249
261
|
}
|
|
250
262
|
// 如果被合并不可隐藏
|
|
251
263
|
if (fixedHiddenColumn && mergeList) {
|
|
252
|
-
if (
|
|
264
|
+
if (tdAttrs.colspan > 1 || tdAttrs.rowspan > 1) {
|
|
253
265
|
fixedHiddenColumn = false
|
|
254
266
|
}
|
|
255
267
|
}
|
|
@@ -257,42 +269,80 @@ export default defineComponent({
|
|
|
257
269
|
if (!fixedHiddenColumn && editConfig && (editRender || cellRender) && (editOpts.showStatus || editOpts.showUpdateStatus)) {
|
|
258
270
|
isDirty = $xeTable.isUpdateByRow(row, column.field)
|
|
259
271
|
}
|
|
272
|
+
|
|
273
|
+
const isVNAutoHeight = scrollYLoad && !hasEllipsis
|
|
274
|
+
let cellHeight = currCellHeight
|
|
275
|
+
const vnHeight = calcCellHeightFlag ? rowRest.height : 0
|
|
276
|
+
if (resizeHeight) {
|
|
277
|
+
cellHeight = resizeHeight
|
|
278
|
+
} else {
|
|
279
|
+
if (scrollYLoad) {
|
|
280
|
+
if (!hasEllipsis) {
|
|
281
|
+
cellHeight = vnHeight || currCellHeight
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
const isLastColumn = $columnIndex === columns.length - 1
|
|
287
|
+
const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto')
|
|
288
|
+
|
|
289
|
+
let isVNPreEmptyStatus = false
|
|
290
|
+
if (scrollYLoad && (_rowIndex < scrollYStore.visibleStartIndex - scrollYStore.preloadSize || _rowIndex > scrollYStore.visibleEndIndex + scrollYStore.preloadSize)) {
|
|
291
|
+
isVNPreEmptyStatus = true
|
|
292
|
+
} else if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
|
|
293
|
+
isVNPreEmptyStatus = true
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
const tcStyle: Record<string, string> = {}
|
|
297
|
+
if (scrollYLoad || hasEllipsis || isCsHeight || isRsHeight) {
|
|
298
|
+
tcStyle.height = `${cellHeight}px`
|
|
299
|
+
} else {
|
|
300
|
+
tcStyle.minHeight = `${cellHeight}px`
|
|
301
|
+
}
|
|
302
|
+
|
|
260
303
|
const tdVNs: any[] = []
|
|
261
|
-
if (fixedHiddenColumn &&
|
|
304
|
+
if (fixedHiddenColumn && isAllOverflow) {
|
|
262
305
|
tdVNs.push(
|
|
263
306
|
h('div', {
|
|
307
|
+
key: 'tc',
|
|
264
308
|
class: ['vxe-cell', {
|
|
265
309
|
'c--title': showTitle,
|
|
266
310
|
'c--tooltip': showTooltip,
|
|
267
311
|
'c--ellipsis': showEllipsis
|
|
268
312
|
}],
|
|
269
|
-
style:
|
|
270
|
-
maxHeight: hasEllipsis && (customRHeight || defaultRowHeight) ? `${customRHeight || defaultRowHeight}px` : ''
|
|
271
|
-
}
|
|
313
|
+
style: tcStyle
|
|
272
314
|
})
|
|
273
315
|
)
|
|
274
316
|
} else {
|
|
275
317
|
// 渲染单元格
|
|
276
318
|
tdVNs.push(
|
|
277
|
-
...renderLine(
|
|
319
|
+
...renderLine(cellParams, cellHeight),
|
|
278
320
|
h('div', {
|
|
321
|
+
key: 'tc',
|
|
279
322
|
class: ['vxe-cell', {
|
|
280
323
|
'c--title': showTitle,
|
|
281
324
|
'c--tooltip': showTooltip,
|
|
282
325
|
'c--ellipsis': showEllipsis
|
|
283
326
|
}],
|
|
284
|
-
style:
|
|
285
|
-
maxHeight: hasEllipsis && (customRHeight || defaultRowHeight) ? `${customRHeight || defaultRowHeight}px` : ''
|
|
286
|
-
},
|
|
327
|
+
style: tcStyle,
|
|
287
328
|
title: showTitle ? $xeTable.getCellLabel(row, column) : null
|
|
288
|
-
},
|
|
329
|
+
}, isVNPreEmptyStatus
|
|
330
|
+
? []
|
|
331
|
+
: [
|
|
332
|
+
h('div', {
|
|
333
|
+
colid,
|
|
334
|
+
rowid,
|
|
335
|
+
class: 'vxe-cell--wrapper'
|
|
336
|
+
}, column.renderCell(cellParams))
|
|
337
|
+
])
|
|
289
338
|
)
|
|
290
339
|
if (showValidTip && errorValidItem) {
|
|
291
340
|
const errRule = errorValidItem.rule
|
|
292
341
|
const validSlot = slots ? slots.valid : null
|
|
293
|
-
const validParams = { ...
|
|
342
|
+
const validParams = { ...cellParams, ...errorValidItem, rule: errorValidItem }
|
|
294
343
|
tdVNs.push(
|
|
295
344
|
h('div', {
|
|
345
|
+
key: 'tcv',
|
|
296
346
|
class: ['vxe-cell--valid-error-tip', getPropClass(validOpts.className, validParams)],
|
|
297
347
|
style: errRule && errRule.maxWidth
|
|
298
348
|
? {
|
|
@@ -315,54 +365,60 @@ export default defineComponent({
|
|
|
315
365
|
)
|
|
316
366
|
}
|
|
317
367
|
}
|
|
318
|
-
let cellHeight = ''
|
|
319
|
-
const vnHeight = isCalcCellHeight ? rest.height : 0
|
|
320
|
-
if (hasEllipsis) {
|
|
321
|
-
if (customRHeight) {
|
|
322
|
-
cellHeight = `${customRHeight}px`
|
|
323
|
-
} else if (!isAllOverflow) {
|
|
324
|
-
cellHeight = `${vnHeight || defaultRowHeight || 18}px`
|
|
325
|
-
}
|
|
326
|
-
} else {
|
|
327
|
-
cellHeight = `${vnHeight || defaultRowHeight || 18}px`
|
|
328
|
-
}
|
|
329
368
|
|
|
369
|
+
let showAreaRowStatus = false
|
|
330
370
|
if (mouseConfig && mouseOpts.area && selectCellToRow) {
|
|
331
371
|
if (
|
|
332
|
-
(
|
|
372
|
+
(!_columnIndex && selectCellToRow === true) ||
|
|
333
373
|
(selectCellToRow === column.field)
|
|
334
374
|
) {
|
|
335
|
-
|
|
336
|
-
h('div', {
|
|
337
|
-
class: 'vxe-cell--area-status'
|
|
338
|
-
})
|
|
339
|
-
)
|
|
375
|
+
showAreaRowStatus = true
|
|
340
376
|
}
|
|
341
377
|
}
|
|
342
|
-
const isLastColumn = $columnIndex === columns.length - 1
|
|
343
|
-
const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto')
|
|
344
378
|
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
379
|
+
if (!fixedHiddenColumn && showResizable && isAllColumnDrag) {
|
|
380
|
+
tdVNs.push(
|
|
381
|
+
h('div', {
|
|
382
|
+
key: 'tcc',
|
|
383
|
+
class: ['vxe-cell--col-resizable', {
|
|
384
|
+
'is--line': !border || border === 'none'
|
|
385
|
+
}],
|
|
386
|
+
onMousedown: (evnt: MouseEvent) => $xeTable.handleColResizeMousedownEvent(evnt, fixedType, cellParams),
|
|
387
|
+
onDblclick: (evnt: MouseEvent) => $xeTable.handleColResizeDblclickEvent(evnt, cellParams)
|
|
388
|
+
})
|
|
389
|
+
)
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
if ((rowResize || isAllRowDrag) && rowOpts.resizable) {
|
|
393
|
+
tdVNs.push(
|
|
394
|
+
h('div', {
|
|
395
|
+
key: 'tcr',
|
|
396
|
+
class: 'vxe-cell--row-resizable',
|
|
397
|
+
onMousedown: (evnt: MouseEvent) => $xeTable.handleRowResizeMousedownEvent(evnt, cellParams),
|
|
398
|
+
onDblclick: (evnt: MouseEvent) => $xeTable.handleRowResizeDblclickEvent(evnt, cellParams)
|
|
399
|
+
})
|
|
400
|
+
)
|
|
350
401
|
}
|
|
351
402
|
|
|
352
403
|
return h('td', {
|
|
353
404
|
class: [
|
|
354
405
|
'vxe-body--column',
|
|
355
406
|
colid,
|
|
407
|
+
cellVerticalAlign ? `col--vertical-${cellVerticalAlign}` : '',
|
|
408
|
+
cellAlign ? `col--${cellAlign}` : '',
|
|
409
|
+
type ? `col--${type}` : '',
|
|
356
410
|
{
|
|
357
|
-
[`col--${cellAlign}`]: cellAlign,
|
|
358
|
-
[`col--vertical-${verticalAlign}`]: verticalAlign,
|
|
359
|
-
[`col--${type}`]: type,
|
|
360
411
|
'col--last': isLastColumn,
|
|
361
412
|
'col--tree-node': treeNode,
|
|
362
413
|
'col--edit': isEdit,
|
|
363
414
|
'col--ellipsis': hasEllipsis,
|
|
415
|
+
'col--cs-height': isCsHeight,
|
|
416
|
+
'col--rs-height': isRsHeight,
|
|
417
|
+
'col--to-row': showAreaRowStatus,
|
|
418
|
+
'col--auto-height': isVNAutoHeight,
|
|
364
419
|
'fixed--width': !isAutoCellWidth,
|
|
365
420
|
'fixed--hidden': fixedHiddenColumn,
|
|
421
|
+
'is--padding': isCellPadding,
|
|
366
422
|
'is--drag-cell': isRowDragCell && (isCrossDrag || isPeerDrag || !rowLevel),
|
|
367
423
|
'is--drag-disabled': isDisabledDrag,
|
|
368
424
|
'col--dirty': isDirty,
|
|
@@ -370,22 +426,20 @@ export default defineComponent({
|
|
|
370
426
|
'col--valid-error': !!errorValidItem,
|
|
371
427
|
'col--current': currentColumn === column
|
|
372
428
|
},
|
|
373
|
-
getPropClass(compCellClassName,
|
|
374
|
-
getPropClass(className,
|
|
375
|
-
getPropClass(allCellClassName,
|
|
429
|
+
getPropClass(compCellClassName, cellParams),
|
|
430
|
+
getPropClass(className, cellParams),
|
|
431
|
+
getPropClass(allCellClassName, cellParams)
|
|
376
432
|
],
|
|
377
433
|
key: columnKey || scrollXLoad || scrollYLoad || columnOpts.useKey || rowOpts.useKey || columnOpts.drag ? colid : $columnIndex,
|
|
378
|
-
...
|
|
379
|
-
style: Object.assign({
|
|
380
|
-
height: cellHeight
|
|
381
|
-
}, XEUtils.isFunction(compCellStyle) ? compCellStyle(params) : compCellStyle, XEUtils.isFunction(cellStyle) ? cellStyle(params) : cellStyle),
|
|
434
|
+
...tdAttrs,
|
|
435
|
+
style: Object.assign({}, XEUtils.isFunction(compCellStyle) ? compCellStyle(cellParams) : compCellStyle, XEUtils.isFunction(cellStyle) ? cellStyle(cellParams) : cellStyle),
|
|
382
436
|
...tdOns
|
|
383
|
-
},
|
|
437
|
+
}, isOptimizeMode && fixedHiddenColumn ? [] : tdVNs)
|
|
384
438
|
}
|
|
385
439
|
|
|
386
|
-
const renderRows = (fixedType:
|
|
387
|
-
const { stripe, rowKey, highlightHoverRow, rowClassName, rowStyle,
|
|
388
|
-
const { hasFixedColumn, treeExpandedMaps, scrollXLoad, scrollYLoad, rowExpandedMaps, expandColumn, selectRadioRow, pendingRowMaps, isDragColMove } = tableReactData
|
|
440
|
+
const renderRows = (fixedType: 'left' | 'right' | '', isOptimizeMode: boolean, tableData: any[], tableColumn: VxeTableDefines.ColumnInfo[]) => {
|
|
441
|
+
const { stripe, rowKey, highlightHoverRow, rowClassName, rowStyle, editConfig, treeConfig } = tableProps
|
|
442
|
+
const { hasFixedColumn, treeExpandedMaps, isColLoading, scrollXLoad, scrollYLoad, isAllOverflow, rowExpandedMaps, expandColumn, selectRadioRow, pendingRowMaps, isDragColMove } = tableReactData
|
|
389
443
|
const { fullAllDataRowIdData } = tableInternalData
|
|
390
444
|
const checkboxOpts = computeCheckboxOpts.value
|
|
391
445
|
const radioOpts = computeRadioOpts.value
|
|
@@ -470,7 +524,7 @@ export default defineComponent({
|
|
|
470
524
|
return renderTdColumn(seq, rowid, fixedType, isOptimizeMode, rowLevel, row, rowIndex, $rowIndex, _rowIndex, column, $columnIndex, tableColumn, tableData)
|
|
471
525
|
})
|
|
472
526
|
rows.push(
|
|
473
|
-
columnOpts.drag && columnDragOpts.animation
|
|
527
|
+
!isColLoading && (columnOpts.drag && columnDragOpts.animation)
|
|
474
528
|
? h(TransitionGroup, {
|
|
475
529
|
name: `vxe-header--col-list${isDragColMove ? '' : '-disabled'}`,
|
|
476
530
|
tag: 'tr',
|
|
@@ -502,7 +556,7 @@ export default defineComponent({
|
|
|
502
556
|
cellStyle.paddingLeft = `${(rowLevel * treeOpts.indent) + 30}px`
|
|
503
557
|
}
|
|
504
558
|
const { showOverflow } = expandColumn
|
|
505
|
-
const hasEllipsis = (XEUtils.isUndefined(showOverflow) || XEUtils.isNull(showOverflow)) ?
|
|
559
|
+
const hasEllipsis = (XEUtils.isUndefined(showOverflow) || XEUtils.isNull(showOverflow)) ? isAllOverflow : showOverflow
|
|
506
560
|
const expandParams = { $table: $xeTable, seq, column: expandColumn, fixed: fixedType, type: renderType, level: rowLevel, row, rowIndex, $rowIndex, _rowIndex }
|
|
507
561
|
rows.push(
|
|
508
562
|
h('tr', {
|
|
@@ -576,8 +630,8 @@ export default defineComponent({
|
|
|
576
630
|
const { slots } = tableContext
|
|
577
631
|
|
|
578
632
|
const { fixedColumn, fixedType, tableColumn } = props
|
|
579
|
-
const {
|
|
580
|
-
const { isGroup, tableData, scrollXLoad, scrollYLoad, isAllOverflow, isDragRowMove, expandColumn, dragRow, dragCol } = tableReactData
|
|
633
|
+
const { spanMethod, footerSpanMethod, mouseConfig } = tableProps
|
|
634
|
+
const { isGroup, tableData, isRowLoading, isColLoading, scrollXLoad, scrollYLoad, isAllOverflow, isDragRowMove, expandColumn, dragRow, dragCol } = tableReactData
|
|
581
635
|
const { visibleColumn, fullAllDataRowIdData, fullColumnIdData } = tableInternalData
|
|
582
636
|
const rowOpts = computeRowOpts.value
|
|
583
637
|
const emptyOpts = computeEmptyOpts.value
|
|
@@ -590,7 +644,7 @@ export default defineComponent({
|
|
|
590
644
|
let renderColumnList = tableColumn as VxeTableDefines.ColumnInfo[]
|
|
591
645
|
let isOptimizeMode = false
|
|
592
646
|
// 如果是使用优化模式
|
|
593
|
-
if (scrollXLoad || scrollYLoad ||
|
|
647
|
+
if (scrollXLoad || scrollYLoad || isAllOverflow) {
|
|
594
648
|
if (expandColumn || spanMethod || footerSpanMethod) {
|
|
595
649
|
// 如果不支持优化模式
|
|
596
650
|
} else {
|
|
@@ -704,21 +758,21 @@ export default defineComponent({
|
|
|
704
758
|
cellpadding: 0,
|
|
705
759
|
border: 0
|
|
706
760
|
}, [
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
761
|
+
/**
|
|
762
|
+
* 列宽
|
|
763
|
+
*/
|
|
710
764
|
h('colgroup', {
|
|
711
765
|
ref: refBodyColgroup
|
|
712
|
-
},
|
|
766
|
+
}, renderColumnList.map((column, $columnIndex) => {
|
|
713
767
|
return h('col', {
|
|
714
768
|
name: column.id,
|
|
715
769
|
key: $columnIndex
|
|
716
770
|
})
|
|
717
771
|
})),
|
|
718
772
|
/**
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
rowOpts.drag && rowDragOpts.animation
|
|
773
|
+
* 内容
|
|
774
|
+
*/
|
|
775
|
+
!(isRowLoading || isColLoading) && (rowOpts.drag && rowDragOpts.animation)
|
|
722
776
|
? h(TransitionGroup, {
|
|
723
777
|
ref: refBodyTBody,
|
|
724
778
|
name: `vxe-body--row-list${isDragRowMove ? '' : '-disabled'}`,
|
|
@@ -762,6 +816,9 @@ export default defineComponent({
|
|
|
762
816
|
}),
|
|
763
817
|
h('span', {
|
|
764
818
|
class: 'vxe-table--cell-active-area'
|
|
819
|
+
}),
|
|
820
|
+
h('span', {
|
|
821
|
+
class: 'vxe-table--cell-row-status-area'
|
|
765
822
|
})
|
|
766
823
|
])
|
|
767
824
|
: renderEmptyElement($xeTable),
|
|
@@ -6,7 +6,7 @@ import { updateCellTitle } from '../../ui/src/dom'
|
|
|
6
6
|
import { createColumn, getRowid } from './util'
|
|
7
7
|
import { getSlotVNs } from '../../ui/src/vn'
|
|
8
8
|
|
|
9
|
-
import type { VxeTableConstructor, VxeTableDefines,
|
|
9
|
+
import type { VxeTableConstructor, VxeTableDefines, VxeTablePrivateMethods, VxeComponentSlotType } from '../../../types'
|
|
10
10
|
|
|
11
11
|
const { getI18n, getIcon, renderer, formats, renderEmptyElement } = VxeUI
|
|
12
12
|
|
|
@@ -173,7 +173,7 @@ function renderTitleContent (params: VxeTableDefines.CellRenderHeaderParams & {
|
|
|
173
173
|
const ons: Record<string, any> = {}
|
|
174
174
|
if (showTitle || showTooltip || showAllTip) {
|
|
175
175
|
ons.onMouseenter = (evnt: MouseEvent) => {
|
|
176
|
-
if (tableReactData.
|
|
176
|
+
if (tableReactData.isDragResize) {
|
|
177
177
|
return
|
|
178
178
|
}
|
|
179
179
|
if (showTitle) {
|
|
@@ -185,7 +185,7 @@ function renderTitleContent (params: VxeTableDefines.CellRenderHeaderParams & {
|
|
|
185
185
|
}
|
|
186
186
|
if (showTooltip || showAllTip) {
|
|
187
187
|
ons.onMouseleave = (evnt: MouseEvent) => {
|
|
188
|
-
if (tableReactData.
|
|
188
|
+
if (tableReactData.isDragResize) {
|
|
189
189
|
return
|
|
190
190
|
}
|
|
191
191
|
if (showTooltip || showAllTip) {
|
|
@@ -207,25 +207,6 @@ function renderTitleContent (params: VxeTableDefines.CellRenderHeaderParams & {
|
|
|
207
207
|
]
|
|
208
208
|
}
|
|
209
209
|
|
|
210
|
-
function formatFooterLabel (footerFormatter: VxeColumnPropTypes.FooterFormatter, params: {
|
|
211
|
-
itemValue: any
|
|
212
|
-
column: VxeTableDefines.ColumnInfo
|
|
213
|
-
row: any
|
|
214
|
-
items: any[]
|
|
215
|
-
_columnIndex: number
|
|
216
|
-
}) {
|
|
217
|
-
if (XEUtils.isFunction(footerFormatter)) {
|
|
218
|
-
return `${footerFormatter(params)}`
|
|
219
|
-
}
|
|
220
|
-
const isArr = XEUtils.isArray(footerFormatter)
|
|
221
|
-
const gFormatOpts = isArr ? formats.get(footerFormatter[0]) : formats.get(footerFormatter)
|
|
222
|
-
const footerFormatMethod = gFormatOpts ? gFormatOpts.tableFooterCellFormatMethod : null
|
|
223
|
-
if (footerFormatMethod) {
|
|
224
|
-
return `${isArr ? footerFormatMethod(params, ...footerFormatter.slice(1)) : footerFormatMethod(params)}`
|
|
225
|
-
}
|
|
226
|
-
return ''
|
|
227
|
-
}
|
|
228
|
-
|
|
229
210
|
function getFooterContent (params: VxeTableDefines.CellRenderFooterParams & { $table: VxeTableConstructor & VxeTablePrivateMethods }) {
|
|
230
211
|
const { $table, column, _columnIndex, items, row } = params
|
|
231
212
|
const { slots, editRender, cellRender, footerFormatter } = column
|
|
@@ -234,42 +215,39 @@ function getFooterContent (params: VxeTableDefines.CellRenderFooterParams & { $t
|
|
|
234
215
|
if (footerSlot) {
|
|
235
216
|
return $table.callSlot(footerSlot, params)
|
|
236
217
|
}
|
|
218
|
+
let itemValue = ''
|
|
219
|
+
// 兼容老模式
|
|
220
|
+
if (XEUtils.isArray(items)) {
|
|
221
|
+
itemValue = items[_columnIndex]
|
|
222
|
+
} else {
|
|
223
|
+
itemValue = XEUtils.get(row, column.field)
|
|
224
|
+
}
|
|
225
|
+
const footParams = Object.assign(params, {
|
|
226
|
+
itemValue
|
|
227
|
+
})
|
|
228
|
+
if (footerFormatter) {
|
|
229
|
+
if (XEUtils.isFunction(footerFormatter)) {
|
|
230
|
+
return `${footerFormatter(footParams)}`
|
|
231
|
+
}
|
|
232
|
+
const isArr = XEUtils.isArray(footerFormatter)
|
|
233
|
+
const gFormatOpts = isArr ? formats.get(footerFormatter[0]) : formats.get(footerFormatter)
|
|
234
|
+
const footerFormatMethod = gFormatOpts ? gFormatOpts.tableFooterCellFormatMethod : null
|
|
235
|
+
if (footerFormatMethod) {
|
|
236
|
+
return `${isArr ? footerFormatMethod(footParams, ...footerFormatter.slice(1)) : footerFormatMethod(footParams)}`
|
|
237
|
+
}
|
|
238
|
+
return ''
|
|
239
|
+
}
|
|
237
240
|
if (renderOpts) {
|
|
238
241
|
const compConf = renderer.get(renderOpts.name)
|
|
239
242
|
if (compConf) {
|
|
240
243
|
const rtFooter = compConf.renderTableFooter || compConf.renderFooter
|
|
241
244
|
if (rtFooter) {
|
|
242
|
-
return getSlotVNs(rtFooter(renderOpts,
|
|
245
|
+
return getSlotVNs(rtFooter(renderOpts, footParams))
|
|
243
246
|
}
|
|
244
247
|
}
|
|
245
248
|
}
|
|
246
|
-
let itemValue = ''
|
|
247
|
-
// 兼容老模式
|
|
248
|
-
if (XEUtils.isArray(items)) {
|
|
249
|
-
itemValue = items[_columnIndex]
|
|
250
|
-
return [
|
|
251
|
-
footerFormatter
|
|
252
|
-
? formatFooterLabel(footerFormatter, {
|
|
253
|
-
itemValue,
|
|
254
|
-
column,
|
|
255
|
-
row,
|
|
256
|
-
items,
|
|
257
|
-
_columnIndex
|
|
258
|
-
})
|
|
259
|
-
: formatText(itemValue, 1)
|
|
260
|
-
]
|
|
261
|
-
}
|
|
262
|
-
itemValue = XEUtils.get(row, column.field)
|
|
263
249
|
return [
|
|
264
|
-
|
|
265
|
-
? formatFooterLabel(footerFormatter, {
|
|
266
|
-
itemValue,
|
|
267
|
-
column,
|
|
268
|
-
row,
|
|
269
|
-
items,
|
|
270
|
-
_columnIndex
|
|
271
|
-
})
|
|
272
|
-
: formatText(itemValue, 1)
|
|
250
|
+
formatText(itemValue, 1)
|
|
273
251
|
]
|
|
274
252
|
}
|
|
275
253
|
|
|
@@ -425,11 +403,7 @@ export const Cell = {
|
|
|
425
403
|
return Cell.renderTreeIcon(params, Cell.renderDefaultCell(params) as VNode[])
|
|
426
404
|
},
|
|
427
405
|
renderDefaultFooter (params: VxeTableDefines.CellRenderFooterParams & { $table: VxeTableConstructor & VxeTablePrivateMethods }) {
|
|
428
|
-
return
|
|
429
|
-
h('span', {
|
|
430
|
-
class: 'vxe-cell--item'
|
|
431
|
-
}, getFooterContent(params))
|
|
432
|
-
]
|
|
406
|
+
return getFooterContent(params)
|
|
433
407
|
},
|
|
434
408
|
|
|
435
409
|
/**
|
|
@@ -911,7 +885,7 @@ export const Cell = {
|
|
|
911
885
|
const { $table, column } = params
|
|
912
886
|
const { computeSortOpts } = $table.getComputeMaps()
|
|
913
887
|
const sortOpts = computeSortOpts.value
|
|
914
|
-
const { showIcon, iconLayout, iconAsc, iconDesc, iconVisibleMethod } = sortOpts
|
|
888
|
+
const { showIcon, allowBtn, iconLayout, iconAsc, iconDesc, iconVisibleMethod } = sortOpts
|
|
915
889
|
const { order } = column
|
|
916
890
|
if (showIcon && (!iconVisibleMethod || iconVisibleMethod(params))) {
|
|
917
891
|
return [
|
|
@@ -923,20 +897,24 @@ export const Cell = {
|
|
|
923
897
|
'sort--active': order === 'asc'
|
|
924
898
|
}],
|
|
925
899
|
title: getI18n('vxe.table.sortAsc'),
|
|
926
|
-
onClick
|
|
927
|
-
evnt
|
|
928
|
-
|
|
929
|
-
|
|
900
|
+
onClick: allowBtn
|
|
901
|
+
? (evnt: Event) => {
|
|
902
|
+
evnt.stopPropagation()
|
|
903
|
+
$table.triggerSortEvent(evnt, column, 'asc')
|
|
904
|
+
}
|
|
905
|
+
: undefined
|
|
930
906
|
}),
|
|
931
907
|
h('i', {
|
|
932
908
|
class: ['vxe-sort--desc-btn', iconDesc || getIcon().TABLE_SORT_DESC, {
|
|
933
909
|
'sort--active': order === 'desc'
|
|
934
910
|
}],
|
|
935
911
|
title: getI18n('vxe.table.sortDesc'),
|
|
936
|
-
onClick
|
|
937
|
-
evnt
|
|
938
|
-
|
|
939
|
-
|
|
912
|
+
onClick: allowBtn
|
|
913
|
+
? (evnt: Event) => {
|
|
914
|
+
evnt.stopPropagation()
|
|
915
|
+
$table.triggerSortEvent(evnt, column, 'desc')
|
|
916
|
+
}
|
|
917
|
+
: undefined
|
|
940
918
|
})
|
|
941
919
|
])
|
|
942
920
|
]
|