mirror of
https://github.com/jumpserver/lina.git
synced 2025-09-25 06:19:51 +00:00
perf: 创建、更新资产默认按照更新时间排序
This commit is contained in:
committed by
Jiangjie.Bai
parent
90659afc36
commit
822fa9714c
@@ -78,6 +78,17 @@ export default {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
return this.$axios[submitMethod](url, values)
|
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
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -67,6 +67,11 @@ export default {
|
|||||||
optionInfo: {
|
optionInfo: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: () => ({})
|
default: () => ({})
|
||||||
|
},
|
||||||
|
// url中需要添加额外的参数
|
||||||
|
extraQuery: {
|
||||||
|
type: Object,
|
||||||
|
default: () => ({})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
@@ -93,6 +98,7 @@ export default {
|
|||||||
}
|
}
|
||||||
vm.$router.push(route)
|
vm.$router.push(route)
|
||||||
}
|
}
|
||||||
|
const extraQuery = this.$route.params?.extraQuery || {}
|
||||||
return {
|
return {
|
||||||
showPlatform: false,
|
showPlatform: false,
|
||||||
GatewayPort: 0,
|
GatewayPort: 0,
|
||||||
@@ -104,6 +110,10 @@ export default {
|
|||||||
app: 'assets',
|
app: 'assets',
|
||||||
resource: 'asset'
|
resource: 'asset'
|
||||||
},
|
},
|
||||||
|
extraQuery: {
|
||||||
|
...extraQuery,
|
||||||
|
...this.extraQuery
|
||||||
|
},
|
||||||
columnsExclude: ['spec_info', 'auto_info'],
|
columnsExclude: ['spec_info', 'auto_info'],
|
||||||
columnsShow: {
|
columnsShow: {
|
||||||
min: ['name', 'address', 'actions'],
|
min: ['name', 'address', 'actions'],
|
||||||
|
Reference in New Issue
Block a user