steps.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. <template>
  2. <div class="body">
  3. <div class="steps" v-for="(item, index) in opsArray" :key="index" @click="boxClick(item, index)">
  4. <div :class="selectStepIndex == index ? 'stepBox stepBoxHover' : 'stepBox'">
  5. <div style="display: flex; align-items: center">
  6. <div :class="selectStepIndex == index
  7. ? 'stepIndex stepIndexHover'
  8. : 'stepIndex'
  9. ">
  10. <span :class="selectStepIndex == index
  11. ? 'indexText hoverTextColor'
  12. : 'indexText'
  13. ">{{ index + 1 }}</span>
  14. </div>
  15. <div class="midTextBox">
  16. <div :class="selectStepIndex == index ? 'stepName stepNameHover' : 'stepName'
  17. ">
  18. {{ item.operationName }}
  19. </div>
  20. <div :class="selectStepIndex == index
  21. ? 'stepStation stepStationHover'
  22. : 'stepStation'
  23. ">
  24. {{ item.operationCode }}
  25. </div>
  26. </div>
  27. </div>
  28. <div :class="selectStepIndex == index ? 'timeBox timeBoxHover' : 'timeBox'">
  29. {{ item.completeNum }}
  30. </div>
  31. </div>
  32. <div class="line" v-if="index != opsArray.length - 1"></div>
  33. </div>
  34. </div>
  35. </template>
  36. <script lang="ts" setup>
  37. import { useProcessStore } from "@/store";
  38. const store = useProcessStore();
  39. const props = defineProps<{
  40. opsArray?: object;
  41. selectStepIndex: number;
  42. }>();
  43. const emit = defineEmits(["setstepindex"]);
  44. const boxClick = (item, index) => {
  45. //第二层参数赋值
  46. store.odersData.operationId = item.operationId;
  47. store.processInfo.operationCode = item.operationCode;
  48. store.processInfo.operationName = item.operationName;
  49. emit("setstepindex", index);
  50. };
  51. onMounted(() => {
  52. // if (props.opsArray) {
  53. // boxClick(props.opsArray[0], 0);
  54. // }
  55. });
  56. </script>
  57. <style lang="scss" scoped>
  58. .body {
  59. width: 100%;
  60. }
  61. .stepBox {
  62. display: flex;
  63. justify-content: space-between;
  64. align-items: center;
  65. height: 88px;
  66. border-radius: 44px;
  67. background-color: white;
  68. box-shadow: 0px 1px 1px 1px #00000025;
  69. }
  70. .stepBoxHover {
  71. box-shadow: 0px 0px 0px 0px;
  72. background-color: $select-hover;
  73. }
  74. .stepIndexHover {
  75. border-color: white !important;
  76. span {
  77. color: white;
  78. }
  79. }
  80. .stepNameHover {
  81. color: white !important;
  82. }
  83. .stepStationHover {
  84. color: white !important;
  85. }
  86. .timeBoxHover {
  87. color: white !important;
  88. }
  89. .hoverTextColor {
  90. color: white !important;
  91. }
  92. .stepIndex {
  93. width: 88px;
  94. height: 88px;
  95. border: 2px solid #303030;
  96. border-radius: 44px;
  97. @include flex;
  98. .indexText {
  99. font-size: $f24;
  100. color: #303030;
  101. }
  102. }
  103. .midTextBox {
  104. margin-left: 10px;
  105. .stepName {
  106. font-size: $f24;
  107. color: $font-default-black;
  108. }
  109. .stepStation {
  110. font-size: $f20;
  111. color: $font-default-60;
  112. line-height: 20px;
  113. }
  114. }
  115. .timeBox {
  116. margin-right: 20px;
  117. @include flex;
  118. font-size: $f24;
  119. }
  120. .line {
  121. border-right: 1px solid #303030;
  122. height: 15px;
  123. width: 1px;
  124. margin-left: 44px;
  125. }
  126. </style>