perf: 创建、更新资产默认按照更新时间排序

This commit is contained in:
“huailei000”
2023-03-28 15:47:56 +08:00
committed by Jiangjie.Bai
parent 90659afc36
commit 822fa9714c
2 changed files with 21 additions and 0 deletions

View File

@@ -78,6 +78,17 @@ export default {
})
}
return this.$axios[submitMethod](url, values)
},
onPerformSuccess(res, method) {
const nextRoute = this.$router.push({ name: 'AssetList', params: { extraQuery: { order: '-date_updated' }}})
switch (method) {
case 'post':
this.$message.success(this.$tc('common.createSuccessMsg'))
return nextRoute
case 'put':
this.$message.success(this.$tc('common.updateSuccessMsg'))
return nextRoute
}
}
}
}

View File

@@ -67,6 +67,11 @@ export default {
optionInfo: {
type: Object,
default: () => ({})
},
// url中需要添加额外的参数
extraQuery: {
type: Object,
default: () => ({})
}
},
data() {
@@ -93,6 +98,7 @@ export default {
}
vm.$router.push(route)
}
const extraQuery = this.$route.params?.extraQuery || {}
return {
showPlatform: false,
GatewayPort: 0,
@@ -104,6 +110,10 @@ export default {
app: 'assets',
resource: 'asset'
},
extraQuery: {
...extraQuery,
...this.extraQuery
},
columnsExclude: ['spec_info', 'auto_info'],
columnsShow: {
min: ['name', 'address', 'actions'],