electronicMonitoring.vue 29 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447
  1. <template>
  2. <view>
  3. <view class="background">
  4. <!-- 设备选择器 -->
  5. <!-- <u-picker title="设备选择" v-model="equipmentShow"
  6. mode="multiSelector" :default-selector='[0, 1]' :range="multiSelector">
  7. </u-picker> -->
  8. <u-picker v-model="tabsFrom.show1" mode="selector" :range="tabsFrom.selector1" range-key="label"
  9. @confirm="selector1confirm"></u-picker>
  10. <u-select v-model="equipmentShow" mode="mutil-column-auto" :list="equipmentList" @confirm="confirm">
  11. </u-select>
  12. <!-- 日期选择器 -->
  13. <u-picker-select title="日期选择" v-model="tabsFrom.show2" :defaultTime="tabsFrom.show2Index" :endYear="endYear"
  14. mode="time" :params="params" @confirm="selector2confirm" @reset="selector2reset"></u-picker-select>
  15. <!-- <u-navbar :background="background" back-icon-color="#fff" title="联通公司" title-color="#fff">
  16. <view class="u-nav-slot" slot="right" @click="tabsFrom.show2=true,params.day=true">
  17. <image class="img" src="@/assets/img/riLine-calendar-todo-line 1.svg" mode=""></image>
  18. </view>
  19. </u-navbar> -->
  20. <view class="navbar-c">
  21. <view class="back" @click="backDataMonitoringList">
  22. <u-icon name="arrow-left" color="#fff" size="36"></u-icon>
  23. </view>
  24. <view class="title">
  25. <<<<<<< HEAD
  26. {{tabsFrom.title}}
  27. <!-- <u-icon name="arrow-down" color="#fff" size="24" @click="equipmentShow=true"></u-icon> -->
  28. <u-icon name="arrow-down" color="#fff" size="24" @click="tabsFrom.show1=true"></u-icon>
  29. =======
  30. {{title}}<u-icon v-if="false" name="arrow-down" color="#fff" size="24"
  31. @click="equipmentShow=true"></u-icon>
  32. >>>>>>> d6db741283ddecd108c9c7844ac40a43193c5dd9
  33. </view>
  34. <!-- <view class="right" @click="tabsFrom.show2=true">
  35. <image class="img" src="@/assets/img/riLine-calendar-todo-line 1.svg" mode=""></image>
  36. </view> -->
  37. </view>
  38. <!-- 日期 -->
  39. <!-- <view class="date-box">
  40. <view class="item item-today">
  41. <view class="date">
  42. 26
  43. </view>
  44. <view class="week ">
  45. 今天
  46. </view>
  47. <view class="dot">
  48. </view>
  49. </view>
  50. <view class="item">
  51. <view class="date">
  52. 27
  53. </view>
  54. <view class="week">
  55. 周六
  56. </view>
  57. </view>
  58. <view class="item">
  59. <view class="date">
  60. 28
  61. </view>
  62. <view class="week">
  63. 周日
  64. </view>
  65. </view>
  66. <view class="item">
  67. <view class="date">
  68. 29
  69. </view>
  70. <view class="week">
  71. 周一
  72. </view>
  73. </view>
  74. <view class="item">
  75. <view class="date">
  76. 30
  77. </view>
  78. <view class="week">
  79. 周二
  80. </view>
  81. </view>
  82. </view> -->
  83. </view>
  84. <!-- 用电量 -->
  85. <view class="electricity-consumption">
  86. <view class="title">
  87. 用电量统计 (度)
  88. </view>
  89. <view class="degree">
  90. <view class="item">
  91. <view class="item-text">
  92. 百万
  93. </view>
  94. <view class="item-number" v-text="showTop[0]">
  95. 0
  96. </view>
  97. </view>
  98. <view class="item">
  99. <view class="item-text">
  100. 拾万
  101. </view>
  102. <view class="item-number" v-text="showTop[1]">
  103. 0
  104. </view>
  105. </view>
  106. <view class="item">
  107. <view class="item-text">
  108. </view>
  109. <view class="item-number" v-text="showTop[2]">
  110. 0
  111. </view>
  112. </view>
  113. <view class="item">
  114. <view class="item-text">
  115. </view>
  116. <view class="item-number" v-text="showTop[3]">
  117. 0
  118. </view>
  119. </view>
  120. <view class="item">
  121. <view class="item-text">
  122. </view>
  123. <view class="item-number" v-text="showTop[4]">
  124. 0
  125. </view>
  126. </view>
  127. <view class="item">
  128. <view class="item-text">
  129. </view>
  130. <view class="item-number" v-text="showTop[5]">
  131. 7
  132. </view>
  133. </view>
  134. <view class="item">
  135. <view class="item-text">
  136. 1
  137. </view>
  138. <view class="item-number" v-text="showTop[6]">
  139. 7
  140. </view>
  141. </view>
  142. <view class="item">
  143. <view class="item-text">
  144. 0.1
  145. </view>
  146. <view class="item-number decimal" v-text="showTop[7]">
  147. 7
  148. </view>
  149. </view>
  150. </view>
  151. <view class="radio">
  152. <u-radio-group v-model="value" @change="radioGroupChange">
  153. <u-radio @change="radioChange" v-for="(item, index) in list" :key="index" :name="item.id"
  154. :disabled="item.disabled">
  155. {{item.name}}
  156. </u-radio>
  157. </u-radio-group>
  158. </view>
  159. </view>
  160. <!-- 各时段用电量 -->
  161. <view class="electricity-chart">
  162. <view class="title">
  163. <<<<<<< HEAD
  164. <view class="text">
  165. <view class="icon">
  166. </view> 各时段用电量 (度)
  167. </view>
  168. <view @click="tabsFrom.show2=true,params.day=true">
  169. =======
  170. <view class="icon">
  171. </view>
  172. <view class="text">
  173. 各时段用电量 (度)
  174. </view>
  175. <view class="date" @click="tabsFrom.show2=true,params.day=true">
  176. >>>>>>> d6db741283ddecd108c9c7844ac40a43193c5dd9
  177. {{queryDay}}<u-icon name="arrow-down"></u-icon>
  178. </view>
  179. </view>
  180. <view class="chart">
  181. <!-- <image class="img" src="@/assets/img/chart@1x.png" mode=""></image> -->
  182. <view id="barEcharts" style="min-height:440rpx;">
  183. </view>
  184. </view>
  185. </view>
  186. <!-- 异常波动 -->
  187. <view class="abnormal" v-if="false">
  188. <view class="headline">
  189. <view class="title">
  190. <view class="icon">
  191. </view>
  192. <view class="text">
  193. 异常告警
  194. </view>
  195. </view>
  196. <view class="more">
  197. 查看全部
  198. <u-icon name="arrow-right" size="24" color="#d4d4d4"></u-icon>
  199. </view>
  200. </view>
  201. <view class="details">
  202. <view class="item">
  203. <view class="name">
  204. 温度异常告警
  205. </view>
  206. <view class="time">
  207. 2024-01-25 15:00:00
  208. </view>
  209. </view>
  210. <view class="item">
  211. <view class="name">
  212. 三厢功率因数异常告警
  213. </view>
  214. <view class="time">
  215. 2024-01-05 20:00:00
  216. </view>
  217. </view>
  218. </view>
  219. </view>
  220. <!-- 能源监测 -->
  221. <view class="energy-inspection" v-if="false">
  222. <view class="title">
  223. <view class="icon">
  224. </view>
  225. <view class="text">
  226. 能源监测
  227. </view>
  228. </view>
  229. <view class="grid">
  230. <u-grid :col="3" :border="false">
  231. <u-grid-item>
  232. <view class="icon icon1">
  233. <image class="img" src="@/assets/img/Image@1.png" mode=""></image>
  234. </view>
  235. <view class="grid-text">三相电流</view>
  236. </u-grid-item>
  237. <u-grid-item>
  238. <view class="icon icon2">
  239. <image class="img" src="@/assets/img/Image@2.png" mode=""></image>
  240. </view>
  241. <view class="grid-text">三相电压</view>
  242. </u-grid-item>
  243. <u-grid-item>
  244. <view class="icon icon3">
  245. <image class="img" src="@/assets/img/Image@3.png" mode=""></image>
  246. </view>
  247. <view class="grid-text">三相温度</view>
  248. </u-grid-item>
  249. <u-grid-item>
  250. <view class="icon icon4">
  251. <image class="img" src="@/assets/img/Image@4.png" mode=""></image>
  252. </view>
  253. <view class="grid-text">三相有功功率</view>
  254. </u-grid-item>
  255. <u-grid-item>
  256. <view class="icon icon5">
  257. <image class="img" src="@/assets/img/Image@5.png" mode=""></image>
  258. </view>
  259. <view class="grid-text">三相功率因数</view>
  260. </u-grid-item>
  261. <u-grid-item>
  262. <view class="icon icon6">
  263. <image class="img" src="@/assets/img/Image@5.png" mode=""></image>
  264. </view>
  265. <view class="grid-text">平均功率因数</view>
  266. </u-grid-item>
  267. </u-grid>
  268. </view>
  269. </view>
  270. <!-- 数据分析 -->
  271. <view class="data-analysis" v-if="false">
  272. <view class="title">
  273. <view class="icon">
  274. </view>
  275. <view class="text">
  276. 数据分析
  277. </view>
  278. </view>
  279. <view class="grid">
  280. <u-grid :col="3" :border="false">
  281. <u-grid-item>
  282. <view class="icon icon7">
  283. <image class="img" src="@/assets/img/Image@7.png" mode=""></image>
  284. </view>
  285. <view class="grid-text">同比分析</view>
  286. </u-grid-item>
  287. <u-grid-item>
  288. <view class="icon icon8">
  289. <image class="img" src="@/assets/img/Image@8.png" mode=""></image>
  290. </view>
  291. <view class="grid-text">环比分析</view>
  292. </u-grid-item>
  293. <u-grid-item>
  294. <view class="icon icon9">
  295. <image class="img" src="@/assets/img/Image@9.svg" mode=""></image>
  296. </view>
  297. <view class="grid-text">用电统计</view>
  298. </u-grid-item>
  299. </u-grid>
  300. </view>
  301. </view>
  302. <!-- 设备信息 -->
  303. <view class="equipment-information" v-if="false">
  304. <view class="title">
  305. <view class="icon">
  306. </view>
  307. <view class="text">
  308. 设备信息
  309. </view>
  310. <view class="more" @click="equipmentInfosShow=true">
  311. 查看全部<u-icon name="arrow-right" size="24" color="#d4d4d4"></u-icon>
  312. </view>
  313. </view>
  314. <view class="infos">
  315. <view class="item">
  316. <view class="item-title">
  317. 类型
  318. </view>
  319. <view class="item-value">
  320. 变压器
  321. </view>
  322. </view>
  323. <view class="border">
  324. </view>
  325. <view class="item">
  326. <view class="item-title">
  327. 设备编号
  328. </view>
  329. <view class="item-value">
  330. SN9015001
  331. </view>
  332. </view>
  333. <view class="border">
  334. </view>
  335. <view class="item">
  336. <view class="item-title">
  337. 上次故障时间
  338. </view>
  339. <view class="item-value">
  340. 2024-02-14
  341. </view>
  342. </view>
  343. </view>
  344. </view>
  345. <!-- 设备信息弹窗 -->
  346. <view class="equipment-popup">
  347. <u-popup v-model="equipmentInfosShow" mode="bottom" border-radius="12">
  348. <view class="content">
  349. <view class="headline">
  350. 设备信息
  351. </view>
  352. <view class="infos">
  353. <view class="item" >
  354. <view class="item-title">
  355. 类型
  356. </view>
  357. <view class="item-value">
  358. 变压器
  359. </view>
  360. </view>
  361. <view class="item" >
  362. <view class="item-title">
  363. 编号
  364. </view>
  365. <view class="item-value">
  366. SN9015001
  367. </view>
  368. </view>
  369. <view class="item" >
  370. <view class="item-title">
  371. 所属公司
  372. </view>
  373. <view class="item-value">
  374. 荆鹏集团
  375. </view>
  376. </view>
  377. <view class="item" >
  378. <view class="item-title">
  379. 地址
  380. </view>
  381. <view class="item-value">
  382. 荆州市沙市区江津东路155号
  383. </view>
  384. </view>
  385. <view class="item" >
  386. <view class="item-title">
  387. 上线时间
  388. </view>
  389. <view class="item-value">
  390. 2024-01-01
  391. </view>
  392. </view>
  393. <view class="item" >
  394. <view class="item-title">
  395. 上次故障时间
  396. </view>
  397. <view class="item-value">
  398. 2024-02-14
  399. </view>
  400. </view>
  401. </view>
  402. <button class="get" @click="equipmentInfosShow=false">知道了</button>
  403. </view>
  404. </u-popup>
  405. </view>
  406. <!-- 故障上报 -->
  407. <view class="create-order" v-if="false">
  408. <view class="img-box">
  409. <image class="img" src="@/assets/img/fas fa-exclamation-triangle Copy 2@3x.png" mode=""></image>
  410. </view>
  411. <view class="text">
  412. 故障上报
  413. </view>
  414. </view>
  415. </view>
  416. </template>
  417. <script>
  418. import {
  419. parseUnixTime,
  420. beforeTimeStamp,
  421. getWeek
  422. } from '@/apis/utils'
  423. import * as echarts from 'echarts';
  424. import * as API from '@/apis/pagejs/energy/index.js'
  425. export default {
  426. data() {
  427. return {
  428. equipmentInfosShow:false,
  429. kWhList: [],
  430. <<<<<<< HEAD
  431. =======
  432. title: '',
  433. >>>>>>> d6db741283ddecd108c9c7844ac40a43193c5dd9
  434. queryDay: '',
  435. showTop: [0, 0, 0, 0, 0, 0, 0, 0],
  436. FormData: {
  437. queryDate: '',
  438. meterId: '',
  439. type: 0
  440. },
  441. FormData2: {
  442. queryDate: '',
  443. meterId: ''
  444. },
  445. myBarChart: null,
  446. endYear: '',
  447. equipmentShow: false,
  448. multiSelector: [
  449. ['荆鹏集团', '玉桥公园', '全季酒店'],
  450. ['荆鹏软件园01', '青少年宫02', '御河社区03', '荆州院子04']
  451. ],
  452. equipmentList: [{
  453. value: 1,
  454. label: '荆鹏集团',
  455. children: [{
  456. value: 2,
  457. label: '荆鹏集团01',
  458. },
  459. {
  460. value: 3,
  461. label: '荆鹏集团02',
  462. },
  463. {
  464. value: 4,
  465. label: '荆鹏集团03',
  466. }
  467. ]
  468. },
  469. {
  470. value: 5,
  471. label: '荆州院子',
  472. children: [{
  473. value: 6,
  474. label: '荆州院子01',
  475. },
  476. {
  477. value: 7,
  478. label: '荆州院子02',
  479. },
  480. {
  481. value: 8,
  482. label: '荆州院子03',
  483. }
  484. ]
  485. }
  486. ],
  487. params: {
  488. year: true,
  489. month: true,
  490. day: true,
  491. hour: false,
  492. minute: false,
  493. second: false
  494. },
  495. tabsFrom: {
  496. show1: false,
  497. show1Index: 0,
  498. show2Index: '',
  499. show2: false,
  500. show1Text: "全部类型",
  501. show2Text: "全部时间",
  502. selector1: [{
  503. label: '全部类型',
  504. value: '',
  505. },
  506. {
  507. label: '线上充值',
  508. value: '1',
  509. },
  510. {
  511. label: '线下充值',
  512. value: '2',
  513. },
  514. ]
  515. },
  516. background: {
  517. backgroundColor: '#1677FF',
  518. },
  519. list: [{
  520. <<<<<<< HEAD
  521. id: 4,
  522. name: '当日用电量',
  523. disabled: false
  524. }, {
  525. id: 1,
  526. name: '当月用电量',
  527. disabled: false
  528. }, {
  529. id: 2,
  530. name: '上月用电量',
  531. disabled: false
  532. }, {
  533. id: 3,
  534. name: '当年用电量',
  535. disabled: false
  536. }, {
  537. id: 0,
  538. name: '总用电量',
  539. disabled: false
  540. }, {
  541. id: 10,
  542. name: '指定月份',
  543. disabled: false
  544. }],
  545. value: '2',
  546. =======
  547. id: 0,
  548. name: '总用电量',
  549. disabled: false
  550. },
  551. {
  552. id: 4,
  553. name: '当日用电量',
  554. disabled: false
  555. },
  556. {
  557. id: 1,
  558. name: '当月用电量',
  559. disabled: false
  560. }, {
  561. id: 3,
  562. name: '当年用电量',
  563. disabled: false
  564. }, {
  565. id: 5,
  566. name: '去年用电量',
  567. disabled: false
  568. }, {
  569. id: 10,
  570. name: '指定月份',
  571. disabled: false
  572. }
  573. ],
  574. value: '0',
  575. >>>>>>> d6db741283ddecd108c9c7844ac40a43193c5dd9
  576. };
  577. },
  578. onLoad(op) {
  579. if (op.id) {
  580. this.FormData.meterId = op.id;
  581. this.FormData2.meterId = op.id;
  582. this.tabsFrom.title = op.name;
  583. }
  584. this.endYear = new Date().getFullYear();
  585. this.FormData.queryDate = parseUnixTime(new Date(), '{y}-{m}-{d}');
  586. this.FormData2.queryDate = parseUnixTime(new Date(), '{y}-{m}-{d}');
  587. <<<<<<< HEAD
  588. this.FormData.type = 2;
  589. =======
  590. this.FormData.type = 0;
  591. this.getTimeSlotStatistics();
  592. >>>>>>> d6db741283ddecd108c9c7844ac40a43193c5dd9
  593. this.getElectricityStatistics();
  594. this.getTimeSlotStatistics();
  595. this.getList();
  596. },
  597. onReady() {
  598. this.getBarCharts(false);
  599. },
  600. methods: {
  601. <<<<<<< HEAD
  602. selector1confirm(e) {
  603. var index = e[0];
  604. this.tabsFrom.show1Index = index;
  605. this.tabsFrom.show1Text = this.tabsFrom.selector1[index].label;
  606. this.tabsFrom.title = this.tabsFrom.selector1[index].label;
  607. this.FormData.meterId = this.tabsFrom.selector1[index].value;
  608. this.FormData.queryDate = parseUnixTime(new Date(), '{y}-{m}-{d}');
  609. this.FormData2.meterId = this.tabsFrom.selector1[index].value;
  610. this.FormData2.queryDate = parseUnixTime(new Date(), '{y}-{m}-{d}');
  611. this.FormData.type = 2;
  612. this.value = '2';
  613. this.getTimeSlotStatistics();
  614. this.getElectricityStatistics();
  615. },
  616. =======
  617. >>>>>>> d6db741283ddecd108c9c7844ac40a43193c5dd9
  618. queryDate(queryTime, day) {
  619. if (day) {
  620. this.FormData2.queryDate = queryTime;
  621. //this.FormData2.type =day?"9":"10"
  622. //this.value="-1"
  623. <<<<<<< HEAD
  624. this.getTimeSlotStatistics();
  625. =======
  626. this.getTimeSlotStatistics()
  627. >>>>>>> d6db741283ddecd108c9c7844ac40a43193c5dd9
  628. } else {
  629. this.FormData.queryDate = queryTime + "-01";
  630. <<<<<<< HEAD
  631. this.FormData.type = "10";
  632. //this.value="-1"
  633. this.getElectricityStatistics();
  634. }
  635. =======
  636. this.FormData.type = "10"
  637. //this.value="-1"
  638. this.getElectricityStatistics()
  639. }
  640. >>>>>>> d6db741283ddecd108c9c7844ac40a43193c5dd9
  641. },
  642. getList() {
  643. uni.showLoading({
  644. title: "加载中",
  645. mask: true,
  646. })
  647. var data = {
  648. pageIndex: 1,
  649. pageSize: 100
  650. };
  651. API.homePageKwh(data).then((res) => {
  652. uni.hideLoading()
  653. this.kWhList = res.data.data;
  654. <<<<<<< HEAD
  655. this.tabsFrom.selector1 = [];
  656. this.tabsFrom.selector1 = this.kWhList.map(item => {
  657. return {
  658. label: item.name,
  659. value: item.id
  660. =======
  661. for (var i = 0; i < this.kWhList.length; i++) {
  662. if (this.kWhList[i].id == this.FormData.meterId) {
  663. this.title = this.kWhList[i].name;
  664. >>>>>>> d6db741283ddecd108c9c7844ac40a43193c5dd9
  665. }
  666. })
  667. }).catch(error => {
  668. uni.showToast({
  669. title: error,
  670. icon: "none"
  671. })
  672. })
  673. },
  674. getTimeSlotStatistics() {
  675. uni.showLoading({
  676. title: "加载中",
  677. mask: true,
  678. })
  679. this.queryDay = parseUnixTime(new Date(this.FormData2.queryDate), '{y}年{m}月{d}日');
  680. API.timeSlotStatistics(this.FormData2).then((response) => {
  681. uni.hideLoading();
  682. this.hourMap = response.data.hourMap;
  683. this.getBarCharts(this.hourMap);
  684. }).catch(error => {
  685. uni.showToast({
  686. title: error,
  687. icon: "none"
  688. })
  689. })
  690. },
  691. getElectricityStatistics() {
  692. uni.showLoading({
  693. title: "加载中",
  694. mask: true,
  695. })
  696. var obj = {
  697. ...this.FormData
  698. }
  699. // if(obj.type==10){
  700. // obj.queryDate+="-01"
  701. // }
  702. API.electricityStatistics(obj).then((response) => {
  703. uni.hideLoading();
  704. this.showTop = [0, 0, 0, 0, 0, 0, 0, 0]
  705. var electricity = response.data.kwhMap.kwh + "";
  706. if (electricity) {
  707. var sz = electricity.split(".")
  708. var str1 = sz[0];
  709. var str2 = [];
  710. if (sz.length > 1) {
  711. str2 = sz[1];
  712. this.showTop[7] = str2[0];
  713. }
  714. var j = 0;
  715. for (var i in str1) {
  716. if (i != undefined) {
  717. this.showTop[6 - str1.length + j + 1] = str1[i]
  718. }
  719. j++;
  720. }
  721. this.$forceUpdate()
  722. }
  723. //this.electricityMeterList=response.data.meterList
  724. }).catch(error => {
  725. uni.showToast({
  726. title: error,
  727. icon: "none"
  728. })
  729. })
  730. },
  731. getBarCharts(list) {
  732. if (!this.myChart) {
  733. this.myChart = echarts.init(document.getElementById('barEcharts'), null, {
  734. width: uni.upx2px(700),
  735. height: uni.upx2px(480)
  736. });
  737. }
  738. this.myChart.clear();
  739. <<<<<<< HEAD
  740. var data1 = ['0-2点', '3-4点', '5-6点', '7-8点', '9-10点', '11-12点', '13-14点', '15-16点',
  741. '17-18点', '19-20点', '21-22点', '23-24点'];
  742. var data2 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
  743. if(list) {
  744. data1 = [];
  745. data2 = [];
  746. for (var i in list) {
  747. data1.push(i)
  748. data2.push(list[i])
  749. }
  750. =======
  751. var data1 = [];
  752. var data2 = [];
  753. for (var i in list) {
  754. data1.push(i)
  755. data2.push(list[i])
  756. >>>>>>> d6db741283ddecd108c9c7844ac40a43193c5dd9
  757. }
  758. var headitemby = ""
  759. var showkey = "";
  760. var option = {
  761. tooltip: {
  762. trigger: 'axis',
  763. axisPointer: {
  764. type: 'shadow'
  765. }
  766. },
  767. grid: {
  768. top: '6%',
  769. left: '3%',
  770. right: '8%',
  771. bottom: '8%',
  772. containLabel: true
  773. },
  774. xAxis: {
  775. type: 'category',
  776. data: data1,
  777. axisLabel: {
  778. rotate: 40,
  779. interval: 0,
  780. textStyle: {
  781. color: "#333"
  782. }
  783. },
  784. },
  785. yAxis: {
  786. type: 'value',
  787. <<<<<<< HEAD
  788. =======
  789. >>>>>>> d6db741283ddecd108c9c7844ac40a43193c5dd9
  790. },
  791. series: [{
  792. name: '合计',
  793. data: data2,
  794. type: 'bar'
  795. }]
  796. }
  797. console.log(option)
  798. this.myChart.setOption(option);
  799. },
  800. selector2confirm(e) {
  801. this.tabsFrom.show2Text = e.year + "年" + e.month + "月"
  802. this.tabsFrom.show2Index = e.year + "-" + e.month
  803. if (e.day) {
  804. this.tabsFrom.show2Text += e.day + "日"
  805. this.tabsFrom.show2Index += '-' + e.day
  806. this.queryDate(this.tabsFrom.show2Index, true)
  807. } else {
  808. this.queryDate(this.tabsFrom.show2Index, false)
  809. }
  810. },
  811. selector2reset(e) {
  812. console.log(e)
  813. this.tabsFrom.show2Text = '全部时间'
  814. this.tabsFrom.show2Index = '';
  815. },
  816. // 选中某个单选框时,由radio时触发
  817. radioChange(e) {
  818. //console.log(e);
  819. },
  820. // 选中任一radio时,由radio-group触发
  821. radioGroupChange(e) {
  822. console.log(e)
  823. this.FormData.type = e;
  824. if (e == 10) {
  825. this.tabsFrom.show2 = true;
  826. this.params.day = false;
  827. } else {
  828. this.getElectricityStatistics();
  829. }
  830. },
  831. backDataMonitoringList() {
  832. uni.navigateBack()
  833. },
  834. }
  835. };
  836. </script>
  837. <style lang="scss" scoped>
  838. page {
  839. padding-bottom: 184rpx;
  840. }
  841. .navbar-c {
  842. background-color: rgba(22, 119, 255, 1);
  843. .back {
  844. z-index: 999;
  845. width: 200rpx;
  846. }
  847. .title {
  848. color: #fff;
  849. display: flex;
  850. align-items: center;
  851. justify-content: center;
  852. }
  853. .right {
  854. .img {
  855. width: 48rpx;
  856. height: 48rpx;
  857. }
  858. }
  859. }
  860. /deep/.uicon-nav-back {
  861. color: #fff !important;
  862. }
  863. .background {
  864. background-color: rgba(22, 119, 255, 1);
  865. padding-bottom: 100rpx;
  866. /deep/.u-border-bottom:after {
  867. border: none;
  868. }
  869. .u-nav-slot {
  870. margin-right: 32rpx;
  871. .img {
  872. width: 48rpx;
  873. height: 48rpx;
  874. vertical-align: middle;
  875. }
  876. }
  877. }
  878. .background::after {
  879. content: '';
  880. position: absolute;
  881. width: 160%;
  882. height: 80px;
  883. background-color: rgba(22, 119, 255, 1);
  884. left: -30%;
  885. border-radius: 0 0 50% 50%;
  886. }
  887. // // 日期
  888. .date-box {
  889. display: flex;
  890. align-items: center;
  891. justify-content: space-between;
  892. margin: 24rpx 32rpx;
  893. .item {
  894. border-radius: 8px;
  895. background-color: rgba(255, 255, 255, 0.1);
  896. border: 1px solid rgba(255, 255, 255, 0.15);
  897. width: 120rpx;
  898. height: 120rpx;
  899. color: #fff;
  900. text-align: center;
  901. display: flex;
  902. flex-direction: column;
  903. justify-content: center;
  904. .date {
  905. font-size: 40rpx;
  906. }
  907. }
  908. .item-today {
  909. background-color: rgba(255, 255, 255, 1);
  910. position: relative;
  911. .date {
  912. color: rgba(22, 119, 255, 1);
  913. }
  914. .week {
  915. color: rgba(16, 16, 16, 1);
  916. }
  917. .dot {
  918. width: 10rpx;
  919. height: 10rpx;
  920. background-color: rgba(255, 150, 0, 1);
  921. border-radius: 999px;
  922. position: absolute;
  923. bottom: -5rpx;
  924. left: 50%;
  925. transform: translateX(-50%);
  926. }
  927. }
  928. }
  929. // 用电量
  930. .electricity-consumption {
  931. background-color: #fff;
  932. padding: 40rpx 32rpx 0rpx;
  933. border-radius: 8px;
  934. margin: -88rpx 32rpx 0;
  935. position: relative;
  936. .title {
  937. color: rgba(16, 16, 16, 1);
  938. font-size: 36rpx;
  939. }
  940. .degree {
  941. display: flex;
  942. margin-top: 32rpx;
  943. .item {
  944. margin-right: 6rpx;
  945. text-align: center;
  946. .item-text {
  947. color: rgba(16, 16, 16, 1);
  948. }
  949. .item-number {
  950. margin-top: 24rpx;
  951. width: 72rpx;
  952. height: 96rpx;
  953. background-color: rgba(16, 16, 16, 1);
  954. color: #fff;
  955. font-size: 72rpx;
  956. }
  957. .decimal {
  958. background-color: #900005;
  959. }
  960. }
  961. }
  962. // .tab {
  963. // width: 240rpx;
  964. // height: 0;
  965. // border-width: 0px 48rpx 72rpx 0px;
  966. // border-radius: 8px 8px 0 0;
  967. // border-style: none solid solid none;
  968. // border-color: transparent transparent #fff;
  969. // position: absolute;
  970. // top: -72rpx;
  971. // left: 0rpx;
  972. // right: 0rpx;
  973. // color: #101010;
  974. // color: rgba(16, 16, 16, 1);
  975. // text-align: center;
  976. // line-height: 72rpx;
  977. // z-index: 999;
  978. // text-indent: 16rpx;
  979. // }
  980. // .tab2 {
  981. // width: 240rpx;
  982. // height: 0;
  983. // border-width: 0px 48rpx 72rpx 0px;
  984. // border-radius: 8px 8px 0 0;
  985. // border-style: none solid solid none;
  986. // border-color: transparent transparent #D4DBE4;
  987. // position: absolute;
  988. // top: -72rpx;
  989. // left: 210rpx;
  990. // right: 0rpx;
  991. // color: #777777;
  992. // text-align: center;
  993. // line-height: 72rpx;
  994. // text-indent: 16rpx;
  995. // }
  996. .radio {
  997. margin-top: 24rpx;
  998. /deep/.u-radio__label {
  999. font-size: 24rpx
  1000. }
  1001. /deep/.u-radio {
  1002. margin-bottom: 16px;
  1003. width: 200rpx !important;
  1004. }
  1005. }
  1006. }
  1007. //各时段用电量
  1008. // .electricity-chart {
  1009. // margin: 24rpx 32rpx;
  1010. // padding: 40rpx 0rpx;
  1011. // background-color: #fff;
  1012. // border-radius: 8px;
  1013. // .title {
  1014. // display: flex;
  1015. // align-items: center;
  1016. // padding: 0 32rpx;
  1017. // margin-bottom: 40rpx;
  1018. // font-weight: bold;
  1019. // .icon {
  1020. // width: 36rpx;
  1021. // height: 36rpx;
  1022. // background-color: rgba(22, 119, 255, 1);
  1023. // border: 6px solid rgba(182, 212, 255, 1);
  1024. // border-radius: 100px;
  1025. // }
  1026. // .text {
  1027. // color: rgba(51, 51, 51, 1);
  1028. // font-size: 36rpx;
  1029. // margin-left: 16rpx;
  1030. // }
  1031. // }
  1032. // .chart {
  1033. // width: 100%;
  1034. // height: 440rpx;
  1035. // .img {
  1036. // width: 100%;
  1037. // height: 440rpx;
  1038. // }
  1039. // }
  1040. // }
  1041. .electricity-chart,
  1042. .equipment-information {
  1043. margin: 24rpx 32rpx;
  1044. padding: 40rpx 0rpx;
  1045. background-color: #fff;
  1046. border-radius: 8px;
  1047. .title {
  1048. display: flex;
  1049. align-items: center;
  1050. padding: 0 32rpx;
  1051. margin-bottom: 40rpx;
  1052. .icon {
  1053. width: 36rpx;
  1054. height: 36rpx;
  1055. background-color: rgba(182, 212, 255, 1);
  1056. border: 6px solid rgba(22, 119, 255, 1);
  1057. border-radius: 100px;
  1058. }
  1059. .text {
  1060. display: flex;
  1061. align-items: center;
  1062. color: rgba(51, 51, 51, 1);
  1063. font-size: 36rpx;
  1064. margin-left: 16rpx;
  1065. }
  1066. .date {
  1067. margin-left: auto;
  1068. }
  1069. .more {
  1070. color: #838383;
  1071. font-size: 24rpx;
  1072. margin-left: auto;
  1073. }
  1074. }
  1075. .chart {
  1076. width: 100%;
  1077. height: 440rpx;
  1078. .img {
  1079. width: 100%;
  1080. height: 440rpx;
  1081. }
  1082. }
  1083. .infos{
  1084. padding: 0 32rpx;
  1085. display: flex;
  1086. justify-content: space-between;
  1087. text-align: center;
  1088. .border{
  1089. margin: auto 0;
  1090. height: 70rpx;
  1091. width: 2rpx;
  1092. background-color: rgba(204,204,204,1);;
  1093. }
  1094. .item-title{
  1095. color: rgba(119,119,119,1);
  1096. }
  1097. .item-value{
  1098. color: rgba(16,16,16,1);
  1099. font-size: 32rpx;
  1100. margin-top: 16rpx;
  1101. }
  1102. }
  1103. }
  1104. // 异常
  1105. .abnormal {
  1106. margin: 24rpx 32rpx;
  1107. padding: 40rpx 32rpx;
  1108. background-color: #fff;
  1109. border-radius: 8px;
  1110. .headline {
  1111. display: flex;
  1112. align-items: center;
  1113. justify-content: space-between;
  1114. }
  1115. .title {
  1116. display: flex;
  1117. align-items: center;
  1118. font-weight: bold;
  1119. .icon {
  1120. width: 36rpx;
  1121. height: 36rpx;
  1122. background-color: rgba(182, 212, 255, 1);
  1123. border: 6px solid rgba(22, 119, 255, 1);
  1124. border-radius: 100px;
  1125. }
  1126. .text {
  1127. color: rgba(51, 51, 51, 1);
  1128. font-size: 36rpx;
  1129. margin-left: 16rpx;
  1130. }
  1131. }
  1132. .more {
  1133. color: #838383;
  1134. font-size: 24rpx
  1135. }
  1136. .details {
  1137. margin-top: 40rpx;
  1138. .item {
  1139. display: flex;
  1140. align-items: center;
  1141. justify-content: space-between;
  1142. margin-top: 32rpx;
  1143. .name {
  1144. color: rgba(51, 51, 51, 1);
  1145. }
  1146. .time {
  1147. color: rgba(119, 119, 119, 1);
  1148. font-size: 24rpx;
  1149. }
  1150. }
  1151. }
  1152. }
  1153. // 能源监测
  1154. .energy-inspection,
  1155. .data-analysis {
  1156. margin: 24rpx 32rpx;
  1157. padding: 40rpx 32rpx;
  1158. background-color: #fff;
  1159. border-radius: 8px;
  1160. .title {
  1161. display: flex;
  1162. align-items: center;
  1163. font-weight: bold;
  1164. .icon {
  1165. width: 36rpx;
  1166. height: 36rpx;
  1167. background-color: rgba(182, 212, 255, 1);
  1168. border: 6px solid rgba(22, 119, 255, 1);
  1169. border-radius: 100px;
  1170. }
  1171. .text {
  1172. color: rgba(51, 51, 51, 1);
  1173. font-size: 36rpx;
  1174. margin-left: 16rpx;
  1175. }
  1176. }
  1177. .grid {
  1178. .icon {
  1179. width: 128rpx;
  1180. height: 128rpx;
  1181. border-radius: 12px;
  1182. background-color: rgba(35, 186, 178, 1);
  1183. display: flex;
  1184. align-items: center;
  1185. justify-content: center;
  1186. margin-bottom: 16rpx;
  1187. .img {
  1188. width: 80rpx;
  1189. height: 80rpx;
  1190. }
  1191. }
  1192. .icon2 {
  1193. background-color: rgba(42, 186, 72, 1);
  1194. }
  1195. .icon3 {
  1196. background-color: rgba(78, 96, 246, 1);
  1197. }
  1198. .icon4 {
  1199. background-color: rgba(22, 119, 255, 1);
  1200. }
  1201. .icon5 {
  1202. background-color: rgba(35, 186, 178, 1);
  1203. }
  1204. .icon6 {
  1205. background-color: rgba(42, 186, 72, 1);
  1206. }
  1207. .icon7 {
  1208. background-color: rgba(22, 119, 255, 1);
  1209. }
  1210. .icon8 {
  1211. background-color: rgba(35, 186, 178, 1);
  1212. }
  1213. .icon9 {
  1214. background-color: rgba(42, 186, 72, 1);
  1215. }
  1216. .grid-text {
  1217. color: #333333;
  1218. }
  1219. }
  1220. }
  1221. // 设备信息弹窗
  1222. .equipment-popup{
  1223. .content{
  1224. padding: 32rpx;
  1225. .headline{
  1226. color: rgba(16,16,16,1);
  1227. font-size: 36rpx;
  1228. text-align: center;
  1229. font-weight: bold;
  1230. }
  1231. .infos{
  1232. padding-bottom: 100rpx;
  1233. .item:last-of-type{
  1234. border: none;
  1235. }
  1236. .item{
  1237. display: flex;
  1238. align-items: center;
  1239. height: 80rpx;
  1240. line-height: 80rpx;
  1241. border-bottom: 1px solid #cccccc;
  1242. .item-title{
  1243. color: rgba(51,51,51,1);
  1244. width: 200rpx;
  1245. }
  1246. .item-value{
  1247. color: #666666;
  1248. flex: 1;
  1249. margin-left: 16rpx;
  1250. }
  1251. }
  1252. }
  1253. .get{
  1254. height: 80rpx;
  1255. line-height: 80rpx;
  1256. border-radius: 4px;
  1257. background-color: rgba(22,119,255,1);
  1258. color: rgba(255,255,255,1);
  1259. font-size: 32rpx;
  1260. }
  1261. }
  1262. }
  1263. // 创建工单
  1264. .create-order {
  1265. width: 120rpx;
  1266. height: 120rpx;
  1267. border-radius: 20px;
  1268. background: linear-gradient(180.29deg, rgba(255,124,112,1) 0.9%,rgba(255,79,63,1) 100.4%);
  1269. box-shadow: 0px 2px 6px 0px rgba(0, 0, 0, 0.4);
  1270. text-align: center;
  1271. display: flex;
  1272. flex-direction: column;
  1273. justify-content: center;
  1274. align-items: center;
  1275. position: fixed;
  1276. right: 32rpx;
  1277. bottom: 64rpx;
  1278. .img {
  1279. width: 56rpx;
  1280. height: 56rpx;
  1281. vertical-align: middle;
  1282. }
  1283. .text {
  1284. color: rgba(255, 255, 255, 1);
  1285. font-size: 22rpx;
  1286. }
  1287. }
  1288. </style>