operates.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <template>
  2. <div class="container">
  3. <div
  4. v-for="(item, index) in stepComponents"
  5. :key="index"
  6. :class="selectIndex == index ? 'operator active' : 'operator'"
  7. @click="setIndex(index)"
  8. >
  9. <div class="operatorText">{{ item.compentName }}</div>
  10. <div class="operatorIcon">
  11. <svg-icon :icon-class="item.compentType" size="45" />
  12. </div>
  13. </div>
  14. <ReportBreak ref="reportBreakRef" />
  15. <ReportWork ref="reportWorkRef" />
  16. </div>
  17. </template>
  18. <script lang="ts" setup>
  19. import ReportBreak from "@/views/pro-operation/report-break/index.vue"; // ================ 报故
  20. import ReportWork from "@/views/pro-operation/report-work/index.vue"; // = 报工
  21. // ================ 报故
  22. const reportBreakRef = ref<InstanceType<typeof ReportBreak>>();
  23. // ================ 报工
  24. const reportWorkRef = ref<InstanceType<typeof ReportWork>>();
  25. const selectIndex = ref(0);
  26. const setIndex = (index: number) => {
  27. selectIndex.value = index;
  28. switch (stepComponents.value[index].compentType) {
  29. case "baogu":
  30. reportBreakRef.value?.openReportBreakDrawer();
  31. break;
  32. case "gongweishangliao":
  33. break;
  34. case "liuzhuan":
  35. break;
  36. case "tuzhi":
  37. break;
  38. case "weiwai":
  39. break;
  40. case "baogong":
  41. reportWorkRef.value?.openReportWorkDrawer();
  42. break;
  43. default:
  44. break;
  45. }
  46. };
  47. const stepComponents = ref([
  48. {
  49. compentName: "叫料",
  50. compentType: "jiaoliao",
  51. },
  52. {
  53. compentName: "工位上料",
  54. compentType: "gongweishangliao",
  55. },
  56. {
  57. compentName: "物料流转",
  58. compentType: "liuzhuan",
  59. },
  60. {
  61. compentName: "图纸",
  62. compentType: "tuzhi",
  63. },
  64. {
  65. compentName: "委外",
  66. compentType: "weiwai",
  67. },
  68. {
  69. compentName: "报故",
  70. compentType: "baogu",
  71. },
  72. {
  73. compentName: "报工",
  74. compentType: "baogong",
  75. },
  76. ]);
  77. </script>
  78. <style lang="scss" scoped>
  79. .container {
  80. width: 100%;
  81. font-weight: $Medium;
  82. .operator {
  83. width: 100%;
  84. height: 88px;
  85. border-radius: 16px;
  86. background-color: white;
  87. margin-top: 20px;
  88. display: flex;
  89. padding: 20px;
  90. justify-content: space-between;
  91. align-items: center;
  92. .operatorText {
  93. font-size: $f24;
  94. }
  95. .operatorIcon {
  96. font-weight: 800;
  97. }
  98. }
  99. }
  100. .active {
  101. background-color: #64bb5c !important;
  102. color: white;
  103. }
  104. </style>