newsDetail.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <template>
  2. <view class="page">
  3. <view class="newsDetail">
  4. <view class="n-d1">
  5. <text class="t1"></text>
  6. <text class="t2">告警信息</text>
  7. </view>
  8. <view class="n-d2">
  9. <text>告警对象</text>
  10. <text class="t2">{{dataObj.alarmFor}}</text>
  11. </view>
  12. <view class="n-d2">
  13. <text>告警内容</text>
  14. <text class="t2">{{dataObj.discernResult}}</text>
  15. </view>
  16. <view class="n-d2">
  17. <text>告警等级</text>
  18. <text class="t2">{{dataObj.alarmLevel | alarmLevel}}</text>
  19. </view>
  20. <view class="n-d2">
  21. <text>告警时间</text>
  22. <text class="t2">{{dataObj.createTime}}</text>
  23. </view>
  24. </view>
  25. </view>
  26. </template>
  27. <script>
  28. import {readMsg} from '@/common/api.js'
  29. export default {
  30. data() {
  31. return {
  32. dataObj:{}
  33. }
  34. },
  35. filters:{
  36. alarmLevel(val){
  37. return val == 1 ? '预警' :val == 2 ?'一般告警': val == 3 ? '严重告警' : val == 4 ?'危急告警' :'正常'
  38. }
  39. },
  40. mounted() {
  41. this.dataObj = uni.getStorageSync("newsDetailxjapp")
  42. readMsg({
  43. msgId:this.dataObj.id
  44. }).then(res =>{
  45. console.log(res)
  46. }).catch(e =>{
  47. console.log(e)
  48. })
  49. },
  50. methods: {
  51. }
  52. }
  53. </script>
  54. <style scoped lang="scss">
  55. .page {
  56. background: #F9F9F9;
  57. height:calc(100vh - 30rpx);
  58. padding-top:30rpx ;
  59. }
  60. .newsDetail {
  61. background: #fff;
  62. margin:0rpx 18rpx 50rpx 18rpx;
  63. border-radius: 20rpx;
  64. padding: 38rpx 38rpx 0 38rpx;
  65. .n-d2{
  66. display: flex;
  67. align-items: center;
  68. justify-content: space-between;
  69. font-size: 30rpx;
  70. height: 90rpx;
  71. line-height: 90rpx;
  72. border-bottom: 1rpx solid #E5E5E5;
  73. color: #666666;
  74. .t2{
  75. font-weight: bold;
  76. color: #333;
  77. }
  78. &:last-child{
  79. border: none;
  80. }
  81. }
  82. .n-d1 {
  83. margin-bottom: 20rpx;
  84. .t1 {
  85. width: 7rpx;
  86. height: 24rpx;
  87. background: #0581FD;
  88. border-radius: 3px;
  89. display: inline-block;
  90. margin-right: 10rpx;
  91. }
  92. .t2 {
  93. font-size: 32rpx;
  94. color: #000;
  95. font-weight: bold;
  96. }
  97. }
  98. }
  99. </style>