monitorlogdata.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  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. watch: {
  73. videoData(news, old) {
  74. uni.switchTab({
  75. url: '../response/index'
  76. })
  77. },
  78. },
  79. computed: {
  80. // 视频消息
  81. videoData() {
  82. return this.$store.state.video
  83. },
  84. },
  85. methods: {
  86. async getdatalist(id) {
  87. this.loading = true
  88. const res = await this.$myRequest({
  89. url: '/api/api_gateway?method=control_center.task.monitor_log_info',
  90. data: {
  91. record_id: id
  92. }
  93. })
  94. console.log(res)
  95. this.datainfo = res.monitor_info
  96. this.baselist = res.page_list
  97. for(var i = 0; i < this.baselist.length; i++){
  98. this.baselist[i].img_list = JSON.parse(this.baselist[i].img_list) || []
  99. }
  100. this.loading = false
  101. },
  102. examine(item) {
  103. var imgarr = []
  104. for (var i = 0; i < item.length; i++) {
  105. imgarr.push(this.baseUrl + item[i])
  106. }
  107. if(imgarr.length!=0){
  108. uni.previewImage({
  109. urls: imgarr,
  110. current: 0
  111. });
  112. }else{
  113. uni.$u.toast('暂无图片!')
  114. }
  115. },
  116. },
  117. onLoad(option) {
  118. this.getdatalist(option.id)
  119. }
  120. }
  121. </script>
  122. <style lang="less" scoped>
  123. page{
  124. background-color: #f7f7f7;
  125. }
  126. .wearthbox {
  127. width: 90%;
  128. margin: 0 auto;
  129. padding-bottom: 40rpx;
  130. .wearthbox_item {
  131. display: flex;
  132. justify-content: space-between;
  133. border-bottom: 1px solid #F6F6F6;
  134. margin-bottom: 20rpx;
  135. padding: 20rpx 0;
  136. .wearthbox_item_r {
  137. color: #999999;
  138. }
  139. }
  140. .title_box {
  141. width: 100%;
  142. display: flex;
  143. justify-content: space-between;
  144. margin-top: 30rpx;
  145. margin-bottom: 30rpx;
  146. font-weight: 700;
  147. }
  148. .task_box {
  149. padding: 20rpx 10rpx;
  150. border-top: 1px solid #dadbde;
  151. border-bottom: 1px solid #dadbde;
  152. .task_box_left {
  153. display: flex;
  154. justify-content: space-between;
  155. margin-bottom: 20rpx;
  156. .task_box_left_f {
  157. font-weight: 700;
  158. font-size: 28rpx;
  159. }
  160. .task_box_left_t {
  161. color: #999999;
  162. font-size: 24rpx;
  163. }
  164. }
  165. .task_box_con {
  166. font-size: 28rpx;
  167. .task_box_con_f{
  168. margin-bottom: 10rpx;
  169. }
  170. .task_box_con_t{
  171. text-overflow: -o-ellipsis-lastline;
  172. overflow: hidden;
  173. text-overflow: ellipsis;
  174. display: -webkit-box;
  175. -webkit-line-clamp: 2;
  176. line-clamp: 2;
  177. -webkit-box-orient: vertical;
  178. }
  179. }
  180. }
  181. }
  182. </style>