electronicMonitoringWater.vue 29 KB

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