commit
This commit is contained in:
@@ -299,10 +299,10 @@ export default {
|
|||||||
// path: '/convertDocView',
|
// path: '/convertDocView',
|
||||||
// menuId: '3F52K25546'
|
// menuId: '3F52K25546'
|
||||||
// },
|
// },
|
||||||
// // {
|
{
|
||||||
// // title: '菜单管理',
|
title: '菜单管理',
|
||||||
// // path: '/menuManage'
|
path: '/menuManage'
|
||||||
// // },
|
},
|
||||||
// // {
|
// // {
|
||||||
// // title: '保密管理',
|
// // title: '保密管理',
|
||||||
// // path: '/convertDocView'
|
// // path: '/convertDocView'
|
||||||
|
|||||||
@@ -188,7 +188,6 @@ export default {
|
|||||||
computed: {},
|
computed: {},
|
||||||
watch: {
|
watch: {
|
||||||
filterText(val) {
|
filterText(val) {
|
||||||
console.log(val);
|
|
||||||
this.$refs.tree.filter(val);
|
this.$refs.tree.filter(val);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -2,89 +2,67 @@
|
|||||||
<template>
|
<template>
|
||||||
<div id="permission-menu-manage">
|
<div id="permission-menu-manage">
|
||||||
<div class="permission-menu-manage-left">
|
<div class="permission-menu-manage-left">
|
||||||
<laws-tree
|
<el-tree
|
||||||
ref="permissionManage"
|
class="filter-tree"
|
||||||
treeDivId="permissionManage"
|
:data="treeData"
|
||||||
:zNodes="zNodes"
|
:props="defaultProps"
|
||||||
autoSelect
|
default-expand-all
|
||||||
deptSelect
|
ref="tree"
|
||||||
showRMenu
|
@node-contextmenu="rightHandleNodeClick"
|
||||||
@treeClick="(treeId, treeNode) => handleClick(treeId, treeNode)"
|
@node-click="handleNodeClick">
|
||||||
@treeAdd="(treeId, treeNode) => handleAdd(treeId, treeNode)"
|
</el-tree>
|
||||||
@treeEdit="(treeId, treeNode) => handleEdit(treeId, treeNode)"
|
|
||||||
@treeRightClick="(treeId, treeNode) => treeRightClick(treeId, treeNode)"
|
|
||||||
@treeRemove="(treeId, treeNode) => handleRemove(treeId, treeNode)"
|
|
||||||
></laws-tree>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="permission-menu-manage-right" v-if="showSarMenuInfoFlag">
|
<div class="permission-menu-manage-right" v-if="showSarMenuInfoFlag">
|
||||||
<div class="permission-content">
|
<el-row>
|
||||||
<el-form ref="sarMenuForm" :model="sarMenuEO" :rules="sarMenuRules" class="label-input-form">
|
<el-col :span="12">
|
||||||
<el-row>
|
<el-button type="primary"
|
||||||
<el-col :span="6">
|
class="common-button-primary add-button"
|
||||||
<span style="color: #fff">1</span>
|
@click="Add"
|
||||||
</el-col>
|
size="mini">新增</el-button>
|
||||||
<el-col :span="18">
|
</el-col>
|
||||||
<el-form-item label="ID" prop="id" label-width="130px" class="standards-info-item">
|
</el-row>
|
||||||
<el-input v-model="sarMenuEO.id" :disabled="formdisableflag" class="permission-input"></el-input>
|
<el-row>
|
||||||
</el-form-item>
|
<el-col :span="12">
|
||||||
</el-col>
|
<el-form
|
||||||
</el-row>
|
ref="sarStandardsInfoForm"
|
||||||
<el-row>
|
:model="form"
|
||||||
<el-col :span="6">
|
label-width="100px"
|
||||||
<span style="color: #fff">1</span>
|
class="label-input-form"
|
||||||
</el-col>
|
>
|
||||||
<el-col :span="18">
|
<el-form-item label="Id" class="search-item">
|
||||||
<el-form-item label="名称" prop="name" label-width="130px" class="standards-info-item">
|
<el-input v-model="form.id" clearable disabled/>
|
||||||
<el-input v-model="sarMenuEO.name" class="permission-input"></el-input>
|
</el-form-item>
|
||||||
</el-form-item>
|
<el-form-item label="名称" class="search-item">
|
||||||
</el-col>
|
<el-input v-model="form.menuName" clearable disabled/>
|
||||||
</el-row>
|
</el-form-item>
|
||||||
<Row>
|
<el-form-item label="父节点Id" class="search-item">
|
||||||
<el-col :span="6">
|
<el-input v-model="form.parentId" clearable disabled/>
|
||||||
<span style="color: #fff">1</span>
|
</el-form-item>
|
||||||
</el-col>
|
</el-form>
|
||||||
<el-col :span="18">
|
</el-col>
|
||||||
<el-form-item label="父节点ID" prop="pId" label-width="130px" class="standards-info-item">
|
</el-row>
|
||||||
<el-input v-model="sarMenuEO.pId" :disabled="formdisableflag" class="permission-input"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</Row>
|
|
||||||
<Row>
|
|
||||||
<el-col :span="6">
|
|
||||||
<span style="color: #fff">1</span>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="18">
|
|
||||||
<el-form-item label="前台页面地址" prop="href" label-width="130px" class="standards-info-item">
|
|
||||||
<el-input v-model="sarMenuEO.href" class="permission-input"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</Row>
|
|
||||||
<Row>
|
|
||||||
<el-col :span="6">
|
|
||||||
<span style="color: #fff">1</span>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="18">
|
|
||||||
<el-form-item label="排序号" prop="isShow" label-width="130px" class="standards-info-item">
|
|
||||||
<el-input v-model="sarMenuEO.isShow" maxlength="2" class="permission-input"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</Row>
|
|
||||||
<Row>
|
|
||||||
<el-col :span="6">
|
|
||||||
<span style="color: #fff">1</span>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="18">
|
|
||||||
<el-form-item label="后台接口权限" prop="permission" label-width="130px" class="standards-info-item">
|
|
||||||
<el-input v-model="sarMenuEO.permission" class="permission-input"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</Row>
|
|
||||||
</el-form>
|
|
||||||
</div>
|
|
||||||
<div class="permission-btn" v-if="submitBtnFlag">
|
|
||||||
<el-button type="primary" :loading="isSubmit" @click="saveMenuInfo">提交</el-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
<el-dialog
|
||||||
|
title="新增"
|
||||||
|
:visible.sync="modalshowflag"
|
||||||
|
:wrapperClosable="false"
|
||||||
|
:before-close="closeDialog"
|
||||||
|
size="800px">
|
||||||
|
<el-form
|
||||||
|
ref="sarStandardsInfoForm"
|
||||||
|
:model="NewForm"
|
||||||
|
label-width="100px"
|
||||||
|
class="label-input-form"
|
||||||
|
>
|
||||||
|
<el-form-item label="名称" class="search-item">
|
||||||
|
<el-input v-model="NewForm.menuName" clearable/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer">
|
||||||
|
<el-button class="common-button-default" size="mini" icon="el-icon-close" @click="closeDialog">取消</el-button>
|
||||||
|
<el-button class="common-button-primary" size="mini" icon="el-icon-check" type="primary" @click="confirmDialog">提交</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -96,212 +74,59 @@ export default {
|
|||||||
name: 'permission-menu-manage',
|
name: 'permission-menu-manage',
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
formdisableflag: true,
|
modalshowflag: false,
|
||||||
zNodes: [],
|
showSarMenuInfoFlag: false,
|
||||||
sarMenuEO: {
|
treeData: [],
|
||||||
|
defaultProps: {
|
||||||
|
children: 'children',
|
||||||
|
label: 'menuName'
|
||||||
|
},
|
||||||
|
form: {
|
||||||
id: '',
|
id: '',
|
||||||
name: '',
|
menuName: '',
|
||||||
pId: '',
|
|
||||||
href: '',
|
|
||||||
isShow: '',
|
|
||||||
permission: '',
|
|
||||||
parentId: ''
|
parentId: ''
|
||||||
},
|
},
|
||||||
sarMenuRules: {
|
NewForm: {
|
||||||
name: [
|
menuName: '',
|
||||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
}
|
||||||
]
|
|
||||||
// isShow: [
|
|
||||||
// { type: 'string', required: true, message: '不能为空', trigger: 'blur' }
|
|
||||||
// ]
|
|
||||||
},
|
|
||||||
isSubmit: false,
|
|
||||||
showSarMenuInfoFlag: false,
|
|
||||||
submitBtnFlag: false,
|
|
||||||
saveClickNodeInfo: '',
|
|
||||||
clickType: '' // 1为新增,2为修改
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getTree () {
|
confirmDialog () {
|
||||||
return new Promise((resolve, reject) => {
|
var form = {}
|
||||||
this.$http.get('sys/menu/listAllMenu', {}, {
|
form.parentId = this.form.id
|
||||||
_this: this
|
form.menuName = this.NewForm.menuName
|
||||||
}, res => {
|
this.$http.postData('lawss/sarMenu/add', form, {}, res=> {
|
||||||
if (res.ok) {
|
if (res.ok) {
|
||||||
let zNodes = []
|
this.getTree()
|
||||||
for (let i = 0; i < res.data.length; i++) {
|
this.modalshowflag = false
|
||||||
let zObj = {}
|
this.$message.success('成功')
|
||||||
zObj.id = res.data[i].id
|
|
||||||
zObj.pId = res.data[i].parentId
|
|
||||||
zObj.name = res.data[i].name
|
|
||||||
zObj.href = res.data[i].href
|
|
||||||
zObj.isShow = res.data[i].isShow
|
|
||||||
zObj.permission = res.data[i].permission
|
|
||||||
zObj.remarks = res.data[i].remarks
|
|
||||||
zNodes[i] = zObj
|
|
||||||
if (res.data[i].parentIds !== null) {}
|
|
||||||
}
|
|
||||||
this.zNodes = zNodes
|
|
||||||
}
|
|
||||||
resolve()
|
|
||||||
}, e => {
|
|
||||||
reject(e)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* @description: 树节点点击
|
|
||||||
* @author: chenxiaoxi
|
|
||||||
* @date: 2018-09-25 16:13:25
|
|
||||||
*/
|
|
||||||
handleClick (treeId, treeNode) {
|
|
||||||
this.submitBtnFlag = false
|
|
||||||
this.showSarMenuInfoFlag = true
|
|
||||||
this.sarMenuEO = treeNode
|
|
||||||
if (treeNode.href == null || treeNode.href === '' || treeNode.href === 'null') {
|
|
||||||
this.sarMenuEO.href = ''
|
|
||||||
}
|
|
||||||
if (treeNode.permission == null || treeNode.permission === '' || treeNode.permission === 'null') {
|
|
||||||
this.sarMenuEO.permission = ''
|
|
||||||
}
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* @description: 树节点添加
|
|
||||||
* @author: chenxiaoxi
|
|
||||||
* @date: 2018/12/26 15:39:22
|
|
||||||
*/
|
|
||||||
handleAdd (treeId, treeNode) {
|
|
||||||
this.resetForm()
|
|
||||||
this.submitBtnFlag = true
|
|
||||||
this.clickType = '1'
|
|
||||||
this.showSarMenuInfoFlag = true
|
|
||||||
this.sarMenuEO.pId = treeNode.id
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @description: 树节点删除
|
|
||||||
* @author: chenxiaoxi
|
|
||||||
* @date: 2018-09-25 14:05:25
|
|
||||||
*/
|
|
||||||
handleRemove (treeId, treeNode) {
|
|
||||||
if (treeNode.pId == null || treeNode.pId === '') {
|
|
||||||
this.$Message.error('不能删除根级节点')
|
|
||||||
} else {
|
|
||||||
this.$http.get('sys/menu/judgeContentChild', {
|
|
||||||
id: treeNode.id
|
|
||||||
}, {
|
|
||||||
_this: this
|
|
||||||
}, res => {
|
|
||||||
if (res.data != null && res.data.length > 0) {
|
|
||||||
this.$message.error('该节点包含子节点,不能删除')
|
|
||||||
} else {
|
|
||||||
this.sureDeleteMenu(treeNode)
|
|
||||||
}
|
|
||||||
}, e => {})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
sureDeleteMenu (treeNode) {
|
|
||||||
this.$confirm('确认删除该条数据?', '提示', {
|
|
||||||
confirmButtonText: '确定',
|
|
||||||
cancelButtonText: '取消',
|
|
||||||
type: 'warning',
|
|
||||||
confirmButtonClass: 'common-button-primary',
|
|
||||||
roundButton: true
|
|
||||||
}).then(() => {
|
|
||||||
if (treeNode.id != null && treeNode.id !== '') {
|
|
||||||
this.$http.put('sys/menu/deleteMenuById', {
|
|
||||||
id: treeNode.id
|
|
||||||
}, {
|
|
||||||
_this: this
|
|
||||||
}, res => {
|
|
||||||
if (res.data != null) {
|
|
||||||
this.getTree()
|
|
||||||
this.showSarMenuInfoFlag = false
|
|
||||||
this.resetForm()
|
|
||||||
}
|
|
||||||
}, e => {
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
this.$message.warning('没有获取到所选节点id')
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
/**
|
Add () {
|
||||||
* @description: 节点编辑
|
this.modalshowflag = true
|
||||||
* @author: chenxiaoxi
|
},
|
||||||
* @date: 2018/12/26 15:29:46
|
closeDialog () {
|
||||||
*/
|
this.modalshowflag = false
|
||||||
handleEdit (treeId, treeNode) {
|
this.NewForm.menuName = ''
|
||||||
this.submitBtnFlag = true
|
},
|
||||||
this.clickType = '2'
|
rightHandleNodeClick (e, data) {},
|
||||||
|
handleNodeClick (data) {
|
||||||
|
this.form.id = data.id
|
||||||
|
this.form.menuName = data.menuName
|
||||||
|
this.form.parentId = data.parentId
|
||||||
this.showSarMenuInfoFlag = true
|
this.showSarMenuInfoFlag = true
|
||||||
this.saveClickNodeInfo = treeNode
|
|
||||||
this.sarMenuEO = treeNode
|
|
||||||
if (treeNode.href == null || treeNode.href === '' || treeNode.href === 'null') {
|
|
||||||
this.sarMenuEO.href = ''
|
|
||||||
}
|
|
||||||
if (treeNode.permission == null || treeNode.permission === '' || treeNode.permission === 'null') {
|
|
||||||
this.sarMenuEO.permission = ''
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
treeRightClick (treeId, treeNode) {
|
getTree () {
|
||||||
},
|
this.$http.get('lawss/sarMenu', {}, {}, res=> {
|
||||||
resetForm () {
|
if (res.ok) {
|
||||||
this.sarMenuEO.id = ''
|
this.treeData = res.data
|
||||||
this.sarMenuEO.pId = ''
|
}
|
||||||
this.sarMenuEO.name = ''
|
})
|
||||||
this.sarMenuEO.href = ''
|
|
||||||
this.sarMenuEO.isShow = ''
|
|
||||||
this.sarMenuEO.permission = ''
|
|
||||||
},
|
|
||||||
saveMenuInfo () {
|
|
||||||
if (this.sarMenuEO.isShow != null && this.sarMenuEO.isShow !== '') {
|
|
||||||
this.isSubmit = true
|
|
||||||
this.$refs['sarMenuForm'].validate((valid) => {
|
|
||||||
if (valid) {
|
|
||||||
this.sarMenuEO.parentId = this.sarMenuEO.pId
|
|
||||||
let menuEO = JSON.parse(JSON.stringify(this.sarMenuEO))
|
|
||||||
if (this.clickType === '1') {
|
|
||||||
this.$http.post('sys/menu/addMenu', menuEO, {
|
|
||||||
_this: this,
|
|
||||||
loading: 'isSubmit'
|
|
||||||
}, res => {
|
|
||||||
if (res.ok) {
|
|
||||||
this.isSubmit = false
|
|
||||||
this.submitBtnFlag = false
|
|
||||||
this.getTree()
|
|
||||||
}
|
|
||||||
}, e => {
|
|
||||||
this.isSubmit = false
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
this.$http.put('sys/menu/updateMenu', this.sarMenuEO, {
|
|
||||||
_this: this,
|
|
||||||
loading: 'isSubmit'
|
|
||||||
}, res => {
|
|
||||||
this.isSubmit = false
|
|
||||||
this.submitBtnFlag = false
|
|
||||||
this.getTree()
|
|
||||||
}, e => {
|
|
||||||
this.isSubmit = false
|
|
||||||
})
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.isSubmit = false
|
|
||||||
this.$message.error('请检查表单是否填写正确!')
|
|
||||||
}
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
this.$message.warning('排序号不能为空!')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
props: {
|
|
||||||
sideClose: {
|
|
||||||
type: Boolean
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
props: {},
|
||||||
computed: {},
|
computed: {},
|
||||||
watch: {},
|
watch: {},
|
||||||
mounted () {
|
mounted () {
|
||||||
@@ -312,177 +137,29 @@ export default {
|
|||||||
|
|
||||||
<style lang="less">
|
<style lang="less">
|
||||||
//@import '~styles/mixins';
|
//@import '~styles/mixins';
|
||||||
#permission-menu-manage{
|
#permission-menu-manage {
|
||||||
display: flex;
|
display: flex;
|
||||||
//.flex();
|
|
||||||
background: #FFF;
|
background: #FFF;
|
||||||
.permission-menu-manage-left{
|
height: 100%;
|
||||||
|
.permission-menu-manage-left {
|
||||||
width: 240px;
|
width: 240px;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
border-right: 1px solid #DDD;
|
border-right: 1px solid #DDD;
|
||||||
position: relative;
|
position: relative;
|
||||||
overflow-x: auto;
|
overflow-x: auto;
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
.node_name{
|
|
||||||
display: inline-block;
|
|
||||||
max-width: 200px;
|
|
||||||
//.ellipsis();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
.permission-menu-manage-right{
|
|
||||||
|
.permission-menu-manage-right {
|
||||||
width: calc(~'100% - 240px');
|
width: calc(~'100% - 240px');
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
position: relative;
|
position: relative;
|
||||||
.content{
|
|
||||||
|
.content {
|
||||||
height: calc(~'100% - 150px');
|
height: calc(~'100% - 150px');
|
||||||
background: #CCC;
|
background: #CCC;
|
||||||
.hasNoData{
|
|
||||||
background: #FFF;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
.no-data-icon{
|
|
||||||
width: 150px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.ivu-table-overflowX{
|
|
||||||
overflow-x: auto;
|
|
||||||
}
|
|
||||||
.pagination{
|
|
||||||
.ivu-divider{
|
|
||||||
margin-bottom: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.syncInfo{
|
|
||||||
padding-bottom: 0.2rem;
|
|
||||||
//.flex();
|
|
||||||
flex: 1;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
.permission-content{
|
|
||||||
padding-top: 30px;
|
|
||||||
.permission-input{
|
|
||||||
width: 300px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.permission-btn{
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.ivu-tree-children{
|
|
||||||
.ivu-tree-arrow{
|
|
||||||
margin-right: 5px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.content .btn-group{
|
|
||||||
margin-bottom: 0.5rem;
|
|
||||||
}
|
|
||||||
.permission-menu-manage-right-search{
|
|
||||||
.ivu-form-item-label{
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
.ivu-form-item-content{
|
|
||||||
width: calc(~'100% - 60px');
|
|
||||||
.ivu-select{
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.ivu-form-item{
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
.ivu-btn{
|
|
||||||
position: relative;
|
|
||||||
top: 1px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.ivu-divider-horizontal{
|
|
||||||
margin: 8px 0;
|
|
||||||
}
|
|
||||||
.ivu-table-body{
|
|
||||||
overflow-x: auto;
|
|
||||||
}
|
|
||||||
.ivu-table-tip{
|
|
||||||
width: 100%;
|
|
||||||
height: calc(~'100% - 41px');
|
|
||||||
table{
|
|
||||||
display: block;
|
|
||||||
tbody,tr,td{
|
|
||||||
display: block;
|
|
||||||
width: 100% !important;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
td{
|
|
||||||
//.flex();
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.hasNoData{
|
|
||||||
background: #FFF;
|
|
||||||
.no-data-icon{
|
|
||||||
width: 85px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.ivu-table-fixed,
|
|
||||||
.ivu-table-fixed-right{
|
|
||||||
height: 100%;
|
|
||||||
.ivu-table-fixed-body{
|
|
||||||
height: calc(~'100% - 41px');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.ivu-select-item{
|
|
||||||
max-width: 200px;
|
|
||||||
//.ellipsis();
|
|
||||||
}
|
|
||||||
.demo-drawer-footer{
|
|
||||||
width: 100%;
|
|
||||||
position: absolute;
|
|
||||||
bottom: 0;
|
|
||||||
left: 0;
|
|
||||||
border-top: 1px solid #e8e8e8;
|
|
||||||
padding: 10px 16px;
|
|
||||||
text-align: right;
|
|
||||||
background: #fff;
|
|
||||||
}
|
|
||||||
.btn-show{
|
|
||||||
display: inline-block !important;
|
|
||||||
}
|
|
||||||
.btn-hide{
|
|
||||||
display: none !important;
|
|
||||||
}
|
|
||||||
.ivu-tag{
|
|
||||||
cursor: default;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.role-setting-form{
|
|
||||||
.ivu-modal-body{
|
|
||||||
overflow-y: inherit;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.demo-drawer-profile{
|
|
||||||
font-size: 14px;
|
|
||||||
}
|
|
||||||
.demo-drawer-profile .ivu-col{
|
|
||||||
margin-bottom: 12px;
|
|
||||||
}
|
|
||||||
.user-info-text{
|
|
||||||
color: #A59D9D;
|
|
||||||
}
|
|
||||||
.mechanism-tree-modal{
|
|
||||||
.ivu-modal{
|
|
||||||
width: 350px !important;
|
|
||||||
.form-content{
|
|
||||||
width: 300px;
|
|
||||||
margin: 0 auto;
|
|
||||||
.ivu-form-item{
|
|
||||||
//.flex();
|
|
||||||
.ivu-form-item-content{
|
|
||||||
flex: 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -88,10 +88,20 @@
|
|||||||
v-if="modalRole"
|
v-if="modalRole"
|
||||||
:props="props"
|
:props="props"
|
||||||
:data="roleList"
|
:data="roleList"
|
||||||
show-checkbox
|
check-strictly
|
||||||
@check="handleCheckChange">
|
show-checkbox>
|
||||||
</el-tree>
|
</el-tree>
|
||||||
<el-button @click="add"></el-button>
|
<div id="roleFormButton" class="demo-drawer-footer">
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
class="common-button-primary"
|
||||||
|
icon="el-icon-check"
|
||||||
|
type="primary"
|
||||||
|
@click="RoleSubmit"
|
||||||
|
:loading="submitLoading"
|
||||||
|
>确定</el-button>
|
||||||
|
<el-button size="mini" class="common-button-default" icon="el-icon-close" @click="resetFormRole">取消</el-button>
|
||||||
|
</div>
|
||||||
</el-drawer>
|
</el-drawer>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -101,6 +111,7 @@
|
|||||||
name: 'PostManage',
|
name: 'PostManage',
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
|
submitLoading: false,
|
||||||
selectList: [],
|
selectList: [],
|
||||||
data: [],
|
data: [],
|
||||||
Loading: false,
|
Loading: false,
|
||||||
@@ -122,14 +133,24 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
add () {
|
RoleSubmit () { // 配置角色提交
|
||||||
console.log(this.$refs.tree.getCheckedKeys().concat(this.$refs.tree.getHalfCheckedKeys()));
|
this.submitLoading = true
|
||||||
|
this.$http.postData('sarPosition/position/role', {
|
||||||
|
positionId: this.selectList[0].id,
|
||||||
|
roleIds: this.$refs.tree.getCheckedKeys().concat(this.$refs.tree.getHalfCheckedKeys())
|
||||||
|
}, {}, res=> {
|
||||||
|
if (res.ok) {
|
||||||
|
this.$message.success('配置成功')
|
||||||
|
this.modalRole = false
|
||||||
|
this.getData()
|
||||||
|
} else {
|
||||||
|
this.$message.warning(res.message)
|
||||||
|
}
|
||||||
|
this.submitLoading = false
|
||||||
|
})
|
||||||
},
|
},
|
||||||
handleCheckChange (checkedNodes, checkedKeys) {
|
resetFormRole () { // 配置角色关闭事件
|
||||||
var list = []
|
this.modalRole = false
|
||||||
for (var a = 0; a < checkedKeys.checkedNodes.length; a++) {
|
|
||||||
list.push(checkedKeys.checkedNodes[a].id)
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
getRole () {
|
getRole () {
|
||||||
this.$http.get('sarRole/role', {}, {}, res=> {
|
this.$http.get('sarRole/role', {}, {}, res=> {
|
||||||
@@ -140,10 +161,12 @@
|
|||||||
this.selectList = val
|
this.selectList = val
|
||||||
},
|
},
|
||||||
addRole () { // 点击配置角色按钮
|
addRole () { // 点击配置角色按钮
|
||||||
if (this.selectList.length > 0) {
|
if (this.selectList.length === 1) {
|
||||||
this.modalRole = true
|
this.modalRole = true
|
||||||
} else {
|
} else if (this.selectList.length === 0) {
|
||||||
this.$message.warning('请选择要配置角色的岗位')
|
this.$message.warning('请选择要配置角色的岗位')
|
||||||
|
} else {
|
||||||
|
this.$message.warning('请选择一条岗位')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
getData () { // 获取岗位数据
|
getData () { // 获取岗位数据
|
||||||
@@ -161,8 +184,6 @@
|
|||||||
this.$refs['sarStandardsInfoForm'].resetFields();
|
this.$refs['sarStandardsInfoForm'].resetFields();
|
||||||
this.modalshowflag = false
|
this.modalshowflag = false
|
||||||
},
|
},
|
||||||
resetFormRole () { // 配置角色关闭事件
|
|
||||||
},
|
|
||||||
submit () { // 新增角色确认
|
submit () { // 新增角色确认
|
||||||
this.$refs['sarStandardsInfoForm'].validate((valid) => {
|
this.$refs['sarStandardsInfoForm'].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
@@ -179,7 +200,7 @@
|
|||||||
this.modalshowflag = false
|
this.modalshowflag = false
|
||||||
this.getData()
|
this.getData()
|
||||||
} else {
|
} else {
|
||||||
this.$message.warning('新增失败')
|
this.$message.warning(res.message)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
@@ -204,5 +225,8 @@
|
|||||||
.content {
|
.content {
|
||||||
height: calc(~'100% - 53px')
|
height: calc(~'100% - 53px')
|
||||||
}
|
}
|
||||||
|
.filter-tree {
|
||||||
|
height: calc(~'100% - 50px')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user