step.vue 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <template>
  2. <div class="stepBox">
  3. <div class="line">
  4. <span class="before circle" />
  5. <div v-for="item in data" :key="item.parentTemplateId" class="subTitle" @click="$emit('goto', `s${item.parentTemplateId}`)">
  6. <i class="el-icon-success icon" :class="getclass(item.parentTemplateId)" />
  7. {{ item.name }}
  8. </div>
  9. <span class="after circle" />
  10. </div>
  11. </div>
  12. </template>
  13. <script>
  14. export default {
  15. props: {
  16. data: {
  17. type: Array,
  18. default: () => [],
  19. required: false
  20. },
  21. typeList: {
  22. type: Array,
  23. default: () => [],
  24. required: false
  25. }
  26. },
  27. methods: {
  28. getclass(id) {
  29. let type = 'el-icon-question'
  30. this.typeList.map(t => {
  31. if (t.parentTemplateId === id && t.isCheck) {
  32. type = 'el-icon-success'
  33. }
  34. })
  35. return type
  36. }
  37. }
  38. }
  39. </script>
  40. <style scoped lang="scss">
  41. .line {
  42. border-right: 2px solid #D1D1D1;
  43. position: relative;
  44. padding: 2px 0;
  45. .circle {
  46. display: inline-block;
  47. width: 6px;
  48. height: 6px;
  49. border-radius: 50%;
  50. border: 1px solid #666;
  51. background-color: #fff;
  52. position: absolute;
  53. left: calc(100% - 2px);
  54. }
  55. .subTitle {
  56. width: 130px;
  57. text-align: center;
  58. margin: 16px 0px 16px 50%;
  59. padding-left: 16px;
  60. background: #fff;
  61. cursor: pointer;
  62. position: relative;
  63. .icon {
  64. position: absolute;
  65. left: 0px;
  66. top: 4px;
  67. font-size: 14px;
  68. }
  69. .el-icon-success {
  70. color: #1890FF;
  71. }
  72. .el-icon-question {
  73. color: #999;
  74. }
  75. }
  76. .before {
  77. top: 0px;
  78. margin-bottom: 8px;
  79. }
  80. .after {
  81. bottom: 0px;
  82. }
  83. }
  84. </style>