Commit 6a7f99db by 蒋勇

d

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