Browse Source

删除&优化权限

organize
刘嘉炜 3 years ago
parent
commit
2e0d638664
  1. 25
      src/pages/employee/manage/manage.vue
  2. 24
      src/store/index.js

25
src/pages/employee/manage/manage.vue

@ -59,8 +59,19 @@
<view class="ei-author">
<view>权限</view>
<view>
<view class="tag-active" v-if="k.extension.permission.menu.length == permissionArr.length">全部权限</view>
<view v-else v-for="e in k.extension.permission.menu" :key="e">{{permissionObj[e] || ''}}</view>
<view
class="tag-active"
v-if="isAllAuthor({
adminLs: k.extension.permission.menu,
localLs: permissionArr,
})"
>全部权限</view>
<block v-else >
<block v-for="e in k.extension.permission.menu" :key="e">
<view v-if="!!permissionObj[e]">{{permissionObj[e] || ''}}</view>
</block>
</block>
</view>
</view>
</view>
@ -114,11 +125,21 @@ export default {
}
},
onLoad(){
},
onShow(){
this.refreshEmployList();
},
methods: {
//
isAllAuthor({
adminLs = [],
localLs = []
}){
if(!localLs || !adminLs || !adminLs.length || !localLs.length)return false;
let _unAuthorLs = localLs.filter(ele=>!adminLs.includes(+ele.key))
return !_unAuthorLs.length
},
//
employeeDelete: util.debounce(function(){
let _employeeList = this.employeeInfo.employee || [];

24
src/store/index.js

@ -16,22 +16,32 @@ export default new Vuex.Store({
brandInfo: {
brand: {}
},
// permissionObj: { // 权限代号对应
// '1001': '营业额',
// '1002': '收款记录',
// '1003': '经营分析',
// '1004': '预约订单',
// '1005': '会员卡订单',
// '1006': '积分订单',
// '1007': '员工管理',
// '1008': '查询核销',
// '1009': '场地管理',
// '1010': '设备管理',
// '1011': '商品零售',
// '1012': '订单管理',
// '1013': '课程管理',
// },
permissionObj: { // 权限代号对应
'1001': '营业额',
'1002': '收款记录',
'1003': '经营分析',
'1004': '预约订单',
'1005': '会员卡订单',
'1006': '积分订单',
'1012': '订单管理',
'1007': '员工管理',
'1008': '查询核销',
'1008': '核销查询',
'1009': '场地管理',
'1010': '设备管理',
'1011': '商品零售',
'1012': '订单管理',
'1013': '课程管理',
},
// 场地占用提交页面信息
occupyInfo: {
storeInfo: {}, // 店铺信息

Loading…
Cancel
Save