warninglist.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. <!--
  2. * @Title:
  3. * @Description: 异常列表信息
  4. * @Author: swp
  5. * @Date: 2022-08-24 10:49:21
  6. * @LastEditors:
  7. * @LastEditTime: 2022-08-24 10:49:21
  8. -->
  9. <template>
  10. <view class="wrap">
  11. <uni-nav-bar dark :fixed="true" backgroundColor="#3F9EFF" statusBar="false" left-icon="left" left-text="返回"
  12. @clickLeft="toBack">
  13. <view class="nav-title">
  14. <text>{{title}}</text>
  15. </view>
  16. </uni-nav-bar>
  17. <view class="container">
  18. <uni-list>
  19. <uni-list-item v-for="item in list" :key="item.id">
  20. <template v-slot:body>
  21. <view class="list-item-block">
  22. <view class="items-line">
  23. <image class="item-title-run-status-icon" src="/static/images/icon_warning.png"
  24. mode="widthFix">
  25. </image>
  26. <text class="item-title-rtu-name">{{item.rtuName}}</text>
  27. <text class="item-title-rtu-code">[{{item.rtuCode}}]</text>
  28. </view>
  29. <view class="items-line">
  30. <uni-icons class="input-uni-icon" type="calendar" size="18" color="lightblue" />
  31. <text class="item-text">创建时间:</text>
  32. <text class="item-text">{{item.warningHappenTime}}</text>
  33. </view>
  34. <view class="items-line">
  35. <uni-icons class="input-uni-icon" type="list" size="18" color="lightblue" />
  36. <text class="item-text-lable">异常类型:</text>
  37. <text v-if="item.warningKind==1" class="item-text-content">测站离线</text>
  38. <text v-else-if="item.warningKind==2" class="item-text-content">测站时钟异常</text>
  39. <text v-else-if="item.warningKind==3" class="item-text-content">测站雨量小时报漏报</text>
  40. <text v-else-if="item.warningKind==4" class="item-text-content">测站水位小时报漏报</text>
  41. <text v-else-if="item.warningKind==5" class="item-text-content">雨量5分钟上报延时</text>
  42. <text v-else-if="item.warningKind==6" class="item-text-content">雨量站小时上报延时</text>
  43. <text v-else-if="item.warningKind==7" class="item-text-content">水位站小时上报延时</text>
  44. <text v-else-if="item.warningKind==8" class="item-text-content">雨量疑似异常值</text>
  45. </view>
  46. <view class="items-line">
  47. <uni-icons class="input-uni-icon" type="compose" size="18" color="lightblue" />
  48. <text class="item-text-lable">异常信息:</text>
  49. </view>
  50. <view class="items-line">
  51. <text class="item-text-content" style="margin-left: 0px;">{{item.warningDesc}}</text>
  52. </view>
  53. </view>
  54. </template>
  55. </uni-list-item>
  56. </uni-list>
  57. <uni-group>
  58. <view class="pagination-block">
  59. <uni-pagination show-icon :page-size="pageSize" :current="pageCurrent" :total="total"
  60. @change="pageChange" />
  61. </view>
  62. </uni-group>
  63. </view>
  64. </view>
  65. </template>
  66. <script>
  67. import http from '@/http/api.js';
  68. export default {
  69. name: '',
  70. components: {},
  71. onLoad(option) {
  72. this.getPage();
  73. },
  74. data() {
  75. return {
  76. list: [],
  77. title: '异常测站信息',
  78. pageSize: 10,
  79. // 当前页
  80. pageCurrent: 1,
  81. // 数据总量
  82. total: 0,
  83. query: {},
  84. }
  85. },
  86. computed: {},
  87. onShow() {},
  88. methods: {
  89. toBack() {
  90. uni.navigateBack({
  91. delta: 1
  92. })
  93. },
  94. // 分页触发
  95. pageChange(e) {
  96. this.pageCurrent = e.current;
  97. this.getPage()
  98. },
  99. getPage(params = {}) {
  100. let that = this;
  101. const current = this.pageCurrent;
  102. const size = this.pageSize;
  103. let postData = Object.assign(params, this.query);
  104. http.request({
  105. url: '/galaxy-business/rtu/warning/page',
  106. method: 'GET',
  107. data: postData,
  108. params: {
  109. current,
  110. size,
  111. },
  112. }).then(res => {
  113. if (res.data.records != null) {
  114. that.list = res.data.records;
  115. }
  116. this.total = res.data.total;
  117. }).catch(err => {
  118. console.log(err)
  119. })
  120. },
  121. toWarningPage(id) {
  122. var url = '/pages/warning/warninginfodetail?id=' + id;
  123. uni.navigateTo({
  124. url: url
  125. })
  126. },
  127. }
  128. }
  129. </script>
  130. <style>
  131. /* page {
  132. background-color: rgb(240, 242, 244);
  133. } */
  134. </style>
  135. <style lang="scss" scoped>
  136. </style>