index.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  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-video/comment/list',
  77. img: require('@/static/icon-comment-video.png')
  78. }
  79. ]
  80. }
  81. ]
  82. }
  83. },
  84. onLoad() {
  85. this.init()
  86. },
  87. onShareAppMessage() {
  88. return shareData
  89. },
  90. methods: {
  91. handleGoNext(url) {
  92. uni.navigateTo({
  93. url
  94. })
  95. },
  96. init() {
  97. const userInfo = this.$store.state.userInfo;
  98. this.my_tabs = !['ficc_admin','admin'].includes(userInfo.RoleTypeCode) ? this.tabs.filter(_ => _.label !== '问答社区') : this.tabs;
  99. }
  100. },
  101. }
  102. </script>
  103. <style lang="scss">
  104. .workbench-page{
  105. padding: 20rpx;
  106. display: flex;
  107. flex-wrap: wrap;
  108. }
  109. .section{
  110. width: 100%;
  111. padding: 30rpx;
  112. box-shadow: 0px 3px 12px rgba(175, 175, 175, 0.16);
  113. font-size: 12px;
  114. font-weight: 400;
  115. color: #666;
  116. margin-bottom: 30rpx;
  117. .tab-title {
  118. font-size: 32rpx;
  119. font-weight: bold;
  120. color: #222;
  121. }
  122. .tab-ul {
  123. margin-top: 40rpx;
  124. display: flex;
  125. align-items: center;
  126. .tab-item {
  127. margin-right: 60rpx;
  128. text-align: center;
  129. .icon{
  130. width: 78rpx;
  131. height: 78rpx;
  132. margin: 0 auto 10rpx;
  133. }
  134. }
  135. }
  136. }
  137. </style>