diff --git a/src/components/Table/DrawerListTable/index.vue b/src/components/Table/DrawerListTable/index.vue index 3725a4705..77ae988af 100644 --- a/src/components/Table/DrawerListTable/index.vue +++ b/src/components/Table/DrawerListTable/index.vue @@ -256,19 +256,29 @@ export default { } }, getDetailComponent({ detailRoute }) { - const route = this.resolveRoute(detailRoute) - if (route) { - return route.components.default + if (!detailRoute) { + return this.detailDrawer } + this.$log.debug('>>> getDetailComponent: ', detailRoute) + const route = this.resolveRoute(detailRoute) + let component = null + if (route) { + component = route.components.default + } + if (!component) { + component = this.detailDrawer + } + return component }, getDrawerComponent(action, payload) { + this.$log.debug('>>> getDrawerComponent: ', action, payload) switch (action) { case 'create': return this.createDrawer case 'update': return this.updateDrawer || this.createDrawer case 'detail': - return this.detailDrawer || this.getDetailComponent(payload) + return this.getDetailComponent(payload) case 'clone': return this.createDrawer || this.getDefaultDrawer('create') default: @@ -287,6 +297,7 @@ export default { // 3. 设置组件 this.drawerComponent = this.getDrawerComponent(action, payload) + this.$log.debug('>>> drawerComponent: ', this.drawerComponent) this.drawerTitle = this.getActionDrawerTitle({ action, row, col, cellValue, payload }) // 4. 如果没有组件,尝试获取默认组件 diff --git a/src/views/accounts/PAM/AccountList.vue b/src/views/accounts/PAM/AccountList.vue index 6681868c0..2bc4de76f 100644 --- a/src/views/accounts/PAM/AccountList.vue +++ b/src/views/accounts/PAM/AccountList.vue @@ -22,6 +22,10 @@ export default { formatter: DetailFormatter, formatterArgs: { drawer: true, + getRoute: ({ row }) => ({ + name: 'AssetDetail', + params: { id: row.asset.id } + }), can: this.$hasPerm('assets.view_asset'), getTitle: ({ row }) => row.asset.name }