|
@@ -3,45 +3,17 @@
|
|
|
<div class="postmanagementadd_header">
|
|
|
<div class="postmanagementadd_top">
|
|
|
<div class="tltleLeft">{{ pageTitle }}</div>
|
|
|
- <div
|
|
|
- v-is="['group_btn_edit']"
|
|
|
- class="btn"
|
|
|
- style="margin-top: 20px"
|
|
|
- >
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- @click="handleClickSave('editForm')"
|
|
|
- >保存</el-button>
|
|
|
+ <div v-is="['group_btn_edit']" class="btn" style="margin-top: 20px">
|
|
|
+ <el-button type="primary" @click="handleClickSave('editForm')">保存</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="addApp-form-content dialog-public-background">
|
|
|
- <el-form
|
|
|
- ref="editForm"
|
|
|
- :inline="true"
|
|
|
- :rules="rules"
|
|
|
- class="form"
|
|
|
- :model="editForm"
|
|
|
- >
|
|
|
- <el-form-item
|
|
|
- prop="name"
|
|
|
- label="账号组名称"
|
|
|
- >
|
|
|
- <el-input
|
|
|
- v-model="editForm.name"
|
|
|
- maxlength="32"
|
|
|
- placeholder="账号组名称"
|
|
|
- />
|
|
|
+ <el-form ref="editForm" :inline="true" :rules="rules" class="form" :model="editForm">
|
|
|
+ <el-form-item prop="name" label="账号组名称">
|
|
|
+ <el-input v-model="editForm.name" maxlength="32" placeholder="账号组名称" />
|
|
|
</el-form-item>
|
|
|
- <el-form-item
|
|
|
- label="描述"
|
|
|
- style="margin-left: 40px"
|
|
|
- >
|
|
|
- <el-input
|
|
|
- v-model="editForm.desc"
|
|
|
- style="width: 640px"
|
|
|
- placeholder="请输入描述"
|
|
|
- maxlength="200"
|
|
|
- />
|
|
|
+ <el-form-item label="描述" style="margin-left: 40px">
|
|
|
+ <el-input v-model="editForm.desc" style="width: 640px" placeholder="请输入描述" maxlength="200" />
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</div>
|
|
@@ -50,43 +22,19 @@
|
|
|
<el-row :gutter="24">
|
|
|
<el-col :span="8">
|
|
|
<div class="part">
|
|
|
- <AccountGroupTree
|
|
|
- title="上级账号组"
|
|
|
- nodekey="GroupId"
|
|
|
- :check-disabled="doesGroupExist"
|
|
|
- :type="true"
|
|
|
- :defaultProps="defaultProps"
|
|
|
- :checkedKeys="accountGroupTreeCheckedList"
|
|
|
- @getTreeData="getAccountGroupChecked"
|
|
|
- />
|
|
|
+ <AccountGroupTree title="上级账号组" nodekey="GroupId" :check-disabled="doesGroupExist" :type="true" :defaultProps="defaultProps" :checkedKeys="accountGroupTreeCheckedList" @getTreeData="getAccountGroupChecked" />
|
|
|
</div>
|
|
|
</el-col>
|
|
|
<!-- 开启角色 -->
|
|
|
<template v-if="openRole">
|
|
|
<el-col :span="8">
|
|
|
<div class="part">
|
|
|
- <RoleList
|
|
|
- title="角色列表"
|
|
|
- :roleType="roleType"
|
|
|
- :GroupIds="groupIds"
|
|
|
- :checkBoxList="roleListCheckedList"
|
|
|
- :number="8"
|
|
|
- :active="true"
|
|
|
- @checkChange="getRoleListChecked"
|
|
|
- @checkClick="selectRole"
|
|
|
- @roleListChange="roleListCheckedChange"
|
|
|
- />
|
|
|
+ <RoleList title="角色列表" :roleType="roleType" :GroupIds="groupIds" :checkBoxList="roleListCheckedList" :number="8" :active="true" @checkChange="getRoleListChecked" @checkClick="selectRole" @roleListChange="roleListCheckedChange" />
|
|
|
</div>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
<div class="part">
|
|
|
- <PermissionList
|
|
|
- title="权限列表"
|
|
|
- class="hucPower"
|
|
|
- :RoleList="checkedRoles"
|
|
|
- :check="true"
|
|
|
- @Competen="Competen"
|
|
|
- />
|
|
|
+ <PermissionList title="权限列表" :RoleList="checkedRoles" :check="true" @Competen="Competen" />
|
|
|
</div>
|
|
|
</el-col>
|
|
|
</template>
|
|
@@ -94,22 +42,12 @@
|
|
|
<template v-else>
|
|
|
<el-col :span="8">
|
|
|
<div class="part">
|
|
|
- <PermissionTree
|
|
|
- title="权限树"
|
|
|
- :checkedKeys="permissionTreeChckedKeys"
|
|
|
- :queryType="queryType"
|
|
|
- :queryIds="queryIds"
|
|
|
- @getTreeData="getPermissionTreeChecked"
|
|
|
- />
|
|
|
+ <PermissionTree title="权限树" :checkedKeys="permissionTreeChckedKeys" :queryType="queryType" :queryIds="queryIds" @getTreeData="getPermissionTreeChecked" />
|
|
|
</div>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
<div class="part">
|
|
|
- <RulesOfCompetency
|
|
|
- title="权限规则"
|
|
|
- margin-b="20px"
|
|
|
- @getData="getRulesOfCompetency"
|
|
|
- />
|
|
|
+ <RulesOfCompetency title="权限规则" margin-b="20px" @getData="getRulesOfCompetency" />
|
|
|
</div>
|
|
|
</el-col>
|
|
|
</template>
|
|
@@ -156,7 +94,7 @@ export default {
|
|
|
// Dialog
|
|
|
},
|
|
|
// mixins: [treeData],
|
|
|
- data() {
|
|
|
+ data () {
|
|
|
return {
|
|
|
doesGroupExist: this.$route.meta.doesGroupExist, // 控制账号组新增/编辑
|
|
|
GroupId: 0,
|
|
@@ -196,11 +134,11 @@ export default {
|
|
|
},
|
|
|
computed: {
|
|
|
...mapGetters(['systemSet']),
|
|
|
- pageTitle() {
|
|
|
+ pageTitle () {
|
|
|
return this.doesGroupExist ? '编辑账号组' : '新增账号组'
|
|
|
}
|
|
|
},
|
|
|
- created() {
|
|
|
+ created () {
|
|
|
// 获取系统配置
|
|
|
let obj
|
|
|
if (typeof this.systemSet === 'string') {
|
|
@@ -215,7 +153,7 @@ export default {
|
|
|
this.groupIds.push(this.GroupUpId)
|
|
|
this.queryIds.push(this.GroupUpId)
|
|
|
},
|
|
|
- mounted() {
|
|
|
+ mounted () {
|
|
|
if (this.doesGroupExist) {
|
|
|
this.GroupId = this.$route.query.GroupId
|
|
|
this.getGroupDetails()
|
|
@@ -227,7 +165,7 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
// 账号组详情
|
|
|
- async getGroupDetails() {
|
|
|
+ async getGroupDetails () {
|
|
|
try {
|
|
|
const res = await GetGroupDetails({
|
|
|
GroupId: this.GroupId
|
|
@@ -261,7 +199,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
// 保存
|
|
|
- handleClickSave(formName) {
|
|
|
+ handleClickSave (formName) {
|
|
|
this.$refs[formName].validate(valid => {
|
|
|
if (valid) {
|
|
|
this.handleSaveEdit()
|
|
@@ -272,12 +210,12 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
// 获取当前权限树勾选项
|
|
|
- getPermissionTreeChecked(arr) {
|
|
|
+ getPermissionTreeChecked (arr) {
|
|
|
// console.log(arr)
|
|
|
this.permissionTreeChckedTemp = arr.map(auth => auth.AuthList)
|
|
|
},
|
|
|
// 获取当前勾选的账号组
|
|
|
- getAccountGroupChecked(arr) {
|
|
|
+ getAccountGroupChecked (arr) {
|
|
|
if (arr && arr.length && arr[0] !== -1) {
|
|
|
const GroupIds = arr.map(item => item.GroupId)
|
|
|
this.accountGroupTreeCheckedTemp = GroupIds
|
|
@@ -292,19 +230,19 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
// 角色选取
|
|
|
- getRoleListChecked(arr) {
|
|
|
+ getRoleListChecked (arr) {
|
|
|
this.roleListCheckedTemp = arr
|
|
|
},
|
|
|
- roleListCheckedChange(arr) {
|
|
|
+ roleListCheckedChange (arr) {
|
|
|
this.roleListCheckedTemp = this.roleListCheckedTemp.filter(role => arr.some(data => data.RoleId === role.RoleId))
|
|
|
this.roleListCheckedList = this.roleListCheckedTemp.map(role => role.RoleId)
|
|
|
},
|
|
|
// 获取当前编辑的权限规则
|
|
|
- getRulesOfCompetency(obj) {
|
|
|
+ getRulesOfCompetency (obj) {
|
|
|
this.rulesOfCompetency = obj
|
|
|
},
|
|
|
// 点击角色后显示对应权限列表
|
|
|
- async selectRole(data) {
|
|
|
+ async selectRole (data) {
|
|
|
if (this.currentSelectedRoleId === data.RoleId) return
|
|
|
try {
|
|
|
const params = {
|
|
@@ -343,11 +281,11 @@ export default {
|
|
|
// }
|
|
|
// },
|
|
|
// 修改权限规则
|
|
|
- Competen(data) {
|
|
|
+ Competen (data) {
|
|
|
console.log(data)
|
|
|
},
|
|
|
// 账号组编辑保存
|
|
|
- async handleSaveEdit() {
|
|
|
+ async handleSaveEdit () {
|
|
|
const params = {
|
|
|
AuthList: this.permissionTreeChckedTemp,
|
|
|
GroupName: this.editForm.name,
|
|
@@ -366,7 +304,7 @@ export default {
|
|
|
this.saveAddGroup(params)
|
|
|
}
|
|
|
},
|
|
|
- async saveEditGroup(params) {
|
|
|
+ async saveEditGroup (params) {
|
|
|
try {
|
|
|
const res = await EditGroup(params)
|
|
|
if (res.code === 0) {
|
|
@@ -382,7 +320,7 @@ export default {
|
|
|
console.log('出错了', error)
|
|
|
}
|
|
|
},
|
|
|
- async saveAddGroup(params) {
|
|
|
+ async saveAddGroup (params) {
|
|
|
try {
|
|
|
const res = await SaveGroup(params)
|
|
|
if (res.code === 0) {
|