mirror of https://github.com/veops/cmdb.git
[更新] 完成权限管理页面
This commit is contained in:
parent
d19834ed5d
commit
7fa5cff919
|
@ -63,10 +63,3 @@ export function deleteResourceTypeById (id) {
|
||||||
method: 'DELETE'
|
method: 'DELETE'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getResourcePermissions (id) {
|
|
||||||
return axios({
|
|
||||||
url: urlPrefix + `/resources/${id}/permissions`,
|
|
||||||
method: 'DELETE'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
|
@ -112,7 +112,7 @@ export default {
|
||||||
title: '类型名',
|
title: '类型名',
|
||||||
dataIndex: 'name',
|
dataIndex: 'name',
|
||||||
sorter: false,
|
sorter: false,
|
||||||
width: 300,
|
width: 150,
|
||||||
scopedSlots: {
|
scopedSlots: {
|
||||||
customRender: 'nameSearchRender',
|
customRender: 'nameSearchRender',
|
||||||
filterDropdown: 'filterDropdown',
|
filterDropdown: 'filterDropdown',
|
||||||
|
|
|
@ -59,7 +59,8 @@
|
||||||
<template>
|
<template>
|
||||||
<a @click="handleEdit(record)">编辑</a>
|
<a @click="handleEdit(record)">编辑</a>
|
||||||
<a-divider type="vertical"/>
|
<a-divider type="vertical"/>
|
||||||
|
<a @click="handlePerm(record)">权限</a>
|
||||||
|
<a-divider type="vertical"/>
|
||||||
<a-popconfirm
|
<a-popconfirm
|
||||||
title="确认删除?"
|
title="确认删除?"
|
||||||
@confirm="handleDelete(record)"
|
@confirm="handleDelete(record)"
|
||||||
|
@ -74,6 +75,7 @@
|
||||||
|
|
||||||
</s-table>
|
</s-table>
|
||||||
<resourceForm ref="resourceForm" :handleOk="handleOk"> </resourceForm>
|
<resourceForm ref="resourceForm" :handleOk="handleOk"> </resourceForm>
|
||||||
|
<resourcePermForm ref="resourcePermForm"> </resourcePermForm>
|
||||||
|
|
||||||
</a-card>
|
</a-card>
|
||||||
</template>
|
</template>
|
||||||
|
@ -81,20 +83,18 @@
|
||||||
<script>
|
<script>
|
||||||
import { STable } from '@/components'
|
import { STable } from '@/components'
|
||||||
import resourceForm from './module/resourceForm'
|
import resourceForm from './module/resourceForm'
|
||||||
|
import resourcePermForm from './module/resourcePermForm'
|
||||||
import { deleteResourceById, searchResource } from '@/api/acl/resource'
|
import { deleteResourceById, searchResource } from '@/api/acl/resource'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Index',
|
name: 'Index',
|
||||||
components: {
|
components: {
|
||||||
STable,
|
STable,
|
||||||
resourceForm
|
resourceForm,
|
||||||
|
resourcePermForm
|
||||||
},
|
},
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
appList: [{
|
|
||||||
id: '1',
|
|
||||||
name: '默认应用'
|
|
||||||
}],
|
|
||||||
scroll: { x: 1000, y: 500 },
|
scroll: { x: 1000, y: 500 },
|
||||||
btnName: '新增资源',
|
btnName: '新增资源',
|
||||||
|
|
||||||
|
@ -112,7 +112,7 @@ export default {
|
||||||
title: '资源名',
|
title: '资源名',
|
||||||
dataIndex: 'name',
|
dataIndex: 'name',
|
||||||
sorter: false,
|
sorter: false,
|
||||||
width: 50,
|
width: 300,
|
||||||
scopedSlots: {
|
scopedSlots: {
|
||||||
customRender: 'nameSearchRender',
|
customRender: 'nameSearchRender',
|
||||||
filterDropdown: 'filterDropdown',
|
filterDropdown: 'filterDropdown',
|
||||||
|
@ -130,7 +130,6 @@ export default {
|
||||||
{
|
{
|
||||||
title: '资源类型',
|
title: '资源类型',
|
||||||
dataIndex: 'resource_type_id',
|
dataIndex: 'resource_type_id',
|
||||||
width: 50,
|
|
||||||
sorter: false,
|
sorter: false,
|
||||||
scopedSlots: { customRender: 'resource_type_id' }
|
scopedSlots: { customRender: 'resource_type_id' }
|
||||||
|
|
||||||
|
@ -239,6 +238,10 @@ export default {
|
||||||
handleEdit (record) {
|
handleEdit (record) {
|
||||||
this.$refs.resourceForm.handleEdit(record)
|
this.$refs.resourceForm.handleEdit(record)
|
||||||
},
|
},
|
||||||
|
|
||||||
|
handlePerm (record) {
|
||||||
|
this.$refs.resourcePermForm.handlePerm(record)
|
||||||
|
},
|
||||||
handleDelete (record) {
|
handleDelete (record) {
|
||||||
this.deleteResource(record.id)
|
this.deleteResource(record.id)
|
||||||
},
|
},
|
||||||
|
|
|
@ -152,7 +152,7 @@ export default {
|
||||||
{
|
{
|
||||||
title: '操作',
|
title: '操作',
|
||||||
dataIndex: 'action',
|
dataIndex: 'action',
|
||||||
width: 300,
|
width: 150,
|
||||||
fixed: 'right',
|
fixed: 'right',
|
||||||
scopedSlots: { customRender: 'action' }
|
scopedSlots: { customRender: 'action' }
|
||||||
}
|
}
|
||||||
|
|
|
@ -207,7 +207,7 @@ export default {
|
||||||
{
|
{
|
||||||
title: '操作',
|
title: '操作',
|
||||||
dataIndex: 'action',
|
dataIndex: 'action',
|
||||||
width: 100,
|
width: 150,
|
||||||
fixed: 'right',
|
fixed: 'right',
|
||||||
scopedSlots: { customRender: 'action' }
|
scopedSlots: { customRender: 'action' }
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue