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