vxe-table 3.14.0-beta.9 → 3.14.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 +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 +17 -11
- package/es/table/module/export/export-panel.js +5 -4
- package/es/table/module/export/import-panel.js +8 -7
- package/es/table/module/export/mixin.js +30 -27
- package/es/table/module/filter/panel.js +21 -10
- package/es/table/module/keyboard/mixin.js +141 -41
- package/es/table/module/menu/mixin.js +6 -3
- package/es/table/module/menu/panel.js +7 -7
- package/es/table/module/validator/mixin.js +2 -2
- package/es/table/render/index.js +2 -2
- package/es/table/src/body.js +39 -20
- 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 +761 -698
- package/es/table/src/props.js +4 -0
- package/es/table/src/table.js +85 -49
- 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 +1558 -1232
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/ar-EG.js +7 -1
- package/lib/locale/lang/ar-EG.min.js +1 -1
- package/lib/locale/lang/de-DE.js +7 -1
- package/lib/locale/lang/de-DE.min.js +1 -1
- package/lib/locale/lang/en-US.js +7 -1
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +7 -1
- package/lib/locale/lang/es-ES.js +7 -1
- package/lib/locale/lang/es-ES.min.js +1 -1
- package/lib/locale/lang/es-ES.umd.js +7 -1
- package/lib/locale/lang/fr-FR.js +7 -1
- package/lib/locale/lang/fr-FR.min.js +1 -1
- package/lib/locale/lang/hu-HU.js +7 -1
- package/lib/locale/lang/hu-HU.min.js +1 -1
- package/lib/locale/lang/hu-HU.umd.js +7 -1
- package/lib/locale/lang/hy-AM.js +7 -1
- package/lib/locale/lang/hy-AM.min.js +1 -1
- package/lib/locale/lang/id-ID.js +7 -1
- package/lib/locale/lang/id-ID.min.js +1 -1
- package/lib/locale/lang/it-IT.js +7 -1
- package/lib/locale/lang/it-IT.min.js +1 -1
- package/lib/locale/lang/ja-JP.js +7 -1
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +7 -1
- package/lib/locale/lang/ko-KR.js +7 -1
- package/lib/locale/lang/ko-KR.min.js +1 -1
- package/lib/locale/lang/ko-KR.umd.js +7 -1
- package/lib/locale/lang/nb-NO.js +7 -1
- package/lib/locale/lang/nb-NO.min.js +1 -1
- package/lib/locale/lang/pt-BR.js +7 -1
- package/lib/locale/lang/pt-BR.min.js +1 -1
- package/lib/locale/lang/pt-BR.umd.js +7 -1
- package/lib/locale/lang/ru-RU.js +7 -1
- package/lib/locale/lang/ru-RU.min.js +1 -1
- package/lib/locale/lang/ru-RU.umd.js +7 -1
- package/lib/locale/lang/th-TH.js +7 -1
- package/lib/locale/lang/th-TH.min.js +1 -1
- package/lib/locale/lang/ug-CN.js +7 -1
- package/lib/locale/lang/ug-CN.min.js +1 -1
- package/lib/locale/lang/uk-UA.js +7 -1
- package/lib/locale/lang/uk-UA.min.js +1 -1
- package/lib/locale/lang/uk-UA.umd.js +7 -1
- package/lib/locale/lang/vi-VN.js +7 -1
- package/lib/locale/lang/vi-VN.min.js +1 -1
- package/lib/locale/lang/zh-CHT.js +7 -1
- package/lib/locale/lang/zh-CHT.min.js +1 -1
- package/lib/locale/lang/zh-CHT.umd.js +7 -1
- package/lib/locale/lang/zh-CN.js +7 -1
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +7 -1
- package/lib/style.css +1 -1
- package/lib/table/module/custom/mixin.js +5 -3
- package/lib/table/module/custom/mixin.min.js +1 -1
- package/lib/table/module/custom/panel.js +22 -29
- package/lib/table/module/custom/panel.min.js +1 -1
- package/lib/table/module/edit/mixin.js +19 -13
- package/lib/table/module/edit/mixin.min.js +1 -1
- package/lib/table/module/export/export-panel.js +5 -4
- package/lib/table/module/export/export-panel.min.js +1 -1
- package/lib/table/module/export/import-panel.js +8 -7
- package/lib/table/module/export/import-panel.min.js +1 -1
- package/lib/table/module/export/mixin.js +35 -34
- package/lib/table/module/export/mixin.min.js +1 -1
- package/lib/table/module/filter/panel.js +16 -16
- package/lib/table/module/filter/panel.min.js +1 -1
- package/lib/table/module/keyboard/mixin.js +149 -47
- package/lib/table/module/keyboard/mixin.min.js +1 -1
- package/lib/table/module/menu/mixin.js +6 -3
- package/lib/table/module/menu/mixin.min.js +1 -1
- package/lib/table/module/menu/panel.js +7 -7
- package/lib/table/module/menu/panel.min.js +1 -1
- package/lib/table/module/validator/mixin.js +3 -3
- package/lib/table/module/validator/mixin.min.js +1 -1
- package/lib/table/render/index.js +3 -2
- package/lib/table/render/index.min.js +1 -1
- package/lib/table/src/body.js +47 -20
- 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 +898 -825
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/props.js +4 -0
- package/lib/table/src/props.min.js +1 -1
- package/lib/table/src/table.js +93 -52
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +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 +20 -14
- package/packages/table/module/export/export-panel.ts +8 -5
- package/packages/table/module/export/import-panel.ts +11 -7
- package/packages/table/module/export/mixin.ts +37 -32
- package/packages/table/module/filter/panel.ts +25 -10
- package/packages/table/module/keyboard/mixin.ts +155 -49
- package/packages/table/module/menu/mixin.ts +12 -6
- package/packages/table/module/menu/panel.ts +10 -7
- package/packages/table/module/validator/mixin.ts +2 -2
- package/packages/table/render/index.ts +2 -2
- package/packages/table/src/body.ts +39 -20
- 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 +840 -734
- package/packages/table/src/props.ts +16 -12
- package/packages/table/src/table.ts +99 -52
- package/packages/table/src/util.ts +63 -21
- package/packages/toolbar/src/toolbar.ts +3 -3
- package/packages/ui/index.ts +1 -0
- /package/es/{iconfont.1741336976538.ttf → iconfont.1742955973002.ttf} +0 -0
- /package/es/{iconfont.1741336976538.woff → iconfont.1742955973002.woff} +0 -0
- /package/es/{iconfont.1741336976538.woff2 → iconfont.1742955973002.woff2} +0 -0
- /package/lib/{iconfont.1741336976538.ttf → iconfont.1742955973002.ttf} +0 -0
- /package/lib/{iconfont.1741336976538.woff → iconfont.1742955973002.woff} +0 -0
- /package/lib/{iconfont.1741336976538.woff2 → iconfont.1742955973002.woff2} +0 -0
|
@@ -164,9 +164,11 @@ export default {
|
|
|
164
164
|
// 是否自动根据状态属性去更新响应式表格宽高
|
|
165
165
|
syncResize: [Boolean, String, Number],
|
|
166
166
|
// 响应式布局配置项
|
|
167
|
-
resizeConfig: Object
|
|
167
|
+
resizeConfig: Object as PropType<VxeTablePropTypes.ResizeConfig>,
|
|
168
168
|
// 列配置信息
|
|
169
|
-
columnConfig: Object
|
|
169
|
+
columnConfig: Object as PropType<VxeTablePropTypes.ColumnConfig>,
|
|
170
|
+
// 当前列配置信息
|
|
171
|
+
currentColumnConfig: Object as PropType<VxeTablePropTypes.CurrentColumnConfig>,
|
|
170
172
|
// 单元格配置信息
|
|
171
173
|
cellConfig: Object as PropType<VxeTablePropTypes.CellConfig>,
|
|
172
174
|
// 表头单元格配置信息
|
|
@@ -174,7 +176,9 @@ export default {
|
|
|
174
176
|
// 表尾单元格配置信息
|
|
175
177
|
footerCellConfig: Object as PropType<VxeTablePropTypes.FooterCellConfig>,
|
|
176
178
|
// 行配置信息
|
|
177
|
-
rowConfig: Object
|
|
179
|
+
rowConfig: Object as PropType<VxeTablePropTypes.RowConfig>,
|
|
180
|
+
// 当前行配置信息
|
|
181
|
+
currentRowConfig: Object as PropType<VxeTablePropTypes.CurrentRowConfig>,
|
|
178
182
|
// 已废弃,被 rowDragConfig 替换
|
|
179
183
|
dragConfig: Object as PropType<VxeTablePropTypes.DragConfig>,
|
|
180
184
|
// 行拖拽排序配置项
|
|
@@ -182,27 +186,27 @@ export default {
|
|
|
182
186
|
// 列拖拽排序配置项
|
|
183
187
|
columnDragConfig: Object as PropType<VxeTablePropTypes.ColumnDragConfig>,
|
|
184
188
|
// 列调整配置项
|
|
185
|
-
resizableConfig: Object
|
|
189
|
+
resizableConfig: Object as PropType<VxeTablePropTypes.ResizableConfig>,
|
|
186
190
|
// 序号配置项
|
|
187
|
-
seqConfig: Object
|
|
191
|
+
seqConfig: Object as PropType<VxeTablePropTypes.SeqConfig>,
|
|
188
192
|
// 排序配置项
|
|
189
|
-
sortConfig: Object
|
|
193
|
+
sortConfig: Object as PropType<VxeTablePropTypes.SortConfig>,
|
|
190
194
|
// 筛选配置项
|
|
191
|
-
filterConfig: Object
|
|
195
|
+
filterConfig: Object as PropType<VxeTablePropTypes.FilterConfig>,
|
|
192
196
|
// 单选框配置
|
|
193
|
-
radioConfig: Object
|
|
197
|
+
radioConfig: Object as PropType<VxeTablePropTypes.RadioConfig>,
|
|
194
198
|
// 复选框配置项
|
|
195
|
-
checkboxConfig: Object
|
|
199
|
+
checkboxConfig: Object as PropType<VxeTablePropTypes.CheckboxConfig>,
|
|
196
200
|
// tooltip 配置项
|
|
197
|
-
tooltipConfig: Object
|
|
201
|
+
tooltipConfig: Object as PropType<VxeTablePropTypes.TooltipConfig>,
|
|
198
202
|
// 导出配置项
|
|
199
203
|
exportConfig: [Boolean, Object],
|
|
200
204
|
// 导入配置项
|
|
201
205
|
importConfig: [Boolean, Object],
|
|
202
206
|
// 打印配置项
|
|
203
|
-
printConfig: Object
|
|
207
|
+
printConfig: Object as PropType<VxeTablePropTypes.PrintConfig>,
|
|
204
208
|
// 展开行配置项
|
|
205
|
-
expandConfig: Object
|
|
209
|
+
expandConfig: Object as PropType<VxeTablePropTypes.ExpandConfig>,
|
|
206
210
|
// 树形结构配置项
|
|
207
211
|
treeConfig: [Boolean, Object],
|
|
208
212
|
// 快捷菜单配置项
|
|
@@ -2,7 +2,7 @@ import { CreateElement } from 'vue'
|
|
|
2
2
|
import XEUtils from 'xe-utils'
|
|
3
3
|
import { getFuncText, isEnableConf } from '../../ui/src/utils'
|
|
4
4
|
import { initTpImg } from '../../ui/src/dom'
|
|
5
|
-
import {
|
|
5
|
+
import { createHandleGetRowId } from './util'
|
|
6
6
|
import { VxeUI } from '../../ui'
|
|
7
7
|
import methods from './methods'
|
|
8
8
|
import TableBodyComponent from './body'
|
|
@@ -34,14 +34,15 @@ const { getConfig, getIcon, getI18n, renderer, globalResize, globalEvents, globa
|
|
|
34
34
|
* 渲染浮固定列
|
|
35
35
|
* 分别渲染左边固定列和右边固定列
|
|
36
36
|
* 如果宽度足够情况下,则不需要渲染固定列
|
|
37
|
-
* @param {Function} h 创建 VNode 函数
|
|
38
|
-
* @param {Object} $xetable 表格实例
|
|
39
|
-
* @param {String} fixedType 固定列类型
|
|
40
37
|
*/
|
|
41
|
-
function renderFixed (h: CreateElement, $
|
|
42
|
-
const
|
|
38
|
+
function renderFixed (h: CreateElement, $xeTable: VxeTableConstructor & VxeTablePrivateMethods, fixedType: any) {
|
|
39
|
+
const props = $xeTable
|
|
40
|
+
const reactData = $xeTable as unknown as TableReactData
|
|
41
|
+
|
|
42
|
+
const { showHeader, showFooter } = props
|
|
43
|
+
const { tableData, tableColumn, tableGroupColumn, columnStore, footerTableData } = reactData
|
|
43
44
|
const isFixedLeft = fixedType === 'left'
|
|
44
|
-
const fixedColumn = columnStore
|
|
45
|
+
const fixedColumn = isFixedLeft ? columnStore.leftList : columnStore.rightList
|
|
45
46
|
return h('div', {
|
|
46
47
|
ref: isFixedLeft ? 'refLeftContainer' : 'refRightContainer',
|
|
47
48
|
class: `vxe-table--fixed-${fixedType}-wrapper`
|
|
@@ -53,19 +54,17 @@ function renderFixed (h: CreateElement, $xetable: any, fixedType: any) {
|
|
|
53
54
|
tableData,
|
|
54
55
|
tableColumn,
|
|
55
56
|
tableGroupColumn,
|
|
56
|
-
size: vSize,
|
|
57
57
|
fixedColumn
|
|
58
58
|
},
|
|
59
59
|
ref: `${fixedType}Header`
|
|
60
60
|
})
|
|
61
|
-
:
|
|
61
|
+
: renderEmptyElement($xeTable),
|
|
62
62
|
h(TableBodyComponent, {
|
|
63
63
|
props: {
|
|
64
64
|
fixedType,
|
|
65
65
|
tableData,
|
|
66
66
|
tableColumn,
|
|
67
|
-
fixedColumn
|
|
68
|
-
size: vSize
|
|
67
|
+
fixedColumn
|
|
69
68
|
},
|
|
70
69
|
ref: `${fixedType}Body`
|
|
71
70
|
}),
|
|
@@ -75,12 +74,11 @@ function renderFixed (h: CreateElement, $xetable: any, fixedType: any) {
|
|
|
75
74
|
footerTableData,
|
|
76
75
|
tableColumn,
|
|
77
76
|
fixedColumn,
|
|
78
|
-
fixedType
|
|
79
|
-
size: vSize
|
|
77
|
+
fixedType
|
|
80
78
|
},
|
|
81
79
|
ref: `${fixedType}Footer`
|
|
82
80
|
})
|
|
83
|
-
:
|
|
81
|
+
: renderEmptyElement($xeTable)
|
|
84
82
|
])
|
|
85
83
|
}
|
|
86
84
|
|
|
@@ -209,6 +207,7 @@ function renderRowExpandedVNs (h: CreateElement, $xeTable: VxeTableConstructor &
|
|
|
209
207
|
]
|
|
210
208
|
|
|
211
209
|
if (expandColumn) {
|
|
210
|
+
const { handleGetRowId } = createHandleGetRowId($xeTable)
|
|
212
211
|
tableRowExpandedList.forEach((row) => {
|
|
213
212
|
const expandOpts = $xeTable.computeExpandOpts
|
|
214
213
|
const { height: expandHeight, padding } = expandOpts
|
|
@@ -216,7 +215,7 @@ function renderRowExpandedVNs (h: CreateElement, $xeTable: VxeTableConstructor &
|
|
|
216
215
|
const treeOpts = $xeTable.computeTreeOpts
|
|
217
216
|
const { transform, seqMode } = treeOpts
|
|
218
217
|
const cellStyle: Record<string, string> = {}
|
|
219
|
-
const rowid =
|
|
218
|
+
const rowid = handleGetRowId(row)
|
|
220
219
|
const rest = fullAllDataRowIdData[rowid]
|
|
221
220
|
let rowLevel = 0
|
|
222
221
|
let seq: string | number = -1
|
|
@@ -419,7 +418,6 @@ export default {
|
|
|
419
418
|
props: tableProps,
|
|
420
419
|
provide () {
|
|
421
420
|
return {
|
|
422
|
-
$xetable: this,
|
|
423
421
|
$xeTable: this,
|
|
424
422
|
xecolgroup: null
|
|
425
423
|
}
|
|
@@ -430,9 +428,6 @@ export default {
|
|
|
430
428
|
},
|
|
431
429
|
$xeGrid: {
|
|
432
430
|
default: null
|
|
433
|
-
},
|
|
434
|
-
$xegrid: {
|
|
435
|
-
default: null
|
|
436
431
|
}
|
|
437
432
|
},
|
|
438
433
|
data () {
|
|
@@ -471,8 +466,6 @@ export default {
|
|
|
471
466
|
isAllSelected: false,
|
|
472
467
|
// 复选框属性,有选中且非全选状态
|
|
473
468
|
isIndeterminate: false,
|
|
474
|
-
// 复选框属性,已选中的行集合
|
|
475
|
-
selectCheckboxMaps: {},
|
|
476
469
|
// 当前行
|
|
477
470
|
currentRow: null,
|
|
478
471
|
// 单选框属性,选中列
|
|
@@ -486,16 +479,6 @@ export default {
|
|
|
486
479
|
hasFixedColumn: false,
|
|
487
480
|
// 树节点列信息
|
|
488
481
|
treeNodeColumn: null,
|
|
489
|
-
// 已展开的行集合
|
|
490
|
-
rowExpandedMaps: {},
|
|
491
|
-
// 懒加载中的展开行的集合
|
|
492
|
-
rowExpandLazyLoadedMaps: {},
|
|
493
|
-
// 已展开树节点集合
|
|
494
|
-
treeExpandedMaps: {},
|
|
495
|
-
// 懒加载中的树节点的集合
|
|
496
|
-
treeExpandLazyLoadedMaps: {},
|
|
497
|
-
// 树节点不确定状态的集合
|
|
498
|
-
treeIndeterminateMaps: {},
|
|
499
482
|
// 合并单元格的对象集
|
|
500
483
|
mergeList: [],
|
|
501
484
|
// 合并表尾数据的对象集
|
|
@@ -512,8 +495,6 @@ export default {
|
|
|
512
495
|
upDataFlag: 0,
|
|
513
496
|
// 刷新列标识,当列的特定属性被改变时,触发表格刷新列
|
|
514
497
|
reColumnFlag: 0,
|
|
515
|
-
// 已标记的对象集
|
|
516
|
-
pendingRowMaps: {},
|
|
517
498
|
// 自定义列相关的信息
|
|
518
499
|
customStore: {
|
|
519
500
|
btnEl: null,
|
|
@@ -649,6 +630,11 @@ export default {
|
|
|
649
630
|
isFooter: false
|
|
650
631
|
},
|
|
651
632
|
|
|
633
|
+
rowExpandedFlag: 1,
|
|
634
|
+
treeExpandedFlag: 1,
|
|
635
|
+
updateCheckboxFlag: 1,
|
|
636
|
+
pendingRowFlag: 1,
|
|
637
|
+
|
|
652
638
|
rowHeightStore: {
|
|
653
639
|
default: 48,
|
|
654
640
|
medium: 44,
|
|
@@ -667,6 +653,7 @@ export default {
|
|
|
667
653
|
rowExpandHeightFlag: 1,
|
|
668
654
|
calcCellHeightFlag: 1,
|
|
669
655
|
resizeHeightFlag: 1,
|
|
656
|
+
resizeWidthFlag: 1,
|
|
670
657
|
|
|
671
658
|
isCustomStatus: false,
|
|
672
659
|
|
|
@@ -774,13 +761,13 @@ export default {
|
|
|
774
761
|
return this.computeRowHeightMaps
|
|
775
762
|
},
|
|
776
763
|
computeRowHeightMaps () {
|
|
777
|
-
const $xeTable = this
|
|
778
|
-
const reactData = $xeTable as TableReactData
|
|
764
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
765
|
+
const reactData = $xeTable as unknown as TableReactData
|
|
779
766
|
|
|
780
767
|
return reactData.rowHeightStore
|
|
781
768
|
},
|
|
782
769
|
computeDefaultRowHeight () {
|
|
783
|
-
const $xeTable = this
|
|
770
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
784
771
|
|
|
785
772
|
const vSize = $xeTable.computeSize
|
|
786
773
|
const rowHeightMaps = $xeTable.computeRowHeightMaps
|
|
@@ -790,31 +777,61 @@ export default {
|
|
|
790
777
|
return this.computeColumnOpts
|
|
791
778
|
},
|
|
792
779
|
computeColumnOpts () {
|
|
793
|
-
|
|
780
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
781
|
+
const props = $xeTable
|
|
782
|
+
|
|
783
|
+
return Object.assign({}, getConfig().table.columnConfig, props.columnConfig)
|
|
784
|
+
},
|
|
785
|
+
computeCurrentColumnOpts () {
|
|
786
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
787
|
+
const props = $xeTable
|
|
788
|
+
|
|
789
|
+
return Object.assign({}, getConfig().table.currentColumnConfig, props.currentColumnConfig)
|
|
794
790
|
},
|
|
795
791
|
computeCellOpts () {
|
|
796
792
|
const $xeTable = this
|
|
797
793
|
const props = $xeTable
|
|
798
794
|
|
|
799
|
-
|
|
795
|
+
const cellOpts = Object.assign({}, getConfig().table.cellConfig, props.cellConfig)
|
|
796
|
+
if (cellOpts.height) {
|
|
797
|
+
cellOpts.height = XEUtils.toNumber(cellOpts.height)
|
|
798
|
+
}
|
|
799
|
+
return cellOpts
|
|
800
800
|
},
|
|
801
801
|
computeHeaderCellOpts () {
|
|
802
802
|
const $xeTable = this
|
|
803
803
|
const props = $xeTable
|
|
804
804
|
|
|
805
|
-
|
|
805
|
+
const headerCellOpts = Object.assign({}, getConfig().table.headerCellConfig, props.headerCellConfig)
|
|
806
|
+
if (headerCellOpts.height) {
|
|
807
|
+
headerCellOpts.height = XEUtils.toNumber(headerCellOpts.height)
|
|
808
|
+
}
|
|
809
|
+
return headerCellOpts
|
|
806
810
|
},
|
|
807
811
|
computeFooterCellOpts () {
|
|
808
812
|
const $xeTable = this
|
|
809
813
|
const props = $xeTable
|
|
810
814
|
|
|
811
|
-
|
|
815
|
+
const footerCellOpts = Object.assign({}, getConfig().table.footerCellConfig, props.footerCellConfig)
|
|
816
|
+
if (footerCellOpts.height) {
|
|
817
|
+
footerCellOpts.height = XEUtils.toNumber(footerCellOpts.height)
|
|
818
|
+
}
|
|
819
|
+
return footerCellOpts
|
|
812
820
|
},
|
|
813
821
|
rowOpts () {
|
|
814
822
|
return this.computeRowOpts
|
|
815
823
|
},
|
|
816
824
|
computeRowOpts () {
|
|
817
|
-
|
|
825
|
+
const $xeTable = this
|
|
826
|
+
const props = $xeTable
|
|
827
|
+
|
|
828
|
+
return Object.assign({}, getConfig().table.rowConfig, props.rowConfig)
|
|
829
|
+
},
|
|
830
|
+
computeCurrentRowOpts () {
|
|
831
|
+
const $xeTable = this
|
|
832
|
+
const props = $xeTable
|
|
833
|
+
|
|
834
|
+
return Object.assign({}, getConfig().table.currentRowConfig, props.currentRowConfig)
|
|
818
835
|
},
|
|
819
836
|
computeRowDragOpts () {
|
|
820
837
|
return Object.assign({}, getConfig().table.rowDragConfig, this.rowDragConfig)
|
|
@@ -838,25 +855,37 @@ export default {
|
|
|
838
855
|
return this.computeSeqOpts
|
|
839
856
|
},
|
|
840
857
|
computeSeqOpts () {
|
|
841
|
-
|
|
858
|
+
const $xeTable = this
|
|
859
|
+
const props = $xeTable
|
|
860
|
+
|
|
861
|
+
return Object.assign({ startIndex: 0 }, getConfig().table.seqConfig, props.seqConfig)
|
|
842
862
|
},
|
|
843
863
|
radioOpts () {
|
|
844
864
|
return this.computeRadioOpts
|
|
845
865
|
},
|
|
846
866
|
computeRadioOpts () {
|
|
847
|
-
|
|
867
|
+
const $xeTable = this
|
|
868
|
+
const props = $xeTable
|
|
869
|
+
|
|
870
|
+
return Object.assign({}, getConfig().table.radioConfig, props.radioConfig)
|
|
848
871
|
},
|
|
849
872
|
checkboxOpts () {
|
|
850
873
|
return this.computeCheckboxOpts
|
|
851
874
|
},
|
|
852
875
|
computeCheckboxOpts () {
|
|
853
|
-
|
|
876
|
+
const $xeTable = this
|
|
877
|
+
const props = $xeTable
|
|
878
|
+
|
|
879
|
+
return Object.assign({}, getConfig().table.checkboxConfig, props.checkboxConfig)
|
|
854
880
|
},
|
|
855
881
|
tooltipOpts () {
|
|
856
882
|
return this.computeTooltipOpts
|
|
857
883
|
},
|
|
858
884
|
computeTooltipOpts () {
|
|
859
|
-
|
|
885
|
+
const $xeTable = this
|
|
886
|
+
const props = $xeTable
|
|
887
|
+
|
|
888
|
+
return Object.assign({}, getConfig().tooltip, getConfig().table.tooltipConfig, props.tooltipConfig)
|
|
860
889
|
},
|
|
861
890
|
tipConfig () {
|
|
862
891
|
return { ...this.tooltipOpts }
|
|
@@ -1071,13 +1100,16 @@ export default {
|
|
|
1071
1100
|
computeTableRowExpandedList () {
|
|
1072
1101
|
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
1073
1102
|
const reactData = $xeTable as unknown as TableReactData
|
|
1103
|
+
const internalData = $xeTable as unknown as TableInternalData
|
|
1074
1104
|
|
|
1075
|
-
const {
|
|
1105
|
+
const { rowExpandedFlag, tableData, expandColumn } = reactData
|
|
1106
|
+
const { rowExpandedMaps } = internalData
|
|
1107
|
+
const { handleGetRowId } = createHandleGetRowId($xeTable)
|
|
1076
1108
|
const expandList: any[] = []
|
|
1077
|
-
if (expandColumn) {
|
|
1109
|
+
if (expandColumn && rowExpandedFlag) {
|
|
1078
1110
|
const rowKeys: Record<string, boolean> = {}
|
|
1079
1111
|
tableData.forEach(row => {
|
|
1080
|
-
rowKeys[
|
|
1112
|
+
rowKeys[handleGetRowId(row)] = true
|
|
1081
1113
|
})
|
|
1082
1114
|
XEUtils.each(rowExpandedMaps, (row, rowid) => {
|
|
1083
1115
|
if (rowKeys[rowid]) {
|
|
@@ -1330,13 +1362,15 @@ export default {
|
|
|
1330
1362
|
lastScrollTop: 0,
|
|
1331
1363
|
// 单选框属性,已选中保留的行
|
|
1332
1364
|
radioReserveRow: null,
|
|
1333
|
-
//
|
|
1365
|
+
// 复选框属性,已选中保留的行集合
|
|
1334
1366
|
checkboxReserveRowMap: {},
|
|
1335
|
-
//
|
|
1367
|
+
// 行数据,已展开保留的行集合
|
|
1336
1368
|
rowExpandedReserveRowMap: {},
|
|
1337
|
-
//
|
|
1369
|
+
// 树结构数据,已展开保留的行集合
|
|
1338
1370
|
treeExpandedReserveRowMap: {},
|
|
1339
|
-
//
|
|
1371
|
+
// 树结构数据,不确定状态的集合
|
|
1372
|
+
treeIndeterminateRowMaps: {},
|
|
1373
|
+
// 列表完整数据、条件处理后
|
|
1340
1374
|
tableFullData: [],
|
|
1341
1375
|
afterFullData: [],
|
|
1342
1376
|
// 列表条件处理后数据集合
|
|
@@ -1355,6 +1389,19 @@ export default {
|
|
|
1355
1389
|
fullColumnIdData: {},
|
|
1356
1390
|
fullColumnFieldData: {},
|
|
1357
1391
|
|
|
1392
|
+
// 已展开的行集合
|
|
1393
|
+
rowExpandedMaps: {},
|
|
1394
|
+
// 懒加载中的展开行的集合
|
|
1395
|
+
rowExpandLazyLoadedMaps: {},
|
|
1396
|
+
// 已展开树节点集合
|
|
1397
|
+
treeExpandedMaps: {},
|
|
1398
|
+
// 懒加载中的树节点的集合
|
|
1399
|
+
treeExpandLazyLoadedMaps: {},
|
|
1400
|
+
// 复选框属性,已选中的行集合
|
|
1401
|
+
selectCheckboxMaps: {},
|
|
1402
|
+
// 已标记的对象集
|
|
1403
|
+
pendingRowMaps: {},
|
|
1404
|
+
|
|
1358
1405
|
swYSize: 0,
|
|
1359
1406
|
swYInterval: 0,
|
|
1360
1407
|
swYTotal: 0
|
|
@@ -103,37 +103,69 @@ export function getRowUniqueId () {
|
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
// 行主键 key
|
|
106
|
-
export function getRowkey ($xeTable:
|
|
106
|
+
export function getRowkey ($xeTable: VxeTableConstructor) {
|
|
107
107
|
const props = $xeTable
|
|
108
108
|
const rowOpts = $xeTable.computeRowOpts
|
|
109
109
|
return `${props.rowId || rowOpts.keyField || '_X_ROW_KEY'}`
|
|
110
110
|
}
|
|
111
111
|
|
|
112
112
|
// 行主键 value
|
|
113
|
-
export function getRowid ($
|
|
114
|
-
const rowid = XEUtils.get(row, getRowkey($
|
|
113
|
+
export function getRowid ($xeTable: VxeTableConstructor, row: any) {
|
|
114
|
+
const rowid = XEUtils.get(row, getRowkey($xeTable))
|
|
115
115
|
return encodeRowid(rowid)
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
+
export function createHandleUpdateRowId ($xeTable: VxeTableConstructor) {
|
|
119
|
+
const rowKey = getRowkey($xeTable)
|
|
120
|
+
const isDeepKey = rowKey.indexOf('.') > -1
|
|
121
|
+
const updateRId = isDeepKey ? updateDeepRowKey : updateFastRowKey
|
|
122
|
+
return {
|
|
123
|
+
rowKey,
|
|
124
|
+
handleUpdateRowId (row: any) {
|
|
125
|
+
return row ? updateRId(row, rowKey) : null
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export function createHandleGetRowId ($xeTable: VxeTableConstructor) {
|
|
131
|
+
const rowKey = getRowkey($xeTable)
|
|
132
|
+
const isDeepKey = rowKey.indexOf('.') > -1
|
|
133
|
+
const getRId = isDeepKey ? getDeepRowIdByKey : getFastRowIdByKey
|
|
134
|
+
return {
|
|
135
|
+
rowKey,
|
|
136
|
+
handleGetRowId (row: any) {
|
|
137
|
+
return row ? getRId(row, rowKey) : null
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
118
142
|
// 编码行主键
|
|
119
143
|
export function encodeRowid (rowVal: string) {
|
|
120
144
|
return XEUtils.eqNull(rowVal) ? '' : encodeURIComponent(rowVal)
|
|
121
145
|
}
|
|
122
146
|
|
|
123
|
-
|
|
124
|
-
|
|
147
|
+
function getDeepRowIdByKey (row: any, rowKey: string) {
|
|
148
|
+
return XEUtils.get(row, rowKey)
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export function updateDeepRowKey (row: any, rowKey: string) {
|
|
152
|
+
let rowid = getDeepRowIdByKey(row, rowKey)
|
|
125
153
|
if (eqEmptyValue(rowid)) {
|
|
126
154
|
rowid = getRowUniqueId()
|
|
127
|
-
XEUtils.set(row,
|
|
155
|
+
XEUtils.set(row, rowKey, rowid)
|
|
128
156
|
}
|
|
129
157
|
return rowid
|
|
130
158
|
}
|
|
131
159
|
|
|
132
|
-
|
|
133
|
-
|
|
160
|
+
function getFastRowIdByKey (row: any, rowKey: string) {
|
|
161
|
+
return row[rowKey]
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
export function updateFastRowKey (row: any, rowKey: string) {
|
|
165
|
+
let rowid = getFastRowIdByKey(row, rowKey)
|
|
134
166
|
if (eqEmptyValue(rowid)) {
|
|
135
167
|
rowid = getRowUniqueId()
|
|
136
|
-
row[
|
|
168
|
+
row[rowKey] = rowid
|
|
137
169
|
}
|
|
138
170
|
return rowid
|
|
139
171
|
}
|
|
@@ -182,34 +214,44 @@ export const handleRowidOrRow = ($xeTable: VxeTableConstructor, rowidOrRow: any)
|
|
|
182
214
|
|
|
183
215
|
// 组装列配置
|
|
184
216
|
export function assembleColumn (_vm: any) {
|
|
185
|
-
const
|
|
186
|
-
const
|
|
217
|
+
const $xeTable = _vm.$xeTable as VxeTableConstructor & VxeTablePrivateMethods
|
|
218
|
+
const reactData = $xeTable as unknown as TableReactData
|
|
219
|
+
const { staticColumns } = reactData
|
|
220
|
+
|
|
221
|
+
const { $el, $xeColumn, columnConfig } = _vm
|
|
222
|
+
const groupConfig = $xeColumn ? $xeColumn.columnConfig : null
|
|
187
223
|
if (groupConfig) {
|
|
188
|
-
if ($
|
|
189
|
-
errLog('vxe.error.groupTag', [`<vxe-table-colgroup title=${$
|
|
190
|
-
} else if ($
|
|
191
|
-
warnLog('vxe.error.groupTag', [`<vxe-colgroup title=${$
|
|
224
|
+
if ($xeColumn.$options._componentTag === 'vxe-table-column') {
|
|
225
|
+
errLog('vxe.error.groupTag', [`<vxe-table-colgroup title=${$xeColumn.title} ...>`, `<vxe-table-column title=${$xeColumn.title} ...>`])
|
|
226
|
+
} else if ($xeColumn.$options._componentTag === 'vxe-column') {
|
|
227
|
+
warnLog('vxe.error.groupTag', [`<vxe-colgroup title=${$xeColumn.title} ...>`, `<vxe-column title=${$xeColumn.title} ...>`])
|
|
192
228
|
}
|
|
193
229
|
if (!groupConfig.children) {
|
|
194
230
|
groupConfig.children = []
|
|
195
231
|
}
|
|
196
|
-
groupConfig.children.splice(XEUtils.arrayIndexOf($
|
|
232
|
+
groupConfig.children.splice(XEUtils.arrayIndexOf($xeColumn.$el.children, $el), 0, columnConfig)
|
|
197
233
|
} else {
|
|
198
|
-
|
|
234
|
+
staticColumns.splice(XEUtils.arrayIndexOf(($xeTable.$refs.hideColumn as any).children, $el), 0, columnConfig)
|
|
199
235
|
}
|
|
200
236
|
}
|
|
201
237
|
|
|
202
238
|
// 销毁列
|
|
203
239
|
export function destroyColumn (_vm: any) {
|
|
204
|
-
const
|
|
205
|
-
const
|
|
240
|
+
const $xeTable = _vm.$xeTable as VxeTableConstructor & VxeTablePrivateMethods
|
|
241
|
+
const reactData = $xeTable as unknown as TableReactData
|
|
242
|
+
const { staticColumns } = reactData
|
|
243
|
+
|
|
244
|
+
const { columnConfig } = _vm
|
|
245
|
+
const matchObj = XEUtils.findTree(staticColumns, column => column === columnConfig)
|
|
206
246
|
if (matchObj) {
|
|
207
247
|
matchObj.items.splice(matchObj.index, 1)
|
|
208
248
|
}
|
|
209
249
|
}
|
|
210
250
|
|
|
211
|
-
export function getRootColumn ($
|
|
212
|
-
const
|
|
251
|
+
export function getRootColumn ($xeTable: VxeTableConstructor & VxeTablePrivateMethods, column: any) {
|
|
252
|
+
const internalData = $xeTable as unknown as TableInternalData
|
|
253
|
+
|
|
254
|
+
const { fullColumnIdData } = internalData
|
|
213
255
|
if (!column) {
|
|
214
256
|
return null
|
|
215
257
|
}
|
|
@@ -719,13 +719,13 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
719
719
|
$xeToolbar.$nextTick(() => {
|
|
720
720
|
const { refresh } = props
|
|
721
721
|
const refreshOpts = $xeToolbar.computeRefreshOpts
|
|
722
|
-
const $
|
|
722
|
+
const $xeTable = this.fintTable() as any
|
|
723
723
|
const queryMethod = refreshOpts.queryMethod || refreshOpts.query
|
|
724
724
|
if (refresh && !$xeGrid && !queryMethod) {
|
|
725
725
|
warnLog('vxe.error.notFunc', ['queryMethod'])
|
|
726
726
|
}
|
|
727
|
-
if ($
|
|
728
|
-
$
|
|
727
|
+
if ($xeTable) {
|
|
728
|
+
$xeTable.connect(this)
|
|
729
729
|
}
|
|
730
730
|
const customOpts = $xeToolbar.computeCustomOpts
|
|
731
731
|
if (customOpts.isFooter) {
|
package/packages/ui/index.ts
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|