dataMonitoring-list.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473
  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">
  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">
  147. 已经到底了</u-divider>
  148. </view>
  149. </view>
  150. </template>
  151. <script>
  152. import * as API from '@/apis/pagejs/index.js'
  153. export default {
  154. data() {
  155. return {
  156. show2: false, // 状态选择
  157. state: '全部状态',
  158. stateList: [
  159. {label: '全部状态', value: ''},
  160. {label: '设备正常', value: '0'},
  161. {label: '设备离线', value: '1'},
  162. {label: '温度异常', value: '2'},
  163. {label: '烟感异常', value: '3'},
  164. {label: '设备异常', value: '4'}
  165. ],
  166. show1: false, // 设备选择
  167. device: '全部设备',
  168. selectDeviceList: [],
  169. deviceList: [],
  170. companyId: '',
  171. status: '',
  172. pageIndex: 1,
  173. recordsTotal: 0,
  174. value1: 0,
  175. value2: 0,
  176. options1: [{
  177. label: '荆鹏集团',
  178. value: 1,
  179. },
  180. {
  181. label: '青少年宫',
  182. value: 2,
  183. },
  184. {
  185. label: '荆州院子',
  186. value: 3,
  187. },
  188. ],
  189. options2: [{
  190. label: '设备离线',
  191. value: 1,
  192. },
  193. {
  194. label: '温度异常',
  195. value: 2,
  196. },
  197. {
  198. label: '电压异常',
  199. value: 3,
  200. },
  201. {
  202. label: '功率因数异常',
  203. value: 4,
  204. },
  205. ],
  206. }
  207. },
  208. onReady() {
  209. this.getList();
  210. this.getAlarmConfiguration();
  211. },
  212. onReachBottom() {
  213. if (this.deviceList.length < this.recordsTotal) {
  214. this.myLoadmore();
  215. }
  216. },
  217. methods: {
  218. // 异常查询条件
  219. getAlarmConfiguration() {
  220. uni.showLoading({
  221. title: "加载中",
  222. mask: true,
  223. })
  224. API.alarmConfiguration().then((response) => {
  225. uni.hideLoading();
  226. var list2 = [];
  227. if(response.data.companyInfoList && response.data.companyInfoList.length != 0) {
  228. list2 = response.data.companyInfoList.map(item => {
  229. return {
  230. label: item.name,
  231. value: item.id
  232. }
  233. });
  234. }
  235. list2.unshift({
  236. value: '',
  237. label: '全部设备'
  238. });
  239. this.selectDeviceList = list2;
  240. }).catch(error => {
  241. uni.showToast({
  242. title: error,
  243. icon: "none"
  244. })
  245. })
  246. },
  247. // 状态查询
  248. stateChange(e) {
  249. console.log(e);
  250. this.status = e[0].value;
  251. this.state = e[0].label;
  252. this.getList(true);
  253. },
  254. // 设备查询
  255. deviceChange(e) {
  256. console.log(e);
  257. this.companyId = e[0].value;
  258. this.device = e[0].label;
  259. this.getList(true);
  260. },
  261. myLoadmore() {
  262. this.pageIndex += 1;
  263. this.getList();
  264. },
  265. getList(bl) {
  266. uni.showLoading({
  267. title: "加载中",
  268. mask: true,
  269. })
  270. if (bl) {
  271. this.deviceList = [];
  272. this.pageIndex = 1;
  273. }
  274. var data = {
  275. pageIndex: this.pageIndex,
  276. pageSize: 5,
  277. companyId: this.companyId,
  278. status: this.status
  279. };
  280. API.homePageDeviceData(data).then((res) => {
  281. uni.hideLoading()
  282. this.deviceList = [
  283. ...this.deviceList,
  284. ...res.data.data
  285. ];
  286. this.recordsTotal = res.data.recordsTotal;
  287. }).catch(error => {
  288. uni.showToast({
  289. title: error,
  290. icon: "none"
  291. })
  292. })
  293. },
  294. toStatistics() {
  295. uni.navigateBack()
  296. },
  297. toDataMonitoringMap() {
  298. uni.navigateTo({
  299. url: '/pages/equipmentDataMonitoring/dataMonitoring-map'
  300. })
  301. },
  302. toElectronicMonitoring(item) {
  303. uni.navigateTo({
  304. url: '/pages/equipmentDataMonitoring/electronicMonitoring?id=' + item.id + '&name=' + item.name
  305. + '&companyId=' + item.companyId
  306. })
  307. }
  308. }
  309. }
  310. </script>
  311. <style lang="scss" scoped>
  312. page {
  313. padding-bottom: 100rpx;
  314. }
  315. .dropdown {
  316. background-color: #fff;
  317. position: sticky;
  318. top: 88rpx;
  319. z-index: 999;
  320. padding: 18rpx 46rpx;
  321. display: flex;
  322. border-bottom: 1px solid rgba(245, 245, 245, 1);
  323. .dropdown-item{
  324. width: 50%;
  325. text-align: center;
  326. height: 60rpx;
  327. line-height: 60rpx;
  328. }
  329. }
  330. .back {
  331. z-index: 999;
  332. width: 200rpx;
  333. }
  334. .slot {
  335. display: flex;
  336. align-items: center;
  337. .img {
  338. width: 32rpx;
  339. height: 32rpx;
  340. margin-right: 4rpx;
  341. }
  342. }
  343. .dropdown {
  344. background-color: #fff;
  345. position: sticky;
  346. top: 87rpx;
  347. z-index: 999;
  348. }
  349. .main {
  350. background-color: #fff;
  351. .item {
  352. border-bottom: 1px solid rgba(245, 245, 245, 1);
  353. padding: 32rpx 32rpx 16rpx 32rpx;
  354. .title {
  355. display: flex;
  356. align-items: flex-start;
  357. .icon-box {
  358. width: 72rpx;
  359. height: 72rpx;
  360. border-radius: 4px;
  361. display: flex;
  362. align-items: center;
  363. justify-content: center;
  364. background-color: rgba(219, 234, 255, 1);
  365. .img {
  366. width: 48rpx;
  367. height: 48rpx;
  368. }
  369. }
  370. .equipment {
  371. margin-left: 16rpx;
  372. .name1 {
  373. color: rgba(51, 51, 51, 1);
  374. }
  375. .name2 {
  376. color: rgba(119, 119, 119, 1);
  377. font-size: 24rpx;
  378. margin-top: 4rpx;
  379. }
  380. }
  381. // 状态
  382. .state {
  383. display: flex;
  384. align-items: center;
  385. flex-wrap: wrap;
  386. justify-content: flex-end;
  387. margin-left: auto;
  388. flex: 1;
  389. .state1 {
  390. display: flex;
  391. align-items: center;
  392. margin-left: 24rpx;
  393. .icon {
  394. width: 16rpx;
  395. height: 16rpx;
  396. border-radius: 99px;
  397. background-color: rgba(22, 119, 255, 1);
  398. margin-right: 8rpx;
  399. }
  400. .icon2 {
  401. background-color: #FF4F3F;
  402. }
  403. .icon3 {
  404. background-color: #C2C2C2;
  405. }
  406. .icon4{
  407. background-color: rgba(0,185,98,1);
  408. }
  409. }
  410. }
  411. .more{
  412. margin-left: 8rpx;
  413. }
  414. }
  415. // 设备信息
  416. .infos {
  417. margin-top: 32rpx;
  418. display: flex;
  419. align-items: center;
  420. justify-content: space-between;
  421. flex-wrap: wrap;
  422. font-size: 24rpx;
  423. .infos-item {
  424. // width: 33%;
  425. display: flex;
  426. margin-bottom: 16rpx;
  427. color: rgba(51,51,51,1);
  428. font-size: 24rpx;
  429. .item-value{
  430. font-weight: bold;
  431. }
  432. .warning {
  433. color: rgba(255, 61, 0, 1);
  434. }
  435. }
  436. }
  437. }
  438. }
  439. </style>