[更新] 完成权限管理页面

This commit is contained in:
kdyq007 2019-11-24 15:22:18 +08:00
parent d19834ed5d
commit 7fa5cff919
5 changed files with 14 additions and 18 deletions

View File

@ -63,10 +63,3 @@ export function deleteResourceTypeById (id) {
method: 'DELETE'
})
}
export function getResourcePermissions (id) {
return axios({
url: urlPrefix + `/resources/${id}/permissions`,
method: 'DELETE'
})
}

View File

@ -112,7 +112,7 @@ export default {
title: '类型名',
dataIndex: 'name',
sorter: false,
width: 300,
width: 150,
scopedSlots: {
customRender: 'nameSearchRender',
filterDropdown: 'filterDropdown',

View File

@ -59,7 +59,8 @@
<template>
<a @click="handleEdit(record)">编辑</a>
<a-divider type="vertical"/>
<a @click="handlePerm(record)">权限</a>
<a-divider type="vertical"/>
<a-popconfirm
title="确认删除?"
@confirm="handleDelete(record)"
@ -74,6 +75,7 @@
</s-table>
<resourceForm ref="resourceForm" :handleOk="handleOk"> </resourceForm>
<resourcePermForm ref="resourcePermForm"> </resourcePermForm>
</a-card>
</template>
@ -81,20 +83,18 @@
<script>
import { STable } from '@/components'
import resourceForm from './module/resourceForm'
import resourcePermForm from './module/resourcePermForm'
import { deleteResourceById, searchResource } from '@/api/acl/resource'
export default {
name: 'Index',
components: {
STable,
resourceForm
resourceForm,
resourcePermForm
},
data () {
return {
appList: [{
id: '1',
name: '默认应用'
}],
scroll: { x: 1000, y: 500 },
btnName: '新增资源',
@ -112,7 +112,7 @@ export default {
title: '资源名',
dataIndex: 'name',
sorter: false,
width: 50,
width: 300,
scopedSlots: {
customRender: 'nameSearchRender',
filterDropdown: 'filterDropdown',
@ -130,7 +130,6 @@ export default {
{
title: '资源类型',
dataIndex: 'resource_type_id',
width: 50,
sorter: false,
scopedSlots: { customRender: 'resource_type_id' }
@ -239,6 +238,10 @@ export default {
handleEdit (record) {
this.$refs.resourceForm.handleEdit(record)
},
handlePerm (record) {
this.$refs.resourcePermForm.handlePerm(record)
},
handleDelete (record) {
this.deleteResource(record.id)
},

View File

@ -152,7 +152,7 @@ export default {
{
title: '操作',
dataIndex: 'action',
width: 300,
width: 150,
fixed: 'right',
scopedSlots: { customRender: 'action' }
}

View File

@ -207,7 +207,7 @@ export default {
{
title: '操作',
dataIndex: 'action',
width: 100,
width: 150,
fixed: 'right',
scopedSlots: { customRender: 'action' }
}