Fixed: Session Detail

This commit is contained in:
zhaojisen
2025-03-13 15:57:22 +08:00
committed by ZhaoJiSen
parent 5e12e7ea84
commit 2896dfe3b1
2 changed files with 11 additions and 6 deletions

View File

@@ -114,20 +114,22 @@ export default {
return resource.replace(' details', '').replace('详情', '')
},
getDrawerTitle() {
let drawerTitle = ''
if (this.formatterArgs?.getTitle && typeof this.formatterArgs.getTitle === 'function') {
drawerTitle = this.formatterArgs.getTitle({
if (this.formatterArgs?.getDrawerTitle && typeof this.formatterArgs.getDrawerTitle === 'function') {
this.formatterArgs.getDrawerTitle({
col: this.col,
row: this.row,
cellValue: this.cellValue,
index: this.index
cellValue: this.cellValue
})
}
let title = this.cellValue?.name || drawerTitle
let title = this.cellValue || this.row.name
const resource = this.getResource()
if (resource) {
title = `${resource}: ${title}`
}
return title
},
resolveRoute() {

View File

@@ -63,6 +63,9 @@ export default {
drawer: true,
can: this.$hasPerm('assets.view_asset'),
getTitle: ({ row, col, cellValue, index }) => { return index + 1 },
getDrawerTitle: ({ row }) => {
return row.id
},
getRoute: ({ row }) => {
return {
name: 'SessionDetail',