index.vue 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368
  1. <template>
  2. <div v-if="props.open" class="alertModal">
  3. <div class="alertModal-contant">
  4. <div class="scan-line"></div>
  5. <div class="grid-overlay"></div>
  6. <div class="corner-decoration corner-tl"></div>
  7. <div class="corner-decoration corner-tr"></div>
  8. <div class="corner-decoration corner-bl"></div>
  9. <div class="corner-decoration corner-br"></div>
  10. <div class="status-led"></div>
  11. <div class="alert-header">
  12. <div class="alert-icon">
  13. <WarningOutlined />
  14. </div>
  15. <div>
  16. <h1 class="alert-title">跌倒警报</h1>
  17. <p class="alert-subtitle">系统检测到跌倒事件,请及时处理!</p>
  18. </div>
  19. </div>
  20. <div class="alert-body">
  21. <div class="alert-details">
  22. <div class="detail-row">
  23. <div class="detail-label">设备名称</div>
  24. <div class="detail-value">{{ props.data.devName }}</div>
  25. </div>
  26. <div class="detail-row">
  27. <div class="detail-label">小区名称</div>
  28. <div class="detail-value">{{ props.data.tenantName }}</div>
  29. </div>
  30. <div class="detail-row">
  31. <div class="detail-label">设备ID</div>
  32. <div class="detail-value">{{ props.data.clientId }}</div>
  33. </div>
  34. </div>
  35. </div>
  36. <div class="alert-footer">
  37. <button class="btn btn-acknowledge" @click="close"> 立即处理 </button>
  38. <button class="btn btn-view-details" @click="close"> 稍后处理 </button>
  39. </div>
  40. </div>
  41. </div>
  42. </template>
  43. <script setup lang="ts">
  44. import { defineProps, defineEmits, withDefaults } from 'vue'
  45. import { WarningOutlined } from '@ant-design/icons-vue'
  46. defineOptions({
  47. name: 'AlertModal',
  48. })
  49. type Props = {
  50. open: boolean
  51. data: {
  52. devName: string
  53. tenantName: string
  54. clientId: string
  55. }
  56. }
  57. const emit = defineEmits<{
  58. (e: 'update:open', value: boolean): void
  59. }>()
  60. const props = withDefaults(defineProps<Props>(), {
  61. open: false,
  62. data: () => ({
  63. devName: '',
  64. tenantName: '',
  65. clientId: '',
  66. }),
  67. })
  68. const close = () => {
  69. emit('update:open', false)
  70. }
  71. </script>
  72. <style scoped lang="less">
  73. .alertModal {
  74. position: fixed;
  75. top: 0;
  76. left: 0;
  77. inset: 0;
  78. background-color: rgba(0, 0, 0, 0.7);
  79. z-index: 10000;
  80. &-contant {
  81. top: 50%;
  82. left: 50%;
  83. transform: translate(-50%, -50%);
  84. padding: 20px;
  85. border-radius: 10px;
  86. z-index: 10001;
  87. width: 500px;
  88. background: rgba(10, 15, 35, 0.9);
  89. border: 1px solid rgba(0, 195, 255, 0.3);
  90. box-shadow:
  91. 0 0 20px rgba(0, 195, 255, 0.5),
  92. 0 0 40px rgba(0, 89, 255, 0.3),
  93. inset 0 0 15px rgba(0, 195, 255, 0.2);
  94. overflow: hidden;
  95. position: relative;
  96. backdrop-filter: blur(10px);
  97. transition: all 0.4s ease;
  98. .alert-header {
  99. background: linear-gradient(90deg, rgba(0, 80, 120, 0.7) 0%, rgba(0, 150, 200, 0.5) 100%);
  100. padding: 20px;
  101. position: relative;
  102. display: flex;
  103. align-items: center;
  104. border-bottom: 1px solid rgba(0, 195, 255, 0.3);
  105. }
  106. .alert-icon {
  107. width: 60px;
  108. height: 60px;
  109. background: rgba(255, 40, 40, 0.2);
  110. border-radius: 50%;
  111. display: flex;
  112. justify-content: center;
  113. align-items: center;
  114. margin-right: 20px;
  115. animation: pulse 2s infinite;
  116. }
  117. .alert-icon {
  118. font-size: 30px;
  119. color: #ff2a2a;
  120. animation: shake 0.8s infinite;
  121. }
  122. @keyframes pulse {
  123. 0% {
  124. box-shadow: 0 0 0 0 rgba(255, 40, 40, 0.4);
  125. }
  126. 70% {
  127. box-shadow: 0 0 0 15px rgba(255, 40, 40, 0);
  128. }
  129. 100% {
  130. box-shadow: 0 0 0 0 rgba(255, 40, 40, 0);
  131. }
  132. }
  133. @keyframes shake {
  134. 0% {
  135. transform: translateX(0);
  136. }
  137. 25% {
  138. transform: translateX(-3px);
  139. }
  140. 50% {
  141. transform: translateX(3px);
  142. }
  143. 75% {
  144. transform: translateX(-3px);
  145. }
  146. 100% {
  147. transform: translateX(0);
  148. }
  149. }
  150. @keyframes rotate {
  151. 0% {
  152. transform: rotate(0deg);
  153. }
  154. 100% {
  155. transform: rotate(360deg);
  156. }
  157. }
  158. .alert-title {
  159. font-size: 24px;
  160. font-weight: 700;
  161. color: #ff4d4d;
  162. text-shadow: 0 0 10px rgba(255, 77, 77, 0.7);
  163. letter-spacing: 1px;
  164. }
  165. .alert-subtitle {
  166. font-size: 16px;
  167. color: #8fbcff;
  168. margin-top: 5px;
  169. }
  170. .alert-body {
  171. padding: 25px;
  172. }
  173. .alert-content {
  174. margin-bottom: 25px;
  175. line-height: 1.6;
  176. }
  177. .alert-details {
  178. background: rgba(0, 30, 60, 0.4);
  179. border-radius: 10px;
  180. padding: 15px;
  181. margin: 20px 0;
  182. border-left: 3px solid #00c3ff;
  183. }
  184. .detail-row {
  185. display: flex;
  186. padding: 8px 0;
  187. border-bottom: 1px solid rgba(0, 195, 255, 0.1);
  188. }
  189. .detail-row:last-child {
  190. border-bottom: none;
  191. }
  192. .detail-label {
  193. width: 40%;
  194. color: #8fbcff;
  195. font-weight: 500;
  196. }
  197. .detail-value {
  198. width: 60%;
  199. color: #ffffff;
  200. font-weight: 600;
  201. }
  202. .critical {
  203. color: #ff4d4d;
  204. text-shadow: 0 0 5px rgba(255, 77, 77, 0.5);
  205. }
  206. .alert-message {
  207. background: rgba(255, 40, 40, 0.1);
  208. border: 1px solid rgba(255, 77, 77, 0.3);
  209. border-radius: 8px;
  210. padding: 15px;
  211. margin: 20px 0;
  212. color: #ff9999;
  213. line-height: 1.6;
  214. }
  215. .alert-footer {
  216. display: flex;
  217. justify-content: flex-end;
  218. padding: 20px;
  219. background: rgba(0, 20, 40, 0.5);
  220. border-top: 1px solid rgba(0, 195, 255, 0.2);
  221. }
  222. .btn {
  223. padding: 12px 30px;
  224. border-radius: 8px;
  225. font-weight: 600;
  226. font-size: 16px;
  227. cursor: pointer;
  228. transition: all 0.3s ease;
  229. border: none;
  230. outline: none;
  231. letter-spacing: 1px;
  232. margin-left: 15px;
  233. }
  234. .btn-acknowledge {
  235. background: linear-gradient(90deg, #00c3ff 0%, #0077ff 100%);
  236. color: white;
  237. box-shadow: 0 0 15px rgba(0, 195, 255, 0.4);
  238. }
  239. .btn-acknowledge:hover {
  240. background: linear-gradient(90deg, #00d9ff 0%, #0088ff 100%);
  241. box-shadow: 0 0 20px rgba(0, 195, 255, 0.7);
  242. // transform: translateY(-2px);
  243. }
  244. .btn-view-details {
  245. background: transparent;
  246. color: #00c3ff;
  247. border: 1px solid #00c3ff;
  248. }
  249. .btn-view-details:hover {
  250. background: rgba(0, 195, 255, 0.1);
  251. box-shadow: 0 0 15px rgba(0, 195, 255, 0.3);
  252. }
  253. .grid-overlay {
  254. position: absolute;
  255. top: 0;
  256. left: 0;
  257. width: 100%;
  258. height: 100%;
  259. background:
  260. linear-gradient(rgba(0, 195, 255, 0.05) 1px, transparent 1px),
  261. linear-gradient(90deg, rgba(0, 195, 255, 0.05) 1px, transparent 1px);
  262. background-size: 20px 20px;
  263. pointer-events: none;
  264. z-index: -1;
  265. }
  266. .corner-decoration {
  267. position: absolute;
  268. width: 15px;
  269. height: 15px;
  270. }
  271. .corner-tl {
  272. top: 0;
  273. left: 0;
  274. border-top: 2px solid #00c3ff;
  275. border-left: 2px solid #00c3ff;
  276. }
  277. .corner-tr {
  278. top: 0;
  279. right: 0;
  280. border-top: 2px solid #00c3ff;
  281. border-right: 2px solid #00c3ff;
  282. }
  283. .corner-bl {
  284. bottom: 0;
  285. left: 0;
  286. border-bottom: 2px solid #00c3ff;
  287. border-left: 2px solid #00c3ff;
  288. }
  289. .corner-br {
  290. bottom: 0;
  291. right: 0;
  292. border-bottom: 2px solid #00c3ff;
  293. border-right: 2px solid #00c3ff;
  294. }
  295. .scan-line {
  296. position: absolute;
  297. top: 0;
  298. left: 0;
  299. width: 100%;
  300. height: 3px;
  301. background: linear-gradient(90deg, transparent, rgba(0, 195, 255, 0.7), transparent);
  302. animation: scan 4s linear infinite;
  303. }
  304. @keyframes scan {
  305. 0% {
  306. top: 0;
  307. }
  308. 100% {
  309. top: 100%;
  310. }
  311. }
  312. .status-led {
  313. position: absolute;
  314. top: 25px;
  315. right: 25px;
  316. width: 12px;
  317. height: 12px;
  318. background-color: #ff2a2a;
  319. border-radius: 50%;
  320. box-shadow: 0 0 10px #ff2a2a;
  321. animation: blink 1s infinite;
  322. }
  323. }
  324. }
  325. </style>