electronicMonitoringWater.vue 28 KB

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