You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

120 lines
3.6 KiB

3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
  1. <script lang="ts" setup>
  2. import { useLiquidStore } from '@/stores/useLiquidsStore'
  3. import { ref, watch } from 'vue'
  4. import { StepCmdDescMap, tubeSolList } from '../../views/craft/craft_constant'
  5. const props = defineProps<{
  6. order: number
  7. step: CraftTypes.StepStruct
  8. type: string
  9. }>()
  10. const $emit = defineEmits<{
  11. (e: 'del', order: number): void
  12. (e: 'transferChange', stepData: CraftTypes.StepStruct, order: number): void
  13. }>()
  14. const liquidStore = useLiquidStore()
  15. const stepInfo = ref(props.step)
  16. watch(stepInfo, (newVal) => {
  17. $emit('transferChange', newVal, props.order)
  18. }, {
  19. deep: true,
  20. })
  21. // const onDel = () => {
  22. // emit('del', props.order)
  23. // }
  24. </script>
  25. <template>
  26. <div class="right-contaner">
  27. <section class="right-main">
  28. <span class="right-seq">{{ order }}</span>
  29. <span class="right-base">{{ StepCmdDescMap[stepInfo.method] }}</span>
  30. <div v-if="type !== 'showlog'" class="text-item" @click="$emit('del', order)">
  31. <img class="item-img" src="@/assets/images/icon_del_s.svg" alt="del">
  32. </div>
  33. </section>
  34. <template v-if="stepInfo.method !== 'takePhoto'">
  35. <section v-if="stepInfo.method === 'addLiquid'" class="right-liquid right-base">
  36. <div v-for="(tubeItem, index) in stepInfo.params.tubeSolList" :key="index" class="right-liquid">
  37. <el-select v-model="tubeItem.tubeNum" size="small" placeholder="请选择" style="width: 120px" class="right-base" :disabled="type === 'showlog'">
  38. <el-option v-for="item in tubeSolList" :key="item.id" :label="item.name" :value="item.id" />
  39. </el-select>
  40. <div v-for="(liquidItem, liquidIndex) in tubeItem.addLiquidList" :key="liquidIndex" class="right-liquid right-base">
  41. <el-select v-model="liquidItem.solId" size="small" placeholder="请选择" style="width: 100px" class="right-base" :disabled="type === 'showlog'">
  42. <el-option v-for="item in liquidStore.liquids" :key="item.id" :label="item.name" :value="item.id" />
  43. </el-select>
  44. <div>
  45. <el-input v-model.number="liquidItem.volume" size="small" style="width: 100px" :disabled="type === 'showlog'" />
  46. <span class="ml-2">ml</span>
  47. </div>
  48. </div>
  49. </div>
  50. </section>
  51. <section v-if="stepInfo.method === 'shaking' || stepInfo.method === 'delay'" class="right-shaking">
  52. <div class="flex items-center right-base">
  53. <el-input v-model.number="stepInfo.params.second" style="width: 100px" size="small" class="right-base" />
  54. <span class="ml-2"></span>
  55. </div>
  56. </section>
  57. <section v-if="stepInfo.method === 'startHeating'" class="right-shaking">
  58. <div class="flex items-center right-base">
  59. 加热温度<el-input v-model.number="stepInfo.params.temperature" style="width: 100px" size="small" />
  60. <span class="ml-2">°C</span>
  61. </div>
  62. </section>
  63. </template>
  64. </div>
  65. <div style="height:5px;background: white;" />
  66. </template>
  67. <style lang="scss" scoped>
  68. .right-contaner{
  69. background-color: rgb(82 148 215 / .06);
  70. border-radius: 10px;
  71. }
  72. .right-main{
  73. display: flex;
  74. align-items: center;
  75. }
  76. .right-base{
  77. font-size: 1rem;
  78. line-height: 1.5rem;
  79. margin-left: 1.25rem;
  80. }
  81. .text-item{
  82. margin-left: auto;
  83. width: 2.5rem;
  84. height: 2.5rem;
  85. display: flex;
  86. justify-content: center;
  87. align-items: center;
  88. .item-img{
  89. width:1rem
  90. }
  91. }
  92. .right-liquid{
  93. display: flex;
  94. height: 2.5rem;
  95. }
  96. .right-shaking{
  97. display: flex;
  98. height: 2.5rem;
  99. }
  100. .right-seq{
  101. padding-left: 20px;
  102. color: #19b370;
  103. }
  104. .el-select-dropdown__item{
  105. display: flex;
  106. align-items: center;
  107. }
  108. </style>