Fixed: Fix: Applications related to Drawer in the component settings page

This commit is contained in:
zhaojisen
2025-03-07 14:42:39 +08:00
committed by ZhaoJiSen
parent ad02a57c0a
commit a106b5e199
4 changed files with 40 additions and 22 deletions

View File

@@ -38,8 +38,7 @@ export default {
actions: {
canUpdate: this.$hasPerm('terminal.change_terminal'),
hasDelete: this.$hasPerm('terminal.delete_terminal'),
canDelete: this.$hasPerm('terminal.delete_terminal'),
detailApiUrl: `/api/v1/terminal/terminals/${this.$route.params.id}/`
canDelete: this.$hasPerm('terminal.delete_terminal')
},
titlePrefix: this.$t('TerminalDetail')
}
@@ -49,7 +48,3 @@ export default {
}
}
</script>
<style scoped>
</style>

View File

@@ -1,6 +1,12 @@
<template>
<div>
<ListTable :header-actions="headerActions" :table-config="tableConfig" />
<ListTable
ref="ListTable"
:header-actions="headerActions"
:table-config="tableConfig"
:create-drawer="createDrawer"
:detail-drawer="detailDrawer"
/>
<Dialog
:destroy-on-close="true"
:show-cancel="false"
@@ -14,11 +20,13 @@
</template>
<script>
import ListTable from '@/components/Table/ListTable'
import { GenericCreateUpdateForm } from '@/layout/components'
import Dialog from '@/components/Dialog'
import Select2 from '@/components/Form/FormFields/Select2'
import { DrawerListTable as ListTable } from '@/components'
import { GenericCreateUpdateForm } from '@/layout/components'
import { DetailFormatter } from '@/components/Table/TableFormatters'
export default {
components: {
ListTable,
@@ -28,6 +36,8 @@ export default {
data() {
const vm = this
return {
createDrawer: () => import('./TerminalUpdate.vue'),
detailDrawer: () => import('./TerminalDetail/index.vue'),
dialogSettings: {
selectedRows: [],
visible: false,
@@ -110,8 +120,17 @@ export default {
columnsMeta: {
name: {
sortable: 'custom',
formatter: DetailFormatter,
formatterArgs: {
route: 'TerminalDetail'
drawer: true,
getRoute: ({ row }) => {
return {
name: 'TerminalDetail',
params: {
id: row.id
}
}
}
}
},
stat: {

View File

@@ -1,12 +1,17 @@
<template>
<div>
<el-alert v-sanitize="helpMessage" type="success" />
<ListTable :header-actions="headerActions" :table-config="tableConfig" />
<ListTable
ref="ListTable"
:header-actions="headerActions"
:table-config="tableConfig"
:create-drawer="createDrawer"
/>
</div>
</template>
<script>
import ListTable from '@/components/Table/ListTable'
import { DrawerListTable as ListTable } from '@/components'
export default {
name: 'EndpointList',
@@ -15,6 +20,7 @@ export default {
},
data() {
return {
createDrawer: () => import('./EndpointCreateUpdate.vue'),
helpMessage: this.$t('EndpointListHelpMessage'),
tableConfig: {
url: '/api/v1/terminal/endpoints/',
@@ -51,7 +57,3 @@ export default {
}
}
</script>
<style>
</style>

View File

@@ -1,12 +1,17 @@
<template>
<div>
<el-alert v-sanitize="helpMessage" type="success" />
<ListTable :header-actions="headerActions" :table-config="tableConfig" />
<ListTable
ref="ListTable"
:header-actions="headerActions"
:table-config="tableConfig"
:create-drawer="createDrawer"
/>
</div>
</template>
<script>
import ListTable from '@/components/Table/ListTable'
import { DrawerListTable as ListTable } from '@/components'
export default {
name: 'EndpointRule',
@@ -15,6 +20,7 @@ export default {
},
data() {
return {
createDrawer: () => import('./EndpointRuleCreateUpdate.vue'),
helpMessage: this.$t('EndpointRuleListHelpMessage'),
tableConfig: {
url: '/api/v1/terminal/endpoint-rules/',
@@ -46,7 +52,3 @@ export default {
}
}
</script>
<style scoped>
</style>