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

180 lines
3.7 KiB

1 month ago
1 month ago
  1. <script setup lang="ts">
  2. import { ref, watchEffect } from 'vue'
  3. import { syncSendCmd } from '@/apis/system'
  4. import { useDeviceStore } from '@/stores/deviceStore'
  5. const deviceStore = useDeviceStore()
  6. const appEvents = ref<Record<string, any>[]>([])
  7. watchEffect(() => {
  8. appEvents.value = deviceStore.deviceStete.appEvents
  9. })
  10. const confirmClose = (item: Record<string, any>) => {
  11. console.log('item === ', item)
  12. const evenid = item.uuid
  13. const params = {
  14. className: 'AppCore',
  15. fnName: 'appEventConfirm',
  16. params: {
  17. evenid,
  18. },
  19. }
  20. syncSendCmd(params)
  21. }
  22. </script>
  23. <template>
  24. <div v-if="appEvents.length" class="reconnect-modal-overlay">
  25. <div class="reconnect-modal-container">
  26. <h2 class="reconnect-title">
  27. 错误信息
  28. </h2>
  29. <ul class="recipe-list">
  30. <li
  31. v-for="(item, index) in appEvents"
  32. :key="index"
  33. >
  34. <span v-if="item.errCheckPoints">
  35. <span v-for="checkItem in item.errCheckPoints" :key="checkItem.ecode">
  36. {{ checkItem.ecodeInfo }}
  37. </span>
  38. </span>
  39. <span v-else>{{ item.description || item.message }}</span>
  40. <div class="actions">
  41. <button class="delete-button" @click.stop="confirmClose(item)">
  42. 关闭
  43. </button>
  44. <span class="selected-icon">
  45. <i class="fa fa-check-circle" />
  46. </span>
  47. </div>
  48. </li>
  49. </ul>
  50. </div>
  51. </div>
  52. </template>
  53. <style lang="scss" scoped>
  54. .reconnect-modal-overlay {
  55. position: fixed;
  56. top: 0;
  57. left: 0;
  58. width: 100%;
  59. height: 100%;
  60. background-color: rgba(0, 0, 0, 0.5);
  61. backdrop-filter: blur(4px);
  62. display: flex;
  63. justify-content: center;
  64. align-items: center;
  65. z-index: 9999;
  66. }
  67. .reconnect-modal-container {
  68. background-color: white;
  69. border-radius: 12px;
  70. padding: 40px;
  71. width: 40vw;
  72. box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  73. text-align: center;
  74. animation: fadeIn 0.3s ease-out;
  75. .recipe-list {
  76. list-style: none;
  77. padding: 0;
  78. margin: 0;
  79. }
  80. .recipe-list li {
  81. display: flex;
  82. align-items: center;
  83. justify-content: space-between;
  84. padding: 10px;
  85. border-radius: 4px;
  86. margin-bottom: 8px;
  87. transition: all 0.2s;
  88. cursor: pointer;
  89. }
  90. .recipe-list li:hover {
  91. background-color: #f5f7fa;
  92. }
  93. .recipe-list li.selected {
  94. background-color: #e6f7ff;
  95. /* border: 1px solid #1890ff; */
  96. /* padding: 9px; */
  97. }
  98. }
  99. .reconnect-spinner {
  100. width: 64px;
  101. height: 64px;
  102. border: 6px solid #f3f3f3;
  103. border-radius: 50%;
  104. border-top: 6px solid #3b82f6;
  105. margin: 0 auto 24px;
  106. animation: spin 1s linear infinite;
  107. }
  108. .reconnect-title {
  109. font-size: 1.12rem;
  110. font-weight: bold;
  111. color: #1f2937;
  112. margin-bottom: 12px;
  113. }
  114. .reconnect-message {
  115. font-size: 16px;
  116. color: #4b5563;
  117. }
  118. .actions {
  119. display: flex;
  120. align-items: center;
  121. }
  122. .view-button, .delete-button {
  123. border: none;
  124. padding: 4px 8px;
  125. border-radius: 3px;
  126. cursor: pointer;
  127. margin-right: 5px;
  128. transition: all 0.3s;
  129. }
  130. .view-button {
  131. background-color: #e6f7ff;
  132. color: #1890ff;
  133. }
  134. .view-button:hover {
  135. background-color: #1890ff;
  136. color: white;
  137. }
  138. .delete-button {
  139. background-color: #ffe6e6;
  140. color: #ff4d4f;
  141. }
  142. .delete-button:hover {
  143. background-color: #ff4d4f;
  144. color: white;
  145. }
  146. .selected-icon {
  147. color: #1890ff;
  148. /* margin-left: 8px; */
  149. }
  150. @keyframes spin {
  151. 0% { transform: rotate(0deg); }
  152. 100% { transform: rotate(360deg); }
  153. }
  154. @keyframes fadeIn {
  155. from { opacity: 0; transform: scale(0.95); }
  156. to { opacity: 1; transform: scale(1); }
  157. }
  158. </style>