dataMonitoring-list.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359
  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" v-if="false">
  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. <u-divider :isnone="deviceList.length==0" v-if="deviceList.length==recordsTotal" nonetext="没有找到相关内容"
  126. border-color="#CFD2D5">已经到底了</u-divider>
  127. </view>
  128. </view>
  129. </template>
  130. <script>
  131. import * as API from '@/apis/pagejs/energy/index.js'
  132. export default {
  133. data() {
  134. return {
  135. deviceList: [],
  136. companyId: '',
  137. pageIndex: 1,
  138. recordsTotal: 0,
  139. value1: 0,
  140. value2: 0,
  141. options1: [{
  142. label: '荆鹏集团',
  143. value: 1,
  144. },
  145. {
  146. label: '青少年宫',
  147. value: 2,
  148. },
  149. {
  150. label: '荆州院子',
  151. value: 3,
  152. },
  153. ],
  154. options2: [{
  155. label: '设备离线',
  156. value: 1,
  157. },
  158. {
  159. label: '温度异常',
  160. value: 2,
  161. },
  162. {
  163. label: '电压异常',
  164. value: 3,
  165. },
  166. {
  167. label: '功率因数异常',
  168. value: 4,
  169. },
  170. ],
  171. }
  172. },
  173. onReady() {
  174. this.getList()
  175. },
  176. onReachBottom() {
  177. if (this.deviceList.length < this.recordsTotal) {
  178. this.myLoadmore();
  179. }
  180. },
  181. methods: {
  182. myLoadmore() {
  183. this.pageIndex += 1;
  184. this.getList();
  185. },
  186. getList(bl) {
  187. uni.showLoading({
  188. title: "加载中",
  189. mask: true,
  190. })
  191. if (bl) {
  192. this.deviceList = [];
  193. this.pageIndex = 1;
  194. }
  195. var data = {
  196. pageIndex: this.pageIndex,
  197. pageSize: 5,
  198. companyId: this.companyId
  199. };
  200. API.homePageDeviceData(data).then((res) => {
  201. uni.hideLoading()
  202. this.deviceList = [
  203. ...this.deviceList,
  204. ...res.data.data
  205. ];
  206. this.recordsTotal = res.data.recordsTotal;
  207. }).catch(error => {
  208. uni.showToast({
  209. title: error,
  210. icon: "none"
  211. })
  212. })
  213. },
  214. toStatistics() {
  215. uni.navigateBack()
  216. },
  217. toDataMonitoringMap() {
  218. uni.navigateTo({
  219. url: '/pages/equipmentDataMonitoring/dataMonitoring-map'
  220. })
  221. },
  222. toElectronicMonitoring() {
  223. uni.navigateTo({
  224. url: '/pages/equipmentDataMonitoring/electronicMonitoring'
  225. })
  226. }
  227. }
  228. }
  229. </script>
  230. <style lang="scss" scoped>
  231. page {
  232. padding-bottom: 100rpx;
  233. }
  234. .back {
  235. z-index: 999;
  236. width: 200rpx;
  237. }
  238. .slot {
  239. display: flex;
  240. align-items: center;
  241. .img {
  242. width: 32rpx;
  243. height: 32rpx;
  244. margin-right: 4rpx;
  245. }
  246. }
  247. .dropdown {
  248. background-color: #fff;
  249. position: sticky;
  250. top: 87rpx;
  251. z-index: 999;
  252. }
  253. .main {
  254. background-color: #fff;
  255. .item {
  256. border-bottom: 1px solid rgba(245, 245, 245, 1);
  257. padding: 32rpx 32rpx 16rpx 32rpx;
  258. .title {
  259. display: flex;
  260. align-items: flex-start;
  261. .icon-box {
  262. width: 72rpx;
  263. height: 72rpx;
  264. border-radius: 4px;
  265. display: flex;
  266. align-items: center;
  267. justify-content: center;
  268. background-color: rgba(219, 234, 255, 1);
  269. .img {
  270. width: 48rpx;
  271. height: 48rpx;
  272. }
  273. }
  274. .equipment {
  275. margin-left: 16rpx;
  276. .name1 {
  277. color: rgba(51, 51, 51, 1);
  278. }
  279. .name2 {
  280. color: rgba(119, 119, 119, 1);
  281. font-size: 24rpx;
  282. margin-top: 4rpx;
  283. }
  284. }
  285. // 状态
  286. .state {
  287. display: flex;
  288. align-items: center;
  289. margin-left: auto;
  290. .state1 {
  291. display: flex;
  292. align-items: center;
  293. margin-left: 24rpx;
  294. .icon {
  295. width: 16rpx;
  296. height: 16rpx;
  297. border-radius: 99px;
  298. background-color: rgba(22, 119, 255, 1);
  299. margin-right: 8rpx;
  300. }
  301. .icon2 {
  302. background-color: #FF4F3F;
  303. }
  304. .icon3 {
  305. background-color: #C2C2C2;
  306. }
  307. }
  308. }
  309. }
  310. // 设备信息
  311. .infos {
  312. margin-top: 32rpx;
  313. display: flex;
  314. align-items: center;
  315. justify-content: space-between;
  316. flex-wrap: wrap;
  317. font-size: 24rpx;
  318. .infos-item {
  319. width: 33%;
  320. display: flex;
  321. margin-bottom: 16rpx;
  322. .warning {
  323. color: rgba(255, 61, 0, 1);
  324. }
  325. }
  326. }
  327. }
  328. }
  329. </style>