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.

161 lines
4.8 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
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 { getContainerList } from '@/apis/container'
  3. import { getSolsList } from '@/apis/solution'
  4. import { useSolutionStore } from '@/stores/useSolutionStore'
  5. import { onMounted, ref, watch } from 'vue'
  6. import { StepCmdDescMap, tubeSolList } from '../../views/craft/craft_constant'
  7. const props = defineProps<{
  8. order: number
  9. step: CraftTypes.StepStruct
  10. type: string
  11. }>()
  12. const $emit = defineEmits<{
  13. (e: 'del', order: number): void
  14. (e: 'transferChange', stepData: CraftTypes.StepStruct, order: number): void
  15. }>()
  16. const solutionStore = useSolutionStore()
  17. const stepInfo = ref(props.step)
  18. onMounted(() => {
  19. querySolutionList()
  20. })
  21. watch(stepInfo, (newVal) => {
  22. $emit('transferChange', newVal, props.order)
  23. }, {
  24. deep: true,
  25. })
  26. const solutionList = ref<Solution.SolutionItem[]>([])
  27. const querySolutionList = () => {
  28. getSolsList().then((res) => {
  29. if (res && res.list) {
  30. solutionList.value = res.list
  31. solutionStore.updateSolution(res.list)
  32. queryContainerList()
  33. }
  34. })
  35. }
  36. const containerLiquiedList = ref<Container.ContainerItem[]>([])
  37. const queryContainerList = () => {
  38. getContainerList().then((res) => {
  39. res.forEach((item) => {
  40. if (item.solutionId) {
  41. solutionList.value.forEach((soluItem) => {
  42. if (item.solutionId === soluItem.id) {
  43. containerLiquiedList.value.push({
  44. ...item,
  45. solutionName: soluItem.name,
  46. })
  47. }
  48. })
  49. }
  50. })
  51. })
  52. }
  53. </script>
  54. <template>
  55. <div class="right-container">
  56. <section class="right-main">
  57. <span class="right-seq">{{ order }}</span>
  58. <span class="right-base">{{ StepCmdDescMap[stepInfo.method] }}</span>
  59. <div v-if="type !== 'showlog'" class="text-item" @click="$emit('del', order)">
  60. <img class="item-img" src="@/assets/images/icon_del_s.svg" alt="del">
  61. </div>
  62. </section>
  63. <template v-if="stepInfo.method !== 'takePhoto'">
  64. <section v-if="stepInfo.method === 'addLiquid'" class="right-liquid right-base">
  65. <div v-for="(tubeItem, index) in stepInfo.params.tubeSolList" :key="index" class="right-liquid">
  66. <el-select v-model="tubeItem.tubeNum" size="small" placeholder="请选择" style="width: 120px" class="right-base" :disabled="type === 'showlog'">
  67. <el-option v-for="item in tubeSolList" :key="item.id" :label="item.name" :value="item.id" />
  68. </el-select>
  69. <div v-for="(liquidItem, liquidIndex) in tubeItem.addLiquidList" :key="liquidIndex" class="right-liquid right-base">
  70. <el-select v-model="liquidItem.solId" size="small" placeholder="请选择" style="width: 100px" class="right-base" :disabled="type === 'showlog'">
  71. <el-option v-for="item in containerLiquiedList" :key="item.id" :label="item.solutionName" :value="item.id" />
  72. </el-select>
  73. <div>
  74. <el-input v-model.number="liquidItem.volume" size="small" style="width: 100px" :disabled="type === 'showlog'" />
  75. <span class="mL-2">mL</span>
  76. </div>
  77. </div>
  78. </div>
  79. </section>
  80. <section v-if="stepInfo.method === 'shaking' || stepInfo.method === 'delay'" class="right-shaking">
  81. <div class="flex items-center right-base">
  82. <el-input v-model.number="stepInfo.params.second" style="width: 100px" size="small" class="right-base" :disabled="type === 'showlog'" />
  83. <span class="mL-2"></span>
  84. </div>
  85. </section>
  86. <section v-if="stepInfo.method === 'startHeating'" class="right-shaking">
  87. <div class="flex items-center right-base">
  88. 加热温度<el-input v-model.number="stepInfo.params.temperature" style="width: 100px" size="small" :disabled="type === 'showlog'" />
  89. <span class="mL-2">°C</span>
  90. </div>
  91. <div class="flex items-center right-base">
  92. 加热时间<el-input v-model.number="stepInfo.params.second" style="width: 100px" size="small" :disabled="type === 'showlog'" />
  93. <span class="mL-2"></span>
  94. </div>
  95. </section>
  96. </template>
  97. </div>
  98. <div style="height:5px;background: white;" />
  99. </template>
  100. <style lang="scss" scoped>
  101. div{
  102. font-size: 12px;
  103. }
  104. span{
  105. font-size: 12px;
  106. }
  107. .right-container{
  108. background-color: rgb(82 148 215 / .06);
  109. border-radius: 10px;
  110. min-height: 40px;
  111. padding-top: 5px;
  112. }
  113. .right-main{
  114. display: flex;
  115. align-items: center;
  116. }
  117. .right-base{
  118. line-height: 1.5rem;
  119. margin-left: 1.25rem;
  120. }
  121. .text-item{
  122. margin-left: auto;
  123. width: 2.5rem;
  124. height: 2.5rem;
  125. display: flex;
  126. justify-content: center;
  127. align-items: center;
  128. .item-img{
  129. width:1rem
  130. }
  131. }
  132. .right-liquid{
  133. display: flex;
  134. height: 3rem;
  135. }
  136. .right-shaking{
  137. display: flex;
  138. height: 2.5rem;
  139. }
  140. .right-seq{
  141. padding-left: 20px;
  142. color: #19b370;
  143. }
  144. .el-select-dropdown__item{
  145. display: flex;
  146. align-items: center;
  147. }
  148. </style>