fix: 修复资产列表baseList传参

This commit is contained in:
“huailei000”
2022-09-06 10:46:18 +08:00
committed by huailei
parent 8c178d92de
commit 17bf2b0611
3 changed files with 8 additions and 5 deletions

View File

@@ -13,7 +13,7 @@
/>
<BaseList
slot="table"
:table-config="tableConfig"
v-bind="tableConfig"
/>
</TreeTable>

View File

@@ -27,7 +27,7 @@ export default {
}
]
},
columnsMeta: {
addColumnsMeta: {
actions: {
formatter: ActionsFormatter,
formatterArgs: {

View File

@@ -28,7 +28,7 @@ export default {
},
category: {
type: String,
default: 'all'
default: ''
},
tableConfig: {
type: Object,
@@ -114,6 +114,10 @@ export default {
actions: {
formatter: ActionsFormatter,
formatterArgs: {
onUpdate: ({ row }) => {
const routeName = _.capitalize(row.category.value) + 'Update'
vm.$router.push({ name: routeName, params: { id: row.id }})
},
performDelete: ({ row }) => {
const id = row.id
const url = `/api/v1/assets/assets/${id}/`
@@ -124,7 +128,6 @@ export default {
}
},
defaultHeaderActions: {
createRoute: 'HostCreate',
onCreate: () => {
this.showPlatform = true
},
@@ -189,7 +192,7 @@ export default {
iTableConfig() {
const config = _.merge(this.defaultConfig, this.tableConfig, {
url: this.url,
category: this.category
...(this.category && { category: this.category })
})
if (this.addColumns.length > 0) {
config.columns = [