electronicMonitoring.vue 28 KB

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