electronicMonitoring.vue 29 KB

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