|
@@ -10,7 +10,7 @@ Page({
|
|
|
tabShow: true,
|
|
|
auth: {}, //权限
|
|
|
listHeight: 0,
|
|
|
- butText: "账号", //按钮类型
|
|
|
+ butText: "", //按钮类型
|
|
|
content: {
|
|
|
"pageNumber": 1,
|
|
|
"pageSize": 20,
|
|
@@ -25,27 +25,20 @@ Page({
|
|
|
* 生命周期函数--监听页面加载
|
|
|
*/
|
|
|
onLoad(options) {
|
|
|
- let auth = getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ['营销工具'], ['团队管理'])[0].apps;
|
|
|
- let teammag = [],
|
|
|
- rolemag = [];
|
|
|
- if (auth.length == 1) {
|
|
|
- let title = auth[0].meta.title;
|
|
|
- console.log(auth[0].meta.auth)
|
|
|
- let authList = auth[0].meta.auth.map(v => v.option);
|
|
|
- title == '团队管理' ? teammag = authList : rolemag = authList;
|
|
|
- this.setData({
|
|
|
- butText: title == '团队管理' ? '账号' : '角色',
|
|
|
- tabShow: false
|
|
|
- });
|
|
|
+ let authList = JSON.parse(options.auth).map(v => v.optionname);
|
|
|
+ let tabShow = false,
|
|
|
+ butText = '账号';
|
|
|
+ if (authList.includes('查看账号') && authList.includes('查看角色')) {
|
|
|
+ tabShow = true;
|
|
|
} else {
|
|
|
- auth.filter(v => {
|
|
|
- let list = v.meta.auth.map(v => v.option);
|
|
|
- v.name == 'teammag' ? teammag = list : rolemag = list;
|
|
|
- })
|
|
|
+ butText = authList.includes('查看角色') ? '角色' : '账号';
|
|
|
}
|
|
|
+ console.log(butText)
|
|
|
+
|
|
|
this.setData({
|
|
|
- teammag,
|
|
|
- rolemag
|
|
|
+ tabShow,
|
|
|
+ butText,
|
|
|
+ authList
|
|
|
})
|
|
|
this.getList();
|
|
|
},
|
|
@@ -105,7 +98,7 @@ Page({
|
|
|
item
|
|
|
} = e.currentTarget.dataset;
|
|
|
wx.navigateTo({
|
|
|
- url: `./addRole?item=${JSON.stringify(item)}&update=${this.data.rolemag.includes("update")}&userDelete=${this.data.rolemag.includes("delete")}`
|
|
|
+ url: `./addRole?item=${JSON.stringify(item)}&update=${this.data.authList.includes("角色修改")}&userDelete=${this.data.authList.includes("角色删除")}`
|
|
|
})
|
|
|
},
|
|
|
/* 修改账号 */
|
|
@@ -115,7 +108,7 @@ Page({
|
|
|
} = e.currentTarget.dataset;
|
|
|
delete(item.attinfos);
|
|
|
wx.navigateTo({
|
|
|
- url: `./addUsers?item=${JSON.stringify(item)}&update=${this.data.teammag.includes("update")}`
|
|
|
+ url: `./addUsers?item=${JSON.stringify(item)}&update=${this.data.authList.includes("账号修改")}`
|
|
|
})
|
|
|
},
|
|
|
|