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

134 lines
2.7 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. <template>
  2. <my-modal type="confirm" icon="warning"
  3. v-model:visible="visible"
  4. @ok="handleStart"
  5. @cancel="handleCancel"
  6. >
  7. <p class="tips"><span class="red">消毒正在进行中是否终止消毒</span></p>
  8. </my-modal>
  9. </template>
  10. <script setup>
  11. import { stopDisinfectionJSON } from '@/mock/command'
  12. import { useOperatorStore, useWebSocketStore } from '@/store'
  13. import { ref } from 'vue'
  14. const props = defineProps({
  15. hideDisinfectModal: {
  16. type: Function,
  17. },
  18. })
  19. const visible = ref(true)
  20. const operatorStore = useOperatorStore()
  21. const webSocketStore = useWebSocketStore()
  22. const handleCancel = () => {
  23. props.hideDisinfectModal()
  24. }
  25. const handleStart = () => {
  26. if ([1, 2, 3, 4].includes(operatorStore.disinfectStatus)) {
  27. operatorStore.updateStopReady(true)
  28. // 十秒以后隐藏遮罩
  29. setTimeout(() => {
  30. operatorStore.updateStopReady(false)
  31. }, 10000)
  32. webSocketStore.sendCommandMsg(stopDisinfectionJSON)
  33. props.hideDisinfectModal()
  34. }
  35. }
  36. </script>
  37. <style lang="scss" scoped>
  38. .tips {
  39. margin-top: 33px;
  40. margin-bottom: 50px;
  41. font-family: Source Han Sans CN;
  42. font-size: 21px;
  43. font-weight: normal;
  44. letter-spacing: 0.04em;
  45. color: #000000;
  46. .red {
  47. color: #fa1c1c;
  48. }
  49. }
  50. .disinfect_modal_container {
  51. position: fixed;
  52. top: 0;
  53. left: 0;
  54. right: 0;
  55. bottom: 0;
  56. background: rgba(0, 0, 0, 0.5);
  57. z-index: 2;
  58. display: flex;
  59. align-items: center;
  60. justify-content: center;
  61. .modal_content {
  62. width: 476px;
  63. height: 350px;
  64. border-radius: 16px;
  65. background: #ffffff;
  66. padding: 52px 37px 55px 37px;
  67. box-sizing: border-box;
  68. display: flex;
  69. flex-direction: column;
  70. align-items: center;
  71. .tips {
  72. margin-top: 33px;
  73. margin-bottom: 50px;
  74. font-family: Source Han Sans CN;
  75. font-size: 21px;
  76. font-weight: normal;
  77. letter-spacing: 0.04em;
  78. color: #000000;
  79. .red {
  80. color: #fa1c1c;
  81. }
  82. }
  83. .btns {
  84. display: flex;
  85. align-items: center;
  86. justify-content: space-between;
  87. width: 362px;
  88. .cancel {
  89. width: 173px;
  90. height: 68px;
  91. border-radius: 34px;
  92. background: #06518b;
  93. font-family: Source Han Sans CN;
  94. font-size: 23px;
  95. font-weight: 350;
  96. letter-spacing: 0em;
  97. color: #ffffff;
  98. display: flex;
  99. align-items: center;
  100. justify-content: center;
  101. }
  102. .ok {
  103. width: 173px;
  104. height: 68px;
  105. border-radius: 34px;
  106. background: #1f6397;
  107. font-family: Source Han Sans CN;
  108. font-size: 23px;
  109. font-weight: 350;
  110. letter-spacing: 0em;
  111. color: #ffffff;
  112. display: flex;
  113. align-items: center;
  114. justify-content: center;
  115. }
  116. }
  117. }
  118. }
  119. </style>