|
@@ -2,20 +2,21 @@
|
|
|
<div class="sys-org">
|
|
|
<!-- <cy-org-list></cy-org-list> -->
|
|
|
<div class="sys-org-left">
|
|
|
- <el-input placeholder="搜索部门/成员" v-model="searchName" style="margin-bottom: 15px;" @input="searchList" clearable></el-input>
|
|
|
+ <el-input v-model="searchName" placeholder="搜索部门/成员" style="margin-bottom: 15px;" clearable @input="searchList"></el-input>
|
|
|
<div v-show="!searchName">
|
|
|
<el-radio-group v-model="type" style="margin-bottom: 15px;" class="sys-org-radio">
|
|
|
<el-radio-button label="组织机构"></el-radio-button>
|
|
|
<el-radio-button label="角色"></el-radio-button>
|
|
|
</el-radio-group>
|
|
|
<el-tree
|
|
|
+ v-show="type == '组织机构'"
|
|
|
:data="orgList"
|
|
|
node-key="id"
|
|
|
:props="orgListProp"
|
|
|
default-expand-all
|
|
|
+ :expand-on-click-node="false"
|
|
|
@node-click="orgDetail"
|
|
|
- v-show="type == '组织机构'"
|
|
|
- :expand-on-click-node="false">
|
|
|
+ >
|
|
|
<div slot-scope="{ node, data }">
|
|
|
<i class="el-icon-folder" style="margin-right: 5px;"></i>
|
|
|
<span :style="{color: orgInfo.id == node.data.id ? '#54c3fe' : ''}">{{ node.data.name }}</span>
|
|
@@ -23,21 +24,22 @@
|
|
|
</el-tree>
|
|
|
<div v-show="type == '角色'">
|
|
|
<div style="width: 100%; display: flex; justify-content: center; margin-bottom: 20px;">
|
|
|
- <el-button type="normal" v-power="'addRoleGroup'" @click="isUpdateGroup = false, updateId = '', groupForm.name = '', $refs.addRoleGroup.show = true">新增角色组</el-button>
|
|
|
- <el-button type="normal" v-power="'addRole'" @click="$refs.addRole.openDialog()">新增角色</el-button>
|
|
|
+ <el-button v-power="'addRoleGroup'" type="normal" @click="isUpdateGroup = false, updateId = '', groupForm.name = '', $refs.addRoleGroup.show = true">新增角色组</el-button>
|
|
|
+ <el-button v-power="'addRole'" type="normal" @click="$refs.addRole.openDialog()">新增角色</el-button>
|
|
|
</div>
|
|
|
<el-tree
|
|
|
+ v-show="type == '角色'"
|
|
|
:data="roleList"
|
|
|
node-key="id"
|
|
|
default-expand-all
|
|
|
:props="roleListProp"
|
|
|
- v-show="type == '角色'"
|
|
|
- :expand-on-click-node="true">
|
|
|
- <div slot-scope="{ node, data }" @mouseover="showEditIcon(data, true)" @mouseleave="showEditIcon(data, false)" :class="data.id == showIconId ? 'hover-class' : ''">
|
|
|
+ :expand-on-click-node="true"
|
|
|
+ >
|
|
|
+ <div slot-scope="{ node, data }" :class="data.id == showIconId ? 'hover-class' : ''" @mouseover="showEditIcon(data, true)" @mouseleave="showEditIcon(data, false)">
|
|
|
<i v-if="node.isLeaf" class="el-icon-s-custom" style="margin-right: 5px;"></i>
|
|
|
<i v-if="!node.isLeaf" class="el-icon-folder" style="margin-right: 5px;"></i>
|
|
|
- <span @click="roleDetail(data)" :style="{color: roleInfo.id == data.id ? '#54c3fe' : ''}">{{ data.name }}</span>
|
|
|
- <i class="el-icon-edit-outline" v-show="data.id == showIconId" style="margin-left: 5px;" @click.stop="isUpdateGroup = true, updateId = data.id, groupForm.name = data.name, $refs.addRoleGroup.show = true"></i>
|
|
|
+ <span :style="{color: roleInfo.id == data.id ? '#54c3fe' : ''}" @click="roleDetail(data)">{{ data.name }}</span>
|
|
|
+ <i v-show="data.id == showIconId" class="el-icon-edit-outline" style="margin-left: 5px;" @click.stop="isUpdateGroup = true, updateId = data.id, groupForm.name = data.name, $refs.addRoleGroup.show = true"></i>
|
|
|
</div>
|
|
|
</el-tree>
|
|
|
</div>
|
|
@@ -51,12 +53,12 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="sys-org-right">
|
|
|
- <org-info v-if="type == '组织机构' && !isPerson" :info="orgInfo" :orgList="orgList" @toOrg="orgDetail" @addOrg="getOrgList" @addPerson="addPersonInfo"></org-info>
|
|
|
- <person-info v-if="type == '组织机构' && isPerson == 1" :info="orgInfo" :personInfo="personDetailInfo" :orgList="orgList" @close="closePerson"></person-info>
|
|
|
+ <org-info v-if="type == '组织机构' && !isPerson" :info="orgInfo" :org-list="orgList" @toOrg="orgDetail" @addOrg="getOrgList" @addPerson="addPersonInfo"></org-info>
|
|
|
+ <person-info v-if="type == '组织机构' && isPerson == 1" :info="orgInfo" :person-info="personDetailInfo" :org-list="orgList" @close="closePerson"></person-info>
|
|
|
<role-info v-if="type == '角色'" :info="roleInfo" @close="getRoleList"></role-info>
|
|
|
- <person-detail v-if="type == '组织机构' && isPerson == 2" :personInfo="personDetailInfo"></person-detail>
|
|
|
+ <person-detail v-if="type == '组织机构' && isPerson == 2" :person-info="personDetailInfo"></person-detail>
|
|
|
</div>
|
|
|
-
|
|
|
+
|
|
|
<cy-dialog ref="addRoleGroup" :title="isUpdateGroup ? '编辑角色组' : '新增角色组'" @close="$refs.groupForm.resetFields(), isUpdateGroup = false, updateId = ''">
|
|
|
<el-form ref="groupForm" :model="groupForm" :rules="groupRules" label-width="120px" label-position="left">
|
|
|
<el-form-item label="角色组名称:" prop="name" style="width: 100%;">
|
|
@@ -65,7 +67,7 @@
|
|
|
</el-form>
|
|
|
<template slot="footer">
|
|
|
<el-button type="primary" @click="confirm('groupForm')">保存</el-button>
|
|
|
- <el-button type="normal" @click="deleteGroup" v-if="isUpdateGroup">删除</el-button>
|
|
|
+ <el-button v-if="isUpdateGroup" type="normal" @click="deleteGroup">删除</el-button>
|
|
|
<el-button type="normal" @click="$refs.groupForm.resetFields(), isUpdateGroup = false, updateId = '', $refs.addRoleGroup.show = false">取消</el-button>
|
|
|
</template>
|
|
|
</cy-dialog>
|
|
@@ -83,6 +85,9 @@ import request from '@/utils/request'
|
|
|
|
|
|
export default {
|
|
|
name: 'LogManage',
|
|
|
+ components: {
|
|
|
+ orgInfo, roleInfo, personInfo, editRole, personDetail
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
type: '组织机构',
|
|
@@ -117,9 +122,6 @@ export default {
|
|
|
personDetailInfo: {}
|
|
|
}
|
|
|
},
|
|
|
- components: {
|
|
|
- orgInfo, roleInfo, personInfo, editRole, personDetail
|
|
|
- },
|
|
|
mounted() {
|
|
|
this.getOrgList()
|
|
|
this.getRoleList()
|
|
@@ -131,7 +133,7 @@ export default {
|
|
|
method: 'get'
|
|
|
}).then(({ data }) => {
|
|
|
this.orgList = data || []
|
|
|
- if(data && data.length > 0) {
|
|
|
+ if (data && data.length > 0) {
|
|
|
this.orgInfo = val || data[0]
|
|
|
}
|
|
|
})
|
|
@@ -146,7 +148,7 @@ export default {
|
|
|
}
|
|
|
}).then(({ rows }) => {
|
|
|
this.roleList = rows || []
|
|
|
- if(rows && rows.length > 0) {
|
|
|
+ if (rows && rows.length > 0) {
|
|
|
this.roleInfo = val || rows[0].childList[0]
|
|
|
}
|
|
|
})
|
|
@@ -157,12 +159,12 @@ export default {
|
|
|
},
|
|
|
closePerson(val) {
|
|
|
this.getOrgList(this.orgInfo)
|
|
|
- if(val == 1) {
|
|
|
+ if (val == 1) {
|
|
|
this.isPerson = 0
|
|
|
}
|
|
|
},
|
|
|
roleDetail(val) {
|
|
|
- if(!val.childList) {
|
|
|
+ if (!val.childList) {
|
|
|
this.roleInfo = val
|
|
|
}
|
|
|
},
|
|
@@ -178,9 +180,9 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
submitGroup() {
|
|
|
- let data = new FormData()
|
|
|
+ const data = new FormData()
|
|
|
data.append('name', this.groupForm.name)
|
|
|
- if(this.isUpdateGroup) {
|
|
|
+ if (this.isUpdateGroup) {
|
|
|
data.append('id', this.updateId)
|
|
|
}
|
|
|
request({
|
|
@@ -196,7 +198,7 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
deleteGroup() {
|
|
|
- let data = new FormData()
|
|
|
+ const data = new FormData()
|
|
|
data.append('id', this.updateId)
|
|
|
request({
|
|
|
url: '/role/do_delete',
|
|
@@ -212,7 +214,7 @@ export default {
|
|
|
},
|
|
|
confirm(key) {
|
|
|
this.$refs[key].validate(flag => {
|
|
|
- if(flag) {
|
|
|
+ if (flag) {
|
|
|
this.submitGroup()
|
|
|
} else {
|
|
|
this.$message.error('必填项不能为空')
|
|
@@ -228,12 +230,12 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
showEditIcon(info, flag) {
|
|
|
- if(info.childList && info.name !== '默认') {
|
|
|
+ if (info.childList && info.name !== '默认') {
|
|
|
this.showIconId = flag ? info.id : ''
|
|
|
}
|
|
|
},
|
|
|
addPersonInfo(val) {
|
|
|
- if(val) {
|
|
|
+ if (val) {
|
|
|
this.personDetailInfo = { ...val }
|
|
|
} else {
|
|
|
this.personDetailInfo = {}
|
|
@@ -242,7 +244,7 @@ export default {
|
|
|
},
|
|
|
openSearchResult(info) {
|
|
|
this.type = '组织机构'
|
|
|
- if(info.type) {
|
|
|
+ if (info.type) {
|
|
|
this.personDetailInfo = { ...info }
|
|
|
// this.getPersonDetail(info.id)
|
|
|
this.isPerson = 1
|
|
@@ -296,7 +298,7 @@ export default {
|
|
|
.el-tree {
|
|
|
background-color: transparent;
|
|
|
}
|
|
|
- .sys-org-radio {
|
|
|
+ .sys-org-radio {
|
|
|
width: 100%;
|
|
|
.el-radio-button {
|
|
|
width: 50%;
|
|
@@ -325,4 +327,4 @@ export default {
|
|
|
flex-grow: 1;
|
|
|
}
|
|
|
}
|
|
|
-</style>
|
|
|
+</style>
|