deviceDetail.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  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">
  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">
  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==16" class="info-content padding">
  97. <table>
  98. <tr>
  99. <th>最后上传值</th>
  100. <th>最后上传时间</th>
  101. </tr>
  102. <tr>
  103. <td>{{this.video_data.data4}}</td>
  104. <td>{{this.video_data.time}}</td>
  105. </tr>
  106. </table>
  107. </view>
  108. <!-- 视频 end -->
  109. <!-- 井盖 start -->
  110. <view v-if="this.getData.dwtype==128" class="info-content padding">
  111. <table>
  112. <tr>
  113. <th>最后上传值</th>
  114. <th>最后上传时间</th>
  115. </tr>
  116. <tr>
  117. <td>{{this.mc_data.data4}}</td>
  118. </tr>
  119. </table>
  120. </view>
  121. <!-- 井盖 end -->
  122. <!-- 消防栓 start -->
  123. <view v-if="this.getData.dwtype==4" class="info-content padding">
  124. <table>
  125. <tr>
  126. <th>最后上传值</th>
  127. <th>最后上传时间</th>
  128. </tr>
  129. <tr>
  130. <td>
  131. <!-- {{this.getData.device_status}} -->
  132. </td>
  133. <td>{{this.getData.stime}}</td>
  134. </tr>
  135. </table>
  136. </view>
  137. <!-- 消防栓 end -->
  138. <!-- 液位 start -->
  139. <view v-if="this.getData.dwtype==5" class="info-content padding">
  140. <table>
  141. <tr>
  142. <th>液位水位值</th>
  143. <th>液位统计时间</th>
  144. </tr>
  145. <tr>
  146. <td>
  147. {{this.getData.water_data?this.getData.water_data:'-'}}
  148. </td>
  149. <td>{{this.getData.stime?this.getData.stime:'-'}}</td>
  150. </tr>
  151. </table>
  152. </view>
  153. <!-- 液位 end -->
  154. </view>
  155. <!-- 表格start -->
  156. <!-- <table-detail v-if="this.getData.dwtype==4"></table-detail> -->
  157. <!-- 表格end -->
  158. <br>
  159. </view>
  160. </view>
  161. </template>
  162. <script>
  163. import chart from './components/chart.vue';
  164. import waterChart from './components/waterChart.vue';
  165. import tableDetail from './components/table-detail.vue';
  166. import fireTable from './components/fireTable.vue';
  167. export default {
  168. components: {
  169. chart,
  170. waterChart,
  171. tableDetail,
  172. fireTable
  173. },
  174. data() {
  175. return {
  176. getData: {},
  177. mc_data: {},
  178. video_data: {}
  179. }
  180. },
  181. onLoad: function(option) {
  182. this.getDeviceDetails({
  183. "id": option.id
  184. })
  185. },
  186. methods: {
  187. // 设备详情数据请求
  188. async getDeviceDetails(params = {}) {
  189. const res = await this.$myRequest({
  190. url: 'DeviceManagement/getDeviceDetails',
  191. data: params,
  192. showLoading: true
  193. })
  194. this.getData = res.data.data[0];
  195. this.staticData = res.data.data[0]
  196. this.getFireData = res.data.data[0].electric_data;
  197. this.rtu_data = res.data.data[0].rtu_data;
  198. if (this.getData.dwtype == 16) {
  199. this.video_data = res.data.data[0].video_data[0];
  200. }
  201. if (this.getData.dwtype == 128) {
  202. this.mc_data = res.data.data[0].mc_data[0];
  203. }
  204. console.log(this.mc_data);
  205. },
  206. }
  207. }
  208. </script>
  209. <style lang="scss">
  210. </style>