home.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. <template>
  2. <view class="home page-bg-color u-rela">
  3. <view class="banner">
  4. <banner/>
  5. </view>
  6. <u-card margin="30rpx 0" padding="10" :border-radius="0" :border="false" :show-foot="false">
  7. <view class="" slot="head">
  8. <u-icon name="list-dot" class="u-margin-right-10 text"></u-icon>
  9. <text class="text">业务服务</text>
  10. </view>
  11. <u-grid slot="body" :col="4" :border="false">
  12. <u-grid-item :key="index" v-for="(menu, index) in menuList" @click="handleMenuClick(menu)">
  13. <u-image :class="{gray: menu.forbidClick}" width="64rpx" height="64rpx" :src="menu.icon"></u-image>
  14. <view class="menu-text text">{{menu.title}}</view>
  15. </u-grid-item>
  16. </u-grid>
  17. </u-card>
  18. <u-card margin="30rpx 0" padding="10" :border-radius="0" :border="false" :show-foot="false" title-size="28">
  19. <view class="" slot="head">
  20. <u-icon name="calendar-fill" class="u-margin-right-10 text"></u-icon>
  21. <text class="text">日程安排</text>
  22. </view>
  23. <calendar slot="body" mode="date"></calendar>
  24. </u-card>
  25. </view>
  26. </template>
  27. <script>
  28. import banner from './banner/index.vue'
  29. import calendar from './calendar/calendar.vue'
  30. export default {
  31. data() {
  32. return {
  33. show: true,
  34. menuList: [
  35. {
  36. title: '发起流程',
  37. icon: require('@/static/images/workflow/start.png'),
  38. options: {
  39. type: 'start'
  40. }
  41. },
  42. {
  43. title: '我发起的',
  44. icon: require('@/static/images/workflow/myLanuch.png'),
  45. options: {
  46. type: 'myLaunch'
  47. }
  48. },
  49. {
  50. title: '我的待办',
  51. icon: require('@/static/images/workflow/todo.png'),
  52. options: {
  53. type: 'todo'
  54. }
  55. },
  56. {
  57. title: '我的已办',
  58. icon: require('@/static/images/workflow/done.png'),
  59. options: {
  60. type: 'done'
  61. }
  62. },
  63. {
  64. title: '抄送我的',
  65. icon: require('@/static/images/workflow/todo.png'),
  66. options: {
  67. type: 'cc'
  68. }
  69. },
  70. {
  71. title: '流程干预',
  72. icon: require('@/static/images/workflow/todo.png'),
  73. options: {
  74. type: 'manager'
  75. }
  76. },
  77. {
  78. title: '请假申请',
  79. forbidClick: true,
  80. icon: require('@/static/images/menu/leave.png')
  81. },
  82. {
  83. title: '采购申请',
  84. forbidClick: true,
  85. icon: require('@/static/images/menu/buy.png')
  86. },
  87. {
  88. title: '企业内训',
  89. forbidClick: true,
  90. icon: require('@/static/images/menu/train.png')
  91. },
  92. {
  93. title: '邮件通知',
  94. forbidClick: true,
  95. icon: require('@/static/images/menu/email.png')
  96. }
  97. ]
  98. };
  99. },
  100. components: {
  101. banner,
  102. calendar
  103. },
  104. methods: {
  105. handleMenuClick(menu) {
  106. if(!menu.forbidClick) {
  107. this.openPage(menu.options)
  108. }
  109. },
  110. /**
  111. * 打开工作流页面
  112. */
  113. openPage(options) {
  114. uni.navigateTo({
  115. url: `/pages/workflowTask/index?type=${options.type}`
  116. });
  117. }
  118. }
  119. }
  120. </script>
  121. <style lang="scss">
  122. page {
  123. height: unset;
  124. }
  125. .home {
  126. &-bg-color {
  127. top: 0;
  128. left: 0;
  129. width: 100%;
  130. height: 560rpx;
  131. }
  132. .text {
  133. font-weight: 400;
  134. font-size: $main-font-size;
  135. }
  136. .menu-text {
  137. margin-top: 5rpx;
  138. }
  139. .gray {
  140. filter: grayscale(100%);
  141. }
  142. }
  143. </style>