index.vue 3.0 KB

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