StepsTool.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. <template>
  2. <div class="steps-box">
  3. <div
  4. class="steps-item"
  5. v-for="(step, index) in stepList"
  6. :key="index"
  7. :class="{ active: index + 1 == activeIndex }"
  8. >
  9. <div class="left-box">
  10. <slot name="left" :index="index" :data="step">
  11. <div class="time-box">
  12. <span class="date">{{ step.date || "" }}</span>
  13. <span class="time">{{ step.time || "" }}</span>
  14. </div>
  15. </slot>
  16. </div>
  17. <div class="icon-box">
  18. <slot name="icon" :index="index" :data="step">
  19. <div class="icon-content">
  20. <img
  21. class="node-box active"
  22. src="../../../../assets/img/activesteps.png"
  23. v-if="index + 1 == activeIndex"
  24. />
  25. <img
  26. v-else
  27. class="node-box"
  28. src="../../../../assets/img/noActivesteps.png"
  29. />
  30. </div>
  31. </slot>
  32. </div>
  33. <div class="right-box">
  34. <slot name="title" :index="index" :data="step">
  35. <div class="title-info">
  36. <div class="title">{{ step.title || "" }}</div>
  37. <div class="right-item">
  38. <div class="depart">{{ step.depart || "" }}</div>
  39. <div class="name">{{ step.name || "" }}</div>
  40. </div>
  41. </div>
  42. </slot>
  43. <slot
  44. v-if="step.describeSlot"
  45. :name="step.describeSlot"
  46. :index="index"
  47. :data="step"
  48. ></slot>
  49. <slot v-else name="describe" :index="index" :data="step">
  50. <div class="describe-box"></div>
  51. </slot>
  52. </div>
  53. </div>
  54. </div>
  55. </template>
  56. <script setup>
  57. const props = defineProps({
  58. stepList: {
  59. type: Array,
  60. default: () => [],
  61. },
  62. activeIndex: {
  63. type: [Number, String],
  64. default: "",
  65. },
  66. });
  67. </script>
  68. <style lang="scss" scoped>
  69. .steps-box {
  70. padding: 10px;
  71. .steps-item {
  72. display: flex;
  73. min-height: 100px;
  74. .left-box {
  75. .time-box {
  76. display: flex;
  77. flex-direction: column;
  78. }
  79. .date,
  80. .time {
  81. font-family: YouSheBiaoTiHei;
  82. color: #50e0ff;
  83. white-space: nowrap;
  84. text-align: left;
  85. font-style: normal;
  86. text-transform: none;
  87. }
  88. .date {
  89. font-size: 21px;
  90. }
  91. .time {
  92. font-size: 19px;
  93. }
  94. }
  95. .icon-box {
  96. width: 40px;
  97. margin-left: 10px;
  98. margin-top: 5px;
  99. .icon-content {
  100. height: 100%;
  101. width: 100%;
  102. position: relative;
  103. .node-box {
  104. position: relative;
  105. width: 30px;
  106. height: 30px;
  107. z-index: 3;
  108. &.active {
  109. position: relative;
  110. left: -6px;
  111. width: 40px;
  112. height: 40px;
  113. }
  114. }
  115. &::after {
  116. position: absolute;
  117. content: "";
  118. width: 3px;
  119. background-color: #23aad367;
  120. top: 0;
  121. bottom: -7px;
  122. left: 14px;
  123. }
  124. }
  125. }
  126. .right-box {
  127. margin-left: 12px;
  128. padding-bottom: 25px;
  129. .title-info {
  130. display: flex;
  131. .title {
  132. min-width: 79px;
  133. height: 32px;
  134. line-height: 32px;
  135. font-family: Alibaba PuHuiTi;
  136. font-weight: normal;
  137. font-size: 20px;
  138. color: #50e0ff;
  139. text-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
  140. text-align: left;
  141. font-style: normal;
  142. text-transform: none;
  143. }
  144. .right-item {
  145. display: flex;
  146. align-items: center;
  147. padding-left: 10px;
  148. width: 270px;
  149. height: 32px;
  150. margin-left: 20px;
  151. background: linear-gradient(
  152. 270deg,
  153. rgba(62, 174, 255, 0) 0%,
  154. #1b82cbb1 85%,
  155. rgba(27, 129, 203, 0.3) 100%
  156. );
  157. border-radius: 0px 0px 0px 0px;
  158. .depart {
  159. font-family: Alibaba PuHuiTi;
  160. font-size: 16px;
  161. color: #50e0ff;
  162. text-align: left;
  163. }
  164. .name {
  165. font-family: Alibaba PuHuiTi;
  166. font-weight: normal;
  167. font-size: 16px;
  168. color: #ffffff;
  169. text-align: left;
  170. margin-left: 20px;
  171. }
  172. }
  173. }
  174. .describe-box {
  175. }
  176. }
  177. &:first-child {
  178. .icon-content {
  179. &::after {
  180. top: 5px;
  181. }
  182. }
  183. }
  184. &:last-child {
  185. .icon-content {
  186. &::after {
  187. display: none;
  188. }
  189. }
  190. }
  191. }
  192. }
  193. </style>