dataMonitoring-list.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357
  1. <template>
  2. <view>
  3. <!-- <u-navbar title="设备数据监测" title-color="#101010" >
  4. <view class="slot" slot="right">
  5. <image class="img" src="@/assets/img/riLine-road-map-line.svg" mode=""></image>地图
  6. </view>
  7. </u-navbar> -->
  8. <view class="navbar-c">
  9. <view class="back" @click="toStatistics">
  10. <u-icon name="arrow-left" color="#101010" size="36"></u-icon>
  11. </view>
  12. <view class="title">
  13. 设备数据监测<image class="img" src="@/assets/img/refresh-line.svg"></image>
  14. </view>
  15. <view class="right" @click="toDataMonitoringMap">
  16. <image class="img" src="@/assets/img/riLine-road-map-line.svg" mode=""></image>地图
  17. </view>
  18. </view>
  19. <view class="dropdown">
  20. <u-dropdown-change>
  21. <u-dropdown-item v-model="value1" title="全部设备" :options="options1"></u-dropdown-item>
  22. <u-dropdown-item v-model="value2" title="全部状态" :options="options2"></u-dropdown-item>
  23. </u-dropdown-change>
  24. </view>
  25. <view class="main">
  26. <view class="item" v-for="(item,index) in deviceList" :key="index" @click="toElectronicMonitoring(item)">
  27. <view class="title">
  28. <view class="icon-box">
  29. <image class="img" src="@/assets/img/transformer1.svg" mode=""></image>
  30. </view>
  31. <view class="equipment">
  32. <view class="name1">
  33. {{item.name}}
  34. </view>
  35. <view class="name2">
  36. {{item.companyName}}
  37. </view>
  38. </view>
  39. <!-- 状态 -->
  40. <view class="state">
  41. <view class="state1" v-if="item.deviceStatus == '1' && item.temperatureStatus == '1'">
  42. <view class="icon"></view>
  43. <view class="text">
  44. 正常运行
  45. </view>
  46. </view>
  47. <view class="state1" v-else-if="item.deviceStatus == '1' && item.temperatureStatus == '0'">
  48. <view class="icon icon2"></view>
  49. <view class="text">
  50. 温度异常
  51. </view>
  52. </view>
  53. <view class="state1" v-else>
  54. <view class="icon icon3"></view>
  55. <view class="text">
  56. 设备离线
  57. </view>
  58. </view>
  59. <view class="state1" v-if="item.smokeStatus == '1'">
  60. <view class="icon"></view>
  61. <view class="text">
  62. 烟感正常
  63. </view>
  64. </view>
  65. <view class="state1" v-else>
  66. <view class="icon icon2"></view>
  67. <view class="text">
  68. 烟感异常
  69. </view>
  70. </view>
  71. </view>
  72. </view>
  73. <!-- 设备信息 -->
  74. <view class="infos">
  75. <view class="infos-item">
  76. <view class="item-title">
  77. 当前电流:
  78. </view>
  79. <view class="item-value">
  80. {{item.remoteMonitorRecord.dcaTotal.toFixed(2)}}A
  81. </view>
  82. </view>
  83. <view class="infos-item">
  84. <view class="item-title">
  85. 当前电压:
  86. </view>
  87. <view class="item-value">
  88. {{item.remoteMonitorRecord.dcvTop.toFixed(2)}}V
  89. </view>
  90. </view>
  91. <view class="infos-item">
  92. <view class="item-title">
  93. 当前温度:
  94. </view>
  95. <view class="item-value">
  96. {{item.remoteMonitorRecord.temperatureTop}}°C
  97. </view>
  98. </view>
  99. <view class="infos-item">
  100. <view class="item-title">
  101. 当前功率:
  102. </view>
  103. <view class="item-value">
  104. {{(item.remoteMonitorRecord.totalPower).toFixed(2)}}kW
  105. </view>
  106. </view>
  107. <view class="infos-item">
  108. <view class="item-title">
  109. 当前功率因数:
  110. </view>
  111. <view class="item-value">
  112. {{item.remoteMonitorRecord.averPowerFactor}}
  113. </view>
  114. </view>
  115. <view class="infos-item">
  116. <view class="item-title">
  117. 平均功率因数:
  118. </view>
  119. <view class="item-value">
  120. {{item.remoteMonitorRecord.averPowerFactorHistory}}
  121. </view>
  122. </view>
  123. </view>
  124. </view>
  125. </view>
  126. </view>
  127. </template>
  128. <script>
  129. import * as API from '@/apis/pagejs/energy/index.js'
  130. export default {
  131. data() {
  132. return {
  133. deviceList: [],
  134. companyId: '',
  135. pageIndex: 1,
  136. recordsTotal: 0,
  137. value1: 0,
  138. value2: 0,
  139. options1: [{
  140. label: '荆鹏集团',
  141. value: 1,
  142. },
  143. {
  144. label: '青少年宫',
  145. value: 2,
  146. },
  147. {
  148. label: '荆州院子',
  149. value: 3,
  150. },
  151. ],
  152. options2: [{
  153. label: '设备离线',
  154. value: 1,
  155. },
  156. {
  157. label: '温度异常',
  158. value: 2,
  159. },
  160. {
  161. label: '电压异常',
  162. value: 3,
  163. },
  164. {
  165. label: '功率因数异常',
  166. value: 4,
  167. },
  168. ],
  169. }
  170. },
  171. onReady() {
  172. this.getList()
  173. },
  174. onReachBottom() {
  175. if (this.deviceList.length < this.recordsTotal) {
  176. this.myLoadmore();
  177. }
  178. },
  179. methods: {
  180. myLoadmore() {
  181. this.pageIndex += 1;
  182. this.getList();
  183. },
  184. getList(bl) {
  185. uni.showLoading({
  186. title: "加载中",
  187. mask: true,
  188. })
  189. if (bl) {
  190. this.deviceList = [];
  191. this.pageIndex = 1;
  192. }
  193. var data = {
  194. pageIndex: this.pageIndex,
  195. pageSize: 5,
  196. companyId: this.companyId
  197. };
  198. API.homePageDeviceData(data).then((res) => {
  199. uni.hideLoading()
  200. this.deviceList = [
  201. ...this.deviceList,
  202. ...res.data.data
  203. ];
  204. this.recordsTotal = res.data.recordsTotal;
  205. }).catch(error => {
  206. uni.showToast({
  207. title: error,
  208. icon: "none"
  209. })
  210. })
  211. },
  212. toStatistics() {
  213. uni.navigateBack()
  214. },
  215. toDataMonitoringMap() {
  216. uni.navigateTo({
  217. url: '/pages/equipmentDataMonitoring/dataMonitoring-map'
  218. })
  219. },
  220. toElectronicMonitoring() {
  221. uni.navigateTo({
  222. url: '/pages/equipmentDataMonitoring/electronicMonitoring'
  223. })
  224. }
  225. }
  226. }
  227. </script>
  228. <style lang="scss" scoped>
  229. page {
  230. padding-bottom: 100rpx;
  231. }
  232. .back {
  233. z-index: 999;
  234. width: 200rpx;
  235. }
  236. .slot {
  237. display: flex;
  238. align-items: center;
  239. .img {
  240. width: 32rpx;
  241. height: 32rpx;
  242. margin-right: 4rpx;
  243. }
  244. }
  245. .dropdown {
  246. background-color: #fff;
  247. position: sticky;
  248. top: 87rpx;
  249. z-index: 999;
  250. }
  251. .main {
  252. background-color: #fff;
  253. .item {
  254. border-bottom: 1px solid rgba(245, 245, 245, 1);
  255. padding: 32rpx 32rpx 16rpx 32rpx;
  256. .title {
  257. display: flex;
  258. align-items: flex-start;
  259. .icon-box {
  260. width: 72rpx;
  261. height: 72rpx;
  262. border-radius: 4px;
  263. display: flex;
  264. align-items: center;
  265. justify-content: center;
  266. background-color: rgba(219, 234, 255, 1);
  267. .img {
  268. width: 48rpx;
  269. height: 48rpx;
  270. }
  271. }
  272. .equipment {
  273. margin-left: 16rpx;
  274. .name1 {
  275. color: rgba(51, 51, 51, 1);
  276. }
  277. .name2 {
  278. color: rgba(119, 119, 119, 1);
  279. font-size: 24rpx;
  280. margin-top: 4rpx;
  281. }
  282. }
  283. // 状态
  284. .state {
  285. display: flex;
  286. align-items: center;
  287. margin-left: auto;
  288. .state1 {
  289. display: flex;
  290. align-items: center;
  291. margin-left: 24rpx;
  292. .icon {
  293. width: 16rpx;
  294. height: 16rpx;
  295. border-radius: 99px;
  296. background-color: rgba(22, 119, 255, 1);
  297. margin-right: 8rpx;
  298. }
  299. .icon2 {
  300. background-color: #FF4F3F;
  301. }
  302. .icon3 {
  303. background-color: #C2C2C2;
  304. }
  305. }
  306. }
  307. }
  308. // 设备信息
  309. .infos {
  310. margin-top: 32rpx;
  311. display: flex;
  312. align-items: center;
  313. justify-content: space-between;
  314. flex-wrap: wrap;
  315. font-size: 24rpx;
  316. .infos-item {
  317. width: 33%;
  318. display: flex;
  319. margin-bottom: 16rpx;
  320. .warning {
  321. color: rgba(255, 61, 0, 1);
  322. }
  323. }
  324. }
  325. }
  326. }
  327. </style>