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

417 lines
9.9 KiB

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