index.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. <template>
  2. <view class="workbench-page">
  3. <view class="section white-wrap" v-for="item in my_tabs" :key="item.label">
  4. <view class="tab-title">{{item.label}}</view>
  5. <view class="tab-ul">
  6. <view class="tab-item" @click="handleGoNext(tab.url)" v-for="tab in item.child" :key="tab.label">
  7. <image :src="tab.img" mode="aspectFill" class="icon"/>
  8. <view class="label">{{tab.label}}</view>
  9. </view>
  10. </view>
  11. </view>
  12. </view>
  13. </template>
  14. <script>
  15. import {shareData} from '@/utils/config.js'
  16. export default{
  17. data() {
  18. return {
  19. my_tabs: [],
  20. tabs: [
  21. {
  22. label: '审批',
  23. child: [
  24. {
  25. label: '客户审批',
  26. url: '/pages-approve/custome/list',
  27. img: require('@/static/icon-1.png')
  28. },
  29. {
  30. label: '合同审批',
  31. url: '/pages-approve/contract/list',
  32. img: require('@/static/icon-2.png')
  33. },
  34. {
  35. label: '用印审批',
  36. url: '/pages-approve/seal/list',
  37. img: require('@/static/icon-3.png')
  38. },
  39. ]
  40. },
  41. {
  42. label: '路演管理',
  43. child: [
  44. {
  45. label: '研究员日历',
  46. url: '/pages-roadshow/researcherCalendar/index',
  47. img: require('@/static/icon-5.png')
  48. },
  49. {
  50. label: '我的日历',
  51. url: '/pages-roadshow/myCalendar/index',
  52. img: require('@/static/icon-6.png')
  53. }
  54. ]
  55. },
  56. {
  57. label: '问答社区',
  58. child: [
  59. {
  60. label: '问答管理',
  61. url: '/pages-question/detail/index?type=question',
  62. img: require('@/static/icon-question.png')
  63. },
  64. {
  65. label: '评论管理',
  66. url: '/pages-question/detail/index?type=comment',
  67. img: require('@/static/icon-comment.png')
  68. }
  69. ]
  70. },
  71. {
  72. label: '出差管理',
  73. child: [
  74. {
  75. label: '出差日历',
  76. url: '/pages-businessTrip/calendar/index',
  77. img: require('@/static/icon-businesstrip-calendar.png')
  78. },
  79. {
  80. label: '出差申请',
  81. url: '/pages-businessTrip/apply/list',
  82. img: require('@/static/icon-businesstrip-apply.png')
  83. },
  84. {
  85. label: '出差审批',
  86. url: '/pages-approve/businessTrip/list',
  87. img: require('@/static/icon-businesstrip-approve.png')
  88. },
  89. ]
  90. },
  91. {
  92. label: '视频',
  93. child: [
  94. {
  95. label: '评论管理',
  96. url: '/pages-video/comment/list',
  97. img: require('@/static/icon-comment-video.png')
  98. }
  99. ]
  100. }
  101. ]
  102. }
  103. },
  104. onLoad() {
  105. this.init()
  106. },
  107. onShareAppMessage() {
  108. return shareData
  109. },
  110. methods: {
  111. handleGoNext(url) {
  112. uni.navigateTo({
  113. url
  114. })
  115. },
  116. init() {
  117. const userInfo = this.$store.state.userInfo;
  118. this.my_tabs = !['ficc_admin','admin'].includes(userInfo.RoleTypeCode) ? this.tabs.filter(_ => _.label !== '问答社区') : this.tabs;
  119. if(!userInfo.IsBusinessTrip){//删除出差审批
  120. this.my_tabs=this.my_tabs.map(item=>{
  121. item.child=item.child.filter(_=>_.label!=='出差审批')
  122. return item
  123. })
  124. }
  125. // 权益不显示出差管理模块
  126. if(userInfo.IsRai){
  127. this.my_tabs=this.my_tabs.filter(_ => _.label !== '出差管理')
  128. }
  129. }
  130. },
  131. }
  132. </script>
  133. <style lang="scss">
  134. .workbench-page{
  135. padding: 20rpx;
  136. display: flex;
  137. flex-wrap: wrap;
  138. }
  139. .section{
  140. width: 100%;
  141. padding: 30rpx;
  142. box-shadow: 0px 3px 12px rgba(175, 175, 175, 0.16);
  143. font-size: 12px;
  144. font-weight: 400;
  145. color: #666;
  146. margin-bottom: 30rpx;
  147. .tab-title {
  148. font-size: 32rpx;
  149. font-weight: bold;
  150. color: #222;
  151. }
  152. .tab-ul {
  153. margin-top: 40rpx;
  154. display: flex;
  155. align-items: center;
  156. .tab-item {
  157. margin-right: 60rpx;
  158. text-align: center;
  159. .icon{
  160. width: 78rpx;
  161. height: 78rpx;
  162. margin: 0 auto 10rpx;
  163. }
  164. }
  165. }
  166. }
  167. </style>