applyModal.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. <template>
  2. <div class="workflow">
  3. <van-collapse v-model="activeNames" :border="false">
  4. <template v-for="(item, index) in applyList">
  5. <van-collapse-item :name="index" :key="index" v-if="item.process_list2 && item.process_list2.length > 0">
  6. <template #title>
  7. <h2 class="title">{{ item.name }}</h2>
  8. </template>
  9. <div class="grid">
  10. <div
  11. class="grid-item"
  12. v-for="process in item.process_list2"
  13. :key="process.id"
  14. @click="onHref(process)"
  15. >
  16. <e-icon class="icon" :icon-name="process.icon" />
  17. <p>{{ process.name }}</p>
  18. </div>
  19. </div>
  20. </van-collapse-item>
  21. </template>
  22. </van-collapse>
  23. </div>
  24. </template>
  25. <script>
  26. export default {
  27. props: {
  28. applyList: {
  29. type: [Array, Object],
  30. default() {
  31. return [];
  32. },
  33. },
  34. },
  35. data() {
  36. return {
  37. activeNames: [0],
  38. };
  39. },
  40. methods: {
  41. onHref(process) {
  42. this.$router.push({
  43. path: "/approvalApply",
  44. query: {
  45. processId: process.id,
  46. name: process.name
  47. },
  48. });
  49. },
  50. },
  51. };
  52. </script>
  53. <style lang="less" scoped>
  54. .workflow {
  55. padding: 0 0.16rem .12rem;
  56. .icon {
  57. // border: 1px solid #666;
  58. // padding: 0.1rem;
  59. // border-radius: 50%;
  60. // width: .4rem;
  61. // height: .4rem;
  62. font-size: .4rem;
  63. display: flex;
  64. align-items: center;
  65. justify-content: center;
  66. margin-bottom: 0.03rem;
  67. }
  68. .title {
  69. display: flex;
  70. align-items: center;
  71. font-size: 0.16rem;
  72. line-height: 0.28rem;
  73. font-weight: 500;
  74. color: #333333;
  75. &::before {
  76. content: " ";
  77. width: 0.04rem;
  78. height: 0.17rem;
  79. background: #01c1b5;
  80. display: inline-block;
  81. margin-right: 0.07rem;
  82. border-radius: 8px;
  83. }
  84. }
  85. .grid {
  86. display: flex;
  87. flex-wrap: wrap;
  88. align-items: flex-start;
  89. margin-top: 0.08rem;
  90. .grid-item {
  91. display: flex;
  92. flex-direction: column;
  93. align-items: center;
  94. justify-items: center;
  95. justify-content: center;
  96. padding: 0 0 0.15rem;
  97. width: 25%;
  98. color: #666;
  99. p {
  100. width: 96%;
  101. text-align: center;
  102. padding: 0.05rem 2% 0;
  103. font-size: 12px;
  104. }
  105. }
  106. }
  107. /deep/.van-collapse-item {
  108. margin-bottom: .1rem;
  109. border-radius: 0.05rem;
  110. overflow: hidden;
  111. }
  112. }
  113. </style>