index.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <template>
  2. <div class="steps flex">
  3. <div v-for="(item,index) in datas" :key="index" class="node">
  4. <div v-if="item.flag" class="node-status-success">
  5. <span class="icon"></span>
  6. </div>
  7. <div v-else class="node-status-default"></div>
  8. <div v-if="item.flag && datas.length != index+1" class="node-status-success-line"></div>
  9. <div v-if="!item.flag && datas.length != index+1" class="node-status-default-line"></div>
  10. <div :style="{width:item.labelWidth ? item.labelWidth + 'px' : 80 + 'px',transform:`translateX(-${Math.floor(item.labelWidth ? item.labelWidth / 3 : 80 / 3)+3}px)`}" class="node-cap">
  11. <div class="node-name">{{item.name}}</div>
  12. <div class="node-info">
  13. <span class="node-info-list" v-for="(p,i) in item.children" :key="i">{{p}}
  14. <br v-if="i == 1" />
  15. <i v-if="i % 2 == 0">/</i>
  16. </span>
  17. </div>
  18. </div>
  19. </div>
  20. </div>
  21. </template>
  22. <script setup lang="ts">
  23. const props = defineProps({
  24. datas: {
  25. type: Array,
  26. default: () => [],
  27. },
  28. });
  29. const { datas } = props;
  30. </script>
  31. <style lang="scss" scoped>
  32. .steps {
  33. padding: 0 13px;
  34. .node {
  35. position: relative;
  36. width: 100%;
  37. &:last-child {
  38. width: 2%;
  39. }
  40. &-name {
  41. font-size: 14px;
  42. font-family: Microsoft YaHei;
  43. font-weight: bold;
  44. color: #101116;
  45. }
  46. &-cap {
  47. text-align: center;
  48. margin-top: 10px;
  49. .node-info-list {
  50. font-size: 12px;
  51. font-family: Helvetica;
  52. font-weight: 400;
  53. color: #101116;
  54. margin-top: 3px;
  55. display: inline;
  56. }
  57. }
  58. }
  59. .node-status-success {
  60. position: relative;
  61. width: 24px;
  62. height: 24px;
  63. background: #ffffff;
  64. border: 2px solid #d5327b;
  65. border-radius: 50%;
  66. z-index: 2;
  67. .icon {
  68. width: 14px;
  69. height: 14px;
  70. background: #d5327b;
  71. border-radius: 50%;
  72. position: absolute;
  73. top: 50%;
  74. left: 50%;
  75. margin-top: -7px;
  76. margin-left: -7px;
  77. }
  78. }
  79. .node-status-default {
  80. width: 24px;
  81. height: 24px;
  82. background: #ffffff;
  83. border: 2px solid #b7b1b4;
  84. border-radius: 50%;
  85. z-index: 2;
  86. position: relative;
  87. }
  88. .node-status-success-line {
  89. height: 6px;
  90. background: #d5327b;
  91. position: absolute;
  92. width: 100%;
  93. top: 9px;
  94. left: 0;
  95. z-index: 1;
  96. }
  97. .node-status-default-line {
  98. height: 6px;
  99. background: #b7b1b4;
  100. position: absolute;
  101. width: 100%;
  102. top: 9px;
  103. left: 0;
  104. z-index: 1;
  105. }
  106. }
  107. </style>