index.vue 5.2 KB

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