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('详情', '') return resource.replace(' details', '').replace('详情', '')
}, },
getDrawerTitle() { getDrawerTitle() {
let drawerTitle = '' if (this.formatterArgs?.getDrawerTitle && typeof this.formatterArgs.getDrawerTitle === 'function') {
if (this.formatterArgs?.getTitle && typeof this.formatterArgs.getTitle === 'function') { this.formatterArgs.getDrawerTitle({
drawerTitle = this.formatterArgs.getTitle({
col: this.col, col: this.col,
row: this.row, row: this.row,
cellValue: this.cellValue, cellValue: this.cellValue
index: this.index
}) })
} }
let title = this.cellValue?.name || drawerTitle
let title = this.cellValue || this.row.name
const resource = this.getResource() const resource = this.getResource()
if (resource) { if (resource) {
title = `${resource}: ${title}` title = `${resource}: ${title}`
} }
return title return title
}, },
resolveRoute() { resolveRoute() {

View File

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