拉杆箱消毒机
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.

976 lines
24 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. <template>
  2. <div class="update_device_container">
  3. <div class="row_wrap">
  4. <p class="title">消毒停止过氧化氢浓度(ppm)</p>
  5. <p class="num">
  6. <van-field
  7. class="field_font"
  8. type="number"
  9. v-model="stoped_gs"
  10. :clickable="true"
  11. :formatter="formatter1"
  12. readonly
  13. @click.stop="hideClickKey(3)"
  14. />
  15. </p>
  16. </div>
  17. <div class="row_wrap">
  18. <p class="title">消毒继续过氧化氢浓度(ppm)</p>
  19. <p class="num">
  20. <van-field
  21. type="number"
  22. class="field_font"
  23. v-model="continued_gs"
  24. :clickable="true"
  25. :formatter="formatter2"
  26. readonly
  27. @click.stop="hideClickKey(4)"
  28. />
  29. </p>
  30. </div>
  31. <div class="row_wrap">
  32. <p class="title">消毒停止相对湿度(%RH)</p>
  33. <p class="num">
  34. <van-field
  35. type="number"
  36. class="field_font"
  37. v-model="stoped_humi"
  38. :clickable="true"
  39. :formatter="formatter9"
  40. readonly
  41. @click.stop="hideClickKey(9)"
  42. />
  43. </p>
  44. </div>
  45. <div class="row_wrap">
  46. <p class="title">消毒继续相对湿度(%RH)</p>
  47. <p class="num">
  48. <van-field
  49. type="number"
  50. class="field_font"
  51. v-model="continued_humi"
  52. :clickable="true"
  53. :formatter="formatter10"
  54. readonly
  55. @click.stop="hideClickKey(10)"
  56. />
  57. </p>
  58. </div>
  59. <div class="row_wrap">
  60. <p class="title">消毒停止过氧化氢相对饱和度(%RS)</p>
  61. <p class="num">
  62. <van-field
  63. type="number"
  64. class="field_font"
  65. :formatter="formatter3"
  66. v-model="stoped_satur"
  67. :clickable="true"
  68. readonly
  69. @click.stop="hideClickKey(5)"
  70. />
  71. </p>
  72. </div>
  73. <div class="row_wrap">
  74. <p class="title">消毒继续过氧化氢相对饱和度(%RS)</p>
  75. <p class="num">
  76. <van-field
  77. type="number"
  78. class="field_font"
  79. :formatter="formatter4"
  80. v-model="continued_satur"
  81. :clickable="true"
  82. readonly
  83. @click.stop="hideClickKey(6)"
  84. />
  85. </p>
  86. </div>
  87. <div class="row_wrap">
  88. <p class="title">注射蠕动泵速率(g/min)</p>
  89. <p class="num">
  90. <van-field
  91. type="number"
  92. class="field_font"
  93. v-model="sprayLiquidConfigVal"
  94. :clickable="true"
  95. :formatter="formatter7"
  96. readonly
  97. @click.stop="hideClickKey(2)"
  98. />
  99. </p>
  100. </div>
  101. <div class="row_wrap">
  102. <p class="title">风机速度(%)</p>
  103. <p class="num">
  104. <van-field
  105. type="number"
  106. class="field_font"
  107. :formatter="formatter12"
  108. v-model="draughtFanValue"
  109. :clickable="true"
  110. readonly
  111. @click.stop="hideClickKey(12)"
  112. />
  113. </p>
  114. </div>
  115. <div class="row_wrap" @click="showLogPicker">
  116. <p class="title">Log等级</p>
  117. <div class="num">
  118. <p class="log">{{ logVal }}</p>
  119. </div>
  120. </div>
  121. <div class="row_wrap">
  122. <p class="title">配方名称</p>
  123. <div>
  124. <input
  125. id="id_formula"
  126. v-model="formula_id"
  127. class="formula_input"
  128. placeholder="请输入配方名称"
  129. type="text"
  130. name=""
  131. />
  132. </div>
  133. </div>
  134. <van-number-keyboard
  135. v-model="addLiquidConfigVal"
  136. :title="addLiquidConfigVal"
  137. :show="addLiquidConfigValShow"
  138. @input="val => handleInput(val, 1)"
  139. theme="custom"
  140. close-button-text="确定"
  141. @close="setAddliquidVal"
  142. @blur="addLiquidConfigValShow = false"
  143. />
  144. <van-number-keyboard
  145. v-model="sprayLiquidConfigVal"
  146. @input="val => handleInput(val, 2)"
  147. :title="sprayLiquidConfigVal"
  148. :show="sprayLiquidConfigValShow"
  149. theme="custom"
  150. @close="setSprayLiquidVal"
  151. close-button-text="确定"
  152. @blur="sprayLiquidConfigValShow = false"
  153. />
  154. <van-number-keyboard
  155. v-model="stoped_gs"
  156. @input="val => handleInput(val, 3)"
  157. :title="stoped_gs"
  158. :show="stoped_gsShow"
  159. theme="custom"
  160. @close="setStopedGsVal"
  161. close-button-text="确定"
  162. @blur="stoped_gsShow = false"
  163. />
  164. <van-number-keyboard
  165. v-model="continued_gs"
  166. @input="val => handleInput(val, 4)"
  167. :title="continued_gs"
  168. @close="setcontinuedGsVal"
  169. :show="continued_gsShow"
  170. theme="custom"
  171. close-button-text="确定"
  172. @blur="continued_gsShow = false"
  173. />
  174. <van-number-keyboard
  175. v-model="stoped_satur"
  176. @input="val => handleInput(val, 5)"
  177. :title="stoped_satur"
  178. @close="setstopedSaturVal"
  179. :show="stoped_saturShow"
  180. theme="custom"
  181. close-button-text="确定"
  182. @blur="stoped_saturShow = false"
  183. />
  184. <van-number-keyboard
  185. v-model="continued_satur"
  186. @input="val => handleInput(val, 6)"
  187. :title="continued_satur"
  188. @close="setContinuedSaturVal"
  189. :show="continued_saturShow"
  190. theme="custom"
  191. close-button-text="确定"
  192. @blur="continued_saturShow = false"
  193. />
  194. <van-number-keyboard
  195. v-model="max_humidity"
  196. @input="val => handleInput(val, 7)"
  197. :title="max_humidity"
  198. @close="setMaxHumidityVal"
  199. :show="max_humidityShow"
  200. theme="custom"
  201. close-button-text="确定"
  202. @blur="max_humidityShow = false"
  203. />
  204. <van-number-keyboard
  205. theme="custom"
  206. close-button-text="确定"
  207. @input="val => handleInput(val, 8)"
  208. @close="setHeat_timeVal"
  209. v-model="pre_heat_time_s"
  210. :title="pre_heat_time_s"
  211. :show="pre_heat_time_sShow"
  212. @blur="pre_heat_time_sShow = false"
  213. />
  214. <van-number-keyboard
  215. @input="val => handleInput(val, 9)"
  216. theme="custom"
  217. close-button-text="确定"
  218. @close="setstoped_humiVal"
  219. v-model="stoped_humi"
  220. :title="stoped_humi"
  221. :show="stoped_humiShow"
  222. @blur="stoped_humiShow = false"
  223. />
  224. <van-number-keyboard
  225. theme="custom"
  226. @input="val => handleInput(val, 10)"
  227. close-button-text="确定"
  228. @close="setcontinued_humiVal"
  229. v-model="continued_humi"
  230. :title="continued_humi"
  231. :show="continued_humiShow"
  232. @blur="continued_humiShow = false"
  233. />
  234. <van-number-keyboard
  235. theme="custom"
  236. @input="val => handleInput(val, 12)"
  237. close-button-text="配置"
  238. @close="setDraughtFanValue"
  239. v-model="draughtFanValue"
  240. :title="draughtFanValue"
  241. :show="draughtFanShow"
  242. @blur="draughtFanShow = false"
  243. />
  244. <LogPicker
  245. v-if="logVisible"
  246. :hiddenLogVisible="hiddenLogVisible"
  247. :changeLogVal="changeLogVal"
  248. :logVal="logVal"
  249. />
  250. <div class="btns">
  251. <div class="btn" @click="save">修改</div>
  252. <div class="btn ml" @click="hiddleSettingModal">返回</div>
  253. </div>
  254. <div class="key_wrap" v-show="showkeyboard" id="keyboard_formula">
  255. <SimpleKeyboard
  256. @onKeyPress="onKeyPress"
  257. @onChange="onChange"
  258. :input="formula_id"
  259. />
  260. </div>
  261. </div>
  262. </template>
  263. <script setup>
  264. import { ref, onMounted, watch } from 'vue'
  265. import SimpleKeyboard from 'cpns/SimpleKeyboard'
  266. import { showSuccessToast, showFailToast } from 'vant'
  267. import {
  268. useSettingStore,
  269. useWebSocketStore,
  270. useOperatorStore,
  271. useFormulaStore,
  272. } from '@/store'
  273. import { storeToRefs } from 'pinia'
  274. import {
  275. setSettingValJSON,
  276. addFormulaJSON,
  277. getAllFormulaJSON,
  278. updateAllFormulaJSON,
  279. updateFormulaJSON,
  280. } from '@/mock/command'
  281. import LogPicker from 'cpns/dialogs/LogPicker'
  282. const settingStore = useSettingStore()
  283. const webSocketStore = useWebSocketStore()
  284. const operatorStore = useOperatorStore()
  285. const formulaStore = useFormulaStore()
  286. const max_humidity = ref('0')
  287. const continued_satur = ref(props.formulaInfo.continued_satur)
  288. const stoped_satur = ref(props.formulaInfo.stoped_satur)
  289. const continued_gs = ref(props.formulaInfo.continued_gs)
  290. const stoped_gs = ref(props.formulaInfo.stoped_gs)
  291. const addLiquidConfigVal = ref('0')
  292. const sprayLiquidConfigVal = ref(props.formulaInfo.injection_pump_speed)
  293. const stoped_humi = ref(props.formulaInfo.stoped_humi)
  294. const continued_humi = ref(props.formulaInfo.continued_humi)
  295. const pre_heat_time_s = ref('0')
  296. const draughtFanValue = ref('0')
  297. const pre_heat_time_sShow = ref(false)
  298. const addLiquidConfigValShow = ref(false)
  299. const sprayLiquidConfigValShow = ref(false)
  300. const stoped_gsShow = ref(false)
  301. const continued_gsShow = ref(false)
  302. const stoped_saturShow = ref(false)
  303. const continued_saturShow = ref(false)
  304. const max_humidityShow = ref(false)
  305. const stoped_humiShow = ref(false)
  306. const continued_humiShow = ref(false)
  307. const draughtFanShow = ref(false)
  308. const logVisible = ref(false)
  309. const logVal = ref(props.formulaInfo.loglevel)
  310. const formula_id = ref(props.formulaInfo.formula_id)
  311. // watch(formula_id, (newValue, oldValue) => {
  312. // if (newValue != '') {
  313. // // webSocketStore.sendCommandMsg(
  314. // // updateFormulaJSON('formula_id', newValue, props.formulaInfo.id),
  315. // // )
  316. // }
  317. // })
  318. const onKeyPress = button => {
  319. if (button == '{bksp}') {
  320. formula_id.value = formula_id.value.substr(0, formula_id.value.length - 1)
  321. }
  322. }
  323. const save = () => {
  324. if (formula_id.value == '') {
  325. showFailToast('配方名称不能为空')
  326. return
  327. }
  328. const data = {
  329. id: props.formulaInfo.id,
  330. formula_id: formula_id.value,
  331. loglevel: parseInt(logVal.value),
  332. injection_pump_speed: parseInt(sprayLiquidConfigVal.value),
  333. stoped_gs: parseInt(stoped_gs.value),
  334. continued_gs: parseInt(continued_gs.value),
  335. stoped_satur: parseInt(stoped_satur.value),
  336. continued_satur: parseInt(continued_satur.value),
  337. stoped_humi: parseInt(stoped_humi.value),
  338. continued_humi: parseInt(continued_humi.value),
  339. draughtFanValue: parseInt(draughtFanValue.value),
  340. }
  341. console.log(data)
  342. webSocketStore.sendCommandMsg(updateAllFormulaJSON(data))
  343. webSocketStore.sendCommandMsg(getAllFormulaJSON)
  344. props.hideSettingModal()
  345. }
  346. const changeLogVal = val => {
  347. logVal.value = val
  348. logVisible.value = false
  349. // webSocketStore.sendCommandMsg(
  350. // updateFormulaJSON('loglevel', val, props.formulaInfo.id),
  351. // )
  352. }
  353. const hiddenLogVisible = () => {
  354. logVisible.value = false
  355. }
  356. const showLogPicker = () => {
  357. logVisible.value = true
  358. }
  359. const isFirstClick = ref(true)
  360. const props = defineProps({
  361. hideSettingModal: {
  362. type: Function,
  363. },
  364. formulaInfo: {
  365. type: Object,
  366. },
  367. })
  368. const hiddleSettingModal = () => {
  369. webSocketStore.sendCommandMsg(getAllFormulaJSON)
  370. props.hideSettingModal()
  371. }
  372. const hideClickKey = flag => {
  373. isFirstClick.value = true
  374. stoped_humiShow.value = false
  375. continued_humiShow.value = false
  376. pre_heat_time_sShow.value = false
  377. addLiquidConfigValShow.value = false
  378. sprayLiquidConfigValShow.value = false
  379. stoped_gsShow.value = false
  380. continued_gsShow.value = false
  381. stoped_saturShow.value = false
  382. continued_saturShow.value = false
  383. max_humidityShow.value = false
  384. if (flag == 1) {
  385. addLiquidConfigValShow.value = true
  386. }
  387. if (flag == 2) {
  388. sprayLiquidConfigValShow.value = true
  389. }
  390. if (flag == 3) {
  391. stoped_gsShow.value = true
  392. }
  393. if (flag == 4) {
  394. continued_gsShow.value = true
  395. }
  396. if (flag == 5) {
  397. stoped_saturShow.value = true
  398. }
  399. if (flag == 6) {
  400. continued_saturShow.value = true
  401. }
  402. if (flag == 7) {
  403. max_humidityShow.value = true
  404. }
  405. if (flag == 8) {
  406. pre_heat_time_sShow.value = true
  407. }
  408. if (flag == 9) {
  409. stoped_humiShow.value = true
  410. }
  411. if (flag == 10) {
  412. continued_humiShow.value = true
  413. }
  414. if (flag == 12) {
  415. draughtFanShow.value = true
  416. }
  417. }
  418. const handleInput = (value, index) => {
  419. if (isFirstClick.value) {
  420. if (index == 1) {
  421. setTimeout(() => {
  422. addLiquidConfigVal.value = value + ''
  423. })
  424. }
  425. if (index == 2) {
  426. setTimeout(() => {
  427. sprayLiquidConfigVal.value = value + ''
  428. })
  429. }
  430. if (index == 3) {
  431. setTimeout(() => {
  432. stoped_gs.value = value + ''
  433. })
  434. }
  435. if (index == 4) {
  436. setTimeout(() => {
  437. continued_gs.value = value + ''
  438. })
  439. }
  440. if (index == 5) {
  441. setTimeout(() => {
  442. stoped_satur.value = value + ''
  443. })
  444. }
  445. if (index == 6) {
  446. setTimeout(() => {
  447. continued_satur.value = value + ''
  448. })
  449. }
  450. if (index == 7) {
  451. setTimeout(() => {
  452. max_humidity.value = value + ''
  453. })
  454. }
  455. if (index == 8) {
  456. setTimeout(() => {
  457. pre_heat_time_s.value = value + ''
  458. })
  459. }
  460. if (index == 9) {
  461. setTimeout(() => {
  462. stoped_humi.value = value + ''
  463. })
  464. }
  465. if (index == 10) {
  466. setTimeout(() => {
  467. continued_humi.value = value + ''
  468. })
  469. }
  470. if (index == 12) {
  471. setTimeout(() => {
  472. draughtFanValue.value = value + ''
  473. })
  474. }
  475. isFirstClick.value = false
  476. }
  477. }
  478. const formatter1 = value => {
  479. if (parseInt(value) == 0) {
  480. return '0'
  481. }
  482. let arr = settingStore.allSettingList.filter(item => item.name == 'stoped_gs')
  483. if (arr && arr.length > 0) {
  484. if (parseInt(value) > arr[0].val_upper_limit) {
  485. return arr[0].val_upper_limit + ''
  486. }
  487. if (parseInt(value) < arr[0].val_lower_limit) {
  488. return arr[0].val_lower_limit + ''
  489. }
  490. }
  491. if (value == '') {
  492. return '0'
  493. }
  494. return value.replace(/^0+/gi, '')
  495. }
  496. const formatter2 = value => {
  497. if (parseInt(value) == 0) {
  498. return '0'
  499. }
  500. let arr = settingStore.allSettingList.filter(
  501. item => item.name == 'continued_gs',
  502. )
  503. if (arr && arr.length > 0) {
  504. if (parseInt(value) > arr[0].val_upper_limit) {
  505. return arr[0].val_upper_limit + ''
  506. }
  507. if (parseInt(value) < arr[0].val_lower_limit) {
  508. return arr[0].val_lower_limit + ''
  509. }
  510. }
  511. if (value == '') {
  512. return '0'
  513. }
  514. return value.replace(/^0+/gi, '')
  515. }
  516. const formatter3 = value => {
  517. if (parseInt(value) == 0) {
  518. return '0'
  519. }
  520. let arr = settingStore.allSettingList.filter(
  521. item => item.name == 'stoped_satur',
  522. )
  523. if (arr && arr.length > 0) {
  524. if (parseInt(value) > arr[0].val_upper_limit) {
  525. return arr[0].val_upper_limit + ''
  526. }
  527. if (parseInt(value) < arr[0].val_lower_limit) {
  528. return arr[0].val_lower_limit + ''
  529. }
  530. }
  531. if (value == '') {
  532. return '0'
  533. }
  534. return value.replace(/^0+/gi, '')
  535. }
  536. const formatter4 = value => {
  537. if (parseInt(value) == 0) {
  538. return '0'
  539. }
  540. let arr = settingStore.allSettingList.filter(
  541. item => item.name == 'continued_satur',
  542. )
  543. if (arr && arr.length > 0) {
  544. if (parseInt(value) > arr[0].val_upper_limit) {
  545. return arr[0].val_upper_limit + ''
  546. }
  547. if (parseInt(value) < arr[0].val_lower_limit) {
  548. return arr[0].val_lower_limit + ''
  549. }
  550. }
  551. if (value == '') {
  552. return '0'
  553. }
  554. return value.replace(/^0+/gi, '')
  555. }
  556. const formatter5 = value => {
  557. if (parseInt(value) == 0) {
  558. return '0'
  559. }
  560. let arr = settingStore.allSettingList.filter(
  561. item => item.name == 'max_humidity',
  562. )
  563. if (arr && arr.length > 0) {
  564. if (parseInt(value) > arr[0].val_upper_limit) {
  565. return arr[0].val_upper_limit + ''
  566. }
  567. if (parseInt(value) < arr[0].val_lower_limit) {
  568. return arr[0].val_lower_limit + ''
  569. }
  570. }
  571. if (value == '') {
  572. return '0'
  573. }
  574. return value.replace(/^0+/gi, '')
  575. }
  576. const formatter6 = value => {
  577. if (parseInt(value) == 0) {
  578. return '0'
  579. }
  580. let arr = settingStore.allSettingList.filter(
  581. item => item.name == 'drainage_pump_speed',
  582. )
  583. if (arr && arr.length > 0) {
  584. if (parseInt(value) > arr[0].val_upper_limit) {
  585. return arr[0].val_upper_limit + ''
  586. }
  587. if (parseInt(value) < arr[0].val_lower_limit) {
  588. return arr[0].val_lower_limit + ''
  589. }
  590. }
  591. if (value == '') {
  592. return '0'
  593. }
  594. return value.replace(/^0+/gi, '')
  595. }
  596. const formatter12 = value => {
  597. if (parseInt(value) == 0) {
  598. return '0'
  599. }
  600. let arr = settingStore.allSettingList.filter(
  601. item => item.name == 'draughtFanValue',
  602. )
  603. if (arr && arr.length > 0) {
  604. if (parseInt(value) > arr[0].val_upper_limit) {
  605. return arr[0].val_upper_limit + ''
  606. }
  607. if (parseInt(value) < arr[0].val_lower_limit) {
  608. return arr[0].val_lower_limit + ''
  609. }
  610. }
  611. if (value == '') {
  612. return '0'
  613. }
  614. return value.replace(/^0+/gi, '')
  615. }
  616. const formatter7 = value => {
  617. if (parseInt(value) == 0) {
  618. return '0'
  619. }
  620. let arr = settingStore.allSettingList.filter(
  621. item => item.name == 'injection_pump_speed',
  622. )
  623. if (arr && arr.length > 0) {
  624. if (parseInt(value) > arr[0].val_upper_limit) {
  625. return arr[0].val_upper_limit + ''
  626. }
  627. if (parseInt(value) < arr[0].val_lower_limit) {
  628. return arr[0].val_lower_limit + ''
  629. }
  630. }
  631. if (value == '') {
  632. return '0'
  633. }
  634. return value.replace(/^0+/gi, '')
  635. }
  636. const formatter8 = value => {
  637. if (parseInt(value) == 0) {
  638. return '0'
  639. }
  640. let arr = settingStore.allSettingList.filter(
  641. item => item.name == 'pre_heat_time_s',
  642. )
  643. if (arr && arr.length > 0) {
  644. if (parseInt(value) > arr[0].val_upper_limit) {
  645. return arr[0].val_upper_limit + ''
  646. }
  647. if (parseInt(value) < arr[0].val_lower_limit) {
  648. return arr[0].val_lower_limit + ''
  649. }
  650. }
  651. if (value == '') {
  652. return '0'
  653. }
  654. return value.replace(/^0+/gi, '')
  655. }
  656. const formatter9 = value => {
  657. if (parseInt(value) == 0) {
  658. return '0'
  659. }
  660. let arr = settingStore.allSettingList.filter(
  661. item => item.name == 'stoped_humi',
  662. )
  663. if (arr && arr.length > 0) {
  664. if (parseInt(value) > arr[0].val_upper_limit) {
  665. return arr[0].val_upper_limit + ''
  666. }
  667. if (parseInt(value) < arr[0].val_lower_limit) {
  668. return arr[0].val_lower_limit + ''
  669. }
  670. }
  671. if (value == '') {
  672. return '0'
  673. }
  674. return value.replace(/^0+/gi, '')
  675. }
  676. const formatter10 = value => {
  677. if (parseInt(value) == 0) {
  678. return '0'
  679. }
  680. let arr = settingStore.allSettingList.filter(
  681. item => item.name == 'continued_humi',
  682. )
  683. if (arr && arr.length > 0) {
  684. if (parseInt(value) > arr[0].val_upper_limit) {
  685. return arr[0].val_upper_limit + ''
  686. }
  687. if (parseInt(value) < arr[0].val_lower_limit) {
  688. return arr[0].val_lower_limit + ''
  689. }
  690. }
  691. if (value == '') {
  692. return '0'
  693. }
  694. return value.replace(/^0+/gi, '')
  695. }
  696. const setAddliquidVal = () => {
  697. const val = parseInt(addLiquidConfigVal.value)
  698. if (isNaN(val)) {
  699. showFailToast('设置失败,请填写正确参数')
  700. return
  701. }
  702. }
  703. const setDraughtFanValue = () => {
  704. const val = parseInt(draughtFanValue.value)
  705. if (isNaN(val)) {
  706. showFailToast('设置失败,请填写正确参数')
  707. return
  708. }
  709. }
  710. const setStopedGsVal = () => {
  711. const val = parseInt(stoped_gs.value)
  712. if (isNaN(val)) {
  713. showFailToast('设置失败,请填写正确参数')
  714. return
  715. } else {
  716. // webSocketStore.sendCommandMsg(
  717. // updateFormulaJSON('stoped_gs', val, props.formulaInfo.id),
  718. // )
  719. }
  720. }
  721. const setcontinuedGsVal = () => {
  722. const val = parseInt(continued_gs.value)
  723. if (isNaN(val)) {
  724. showFailToast('设置失败,请填写正确参数')
  725. return
  726. } else {
  727. // webSocketStore.sendCommandMsg(
  728. // updateFormulaJSON('continued_gs', val, props.formulaInfo.id),
  729. // )
  730. }
  731. }
  732. const setstopedSaturVal = () => {
  733. const val = parseInt(stoped_satur.value)
  734. if (isNaN(val)) {
  735. showFailToast('设置失败,请填写正确参数')
  736. return
  737. } else {
  738. // webSocketStore.sendCommandMsg(
  739. // updateFormulaJSON('stoped_satur', val, props.formulaInfo.id),
  740. // )
  741. }
  742. }
  743. const setContinuedSaturVal = () => {
  744. const val = parseInt(continued_satur.value)
  745. if (isNaN(val)) {
  746. showFailToast('设置失败,请填写正确参数')
  747. return
  748. } else {
  749. // webSocketStore.sendCommandMsg(
  750. // updateFormulaJSON('continued_satur', val, props.formulaInfo.id),
  751. // )
  752. }
  753. }
  754. const setMaxHumidityVal = () => {
  755. const val = parseInt(max_humidity.value)
  756. if (isNaN(val)) {
  757. showFailToast('设置失败,请填写正确参数')
  758. return
  759. }
  760. }
  761. const setHeat_timeVal = () => {
  762. const val = parseInt(pre_heat_time_s.value)
  763. if (isNaN(val)) {
  764. showFailToast('设置失败,请填写正确参数')
  765. return
  766. }
  767. }
  768. const setstoped_humiVal = () => {
  769. const val = parseInt(stoped_humi.value)
  770. if (isNaN(val)) {
  771. showFailToast('设置失败,请填写正确参数')
  772. return
  773. } else {
  774. // webSocketStore.sendCommandMsg(
  775. // updateFormulaJSON('stoped_humi', val, props.formulaInfo.id),
  776. // )
  777. }
  778. }
  779. const setcontinued_humiVal = () => {
  780. const val = parseInt(continued_humi.value)
  781. if (isNaN(val)) {
  782. showFailToast('设置失败,请填写正确参数')
  783. return
  784. } else {
  785. // webSocketStore.sendCommandMsg(
  786. // updateFormulaJSON('continued_humi', val, props.formulaInfo.id),
  787. // )
  788. }
  789. }
  790. const setSprayLiquidVal = () => {
  791. const val = parseInt(sprayLiquidConfigVal.value)
  792. if (isNaN(val)) {
  793. showFailToast('设置失败,请填写正确参数')
  794. return
  795. } else {
  796. // webSocketStore.sendCommandMsg(
  797. // updateFormulaJSON('injection_pump_speed', val, props.formulaInfo.id),
  798. // )
  799. }
  800. }
  801. const showkeyboard = ref(false)
  802. const onChange = a => {
  803. formula_id.value = a
  804. }
  805. const handleShowKeyBoard = () => {
  806. showkeyboard.value = true
  807. }
  808. onMounted(() => {
  809. document.addEventListener('click', e => {
  810. let box = document.getElementById('keyboard_formula')
  811. let room = document.getElementById('id_formula')
  812. const arr = [
  813. 'hg-candidate-box-next',
  814. 'hg-candidate-box-btn-active',
  815. 'hg-candidate-box-prev',
  816. 'hg-candidate-box-list-item',
  817. ]
  818. if (
  819. !box?.contains(e.target) &&
  820. e.target != room &&
  821. !arr.includes(Array.from(e.target.classList)[0])
  822. ) {
  823. showkeyboard.value = false
  824. }
  825. })
  826. $('#id_formula').virtualkeyboard()
  827. })
  828. </script>
  829. <style lang="scss" scoped>
  830. .update_device_container {
  831. box-sizing: border-box;
  832. width: 100%;
  833. height: 580px;
  834. display: grid;
  835. overflow: hidden;
  836. grid-template-columns: repeat(2, 1fr);
  837. row-gap: 20px;
  838. column-gap: 20px;
  839. padding: 20px;
  840. padding-bottom: 180px;
  841. position: relative;
  842. .btns {
  843. position: absolute;
  844. right: 20px;
  845. bottom: 20px;
  846. width: 300px;
  847. height: 68px;
  848. display: flex;
  849. align-items: center;
  850. justify-content: flex-end;
  851. .btn {
  852. width: 111px;
  853. height: 38px;
  854. border-radius: 19px;
  855. background: #06518b;
  856. display: flex;
  857. align-items: center;
  858. justify-content: center;
  859. font-family: Source Han Sans CN;
  860. font-size: 14px;
  861. font-weight: normal;
  862. line-height: normal;
  863. letter-spacing: 0.1em;
  864. color: #ffffff;
  865. }
  866. .ml {
  867. margin-left: 20px;
  868. }
  869. }
  870. .row_wrap {
  871. // width: 726px;
  872. height: 80px;
  873. border-radius: 14px;
  874. background: #f6f6f6;
  875. box-sizing: border-box;
  876. padding: 0 18px 0 40px;
  877. display: flex;
  878. align-items: center;
  879. justify-content: space-between;
  880. .title {
  881. font-family: Zona Pro;
  882. white-space: nowrap;
  883. font-size: 20px;
  884. font-weight: normal;
  885. letter-spacing: 0.06em;
  886. color: #000000;
  887. }
  888. .num {
  889. font-family: Source Han Sans CN;
  890. font-size: 24px;
  891. font-weight: 500;
  892. letter-spacing: 0.1em;
  893. color: #000000;
  894. display: flex;
  895. align-items: center;
  896. .log {
  897. width: 182px;
  898. display: flex;
  899. align-items: center;
  900. justify-content: center;
  901. }
  902. .field_font {
  903. font-size: 26px;
  904. width: 180px;
  905. }
  906. }
  907. .formula_input {
  908. border: none;
  909. height: 38px;
  910. padding: 0 12px;
  911. width: 220px;
  912. font-size: 22px;
  913. }
  914. .btn {
  915. width: 87px;
  916. height: 45px;
  917. border-radius: 23px;
  918. background: #06518b;
  919. font-family: Source Han Sans CN;
  920. font-size: 14px;
  921. font-weight: normal;
  922. letter-spacing: 0.1em;
  923. color: #ffffff;
  924. display: flex;
  925. align-items: center;
  926. justify-content: center;
  927. }
  928. }
  929. .key_wrap {
  930. position: absolute;
  931. right: 97px;
  932. bottom: 0;
  933. height: 245px;
  934. width: 520px;
  935. }
  936. }
  937. </style>