Commit 6a7f99db by 蒋勇

d

parent 2b6b116d
......@@ -221,7 +221,7 @@ export default {
item.orgpath = item.code;
}
item.children.sort((item1, item2) => {
return item1.seq > item2.seq;
return Number(item1.seq) > Number(item2.seq);
});
modiTreeNodeByCode(item.children, newobj, item);
} else {
......
......@@ -30,6 +30,7 @@ export default {
authdic() {
let dic = {};
this.roleauths.forEach(item => {
//auth表里的bizcode---对应树上的code
dic[item.bizcode] = item.authstrs.split(",");
});
return dic;
......@@ -47,8 +48,6 @@ export default {
getApp().then(res => {
let rtn = res.data;
if (rtn.status == 0) {
console.log(rtn.data.funcJson);
// let tmptreedata = JSON.parse(rtn.data.functionJSON);
this.treedata = rtn.data.funcJson; //
//按照当前角色,去获取当前应用的功能权限,对返回的数据进行处理
//赋予权限数据
......@@ -58,7 +57,7 @@ export default {
this.roleauths=rtn.data
this.setAuthData(this.treedata);
}else{
console.log("fetch auths fails.....")
console.log("fetch auths fails.....---------------------------------------------------------")
}
})
......@@ -68,19 +67,21 @@ export default {
},
setAuthData(datas) {
datas.forEach(td => {
if (td.children) {
if (td.children && td.children.length>0) {
this.setAuthData(td.children);
} else {
if(td.sels){
console.log(this.authdic)
td.sels = this.authdic[td.code];
td.sels = this.authdic[td.code]?this.authdic[td.code]:[];
}else{
td.sels=[]
}
}
});
},
makeauths(datas, auths) {
console.log(datas,"makeauths")
datas.forEach(item => {
if (item.children) {
if (item.children && item.children.length>0) {
this.makeauths(item.children, auths);
} else {
if (item.sels) {
......@@ -174,13 +175,13 @@ export default {
},
[h("span", ["all"])]
)
: data.name == "root"
: data.code == "root"
? h("span", [
h(
"Button",
{
props: {
type: "text"
type: "primary"
},
on: {
click: () => {
......@@ -216,7 +217,7 @@ export default {
on: {
"on-change": v => {
data.sels = v;
console.log(v);
console.log("mmmmmmmmmmmmmmmmmmmmmmmmmm",v);
}
}
},
......
......@@ -122,6 +122,8 @@ export default {
this.$refs.orgtree.treedata = treedata2;
this.$refs.orgtree.refreshTree();
this.$Message.success("当前操作成功完成")
//刷新表格
this.$refs.userinfo.searchWhere({opath:modidata.code})
} else {
}
});
......@@ -151,8 +153,9 @@ export default {
this.$refs.orgtree.currentData &&
this.$refs.orgtree.currentData.isPosition
) {
row.opath=this.$refs.orgtree.currentData.orgpath
row.opath=this.$refs.orgtree.currentData.orgpath;
row.ptags = this.$refs.orgtree.currentData.orgtag;
row.roles=this.$refs.orgtree.currentData.roles?this.$refs.orgtree.currentData.roles:[]
}
console.log("before.save", key, row);
return cbk(row);
......
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