dataMonitoring-list.vue 9.4 KB

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