管道式消毒机
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.

204 lines
6.6 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
  1. <template>
  2. <div class="air_switch_config_container">
  3. <div class="header">
  4. <svg
  5. xmlns="http://www.w3.org/2000/svg"
  6. xmlns:xlink="http://www.w3.org/1999/xlink"
  7. fill="none"
  8. version="1.1"
  9. width="28"
  10. height="28"
  11. viewBox="0 0 28 28"
  12. >
  13. <g>
  14. <path
  15. d="M14,0C6.26801,0,0,6.26802,0,14C0,21.732,6.26801,28,14,28C21.732,28,28,21.732,28,14C28,6.26802,21.732,0,14,0ZM9.10859,20.4807C9.097,21.0081,8.66847,21.431,8.14073,21.4356C7.6131,21.4405,7.17713,21.0253,7.15599,20.4979L7.15599,14.4761C7.15421,13.9358,7.59264,13.4974,8.1329,13.4992C8.39231,13.4979,8.64147,13.6004,8.8248,13.784C9.00814,13.9674,9.11035,14.2167,9.10859,14.4761L9.10859,20.4807ZM9.11277,16.4831L10.5775,16.4831L10.5775,13.9308C10.5771,12.598,11.3513,11.3866,12.5608,10.827C12.5414,10.7319,12.5318,10.635,12.5322,10.5379L12.5322,9.02199L8.39528,9.02199C8.06546,9.02229,7.74915,8.89097,7.51653,8.65716C7.2839,8.42333,7.15414,8.10636,7.15602,7.77653C7.15499,7.44753,7.2848,7.13161,7.51685,6.89839C7.74891,6.66514,8.06422,6.53379,8.39324,6.53331L19.6047,6.53331C19.935,6.53331,20.2516,6.66514,20.4843,6.89948C20.717,7.13381,20.8465,7.45138,20.844,7.78166C20.8444,8.46656,20.2895,9.02198,19.6047,9.02198L15.4668,9.02198L15.4668,10.5421C15.467,10.639,15.4581,10.7358,15.4401,10.831C16.6497,11.3886,17.4242,12.5989,17.4235,13.9308L17.4235,16.4831L18.8842,16.4831L18.8842,14.4761C18.8842,13.9363,19.3218,13.4987,19.8614,13.4987C20.4013,13.4987,20.8389,13.9363,20.8389,14.4761L20.8389,20.4847C20.8414,21.0244,20.4058,21.4641,19.8661,21.4667C19.3263,21.4691,18.8867,21.0336,18.8842,20.4939L18.8842,18.9728L18.8893,18.9728L18.8893,16.4831L18.8842,16.4831L18.8842,18.9697L17.2923,18.9697C16.8744,20.4411,15.5307,21.4564,14.001,21.4564C12.4714,21.4564,11.1276,20.441,10.7096,18.9697L9.11274,18.9697"
  16. fill="#FFFFFF"
  17. fill-opacity="1"
  18. />
  19. </g>
  20. </svg>
  21. <p class="title">选择空气阀配置</p>
  22. </div>
  23. <div class="opers_box">
  24. <div class="left_container">
  25. <div
  26. :class="activeTab == '1' ? 'tab mb active' : 'tab mb'"
  27. @click="changeTab('1')"
  28. >
  29. <p class="text">上管道</p>
  30. <div class="percent">{{ topText }}</div>
  31. <img :src="activeTab == 1 ? A2 : A1" class="icon" alt="" />
  32. </div>
  33. <div
  34. :class="activeTab == '2' ? 'tab active' : 'tab'"
  35. @click="changeTab('2')"
  36. >
  37. <p class="text">下管道</p>
  38. <div class="percent">{{ bottomText }}</div>
  39. <img :src="activeTab == 2 ? A2 : A1" class="icon" alt="" />
  40. </div>
  41. </div>
  42. <div class="right_container">
  43. <van-picker
  44. v-if="activeTab == 1"
  45. :columns="columns"
  46. :show-toolbar="false"
  47. visible-option-num="3"
  48. option-height="42"
  49. v-model="selectedValuesTop"
  50. @change="topChange"
  51. />
  52. <van-picker
  53. v-if="activeTab == 2"
  54. :columns="columns"
  55. :show-toolbar="false"
  56. visible-option-num="3"
  57. option-height="42"
  58. @change="bottomChange"
  59. v-model="selectedValuesBottom"
  60. />
  61. </div>
  62. </div>
  63. </div>
  64. </template>
  65. <script setup>
  66. import A1 from '@/assets/img/air/1.png'
  67. import A2 from '@/assets/img/air/2.png'
  68. import { useSealStore, useWebSocketStore } from '@/store'
  69. import {
  70. AirInletProportionalValve_setStateJSON,
  71. AirOutletProportionalValve_setStateJSON,
  72. } from '@/mock/command'
  73. import { ref } from 'vue'
  74. const activeTab = ref('1')
  75. const sealStore = useSealStore()
  76. const webSocketStore = useWebSocketStore()
  77. const changeTab = tab => {
  78. activeTab.value = tab
  79. }
  80. const topText = ref('0%')
  81. const bottomText = ref('0%')
  82. const topChange = ({ selectedOptions, selectedValues }) => {
  83. topText.value = selectedOptions[0].text
  84. webSocketStore.sendCommandMsg(
  85. AirInletProportionalValve_setStateJSON([parseInt(selectedValues[0]) * 10]),
  86. )
  87. sealStore.updateAirInletProportionalValue(parseInt(selectedValues[0]) * 10)
  88. }
  89. const bottomChange = ({ selectedOptions, selectedValues }) => {
  90. bottomText.value = selectedOptions[0].text
  91. webSocketStore.sendCommandMsg(
  92. AirOutletProportionalValve_setStateJSON([parseInt(selectedValues[0]) * 10]),
  93. )
  94. sealStore.updateAirOutletProportionalValue(parseInt(selectedValues[0]) * 10)
  95. }
  96. const columns = ref([
  97. { text: '0%', value: '0' },
  98. { text: '10%', value: '1' },
  99. { text: '20%', value: '2' },
  100. { text: '30%', value: '3' },
  101. { text: '40%', value: '4' },
  102. { text: '50%', value: '5' },
  103. { text: '60%', value: '6' },
  104. { text: '70%', value: '7' },
  105. { text: '80%', value: '8' },
  106. { text: '90%', value: '9' },
  107. { text: '100%', value: '10' },
  108. ])
  109. const selectedValuesTop = ref(['0'])
  110. const selectedValuesBottom = ref(['0'])
  111. </script>
  112. <style lang="scss" scoped>
  113. .air_switch_config_container {
  114. box-sizing: border-box;
  115. .header {
  116. display: flex;
  117. align-items: center;
  118. margin-bottom: 12px;
  119. .title {
  120. margin-left: 8px;
  121. font-family: 思源黑体;
  122. font-size: 24px;
  123. font-weight: 500;
  124. line-height: normal;
  125. letter-spacing: 0.06em;
  126. color: #ffffff;
  127. }
  128. }
  129. .opers_box {
  130. display: flex;
  131. align-items: center;
  132. height: 151px;
  133. justify-content: space-between;
  134. .left_container {
  135. width: 337px;
  136. height: 151px;
  137. .tab {
  138. width: 337px;
  139. height: 68px;
  140. border-radius: 6px;
  141. background: #1f6397;
  142. box-sizing: border-box;
  143. padding-left: 25px;
  144. padding-right: 22px;
  145. display: flex;
  146. align-items: center;
  147. justify-content: space-between;
  148. .text {
  149. font-family: 思源黑体;
  150. font-size: 16px;
  151. font-weight: normal;
  152. line-height: normal;
  153. letter-spacing: 0.06em;
  154. color: #ffffff;
  155. }
  156. .percent {
  157. width: 69px;
  158. height: 36px;
  159. border-radius: 8px;
  160. display: flex;
  161. align-items: center;
  162. justify-content: center;
  163. font-family: Source Han Sans;
  164. font-size: 20px;
  165. font-weight: bold;
  166. line-height: normal;
  167. letter-spacing: 0.06em;
  168. font-feature-settings: 'kern' on;
  169. color: #ffffff;
  170. }
  171. .icon {
  172. width: 22px;
  173. height: 22px;
  174. }
  175. }
  176. .active {
  177. .percent {
  178. background: #06518b;
  179. }
  180. }
  181. .mb {
  182. margin-bottom: 15px;
  183. }
  184. }
  185. .right_container {
  186. width: 339px;
  187. height: 146px;
  188. border-radius: 6px;
  189. box-sizing: border-box;
  190. background: #fff;
  191. overflow: hidden;
  192. }
  193. }
  194. }
  195. .van-ellipsis {
  196. font-size: 26px;
  197. }
  198. </style>