EarlyWarningList.vue 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <template>
  2. <div class="card-box card-box-list">
  3. <div class="card-box-title">预警列表</div>
  4. <ul class="card-box-list-content">
  5. <li
  6. class="card-box card-box-list-item"
  7. v-for="item in list"
  8. :key="item.warningId"
  9. @click="$emit('warnClick', item)"
  10. >
  11. <span class="icon icon-warn"></span>
  12. <span class="ellipsis card-box-list-item-user">
  13. {{ item.name }}
  14. </span>
  15. <span class="ellipsis early-warning-reason" :title="item.info">
  16. {{ item.info }}
  17. </span>
  18. </li>
  19. </ul>
  20. </div>
  21. </template>
  22. <script>
  23. export default {
  24. name: "EarlyWarningList",
  25. props: {
  26. list: {
  27. type: Array,
  28. default: () => [],
  29. },
  30. },
  31. };
  32. </script>
  33. <style lang="scss" scoped>
  34. .ellipsis {
  35. overflow: hidden;
  36. white-space: nowrap;
  37. text-overflow: ellipsis;
  38. }
  39. .card-box-list {
  40. padding: 0 10px 10px;
  41. list-style: none;
  42. .card-box-title {
  43. font-size: 14px;
  44. font-weight: bold;
  45. color: #ffffff;
  46. line-height: 1;
  47. padding: 20px 0;
  48. }
  49. .card-box-list-content {
  50. margin: 0;
  51. padding: 0;
  52. padding-right: 10px;
  53. height: 500px; // 7
  54. overflow-y: auto;
  55. .card-box-list-item {
  56. width: unset;
  57. background-color: #3f444d;
  58. padding: 10px;
  59. line-height: 1;
  60. display: flex;
  61. align-items: center;
  62. color: #fff;
  63. font-size: 12px;
  64. &:not(:last-child) {
  65. margin-bottom: 6px;
  66. }
  67. .icon {
  68. width: 24px;
  69. height: 24px;
  70. }
  71. .card-box-list-item-user {
  72. font-weight: bold;
  73. margin: 0 10px;
  74. width: 48px;
  75. }
  76. .early-warning-reason {
  77. color: #a1a8b3;
  78. margin-left: auto;
  79. flex: 1;
  80. text-align: right;
  81. }
  82. }
  83. }
  84. }
  85. </style>