electronicMonitoring.vue 28 KB

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