electronicMonitoring.vue 29 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417
  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" @cancel="selector2cancel" @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" v-if="false">
  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,name){
  458. if(!this.FormData.meterId){
  459. uni.showToast({
  460. title: "未查询到电表",
  461. icon: "none"
  462. })
  463. return
  464. }
  465. uni.navigateTo({
  466. url:"/pages/equipmentDataMonitoring/"+path+"?id="+this.FormData.meterId+"&type="+type+"&typeName="+name
  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.meterId =e[2].value;
  509. this.FormData.type = 2;
  510. this.value = '2';
  511. this.getTimeSlotStatistics();
  512. this.getElectricityStatistics();
  513. }
  514. },
  515. selector1cancel() {
  516. this.tabsFrom.show1Text = this.titleName;
  517. this.tabsFrom.title = this.titleName;
  518. this.FormData.meterId = this.meterId;
  519. this.FormData.queryDate = parseUnixTime(new Date(), '{y}-{m}-{d}');
  520. this.FormData2.meterId = this.meterId;
  521. this.FormData2.queryDate = parseUnixTime(new Date(), '{y}-{m}-{d}');
  522. this.FormData.type = 2;
  523. this.value = '2';
  524. this.getTimeSlotStatistics();
  525. this.getElectricityStatistics();
  526. },
  527. queryDate(queryTime, day) {
  528. if (day) {
  529. this.FormData2.queryDate = queryTime;
  530. //this.FormData2.type =day?"9":"10"
  531. //this.value="-1"
  532. this.getTimeSlotStatistics();
  533. } else {
  534. this.FormData.queryDate = queryTime + "-01";
  535. this.FormData.type = 10;
  536. this.value = "10";
  537. this.list[5].name = queryTime;
  538. this.getElectricityStatistics();
  539. }
  540. },
  541. getCompanyInfoList() {
  542. uni.showLoading({
  543. title: "加载中",
  544. mask: true,
  545. })
  546. API.deviceCompanyList().then((response) => {
  547. uni.hideLoading();
  548. var list = response.data.companyInfoList;
  549. this.tabsFrom.selector1 = [];
  550. this.tabsFrom.selector1 = list.map(item => {
  551. if (item.remoteReadingMeterList.length != 0 && item.remoteMonitorMeterList.length != 0) {
  552. return {
  553. label: item.fullName,
  554. value: item.id,
  555. children: [{
  556. label: '抄表',
  557. value: '1',
  558. children: item.remoteReadingMeterList.map(item => {
  559. return {
  560. label: item.name,
  561. value: item.id,
  562. }
  563. })
  564. },
  565. {
  566. label: '监控表',
  567. value: '1',
  568. children: item.remoteMonitorMeterList.map(item => {
  569. return {
  570. label: item.name,
  571. value: item.id,
  572. }
  573. })
  574. }
  575. ]
  576. }
  577. } else if (item.remoteReadingMeterList.length != 0 && item.remoteMonitorMeterList.length == 0) {
  578. return {
  579. label: item.fullName,
  580. value: item.id,
  581. children: [{
  582. label: '抄表',
  583. value: '1',
  584. children: item.remoteReadingMeterList.map(item => {
  585. return {
  586. label: item.name,
  587. value: item.id,
  588. }
  589. })
  590. }]
  591. }
  592. } else if (item.remoteReadingMeterList.length == 0 && item.remoteMonitorMeterList.length != 0) {
  593. return {
  594. label: item.fullName,
  595. value: item.id,
  596. children: [{
  597. label: '监控表',
  598. value: '1',
  599. children: item.remoteMonitorMeterList.map(item => {
  600. return {
  601. label: item.name,
  602. value: item.id,
  603. }
  604. })
  605. }]
  606. }
  607. } else {
  608. }
  609. })
  610. }).catch(error => {
  611. uni.showToast({
  612. title: error,
  613. icon: "none"
  614. })
  615. })
  616. },
  617. getTimeSlotStatistics() {
  618. uni.showLoading({
  619. title: "加载中",
  620. mask: true,
  621. })
  622. this.queryDay = parseUnixTime(new Date(this.FormData2.queryDate), '{y}年{m}月{d}日');
  623. API.timeSlotStatistics(this.FormData2).then((response) => {
  624. uni.hideLoading();
  625. this.hourMap = response.data.hourMap;
  626. this.getBarCharts(this.hourMap);
  627. }).catch(error => {
  628. uni.showToast({
  629. title: error,
  630. icon: "none"
  631. })
  632. })
  633. },
  634. getElectricityStatistics() {
  635. uni.showLoading({
  636. title: "加载中",
  637. mask: true,
  638. })
  639. var obj = {
  640. ...this.FormData
  641. }
  642. // if(obj.type==10){
  643. // obj.queryDate+="-01"
  644. // }
  645. API.electricityStatistics(obj).then((response) => {
  646. uni.hideLoading();
  647. this.showTop = [0, 0, 0, 0, 0, 0, 0, 0]
  648. var electricity = response.data.kwhMap.kwh + "";
  649. if (electricity) {
  650. var sz = electricity.split(".")
  651. var str1 = sz[0];
  652. var str2 = [];
  653. if (sz.length > 1) {
  654. str2 = sz[1];
  655. this.showTop[7] = str2[0];
  656. }
  657. var j = 0;
  658. for (var i in str1) {
  659. if (i != undefined) {
  660. this.showTop[6 - str1.length + j + 1] = str1[i]
  661. }
  662. j++;
  663. }
  664. this.$forceUpdate()
  665. }
  666. }).catch(error => {
  667. uni.showToast({
  668. title: error,
  669. icon: "none"
  670. })
  671. })
  672. },
  673. getBarCharts(list) {
  674. if (!this.myChart) {
  675. this.myChart = echarts.init(document.getElementById('barEcharts'), null, {
  676. width: uni.upx2px(700),
  677. height: uni.upx2px(480)
  678. });
  679. }
  680. this.myChart.clear();
  681. var data1 = ['0-2点', '2-4点', '4-6点', '6-8点', '8-10点', '10-12点', '12-14点', '14-16点',
  682. '16-18点', '18-20点', '20-22点', '22-24点'
  683. ];
  684. var data2 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
  685. var sumQuantity = 0;
  686. if (list) {
  687. data1 = [];
  688. data2 = [];
  689. for (var i in list) {
  690. data1.push(i);
  691. data2.push(list[i]);
  692. sumQuantity += list[i];
  693. }
  694. }
  695. this.sumQuantity = sumQuantity.toFixed(2);
  696. var headitemby = "";
  697. var showkey = "";
  698. var option = {
  699. tooltip: {
  700. trigger: 'axis',
  701. axisPointer: {
  702. type: 'shadow'
  703. }
  704. },
  705. grid: {
  706. top: '6%',
  707. left: '3%',
  708. right: '8%',
  709. bottom: '8%',
  710. containLabel: true
  711. },
  712. xAxis: {
  713. type: 'category',
  714. data: data1,
  715. axisLabel: {
  716. rotate: 40,
  717. interval: 0,
  718. textStyle: {
  719. color: "#333"
  720. }
  721. },
  722. },
  723. yAxis: {
  724. type: 'value',
  725. },
  726. series: [{
  727. name: '合计',
  728. data: data2,
  729. type: 'bar'
  730. }]
  731. }
  732. console.log(option)
  733. this.myChart.setOption(option);
  734. },
  735. selector2confirm(e) {
  736. this.tabsFrom.show2Text = e.year + "年" + e.month + "月"
  737. this.tabsFrom.show2Index = e.year + "-" + e.month
  738. if (e.day) {
  739. this.tabsFrom.show2Text += e.day + "日"
  740. this.tabsFrom.show2Index += '-' + e.day
  741. this.queryDate(this.tabsFrom.show2Index, true)
  742. } else {
  743. this.queryDate(this.tabsFrom.show2Index, false)
  744. }
  745. },
  746. selector2cancel(){
  747. this.value=this.clickType;
  748. },
  749. selector2reset(e) {
  750. console.log(e)
  751. this.tabsFrom.show2Text = '全部时间'
  752. this.tabsFrom.show2Index = '';
  753. if (e.day) {
  754. this.FormData2.queryDate = parseUnixTime(new Date(), '{y}-{m}-{d}');
  755. this.queryDay = parseUnixTime(new Date(this.FormData2.queryDate), '{y}年{m}月{d}日');
  756. this.getTimeSlotStatistics();
  757. } else {
  758. this.FormData.type = this.clickType;
  759. this.value = this.clickType;
  760. if (this.value != 10) {
  761. this.list[5].name = '指定月份';
  762. }
  763. this.getElectricityStatistics();
  764. }
  765. },
  766. // 选中某个单选框时,由radio时触发
  767. radioChange(e) {
  768. console.log(`选择前的值: ${this.value}`);
  769. this.clickType = this.value;
  770. },
  771. // 选中任一radio时,由radio-group触发
  772. radioGroupChange(e) {
  773. console.log(e)
  774. this.FormData.type = e;
  775. if (e == 10) {
  776. this.tabsFrom.show2 = true;
  777. this.params.day = false;
  778. } else {
  779. this.list[5].name = '指定月份'
  780. this.getElectricityStatistics();
  781. }
  782. },
  783. backDataMonitoringList() {
  784. uni.navigateBack()
  785. },
  786. }
  787. };
  788. </script>
  789. <style lang="scss" scoped>
  790. page {
  791. padding-bottom: 184rpx;
  792. }
  793. /deep/.u-select__header__title {
  794. font-size: 36rpx;
  795. font-weight: bold;
  796. }
  797. .navbar-c {
  798. background-color: rgba(22, 119, 255, 1);
  799. position: fixed;
  800. top: 0;
  801. left: 0;
  802. right: 0;
  803. z-index: 999;
  804. .back {
  805. z-index: 999;
  806. width: 200rpx;
  807. }
  808. .title {
  809. color: #fff;
  810. display: flex;
  811. align-items: center;
  812. justify-content: center;
  813. }
  814. .right {
  815. .img {
  816. width: 48rpx;
  817. height: 48rpx;
  818. }
  819. }
  820. }
  821. /deep/.uicon-nav-back {
  822. color: #fff !important;
  823. }
  824. .background {
  825. background-color: rgba(22, 119, 255, 1);
  826. padding-top: 88rpx;
  827. padding-bottom: 100rpx;
  828. /deep/.u-border-bottom:after {
  829. border: none;
  830. }
  831. .u-nav-slot {
  832. margin-right: 32rpx;
  833. .img {
  834. width: 48rpx;
  835. height: 48rpx;
  836. vertical-align: middle;
  837. }
  838. }
  839. }
  840. .background::after {
  841. content: '';
  842. position: absolute;
  843. width: 160%;
  844. height: 80px;
  845. background-color: rgba(22, 119, 255, 1);
  846. left: -30%;
  847. border-radius: 0 0 50% 50%;
  848. }
  849. // // 日期
  850. .date-box {
  851. display: flex;
  852. align-items: center;
  853. justify-content: space-between;
  854. margin: 24rpx 32rpx;
  855. .item {
  856. border-radius: 8px;
  857. background-color: rgba(255, 255, 255, 0.1);
  858. border: 1px solid rgba(255, 255, 255, 0.15);
  859. width: 120rpx;
  860. height: 120rpx;
  861. color: #fff;
  862. text-align: center;
  863. display: flex;
  864. flex-direction: column;
  865. justify-content: center;
  866. .date {
  867. font-size: 40rpx;
  868. }
  869. }
  870. .item-today {
  871. background-color: rgba(255, 255, 255, 1);
  872. position: relative;
  873. .date {
  874. color: rgba(22, 119, 255, 1);
  875. }
  876. .week {
  877. color: rgba(16, 16, 16, 1);
  878. }
  879. .dot {
  880. width: 10rpx;
  881. height: 10rpx;
  882. background-color: rgba(255, 150, 0, 1);
  883. border-radius: 999px;
  884. position: absolute;
  885. bottom: -5rpx;
  886. left: 50%;
  887. transform: translateX(-50%);
  888. }
  889. }
  890. }
  891. // 用电量
  892. .electricity-consumption {
  893. background-color: #fff;
  894. padding: 40rpx 32rpx 0rpx;
  895. border-radius: 8px;
  896. margin: -88rpx 32rpx 0;
  897. position: relative;
  898. .title {
  899. color: rgba(16, 16, 16, 1);
  900. font-size: 36rpx;
  901. }
  902. .degree {
  903. display: flex;
  904. margin-top: 32rpx;
  905. .item {
  906. margin-right: 6rpx;
  907. text-align: center;
  908. .item-text {
  909. color: rgba(16, 16, 16, 1);
  910. }
  911. .item-number {
  912. margin-top: 24rpx;
  913. width: 72rpx;
  914. height: 96rpx;
  915. background-color: rgba(16, 16, 16, 1);
  916. color: #fff;
  917. font-size: 72rpx;
  918. }
  919. .decimal {
  920. background-color: #900005;
  921. }
  922. }
  923. }
  924. // .tab {
  925. // width: 240rpx;
  926. // height: 0;
  927. // border-width: 0px 48rpx 72rpx 0px;
  928. // border-radius: 8px 8px 0 0;
  929. // border-style: none solid solid none;
  930. // border-color: transparent transparent #fff;
  931. // position: absolute;
  932. // top: -72rpx;
  933. // left: 0rpx;
  934. // right: 0rpx;
  935. // color: #101010;
  936. // color: rgba(16, 16, 16, 1);
  937. // text-align: center;
  938. // line-height: 72rpx;
  939. // z-index: 999;
  940. // text-indent: 16rpx;
  941. // }
  942. // .tab2 {
  943. // width: 240rpx;
  944. // height: 0;
  945. // border-width: 0px 48rpx 72rpx 0px;
  946. // border-radius: 8px 8px 0 0;
  947. // border-style: none solid solid none;
  948. // border-color: transparent transparent #D4DBE4;
  949. // position: absolute;
  950. // top: -72rpx;
  951. // left: 210rpx;
  952. // right: 0rpx;
  953. // color: #777777;
  954. // text-align: center;
  955. // line-height: 72rpx;
  956. // text-indent: 16rpx;
  957. // }
  958. .radio {
  959. margin-top: 24rpx;
  960. /deep/.u-radio__label {
  961. font-size: 24rpx
  962. }
  963. /deep/.u-radio {
  964. margin-bottom: 16px;
  965. width: 200rpx !important;
  966. }
  967. }
  968. }
  969. //各时段用电量
  970. .electricity-chart {
  971. margin: 24rpx 32rpx;
  972. padding: 40rpx 0rpx;
  973. background-color: #fff;
  974. border-radius: 8px;
  975. .title {
  976. display: flex;
  977. align-items: center;
  978. // justify-content: space-between;
  979. padding: 0 12rpx;
  980. margin-bottom: 40rpx;
  981. .icon {
  982. width: 36rpx;
  983. height: 36rpx;
  984. background-color: rgba(182, 212, 255, 1);
  985. border: 6px solid rgba(22, 119, 255, 1);
  986. border-radius: 100px;
  987. }
  988. .text {
  989. color: rgba(51, 51, 51, 1);
  990. font-size: 36rpx;
  991. margin-left: 16rpx;
  992. }
  993. .more {
  994. margin-left: auto;
  995. }
  996. }
  997. .chart {
  998. width: 100%;
  999. height: 440rpx;
  1000. .img {
  1001. width: 100%;
  1002. height: 440rpx;
  1003. }
  1004. }
  1005. }
  1006. .equipment-information {
  1007. margin: 24rpx 32rpx;
  1008. padding: 40rpx 0rpx;
  1009. background-color: #fff;
  1010. border-radius: 8px;
  1011. .title {
  1012. display: flex;
  1013. align-items: center;
  1014. padding: 0 32rpx;
  1015. margin-bottom: 40rpx;
  1016. .icon {
  1017. width: 36rpx;
  1018. height: 36rpx;
  1019. background-color: rgba(182, 212, 255, 1);
  1020. border: 6px solid rgba(22, 119, 255, 1);
  1021. border-radius: 100px;
  1022. }
  1023. .text {
  1024. display: flex;
  1025. align-items: center;
  1026. color: rgba(51, 51, 51, 1);
  1027. font-size: 36rpx;
  1028. margin-left: 16rpx;
  1029. }
  1030. .date {
  1031. margin-left: auto;
  1032. }
  1033. .more {
  1034. color: #838383;
  1035. font-size: 24rpx;
  1036. margin-left: auto;
  1037. }
  1038. }
  1039. .chart {
  1040. width: 100%;
  1041. height: 440rpx;
  1042. .img {
  1043. width: 100%;
  1044. height: 440rpx;
  1045. }
  1046. }
  1047. .infos {
  1048. padding: 0 32rpx;
  1049. display: flex;
  1050. justify-content: space-between;
  1051. text-align: center;
  1052. .border {
  1053. margin: auto 0;
  1054. height: 70rpx;
  1055. width: 2rpx;
  1056. background-color: rgba(204, 204, 204, 1);
  1057. ;
  1058. }
  1059. .item-title {
  1060. color: rgba(119, 119, 119, 1);
  1061. }
  1062. .item-value {
  1063. color: rgba(16, 16, 16, 1);
  1064. font-size: 32rpx;
  1065. margin-top: 16rpx;
  1066. }
  1067. }
  1068. }
  1069. // 异常
  1070. .abnormal {
  1071. margin: 24rpx 32rpx;
  1072. padding: 40rpx 32rpx;
  1073. background-color: #fff;
  1074. border-radius: 8px;
  1075. .headline {
  1076. display: flex;
  1077. align-items: center;
  1078. justify-content: space-between;
  1079. }
  1080. .title {
  1081. display: flex;
  1082. align-items: center;
  1083. font-weight: bold;
  1084. .icon {
  1085. width: 36rpx;
  1086. height: 36rpx;
  1087. background-color: rgba(182, 212, 255, 1);
  1088. border: 6px solid rgba(22, 119, 255, 1);
  1089. border-radius: 100px;
  1090. }
  1091. .text {
  1092. color: rgba(51, 51, 51, 1);
  1093. font-size: 36rpx;
  1094. margin-left: 16rpx;
  1095. }
  1096. }
  1097. .more {
  1098. color: #838383;
  1099. font-size: 24rpx
  1100. }
  1101. .details {
  1102. margin-top: 40rpx;
  1103. .item {
  1104. display: flex;
  1105. align-items: center;
  1106. justify-content: space-between;
  1107. margin-top: 32rpx;
  1108. .name {
  1109. color: rgba(51, 51, 51, 1);
  1110. }
  1111. .time {
  1112. color: rgba(119, 119, 119, 1);
  1113. font-size: 24rpx;
  1114. }
  1115. }
  1116. }
  1117. }
  1118. // 能源监测
  1119. .energy-inspection,
  1120. .data-analysis {
  1121. margin: 24rpx 32rpx;
  1122. padding: 40rpx 32rpx;
  1123. background-color: #fff;
  1124. border-radius: 8px;
  1125. .title {
  1126. display: flex;
  1127. align-items: center;
  1128. font-weight: bold;
  1129. .icon {
  1130. width: 36rpx;
  1131. height: 36rpx;
  1132. background-color: rgba(182, 212, 255, 1);
  1133. border: 6px solid rgba(22, 119, 255, 1);
  1134. border-radius: 100px;
  1135. }
  1136. .text {
  1137. color: rgba(51, 51, 51, 1);
  1138. font-size: 36rpx;
  1139. margin-left: 16rpx;
  1140. }
  1141. }
  1142. .grid {
  1143. .icon {
  1144. width: 128rpx;
  1145. height: 128rpx;
  1146. border-radius: 12px;
  1147. background-color: rgba(35, 186, 178, 1);
  1148. display: flex;
  1149. align-items: center;
  1150. justify-content: center;
  1151. margin-bottom: 16rpx;
  1152. .img {
  1153. width: 80rpx;
  1154. height: 80rpx;
  1155. }
  1156. }
  1157. .icon2 {
  1158. background-color: rgba(42, 186, 72, 1);
  1159. }
  1160. .icon3 {
  1161. background-color: rgba(78, 96, 246, 1);
  1162. }
  1163. .icon4 {
  1164. background-color: rgba(22, 119, 255, 1);
  1165. }
  1166. .icon5 {
  1167. background-color: rgba(35, 186, 178, 1);
  1168. }
  1169. .icon6 {
  1170. background-color: rgba(42, 186, 72, 1);
  1171. }
  1172. .icon7 {
  1173. background-color: rgba(22, 119, 255, 1);
  1174. }
  1175. .icon8 {
  1176. background-color: rgba(35, 186, 178, 1);
  1177. }
  1178. .icon9 {
  1179. background-color: rgba(42, 186, 72, 1);
  1180. }
  1181. .grid-text {
  1182. color: #333333;
  1183. }
  1184. }
  1185. }
  1186. // 设备信息弹窗
  1187. .equipment-popup {
  1188. .content {
  1189. padding: 32rpx;
  1190. .headline {
  1191. color: rgba(16, 16, 16, 1);
  1192. font-size: 36rpx;
  1193. text-align: center;
  1194. font-weight: bold;
  1195. }
  1196. .infos {
  1197. padding-bottom: 100rpx;
  1198. .item:last-of-type {
  1199. border: none;
  1200. }
  1201. .item {
  1202. display: flex;
  1203. align-items: center;
  1204. height: 80rpx;
  1205. line-height: 80rpx;
  1206. border-bottom: 1px solid #cccccc;
  1207. .item-title {
  1208. color: rgba(51, 51, 51, 1);
  1209. width: 200rpx;
  1210. }
  1211. .item-value {
  1212. color: #666666;
  1213. flex: 1;
  1214. margin-left: 16rpx;
  1215. }
  1216. }
  1217. }
  1218. .get {
  1219. height: 80rpx;
  1220. line-height: 80rpx;
  1221. border-radius: 4px;
  1222. background-color: rgba(22, 119, 255, 1);
  1223. color: rgba(255, 255, 255, 1);
  1224. font-size: 32rpx;
  1225. }
  1226. }
  1227. }
  1228. // 创建工单
  1229. .create-order {
  1230. width: 120rpx;
  1231. height: 120rpx;
  1232. border-radius: 20px;
  1233. background: linear-gradient(180.29deg, rgba(255, 124, 112, 1) 0.9%, rgba(255, 79, 63, 1) 100.4%);
  1234. box-shadow: 0px 2px 6px 0px rgba(0, 0, 0, 0.4);
  1235. text-align: center;
  1236. display: flex;
  1237. flex-direction: column;
  1238. justify-content: center;
  1239. align-items: center;
  1240. position: fixed;
  1241. right: 32rpx;
  1242. bottom: 64rpx;
  1243. .img {
  1244. width: 56rpx;
  1245. height: 56rpx;
  1246. vertical-align: middle;
  1247. }
  1248. .text {
  1249. color: rgba(255, 255, 255, 1);
  1250. font-size: 22rpx;
  1251. }
  1252. }
  1253. </style>