list.vue 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <template>
  2. <view>
  3. <navigator :url="'/pages/alerts/detail?id=' + item.w_event_logid" class="item" hover-class="navigator-hover"
  4. v-for="item in list" :key="item.w_event_logid">
  5. <view class="tag" :style="{
  6. color: tagStyleList[item.lasteventlevel - 1].color,
  7. backgroundColor: tagStyleList[item.lasteventlevel - 1].backgroundColor,
  8. }">{{ tagStyleList[item.lasteventlevel - 1].name }}</view>
  9. <view class="title u-line-1">{{ item.eventname || "--" }}</view>
  10. <view v-if="isShowProdname" class="row u-line-1">产品名称:{{ item.prodname || ' --' }}</view>
  11. <view class="row u-line-1">告警描述:
  12. <text v-for="it in item.lasteventparamvalues" :key="it.w_dataparamid">
  13. 当前设备
  14. <text><!-- style="color: rgb(234, 22, 45);" -->
  15. {{ it.paramname }}
  16. </text>
  17. 值为
  18. <text>
  19. {{ it.paramvalue }}
  20. </text>
  21. ,
  22. <text>
  23. {{ it.symbol + it.eventvalue }}
  24. </text>
  25. 时触发警告;
  26. </text>
  27. </view><!-- :style="{
  28. color: item.status == '待处理' ? '#EA162D' : '#55B43A'
  29. }" -->
  30. <view class="row u-line-1">告警状态:<text>{{ item.status || ' --' }}</text></view>
  31. <view class="time">最新告警时间:{{ item.lasteventtime }}</view>
  32. </navigator>
  33. </view>
  34. </template>
  35. <script>
  36. import { styleList } from "./styleList";
  37. export default {
  38. name: 'List',
  39. props: {
  40. list: Array,
  41. isShowProdname: {
  42. type: Boolean,
  43. default: true
  44. }
  45. },
  46. data() {
  47. return {
  48. tagStyleList: styleList
  49. }
  50. },
  51. }
  52. </script>
  53. <style lang="scss" scoped>
  54. .item {
  55. position: relative;
  56. width: 355px;
  57. padding: 0 10px;
  58. border-radius: 4px;
  59. box-sizing: border-box;
  60. margin: 0 auto;
  61. margin-bottom: 10px;
  62. background: #fff;
  63. overflow: hidden;
  64. .title {
  65. color: #004684;
  66. font-weight: bold;
  67. line-height: 20px;
  68. text-indent: 34px;
  69. margin-top: 4px;
  70. }
  71. .tag {
  72. position: absolute;
  73. top: 0;
  74. left: 0;
  75. padding: 2px 6px;
  76. font-size: 14px;
  77. border-radius: 0 0 4px 0;
  78. }
  79. .row {
  80. font-size: 12px;
  81. color: #666;
  82. line-height: 24px;
  83. }
  84. .time {
  85. margin-top: 2px;
  86. padding: 8px 0;
  87. color: #555;
  88. font-size: 12px;
  89. border-top: 1px solid #999;
  90. }
  91. }
  92. </style>