AlarmPopup.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <template>
  2. <div class="map-alarm-popup">
  3. <div class="popup-header">
  4. <div class="status-icon warning">
  5. <i class="el-icon-warning-outline"></i>
  6. </div>
  7. <span class="title-text">{{ title }}</span>
  8. </div>
  9. <div class="popup-content">
  10. <div class="info-row">
  11. <span class="label">路口:</span>
  12. <span class="value">{{ intersection }}</span>
  13. </div>
  14. <div class="info-row">
  15. <span class="label">发生时间:</span>
  16. <span class="value">{{ time }}</span>
  17. </div>
  18. </div>
  19. </div>
  20. </template>
  21. <script>
  22. export default {
  23. name: 'AlarmPopup',
  24. props: {
  25. title: {
  26. type: String,
  27. default: '降级黄闪'
  28. },
  29. intersection: {
  30. type: String,
  31. default: '北京路与南京路'
  32. },
  33. time: {
  34. type: String,
  35. default: '2026.1.23.12:00'
  36. },
  37. // 可选:用于控制不同状态的颜色 (warning:黄, error:红, normal:绿)
  38. type: {
  39. type: String,
  40. default: 'warning'
  41. }
  42. }
  43. };
  44. </script>
  45. <style scoped>
  46. /* ================= 整体卡片样式 ================= */
  47. .map-alarm-popup {
  48. width: max-content; /* 宽度根据内容自适应 */
  49. min-width: 240px;
  50. /* 完美的暗黑透明背景 + 毛玻璃,高度还原图片 */
  51. background: rgba(15, 20, 35, 0.85);
  52. backdrop-filter: blur(8px);
  53. -webkit-backdrop-filter: blur(8px);
  54. border: 1px solid rgba(255, 255, 255, 0.1); /* 极细边缘光 */
  55. border-radius: 8px; /* 圆角 */
  56. padding: 16px 20px;
  57. box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  58. pointer-events: auto; /* 允许鼠标点击交互 */
  59. }
  60. /* ================= 头部标题区 ================= */
  61. .popup-header {
  62. display: flex;
  63. align-items: center;
  64. margin-bottom: 12px;
  65. }
  66. /* 状态图标容器 */
  67. .status-icon {
  68. display: flex;
  69. justify-content: center;
  70. align-items: center;
  71. width: 24px;
  72. height: 24px;
  73. border-radius: 50%;
  74. margin-right: 10px;
  75. color: #fff;
  76. font-size: 14px;
  77. }
  78. /* 警告状态(黄色) */
  79. .status-icon.warning {
  80. background-color: #e6a23c;
  81. box-shadow: 0 0 8px rgba(230, 162, 60, 0.6);
  82. }
  83. /* 异常状态(红色,预留) */
  84. .status-icon.error {
  85. background-color: #f56c6c;
  86. box-shadow: 0 0 8px rgba(245, 108, 108, 0.6);
  87. }
  88. .title-text {
  89. font-size: 16px;
  90. font-weight: bold;
  91. color: #ffffff;
  92. letter-spacing: 1px;
  93. }
  94. /* ================= 内容信息区 ================= */
  95. .popup-content {
  96. display: flex;
  97. flex-direction: column;
  98. gap: 8px; /* 行间距 */
  99. }
  100. .info-row {
  101. font-size: 14px;
  102. display: flex;
  103. align-items: center;
  104. white-space: nowrap; /* 防止文字换行 */
  105. }
  106. .label {
  107. color: #a0a5b0; /* 标签文字用灰白色区分层级 */
  108. }
  109. .value {
  110. color: #ffffff; /* 核心数据纯白高亮 */
  111. }
  112. </style>