gongyi.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <script setup>
  2. import { useRouter } from 'vue-router';
  3. import LayoutCard from './LayoutCard.vue';
  4. defineProps({
  5. gongyiData: {
  6. type: Array,
  7. default: []
  8. }
  9. })
  10. const router = useRouter()
  11. const types = ['水质报警', '生化报警', '预测报警']
  12. const toGongyi = (item) => {
  13. router.push('water-warn');
  14. }
  15. </script>
  16. <template>
  17. <LayoutCard title="工艺管控助手" name="gongyi" width="100%">
  18. <template #headerRight>
  19. <RouterLink to="/water-warn" class="flex items-center space-x-[0.4rem] text-[14px]">
  20. <div class="jump-btn"></div>
  21. </RouterLink>
  22. </template>
  23. <div class="gongyi-wrap">
  24. <div class="gongyi-wrap-top gongyi-wrap-item">
  25. <span>告警类型</span>
  26. <span>告警信息</span>
  27. <span>触发时间</span>
  28. </div>
  29. <ul class="gongyi-wrap-list">
  30. <li class="gongyi-wrap-item" v-for="item in gongyiData" @click="toGongyi">
  31. <span>{{ types[item.type] }}</span>
  32. <span>{{ item.reason }}</span>
  33. <span>{{ item.time }}</span>
  34. </li>
  35. </ul>
  36. </div>
  37. </LayoutCard>
  38. </template>
  39. <style scoped lang="scss">
  40. .jump-btn {
  41. display: inline-block;
  42. width: 50px;
  43. height: 20px;
  44. }
  45. .gongyi-wrap {
  46. padding: 12px;
  47. &-list {
  48. height: 100px;
  49. overflow-y: auto;
  50. &::-webkit-scrollbar {
  51. width: 0px !important;
  52. }
  53. }
  54. &-item {
  55. margin-bottom: 10px;
  56. padding: 10px 12px;
  57. display: flex;
  58. line-height: 14px;
  59. background: rgba(97, 163, 217, 0.10);
  60. justify-content: space-between;
  61. align-items: center;
  62. color: #fff;
  63. cursor: pointer;
  64. font-size: 14px;
  65. span {
  66. text-overflow: ellipsis;
  67. overflow: hidden;
  68. word-break: break-all;
  69. white-space: nowrap;
  70. }
  71. >span {
  72. flex: 1;
  73. }
  74. >span:nth-child(2) {
  75. text-align: center;
  76. }
  77. >span:last-child {
  78. text-align: right;
  79. }
  80. }
  81. &-top {
  82. background: rgba(13, 80, 135, 0.60);
  83. font-size: 14px;
  84. color: #fff;
  85. font-weight: bold;
  86. }
  87. .warning,
  88. &-item:hover {
  89. color: #F15A24;
  90. }
  91. &-top:hover {
  92. color: #fff;
  93. }
  94. }
  95. @media (min-height: 1070px) {
  96. .gongyi-wrap {
  97. padding: 12px 12px 0 12px;
  98. .gongyi-wrap-list {
  99. height: 134px;
  100. }
  101. }
  102. }
  103. </style>