mirror of
https://github.com/jumpserver/lina.git
synced 2025-09-20 10:46:35 +00:00
[Update] 修改删除
This commit is contained in:
@@ -104,6 +104,7 @@
|
|||||||
:key="row.id"
|
:key="row.id"
|
||||||
:table-data="data"
|
:table-data="data"
|
||||||
:row="row"
|
:row="row"
|
||||||
|
:url="url"
|
||||||
:reload="getList"
|
:reload="getList"
|
||||||
:col="col"
|
:col="col"
|
||||||
:cell-value="row[col.prop]"
|
:cell-value="row[col.prop]"
|
||||||
|
@@ -8,7 +8,7 @@ import BaseFormatter from './base'
|
|||||||
|
|
||||||
const defaultPerformDelete = function({ row, col }) {
|
const defaultPerformDelete = function({ row, col }) {
|
||||||
const id = row.id
|
const id = row.id
|
||||||
const url = `/api/v1/users/groups/${id}/`
|
const url = `${this.url}${id}/`
|
||||||
return this.$axios.delete(url)
|
return this.$axios.delete(url)
|
||||||
}
|
}
|
||||||
const defaultUpdateCallback = function({row, col}) {
|
const defaultUpdateCallback = function({row, col}) {
|
||||||
@@ -56,16 +56,16 @@ export default {
|
|||||||
name: 'update',
|
name: 'update',
|
||||||
title: this.$tc('Update'),
|
title: this.$tc('Update'),
|
||||||
type: 'primary',
|
type: 'primary',
|
||||||
has: colActions.hasUpdate || true,
|
has: colActions.hasUpdate !== false,
|
||||||
can: colActions.canUpdate || true,
|
can: colActions.canUpdate !== false,
|
||||||
callback: colActions.onUpdate || defaultUpdateCallback.bind(this)
|
callback: colActions.onUpdate || defaultUpdateCallback.bind(this)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'delete',
|
name: 'delete',
|
||||||
title: this.$tc('Delete'),
|
title: this.$tc('Delete'),
|
||||||
type: 'danger',
|
type: 'danger',
|
||||||
has: colActions.hasDelete || true,
|
has: colActions.hasDelete !== false,
|
||||||
can: colActions.canDelete || true,
|
can: colActions.canDelete !== false,
|
||||||
callback: colActions.onDelete || defaultDeleteCallback.bind(this)
|
callback: colActions.onDelete || defaultDeleteCallback.bind(this)
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@@ -24,6 +24,10 @@ export default {
|
|||||||
tableData: {
|
tableData: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default: () => ({})
|
default: () => ({})
|
||||||
|
},
|
||||||
|
url: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -26,7 +26,7 @@ export default {
|
|||||||
},
|
},
|
||||||
fields: [
|
fields: [
|
||||||
'name', 'username', 'email', 'groups', 'password_strategy', 'password', 'mfa_level',
|
'name', 'username', 'email', 'groups', 'password_strategy', 'password', 'mfa_level',
|
||||||
'source', 'role', 'date_expired', 'phone', 'wechat', 'comment'
|
'source', 'role', 'date_expired', 'phone', 'wechat', 'comment',
|
||||||
],
|
],
|
||||||
url: '/api/v1/users/users/',
|
url: '/api/v1/users/users/',
|
||||||
fieldsMeta: {
|
fieldsMeta: {
|
||||||
|
Reference in New Issue
Block a user