Commit 9fadac41 by 无尘

fix:修改授权回显禁用

parent 3fbcce36
......@@ -4,7 +4,7 @@
* @Author: 无尘
* @Date: 2020-07-21 10:10:57
* @LastEditors: 无尘
* @LastEditTime: 2020-08-10 13:56:23
* @LastEditTime: 2020-08-12 10:06:00
-->
<!--
门店绑定-选择分组(仅展示)
......@@ -93,6 +93,7 @@ export default {
arr.children.forEach(ele => {
that.$refs.groupTree.setChecked(ele.storeGroupId,checkFlag,true);
// 递归子级禁用和选中
ele.disabled = true;
if (!!ele.children && !!ele.children.length) {
that.checkChild(ele, checkFlag);
}
......@@ -123,10 +124,32 @@ export default {
const that = this;
const ids = that.selectGroup.map(ele=>ele.storeGroupId);
that.groupData.forEach(ele => {
ele.disabled = true;
// 如果父级选中了,设置子级禁用
if (ids.includes(ele.storeGroupId) && !!ele.children.length) {
that.checkChild(ele, true);
}
// 如果父级没有选中,查找子级,再判断父级有没有禁用
if (!ids.includes(ele.storeGroupId)) {
that.disableChild(ele, ids);
}
})
},
/**
* disableChild
*/
disableChild(arr,ids) {
const that = this;
arr.children.forEach(ele => {
ele.disabled = true;
// 如果父级选中了,设置子级禁用
if (ids.includes(ele.storeGroupId) && !!ele.children.length) {
that.checkChild(ele, true);
}
// 如果父级没有选中,查找子级,再判断父级有没有禁用
if (!ids.includes(ele.storeGroupId) && !!ele.children.length) {
that.disableChild(ele,ids);
}
})
},
......@@ -146,7 +169,7 @@ export default {
res.result.forEach(ele => {
ele.expand = false;
ele.children = [];
ele.disabled = true;
ele.disabled = false;
ele.label = ele.storeGroupName;
});
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment