mirror of
https://github.com/jumpserver/lina.git
synced 2025-09-20 02:31:43 +00:00
[Update] 添加默认更新配置
This commit is contained in:
@@ -5,13 +5,16 @@
|
|||||||
<script>
|
<script>
|
||||||
import ActionsGroup from '@/components/ActionsGroup/index'
|
import ActionsGroup from '@/components/ActionsGroup/index'
|
||||||
import BaseFormatter from './base'
|
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 = `/api/v1/users/groups/${id}/`
|
||||||
return this.$axios.delete(url)
|
return this.$axios.delete(url)
|
||||||
}
|
}
|
||||||
const defaultUpdateCallback = ({row, col, cellValue, reload}) => {
|
const defaultUpdateCallback = function({row, col}) {
|
||||||
|
const id = row.id
|
||||||
|
const routeName = col.actions.updateRoute || '404'
|
||||||
|
this.$router.push({name: routeName, params: {id: id}})
|
||||||
}
|
}
|
||||||
|
|
||||||
const defaultDeleteCallback = function({row, col, cellValue, reload}) {
|
const defaultDeleteCallback = function({row, col, cellValue, reload}) {
|
||||||
|
@@ -37,6 +37,7 @@ const cn = {
|
|||||||
'More actions': '更多操作',
|
'More actions': '更多操作',
|
||||||
'Delete selected': '删除所选',
|
'Delete selected': '删除所选',
|
||||||
'Update selected': '更新所选',
|
'Update selected': '更新所选',
|
||||||
|
'Delete success': '删除成功',
|
||||||
'Search': '搜索',
|
'Search': '搜索',
|
||||||
'Source': '来源',
|
'Source': '来源',
|
||||||
'Status': '状态',
|
'Status': '状态',
|
||||||
|
@@ -87,10 +87,10 @@ export const constantRoutes = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'groups/:id/update',
|
path: 'groups/:id/update',
|
||||||
component: () => import('@/views/users/UserGroupEdit.vue'), // Parent router-view
|
component: () => import('@/views/users/UserGroupUpdate.vue'), // Parent router-view
|
||||||
name: 'UserGroupEdit',
|
name: 'UserGroupUpdate',
|
||||||
hidden: true,
|
hidden: true,
|
||||||
meta: { title: 'UserGroupEdit' }
|
meta: { title: 'UserGroupUpdate' }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'groups/:id',
|
path: 'groups/:id',
|
||||||
|
@@ -11,7 +11,6 @@ export default {
|
|||||||
GenericListPage
|
GenericListPage
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
const data = []
|
|
||||||
return {
|
return {
|
||||||
tableConfig: {
|
tableConfig: {
|
||||||
url: '/api/v1/users/groups/',
|
url: '/api/v1/users/groups/',
|
||||||
@@ -21,7 +20,7 @@ export default {
|
|||||||
label: this.$tc('Name'),
|
label: this.$tc('Name'),
|
||||||
formatter: DetailFormatter,
|
formatter: DetailFormatter,
|
||||||
sortable: true,
|
sortable: true,
|
||||||
route: 'UserDetail'
|
route: 'UserGroupDetail'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'users_amount',
|
prop: 'users_amount',
|
||||||
@@ -38,7 +37,16 @@ export default {
|
|||||||
label: this.$tc('Actions'),
|
label: this.$tc('Actions'),
|
||||||
align: 'center',
|
align: 'center',
|
||||||
formatter: ActionsFormatter,
|
formatter: ActionsFormatter,
|
||||||
width: '200px'
|
width: '200px',
|
||||||
|
actions: {
|
||||||
|
updateRoute: 'UserGroupUpdate',
|
||||||
|
extraActions: [
|
||||||
|
{
|
||||||
|
name: 'run',
|
||||||
|
title: this.$tc('Run')
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
// 写路由名字,table组件会自动传作为参数
|
// 写路由名字,table组件会自动传作为参数
|
||||||
|
Reference in New Issue
Block a user