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