useAuthBtn.js 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. //权限按钮相关
  2. import {useAuthBtnStore} from '@/store/modules/authBtn'
  3. const authBtnStore = useAuthBtnStore()
  4. /*
  5. ---------------------------研报管理-----------------
  6. */
  7. export const reportManageBtn = {
  8. reportManage_sendMsg:'reportManage:sendMsg',//推送消息/已推送消息
  9. reportManage_reportView:'reportManage:reportView',//研报预览:即是否能点击研报名称跳转预览页面
  10. reportManage_reportDel:'reportManage:reportDel',//删除研报
  11. reportManage_reportEdit:'reportManage:reportEdit',//编辑研报
  12. reportManage_cancelPublish:'reportManage:cancelPublish',//取消发布
  13. reportManage_exportPdf:'reportManage:exportPdf',//下载pdf
  14. reportManage_exportImg:'reportManage:exportImg',//下载长图
  15. reportManage_publish:'reportManage:publish',//发布研报
  16. reportManage_reportList:'reportManage:reportList',//研报列表的选项
  17. reportManage_reportList_uv:'reportManage:reportList:uv',//研报列表-PV/UV
  18. reportManage_reportList_sendTime:'reportManage:reportList:sendTime',//研报列表-报告推送时间
  19. reportManage_dayWeekReportAdd:'reportManage:dayWeekReportAdd',//添加晨报周报
  20. reportManage_reportAdd:'reportManage:reportAdd',//添加研报
  21. }
  22. export const enReportManageBtn = {
  23. enReport_reportView:'enReport:reportView',//研报预览:即是否能点击研报名称跳转预览页面
  24. enReport_sendEmail:'enReport:sendEmail',//群发邮件/群发日志
  25. enReport_reportDel:'enReport:reportDel',//删除研报
  26. enReport_reportEdit:'enReport:reportEdit',//编辑研报
  27. enReport_cancelPublish:'enReport:cancelPublish',//取消发布
  28. enReport_exportPdf:'enReport:exportPdf',//下载pdf
  29. enReport_exportImg:'enReport:exportImg',//下载长图
  30. enReport_publish:'enReport:publish',//发布研报
  31. enReport_reportAdd:'enReport:reportAdd',//添加研报
  32. }
  33. /*
  34. --------------------------智能PPT-----------------
  35. PS:由于移动端中英文PPT是一个页面,特地把按钮名称设置为一致的方便处理
  36. 与ETA后台不同,修改时请注意
  37. */
  38. export const pptBtn={
  39. ppt_del:'ppt:del',
  40. ppt_copy:'ppt:copy',
  41. ppt_download:'ppt:download',
  42. ppt_show:'ppt:show',//演示
  43. ppt_publish:'ppt:publish',
  44. ppt_visible:'ppt:visible',//可见权限
  45. ppt_save:'ppt:save',//添加PPT按钮,同时也控制目录重命名权限
  46. ppt_setShare:'ppt:setShare',//设置共享
  47. }
  48. export const enPPTBtn={
  49. ppt_del:'pptEn:del',
  50. ppt_copy:'pptEn:copy',
  51. ppt_download:'pptEn:download',
  52. ppt_show:'pptEn:show',
  53. ppt_publish:'pptEn:publish',
  54. ppt_visible:'pptEn:visible',
  55. ppt_save:'pptEn:save',//添加PPT按钮,同时也控制目录重命名权限
  56. ppt_setShare:'pptEn:setShare',//设置共享
  57. }
  58. /*
  59. --------------------------ETA指标库---------------
  60. */
  61. export const edbDataBtn={
  62. /*-----------指标详情按钮--------- */
  63. edbData_refreshAll:'edbData:refreshAll',//全部刷新
  64. edbData_newestValue:'edbData:newestValue',//添加最新值
  65. edbData_enNameSetting:'edbData:enNameSetting',//设置英文名称
  66. edbData_edbSource:'edbData:edbSource',//指标溯源
  67. edbData_copyData:'edbData:copyData',//复制数据
  68. edbData_edit:'edbData:edit',//指标编辑,也包括列表项的编辑按钮
  69. edbData_update:'edbData:update',//更新指标
  70. edbData_saveEdb:'edbData:saveEdb',//保存
  71. edbData_deleteEdb:'edbData:deleteEdb',//删除
  72. edbData_showChartBasis:'edbData:showChartBasis',//展示/隐藏同比图
  73. edbData_switchSeason:'edbData:switchSeason',//切换季节性图
  74. edbData_editLimit:'edbData:editLimit',//编辑上下限
  75. edbData_calculateAgain:'edbData:calculateAgain',//重新计算
  76. /*------------页面按钮---------- */
  77. edbData_replaceEdb:'edbData:replaceEdb',//替换指标
  78. edbData_calcuEdb:'edbData:calcuEdb',//计算指标
  79. edbData_addEdb:'edbData:addEdb',//添加指标
  80. edbData_switchEn:'edbData:switchEn',//切换英文版
  81. edbData_classifyOpt_add:'edbData:classifyOpt:add',//添加/编辑分类
  82. edbData_classifyOpt_delete:'edbData:classifyOpt:delete',//删除分类
  83. edbData_classifyOpt_move:'edbData:classifyOpt:move',//移动分类
  84. edbData_checkRelatedChart:'edbData:checkRelatedChart',//查看关联图表
  85. edbData_checkRelatedEdb:'edbData:checkRelatedEdb',//查看关联指标
  86. edbData_checkCalcChart:'edbData:checkCalcChart',//查看计算指标
  87. }
  88. /*
  89. -------------------------ETA图库------------------
  90. */
  91. export const chartLibBtn={
  92. /*-----------图表详情按钮--------- */
  93. chartLib_del:'chartLib:del',//删除
  94. chartLib_enNameSetting:'chartLib:enNameSetting',//设置英文名称
  95. chartLib_copyWechat:'chartLib:copyWechat',//保存图片(两个按钮控制)
  96. chartLib_copyOffice:'chartLib:copyOffice',//保存图片(两个按钮控制)
  97. chartLib_otherSave:'chartLib:otherSave',//另存为
  98. chartLib_save:'chartLib:save',//保存
  99. chartLib_refresh:'chartLib:refresh',//刷新
  100. chartLib_addMy:'chartLib:addMy',//加入我的图库
  101. chartLib_share:'chartLib:share',//分享
  102. chartLib_editLimit:'chartLib:editLimit',//编辑上下限
  103. /*------------页面按钮---------- */
  104. chartLib_switchEn:'chartLib:switchEn',//切换中英文
  105. chartLib_isOnlyMine:'chartLib:isOnlyMine',//只看我的
  106. chartLib_classifyOpt_add:'chartLib:classifyOpt:add',//新增/编辑分类
  107. chartLib_classifyOpt_delete:'chartLib:classifyOpt:delete',//删除分类
  108. }
  109. /*
  110. ------------------------MyETA--------------------
  111. */
  112. export const myETABtn={
  113. /*-----------图表详情弹窗按钮--------- */
  114. myChart_del:'myChart:del',
  115. myChart_enNameSetting:'myChart:enNameSetting',
  116. myChart_copyWechat:'myChart:copyWechat',
  117. myChart_copyOffice:'myChart:copyOffice',
  118. myChart_otherSave:'myChart:otherSave',
  119. myChart_save:'myChart:save',
  120. myChart_refresh:'myChart:refresh',
  121. myChart_copyTo:'myChart:copyTo',
  122. myChart_share:'myChart:share',
  123. myChart_move:'myChart:move',//移出,同时也控制列表项的移出
  124. myChart_copyData:'myChart:copyData',//复制数据
  125. myChart_checkData:'myChart:checkData',//查看数据
  126. myChart_editLimit:'myChart:editLimit',//编辑上下限
  127. /*-----------页面按钮--------- */
  128. myChart_selectChart:'myChart:selectChart',//选择图表
  129. myChart_classifyOpt_copy:'myChart:classifyOpt:copy',//复制
  130. myChart_classifyOpt_show:'myChart:classifyOpt:show',//可见权限
  131. myChart_classifyOpt_edit:'myChart:classifyOpt:edit',//添加我的分类
  132. myChart_classifyOpt_rename:'myChart:classifyOpt:rename',//重命名
  133. myChart_classifyOpt_delete:'myChart:classifyOpt:delete',//删除
  134. }
  135. export function useAuthBtn(){
  136. const isShowBtn = ()=>{}
  137. const checkAuthBtn = (buttonCode)=>{
  138. const list = authBtnStore.authBtnList||[]
  139. return list.map(item=>item.ButtonCode).includes(buttonCode)
  140. }
  141. return {
  142. isShowBtn,
  143. checkAuthBtn
  144. }
  145. }