monitorlogdata.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. <template>
  2. <view class="" style="background-color: #fff;">
  3. <view class="" style="width: 100%;height: 40rpx;background-color: #f7f7f7;">
  4. </view>
  5. <view class="wearthbox">
  6. <view class="wearthbox_item">
  7. <view class="wearthbox_item_l">
  8. 温度
  9. </view>
  10. <view class="wearthbox_item_r">
  11. {{datainfo.temperature}}
  12. </view>
  13. </view>
  14. <view class="wearthbox_item">
  15. <view class="wearthbox_item_l">
  16. 天气
  17. </view>
  18. <view class="wearthbox_item_r">
  19. {{datainfo.weather}}
  20. </view>
  21. </view>
  22. <view class="wearthbox_item">
  23. <view class="wearthbox_item_l">
  24. 日期
  25. </view>
  26. <view class="wearthbox_item_r">
  27. {{datainfo.monitor_time}}
  28. </view>
  29. </view>
  30. <view class="wearthbox_item">
  31. <view class="wearthbox_item_l">
  32. 地址
  33. </view>
  34. <view class="wearthbox_item_r">
  35. {{datainfo.address}}
  36. </view>
  37. </view>
  38. <view class="title_box">
  39. 监测内容
  40. </view>
  41. <view class="task_box" v-for="item,index in baselist" :key="index" @click="examine(item.img_list)">
  42. <view class="task_box_left">
  43. <view class="task_box_left_f">
  44. {{item.title}}
  45. </view>
  46. <view class="task_box_left_t">
  47. {{item.img_list.length}}张图片
  48. </view>
  49. </view>
  50. <view class="task_box_con">
  51. <view class="task_box_con_f">
  52. {{item.create_time}}
  53. </view>
  54. <view class="task_box_con_t">
  55. {{item.message}}
  56. </view>
  57. </view>
  58. </view>
  59. </view>
  60. <u-loading-page loading-text="加载中..." :loading="loading" font-size="16"></u-loading-page>
  61. </view>
  62. </template>
  63. <script>
  64. export default {
  65. data() {
  66. return {
  67. datainfo: {},
  68. baselist: [],
  69. loading:false
  70. }
  71. },
  72. methods: {
  73. async getdatalist(id) {
  74. this.loading = true
  75. const res = await this.$myRequest({
  76. url: '/api/api_gateway?method=control_center.task.monitor_log_info',
  77. data: {
  78. record_id: id
  79. }
  80. })
  81. console.log(res)
  82. this.datainfo = res.monitor_info
  83. this.baselist = res.page_list
  84. for(var i = 0; i < this.baselist.length; i++){
  85. this.baselist[i].img_list = JSON.parse(this.baselist[i].img_list) || []
  86. }
  87. this.loading = false
  88. },
  89. examine(item) {
  90. var imgarr = []
  91. for (var i = 0; i < item.length; i++) {
  92. imgarr.push(this.baseUrl + item[i])
  93. }
  94. if(imgarr.length!=0){
  95. uni.previewImage({
  96. urls: imgarr,
  97. current: 0
  98. });
  99. }else{
  100. uni.$u.toast('暂无图片!')
  101. }
  102. },
  103. },
  104. onLoad(option) {
  105. this.getdatalist(option.id)
  106. }
  107. }
  108. </script>
  109. <style lang="less" scoped>
  110. page{
  111. background-color: #f7f7f7;
  112. }
  113. .wearthbox {
  114. width: 90%;
  115. margin: 0 auto;
  116. padding-bottom: 40rpx;
  117. .wearthbox_item {
  118. display: flex;
  119. justify-content: space-between;
  120. border-bottom: 1px solid #F6F6F6;
  121. margin-bottom: 20rpx;
  122. padding: 20rpx 0;
  123. .wearthbox_item_r {
  124. color: #999999;
  125. }
  126. }
  127. .title_box {
  128. width: 100%;
  129. display: flex;
  130. justify-content: space-between;
  131. margin-top: 30rpx;
  132. margin-bottom: 30rpx;
  133. font-weight: 700;
  134. }
  135. .task_box {
  136. padding: 20rpx 10rpx;
  137. border-top: 1px solid #dadbde;
  138. border-bottom: 1px solid #dadbde;
  139. .task_box_left {
  140. display: flex;
  141. justify-content: space-between;
  142. margin-bottom: 20rpx;
  143. .task_box_left_f {
  144. font-weight: 700;
  145. font-size: 28rpx;
  146. }
  147. .task_box_left_t {
  148. color: #999999;
  149. font-size: 24rpx;
  150. }
  151. }
  152. .task_box_con {
  153. font-size: 28rpx;
  154. .task_box_con_f{
  155. margin-bottom: 10rpx;
  156. }
  157. .task_box_con_t{
  158. text-overflow: -o-ellipsis-lastline;
  159. overflow: hidden;
  160. text-overflow: ellipsis;
  161. display: -webkit-box;
  162. -webkit-line-clamp: 2;
  163. line-clamp: 2;
  164. -webkit-box-orient: vertical;
  165. }
  166. }
  167. }
  168. }
  169. </style>