小空间消毒机
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.

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