Skip to content

Commit e84a888

Browse files
author
pixel
committed
资源权限增加便利筛选功能
1 parent 84de88b commit e84a888

File tree

1 file changed

+21
-1
lines changed
  • QMPlusVuePage/src/view/superAdmin/authority/components

1 file changed

+21
-1
lines changed

QMPlusVuePage/src/view/superAdmin/authority/components/datas.vue

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
<template>
22
<div>
3-
<div class="clearflex">
3+
<div class="clearflex" style="margin:18px">
44
<el-button @click="authDataEnter" class="fl-right" size="small" type="primary">确 定</el-button>
5+
<el-button @click="all" class="fl-left" size="small" type="primary">全选</el-button>
6+
<el-button @click="self" class="fl-left" size="small" type="primary">本部门</el-button>
7+
<el-button @click="selfAndChildren" class="fl-left" size="small" type="primary">部门及以下</el-button>
58
</div>
69
<el-checkbox-group v-model="dataAuthorityId" @change="selectAuthority">
710
<el-checkbox v-for="(item,key) in authoritys" :label="item" :key="key">{{item.authorityName}}</el-checkbox>
@@ -33,6 +36,23 @@ export default {
3336
}
3437
},
3538
methods:{
39+
all(){
40+
this.dataAuthorityId = [...this.authoritys]
41+
},
42+
self(){
43+
this.dataAuthorityId = this.authoritys.filter(item=>item.ID===this.row.ID)
44+
},
45+
selfAndChildren(){
46+
const arrBox = []
47+
this.getChildrenId(this.row,arrBox)
48+
this.dataAuthorityId = this.authoritys.filter(item=>arrBox.indexOf(item.ID)>-1)
49+
},
50+
getChildrenId(row,arrBox){
51+
arrBox.push(row.ID)
52+
row.children&&row.children.map(item=>{
53+
this.getChildrenId(item,arrBox)
54+
})
55+
},
3656
// 提交
3757
async authDataEnter(){
3858
const res = await setDataAuthority(this.row)

0 commit comments

Comments
 (0)