deviceDetail.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  1. <template>
  2. <view>
  3. <view class="timeBox flex justify-between align-center padding-lr-sm">
  4. <view class="time">{{getData.owner_name}}</view>
  5. <!-- <button class="cu-btn radius bg-offLine sm">
  6. <view class="radiusStatus offLine"></view>
  7. 离线
  8. </button> -->
  9. </view>
  10. <view>
  11. <!-- 基本信息start -->
  12. <view class="basic-info">
  13. <view class="info-tit margin-left-xs">
  14. <text class="cuIcon-titles margin-right-xs"></text>
  15. 基本信息
  16. </view>
  17. <view class="info-content">
  18. <view class="info-one-info ">
  19. <text>设备类型:</text>
  20. <text>{{getData.type_name}}</text>
  21. </view>
  22. <view>
  23. <text>设备编号:</text>
  24. <text>15221</text>
  25. </view>
  26. <view>
  27. <text>物联网卡号:</text>
  28. <text>{{getData.sim}}</text>
  29. </view>
  30. <view>
  31. <text>安装位置:</text>
  32. <text>{{getData.unitinfo}}</text>
  33. </view>
  34. <view>
  35. <text>添加时间:</text>
  36. <text>{{getData.install_time}}</text>
  37. </view>
  38. <view>
  39. <text>设备地址:</text>
  40. <text>{{getData.owner_address}}</text>
  41. </view>
  42. </view>
  43. </view>
  44. <!-- 基本信息end -->
  45. <!-- 报警主机图表start -->
  46. <view class="processStatus" v-if="this.getData.dwtype==1">
  47. <view class="info-tit margin-left-xs">
  48. <text class="cuIcon-titles margin-right-xs"></text>
  49. 图表
  50. </view>
  51. <view class="info-content noborder">
  52. <chart :bindData="staticData"></chart>
  53. </view>
  54. </view>
  55. <!-- 报警主机图表end -->
  56. <!-- 水系统图表start -->
  57. <view class="processStatus" v-if="this.getData.dwtype==2">
  58. <view class="info-tit margin-left-xs">
  59. <text class="cuIcon-titles margin-right-xs"></text>
  60. 图表
  61. </view>
  62. <view class="info-content noborder">
  63. <water-chart :bindData="getData"></water-chart>
  64. </view>
  65. </view>
  66. <!-- 水系统图表end -->
  67. <view class="processStatus" v-if="this.getData.dwtype!=1&&this.getData.dwtype!=2">
  68. <view class="info-tit margin-left-xs">
  69. <text class="cuIcon-titles margin-right-xs"></text>
  70. 表格
  71. </view>
  72. <!-- 电气火灾start -->
  73. <fire-table v-if="this.getData.dwtype==7" :bindData="getFireData"></fire-table>
  74. <!-- 电气火灾end -->
  75. <!-- RTU start -->
  76. <view v-if="this.getData.dwtype==6" class="info-content padding" style="overflow:auto;width:97%">
  77. <table style="width:140%">
  78. <tr>
  79. <th>名称</th>
  80. <th>类型</th>
  81. <th>端口</th>
  82. <th>状态</th>
  83. <th>最后上传时间</th>
  84. </tr>
  85. <tr v-for="(item,index) in this.rtu_data" :key="index">
  86. <td>{{item.data4}}</td>
  87. <td>{{item.types}}</td>
  88. <td>{{item.ncmd}}</td>
  89. <td>{{item.data2}}</td>
  90. <td>{{item.time}}</td>
  91. </tr>
  92. </table>
  93. </view>
  94. <!-- RTU end -->
  95. <!-- 烟感 start -->
  96. <view v-if="this.getData.dwtype==3" class="info-content padding">
  97. <table>
  98. <tr>
  99. <th>烟感状态</th>
  100. <th>电池电量</th>
  101. <th>信号强度</th>
  102. <th>时间</th>
  103. </tr>
  104. <tr>
  105. <td>{{this.getData.device_status}}</td>
  106. <td>{{this.getData.battery_level}}</td>
  107. <td>{{this.getData.rsrq}}</td>
  108. <td>{{this.getData.stime}}</td>
  109. </tr>
  110. </table>
  111. </view>
  112. <!-- 烟感 end -->
  113. <!-- 视频 start -->
  114. <view v-if="this.getData.dwtype==16" class="info-content noborder padding">
  115. <table>
  116. <tr>
  117. <th>最后上传值</th>
  118. <th>最后上传时间</th>
  119. </tr>
  120. <tr v-for="(item,index) in this.video_data">
  121. <td >{{item.data4}}</td>
  122. <td>{{item.time}}</td>
  123. </tr>
  124. </table>
  125. </view>
  126. <!-- 视频 end -->
  127. <!-- 井盖 start -->
  128. <view v-if="this.getData.dwtype==128" class="info-content noborder padding">
  129. <table>
  130. <tr>
  131. <th>最后上传值</th>
  132. <th>最后上传时间</th>
  133. </tr>
  134. <tr v-for="(item,index) in this.mc_data" :key="index">
  135. <td>{{item.data4}}</td>
  136. <td>{{item.time}}</td>
  137. </tr>
  138. </table>
  139. </view>
  140. <!-- 井盖 end -->
  141. <!-- 消防栓 start -->
  142. <view v-if="this.getData.dwtype==4" class="info-content noborder padding">
  143. <table>
  144. <tr>
  145. <th>报警内容</th>
  146. <th>统计时间</th>
  147. </tr>
  148. <tr>
  149. <td>
  150. {{this.getData.device_status}}
  151. </td>
  152. <td>{{this.getData.stime}}</td>
  153. </tr>
  154. </table>
  155. </view>
  156. <!-- 消防栓 end -->
  157. <!-- 液位 start -->
  158. <view v-if="this.getData.dwtype==5" class="info-content noborder padding">
  159. <table>
  160. <tr>
  161. <th>液位水位值</th>
  162. <th>液位统计时间</th>
  163. </tr>
  164. <tr>
  165. <td>
  166. {{this.getData.water_data?this.getData.water_data:'-'}}
  167. </td>
  168. <td>{{this.getData.stime?this.getData.stime:'-'}}</td>
  169. </tr>
  170. </table>
  171. </view>
  172. <!-- 液位 end -->
  173. <!-- 电梯 start -->
  174. <view v-if="this.getData.dwtype==17" class="info-content noborder padding">
  175. <table>
  176. <tr>
  177. <th>告警内容</th>
  178. <th>告警时间</th>
  179. </tr>
  180. <tr v-for="(item,index) in this.getData.elevator_data" :key="index">
  181. <td>
  182. {{item.data4}}
  183. </td>
  184. <td>{{item.time}}</td>
  185. </tr>
  186. </table>
  187. </view>
  188. <!-- 电梯 end -->
  189. </view>
  190. <!-- 表格start -->
  191. <!-- <table-detail v-if="this.getData.dwtype==4"></table-detail> -->
  192. <!-- 表格end -->
  193. <br>
  194. </view>
  195. </view>
  196. </template>
  197. <script>
  198. import chart from './components/chart.vue';
  199. import waterChart from './components/waterChart.vue';
  200. import tableDetail from './components/table-detail.vue';
  201. import fireTable from './components/fireTable.vue';
  202. export default {
  203. components: {
  204. chart,
  205. waterChart,
  206. tableDetail,
  207. fireTable
  208. },
  209. data() {
  210. return {
  211. getData: {},
  212. mc_data: {},
  213. video_data: {}
  214. }
  215. },
  216. onLoad: function(option) {
  217. this.getDeviceDetails({
  218. "id": option.id
  219. })
  220. },
  221. methods: {
  222. // 设备详情数据请求
  223. async getDeviceDetails(params = {}) {
  224. const res = await this.$myRequest({
  225. url: 'DeviceManagement/getDeviceDetails',
  226. data: params,
  227. showLoading: true
  228. })
  229. this.getData = res.data.data[0];
  230. this.staticData = res.data.data[0]
  231. this.getFireData = res.data.data[0].electric_data;
  232. this.rtu_data = res.data.data[0].rtu_data;
  233. if (this.getData.dwtype == 16) {
  234. this.video_data = res.data.data[0].video_data;
  235. }
  236. if (this.getData.dwtype == 128) {
  237. this.mc_data = res.data.data[0].mc_data;
  238. }
  239. console.log(this.mc_data);
  240. },
  241. }
  242. }
  243. </script>
  244. <style lang="scss">
  245. .info-content.noborder> uni-view {
  246. border-bottom: 1px solid rgba(0,0,0,0);
  247. }
  248. </style>