electronicMonitoring.vue 28 KB

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