statistics.vue 27 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273
  1. <template>
  2. <view>
  3. <!-- 导航栏 -->
  4. <view class="navbar">
  5. <view class="title">
  6. 能源中心
  7. </view>
  8. <view class="icon" @click="toDataMonitoringList" v-if="false">
  9. <image class="img" src="@/assets/img/riLine-equalizer-line.svg" mode=""></image>
  10. </view>
  11. </view>
  12. <!-- 标签 -->
  13. <view class="tabs-box">
  14. <view class="tabs" v-if="companyList.length >2">
  15. <u-tabs :list="merchantList1" :is-scroll="false" active-color="#fff" inactive-color="#CCE2FF" bg-color="#1677FF"
  16. :current="current" @change="change"></u-tabs>
  17. </view>
  18. <view class="more" @click="popShow=true" v-if="companyList.length >2">
  19. <u-icon name="arrow-down" color="#fff" size="40"></u-icon>
  20. </view>
  21. </view>
  22. <!-- 标签弹出层 -->
  23. <u-popup v-model="popShow" duration="10" mode="top" :negative-top="88" border-radius="16">
  24. <view class="popup-tabs">
  25. <view class="tabs">
  26. <u-tabs :list="merchantList1" :is-scroll="false" :current="current" @change="change"></u-tabs>
  27. </view>
  28. <view class="more">
  29. <u-icon name="arrow-up" color="#777777" size="40" @click="popShow=false"></u-icon>
  30. </view>
  31. </view>
  32. <view class="tabs-options">
  33. <view class="item" v-for="(item, index) in merchantList2" :key="index" @click="merchantChange(item,index)">
  34. {{item.name}}
  35. </view>
  36. </view>
  37. </u-popup>
  38. <view class="main">
  39. <!-- 统计1 -->
  40. <view class="statistics-1">
  41. <view class="item" @click="toDataMonitoringList">
  42. <view class="item-top">
  43. <view class="img-box">
  44. <u-circle-progress active-color="#2979ff" :percent="alarmsPercent" width="88">
  45. </u-circle-progress>
  46. </view>
  47. <view class="number">
  48. <view class="normal">
  49. 正常:{{alarmsForm.okNum}}台
  50. </view>
  51. <view class="abnormal">
  52. 异常:{{alarmsForm.errorNum}}台
  53. </view>
  54. </view>
  55. </view>
  56. <!-- 累计 -->
  57. <view class="total">
  58. 本月累计报警 <text class="total-number">{{alarmsForm.errorMonthNum}}</text> 次
  59. </view>
  60. </view>
  61. <view class="item" @click="toWorkOrderManagement()">
  62. <view class="item-top">
  63. <view class="img-box">
  64. <u-circle-progress active-color="#2979ff" :percent="0" width="88">
  65. </u-circle-progress>
  66. </view>
  67. <view class="number">
  68. <view class="normal">
  69. 未处理:0
  70. </view>
  71. <view class="abnormal">
  72. 已处理:0
  73. </view>
  74. </view>
  75. </view>
  76. <!-- 累计 -->
  77. <view class="total">
  78. 本月累计工单 <text class="total-number">0</text> 条
  79. </view>
  80. </view>
  81. </view>
  82. <!-- 用电量 -->
  83. <view class="statistics-e statistics" v-if="codes.indexOf('reading') != -1">
  84. <view class="title">
  85. <view class="icon">
  86. <image class="img" src="@/assets/img/circleCopy1@1x.png" mode=""></image>
  87. </view>
  88. <view class="text">
  89. 用电量 (度)
  90. </view>
  91. <view class="change" @click="getPowerConsumption(1)">
  92. <image class="change-img" src="@/assets/img/refresh-line.svg" mode=""></image>
  93. <text>换一批</text>
  94. </view>
  95. <view class="check-all" @click="toEquipmentElectricity">
  96. 查看全部<u-icon name="arrow-right" size="24" color="#838383"></u-icon>
  97. </view>
  98. </view>
  99. <view class="electricity">
  100. <view class="item" v-for="(item, index) in kWhList" :key="index" @click="toElectronicMonitoring(item)">
  101. <view class="equipment">
  102. <view class="equipment1 equipment-text-overflow">
  103. {{item.name}}
  104. </view>
  105. <view class="equipment2 equipment-text-overflow">
  106. <view class="companyName">
  107. {{item.companyName}}
  108. </view>
  109. <!-- 离线 -->
  110. <view class="state" v-if="!item.online">
  111. <text class="off-line"></text>离线
  112. </view>
  113. <!-- 在线 -->
  114. <view class="state state2" v-else>
  115. <text class="on-line"></text>在线
  116. </view>
  117. </view>
  118. </view>
  119. <view class="electricity">
  120. <view class="electricity-item">
  121. <view class="number">
  122. {{item.thisDayKwh}}
  123. </view>
  124. <view class="date">
  125. 今日
  126. </view>
  127. </view>
  128. <view class="electricity-item">
  129. <view class="number">
  130. {{item.thisMonthKwh}}
  131. </view>
  132. <view class="date">
  133. 本月
  134. </view>
  135. </view>
  136. <view class="electricity-item">
  137. <view class="number">
  138. {{item.lastMonthKwh}}
  139. </view>
  140. <view class="date">
  141. 上月
  142. </view>
  143. </view>
  144. </view>
  145. </view>
  146. </view>
  147. </view>
  148. <!-- 统计2 异常告警记录 -->
  149. <view class="statistics-2 statistics" v-if="false">
  150. <view class="title">
  151. <view class="icon">
  152. <image class="img" src="@/assets/img/circleCopy1@1x.png" mode=""></image>
  153. </view>
  154. <view class="text">
  155. 异常告警记录
  156. </view>
  157. <view class="check-all" @click="gotoUrl('/pages/abnormal/abnormalAlarmRecord')">
  158. 查看全部<u-icon name="arrow-right" size="24" color="#838383"></u-icon>
  159. </view>
  160. </view>
  161. <!-- 异常 -->
  162. <view class="abnormal-item" v-for="item in 3"
  163. @click="gotoUrl('/pages/abnormal/abnormalAlarmDetails?id=')">
  164. <view class="item-title">
  165. <!-- <image class="img" src="@/assets/img/riFill-error-warning-fill 1.svg"></image> -->
  166. <view class="name">
  167. 温度异常
  168. </view>
  169. <view class="date">
  170. 2024-02-14 09:00:01
  171. </view>
  172. </view>
  173. <view class="item-value">
  174. <view class="value1">
  175. 荆鹏软件园01
  176. </view>
  177. <view class="value2">
  178. 荆鹏集团
  179. </view>
  180. </view>
  181. </view>
  182. </view>
  183. <!-- 统计3 设备数据监测-->
  184. <view class="statistics-3 statistics" v-if="codes.indexOf('detector') != -1">
  185. <view class="title">
  186. <view class="icon">
  187. <image class="img" src="@/assets/img/circleCopy1@1x.png" mode=""></image>
  188. </view>
  189. <view class="text">
  190. 设备数据监测
  191. </view>
  192. <view class="change" @click="getEquipmentDataMonitoring(1)">
  193. <image class="change-img" src="@/assets/img/refresh-line.svg" mode=""></image>
  194. <text>换一批</text>
  195. </view>
  196. <view class="check-all" @click="toDataMonitoringList">
  197. 查看全部<u-icon name="arrow-right" size="24" color="#838383"></u-icon>
  198. </view>
  199. </view>
  200. <view class="monitoring-item" v-for="(item, index) in deviceList" :key="index"
  201. @click="toElectronicMonitoring(item)">
  202. <view class="item-title">
  203. <view class="text1">
  204. {{item.name}}
  205. </view>
  206. <view class="text2">
  207. {{item.companyName}}
  208. </view>
  209. <view class="state">
  210. <view class="state1">
  211. <view class="icon">
  212. <image class="img" src="@/assets/img/antFill-alert.svg" mode=""></image>
  213. </view>
  214. {{item.temperatureStatus=='1' ? '正常' : '异常'}}
  215. </view>
  216. <view class="state2">
  217. <view class="icon">
  218. <image class="img" src="@/assets/img/smoke.svg" mode=""></image>
  219. </view>
  220. {{item.smokeStatus=='1' ? '正常' : '异常'}}
  221. </view>
  222. </view>
  223. </view>
  224. <!-- 监控信息 -->
  225. <view class="infos">
  226. <view class="infos-item">
  227. <view class="icon">
  228. <img src="../../assets/img/iconPark-electric-wave 1.svg" alt="" />
  229. </view>
  230. <view class="text">
  231. {{item.remoteMonitorRecord.dcaTotal.toFixed(2)}}A
  232. </view>
  233. </view>
  234. <view class="infos-item">
  235. <view class="icon">
  236. <img src="../../assets/img/voltage.svg" alt="" />
  237. </view>
  238. <view class="text">
  239. {{item.remoteMonitorRecord.dcvTop.toFixed(2)}}V
  240. </view>
  241. </view>
  242. <view class="infos-item">
  243. <view class="icon">
  244. <img src="../../assets/img/iconPark-thermometer.svg" alt="" />
  245. </view>
  246. <view class="text">
  247. {{item.remoteMonitorRecord.temperatureTop}}℃
  248. </view>
  249. </view>
  250. <view class="infos-item">
  251. <view class="icon">
  252. <img src="../../assets/img/power.svg" alt="" />
  253. </view>
  254. <view class="text">
  255. {{(item.remoteMonitorRecord.totalPower).toFixed(2)}}kW
  256. </view>
  257. </view>
  258. <view class="infos-item">
  259. <view class="icon">
  260. <img src="../../assets/img/powerFactor.svg" alt="" />
  261. </view>
  262. <view class="text">
  263. {{item.remoteMonitorRecord.averPowerFactor}} /
  264. {{item.remoteMonitorRecord.averPowerFactorHistory}}
  265. </view>
  266. </view>
  267. </view>
  268. </view>
  269. </view>
  270. <!--设备状态-->
  271. <view class="statistics-4 statistics" v-if="false">
  272. <view class="title">
  273. <view class="icon">
  274. <image class="img" src="@/assets/img/circleCopy1@1x.png" mode=""></image>
  275. </view>
  276. <view class="text">
  277. 设备状态
  278. </view>
  279. </view>
  280. <view class="chat">
  281. <view id="pieEcharts" style="min-height:620rpx;">
  282. </view>
  283. </view>
  284. </view>
  285. <!-- 故障类型 -->
  286. <view class="statistics-5 statistics" v-if="false">
  287. <view class="title">
  288. <view class="icon">
  289. <image class="img" src="@/assets/img/circleCopy1@1x.png" mode=""></image>
  290. </view>
  291. <view class="text">
  292. 故障类型
  293. </view>
  294. </view>
  295. <view class="chat">
  296. <view id="barEcharts" style="min-height:410rpx;">
  297. </view>
  298. </view>
  299. </view>
  300. <!-- 工单处理 -->
  301. <view class="statistics-6 statistics" v-if="false">
  302. <view class="title">
  303. <view class="icon">
  304. <image class="img" src="@/assets/img/circleCopy1@1x.png" mode=""></image>
  305. </view>
  306. <view class="text">
  307. 工单处理
  308. </view>
  309. </view>
  310. <view class="chat">
  311. <view id="lineEcharts" style="min-height:410rpx;">
  312. </view>
  313. </view>
  314. </view>
  315. <!-- 异常设备排名 -->
  316. <view class="statistics statistics-ranking" v-if="false">
  317. <view class="title">
  318. <view class="icon">
  319. <image class="img" src="@/assets/img/circleCopy1@1x.png" mode=""></image>
  320. </view>
  321. <view class="text">
  322. 异常设备排名
  323. </view>
  324. </view>
  325. <!-- 合计 -->
  326. <view class="total">
  327. 本年度共有<text> 42</text>次设备异常告警
  328. </view>
  329. <view class="ranking-main">
  330. <view class="item" @click="gotoUrl('/pages/equipmentDataMonitoring/electronicMonitoring?id='+'&name=')">
  331. <view class="ranking">
  332. 1
  333. </view>
  334. <view class="icon">
  335. <image class="img" src="@/assets/img/transformer1.svg" mode=""></image>
  336. </view>
  337. <view class="name">
  338. <view class="name1">
  339. 荆鹏软件园01
  340. </view>
  341. <view class="name2">
  342. 荆鹏集团
  343. </view>
  344. </view>
  345. <view class="time">
  346. 5次
  347. </view>
  348. </view>
  349. </view>
  350. <!-- 查看全部排名 -->
  351. <view class="check-all" @click="gotoUrl('/pages/abnormal/abnormalDeviceRanking')">
  352. 查看全部排名 <u-icon name="arrow-down" size="24" color="rgba(119,119,119,1)"></u-icon>
  353. </view>
  354. </view>
  355. </view>
  356. <energyCenterTabbar :current="0"></energyCenterTabbar>
  357. </view>
  358. </template>
  359. <script>
  360. import energyCenterTabbar from '@/components/energyCenterTabbar.vue'
  361. import * as echarts from 'echarts';
  362. import * as API from '@/apis/pagejs/energy/index.js'
  363. export default {
  364. components: {
  365. energyCenterTabbar
  366. },
  367. data() {
  368. return {
  369. alarmsPercent: 0,
  370. alarmsForm: {
  371. okNum: 0,
  372. errorNum: 0,
  373. errorMonthNum: 0
  374. }, // 累计报警
  375. companyId: '', // 商户ID
  376. pageIndexe: 1, // 设备数据检测
  377. totalPagee: 1,
  378. deviceList: [],
  379. pageIndexp: 1, // 用电量
  380. totalPagep: 1,
  381. kWhList: [],
  382. codes: '', // 判断:reading用电量 detector设备数据检测
  383. merchantList1: [], // 商户
  384. merchantList2: [],
  385. companyList: [],
  386. popShow: false,
  387. current: 0,
  388. myLineChart: null,
  389. myBarChart: null,
  390. myPieChart: null
  391. }
  392. },
  393. onLoad() {
  394. this.getfindByOpenId();
  395. this.getPowerConsumption(0);
  396. this.getEquipmentDataMonitoring(0);
  397. this.getCompanyInfoList();
  398. this.getAccumulatedAlarms();
  399. },
  400. // onReady() {
  401. // this.getPieCharts();
  402. // this.getBarCharts();
  403. // this.getLineCharts();
  404. // },
  405. methods: {
  406. merchantChange(item, index) {
  407. var m = item;
  408. var n = this.merchantList1[this.current];
  409. this.merchantList1[this.current] = m;
  410. this.merchantList2[index] = n;
  411. this.companyId = item.id;
  412. this.getPowerConsumption(0);
  413. this.getEquipmentDataMonitoring(0);
  414. this.getAccumulatedAlarms();
  415. this.popShow = false;
  416. },
  417. // 单位
  418. getCompanyInfoList() {
  419. this.merchantList1 = [];
  420. this.merchantList2 = [];
  421. uni.showLoading({
  422. title: "加载中",
  423. mask: true,
  424. })
  425. API.deviceCompanyList().then((response) => {
  426. uni.hideLoading();
  427. this.companyList = response.data.companyInfoList;
  428. if (this.companyList.length > 3) {
  429. this.merchantList1.push(this.companyList.slice(0, 3));
  430. this.merchantList2.push(this.companyList.slice(3));
  431. } else {
  432. this.merchantList1 = this.companyList;
  433. }
  434. this.merchantList1.unshift({
  435. id: '',
  436. name: '全部'
  437. });
  438. }).catch(error => {
  439. uni.showToast({
  440. title: error,
  441. icon: "none"
  442. })
  443. })
  444. },
  445. // 商户ID
  446. getfindByOpenId() {
  447. uni.showLoading({
  448. title: "加载中",
  449. mask: true,
  450. })
  451. API.findByOpenId({
  452. openId: this.carhelp.getOpenId()
  453. }).then((response) => {
  454. uni.hideLoading();
  455. this.codes = response.data.regUser.codes;
  456. }).catch(error => {
  457. uni.showToast({
  458. title: error,
  459. icon: "none"
  460. })
  461. })
  462. },
  463. // 设备数据监测
  464. getEquipmentDataMonitoring(pl) {
  465. this.pageIndexe = this.pageIndexe + pl;
  466. if (this.pageIndexe > this.totalPagee) {
  467. this.pageIndexe = 1;
  468. }
  469. uni.showLoading({
  470. title: "加载中",
  471. mask: true,
  472. })
  473. API.homePageDeviceData({
  474. pageIndex: this.pageIndexe,
  475. pageSize: 5,
  476. companyId: this.companyId
  477. }).then((response) => {
  478. uni.hideLoading();
  479. this.deviceList = response.data.data;
  480. this.totalPagee = response.data.totalPage;
  481. }).catch(error => {
  482. uni.showToast({
  483. title: error,
  484. icon: "none"
  485. })
  486. })
  487. },
  488. // 异常告警记录
  489. getAbnormalAlarmRecord() {
  490. },
  491. // 用电量
  492. getPowerConsumption(pl) {
  493. this.pageIndexp = this.pageIndexp + pl;
  494. if (this.pageIndexp > this.totalPagep) {
  495. this.pageIndexp = 1;
  496. }
  497. uni.showLoading({
  498. title: "加载中",
  499. mask: true,
  500. })
  501. API.homePageKwh({
  502. pageIndex: this.pageIndexp,
  503. pageSize: 5,
  504. companyId: this.companyId
  505. }).then((response) => {
  506. uni.hideLoading();
  507. this.kWhList = response.data.data;
  508. this.totalPagep = response.data.totalPage;
  509. }).catch(error => {
  510. uni.showToast({
  511. title: error,
  512. icon: "none"
  513. })
  514. })
  515. },
  516. // 累计工单
  517. getAccumulatedWorkOrders() {
  518. },
  519. // 累计报警
  520. getAccumulatedAlarms() {
  521. uni.showLoading({
  522. title: "加载中",
  523. mask: true,
  524. })
  525. API.deviceStatus({
  526. companyId: this.companyId
  527. }).then((response) => {
  528. uni.hideLoading();
  529. this.alarmsForm = response.data;
  530. this.alarmsPercent = this.alarmsForm.okNum / (this.alarmsForm.okNum + this.alarmsForm.errorNum) * 100;
  531. }).catch(error => {
  532. uni.showToast({
  533. title: error,
  534. icon: "none"
  535. })
  536. })
  537. },
  538. getLineCharts() {
  539. if (!this.myLineChart) {
  540. this.myLineChart = echarts.init(document.getElementById('lineEcharts'));
  541. }
  542. var option = {
  543. tooltip: {
  544. trigger: 'axis',
  545. axisPointer: {
  546. type: 'shadow'
  547. }
  548. },
  549. legend: {
  550. data: ['新增工单', '处理工单', '剩余工单']
  551. },
  552. grid: {
  553. left: '3%',
  554. right: '4%',
  555. bottom: '3%',
  556. containLabel: true
  557. },
  558. xAxis: {
  559. type: 'category',
  560. data: ['1日', '2日', '3日', '4日', '5日', '6日']
  561. },
  562. yAxis: {
  563. type: 'value'
  564. },
  565. series: [{
  566. name: '新增工单',
  567. type: 'line',
  568. data: [2, 1, 0, 1, 3, 0],
  569. itemStyle: {
  570. color: '#FF3D00'
  571. }
  572. },
  573. {
  574. name: '处理工单',
  575. type: 'line',
  576. data: [3, 1, 1, 0, 2, 1],
  577. itemStyle: {
  578. color: '#FF7B00'
  579. }
  580. },
  581. {
  582. name: '剩余工单',
  583. type: 'line',
  584. data: [5, 2, 1, 1, 5, 1],
  585. itemStyle: {
  586. color: '#58A55C'
  587. }
  588. }
  589. ]
  590. };
  591. this.myLineChart.setOption(option);
  592. },
  593. getBarCharts() {
  594. if (!this.myBarChart) {
  595. this.myBarChart = echarts.init(document.getElementById('barEcharts'));
  596. }
  597. var option = {
  598. tooltip: {
  599. trigger: 'axis',
  600. axisPointer: {
  601. type: 'shadow'
  602. }
  603. },
  604. legend: {},
  605. grid: {
  606. left: '3%',
  607. right: '4%',
  608. bottom: '3%',
  609. containLabel: true
  610. },
  611. xAxis: [{
  612. type: 'category',
  613. data: ['一月', '二月', '三月']
  614. }],
  615. yAxis: [{
  616. type: 'value'
  617. }],
  618. barGap: '0',
  619. series: [{
  620. name: '温度异常',
  621. type: 'bar',
  622. data: [100, 140, 230],
  623. itemStyle: {
  624. color: '#FF3D00'
  625. }
  626. },
  627. {
  628. name: '电压异常',
  629. type: 'bar',
  630. data: [150, 100, 200],
  631. itemStyle: {
  632. color: '#FF7B00'
  633. }
  634. },
  635. {
  636. name: '功率因素异常',
  637. type: 'bar',
  638. data: [50, 80, 100],
  639. itemStyle: {
  640. color: '#FFAE00'
  641. }
  642. }
  643. ]
  644. };
  645. this.myBarChart.setOption(option);
  646. },
  647. getPieCharts() {
  648. if (!this.myPieChart) {
  649. this.myPieChart = echarts.init(document.getElementById('pieEcharts'));
  650. }
  651. var option = {
  652. tooltip: {
  653. trigger: 'item',
  654. },
  655. legend: {
  656. top: '0%',
  657. left: 'center'
  658. },
  659. series: [{
  660. type: 'pie',
  661. top: '10%',
  662. radius: ['45%', '60%'],
  663. label: {
  664. formatter: '{name|{b}}\n{value|{c}}',
  665. fontSize: 12,
  666. position: 'outer',
  667. bleedMargin: 5,
  668. rich: {
  669. name: {
  670. align: 'left'
  671. },
  672. value: {
  673. align: 'left'
  674. }
  675. }
  676. },
  677. emphasis: {
  678. label: {
  679. itemStyle: {
  680. shadowBlur: 10,
  681. shadowOffsetX: 0,
  682. shadowColor: 'rgba(0, 0, 0, 0.5)'
  683. }
  684. }
  685. },
  686. data: [{
  687. value: 2,
  688. name: '温度异常',
  689. itemStyle: {
  690. color: '#FF4F3F'
  691. }
  692. },
  693. {
  694. value: 3,
  695. name: '电压异常',
  696. itemStyle: {
  697. color: '#FF7B00'
  698. }
  699. },
  700. {
  701. value: 8,
  702. name: '正常运行',
  703. itemStyle: {
  704. color: '#1677FF'
  705. }
  706. },
  707. {
  708. value: 1,
  709. name: '功率因素异常',
  710. itemStyle: {
  711. color: '#F2BD42'
  712. }
  713. },
  714. {
  715. value: 1,
  716. name: '设备离线',
  717. itemStyle: {
  718. color: '#C2C2C2'
  719. }
  720. }
  721. ]
  722. }]
  723. };
  724. this.myPieChart.setOption(option);
  725. },
  726. change(index) {
  727. this.current = index;
  728. this.companyId = this.merchantList1[index].id;
  729. this.getPowerConsumption(0);
  730. this.getEquipmentDataMonitoring(0);
  731. this.getAccumulatedAlarms();
  732. },
  733. toDataMonitoringList() {
  734. return
  735. uni.navigateTo({
  736. url: '/pages/equipmentDataMonitoring/dataMonitoring-list'
  737. })
  738. },
  739. toWorkOrderManagement() {
  740. return
  741. uni.navigateTo({
  742. url: '/pages/workOrderManagement/workOrderManagement'
  743. })
  744. },
  745. toEquipmentElectricity() {
  746. uni.navigateTo({
  747. url: '/pages/equipmentDataMonitoring/equipmentElectricity'
  748. })
  749. },
  750. toElectronicMonitoring(item) {
  751. uni.navigateTo({
  752. url: '/pages/equipmentDataMonitoring/electronicMonitoring?id=' + item.id + '&name=' + item.name
  753. })
  754. }
  755. }
  756. }
  757. </script>
  758. <style lang="scss" scoped>
  759. page {
  760. padding-bottom: 200rpx;
  761. }
  762. /deep/.u-drawer-content {
  763. margin-top: 88rpx;
  764. }
  765. .popup-tabs {
  766. background-color: #fff;
  767. display: flex;
  768. align-items: center;
  769. justify-content: space-between;
  770. padding-top: 32rpx;
  771. padding-right: 32rpx;
  772. color: rgba(51, 51, 51, 1);
  773. font-size: 32rpx;
  774. .tabs {
  775. width: 80%;
  776. }
  777. }
  778. .tabs-options {
  779. display: flex;
  780. padding: 24rpx 32rpx 0;
  781. flex-wrap: wrap;
  782. .item {
  783. width: 25%;
  784. margin-bottom: 40rpx;
  785. }
  786. }
  787. // 导航栏
  788. .navbar {
  789. background-color: rgba(22, 119, 255, 1);
  790. color: #fff;
  791. line-height: 88rpx;
  792. display: flex;
  793. justify-content: space-between;
  794. align-items: center;
  795. padding: 0 32rpx;
  796. color: rgba(255, 255, 255, 1);
  797. font-size: 36rpx;
  798. position: fixed;
  799. left: 0;
  800. right: 0;
  801. top: 0;
  802. z-index: 999999;
  803. .img {
  804. width: 48rpx;
  805. height: 48rpx;
  806. vertical-align: middle;
  807. }
  808. }
  809. // 标签
  810. .tabs-box {
  811. padding: 32rpx 0;
  812. margin-top: 88rpx;
  813. padding-right: 32rpx;
  814. background-color: rgba(22, 119, 255, 1);
  815. display: flex;
  816. align-items: center;
  817. justify-content: space-between;
  818. .tabs {
  819. width: 80%;
  820. }
  821. }
  822. .main {
  823. border-radius: 16px 16px 0px 0px;
  824. background: linear-gradient(180deg, rgba(242, 244, 246, 1) 61%, rgba(255, 255, 255, 0) 100%);
  825. margin-top: -24rpx;
  826. padding: 32rpx;
  827. .statistics {
  828. border-radius: 8px;
  829. background-color: rgba(255, 255, 255, 1);
  830. box-shadow: 0px 1px 6px 0px rgba(0, 59, 142, 0.05);
  831. margin-top: 24rpx;
  832. padding: 40rpx;
  833. .title {
  834. display: flex;
  835. align-items: center;
  836. margin-bottom: 20rpx;
  837. .img {
  838. width: 36rpx;
  839. height: 36rpx;
  840. vertical-align: middle;
  841. border-radius: 999px;
  842. }
  843. .change {
  844. display: flex;
  845. align-items: center;
  846. .change-img {
  847. width: 32rpx;
  848. height: 32rpx;
  849. vertical-align: middle;
  850. }
  851. text {
  852. margin-left: 8rpx;
  853. }
  854. }
  855. .text {
  856. color: rgba(16, 16, 16, 1);
  857. font-size: 36rpx;
  858. margin-left: 16rpx;
  859. font-weight: bold;
  860. }
  861. .change {
  862. margin-left: 16rpx;
  863. font-size: 24rpx;
  864. color: #838383;
  865. }
  866. .check-all {
  867. margin-left: auto;
  868. color: rgba(131, 131, 131, 1);
  869. font-size: 24rpx;
  870. }
  871. }
  872. }
  873. // 用电量
  874. .statistics-e {
  875. .electricity {
  876. background-color: #fff;
  877. .item {
  878. padding: 16rpx 0;
  879. display: flex;
  880. align-items: center;
  881. border-bottom: 1px solid rgba(245, 245, 245, 1);
  882. .equipment {
  883. width: 40%;
  884. // .equipment-text-overflow {
  885. // display: -webkit-box;
  886. // -webkit-box-orient: vertical;
  887. // -webkit-line-clamp: 1;
  888. // overflow: hidden;
  889. // }
  890. .equipment1 {
  891. color: rgba(51, 51, 51, 1);
  892. font-size: 32rpx;
  893. font-weight: bold;
  894. }
  895. .equipment2 {
  896. color: rgba(119, 119, 119, 1);
  897. display: flex;
  898. .companyName {
  899. width: 60%;
  900. // white-space: nowrap;
  901. //overflow: hidden;
  902. // text-overflow: ellipsis;
  903. }
  904. .state {
  905. margin-left: 12rpx;
  906. display: flex;
  907. align-items: center;
  908. color: rgba(255, 123, 0, 1);
  909. text {
  910. margin-right: 8rpx;
  911. display: inline-block;
  912. width: 16rpx;
  913. height: 16rpx;
  914. border-radius: 999px;
  915. }
  916. .off-line {
  917. background-color: rgba(255, 123, 0, 1);
  918. }
  919. .on-line {
  920. background-color: rgba(0, 185, 98, 1);
  921. }
  922. }
  923. .state2 {
  924. color: rgba(0, 185, 98, 1);
  925. }
  926. }
  927. }
  928. .electricity {
  929. display: flex;
  930. justify-content: space-between;
  931. flex: 1;
  932. margin-left: 48rpx;
  933. text-align: center;
  934. .electricity-item {
  935. width: 33.3%;
  936. .number {
  937. color: rgba(51, 51, 51, 1);
  938. font-size: 32rpx;
  939. font-weight: bold;
  940. height: 40rpx;
  941. line-height: 40rpx;
  942. }
  943. .date {
  944. color: rgba(119, 119, 119, 1);
  945. margin-top: 4rpx;
  946. }
  947. }
  948. }
  949. }
  950. }
  951. }
  952. // 统计1
  953. .statistics-1 {
  954. display: flex;
  955. align-items: center;
  956. justify-content: space-between;
  957. .item {
  958. width: 330rpx;
  959. padding: 24rpx;
  960. box-shadow: 0px 1px 6px 0px rgba(0, 59, 142, 0.05);
  961. border-radius: 8px;
  962. background-color: rgba(255, 255, 255, 1);
  963. .item-top {
  964. display: flex;
  965. align-items: center;
  966. .img {
  967. width: 88rpx;
  968. height: 88rpx;
  969. margin-right: 24rpx;
  970. vertical-align: middle;
  971. }
  972. .number {
  973. color: rgba(51, 51, 51, 1);
  974. font-size: 32rpx;
  975. .normal {
  976. margin-bottom: 12rpx;
  977. }
  978. }
  979. }
  980. .total {
  981. margin-top: 28rpx;
  982. text-align: center;
  983. color: rgba(119, 119, 119, 1);
  984. }
  985. .total-number {
  986. color: #EE3138;
  987. margin: 0 8rpx;
  988. }
  989. }
  990. }
  991. // 统计2异常报警记录
  992. .statistics-2 {
  993. .abnormal-item {
  994. display: flex;
  995. justify-content: space-between;
  996. align-items: center;
  997. padding: 16rpx;
  998. border-bottom: 1px solid rgba(245, 245, 245, 1);
  999. .item-title {
  1000. color: rgba(51, 51, 51, 1);
  1001. .img {
  1002. width: 32rpx;
  1003. height: 32rpx;
  1004. margin-right: 8rpx;
  1005. }
  1006. .name {
  1007. color: rgba(51, 51, 51, 1);
  1008. }
  1009. .date {
  1010. color: rgba(119, 119, 119, 1);
  1011. font-size: 24rpx;
  1012. }
  1013. }
  1014. .item-value {
  1015. text-align: right;
  1016. .value1 {
  1017. font-weight: bold;
  1018. color: rgba(51, 51, 51, 1);
  1019. }
  1020. .value2 {
  1021. color: rgba(119, 119, 119, 1);
  1022. font-size: 24rpx;
  1023. }
  1024. }
  1025. }
  1026. }
  1027. // 统计3设备实时监控
  1028. .statistics-3 {
  1029. .monitoring-item {
  1030. padding: 16rpx 0;
  1031. border-bottom: 1px solid rgba(245, 245, 245, 1);
  1032. .item-title {
  1033. display: flex;
  1034. align-items: center;
  1035. .text1 {
  1036. color: rgba(51, 51, 51, 1);
  1037. }
  1038. .text2 {
  1039. color: rgba(119, 119, 119, 1);
  1040. font-size: 24rpx;
  1041. margin-left: 8rpx;
  1042. }
  1043. }
  1044. .state {
  1045. margin-left: auto;
  1046. display: flex;
  1047. .state1,
  1048. .state2 {
  1049. display: flex;
  1050. align-items: center;
  1051. margin-left: 24rpx;
  1052. }
  1053. .img {
  1054. width: 32rpx;
  1055. height: 32rpx;
  1056. vertical-align: middle;
  1057. margin-right: 8rpx;
  1058. }
  1059. }
  1060. // 监控信息
  1061. .infos {
  1062. margin-top: 8rpx;
  1063. display: flex;
  1064. align-items: center;
  1065. justify-content: space-between;
  1066. .infos-item {
  1067. display: flex;
  1068. align-items: center;
  1069. }
  1070. .text {
  1071. margin-left: 4rpx;
  1072. }
  1073. }
  1074. }
  1075. }
  1076. // 设备状态
  1077. .statistics-4 {
  1078. .chat-img {
  1079. width: 100%;
  1080. height: 620rpx;
  1081. }
  1082. }
  1083. // 故障类型
  1084. .statistics-5,
  1085. .statistics-6 {
  1086. .chat-img {
  1087. width: 100%;
  1088. height: 410rpx;
  1089. }
  1090. }
  1091. // 异常设备排名
  1092. .statistics-ranking {
  1093. .total {
  1094. color: rgba(16, 16, 16, 1);
  1095. text {
  1096. color: #1677FF;
  1097. padding: 0 8rpx;
  1098. }
  1099. }
  1100. .ranking-main {
  1101. margin-top: 48rpx;
  1102. border-radius: 16px;
  1103. background-color: #fff;
  1104. .item {
  1105. display: flex;
  1106. align-items: center;
  1107. margin-bottom: 32rpx;
  1108. .ranking {
  1109. color: rgba(16, 16, 16, 1);
  1110. font-weight: bold;
  1111. }
  1112. .icon {
  1113. width: 72rpx;
  1114. height: 72rpx;
  1115. border-radius: 4px;
  1116. background-color: rgba(219, 234, 255, 1);
  1117. display: flex;
  1118. align-items: center;
  1119. justify-content: center;
  1120. margin-left: 24rpx;
  1121. .img {
  1122. width: 48rpx;
  1123. height: 48rpx;
  1124. }
  1125. }
  1126. .name {
  1127. margin-left: 16rpx;
  1128. .name1 {
  1129. color: rgba(51, 51, 51, 1);
  1130. font-weight: bold;
  1131. }
  1132. .name2 {
  1133. color: rgba(119, 119, 119, 1);
  1134. font-size: 24rpx;
  1135. margin-top: 4rpx;
  1136. }
  1137. }
  1138. .time {
  1139. color: rgba(16, 16, 16, 1);
  1140. margin-left: auto;
  1141. font-weight: bold;
  1142. }
  1143. }
  1144. }
  1145. // 查看全部排名
  1146. .check-all {
  1147. text-align: center;
  1148. color: rgba(119, 119, 119, 1);
  1149. font-size: 12px;
  1150. }
  1151. }
  1152. }
  1153. </style>