deviceDetail.vue 7.6 KB

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