permissionButton.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. // 权限配置按钮
  2. const permissionButtons = {
  3. state:()=>({
  4. permissionButtons:[]
  5. }),
  6. mutations:{
  7. SET_PERMISSION_BUTTONS:(state,buttons)=>{
  8. state.permissionButtons = buttons
  9. }
  10. },
  11. actions:{
  12. getPermissionButtons({commit}){
  13. return new Promise((resolve,reject)=>{
  14. /* getPermissionButtons().then(res=>{
  15. commit('GET_PERMISSION_BUTTONS',res.data.list || [])
  16. // console.log(res);
  17. resolve('获取权限按钮成功')
  18. }) */
  19. const buttons = [
  20. {button_code: "system:menu:add"},
  21. {button_code: "system:user:add"},
  22. {button_code:'reportManage:reportList:sendTime'},
  23. {button_code:'reportManage:reportView'},
  24. {button_code:'reportManage_reportView_copyWechat'},
  25. {button_code:'enReport:reportView'},
  26. {button_code:'enReport:reportView:wechatShare'},
  27. //{button_code:'classifyList:enClassify'},
  28. {button_code:'classifyList:cnClassify'},
  29. {button_code:'classifyList:cnClassify:classifyAdd'}
  30. ]
  31. commit('SET_PERMISSION_BUTTONS',buttons)
  32. resolve('获取权限按钮成功')
  33. })
  34. }
  35. },
  36. getters:{}
  37. }
  38. export default permissionButtons;