vxe-table 4.19.2 → 4.19.3
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/dist/all.esm.js +278 -97
- package/dist/style.css +1 -1
- package/dist/style.min.css +1 -1
- package/es/index.css +1 -1
- package/es/index.min.css +1 -1
- package/es/locale/lang/ar-EG.js +4 -0
- package/es/locale/lang/de-DE.js +4 -0
- package/es/locale/lang/en-US.js +4 -0
- package/es/locale/lang/es-ES.js +4 -0
- package/es/locale/lang/fr-FR.js +4 -0
- package/es/locale/lang/hu-HU.js +4 -0
- package/es/locale/lang/hy-AM.js +4 -0
- package/es/locale/lang/id-ID.js +4 -0
- package/es/locale/lang/it-IT.js +4 -0
- package/es/locale/lang/ja-JP.js +4 -0
- package/es/locale/lang/ko-KR.js +4 -0
- package/es/locale/lang/ms-MY.js +4 -0
- package/es/locale/lang/nb-NO.js +4 -0
- package/es/locale/lang/pt-BR.js +4 -0
- package/es/locale/lang/ru-RU.js +4 -0
- package/es/locale/lang/th-TH.js +4 -0
- package/es/locale/lang/ug-CN.js +4 -0
- package/es/locale/lang/uk-UA.js +4 -0
- package/es/locale/lang/uz-UZ.js +4 -0
- package/es/locale/lang/vi-VN.js +4 -0
- package/es/locale/lang/zh-CHT.js +4 -0
- package/es/locale/lang/zh-CN.js +4 -0
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/custom/panel.js +28 -20
- package/es/table/module/export/export-panel.js +27 -16
- package/es/table/module/export/hook.js +120 -27
- package/es/table/src/table.js +94 -31
- package/es/table/src/util.js +3 -1
- package/es/table/style.css +1 -1
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +1 -1
- package/es/vxe-table/style.min.css +1 -1
- package/lib/index.css +1 -1
- package/lib/index.min.css +1 -1
- package/lib/index.umd.js +204 -67
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/ar-EG.js +4 -0
- package/lib/locale/lang/ar-EG.min.js +1 -1
- package/lib/locale/lang/ar-EG.umd.js +4 -0
- package/lib/locale/lang/de-DE.js +4 -0
- package/lib/locale/lang/de-DE.min.js +1 -1
- package/lib/locale/lang/de-DE.umd.js +4 -0
- package/lib/locale/lang/en-US.js +4 -0
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +4 -0
- package/lib/locale/lang/es-ES.js +4 -0
- package/lib/locale/lang/es-ES.min.js +1 -1
- package/lib/locale/lang/es-ES.umd.js +4 -0
- package/lib/locale/lang/fr-FR.js +4 -0
- package/lib/locale/lang/fr-FR.min.js +1 -1
- package/lib/locale/lang/fr-FR.umd.js +4 -0
- package/lib/locale/lang/hu-HU.js +4 -0
- package/lib/locale/lang/hu-HU.min.js +1 -1
- package/lib/locale/lang/hu-HU.umd.js +4 -0
- package/lib/locale/lang/hy-AM.js +4 -0
- package/lib/locale/lang/hy-AM.min.js +1 -1
- package/lib/locale/lang/hy-AM.umd.js +4 -0
- package/lib/locale/lang/id-ID.js +4 -0
- package/lib/locale/lang/id-ID.min.js +1 -1
- package/lib/locale/lang/id-ID.umd.js +4 -0
- package/lib/locale/lang/it-IT.js +4 -0
- package/lib/locale/lang/it-IT.min.js +1 -1
- package/lib/locale/lang/it-IT.umd.js +4 -0
- package/lib/locale/lang/ja-JP.js +4 -0
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +4 -0
- package/lib/locale/lang/ko-KR.js +4 -0
- package/lib/locale/lang/ko-KR.min.js +1 -1
- package/lib/locale/lang/ko-KR.umd.js +4 -0
- package/lib/locale/lang/ms-MY.js +4 -0
- package/lib/locale/lang/ms-MY.min.js +1 -1
- package/lib/locale/lang/ms-MY.umd.js +4 -0
- package/lib/locale/lang/nb-NO.js +4 -0
- package/lib/locale/lang/nb-NO.min.js +1 -1
- package/lib/locale/lang/nb-NO.umd.js +4 -0
- package/lib/locale/lang/pt-BR.js +4 -0
- package/lib/locale/lang/pt-BR.min.js +1 -1
- package/lib/locale/lang/pt-BR.umd.js +4 -0
- package/lib/locale/lang/ru-RU.js +4 -0
- package/lib/locale/lang/ru-RU.min.js +1 -1
- package/lib/locale/lang/ru-RU.umd.js +4 -0
- package/lib/locale/lang/th-TH.js +4 -0
- package/lib/locale/lang/th-TH.min.js +1 -1
- package/lib/locale/lang/th-TH.umd.js +4 -0
- package/lib/locale/lang/ug-CN.js +4 -0
- package/lib/locale/lang/ug-CN.min.js +1 -1
- package/lib/locale/lang/ug-CN.umd.js +4 -0
- package/lib/locale/lang/uk-UA.js +4 -0
- package/lib/locale/lang/uk-UA.min.js +1 -1
- package/lib/locale/lang/uk-UA.umd.js +4 -0
- package/lib/locale/lang/uz-UZ.js +4 -0
- package/lib/locale/lang/uz-UZ.min.js +1 -1
- package/lib/locale/lang/uz-UZ.umd.js +4 -0
- package/lib/locale/lang/vi-VN.js +4 -0
- package/lib/locale/lang/vi-VN.min.js +1 -1
- package/lib/locale/lang/vi-VN.umd.js +4 -0
- package/lib/locale/lang/zh-CHT.js +4 -0
- package/lib/locale/lang/zh-CHT.min.js +1 -1
- package/lib/locale/lang/zh-CHT.umd.js +4 -0
- package/lib/locale/lang/zh-CN.js +4 -0
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +4 -0
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/module/custom/panel.js +29 -18
- package/lib/table/module/custom/panel.min.js +1 -1
- package/lib/table/module/export/export-panel.js +22 -13
- package/lib/table/module/export/export-panel.min.js +1 -1
- package/lib/table/module/export/hook.js +139 -28
- package/lib/table/module/export/hook.min.js +1 -1
- package/lib/table/src/table.js +5 -5
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +3 -1
- package/lib/table/src/util.min.js +1 -1
- package/lib/table/style/style.css +1 -1
- package/lib/table/style/style.min.css +1 -1
- package/lib/ui/index.js +1 -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/lib/vxe-table/style/style.css +1 -1
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/locale/lang/ar-EG.ts +4 -0
- package/packages/locale/lang/de-DE.ts +4 -0
- package/packages/locale/lang/en-US.ts +4 -0
- package/packages/locale/lang/es-ES.ts +4 -0
- package/packages/locale/lang/fr-FR.ts +4 -0
- package/packages/locale/lang/hu-HU.ts +4 -0
- package/packages/locale/lang/hy-AM.ts +4 -0
- package/packages/locale/lang/id-ID.ts +4 -0
- package/packages/locale/lang/it-IT.ts +4 -0
- package/packages/locale/lang/ja-JP.ts +4 -0
- package/packages/locale/lang/ko-KR.ts +4 -0
- package/packages/locale/lang/ms-MY.ts +4 -0
- package/packages/locale/lang/nb-NO.ts +4 -0
- package/packages/locale/lang/pt-BR.ts +4 -0
- package/packages/locale/lang/ru-RU.ts +4 -0
- package/packages/locale/lang/th-TH.ts +4 -0
- package/packages/locale/lang/ug-CN.ts +4 -0
- package/packages/locale/lang/uk-UA.ts +4 -0
- package/packages/locale/lang/uz-UZ.ts +4 -0
- package/packages/locale/lang/vi-VN.ts +4 -0
- package/packages/locale/lang/zh-CHT.ts +4 -0
- package/packages/locale/lang/zh-CN.ts +4 -0
- package/packages/table/module/custom/panel.ts +29 -21
- package/packages/table/module/export/export-panel.ts +27 -16
- package/packages/table/module/export/hook.ts +121 -28
- package/packages/table/src/table.ts +96 -31
- package/packages/table/src/util.ts +3 -1
- package/styles/components/table-module/export.scss +1 -1
- /package/es/{iconfont.1779778422561.ttf → iconfont.1779843543280.ttf} +0 -0
- /package/es/{iconfont.1779778422561.woff → iconfont.1779843543280.woff} +0 -0
- /package/es/{iconfont.1779778422561.woff2 → iconfont.1779843543280.woff2} +0 -0
- /package/lib/{iconfont.1779778422561.ttf → iconfont.1779843543280.ttf} +0 -0
- /package/lib/{iconfont.1779778422561.woff → iconfont.1779843543280.woff} +0 -0
- /package/lib/{iconfont.1779778422561.woff2 → iconfont.1779843543280.woff2} +0 -0
|
@@ -302,13 +302,7 @@ const tableExportMethodKeys: (keyof TableExportMethods)[] = ['exportData', 'impo
|
|
|
302
302
|
hooks.add('tableExportModule', {
|
|
303
303
|
setupTable ($xeTable) {
|
|
304
304
|
const { props, reactData, internalData } = $xeTable
|
|
305
|
-
const { computeTreeOpts, computePrintOpts, computeExportOpts, computeImportOpts, computeCustomOpts, computeSeqOpts, computeRadioOpts, computeCheckboxOpts, computeColumnOpts } = $xeTable.getComputeMaps()
|
|
306
|
-
|
|
307
|
-
const hasTreeChildren = (row: any) => {
|
|
308
|
-
const treeOpts = computeTreeOpts.value
|
|
309
|
-
const childrenField = treeOpts.children || treeOpts.childrenField
|
|
310
|
-
return row[childrenField] && row[childrenField].length
|
|
311
|
-
}
|
|
305
|
+
const { computeTreeOpts, computePrintOpts, computeExportOpts, computeImportOpts, computeCustomOpts, computeSeqOpts, computeRadioOpts, computeCheckboxOpts, computeColumnOpts, computeAggregateOpts } = $xeTable.getComputeMaps()
|
|
312
306
|
|
|
313
307
|
const getSeq = (cellValue: any, row: any, $rowIndex: number, column: VxeTableDefines.ColumnInfo, $columnIndex: number) => {
|
|
314
308
|
const seqOpts = computeSeqOpts.value
|
|
@@ -344,32 +338,116 @@ hooks.add('tableExportModule', {
|
|
|
344
338
|
}
|
|
345
339
|
|
|
346
340
|
const getBodyLabelData = (opts: VxeTablePropTypes.ExportHandleOptions, columns: VxeTableDefines.ColumnInfo[], datas: any[]) => {
|
|
347
|
-
const {
|
|
341
|
+
const { isTreeAllExpanded, isRowGroupAllExpanded, mode } = opts
|
|
348
342
|
const { treeConfig } = props
|
|
343
|
+
const { isRowGroupStatus } = reactData
|
|
349
344
|
const radioOpts = computeRadioOpts.value
|
|
350
345
|
const checkboxOpts = computeCheckboxOpts.value
|
|
351
346
|
const treeOpts = computeTreeOpts.value
|
|
352
347
|
const columnOpts = computeColumnOpts.value
|
|
348
|
+
const aggregateOpts = computeAggregateOpts.value
|
|
353
349
|
if (!htmlCellElem) {
|
|
354
350
|
htmlCellElem = document.createElement('div')
|
|
355
351
|
}
|
|
352
|
+
const { handleGetRowId } = createHandleGetRowId($xeTable)
|
|
353
|
+
if (isRowGroupStatus) {
|
|
354
|
+
// 如果是数据分组
|
|
355
|
+
const { mapChildrenField } = aggregateOpts
|
|
356
|
+
const rest: any[] = []
|
|
357
|
+
const expandMaps: Record<string, boolean> = {}
|
|
358
|
+
const useMaps: Record<string, boolean> = {}
|
|
359
|
+
XEUtils.eachTree(datas, (item, $rowIndex, items, path, parentItem, nodes) => {
|
|
360
|
+
const row = item._row || item
|
|
361
|
+
const rowid = handleGetRowId(row)
|
|
362
|
+
if (useMaps[rowid]) {
|
|
363
|
+
return
|
|
364
|
+
}
|
|
365
|
+
const parentRow = parentItem && parentItem._row ? parentItem._row : parentItem
|
|
366
|
+
const pRowid = parentRow ? handleGetRowId(parentRow) : ''
|
|
367
|
+
if ((isRowGroupAllExpanded || !parentRow || (expandMaps[pRowid] && $xeTable.isRowExpandByRow(parentRow)))) {
|
|
368
|
+
const hasRowChild = mapChildrenField && row[mapChildrenField] && row[mapChildrenField].length
|
|
369
|
+
const item: any = {
|
|
370
|
+
_row: row,
|
|
371
|
+
_level: nodes.length - 1,
|
|
372
|
+
_hasChild: hasRowChild,
|
|
373
|
+
_expand: hasRowChild && $xeTable.isRowExpandByRow(row)
|
|
374
|
+
}
|
|
375
|
+
columns.forEach((column, $columnIndex) => {
|
|
376
|
+
let cellValue: string | number | boolean | null = ''
|
|
377
|
+
const renderOpts = column.editRender || column.cellRender
|
|
378
|
+
let bodyExportMethod: VxeColumnPropTypes.ExportMethod | undefined = column.exportMethod || columnOpts.exportMethod
|
|
379
|
+
if (!bodyExportMethod && renderOpts && renderOpts.name) {
|
|
380
|
+
const compConf = renderer.get(renderOpts.name)
|
|
381
|
+
if (compConf) {
|
|
382
|
+
bodyExportMethod = compConf.tableExportMethod || compConf.exportMethod
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
if (!bodyExportMethod) {
|
|
386
|
+
bodyExportMethod = columnOpts.exportMethod
|
|
387
|
+
}
|
|
388
|
+
if (bodyExportMethod) {
|
|
389
|
+
cellValue = bodyExportMethod({ $table: $xeTable, row, column, options: opts })
|
|
390
|
+
} else {
|
|
391
|
+
switch (column.type) {
|
|
392
|
+
case 'seq': {
|
|
393
|
+
const seqVal = path.map((num, i) => i % 2 === 0 ? (Number(num) + 1) : '.').join('')
|
|
394
|
+
cellValue = mode === 'all' ? seqVal : getSeq(seqVal, row, $rowIndex, column, $columnIndex)
|
|
395
|
+
break
|
|
396
|
+
}
|
|
397
|
+
case 'checkbox':
|
|
398
|
+
cellValue = toBooleanValue($xeTable.isCheckedByCheckboxRow(row))
|
|
399
|
+
item._checkboxLabel = checkboxOpts.labelField ? XEUtils.get(row, checkboxOpts.labelField) : ''
|
|
400
|
+
item._checkboxDisabled = checkboxOpts.checkMethod && !checkboxOpts.checkMethod({ $table: $xeTable, row })
|
|
401
|
+
break
|
|
402
|
+
case 'radio':
|
|
403
|
+
cellValue = toBooleanValue($xeTable.isCheckedByRadioRow(row))
|
|
404
|
+
item._radioLabel = radioOpts.labelField ? XEUtils.get(row, radioOpts.labelField) : ''
|
|
405
|
+
item._radioDisabled = radioOpts.checkMethod && !radioOpts.checkMethod({ $table: $xeTable, row })
|
|
406
|
+
break
|
|
407
|
+
default:
|
|
408
|
+
if (opts.original) {
|
|
409
|
+
cellValue = getCellValue(row, column)
|
|
410
|
+
} else {
|
|
411
|
+
cellValue = $xeTable.getCellLabel(row, column)
|
|
412
|
+
if (column.type === 'html') {
|
|
413
|
+
htmlCellElem.innerHTML = cellValue
|
|
414
|
+
cellValue = htmlCellElem.innerText.trim()
|
|
415
|
+
} else {
|
|
416
|
+
const cell = $xeTable.getCellElement(row, column)
|
|
417
|
+
if (cell && !hasClass(cell, 'is--progress')) {
|
|
418
|
+
cellValue = cell.innerText.trim()
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
item[column.id] = toStringValue(cellValue)
|
|
425
|
+
})
|
|
426
|
+
useMaps[rowid] = true
|
|
427
|
+
if (pRowid) {
|
|
428
|
+
expandMaps[pRowid] = true
|
|
429
|
+
}
|
|
430
|
+
rest.push(Object.assign(item, row))
|
|
431
|
+
}
|
|
432
|
+
}, { children: mapChildrenField })
|
|
433
|
+
return rest
|
|
434
|
+
}
|
|
356
435
|
if (treeConfig) {
|
|
436
|
+
// 如果是树结构
|
|
357
437
|
const childrenField = treeOpts.children || treeOpts.childrenField
|
|
358
|
-
// 如果是树表格只允许导出数据源
|
|
359
438
|
const rest: any[] = []
|
|
360
439
|
const expandMaps: Record<string, boolean> = {}
|
|
361
440
|
const useMaps: Record<string, boolean> = {}
|
|
362
|
-
|
|
363
|
-
XEUtils.eachTree(datas, (item, $rowIndex, items, path, parent, nodes) => {
|
|
441
|
+
XEUtils.eachTree(datas, (item, $rowIndex, items, path, parentItem, nodes) => {
|
|
364
442
|
const row = item._row || item
|
|
365
443
|
const rowid = handleGetRowId(row)
|
|
366
444
|
if (useMaps[rowid]) {
|
|
367
445
|
return
|
|
368
446
|
}
|
|
369
|
-
const parentRow =
|
|
447
|
+
const parentRow = parentItem && parentItem._row ? parentItem._row : parentItem
|
|
370
448
|
const pRowid = parentRow ? handleGetRowId(parentRow) : ''
|
|
371
|
-
if ((
|
|
372
|
-
const hasRowChild =
|
|
449
|
+
if ((isTreeAllExpanded || !parentRow || (expandMaps[pRowid] && $xeTable.isTreeExpandByRow(parentRow)))) {
|
|
450
|
+
const hasRowChild = row[childrenField] && row[childrenField].length
|
|
373
451
|
const item: any = {
|
|
374
452
|
_row: row,
|
|
375
453
|
_level: nodes.length - 1,
|
|
@@ -1037,10 +1115,11 @@ hooks.add('tableExportModule', {
|
|
|
1037
1115
|
const $xeGGWrapper = $xeGrid || $xeGantt
|
|
1038
1116
|
|
|
1039
1117
|
const { treeConfig, showHeader, showFooter } = props
|
|
1040
|
-
const { initStore, isGroup, footerTableData, exportStore, exportParams } = reactData
|
|
1118
|
+
const { initStore, isGroup, rowGroupList, footerTableData, exportStore, exportParams } = reactData
|
|
1041
1119
|
const { collectColumn, mergeBodyList, mergeFooterList } = internalData
|
|
1042
1120
|
const exportOpts = computeExportOpts.value
|
|
1043
|
-
const hasTree = treeConfig
|
|
1121
|
+
const hasTree = !!treeConfig
|
|
1122
|
+
const hasRowGroup = rowGroupList.length > 0
|
|
1044
1123
|
const customOpts = computeCustomOpts.value
|
|
1045
1124
|
const selectRecords = $xeTable.getCheckboxRecords()
|
|
1046
1125
|
const proxyOpts = $xeGGWrapper ? $xeGGWrapper.getComputeMaps().computeProxyOpts.value : {} as VxeGridPropTypes.ProxyOpts
|
|
@@ -1057,6 +1136,13 @@ hooks.add('tableExportModule', {
|
|
|
1057
1136
|
current: 'current',
|
|
1058
1137
|
modes: (proxyOpts.ajax && proxyOpts.ajax.queryAll ? ['all'] : []).concat(['current', 'selected', 'empty'])
|
|
1059
1138
|
}, options)
|
|
1139
|
+
|
|
1140
|
+
// 已废弃,参数 isAllExpand
|
|
1141
|
+
if (XEUtils.isBoolean((defOpts as any).isAllExpand)) {
|
|
1142
|
+
warnLog('vxe.error.delProp', ['isAllExpand', 'isTreeAllExpanded'])
|
|
1143
|
+
defOpts.isTreeAllExpanded = (defOpts as any).isAllExpand
|
|
1144
|
+
}
|
|
1145
|
+
|
|
1060
1146
|
const types: string[] = defOpts.types || XEUtils.keys(exportOpts._typeMaps)
|
|
1061
1147
|
const modes: string[] = defOpts.modes || []
|
|
1062
1148
|
const checkMethod = customOpts.checkMethod
|
|
@@ -1097,17 +1183,16 @@ hooks.add('tableExportModule', {
|
|
|
1097
1183
|
column.disabled = (parent && parent.disabled) || (checkMethod ? !checkMethod({ $table: $xeTable, column }) : false)
|
|
1098
1184
|
})
|
|
1099
1185
|
// 更新条件
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
})
|
|
1186
|
+
exportStore.columns = exportColumns
|
|
1187
|
+
exportStore.typeList = typeList
|
|
1188
|
+
exportStore.modeList = modeList
|
|
1189
|
+
exportStore.hasFooter = hasFooter
|
|
1190
|
+
exportStore.hasMerge = hasMerge
|
|
1191
|
+
exportStore.hasTree = hasTree
|
|
1192
|
+
exportStore.hasRowGroup = hasRowGroup
|
|
1193
|
+
exportStore.isPrint = !!isPrint
|
|
1194
|
+
exportStore.hasColgroup = isGroup
|
|
1195
|
+
exportStore.visible = true
|
|
1111
1196
|
// 默认参数
|
|
1112
1197
|
Object.assign(exportParams, {
|
|
1113
1198
|
mode: selectRecords.length ? 'selected' : 'current'
|
|
@@ -1188,7 +1273,8 @@ hooks.add('tableExportModule', {
|
|
|
1188
1273
|
// filename: '',
|
|
1189
1274
|
// sheetName: '',
|
|
1190
1275
|
// original: false,
|
|
1191
|
-
//
|
|
1276
|
+
// isTreeAllExpanded: false,
|
|
1277
|
+
// isRowGroupAllExpanded: false,
|
|
1192
1278
|
// data: null,
|
|
1193
1279
|
// remote: false,
|
|
1194
1280
|
// dataFilterMethod: null,
|
|
@@ -1198,6 +1284,13 @@ hooks.add('tableExportModule', {
|
|
|
1198
1284
|
// beforeExportMethod: null,
|
|
1199
1285
|
// afterExportMethod: null
|
|
1200
1286
|
}, exportOpts, options)
|
|
1287
|
+
|
|
1288
|
+
// 已废弃,参数 isAllExpand
|
|
1289
|
+
if (XEUtils.isBoolean((opts as any).isAllExpand)) {
|
|
1290
|
+
warnLog('vxe.error.delProp', ['isAllExpand', 'isTreeAllExpanded'])
|
|
1291
|
+
opts.isTreeAllExpanded = (opts as any).isAllExpand
|
|
1292
|
+
}
|
|
1293
|
+
|
|
1201
1294
|
let { filename, sheetName, type, mode, columns, original, columnFilterMethod, beforeExportMethod, includeFields, excludeFields } = opts
|
|
1202
1295
|
let groups: any[] = []
|
|
1203
1296
|
const selectRecords = $xeTable.getCheckboxRecords()
|
|
@@ -312,6 +312,11 @@ export default defineVxeComponent({
|
|
|
312
312
|
return computeAggregateOpts.value
|
|
313
313
|
})
|
|
314
314
|
|
|
315
|
+
const computeAggregateMode = computed(() => {
|
|
316
|
+
const aggregateOpts = computeAggregateOpts.value
|
|
317
|
+
return aggregateOpts.mode
|
|
318
|
+
})
|
|
319
|
+
|
|
315
320
|
const computeAggregateAccuracyOpts = computed(() => {
|
|
316
321
|
return Object.assign({}, getConfig().table.aggregateAccuracyConfig, props.aggregateAccuracyConfig)
|
|
317
322
|
})
|
|
@@ -3616,12 +3621,12 @@ export default defineVxeComponent({
|
|
|
3616
3621
|
}
|
|
3617
3622
|
}
|
|
3618
3623
|
|
|
3619
|
-
const handleGroupData = (list: any[], rowGroups: VxeTableDefines.RowGroupItem[]) => {
|
|
3624
|
+
const handleGroupData = (list: any[], rowGroups: VxeTableDefines.RowGroupItem[], isCombinedField?: boolean) => {
|
|
3620
3625
|
let fullData = list
|
|
3621
3626
|
let treeData = list
|
|
3622
3627
|
if (rowGroups) {
|
|
3623
3628
|
const aggregateOpts = computeAggregateOpts.value
|
|
3624
|
-
const { rowField, parentField, childrenField, mapChildrenField } = aggregateOpts
|
|
3629
|
+
const { rowField, parentField, separator, childrenField, mapChildrenField } = aggregateOpts
|
|
3625
3630
|
const rowOpts = computeRowOpts.value
|
|
3626
3631
|
const checkboxOpts = computeCheckboxOpts.value
|
|
3627
3632
|
const { checkField } = checkboxOpts
|
|
@@ -3633,11 +3638,26 @@ export default defineVxeComponent({
|
|
|
3633
3638
|
const groupField = rgItem.field
|
|
3634
3639
|
const groupColumn = $xeTable.getColumnByField(groupField)
|
|
3635
3640
|
const groupMaps: Record<string, any[]> = {}
|
|
3641
|
+
const groupCombinedMaps: Record<string, any[]> = {}
|
|
3636
3642
|
const aggList: VxeTableDefines.AggregateRowInfo[] = []
|
|
3637
3643
|
const rowkey = getRowkey($xeTable)
|
|
3638
3644
|
list.forEach((row) => {
|
|
3639
3645
|
const cellValue = groupColumn ? $xeTable.getCellLabel(row, groupColumn) : XEUtils.get(row, groupField)
|
|
3640
|
-
|
|
3646
|
+
let groupValue = XEUtils.eqNull(cellValue) ? '' : cellValue
|
|
3647
|
+
if (isCombinedField) {
|
|
3648
|
+
const groupVals = [groupValue]
|
|
3649
|
+
rowGroups.slice(1).forEach(ogItem => {
|
|
3650
|
+
const ogField = ogItem.field
|
|
3651
|
+
const ogColumn = $xeTable.getColumnByField(ogField)
|
|
3652
|
+
const ocValue = ogColumn ? $xeTable.getCellLabel(row, ogColumn) : XEUtils.get(row, ogField)
|
|
3653
|
+
const ogValue = XEUtils.eqNull(ocValue) ? '' : ocValue
|
|
3654
|
+
groupValue += (separator || ' / ') + ogValue
|
|
3655
|
+
groupVals.push(ogValue)
|
|
3656
|
+
})
|
|
3657
|
+
if (!groupCombinedMaps[groupValue]) {
|
|
3658
|
+
groupCombinedMaps[groupValue] = groupVals
|
|
3659
|
+
}
|
|
3660
|
+
}
|
|
3641
3661
|
let childList = groupMaps[groupValue]
|
|
3642
3662
|
if (!childList) {
|
|
3643
3663
|
childList = []
|
|
@@ -3648,33 +3668,61 @@ export default defineVxeComponent({
|
|
|
3648
3668
|
}
|
|
3649
3669
|
childList.push(row)
|
|
3650
3670
|
})
|
|
3651
|
-
|
|
3652
|
-
|
|
3653
|
-
|
|
3654
|
-
|
|
3655
|
-
|
|
3656
|
-
|
|
3657
|
-
|
|
3658
|
-
|
|
3659
|
-
|
|
3660
|
-
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
-
|
|
3665
|
-
|
|
3666
|
-
|
|
3667
|
-
|
|
3668
|
-
|
|
3669
|
-
|
|
3670
|
-
|
|
3671
|
-
|
|
3672
|
-
|
|
3673
|
-
|
|
3674
|
-
|
|
3675
|
-
|
|
3676
|
-
|
|
3677
|
-
|
|
3671
|
+
if (isCombinedField) {
|
|
3672
|
+
XEUtils.objectEach(groupMaps, (childList, groupValue) => {
|
|
3673
|
+
const aggRow: VxeTableDefines.AggregateRowInfo = {
|
|
3674
|
+
isAggregate: true,
|
|
3675
|
+
aggData: {},
|
|
3676
|
+
groupContent: groupValue,
|
|
3677
|
+
groupCombineds: groupCombinedMaps[groupValue],
|
|
3678
|
+
groupField,
|
|
3679
|
+
childCount: 0,
|
|
3680
|
+
[rowField]: getRowUniqueId(),
|
|
3681
|
+
[parentField]: null,
|
|
3682
|
+
[childrenField]: childList,
|
|
3683
|
+
[mapChildrenField]: childList
|
|
3684
|
+
}
|
|
3685
|
+
aggRow[rowkey] = createRowId(rowOpts, aggRow, rowkey)
|
|
3686
|
+
if (checkField) {
|
|
3687
|
+
aggRow[checkField] = false
|
|
3688
|
+
}
|
|
3689
|
+
if (indeterminateField) {
|
|
3690
|
+
aggRow[indeterminateField] = false
|
|
3691
|
+
}
|
|
3692
|
+
aggList.push(aggRow)
|
|
3693
|
+
treeData.push(aggRow)
|
|
3694
|
+
fullData.push(aggRow)
|
|
3695
|
+
})
|
|
3696
|
+
} else {
|
|
3697
|
+
XEUtils.objectEach(groupMaps, (childList, groupValue) => {
|
|
3698
|
+
const { fullData: childFullData, treeData: childTreeData } = handleGroupData(childList, rowGroups.slice(1))
|
|
3699
|
+
const aggRow: VxeTableDefines.AggregateRowInfo = {
|
|
3700
|
+
isAggregate: true,
|
|
3701
|
+
aggData: {},
|
|
3702
|
+
groupContent: groupValue,
|
|
3703
|
+
groupCombineds: [],
|
|
3704
|
+
groupField,
|
|
3705
|
+
childCount: 0,
|
|
3706
|
+
[rowField]: getRowUniqueId(),
|
|
3707
|
+
[parentField]: null,
|
|
3708
|
+
[childrenField]: childTreeData,
|
|
3709
|
+
[mapChildrenField]: childTreeData
|
|
3710
|
+
}
|
|
3711
|
+
aggRow[rowkey] = createRowId(rowOpts, aggRow, rowkey)
|
|
3712
|
+
if (checkField) {
|
|
3713
|
+
aggRow[checkField] = false
|
|
3714
|
+
}
|
|
3715
|
+
if (indeterminateField) {
|
|
3716
|
+
aggRow[indeterminateField] = false
|
|
3717
|
+
}
|
|
3718
|
+
aggList.push(aggRow)
|
|
3719
|
+
treeData.push(aggRow)
|
|
3720
|
+
fullData.push(aggRow)
|
|
3721
|
+
if (childFullData.length) {
|
|
3722
|
+
fullData.push(...childFullData)
|
|
3723
|
+
}
|
|
3724
|
+
})
|
|
3725
|
+
}
|
|
3678
3726
|
handleeGroupSummary(aggList)
|
|
3679
3727
|
}
|
|
3680
3728
|
}
|
|
@@ -3684,6 +3732,14 @@ export default defineVxeComponent({
|
|
|
3684
3732
|
}
|
|
3685
3733
|
}
|
|
3686
3734
|
|
|
3735
|
+
const initGroupData = (list: any[], rowGroups: VxeTableDefines.RowGroupItem[]) => {
|
|
3736
|
+
const aggregateOpts = computeAggregateOpts.value
|
|
3737
|
+
const { mode } = aggregateOpts
|
|
3738
|
+
const isCombinedField = mode === 'combined'
|
|
3739
|
+
const groupRest = handleGroupData(list, rowGroups, isCombinedField)
|
|
3740
|
+
return groupRest
|
|
3741
|
+
}
|
|
3742
|
+
|
|
3687
3743
|
const initData = () => {
|
|
3688
3744
|
const { data } = props
|
|
3689
3745
|
loadTableData(data || [], true, true).then(() => {
|
|
@@ -3765,7 +3821,7 @@ export default defineVxeComponent({
|
|
|
3765
3821
|
treeData = fullData.slice(0)
|
|
3766
3822
|
}
|
|
3767
3823
|
} else if ((aggregateConfig || rowGroupConfig) && rowGroupList.length) {
|
|
3768
|
-
const groupRest =
|
|
3824
|
+
const groupRest = initGroupData(fullData, rowGroupList)
|
|
3769
3825
|
treeData = groupRest.treeData
|
|
3770
3826
|
fullData = groupRest.fullData
|
|
3771
3827
|
isRGroup = true
|
|
@@ -13878,6 +13934,12 @@ export default defineVxeComponent({
|
|
|
13878
13934
|
internalData.keepUpdateFieldMaps = kpfMaps
|
|
13879
13935
|
})
|
|
13880
13936
|
|
|
13937
|
+
watch(computeAggregateMode, () => {
|
|
13938
|
+
if (reactData.isRowGroupStatus) {
|
|
13939
|
+
loadTableData(internalData.tableSynchData, false, true)
|
|
13940
|
+
}
|
|
13941
|
+
})
|
|
13942
|
+
|
|
13881
13943
|
if ($xeTabs) {
|
|
13882
13944
|
watch(() => $xeTabs ? $xeTabs.reactData.resizeFlag : null, () => {
|
|
13883
13945
|
handleGlobalResizeEvent()
|
|
@@ -14040,6 +14102,9 @@ export default defineVxeComponent({
|
|
|
14040
14102
|
if (exportConfig && exportOpts.types && !exportOpts.exportMethod && !XEUtils.includeArrays(XEUtils.keys(exportOpts._typeMaps), exportOpts.types)) {
|
|
14041
14103
|
warnLog('vxe.error.errProp', [`export-config.types=${exportOpts.types.join(',')}`, exportOpts.types.filter((type) => XEUtils.includes(XEUtils.keys(exportOpts._typeMaps), type)).join(',') || XEUtils.keys(exportOpts._typeMaps).join(',')])
|
|
14042
14104
|
}
|
|
14105
|
+
if (exportConfig && XEUtils.isBoolean((exportOpts as any).isAllExpand)) {
|
|
14106
|
+
warnLog('vxe.error.delProp', ['isAllExpand', 'isTreeAllExpanded'])
|
|
14107
|
+
}
|
|
14043
14108
|
|
|
14044
14109
|
if (!props.id) {
|
|
14045
14110
|
if ((props.customConfig ? isEnableConf(customOpts) : customOpts.enabled) && customOpts.storage) {
|
|
@@ -342,6 +342,7 @@ export function createReactData (): TableReactData {
|
|
|
342
342
|
hasFooter: false,
|
|
343
343
|
hasMerge: false,
|
|
344
344
|
hasTree: false,
|
|
345
|
+
hasRowGroup: false,
|
|
345
346
|
hasColgroup: false,
|
|
346
347
|
visible: false
|
|
347
348
|
},
|
|
@@ -352,7 +353,8 @@ export function createReactData (): TableReactData {
|
|
|
352
353
|
type: '',
|
|
353
354
|
isColgroup: false,
|
|
354
355
|
isMerge: false,
|
|
355
|
-
|
|
356
|
+
isTreeAllExpanded: false,
|
|
357
|
+
isRowGroupAllExpanded: false,
|
|
356
358
|
useStyle: false,
|
|
357
359
|
original: false,
|
|
358
360
|
message: true,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|