消毒机设备
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.

202 lines
4.6 KiB

2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
  1. <script lang="ts" setup>
  2. import { useSealStore } from '@/stores/sealStore'
  3. import homeFinish from 'assets/images/home/home-finish.svg'
  4. import homeStart from 'assets/images/home/home-start.svg'
  5. import SealInstrumentSvg from 'assets/images/seal/seal-instrument.svg'
  6. import DashboardChart from 'components/seal/DashboardChart.vue'
  7. import { ref, watch } from 'vue'
  8. const sealStore = useSealStore()
  9. const sealState = ref(sealStore.sealState)
  10. watch(() => sealStore.sealState, (newVal) => {
  11. sealState.value = newVal
  12. })
  13. // const pressure = ref()
  14. const onStartTest = () => {
  15. // 此处轮询获取密封测试状态
  16. sealStore.updateSealState('initDevice')
  17. }
  18. const onFinishTest = () => {
  19. sealStore.updateSealState('idle')
  20. }
  21. </script>
  22. <template>
  23. <div class="dashboard-container">
  24. <main class="main-content">
  25. <div class="seal-left">
  26. <!-- 仪表盘 -->
  27. <div class="seal-chart">
  28. <div class="chart-ml">
  29. <DashboardChart />
  30. </div>
  31. <div class="seal-opt">
  32. <div class="seal-status">
  33. <div class="seal-time-text">测试时间</div>
  34. <div class="seal-time-statue seal-time-text">
  35. 未开始
  36. </div>
  37. </div>
  38. <div class="seal-status">
  39. <div class="seal-diff-text">气压差值</div>
  40. <div class="seal-diff-statue seal-diff-text">
  41. 未开始
  42. </div>
  43. </div>
  44. </div>
  45. </div>
  46. </div>
  47. <div class="seal-right">
  48. <div class="left-title">
  49. <div class="title-text-test">
  50. <img :src="SealInstrumentSvg" alt="仪表盘">
  51. <div class="title-text">
  52. 测试前气压
  53. </div>
  54. <div class="title-text title-text-kpa">
  55. <span>2</span>
  56. <span class="title-kpa-pl">KPa</span>
  57. </div>
  58. </div>
  59. </div>
  60. <div class="seal-right-btn">
  61. <div>
  62. <div class="seal-add-btn seal-start" :class="{ 'seal-start-show': sealState !== 'idle' }" @click="onStartTest">
  63. <img :src="homeStart" alt="">
  64. <div>启动测试</div>
  65. </div>
  66. <div class="seal-add-btn seal-stop" :class="{ 'seal-stop-show': sealState !== 'idle' }" @click="onFinishTest">
  67. <img :src="homeFinish" alt="">
  68. <div>停止测试</div>
  69. </div>
  70. </div>
  71. </div>
  72. </div>
  73. </main>
  74. </div>
  75. </template>
  76. <style lang="scss" scoped>
  77. .main-content{
  78. display: grid;
  79. grid-template-columns: repeat(3,1fr);
  80. height: 100%;
  81. gap: 10px;
  82. height: 100%;
  83. .seal-left{
  84. background: #FFFFFF;
  85. grid-column: 1 / 3;
  86. box-shadow: 0px 1px 5px 0px rgba(9, 39, 62, 0.15);
  87. background: $gradient-color;
  88. .seal-chart{
  89. margin-left: 1rem;
  90. }
  91. .chart-ml{
  92. margin: 3rem;
  93. height: 25rem;
  94. }
  95. }
  96. }
  97. .seal-opt{
  98. display: flex;
  99. justify-content: center;
  100. margin-top: 8vh;
  101. gap: 2rem;
  102. .seal-status{
  103. display: flex;
  104. justify-content: center;
  105. align-items: center;
  106. background: #F6FAFE;
  107. width: 15rem;
  108. height: 5rem;
  109. border-radius: 15px;
  110. }
  111. .seal-time-text{
  112. font-size: 1.5rem;
  113. font-weight: 500;
  114. padding-left: 0.5rem;
  115. }
  116. .seal-time-statue{
  117. height: 3rem;
  118. width: 5rem;
  119. display: flex;
  120. justify-content: center;
  121. align-items: center;
  122. font-weight: 600;
  123. }
  124. .seal-diff-text{
  125. font-size: 1.5rem;
  126. font-weight: 500;
  127. padding-left: 0.5rem;
  128. }
  129. .seal-diff-statue{
  130. height: 3rem;
  131. width: 5rem;
  132. display: flex;
  133. justify-content: center;
  134. align-items: center;
  135. font-weight: 600;
  136. }
  137. }
  138. .seal-add-btn{
  139. width: 24vw;
  140. height: 8vh;
  141. border-radius: 12px;
  142. color: #FFFFFF;
  143. display: flex;
  144. align-items: center;
  145. justify-content: center;
  146. font-size: 24px;
  147. gap: 10px;
  148. margin: 2rem;
  149. }
  150. .seal-start{
  151. background: #31CB7A;
  152. }
  153. .seal-start-show{
  154. background: #e6e6e6;
  155. }
  156. .seal-stop{
  157. background: #e8e8e8;
  158. }
  159. .seal-stop-show {
  160. background: #FF6767;
  161. }
  162. .seal-right{
  163. background: $gradient-color;
  164. display: grid;
  165. grid-template-rows: 1fr 1fr 1fr;
  166. .seal-right-btn{
  167. display: flex;
  168. justify-content: center;
  169. align-items: center;
  170. }
  171. .left-title{
  172. padding-top: 3.5vw;
  173. padding-left: 3.5vw;
  174. display: flex;
  175. .title-text-test{
  176. display: flex;
  177. justify-content: center;
  178. align-items: center;
  179. gap: 1rem;
  180. .title-text{
  181. font-size: 20px;
  182. }
  183. .title-text-kpa{
  184. color: #409EFF;
  185. }
  186. .title-kpa-pl{
  187. padding-left: 5px;
  188. font-weight: bold;
  189. }
  190. }
  191. }
  192. }
  193. </style>