add authority page

木子李·De 3 years ago
parent ade445ca48
commit 392b64f25f

@ -0,0 +1,42 @@
import request from '@/utils/request'
export function accessAuthorityList(params) {
return request({
url: 'accessAuthority/pageList',
method: 'GET',
params,
})
}
export function accessAuthorityAdd(data) {
return request({
url: 'accessAuthority',
method: 'post',
data
})
}
export function accessAuthorityDeleteBatch(data) {
return request({
url: 'accessAuthority/delete/batch',
method: 'post',
data
})
}
export function accessAuthorityUpdate(data) {
return request({
url: 'accessAuthority',
method: 'put', data,
})
}
export function accessAuthorityDetail(data) {
return request({
url: 'accessAuthority/' + data.id,
method: 'get',
params: { accessKey: data.accessKey }
})
}
export default { accessAuthorityList, accessAuthorityAdd, accessAuthorityDeleteBatch, accessAuthorityUpdate, accessAuthorityDetail }

@ -0,0 +1,247 @@
<template>
<anji-crud ref="listPage"
:option="crudOption">
<template v-slot:buttonLeftOnTable>
</template>
<!--
<template slot="rowButton" slot-scope="props">
<el-button type="primary" @click="customButtom(props)"></el-button>
</template>
-->
<!--自定义的卡片插槽将在编辑详情页面出现在底部新卡片-->
<!--这里可以将自定义的弹出框代码放入到page中
<template v-slot:pageSection>
<div>插入底部html片段</div>
</template>
-->
</anji-crud>
</template>
<script>
import { accessAuthorityList, accessAuthorityAdd, accessAuthorityDeleteBatch, accessAuthorityUpdate, accessAuthorityDetail } from '@/api/accessAuthority'
export default {
name: 'AccessAuthority',
data () {
return {
crudOption: {
// 使
title: '权限管理',
//
labelWidth: '120px',
//
queryFormFields: [
{
inputType: 'anji-tree', // 20%
anjiTreeOption: {
url: '/accessAuthority/menuTree', // idtreeidlabeltreelabel
enableFilter: true, // tree input
isOpen: true, // true tree false
},
label: '所属菜单',
field: 'target',
},
{
inputType: 'anji-select', //form input|input-number|anji-select(urldictCode)|anji-tree()|date|datetime|datetimerange
anjiSelectOption: {
dictCode: 'ENABLE_FLAG',
},
label: '启用状态',
field: 'enableFlag'
},
{
inputType: 'input',
label: '菜单代码',
field: 'target',
},
{
inputType: 'input',
label: '菜单名称',
field: 'targetName',
},
{
inputType: 'input',
label: '按钮代码',
field: 'action',
},
{
inputType: 'input',
label: '按钮名称',
field: 'actionName',
},
],
//
buttons: {
query: {
api: accessAuthorityList,
permission: 'AccessAuthority:PAGE'
},
queryByPrimarykey: {
api: accessAuthorityDetail,
permission: 'AccessAuthority:detail'
},
add: {
api: accessAuthorityAdd,
permission: 'AccessAuthority:insert'
},
delete: {
api: accessAuthorityDeleteBatch,
permission: 'AccessAuthority:delete'
},
edit: {
api: accessAuthorityUpdate,
permission: 'AccessAuthority:update'
},
},
//
columns: [
{
label: '',
field: 'id',
primaryKey: true, // ,
tableHide: true, //
editHide: true, //
},
{
label: '菜单代码',//
placeholder: '',
field: 'target',
editField: 'target',
tableHide: true, //
inputType: 'input',
rules: [
{ required: true, message: '目标菜单必填', trigger: 'blur' },
{ min: 1, max: 64, message: '不超过64个字符', trigger: 'blur' }
],
disabled: false,
},
{
label: '菜单名称',//
placeholder: '',
field: 'targetName',
sortable: true,
fieldTableRowRenderer: (row) => {
return `${row['targetName']}[${row['target']}]`
},
editField: 'targetName',
inputType: 'input',
rules: [
{ required: true, message: '目标菜单名称必填', trigger: 'blur' },
{ min: 1, max: 128, message: '不超过128个字符', trigger: 'blur' }
],
disabled: false,
},
{
label: '按钮代码',//
placeholder: '',
field: 'action',
tableHide: true, //
editField: 'action',
inputType: 'input',
rules: [
{ required: true, message: '目标必填', trigger: 'blur' },
{ min: 1, max: 64, message: '不超过64个字符', trigger: 'blur' }
],
disabled: false,
},
{
label: '按钮名称',//
placeholder: '',
field: 'actionName',
fieldTableRowRenderer: (row) => {
return `${row['actionName']}[${row['action']}]`
},
sortable: true,
editField: 'actionName',
inputType: 'input',
rules: [
{ required: true, message: '目标按钮名称必填', trigger: 'blur' },
{ min: 1, max: 128, message: '不超过128个字符', trigger: 'blur' }
],
disabled: false,
},
{
label: '启用状态',//0-- 1-- DIC_NAME=ENABLE_FLAG
placeholder: '',
field: 'enableFlag',
fieldTableRowRenderer: (row) => {
return this.getDictLabelByCode('ENABLE_FLAG', row['enableFlag'])
},
editField: 'enableFlag',
inputType: 'anji-select',
anjiSelectOption: {
dictCode: 'ENABLE_FLAG', //
},
colorStyle: {
0: 'table-danger', //keyeditField'': 'danger','': 'primary','绿': 'success','': 'warning','': 'info',''''
1: 'table-success'
},
rules: [
{ required: true, message: '启用状态必填', trigger: 'blur' },
],
disabled: false,
},
{
label: '排序',//
placeholder: '',
field: 'sort',
editField: 'sort',
inputType: 'input',
rules: [
],
disabled: false,
},
{
label: '创建人',
placeholder: '',
field: 'createBy',
columnType: 'expand',
editField: 'createBy',
inputType: 'input',
editHide: 'hideOnAdd', // true/false/'hideOnAdd hideOnView hideOnEdit'
disabled: true,
},
{
label: '创建时间',
placeholder: '',
field: 'createTime',
columnType: 'expand',
editField: 'createTime',
inputType: 'input',
editHide: 'hideOnAdd', // true/false/'hideOnAdd hideOnView hideOnEdit'
disabled: true,
},
{
label: '修改人',
placeholder: '',
field: 'updateBy',
columnType: 'expand',
editField: 'updateBy',
inputType: 'input',
editHide: 'hideOnAdd', // true/false/'hideOnAdd hideOnView hideOnEdit'
disabled: true,
},
{
label: '修改时间',
placeholder: '',
field: 'updateTime',
columnType: 'expand',
editField: 'updateTime',
inputType: 'input',
editHide: 'hideOnAdd', // true/false/'hideOnAdd hideOnView hideOnEdit'
disabled: true,
},
],
},
}
},
created () { },
methods: {
}
}
</script>
Loading…
Cancel
Save