list.vue 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <template>
  2. <view>
  3. <navigator :url="'/packageA/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 class="row u-line-1">产品名称:{{ item.prodname || ' --' }}</view>
  11. <view class="row u-line-1">告警描述:{{ item.showValue || ' --' }}</view>
  12. <view class="time">最新告警时间:{{ item.lasteventtime }}</view>
  13. </navigator>
  14. </view>
  15. </template>
  16. <script>
  17. import { styleList } from "./styleList";
  18. export default {
  19. name: 'List',
  20. props: {
  21. list: Array
  22. },
  23. data() {
  24. return {
  25. tagStyleList: styleList
  26. }
  27. },
  28. }
  29. </script>
  30. <style lang="scss" scoped>
  31. .item {
  32. position: relative;
  33. width: 355px;
  34. padding: 0 10px;
  35. border-radius: 4px;
  36. box-sizing: border-box;
  37. margin: 0 auto;
  38. margin-bottom: 10px;
  39. background: #fff;
  40. overflow: hidden;
  41. .title {
  42. color: #004684;
  43. font-weight: bold;
  44. line-height: 20px;
  45. text-indent: 34px;
  46. margin-top: 4px;
  47. }
  48. .tag {
  49. position: absolute;
  50. top: 0;
  51. left: 0;
  52. padding: 2px 6px;
  53. font-size: 14px;
  54. border-radius: 0 0 4px 0;
  55. }
  56. .row {
  57. font-size: 12px;
  58. color: #666;
  59. line-height: 24px;
  60. }
  61. .time {
  62. margin-top: 2px;
  63. padding: 8px 0;
  64. color: #555;
  65. font-size: 12px;
  66. border-top: 1px solid #999;
  67. }
  68. }
  69. </style>