dataMonitoring-list.vue 9.4 KB

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