dataMonitoring-list.vue 10 KB

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