石墨仪设备 前端仓库
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.

355 lines
7.9 KiB

6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
  1. <template>
  2. <div
  3. class="heat_main"
  4. :style="`${
  5. trayInfo.isSelect
  6. ? 'border:4px solid rgb(66 215 76)'
  7. : 'border:4px solid #ffffff'
  8. }`"
  9. >
  10. <section class="heat_pos_text">
  11. <div class="pos_text">{{ trayInfo.name }}</div>
  12. <div class="pos_text pos_state">已放置</div>
  13. </section>
  14. <section
  15. class="heat_pos"
  16. :style="`background:${trayInfo?.id ? '' : ''}`"
  17. @click="onSelectTray"
  18. >
  19. <div
  20. v-for="(tube, index) in trayInfo.tubeList || tubeList"
  21. :key="index"
  22. class="inner-circle"
  23. @click.stop="onHandleTube(tube)"
  24. :style="{ background: tube.color || 'rgb(212, 212, 212)' }"
  25. ></div>
  26. <!--执行中状态的遮罩层-->
  27. <div class="craft_executing_modal" v-if="trayInfo.state == 1">
  28. <div class="loading">
  29. <img :src="LoadingSvg" />
  30. </div>
  31. <div class="tray_craft">工艺名称</div>
  32. <div class="tray_exce">工艺执行中</div>
  33. </div>
  34. </section>
  35. <section class="heat_footer">
  36. <div class="heat_temperature" @click="setTemperature">
  37. <template v-if="trayInfo?.id">
  38. <div class="target_temp">目标温度: {{ trayInfo.temperature }}</div>
  39. <div class="heating">加热中</div>
  40. </template>
  41. <template v-else>
  42. <div class="target_temp set_temp">设置目标温度</div>
  43. </template>
  44. </div>
  45. <div class="flex items-center py-4 justify-between px-2">
  46. <div class="temp_text">120</div>
  47. <button
  48. class="btn-light text-sm px-4"
  49. @click="
  50. () => {
  51. onChooseCraft();
  52. }
  53. "
  54. >
  55. 选择
  56. </button>
  57. </div>
  58. </section>
  59. <OverlayModal :visible="tempVisible">
  60. <div class="set_temp_modal_content">
  61. <h3 class="set_temp_title">设定温度</h3>
  62. <section class="temp_label">
  63. <div class="text-xl">
  64. 目标温度<input
  65. type="number"
  66. v-model="heatAreaTemperature"
  67. class="temp_input"
  68. placeholder="请输入温度"
  69. />
  70. </div>
  71. <div class="text-xl temp_status flex">
  72. <div>到达温度后</div>
  73. <van-radio-group
  74. v-model="trayTempType"
  75. shape="square"
  76. class="flex temp_radio"
  77. >
  78. <van-radio name="1">保持温度</van-radio>
  79. <van-radio name="2">停止加热</van-radio>
  80. </van-radio-group>
  81. </div>
  82. </section>
  83. <footer
  84. class="h-[5.625rem] flex justify-center items-center text-sm font-medium gap-x-5"
  85. >
  86. <button class="btn-dark px-10 py-2 w-15" @click="onConfirm">
  87. 确定
  88. </button>
  89. <button class="btn-light px-10 py-2" @click="tempVisible = false">
  90. 取消
  91. </button>
  92. </footer>
  93. </div>
  94. </OverlayModal>
  95. <!--选择工艺-->
  96. <OverlayModal :visible="craftVisible">
  97. <CraftList @changeVisible="changeVisible" @selectedCraft="onHandleSelectedCraft"></CraftList>
  98. </OverlayModal>
  99. </div>
  100. </template>
  101. <script lang="ts" setup>
  102. import { computed, ref, watch, onMounted, onBeforeUnmount } from "vue";
  103. import OverlayModal from "@/components/OverlayModal.vue";
  104. import CraftList from "./CraftList.vue";
  105. import LoadingSvg from "@/assets/loading.svg";
  106. const tubeList = ref([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]);
  107. const props = defineProps({
  108. heatInfo: Object,
  109. tubeIndex: Number,
  110. });
  111. const emits = defineEmits(["onSelectedTray", "onSetHeatAreaTemp"]);
  112. onMounted(() => {});
  113. const craftVisible = ref(false);
  114. //设置温度
  115. const trayTempType = ref(false);
  116. const tempVisible = ref(false);
  117. //托盘信息
  118. let trayInfo = ref<any>(props.heatInfo || {});
  119. watch(()=>props.heatInfo, (newVal)=>{
  120. trayInfo.value = newVal
  121. })
  122. const heatAreaTemperature = ref(trayInfo.value.temperature || "");
  123. //选中托盘
  124. const isSelect = ref(false);
  125. const currentIndex = ref();
  126. const onSelectTray = () => {
  127. if (currentIndex.value !== props.tubeIndex) {
  128. trayInfo.value.isSelect = true;
  129. } else {
  130. trayInfo.value.isSelect = !trayInfo.value.isSelect;
  131. }
  132. currentIndex.value = props.tubeIndex;
  133. emits("onSelectedTray", trayInfo.value, 'isClick');
  134. };
  135. const changeVisible = () => {
  136. craftVisible.value = false;
  137. };
  138. //选择工艺
  139. const onChooseCraft = () => {
  140. craftVisible.value = true;
  141. };
  142. const setTemperature = () => {
  143. tempVisible.value = true;
  144. };
  145. const onConfirm = () => {
  146. trayInfo.value.temperature = heatAreaTemperature.value;
  147. tempVisible.value = false;
  148. //将设置的温度传给加热区
  149. emits("onSetHeatAreaTemp", trayInfo.value);
  150. };
  151. //试管操作
  152. const onHandleTube = (tubeInfo: any) => {
  153. //选择试管时判断试管架是否为选中状态
  154. if (!isSelect.value) onSelectTray();
  155. };
  156. //选择的工艺
  157. const onHandleSelectedCraft = (craftData:any) => {
  158. changeVisible();
  159. }
  160. </script>
  161. <style lang="scss" scoped>
  162. @use "@/assets/style/mixin.scss" as *;
  163. .heat_main {
  164. border: 1px solid #e9f3ff;
  165. width: 11.5rem;
  166. height: 18.125rem;
  167. border-radius: 10px;
  168. background: #e9f3ff;
  169. }
  170. .heat_pos_text {
  171. display: flex;
  172. height: 1.75rem;
  173. padding-left: 0.875rem;
  174. padding-right: 0.75rem;
  175. .pos_text {
  176. font-size: 0.8125rem;
  177. font-weight: 500;
  178. line-height: normal;
  179. display: flex;
  180. align-items: center;
  181. color: #4d6882;
  182. }
  183. .pos_state {
  184. margin-left: 50%;
  185. }
  186. }
  187. .heat_pos {
  188. width: 10.375rem;
  189. height: 10.375rem;
  190. display: flex;
  191. justify-content: center;
  192. flex-wrap: wrap;
  193. margin-left: 5px;
  194. gap: 0.625rem;
  195. flex-direction: row;
  196. border: 2px solid #7592a8;
  197. padding-top: 0.5rem;
  198. border-radius: 0.5rem;
  199. .craft_executing_modal {
  200. position: relative;
  201. width: 10rem;
  202. height: 18rem;
  203. background: rgba(2, 86, 255, 0.12);
  204. opacity: 0.5;
  205. z-index: 9999;
  206. margin-top: -11rem;
  207. .loading {
  208. margin-left: 4.2rem;
  209. margin-top: 4rem;
  210. }
  211. .tray_craft {
  212. font-size: 1rem;
  213. margin-top: 0.5rem;
  214. margin-left: 3rem;
  215. font-weight: bold;
  216. color: #4d6882;
  217. }
  218. .tray_exce {
  219. font-size: 1.2rem;
  220. margin-left: 1.8rem;
  221. font-weight: bold;
  222. color: #4d6882;
  223. }
  224. }
  225. }
  226. .inner-circle {
  227. border-radius: 50%;
  228. width: 1.625rem;
  229. height: 1.625rem;
  230. background-color: rgb(212, 212, 212);
  231. }
  232. .heat_footer {
  233. margin-top: 10px;
  234. margin-left: 5px;
  235. .heat_temperature {
  236. height: 1.625rem;
  237. width: 10rem;
  238. background: #ffffff;
  239. box-shadow: inset 2px 2px 4px 0px rgba(204, 204, 204, 0.3);
  240. border-radius: 5px;
  241. display: flex;
  242. align-items: center;
  243. justify-content: center;
  244. .target_temp {
  245. color: #384d5d;
  246. font-size: 0.75rem;
  247. }
  248. .heating {
  249. color: #fe0a0a;
  250. font-size: 0.875rem;
  251. margin-left: 1rem;
  252. }
  253. }
  254. .temp_text {
  255. font-size: 1.125rem;
  256. font-weight: bold;
  257. color: #4d6882;
  258. }
  259. }
  260. .heat_overlay {
  261. border: 1px solid #e9f3ff;
  262. width: 9.375rem;
  263. height: 15.5rem;
  264. border-radius: 20px;
  265. margin-top: 3.125rem;
  266. position: absolute;
  267. background: #d3d3d3;
  268. margin-top: -10.375rem;
  269. opacity: 0.8;
  270. .heat_loading {
  271. margin: 3.875rem;
  272. }
  273. }
  274. .formula_picker {
  275. width: 25rem;
  276. margin: 20% 30%;
  277. }
  278. .set_temp_modal {
  279. display: flex;
  280. justify-content: center;
  281. align-items: center;
  282. }
  283. .set_temp_modal_content {
  284. width: 28.5rem;
  285. height: 16.5rem;
  286. background: #ffffff;
  287. .temp_label {
  288. margin-left: 2.875rem;
  289. margin-top: 1rem;
  290. }
  291. .set_temp_title {
  292. height: 1.875rem;
  293. width: 5.25rem;
  294. margin-top: 1.875rem;
  295. margin-left: 1.25rem;
  296. font-size: 1.25rem;
  297. font-weight: 500;
  298. color: #40474e;
  299. }
  300. }
  301. .temp_input {
  302. border: 1px solid #dadada;
  303. font-size: 1.25rem;
  304. width: 10rem;
  305. }
  306. .temp_status {
  307. margin-top: 1.5rem;
  308. display: flex;
  309. gap: 20px;
  310. }
  311. .temp_radio {
  312. font-size: 1.25rem;
  313. display: flex;
  314. gap: 20px;
  315. }
  316. :deep(.van-radio__icon) {
  317. i {
  318. font-size: 30px;
  319. margin-top: -10px;
  320. }
  321. }
  322. </style>