|
|
|
@ -99,26 +99,25 @@
|
|
|
|
|
</div>
|
|
|
|
|
<div style="padding-left: 15px;">
|
|
|
|
|
<!--1-->
|
|
|
|
|
<div v-for="item in permissionList" :key="item.id">
|
|
|
|
|
<div v-for="(item, index) in permissionList" :key="item.id">
|
|
|
|
|
<div style="border-bottom: 1px solid #e9e9e9;height: 49px;line-height: 49px;">
|
|
|
|
|
<Checkbox :indeterminate="item.indeterminate" :value="item.check"
|
|
|
|
|
@click.prevent.native="handleCheckAll(item)" style="color:#697882;margin-right: 20px;">{{item.name}}</Checkbox>
|
|
|
|
|
@click.prevent.native="handleCheckAll(index)" style="color:#697882;margin-right: 20px;">{{item.name}}</Checkbox>
|
|
|
|
|
</div>
|
|
|
|
|
<!--2-->
|
|
|
|
|
<CheckboxGroup v-model="item.checkArr">
|
|
|
|
|
<div v-for="itemSon in item.sonPermissionList" :key="itemSon.id" style="height: 49px;">
|
|
|
|
|
<div v-for="(itemSon, itemSonIndex) in item.sonPermissionList" :key="itemSon.id" style="height: 49px;">
|
|
|
|
|
<div style="float: left;width: 20%;border-right: 1px solid #E4E9F1;border-bottom: 1px solid #E4E9F1;height: 49px;line-height: 49px;">
|
|
|
|
|
<Checkbox style="margin-left: 30px;color:#697882" :label="itemSon.id"
|
|
|
|
|
@click.prevent.native="handleSonCheckAll(itemSon, item)" :key="itemSon.id"
|
|
|
|
|
@click.prevent.native="handleSonCheckAll(itemSonIndex, index)" :key="itemSon.id"
|
|
|
|
|
:indeterminate="itemSon.indeterminate" :value="itemSon.check">
|
|
|
|
|
{{itemSon.name}}
|
|
|
|
|
</Checkbox>
|
|
|
|
|
</div>
|
|
|
|
|
<!--3-->
|
|
|
|
|
<div style="float: left;width: 80%;height: 49px;line-height: 49px;border-bottom: 1px solid #E4E9F1;">
|
|
|
|
|
<CheckboxGroup v-model="itemSon.checkArr"
|
|
|
|
|
@on-change="handleGrandSonCheckChange(itemSon, item)">
|
|
|
|
|
<Checkbox v-for="itemGrandson in itemSon.sonPermissionList"
|
|
|
|
|
<CheckboxGroup v-model="itemSon.checkArr">
|
|
|
|
|
<Checkbox v-for="itemGrandson in itemSon.sonPermissionList" @on-change="handleGrandSonCheckChange(itemSonIndex, index)"
|
|
|
|
|
:key="itemGrandson.id"
|
|
|
|
|
style="margin-left: 30px;color:#697882" :label="itemGrandson.id" :value="itemGrandson.check">
|
|
|
|
|
{{itemGrandson.name}}
|
|
|
|
@ -294,7 +293,8 @@
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
//一级权限-点击事件
|
|
|
|
|
handleCheckAll (item) {
|
|
|
|
|
handleCheckAll (index) {
|
|
|
|
|
let item = this.permissionList[index];
|
|
|
|
|
if (item.indeterminate) {
|
|
|
|
|
item.check = false;
|
|
|
|
|
} else {
|
|
|
|
@ -329,7 +329,9 @@
|
|
|
|
|
// this.saveRolePermissionApi();
|
|
|
|
|
},
|
|
|
|
|
//二级权限-点击事件
|
|
|
|
|
handleSonCheckAll(itemSon, item) {
|
|
|
|
|
handleSonCheckAll(itemSonIndex, index) {
|
|
|
|
|
let item = this.permissionList[index];
|
|
|
|
|
let itemSon = this.permissionList[index].sonPermissionList[itemSonIndex];
|
|
|
|
|
if (itemSon.indeterminate) {
|
|
|
|
|
itemSon.check = false;
|
|
|
|
|
} else {
|
|
|
|
@ -367,7 +369,9 @@
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
//三级权限-点击事件
|
|
|
|
|
handleGrandSonCheckChange (itemSon, item) {
|
|
|
|
|
handleGrandSonCheckChange (itemSonIndex, index) {
|
|
|
|
|
let item = this.permissionList[index];
|
|
|
|
|
let itemSon = this.permissionList[index].sonPermissionList[itemSonIndex];
|
|
|
|
|
let sonPermissionCount = itemSon.sonPermissionList.length;
|
|
|
|
|
if (itemSon.checkArr.length === sonPermissionCount) {
|
|
|
|
|
itemSon.indeterminate = false;
|
|
|
|
|