Commit 38be4bbe by 蒋勇

d

parent a4b89b0b
......@@ -23,6 +23,18 @@ export const btnAuthFilter=(metainfo,user)=>{
// })
// }
// metainfo.auths=authbtns
let authbtns=[]
let keyswithauth=Object.keys(metainfo.auths).filter(authname=>{
return true
})
if(keyswithauth){
keyswithauth.forEach(k=>{
metainfo.auths[k].forEach(bt=>{
authbtns.push(bt)
})
})
}
metainfo.auths=authbtns
return metainfo
}
......
......@@ -9,9 +9,6 @@ export default {
title: 'Handle',
key: 'handle',
button: [//这个数组中内容,需要按照权限字符串,在服务端构造
{title: "删除",type: "text",icon: "md-trash",key:"delete" },
{title: "编辑",type: "text",icon: "",key:"edit" },
{title: "启用",type: "text",icon: "",key:"enable"},
]
}
],
......
......@@ -7,7 +7,7 @@
searchable
search-place="top"
v-model="tableData"
:columns="columns"
:columns="colswithauth"
@on-rapid-query="doquery"
@on-exec="doexec"
/>
......@@ -34,11 +34,7 @@ export default {
data() {
this.metaName = "user_info";
return {
forminfo: this.metaName ? this.$store.getters[this.metaName]["form"] : {},
columns: this.metaName ? this.$store.getters[this.metaName]["list"] : [],
authbtns: this.metaName
? this.$store.getters[this.metaName]["auths"]
: [],
metainfo:this.$store.getters[this.metaName],
tableData: []
};
},
......@@ -61,20 +57,29 @@ export default {
});
},
computed: {
forminfo(){
return this.metainfo["form"]
},
formbtns() {
return this.authbtns.filter(bt => {
return this.metainfo["auths"].filter(bt => {
return bt.isOnForm;
});
},
onlistbtns() {
return this.authbtns.filter(bt => {
return this.metainfo["auths"].filter(bt => {
return bt.isOnGrid;
});
},
inrowbtns() {
return this.authbtns.filter(bt => {
return bt.isInRow;
});
colswithauth(){
let listbtns=this.metainfo["auths"].filter(bt => {
return bt.isInRow;
});
this.metainfo["list"].forEach(c=>{
if(c.key=="handle"){
c.button.push(...listbtns)
}
})
return this.metainfo["list"]
}
}
};
......
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