dataMonitoring-list.vue 10 KB

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