perf: 优化clone

This commit is contained in:
ibuler
2021-07-14 16:50:06 +08:00
committed by 老广
parent e7ae4bfbd3
commit 35c7b81359
2 changed files with 17 additions and 2 deletions

View File

@@ -32,6 +32,9 @@ export default {
if (headerActions.canCreate === undefined && this.currentOrgIsRoot) {
_.set(this.$attrs, 'header-actions.canCreate', false)
}
if (headerActions.hasImport === undefined && this.currentOrgIsRoot) {
_.set(this.$attrs, 'header-actions.hasImport', false)
}
},
methods: {
hideRMenu() {

View File

@@ -15,6 +15,7 @@ export default {
GenericListTable
},
data() {
const vm = this
return {
tableConfig: {
url: '/api/v1/assets/admin-users/',
@@ -35,8 +36,19 @@ export default {
},
actions: {
formatterArgs: {
updateRoute: { name: 'SystemUserUpdate', query: { type: 'admin' }},
cloneRoute: { name: 'SystemUserCreate', query: { type: 'admin' }}
onUpdate: ({ row }) => {
vm.$router.push({
name: 'SystemUserUpdate',
params: { id: row.id },
query: { protocol: row.protocol, type: 'admin' }
})
},
onClone: ({ row }) => {
vm.$router.push({
name: 'SystemUserCreate',
query: { protocol: row.protocol, type: 'admin', clone_from: row.id }
})
}
}
}
}