n-safety-monitoring-alarming.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. <template>
  2. <view>
  3. <view class="alarming">
  4. <view class="title">
  5. <view class="icon"></view>
  6. <view class="name">监测报警</view>
  7. </view>
  8. <view class="content">
  9. <view class="content_item" v-for="(item,index) in list" :key="index">
  10. <view class="content_title">{{item.mine_name}}</view>
  11. <view class="time">
  12. <view class="icon"></view>
  13. <view class="text">{{item.file_time}}</view>
  14. </view>
  15. <view class="inner">
  16. <view class="item">
  17. <view class="label">测试名称:</view>
  18. <view class="text">{{item.survey_name}}</view>
  19. </view>
  20. <view class="item">
  21. <view class="label">异常类型:</view>
  22. <view class="text">{{item.abnormal_type}}</view>
  23. </view>
  24. <view class="item">
  25. <view class="label">异常时间:</view>
  26. <view class="text">{{item.abnormal_time}}</view>
  27. </view>
  28. <view class="item">
  29. <view class="label">异常平均值:</view>
  30. <view class="text">{{item.abnormal_average}}</view>
  31. </view>
  32. <view class="item">
  33. <view class="label">异常最大值:</view>
  34. <view class="text">{{item.abnormal_max}}</view>
  35. </view>
  36. <view class="item">
  37. <view class="label">异常最小值:</view>
  38. <view class="text">{{item.abnormal_min}}</view>
  39. </view>
  40. <view class="item">
  41. <view class="label">异常原因:</view>
  42. <view class="text">{{item.abnormal_reason}}</view>
  43. </view>
  44. </view>
  45. </view>
  46. </view>
  47. </view>
  48. </view>
  49. </template>
  50. <script>
  51. let _self = this
  52. export default {
  53. props: [
  54. "page",
  55. "code"
  56. ],
  57. watch: {
  58. // 监听下拉加载页数
  59. page(newVal) {
  60. // console.log(newVal)
  61. this.page_num = newVal
  62. // 加载下一页
  63. this.get_list()
  64. },
  65. // 监听切换编码
  66. code(newVal) {
  67. // console.log(newVal)
  68. this.mine_code = newVal
  69. // 清空list
  70. this.list = []
  71. // 初始加载list
  72. this.get_list()
  73. }
  74. },
  75. data() {
  76. return {
  77. // 当前煤矿编码
  78. mine_code: 0,
  79. // 当前页
  80. page_num: 1,
  81. // 每页查询数量
  82. page_size: 5,
  83. // 列表项
  84. list: [],
  85. color_list:[
  86. "#83DCFC",
  87. "#E74C3C",
  88. "#8E44AD",
  89. "#2873FF",
  90. "#16A085",
  91. "#E67E22",
  92. "#3498DB",
  93. "#64C5E8",
  94. "#FA8B89",
  95. "#FBB47B",
  96. "#A3A2E4"
  97. ]
  98. };
  99. },
  100. methods: {
  101. get_list() {
  102. // 获取列表数据
  103. this.$p_api.jt_safety_alarm_list({
  104. mine_code: this.mine_code,
  105. page_size: this.page_size,
  106. page_num: this.page_num
  107. }).then((res) => {
  108. // console.log(res.data.content.data)
  109. this.list = this.list.concat(res.data.content.data)
  110. })
  111. }
  112. }
  113. }
  114. </script>
  115. <style lang="scss">
  116. .alarming {
  117. margin-top: 8rpx;
  118. width: 749rpx;
  119. .title {
  120. height: 90rpx;
  121. display: flex;
  122. justify-content: center;
  123. align-items: center;
  124. border-bottom: 1px solid #eee;
  125. .icon {
  126. width: 45rpx;
  127. height: 45rpx;
  128. background-image: url(./icon/section1.png);
  129. background-size: cover;
  130. background-repeat: no-repeat;
  131. }
  132. .name {
  133. margin-left: 8rpx;
  134. }
  135. }
  136. .content {
  137. box-sizing: border-box;
  138. padding: 20rpx 24rpx 40rpx;
  139. background-color: #F1F1F1;
  140. .content_item {
  141. margin-bottom: 20rpx;
  142. background-color: #FFFFFF;
  143. border-radius: 8px;
  144. overflow: hidden;
  145. .content_title {
  146. line-height: 100rpx;
  147. padding-left: 20rpx;
  148. border-left: 8rpx solid #83DCFC;
  149. border-bottom: 1px solid #eee;
  150. }
  151. .time {
  152. height: 80rpx;
  153. display: flex;
  154. align-items: center;
  155. box-sizing: border-box;
  156. padding: 0 20rpx;
  157. .icon {
  158. width: 40rpx;
  159. height: 40rpx;
  160. background-image: url(./icon/time.png);
  161. background-size: cover;
  162. background-repeat: no-repeat;
  163. }
  164. .text {
  165. margin-left: 10rpx;
  166. }
  167. }
  168. .inner {
  169. width: 700rpx;
  170. box-sizing: border-box;
  171. padding: 0 20rpx 40rpx;
  172. .item {
  173. padding: 10rpx 0;
  174. display: flex;
  175. .label {
  176. width: 220rpx;
  177. }
  178. .text {
  179. width: 480rpx;
  180. }
  181. }
  182. }
  183. }
  184. }
  185. }
  186. </style>