vxe-table 3.11.13 → 3.11.15
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/locale/lang/ar-EG.js +678 -0
- package/es/locale/lang/de-DE.js +678 -0
- package/es/locale/lang/en-US.js +2 -1
- package/es/locale/lang/es-ES.js +2 -1
- package/es/locale/lang/fr-FR.js +678 -0
- package/es/locale/lang/hu-HU.js +2 -1
- package/es/locale/lang/hy-AM.js +678 -0
- 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 +678 -0
- package/es/locale/lang/pt-BR.js +2 -1
- package/es/locale/lang/ru-RU.js +2 -1
- package/es/locale/lang/ug-CN.js +678 -0
- package/es/locale/lang/uk-UA.js +2 -1
- 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/table/module/edit/mixin.js +2 -2
- package/es/table/module/export/mixin.js +14 -8
- package/es/table/module/keyboard/mixin.js +2 -2
- package/es/table/src/body.js +15 -4
- package/es/table/src/methods.js +93 -13
- package/es/table/src/table.js +14 -6
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/index.umd.js +175 -45
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/ar-EG.js +684 -0
- package/lib/locale/lang/ar-EG.min.js +1 -0
- package/lib/locale/lang/de-DE.js +684 -0
- package/lib/locale/lang/de-DE.min.js +1 -0
- package/lib/locale/lang/en-US.js +2 -1
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +2 -1
- 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 +684 -0
- package/lib/locale/lang/fr-FR.min.js +1 -0
- 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 +684 -0
- package/lib/locale/lang/hy-AM.min.js +1 -0
- 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 +684 -0
- package/lib/locale/lang/nb-NO.min.js +1 -0
- 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 +2 -1
- package/lib/locale/lang/ru-RU.min.js +1 -1
- package/lib/locale/lang/ru-RU.umd.js +2 -1
- package/lib/locale/lang/ug-CN.js +684 -0
- package/lib/locale/lang/ug-CN.min.js +1 -0
- package/lib/locale/lang/uk-UA.js +2 -1
- package/lib/locale/lang/uk-UA.min.js +1 -1
- package/lib/locale/lang/uk-UA.umd.js +2 -1
- 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-CHT.umd.js +2 -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/table/module/edit/mixin.js +2 -2
- package/lib/table/module/edit/mixin.min.js +1 -1
- package/lib/table/module/export/mixin.js +14 -8
- package/lib/table/module/export/mixin.min.js +1 -1
- package/lib/table/module/keyboard/mixin.js +2 -2
- package/lib/table/module/keyboard/mixin.min.js +1 -1
- package/lib/table/src/body.js +17 -4
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/methods.js +120 -16
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +16 -10
- package/lib/table/src/table.min.js +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/package.json +2 -2
- package/packages/locale/lang/ar-EG.ts +678 -0
- package/packages/locale/lang/de-DE.ts +678 -0
- package/packages/locale/lang/en-US.ts +2 -1
- package/packages/locale/lang/es-ES.ts +2 -1
- package/packages/locale/lang/fr-FR.ts +678 -0
- package/packages/locale/lang/hu-HU.ts +2 -1
- package/packages/locale/lang/hy-AM.ts +678 -0
- 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 +678 -0
- package/packages/locale/lang/pt-BR.ts +2 -1
- package/packages/locale/lang/ru-RU.ts +2 -1
- package/packages/locale/lang/ug-CN.ts +678 -0
- package/packages/locale/lang/uk-UA.ts +2 -1
- 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/mixin.ts +2 -2
- package/packages/table/module/export/mixin.ts +14 -8
- package/packages/table/module/keyboard/mixin.ts +2 -2
- package/packages/table/src/body.ts +14 -4
- package/packages/table/src/methods.ts +97 -14
- package/packages/table/src/table.ts +14 -6
- /package/es/{iconfont.1732856009240.ttf → iconfont.1733108997206.ttf} +0 -0
- /package/es/{iconfont.1732856009240.woff → iconfont.1733108997206.woff} +0 -0
- /package/es/{iconfont.1732856009240.woff2 → iconfont.1733108997206.woff2} +0 -0
- /package/lib/{iconfont.1732856009240.ttf → iconfont.1733108997206.ttf} +0 -0
- /package/lib/{iconfont.1732856009240.woff → iconfont.1733108997206.woff} +0 -0
- /package/lib/{iconfont.1732856009240.woff2 → iconfont.1733108997206.woff2} +0 -0
|
@@ -46,7 +46,8 @@ export default {
|
|
|
46
46
|
notType: '不支持的文件类型 "{0}"',
|
|
47
47
|
notExp: '该浏览器不支持导入/导出功能',
|
|
48
48
|
impFields: '导入失败,请检查字段名和数据格式是否正确',
|
|
49
|
-
treeNotImp: '树表格不支持导入'
|
|
49
|
+
treeNotImp: '树表格不支持导入',
|
|
50
|
+
reqPlugin: '可选扩展插件 "{1}" https://vxeui.com/other{0}/#/{1}/install'
|
|
50
51
|
},
|
|
51
52
|
table: {
|
|
52
53
|
emptyText: '暂无数据',
|
|
@@ -46,7 +46,8 @@ export default {
|
|
|
46
46
|
notType: '不支持的文件类型 "{0}"',
|
|
47
47
|
notExp: '该浏览器不支持导入/导出功能',
|
|
48
48
|
impFields: '导入失败,请检查字段名和数据格式是否正确',
|
|
49
|
-
treeNotImp: '树表格不支持导入'
|
|
49
|
+
treeNotImp: '树表格不支持导入',
|
|
50
|
+
reqPlugin: '可选扩展插件 "{1}" https://vxeui.com/other{0}/#/{1}/install'
|
|
50
51
|
},
|
|
51
52
|
table: {
|
|
52
53
|
emptyText: '暂无数据',
|
|
@@ -46,7 +46,8 @@ export default {
|
|
|
46
46
|
notType: '不支援的文件類型 "{0}"',
|
|
47
47
|
notExp: '該瀏覽器不支援匯入/匯出功能',
|
|
48
48
|
impFields: '匯入失敗,請檢查欄位名稱和資料格式是否正確',
|
|
49
|
-
treeNotImp: '樹表格不支援導入'
|
|
49
|
+
treeNotImp: '樹表格不支援導入',
|
|
50
|
+
reqPlugin: '可选扩展插件 "{1}" https://vxeui.com/other{0}/#/{1}/install'
|
|
50
51
|
},
|
|
51
52
|
table: {
|
|
52
53
|
emptyText: '暫無數據',
|
|
@@ -46,7 +46,8 @@ export default {
|
|
|
46
46
|
notType: '不支持的文件类型 "{0}"',
|
|
47
47
|
notExp: '该浏览器不支持导入/导出功能',
|
|
48
48
|
impFields: '导入失败,请检查字段名和数据格式是否正确',
|
|
49
|
-
treeNotImp: '树表格不支持导入'
|
|
49
|
+
treeNotImp: '树表格不支持导入',
|
|
50
|
+
reqPlugin: '可选扩展插件 "{1}" https://vxeui.com/other{0}/#/{1}/install'
|
|
50
51
|
},
|
|
51
52
|
table: {
|
|
52
53
|
emptyText: '暂无数据',
|
|
@@ -74,8 +74,8 @@ function handleInsertRowAt (_vm: any, records: any[], row: any, isInsertNextRow?
|
|
|
74
74
|
const rest = { row: item, rowid, seq: -1, index: -1, _index: -1, $index: -1, items: afterFullData, parent: null, level: 0, height: 0 }
|
|
75
75
|
fullDataRowIdData[rowid] = rest
|
|
76
76
|
fullAllDataRowIdData[rowid] = rest
|
|
77
|
-
afterFullData.
|
|
78
|
-
tableFullData.
|
|
77
|
+
afterFullData.unshift(item)
|
|
78
|
+
tableFullData.unshift(item)
|
|
79
79
|
})
|
|
80
80
|
// 刷新单元格合并
|
|
81
81
|
mergeList.forEach((mergeItem: any) => {
|
|
@@ -66,7 +66,7 @@ function toBooleanValue (cellValue: any) {
|
|
|
66
66
|
return XEUtils.isBoolean(cellValue) ? (cellValue ? 'TRUE' : 'FALSE') : cellValue
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
function
|
|
69
|
+
function getBodyLabelData ($xetable: any, opts: any, columns: any[], datas: any[]) {
|
|
70
70
|
const { isAllExpand, mode } = opts
|
|
71
71
|
const { treeConfig, treeOpts, radioOpts, checkboxOpts, columnOpts } = $xetable
|
|
72
72
|
const childrenField = treeOpts.children || treeOpts.childrenField
|
|
@@ -152,15 +152,18 @@ function getLabelData ($xetable: any, opts: any, columns: any[], datas: any[]) {
|
|
|
152
152
|
columns.forEach((column, $columnIndex) => {
|
|
153
153
|
let cellValue = ''
|
|
154
154
|
const renderOpts = column.editRender || column.cellRender
|
|
155
|
-
let
|
|
156
|
-
if (!
|
|
155
|
+
let bodyExportMethod = column.exportMethod
|
|
156
|
+
if (!bodyExportMethod && renderOpts && renderOpts.name) {
|
|
157
157
|
const compConf = renderer.get(renderOpts.name)
|
|
158
158
|
if (compConf) {
|
|
159
|
-
|
|
159
|
+
bodyExportMethod = compConf.tableExportMethod || compConf.exportMethod || (compConf as any).cellExportMethod
|
|
160
160
|
}
|
|
161
161
|
}
|
|
162
|
-
if (
|
|
163
|
-
|
|
162
|
+
if (!bodyExportMethod) {
|
|
163
|
+
bodyExportMethod = columnOpts.exportMethod
|
|
164
|
+
}
|
|
165
|
+
if (bodyExportMethod) {
|
|
166
|
+
cellValue = bodyExportMethod({ $table: $xetable, row, column, options: opts })
|
|
164
167
|
} else {
|
|
165
168
|
switch (column.type) {
|
|
166
169
|
case 'seq': {
|
|
@@ -207,7 +210,7 @@ function getExportData ($xetable: any, opts: any) {
|
|
|
207
210
|
if (dataFilterMethod) {
|
|
208
211
|
datas = datas.filter((row: any, index: any) => dataFilterMethod({ row, $rowIndex: index }))
|
|
209
212
|
}
|
|
210
|
-
return
|
|
213
|
+
return getBodyLabelData($xetable, opts, columns, datas)
|
|
211
214
|
}
|
|
212
215
|
|
|
213
216
|
function getBooleanValue (cellValue: any) {
|
|
@@ -1284,8 +1287,11 @@ export default {
|
|
|
1284
1287
|
|
|
1285
1288
|
// 检查类型,如果为自定义导出,则不需要校验类型
|
|
1286
1289
|
if (!opts.exportMethod && !XEUtils.includes(XEUtils.keys(exportOpts._typeMaps), type)) {
|
|
1290
|
+
errLog('vxe.error.notType', [type])
|
|
1287
1291
|
if (process.env.VUE_APP_VXE_ENV === 'development') {
|
|
1288
|
-
|
|
1292
|
+
if (['xlsx', 'pdf'].includes(type)) {
|
|
1293
|
+
warnLog('vxe.error.reqPlugin', [4, 'plugin-export-xlsx'])
|
|
1294
|
+
}
|
|
1289
1295
|
}
|
|
1290
1296
|
const params = { status: false }
|
|
1291
1297
|
return Promise.reject(params)
|
|
@@ -213,8 +213,8 @@ export default {
|
|
|
213
213
|
},
|
|
214
214
|
handleCellMousedownEvent (evnt: any, params: any) {
|
|
215
215
|
const { editConfig, editOpts, handleSelected, checkboxConfig, checkboxOpts, mouseConfig, mouseOpts } = this
|
|
216
|
-
if (mouseConfig && mouseOpts.area && this.
|
|
217
|
-
return this.
|
|
216
|
+
if (mouseConfig && mouseOpts.area && this.handleMousedownCellAreaEvent) {
|
|
217
|
+
return this.handleMousedownCellAreaEvent(evnt, params)
|
|
218
218
|
} else {
|
|
219
219
|
if (checkboxConfig && checkboxOpts.range) {
|
|
220
220
|
this.handleCheckboxRangeEvent(evnt, params)
|
|
@@ -358,12 +358,12 @@ function renderRows (h: CreateElement, _vm: any, $xeTable: any, fixedType: any,
|
|
|
358
358
|
columnOpts,
|
|
359
359
|
isDragColMove
|
|
360
360
|
} = $xeTable
|
|
361
|
+
const { transform, seqMode } = treeOpts
|
|
361
362
|
const childrenField = treeOpts.children || treeOpts.childrenField
|
|
362
363
|
const rows: any[] = []
|
|
363
364
|
tableData.forEach((row: any, $rowIndex: any) => {
|
|
364
365
|
const trOn: any = {}
|
|
365
366
|
let rowIndex = $rowIndex
|
|
366
|
-
const _rowIndex = $xeTable.getVTRowIndex(row)
|
|
367
367
|
// 确保任何情况下 rowIndex 都精准指向真实 data 索引
|
|
368
368
|
rowIndex = $xeTable.getRowIndex(row)
|
|
369
369
|
// 当前行事件
|
|
@@ -383,8 +383,18 @@ function renderRows (h: CreateElement, _vm: any, $xeTable: any, fixedType: any,
|
|
|
383
383
|
}
|
|
384
384
|
const rowid = getRowid($xeTable, row)
|
|
385
385
|
const rest = fullAllDataRowIdData[rowid]
|
|
386
|
-
|
|
387
|
-
|
|
386
|
+
let rowLevel = 0
|
|
387
|
+
let seq = -1
|
|
388
|
+
let _rowIndex = 0
|
|
389
|
+
if (rest) {
|
|
390
|
+
rowLevel = rest.level
|
|
391
|
+
if (treeConfig && transform && seqMode === 'increasing') {
|
|
392
|
+
seq = rest._index + 1
|
|
393
|
+
} else {
|
|
394
|
+
seq = rest.seq
|
|
395
|
+
}
|
|
396
|
+
_rowIndex = rest._index
|
|
397
|
+
}
|
|
388
398
|
const params = { $table: $xeTable, seq, rowid, fixed: fixedType, type: renderType, level: rowLevel, row, rowIndex, $rowIndex }
|
|
389
399
|
// 行是否被展开
|
|
390
400
|
const isExpandRow = expandColumn && !!rowExpandedMaps[rowid]
|
|
@@ -416,7 +426,7 @@ function renderRows (h: CreateElement, _vm: any, $xeTable: any, fixedType: any,
|
|
|
416
426
|
'vxe-body--row',
|
|
417
427
|
treeConfig ? `row--level-${rowLevel}` : '',
|
|
418
428
|
{
|
|
419
|
-
'row--stripe': stripe && (
|
|
429
|
+
'row--stripe': stripe && (_rowIndex + 1) % 2 === 0,
|
|
420
430
|
'is--new': isNewRow,
|
|
421
431
|
'is--expand-row': isExpandRow,
|
|
422
432
|
'is--expand-tree': isExpandTree,
|
|
@@ -510,16 +510,15 @@ function handleRecalculateLayout ($xeTable: any, reFull: boolean) {
|
|
|
510
510
|
}
|
|
511
511
|
$xeTable.calcCellWidth()
|
|
512
512
|
$xeTable.autoCellWidth()
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
513
|
+
return $xeTable.computeScrollLoad().then(() => {
|
|
514
|
+
if (reFull === true) {
|
|
515
|
+
// 初始化时需要在列计算之后再执行优化运算,达到最优显示效果
|
|
516
516
|
calcCellHeight($xeTable)
|
|
517
517
|
$xeTable.calcCellWidth()
|
|
518
518
|
$xeTable.autoCellWidth()
|
|
519
519
|
return $xeTable.computeScrollLoad()
|
|
520
|
-
}
|
|
521
|
-
}
|
|
522
|
-
return $xeTable.computeScrollLoad()
|
|
520
|
+
}
|
|
521
|
+
})
|
|
523
522
|
}
|
|
524
523
|
|
|
525
524
|
function checkLastSyncScroll ($xeTable: any, isRollX: boolean, isRollY: boolean) {
|
|
@@ -1699,6 +1698,10 @@ const Methods = {
|
|
|
1699
1698
|
* @returns
|
|
1700
1699
|
*/
|
|
1701
1700
|
handleVirtualTreeToList () {
|
|
1701
|
+
const $xeTable = this
|
|
1702
|
+
const internalData = $xeTable
|
|
1703
|
+
|
|
1704
|
+
const { fullAllDataRowIdData } = internalData
|
|
1702
1705
|
const { treeOpts, treeConfig, treeExpandedMaps, afterTreeFullData, afterFullData } = this
|
|
1703
1706
|
const childrenField = treeOpts.children || treeOpts.childrenField
|
|
1704
1707
|
if (treeConfig && treeOpts.transform) {
|
|
@@ -1708,6 +1711,10 @@ const Methods = {
|
|
|
1708
1711
|
const rowid = getRowid(this, row)
|
|
1709
1712
|
const parentRowid = getRowid(this, parent)
|
|
1710
1713
|
if (!parent || (expandMaps[parentRowid] && treeExpandedMaps[parentRowid])) {
|
|
1714
|
+
const rowRest = fullAllDataRowIdData[rowid]
|
|
1715
|
+
if (rowRest) {
|
|
1716
|
+
rowRest._index = fullData.length
|
|
1717
|
+
}
|
|
1711
1718
|
expandMaps[rowid] = 1
|
|
1712
1719
|
fullData.push(row)
|
|
1713
1720
|
}
|
|
@@ -1840,17 +1847,47 @@ const Methods = {
|
|
|
1840
1847
|
this.afterTreeFullData = tableTree
|
|
1841
1848
|
this.updateAfterDataIndex()
|
|
1842
1849
|
},
|
|
1850
|
+
updateTreeDataIndex () {
|
|
1851
|
+
const $xeTable = this
|
|
1852
|
+
const props = $xeTable
|
|
1853
|
+
const internalData = $xeTable
|
|
1854
|
+
|
|
1855
|
+
const { treeConfig } = props
|
|
1856
|
+
const { afterFullData, fullDataRowIdData, fullAllDataRowIdData } = internalData
|
|
1857
|
+
const treeOpts = $xeTable.computeTreeOpts
|
|
1858
|
+
if (treeConfig) {
|
|
1859
|
+
if (treeOpts.transform) {
|
|
1860
|
+
afterFullData.forEach((row: any, index: number) => {
|
|
1861
|
+
const rowid = getRowid($xeTable, row)
|
|
1862
|
+
const rowRest = fullAllDataRowIdData[rowid]
|
|
1863
|
+
if (rowRest) {
|
|
1864
|
+
rowRest._index = index
|
|
1865
|
+
} else {
|
|
1866
|
+
const rest = { row, rowid, seq: '-1', index: -1, $index: -1, _index: index, items: [], parent: null, level: 0, height: 0 }
|
|
1867
|
+
fullAllDataRowIdData[rowid] = rest
|
|
1868
|
+
fullDataRowIdData[rowid] = rest
|
|
1869
|
+
}
|
|
1870
|
+
})
|
|
1871
|
+
}
|
|
1872
|
+
}
|
|
1873
|
+
},
|
|
1843
1874
|
/**
|
|
1844
1875
|
* 预编译
|
|
1845
1876
|
* 对渲染中的数据提前解析序号及索引。牺牲提前编译耗时换取渲染中额外损耗,使运行时更加流畅
|
|
1846
1877
|
*/
|
|
1847
1878
|
updateAfterDataIndex () {
|
|
1848
|
-
const
|
|
1879
|
+
const $xeTable = this
|
|
1880
|
+
const props = $xeTable
|
|
1881
|
+
const internalData = $xeTable
|
|
1882
|
+
|
|
1883
|
+
const { treeConfig } = props
|
|
1884
|
+
const { afterFullData, fullDataRowIdData, fullAllDataRowIdData, afterTreeFullData } = internalData
|
|
1885
|
+
const treeOpts = $xeTable.computeTreeOpts
|
|
1849
1886
|
const childrenField = treeOpts.children || treeOpts.childrenField
|
|
1850
1887
|
const fullMaps: any = {}
|
|
1851
1888
|
if (treeConfig) {
|
|
1852
1889
|
XEUtils.eachTree(afterTreeFullData, (row, index, items, path) => {
|
|
1853
|
-
const rowid = getRowid(
|
|
1890
|
+
const rowid = getRowid($xeTable, row)
|
|
1854
1891
|
const rowRest = fullAllDataRowIdData[rowid]
|
|
1855
1892
|
const seq = path.map((num, i) => i % 2 === 0 ? (Number(num) + 1) : '.').join('')
|
|
1856
1893
|
if (rowRest) {
|
|
@@ -1863,9 +1900,10 @@ const Methods = {
|
|
|
1863
1900
|
}
|
|
1864
1901
|
fullMaps[rowid] = row
|
|
1865
1902
|
}, { children: treeOpts.transform ? treeOpts.mapChildrenField : childrenField })
|
|
1903
|
+
$xeTable.updateTreeDataIndex()
|
|
1866
1904
|
} else {
|
|
1867
|
-
afterFullData.forEach((row: any, index:
|
|
1868
|
-
const rowid = getRowid(
|
|
1905
|
+
afterFullData.forEach((row: any, index: number) => {
|
|
1906
|
+
const rowid = getRowid($xeTable, row)
|
|
1869
1907
|
const rowRest = fullAllDataRowIdData[rowid]
|
|
1870
1908
|
const seq = index + 1
|
|
1871
1909
|
if (rowRest) {
|
|
@@ -1881,10 +1919,40 @@ const Methods = {
|
|
|
1881
1919
|
}
|
|
1882
1920
|
this.afterFullRowMaps = fullMaps
|
|
1883
1921
|
},
|
|
1922
|
+
/**
|
|
1923
|
+
* 只对 tree-config 有效,获取行的子级
|
|
1924
|
+
*/
|
|
1925
|
+
getTreeRowChildren (rowOrRowid: any) {
|
|
1926
|
+
const $xeTable = this
|
|
1927
|
+
const props = $xeTable
|
|
1928
|
+
const internalData = $xeTable
|
|
1929
|
+
|
|
1930
|
+
const { treeConfig } = props
|
|
1931
|
+
const { fullDataRowIdData } = internalData
|
|
1932
|
+
const treeOpts = $xeTable.computeTreeOpts
|
|
1933
|
+
const { transform, mapChildrenField } = treeOpts
|
|
1934
|
+
const childrenField = treeOpts.children || treeOpts.childrenField
|
|
1935
|
+
if (rowOrRowid && treeConfig) {
|
|
1936
|
+
let rowid
|
|
1937
|
+
if (XEUtils.isString(rowOrRowid)) {
|
|
1938
|
+
rowid = rowOrRowid
|
|
1939
|
+
} else {
|
|
1940
|
+
rowid = getRowid($xeTable, rowOrRowid)
|
|
1941
|
+
}
|
|
1942
|
+
if (rowid) {
|
|
1943
|
+
const rest = fullDataRowIdData[rowid]
|
|
1944
|
+
const row = rest ? rest.row : null
|
|
1945
|
+
if (row) {
|
|
1946
|
+
return row[transform ? mapChildrenField : childrenField] || []
|
|
1947
|
+
}
|
|
1948
|
+
}
|
|
1949
|
+
}
|
|
1950
|
+
return []
|
|
1951
|
+
},
|
|
1884
1952
|
/**
|
|
1885
1953
|
* 只对 tree-config 有效,获取行的父级
|
|
1886
1954
|
*/
|
|
1887
|
-
|
|
1955
|
+
getTreeParentRow (rowOrRowid: any) {
|
|
1888
1956
|
const { treeConfig, fullDataRowIdData } = this
|
|
1889
1957
|
if (rowOrRowid && treeConfig) {
|
|
1890
1958
|
let rowid
|
|
@@ -1900,6 +1968,12 @@ const Methods = {
|
|
|
1900
1968
|
}
|
|
1901
1969
|
return null
|
|
1902
1970
|
},
|
|
1971
|
+
getParentRow (rowOrRowid: any) {
|
|
1972
|
+
const $xeTable = this
|
|
1973
|
+
|
|
1974
|
+
warnLog('vxe.error.delFunc', ['getParentRow', 'getTreeParentRow'])
|
|
1975
|
+
return $xeTable.getTreeParentRow(rowOrRowid)
|
|
1976
|
+
},
|
|
1903
1977
|
/**
|
|
1904
1978
|
* 根据行的唯一主键获取行
|
|
1905
1979
|
* @param {String/Number} rowid 行主键
|
|
@@ -5801,7 +5875,9 @@ const Methods = {
|
|
|
5801
5875
|
}
|
|
5802
5876
|
return this.$nextTick().then(() => {
|
|
5803
5877
|
if (transform) {
|
|
5804
|
-
|
|
5878
|
+
this.handleTableData()
|
|
5879
|
+
this.updateTreeDataIndex()
|
|
5880
|
+
return this.$nextTick()
|
|
5805
5881
|
}
|
|
5806
5882
|
})
|
|
5807
5883
|
})
|
|
@@ -5898,7 +5974,9 @@ const Methods = {
|
|
|
5898
5974
|
validRows.forEach((row: any) => this.handleTreeExpandReserve(row, expanded))
|
|
5899
5975
|
}
|
|
5900
5976
|
this.treeExpandedMaps = treeTempExpandedMaps
|
|
5901
|
-
return Promise.all(result).then(
|
|
5977
|
+
return Promise.all(result).then(() => {
|
|
5978
|
+
return this.recalculate()
|
|
5979
|
+
})
|
|
5902
5980
|
},
|
|
5903
5981
|
/**
|
|
5904
5982
|
* 虚拟树的展开与收起
|
|
@@ -5909,9 +5987,14 @@ const Methods = {
|
|
|
5909
5987
|
handleVirtualTreeExpand (rows: any, expanded: any) {
|
|
5910
5988
|
return this.handleBaseTreeExpand(rows, expanded).then(() => {
|
|
5911
5989
|
this.handleVirtualTreeToList()
|
|
5912
|
-
|
|
5990
|
+
this.handleTableData()
|
|
5991
|
+
this.updateTreeDataIndex()
|
|
5913
5992
|
}).then(() => {
|
|
5914
5993
|
return this.recalculate()
|
|
5994
|
+
}).then(() => {
|
|
5995
|
+
setTimeout(() => {
|
|
5996
|
+
this.updateCellAreas()
|
|
5997
|
+
}, 30)
|
|
5915
5998
|
})
|
|
5916
5999
|
},
|
|
5917
6000
|
/**
|
|
@@ -873,7 +873,7 @@ export default {
|
|
|
873
873
|
if (this.showFooter && !(this.footerMethod || this.footerData)) {
|
|
874
874
|
warnLog('vxe.error.reqProp', ['footer-data | footer-method'])
|
|
875
875
|
}
|
|
876
|
-
if (treeConfig && this.stripe) {
|
|
876
|
+
if (treeConfig && !treeOpts.transform && this.stripe) {
|
|
877
877
|
warnLog('vxe.error.noTree', ['stripe'])
|
|
878
878
|
}
|
|
879
879
|
if (this.tooltipOpts.enabled) {
|
|
@@ -912,7 +912,10 @@ export default {
|
|
|
912
912
|
if (this.rowOpts.height && !this.showOverflow) {
|
|
913
913
|
warnLog('vxe.error.notProp', ['table.show-overflow'])
|
|
914
914
|
}
|
|
915
|
-
if (!this.
|
|
915
|
+
if (!this.handleMousedownCellAreaEvent) {
|
|
916
|
+
if (this.areaConfig) {
|
|
917
|
+
warnLog('vxe.error.notProp', ['area-config'])
|
|
918
|
+
}
|
|
916
919
|
if (this.clipConfig) {
|
|
917
920
|
warnLog('vxe.error.notProp', ['clip-config'])
|
|
918
921
|
}
|
|
@@ -939,7 +942,7 @@ export default {
|
|
|
939
942
|
// if (this.mouseOpts.area && this.checkboxOpts.range) {
|
|
940
943
|
// warnLog('vxe.error.errConflicts', ['mouse-config.area', 'checkbox-config.range'])
|
|
941
944
|
// }
|
|
942
|
-
if (this.
|
|
945
|
+
if (this.mouseOpts.area && (this.treeConfig && !treeOpts.transform)) {
|
|
943
946
|
errLog('vxe.error.noTree', ['mouse-config.area'])
|
|
944
947
|
}
|
|
945
948
|
}
|
|
@@ -1056,7 +1059,7 @@ export default {
|
|
|
1056
1059
|
|
|
1057
1060
|
$xeTable.$nextTick(() => {
|
|
1058
1061
|
if (props.loading) {
|
|
1059
|
-
if (!VxeUILoadingComponent) {
|
|
1062
|
+
if (!VxeUILoadingComponent && !this.$scopedSlots.loading) {
|
|
1060
1063
|
errLog('vxe.error.reqComp', ['vxe-loading'])
|
|
1061
1064
|
}
|
|
1062
1065
|
}
|
|
@@ -1357,8 +1360,13 @@ export default {
|
|
|
1357
1360
|
value: currLoading,
|
|
1358
1361
|
icon: loadingOpts.icon,
|
|
1359
1362
|
text: loadingOpts.text
|
|
1360
|
-
}
|
|
1361
|
-
|
|
1363
|
+
},
|
|
1364
|
+
scopedSlots: loadingSlot
|
|
1365
|
+
? {
|
|
1366
|
+
default: () => $xeTable.callSlot(loadingSlot, { $table: $xeTable, $grid: $xeGrid, loading: currLoading }, h)
|
|
1367
|
+
}
|
|
1368
|
+
: {}
|
|
1369
|
+
})
|
|
1362
1370
|
: loadingSlot
|
|
1363
1371
|
? h('div', {
|
|
1364
1372
|
class: ['vxe-loading--custom-wrapper', {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|