index.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. <template>
  2. <view class="page" :style="{'min-height':h+'px', 'padding-top':mt+'px'}">
  3. <cus-header title='设备异常'></cus-header>
  4. <div class="top" @tap="placeShow = true;">
  5. <div class="left">
  6. <image :src="imgBase+'inspection/record_location.png'"></image>
  7. <text>{{'电商园四期B座'}}</text>
  8. </div>
  9. <div class="right">
  10. <u-icon name="arrow-right" color="#FFFFFF" size="32"></u-icon>
  11. </div>
  12. </div>
  13. <div class="title">共有<span>{{list.length}}</span>条记录</div>
  14. <div class="boxs" v-if="list.length">
  15. <div class="box" v-for="(item,index) in list" :key="index">
  16. <div class="place">{{item.place}}</div>
  17. <div class="pre">安装位置<span>{{item.time}}</span></div>
  18. <div class="pre">设备编号<span>{{item.deviceno}}</span></div>
  19. <div class="pre">告警原因<span class="red">{{item.reason}}</span></div>
  20. <div class="pre">告警内容<span>{{item.content}}</span></div>
  21. <div class="pre">巡检时间<span>{{item.time}}</span></div>
  22. </div>
  23. </div>
  24. <template v-else>
  25. <page-empty :height="'calc(100vh - '+(mt+105)+'px)'" marginTop="105px"></page-empty>
  26. </template>
  27. <u-picker :show="placeShow" :columns="placeColumns" @cancel="placeShow=false" @change="changeHandler" @confirm="e=>paramsConfirm(e,'')" ref="uPicker"></u-picker>
  28. </view>
  29. </template>
  30. <script>
  31. export default {
  32. data(){
  33. return {
  34. placeShow:false,
  35. placeColumns:[
  36. ['A栋','B栋'],
  37. ['A101', 'A102', 'A103', 'A201']
  38. ],
  39. placeColumnData: [
  40. ['A101', 'A102', 'A103', 'A201'],
  41. ['B201', 'B203', 'B303', 'B404']
  42. ],
  43. list:[
  44. {
  45. place:'B座13楼1301',
  46. position:'电商园四期B座-13层',
  47. deviceno:'A32486',
  48. reason:'温度 ≥ 40℃',
  49. content:'实时温度52℃',
  50. time:'2024-12-28 10:34:22'
  51. },
  52. {
  53. place:'B座13楼1302',
  54. position:'电商园四期B座-13层',
  55. deviceno:'A32486',
  56. reason:'温度 ≥ 40℃',
  57. content:'实时温度52℃',
  58. time:'2024-12-28 10:34:22'
  59. }
  60. ]
  61. }
  62. },
  63. methods:{
  64. changeHandler(e) {
  65. const {
  66. columnIndex,
  67. value,
  68. values, // values为当前变化列的数组内容
  69. index,
  70. // 微信小程序无法将picker实例传出来,只能通过ref操作
  71. picker = this.$refs.uPicker
  72. } = e
  73. // 当第一列值发生变化时,变化第二列(后一列)对应的选项
  74. if (columnIndex === 0) {
  75. // picker为选择器this实例,变化第二列对应的选项
  76. picker.setColumnValues(1, this.placeColumnData[index])
  77. }
  78. },
  79. paramsConfirm(e,type){
  80. this.placeShow = false;
  81. }
  82. }
  83. }
  84. </script>
  85. <style scoped lang="less">
  86. .page{
  87. padding-bottom: 20rpx;
  88. background: #F4F8FB;
  89. box-sizing: border-box;
  90. .top{
  91. width: 100%;
  92. height: 102rpx;
  93. background: #198CFF;
  94. padding: 0 30rpx;
  95. box-sizing: border-box;
  96. display: flex;
  97. align-items: center;
  98. justify-content: space-between;
  99. .left{
  100. display: flex;
  101. align-items: center;
  102. image{
  103. width: 36rpx;
  104. height: 36rpx;
  105. }
  106. text{
  107. font-family: PingFangSC, PingFang SC;
  108. font-weight: 400;
  109. font-size: 30rpx;
  110. color: #FFFFFF;
  111. line-height: 42rpx;
  112. margin-left: 10rpx;
  113. }
  114. }
  115. }
  116. .filtrate{
  117. width: 100%;
  118. height: 90rpx;
  119. background: #FFFFFF;
  120. display: flex;
  121. .pre{
  122. width: calc(100% / 3);
  123. height: 100%;
  124. display: flex;
  125. align-items: center;
  126. justify-content: center;
  127. text{
  128. font-family: PingFangSC, PingFang SC;
  129. font-weight: 400;
  130. font-size: 28rpx;
  131. color: #4E5969;
  132. line-height: 40rpx;
  133. margin-right: 12rpx;
  134. }
  135. }
  136. }
  137. .title{
  138. font-family: PingFang-SC, PingFang-SC;
  139. font-weight: bold;
  140. font-size: 32rpx;
  141. color: #1D2129;
  142. line-height: 32rpx;
  143. margin-top: 36rpx;
  144. padding-left: 24rpx;
  145. span{
  146. color: #198CFF;
  147. margin: 0 10rpx;
  148. }
  149. }
  150. .boxs{
  151. width: 100%;
  152. padding: 0 24rpx;
  153. box-sizing: border-box;
  154. margin-top: 16rpx;
  155. overflow: hidden;
  156. .box{
  157. margin-top: 20rpx;
  158. background: #FFFFFF;
  159. border-radius: 16rpx;
  160. padding: 36rpx 24rpx;
  161. .place{
  162. font-family: PingFang-SC, PingFang-SC;
  163. font-weight: bold;
  164. font-size: 32rpx;
  165. color: #1D2129;
  166. line-height: 36rpx;
  167. white-space: nowrap;
  168. overflow: hidden;
  169. text-overflow: ellipsis;
  170. }
  171. .pre{
  172. font-family: PingFangSC, PingFang SC;
  173. font-weight: 400;
  174. font-size: 24rpx;
  175. color: #86909C;
  176. line-height: 24rpx;
  177. margin-top: 26rpx;
  178. span{
  179. font-family: PingFangSC, PingFang SC;
  180. font-weight: 400;
  181. font-size: 26rpx;
  182. color: #1D2129;
  183. line-height: 26rpx;
  184. margin-left: 20rpx;
  185. &.red{
  186. color: #F95050;
  187. }
  188. }
  189. }
  190. }
  191. }
  192. }
  193. </style>