statistics.vue 41 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954
  1. <template>
  2. <view>
  3. <u-picker-select title="日期选择" v-model="tabsFrom.show2" :defaultTime="tabsFrom.show2Index" :endYear="endYear"
  4. mode="time" :params="params" :noselect="false" @confirm="selector2confirm" @cancel="selector2cancel"
  5. @reset="selector2reset">
  6. </u-picker-select>
  7. <!-- 导航栏 -->
  8. <view class="navbar">
  9. <view class="title">
  10. 能源管理
  11. <template v-if="companyList.length==1">
  12. <span style="padding-left: 4px;">-</span>
  13. <span style="padding-left: 4px;">{{companyList[0].name}}</span>
  14. </template>
  15. <template v-else >
  16. <span style="padding-left: 4px;" v-if="companyList.length>=1&&current!=0">
  17. -
  18. </span>
  19. <span style="padding-left: 4px;" v-if="companyList.length>=1&&current!=0">
  20. {{merchantList1[current].name}}
  21. </span>
  22. </template>
  23. </view>
  24. </view>
  25. <!-- 标签 -->
  26. <view class="tabs-box" >
  27. <view class="tabs" v-show="companyList.length>1" :style="{width: companyList.length>4 ? '' : '100%'}">
  28. <u-tabs v-if="utabsone"
  29. :list="merchantList1" :is-scroll="false" active-color="#fff" inactive-color="#CCE2FF"
  30. bg-color="#1677FF" :current="current" @change="change"></u-tabs>
  31. </view>
  32. <view class="more" @click="popShow=true" v-if="companyList.length >= 4">
  33. <u-icon name="arrow-down" color="#fff" size="40"></u-icon>
  34. </view>
  35. </view>
  36. <!-- 标签弹出层 -->
  37. <u-popup v-model="popShow" duration="10" mode="top" :negative-top="88" border-radius="16">
  38. <view class="popup-tabs">
  39. <view class="tabs">
  40. <u-tabs :list="merchantList1" :is-scroll="false" :current="current" @change="change"></u-tabs>
  41. </view>
  42. <view class="more">
  43. <u-icon name="arrow-up" color="#777777" size="40" @click="popShow=false"></u-icon>
  44. </view>
  45. </view>
  46. <view class="tabs-options">
  47. <view class="item" v-for="(item, index) in merchantList2" :key="index"
  48. @click="merchantChange(item,index)">
  49. {{item.name}}
  50. </view>
  51. </view>
  52. </u-popup>
  53. <view class="main">
  54. <!-- 电表运行情况 -->
  55. <view class="statistics-1 statistics">
  56. <view class="title">
  57. <view class="icon">
  58. <image class="img" src="@/assets/img/circleCopy1@1x.png" mode=""></image>
  59. </view>
  60. <view class="text">
  61. 电表运行情况
  62. </view>
  63. <view class="check-all" @click="toEquipmentConditionMonitoring">
  64. 查看全部<u-icon name="arrow-right" size="24" color="#838383"></u-icon>
  65. </view>
  66. </view>
  67. <view class="item">
  68. <view class="item-progess">
  69. <view class="img-box">
  70. <u-circle-progress active-color="#2979ff" :percent="alarmsPercent" width="88">
  71. </u-circle-progress>
  72. </view>
  73. </view>
  74. <!-- 累计 -->
  75. <view class="total">
  76. <view class="total1">
  77. <view class="normal">
  78. 正常 {{alarmsForm.okNum}} 台
  79. </view>
  80. <view class="abnormal">
  81. 异常 {{alarmsForm.errorNum}} 台
  82. </view>
  83. </view>
  84. <view class="total2">
  85. 本月累计触发告警 <text class="total-number">{{alarmsForm.errorMonthNum}}</text> 次
  86. </view>
  87. </view>
  88. </view>
  89. </view>
  90. <!-- 能源管理 -->
  91. <view v-show="companyId" class="statistics statistics-manage">
  92. <view class="title">
  93. <view class="icon">
  94. <image class="img" src="@/assets/img/circleCopy1@1x.png" mode=""></image>
  95. </view>
  96. <view class="text">
  97. 能源管理
  98. </view>
  99. <view class="check-all" @click="toEquipmentElectricity">
  100. 查看全部<u-icon name="arrow-right" size="24" color="#838383"></u-icon>
  101. </view>
  102. </view>
  103. <view class="content"
  104. style="display: flex;justify-content: center;margin: 40px 0;"
  105. v-if="!getHomePageManageshowLoading">
  106. <div class="uni-toast" style="display: flex;font-size: 60rpx; color: rgb(192, 196, 204);" >
  107. <i class="uni-icon_toast uni-loading"
  108. style="
  109. width: 80rpx;
  110. height: 80rpx;
  111. "
  112. ></i><p class="uni-toast__content"> </p>加载中...</div>
  113. </view>
  114. <view class="content" v-else-if="getHomePageManageshowLoading&&meterList.length == 0">
  115. <u-divider :isnone="true" nonetext="无记录"
  116. border-color="#fff"></u-divider>
  117. </view>
  118. <!-- 图表 -->
  119. <view class="chart" v-show="getHomePageManageshowLoading">
  120. <view class="u-subsection">
  121. <u-subsection :list="list" :current="homePageManageType" @change="sectionChange"
  122. font-size="24"></u-subsection>
  123. </view>
  124. <view class="incomeExpenditureClass" v-show="!companyType" >
  125. <view class="income1">
  126. <view class="income11">
  127. 电费支出
  128. </view>
  129. <view class="income12">
  130. {{incomeExpenditureObj.expenditureFee}}
  131. <span class="income121" v-if="!incomeExpenditureObj.id">加载中...</span>
  132. </view>
  133. </view>
  134. <view class="income1">
  135. <view class="income11">
  136. 电费收入
  137. </view>
  138. <view class="income12">
  139. {{incomeExpenditureObj.incomeFee}}
  140. <span class="income121" v-if="!incomeExpenditureObj.id">加载中...</span>
  141. </view>
  142. </view>
  143. <view class="income1">
  144. <view class="income11">
  145. 收支情况
  146. </view>
  147. <view class="income12" :style="incomeExpenditureObj.differenceFee>=0?'color:red':'color:#52b8aa'">
  148. {{incomeExpenditureObj.differenceFee}}
  149. <span class="income121" v-if="!incomeExpenditureObj.id">加载中...</span>
  150. </view>
  151. </view>
  152. </view>
  153. <view class="chat-box" id="barEcharts" v-show="!companyType">
  154. </view>
  155. </view>
  156. <view class="search" v-if="false">
  157. <view class="switch">
  158. <u-switch v-model="checked" size="40"></u-switch><text>只看离线表</text>
  159. </view>
  160. <view class="search-box">
  161. <input type="text" placeholder="请输入电表查询" />
  162. <view class="icon">
  163. <img src="@/assets/img/riLine-search-line 1.svg" alt="" />
  164. </view>
  165. </view>
  166. </view>
  167. <!-- 电表统计 -->
  168. <Tree-Body :meterList="meterList" ref="mytree"
  169. @query="getHomePageManageChildMeter"
  170. v-if="getHomePageManageReady"
  171. :role="codes&&codes.indexOf('switch')!=-1"
  172. @switchBtn="switchBtnApi"
  173. ></Tree-Body>
  174. </view>
  175. <!-- 用电量 -->
  176. <view class="statistics-e statistics" v-if="!companyId">
  177. <view class="title">
  178. <view class="icon">
  179. <image class="img" src="@/assets/img/circleCopy1@1x.png" mode=""></image>
  180. </view>
  181. <view class="text">
  182. 用电量 (度)
  183. </view>
  184. <view class="check-all" @click="toEquipmentElectricity">
  185. 查看全部<u-icon name="arrow-right" size="24" color="#838383"></u-icon>
  186. </view>
  187. </view>
  188. <view class="content" style="display: flex;justify-content: center;margin: 40px 0;"
  189. v-if="getHomePageKwhshowLoading">
  190. <div class="uni-toast" style="display: flex;font-size: 60rpx; color: rgb(192, 196, 204);" >
  191. <i class="uni-icon_toast uni-loading"
  192. style="
  193. width: 80rpx;
  194. height: 80rpx;
  195. "
  196. ></i><p class="uni-toast__content"> </p>加载中...</div>
  197. </view>
  198. <view class="content" v-else-if="!getHomePageKwhshowLoading&&kWhList.length == 0">
  199. <u-divider :isnone="true" nonetext="无记录"
  200. border-color="#fff"></u-divider>
  201. </view>
  202. <view class="content" v-else >
  203. <view class="electricity">
  204. <view class="item" v-for="(item, index) in kWhList" :key="index"
  205. @click="toElectronicMonitoring(item)">
  206. <view class="item-content">
  207. <view class="equipment">
  208. <view class="equipment1 ">
  209. {{item.name}}
  210. </view>
  211. <view class="equipment2">
  212. {{item.installationAddressSimple}}
  213. </view>
  214. <view class="state" v-if="!item.online">
  215. <!-- <view class="dot off-line"></view> -->
  216. <view class="text">离线</view>
  217. </view>
  218. <view class="state state2" v-else>
  219. <!-- <view class="dot on-line"></view> -->
  220. <view class="text">在线</view>
  221. </view>
  222. </view>
  223. <view class="electricity">
  224. <view class="electricity-item electricity-item-day">
  225. <view class="date">
  226. 今日
  227. </view>
  228. <view class="number">
  229. {{item.thisDayKwh}}
  230. </view>
  231. </view>
  232. <view class="electricity-item">
  233. <view class="date">
  234. 本月
  235. </view>
  236. <view class="number">
  237. {{item.thisMonthKwh}}
  238. </view>
  239. </view>
  240. <view class="electricity-item">
  241. <view class="date">
  242. 上月
  243. </view>
  244. <view class="number">
  245. {{item.lastMonthKwh}}
  246. </view>
  247. </view>
  248. </view>
  249. </view>
  250. <view class="more">
  251. <u-icon name="arrow-right" color="#d4d4d4" size="24"></u-icon>
  252. </view>
  253. </view>
  254. </view>
  255. </view>
  256. </view>
  257. <!-- 统计2 异常告警记录 -->
  258. <view class="statistics-2 statistics" >
  259. <view class="title">
  260. <view class="icon">
  261. <image class="img" src="@/assets/img/circleCopy1@1x.png" mode=""></image>
  262. </view>
  263. <view class="text">
  264. 异常告警记录
  265. </view>
  266. <view class="check-all" @click="gotoUrl('/pages/abnormal/abnormalAlarmRecord?id='+companyId)">
  267. 查看全部<u-icon name="arrow-right" size="24" color="#838383"></u-icon>
  268. </view>
  269. </view>
  270. <u-divider :isnone="abnormalRecordsList.length==0" nonetext="无记录"
  271. border-color="#fff"></u-divider>
  272. <!-- 异常 -->
  273. <view class="abnormal-item" v-for="(item,index) in abnormalRecordsList"
  274. :key="index"
  275. @click="gotoUrl('/pages/abnormal/abnormalAlarmDetails?id='+item.id)"
  276. >
  277. <view class="item-title">
  278. <view class="name">
  279. {{item.configName}}
  280. </view>
  281. <view class="date">
  282. {{item.createTime}}
  283. </view>
  284. </view>
  285. <view class="item-value">
  286. <view class="value-content">
  287. <view class="value1">
  288. {{item.meterName}}
  289. </view>
  290. <view class="value2">
  291. {{item.installationAddressSimple}}
  292. </view>
  293. </view>
  294. <!-- 箭头 -->
  295. <view class="more">
  296. <u-icon name="arrow-right" color="#d4d4d4" size="24"></u-icon>
  297. </view>
  298. </view>
  299. </view>
  300. </view>
  301. <!-- 异常设备排名 -->
  302. <view class="statistics statistics-ranking" v-if="false">
  303. <view class="title">
  304. <view class="icon">
  305. <image class="img" src="@/assets/img/circleCopy1@1x.png" mode=""></image>
  306. </view>
  307. <view class="text">
  308. 异常设备排名
  309. </view>
  310. <view class="check-all">
  311. 查看全部<u-icon name="arrow-right" size="24" color="#838383"></u-icon>
  312. </view>
  313. </view>
  314. <!-- 合计 -->
  315. <view class="total">
  316. 本年度共有<text> 42</text>次设备异常告警
  317. </view>
  318. <view class="ranking-main">
  319. <view class="item" v-for="item in 3"
  320. @click="gotoUrl('/pages/equipmentDataMonitoring/electronicMonitoring?id='+'&name=')">
  321. <view class="ranking">
  322. 1
  323. </view>
  324. <view class="name">
  325. <view class="name1">
  326. 荆鹏软件园01
  327. </view>
  328. <view class="name2">
  329. 荆鹏集团
  330. </view>
  331. </view>
  332. <view class="time">
  333. 5次
  334. </view>
  335. </view>
  336. </view>
  337. <!-- 查看全部排名 -->
  338. <!-- <view class="check-all" @click="gotoUrl('/pages/abnormal/abnormalDeviceRanking')">
  339. 查看全部排名 <u-icon name="arrow-down" size="24" color="rgba(119,119,119,1)"></u-icon>
  340. </view> -->
  341. </view>
  342. </view>
  343. <energyCenterTabbar :current="0"></energyCenterTabbar>
  344. </view>
  345. </template>
  346. <script>
  347. import {
  348. parseUnixTime,
  349. beforeTimeStamp,
  350. getWeek
  351. } from '@/apis/utils'
  352. import energyCenterTabbar from '@/components/energyCenterTabbar.vue'
  353. import * as echarts from 'echarts';
  354. import * as API_index from '@/apis/pagejs/index.js'
  355. import * as API from '@/apis/pagejs/energyManage.js'
  356. import TreeBody from '@/components/tree/tree-body.vue';
  357. export default {
  358. components: {
  359. energyCenterTabbar,TreeBody
  360. },
  361. data() {
  362. return {
  363. abnormalRecordsList: [], // 异常告警记录
  364. queryDate: '',
  365. queryDateMonth:"",
  366. alarmsPercent: 0,
  367. alarmsForm: {
  368. okNum: 0,
  369. errorNum: 0,
  370. errorMonthNum: 0
  371. }, // 累计报警
  372. companyId: '', // 商户ID
  373. pageIndexe: 1, // 设备数据检测
  374. totalPagee: 1,
  375. deviceList: [],
  376. pageIndexp: 1, // 用电量
  377. totalPagep: 1,
  378. kWhList: [],
  379. codes: '', // 判断:reading用电量 detector设备数据检测
  380. merchantList1: [], // 商户
  381. merchantList2: [],
  382. companyList: [],
  383. popShow: false,
  384. current: 0,
  385. myLineChart: null, // 图表
  386. myBarChart: null,
  387. myPieChart: null,
  388. intervalId: null, // 用于存储间隔ID
  389. intervalReady: false, // 用于存储间隔ID
  390. list: [{
  391. name: '上月',
  392. value: "2"
  393. },
  394. {
  395. name: '当月',
  396. value: "1"
  397. },
  398. {
  399. name: '今日',
  400. value: "4"
  401. }, {
  402. name: '当年',
  403. value: "3"
  404. }, {
  405. name: '合计',
  406. value: "0"
  407. },
  408. {
  409. name: '指定月份',
  410. value: "10"
  411. }
  412. ],
  413. checked: false,
  414. homePageManageType: 0,
  415. meterList: [],
  416. meterListShow:{},
  417. homePageManageObj: {
  418. childKwh: 0,
  419. differenceKwh: 0,
  420. parkKwh: 0
  421. },
  422. endYear: '',
  423. params: {
  424. year: true,
  425. month: true,
  426. day: true,
  427. hour: false,
  428. minute: false,
  429. second: false
  430. },
  431. value: '2',
  432. clickType: -1,
  433. tabsFrom: {
  434. show1: false,
  435. show1Index: 0,
  436. show2Index: '',
  437. show2: false,
  438. show1Text: "全部类型",
  439. show2Text: "全部时间",
  440. },
  441. getHomePageManageReady:false,
  442. utabsone:true,
  443. companyType:false,
  444. incomeExpenditureObj:{},
  445. getHomePageKwhshowLoading:false,
  446. getHomePageManageshowLoading:false,
  447. }
  448. },
  449. onLoad() {
  450. var date = new Date();
  451. var year = date.getFullYear();
  452. var month = date.getMonth() + 1 >= 10 ? date.getMonth() + 1 : '0' + (date.getMonth() + 1);
  453. this.queryDateMonth = year + '-' + month;
  454. this.endYear = new Date().getFullYear();
  455. this.queryDate = parseUnixTime(new Date(), '{y}-{m}-{d}');
  456. this.getCompanyInfoList();
  457. },
  458. onReady() {
  459. // this.current=1
  460. // this.getHomePageManage()
  461. },
  462. onUnload(){
  463. this.clearTimer(); // 组件销毁前清除定时器
  464. console.log("组件销毁前清除定时器")
  465. },
  466. beforeDestroy() {
  467. this.clearTimer(); // 组件销毁前清除定时器
  468. console.log("组件销毁前清除定时器")
  469. },
  470. watch:{
  471. companyId(val){
  472. var bl=false
  473. this.companyList.find(item=>{
  474. console.log(item.id,item.type)
  475. if(item.id==val){
  476. bl= item.type==4
  477. }
  478. })
  479. this.companyType= bl
  480. }
  481. },
  482. onHide(){
  483. this.intervalReady=false
  484. this.clearTimer();
  485. },
  486. onShow(){
  487. if(!this.intervalReady){
  488. this.startInterval();
  489. }
  490. },
  491. methods: {
  492. switchBtnApiMethod(node,key){
  493. uni.showLoading({
  494. title: "加载中",
  495. mask: true,
  496. })
  497. API.remoteSwitch({
  498. meterId:node.id,
  499. enabled:key
  500. }).then((res) => {
  501. uni.hideLoading();
  502. node.switchStatus=key
  503. }).catch(error => {
  504. uni.showToast({
  505. title: error,
  506. icon: "none"
  507. })
  508. })
  509. },
  510. switchBtnApi(node,key){
  511. uni.showModal({
  512. confirmColor:`${key?'#3CC51F':'red'}`,
  513. confirmText:`${key?'开启':'关闭'}`,
  514. content: `确认是否要"${key?'开启':'关闭'}"${node.name}`,
  515. title: "提示",
  516. success:res=> {
  517. if(res.confirm){
  518. this.switchBtnApiMethod(node,key);
  519. }
  520. }
  521. })
  522. console.log(node,key)
  523. },
  524. getIncomeExpenditure(){
  525. API.incomeExpenditure({
  526. //parentMeterId:item.id,
  527. queryDate:this.queryDate,
  528. companyId: this.companyId,
  529. type: this.list[this.homePageManageType].value
  530. }).then((response) => {
  531. this.incomeExpenditureObj=response.data
  532. this.incomeExpenditureObj.id=1
  533. }).catch(error => {
  534. uni.showToast({
  535. title: error,
  536. icon: "none"
  537. })
  538. })
  539. },
  540. // 设备数据监测
  541. getHomePageManageChildMeter(item,bl) {
  542. if(!bl){
  543. // uni.showLoading({
  544. // title: "加载中",
  545. // mask: true,
  546. // })
  547. }
  548. API.homePageManageChildMeter({
  549. parentMeterId:item.id,
  550. queryDate:this.queryDate,
  551. companyId: this.companyId,
  552. type: this.list[this.homePageManageType].value
  553. }).then((response) => {
  554. // if(!bl){
  555. // uni.hideLoading();
  556. // }
  557. // this.meterList = response.data.meterList;
  558. // if(!this.meterListShow.id){
  559. // this.meterListShow.id=1
  560. // this.recursionList(this.meterList)
  561. // }
  562. var childMeterList=response.data.childMeterList
  563. item.childMeterList=childMeterList
  564. if(!bl){
  565. for(var i in childMeterList){
  566. var obj=childMeterList[i]
  567. this.getHomePageManageChildMeter(obj,true)
  568. }
  569. }
  570. }).catch(error => {
  571. uni.showToast({
  572. title: error,
  573. icon: "none"
  574. })
  575. })
  576. },
  577. recursionList(list){
  578. if(list){
  579. for(var i in list){
  580. var obj=list[i]
  581. this.meterListShow[obj.id]=false
  582. this.recursionList(obj.childMeterList)
  583. }
  584. }
  585. },
  586. ifBtnShow(item){
  587. return this.meterListShow[item.id]
  588. },
  589. showBtn(item){
  590. var key=this.meterListShow[item.id];
  591. this.$set(this.meterListShow,item.id,!key)
  592. console.log("showBtn,",key)
  593. this.$forceUpdate()
  594. },
  595. selector2reset(e) {
  596. console.log(e)
  597. this.tabsFrom.show2Text = '全部时间'
  598. this.tabsFrom.show2Index = '';
  599. if (e.day) {
  600. this.queryDate = parseUnixTime(new Date(), '{y}-{m}-{d}');
  601. this.getHomePageManage();
  602. } else {
  603. this.homePageManageType = this.clickType;
  604. if (this.homePageManageType != 5) {
  605. this.list[5].name = '指定月份';
  606. }
  607. this.getHomePageManage();
  608. }
  609. },
  610. selector2cancel() {
  611. if(this.clickType != -1) {
  612. this.homePageManageType = this.clickType;
  613. }
  614. },
  615. selector2confirm(e) {
  616. this.tabsFrom.show2Text = e.year + "年" + e.month + "月"
  617. this.tabsFrom.show2Index = e.year + "-" + e.month
  618. if (e.day) {
  619. this.tabsFrom.show2Text += e.day + "日"
  620. this.tabsFrom.show2Index += '-' + e.day
  621. this.queryDateMethod(this.tabsFrom.show2Index, true)
  622. } else {
  623. this.queryDateMethod(this.tabsFrom.show2Index, false)
  624. }
  625. },
  626. queryDateMethod(queryTime, day) {
  627. if (day) {
  628. this.queryDate = queryTime;
  629. //this.FormData2.type =day?"9":"10"
  630. //this.value="-1"
  631. //this.getHomePageManage();
  632. } else {
  633. this.queryDate = queryTime + "-01";
  634. this.homePageManageType = "5";
  635. this.list[5].name = queryTime;
  636. this.getHomePageManage();
  637. }
  638. },
  639. clearTimer() {
  640. if (this.intervalId) {
  641. clearInterval(this.intervalId); // 清除定时器
  642. this.intervalId = null; // 重置定时器ID
  643. }
  644. },
  645. startInterval() {
  646. this.clearTimer(); // 组件销毁前清除定时器
  647. this.intervalId = setInterval(() => {
  648. this.getHomePageKwh(0, true)
  649. }, 60000);
  650. },
  651. merchantChangeApi() {
  652. this.popShow=false
  653. this.getDeviceStatus()
  654. this.getAbnormalAlarmRecord();
  655. if (this.companyId) {
  656. this.getHomePageManage(true);
  657. }
  658. },
  659. change(index) {
  660. this.current = index;
  661. this.companyId = this.merchantList1[index].id;
  662. this.merchantChangeApi()
  663. },
  664. merchantChange(item, index) {
  665. if(this.current==0){
  666. this.current=1;
  667. }
  668. var m = item;
  669. var n = this.merchantList1[this.current];
  670. this.merchantList1[this.current] = m;
  671. this.merchantList2[index] = n;
  672. //this.$forceUpdate()
  673. this.utabsone=false
  674. this.companyId = item.id;
  675. this.merchantChangeApi()
  676. this.popShow = false;
  677. },
  678. // 单位
  679. getCompanyInfoList() {
  680. // uni.showLoading({
  681. // title: "加载中",
  682. // mask: true,
  683. // })
  684. API.deviceCompanyList().then((response) => {
  685. //uni.hideLoading();
  686. var list = response.data.companyInfoList;
  687. var mList1 = [];
  688. var mList2 = [];
  689. mList1.push({
  690. id: '',
  691. name: '全部'
  692. });
  693. for (var i = 0; i < list.length; i++) {
  694. if (i >= 3) {
  695. mList2.push(list[i]);
  696. } else {
  697. mList1.push(list[i]);
  698. }
  699. }
  700. this.companyList = list;
  701. if(list.length==1){
  702. this.companyId=list[0].id
  703. }else{
  704. this.getHomePageKwh(0);
  705. }
  706. this.merchantList1 = mList1;
  707. this.merchantList2 = mList2;
  708. this.merchantChangeApi()
  709. }).catch(error => {
  710. uni.showToast({
  711. title: error,
  712. icon: "none"
  713. })
  714. })
  715. },
  716. sectionChange(index) {
  717. this.clickType = index;
  718. this.homePageManageType = index;
  719. if (index == 5) {
  720. this.tabsFrom.show2 = true;
  721. this.params.day = false;
  722. } else {
  723. this.list[5].name = '指定月份'
  724. this.getHomePageManage()
  725. }
  726. },
  727. // 设备数据监测
  728. getHomePageManage(bl) {
  729. this.getHomePageManageReady=false
  730. if(bl){
  731. this.getHomePageManageshowLoading=false
  732. }else{
  733. uni.showLoading({
  734. title: "加载中",
  735. mask: true,
  736. })
  737. }
  738. this.incomeExpenditureObj={}
  739. API.homePageManage({
  740. queryDate:this.queryDate,
  741. companyId: this.companyId,
  742. type: this.list[this.homePageManageType].value
  743. }).then((response) => {
  744. this.getHomePageManageReady=true
  745. if(bl){
  746. this.getHomePageManageshowLoading=true
  747. }else{
  748. uni.hideLoading();
  749. }
  750. this.codes =this.carhelp.getPersonInfo().codes;
  751. this.meterList = response.data.meterList;
  752. this.homePageManageObj = response.data;
  753. if(!this.companyType){
  754. this.myBarChart=null;
  755. this.$nextTick(()=>{
  756. this.getBarCharts()
  757. })
  758. this.getIncomeExpenditure();
  759. }
  760. }).catch(error => {
  761. uni.showToast({
  762. title: error,
  763. icon: "none"
  764. })
  765. })
  766. },
  767. // 异常告警记录
  768. getAbnormalAlarmRecord() {
  769. API.alarmRecord({
  770. queryDate: this.queryDateMonth,
  771. configId: '',
  772. pageIndex: 1,
  773. pageSize: 3,
  774. companyId: this.companyId
  775. }).then((response) => {
  776. this.abnormalRecordsList = response.data.data;
  777. }).catch(error => {
  778. uni.showToast({
  779. title: error,
  780. icon: "none"
  781. })
  782. })
  783. },
  784. // 用电量
  785. getHomePageKwh(pl, interval) {
  786. this.pageIndexp = this.pageIndexp + pl;
  787. if (this.pageIndexp > this.totalPagep) {
  788. this.pageIndexp = 1;
  789. }
  790. if (!interval) {
  791. // uni.showLoading({
  792. // title: "加载中",
  793. // mask: true,
  794. // })
  795. this.getHomePageKwhshowLoading=true;
  796. }
  797. API.homePageKwh({
  798. pageIndex: this.pageIndexp,
  799. pageSize: 5,
  800. companyId: this.companyId
  801. }).then((response) => {
  802. if (!interval) {
  803. //uni.hideLoading();
  804. this.getHomePageKwhshowLoading=false;
  805. }
  806. this.kWhList = response.data.data;
  807. this.totalPagep = response.data.totalPage;
  808. if (!interval) {
  809. this.startInterval(); // 组件挂载后开始间隔
  810. }else{
  811. this.intervalReady=true
  812. }
  813. }).catch(error => {
  814. uni.showToast({
  815. title: error,
  816. icon: "none"
  817. })
  818. })
  819. },
  820. // 累计报警
  821. getDeviceStatus() {
  822. API.deviceStatus({
  823. companyId: this.companyId
  824. }).then((response) => {
  825. this.utabsone=true
  826. this.alarmsForm = response.data;
  827. if (this.alarmsForm.okNum != 0) {
  828. this.alarmsPercent = this.alarmsForm.okNum / (this.alarmsForm.okNum + this.alarmsForm
  829. .errorNum) * 100;
  830. }
  831. }).catch(error => {
  832. uni.showToast({
  833. title: error,
  834. icon: "none"
  835. })
  836. })
  837. },
  838. // 故障类型
  839. getBarCharts() {
  840. if (!this.myBarChart) {
  841. this.myBarChart = echarts.init(document.getElementById('barEcharts'),null,{
  842. width:uni.upx2px(690),height:uni.upx2px(480)
  843. });
  844. }
  845. this.myBarChart.clear()
  846. var thismax=Math.max(this.homePageManageObj.parkKwh,this.homePageManageObj.differenceKwh,this.homePageManageObj.childKwh)
  847. var option = {
  848. polar: {
  849. center:['35%','50%'],
  850. radius:[20, '70%']
  851. },
  852. angleAxis: {
  853. startAngle: 75,
  854. label: {
  855. rotate: 45, // 旋转标签,使得重叠的概率降低
  856. // margin: 5 // 设置标签与轴线之间的距离,增加空间
  857. }
  858. },
  859. legend: {
  860. x:"65%",
  861. y: '0',
  862. data: ['园区电量', '表计电量', '电损量'],
  863. orient :'vertical'
  864. },
  865. radiusAxis: {
  866. type: 'category',
  867. data: ['']
  868. },
  869. tooltip: {},
  870. series: [
  871. {
  872. name:'电损量',
  873. type: 'bar',
  874. data: [
  875. this.homePageManageObj.differenceKwh
  876. ],
  877. coordinateSystem: 'polar',
  878. label: {
  879. show: true,
  880. position: 'middle',
  881. formatter: '{c}度'
  882. }
  883. },
  884. {
  885. name:'表计电量',
  886. type: 'bar',
  887. data: [
  888. this.homePageManageObj.childKwh
  889. ],
  890. coordinateSystem: 'polar',
  891. label: {
  892. show: true,
  893. position: 'middle',
  894. formatter: '{c}度'
  895. }
  896. },
  897. {
  898. name:'园区电量',
  899. type: 'bar',
  900. data: [
  901. this.homePageManageObj.parkKwh,
  902. ],
  903. coordinateSystem: 'polar',
  904. label: {
  905. show: true,
  906. position: 'middle',
  907. formatter: '{c}度'
  908. }
  909. },
  910. ]
  911. };
  912. console.log(option)
  913. this.myBarChart.setOption(option);
  914. },
  915. toDataMonitoringList() {
  916. uni.navigateTo({
  917. url: '/pages/equipmentDataMonitoring/dataMonitoring-list'
  918. })
  919. },
  920. toEquipmentConditionMonitoring() {
  921. uni.navigateTo({
  922. url: '/pages/equipmentConditionMonitoring/equipmentConditionMonitoring?companyId='+this.companyId
  923. })
  924. },
  925. toWorkOrderManagement() {
  926. uni.navigateTo({
  927. url: '/pages/workOrderManagement/workOrderManagement'
  928. })
  929. },
  930. toEquipmentElectricity() {
  931. uni.navigateTo({
  932. url: '/pages/equipmentDataMonitoring/equipmentElectricity'
  933. })
  934. },
  935. toElectronicMonitoring(item) {
  936. uni.navigateTo({
  937. url: '/pages/equipmentDataMonitoring/electronicMonitoring?id=' + item.id + '&name=' + item
  938. .name +
  939. '&companyId=' + item.companyId
  940. })
  941. }
  942. }
  943. }
  944. </script>
  945. <style lang="scss" scoped>
  946. .incomeExpenditureClass{
  947. display: flex;
  948. justify-content: space-evenly;
  949. width: 100%;
  950. padding:32rpx 0;
  951. .income1:last-child{
  952. .income11,.income12{
  953. border-right: 1px solid #c5c3c3;
  954. }
  955. }
  956. .income1{
  957. .income121{
  958. font-size: 24rpx;
  959. color:#c5c3c3;
  960. }
  961. width: 33.33%;
  962. text-align: center;
  963. .income11{
  964. padding:12rpx 0;
  965. background-color: #1677FF ;
  966. color:#fff;
  967. font-size: 36rpx;
  968. border-top: 1px solid #c5c3c3;
  969. border-left: 1px solid #c5c3c3;
  970. }
  971. .income12{
  972. padding:12rpx 0;
  973. border-top: 1px solid #c5c3c3;
  974. border-bottom: 1px solid #c5c3c3;
  975. border-left: 1px solid #c5c3c3;
  976. font-size: 40rpx;
  977. }
  978. }
  979. }
  980. page {
  981. padding-bottom: 200rpx;
  982. }
  983. /deep/.u-drawer-content {
  984. margin-top: 88rpx;
  985. }
  986. .popup-tabs {
  987. background-color: #fff;
  988. display: flex;
  989. align-items: center;
  990. justify-content: space-between;
  991. padding-top: 32rpx;
  992. padding-right: 32rpx;
  993. color: rgba(51, 51, 51, 1);
  994. font-size: 32rpx;
  995. .tabs {
  996. width: 88%;
  997. }
  998. }
  999. /deep/.u-tab-item {
  1000. width: 25% !important;
  1001. flex: none !important;
  1002. }
  1003. .tabs-options {
  1004. display: flex;
  1005. padding: 24rpx 32rpx 0;
  1006. flex-wrap: wrap;
  1007. .item {
  1008. width: 25%;
  1009. margin-bottom: 40rpx;
  1010. }
  1011. }
  1012. // 导航栏
  1013. .navbar {
  1014. background-color: rgba(22, 119, 255, 1);
  1015. color: #fff;
  1016. line-height: 88rpx;
  1017. display: flex;
  1018. justify-content: space-between;
  1019. align-items: center;
  1020. padding: 0 32rpx;
  1021. color: rgba(255, 255, 255, 1);
  1022. font-size: 36rpx;
  1023. position: fixed;
  1024. left: 0;
  1025. right: 0;
  1026. top: 0;
  1027. z-index: 999999;
  1028. .img {
  1029. width: 48rpx;
  1030. height: 48rpx;
  1031. vertical-align: middle;
  1032. }
  1033. }
  1034. // 标签
  1035. .tabs-box {
  1036. padding: 32rpx 0;
  1037. margin-top: 88rpx;
  1038. padding-right: 32rpx;
  1039. background-color: rgba(22, 119, 255, 1);
  1040. display: flex;
  1041. align-items: center;
  1042. justify-content: space-between;
  1043. .tabs {
  1044. width: 88%;
  1045. }
  1046. }
  1047. .main {
  1048. border-radius: 16px 16px 0px 0px;
  1049. background: linear-gradient(180deg, rgba(242, 244, 246, 1) 61%, rgba(255, 255, 255, 0) 100%);
  1050. margin-top: -24rpx;
  1051. padding: 32rpx;
  1052. .statistics {
  1053. border-radius: 8px;
  1054. background-color: rgba(255, 255, 255, 1);
  1055. box-shadow: 0px 1px 6px 0px rgba(0, 59, 142, 0.05);
  1056. margin-bottom: 24rpx;
  1057. padding: 40rpx;
  1058. .title {
  1059. display: flex;
  1060. align-items: center;
  1061. margin-bottom: 20rpx;
  1062. .img {
  1063. width: 36rpx;
  1064. height: 36rpx;
  1065. vertical-align: middle;
  1066. border-radius: 999px;
  1067. }
  1068. .change {
  1069. display: flex;
  1070. align-items: center;
  1071. .change-img {
  1072. width: 32rpx;
  1073. height: 32rpx;
  1074. vertical-align: middle;
  1075. }
  1076. text {
  1077. margin-left: 8rpx;
  1078. }
  1079. }
  1080. .text {
  1081. color: rgba(16, 16, 16, 1);
  1082. font-size: 36rpx;
  1083. margin-left: 16rpx;
  1084. font-weight: bold;
  1085. }
  1086. .change {
  1087. margin-left: 16rpx;
  1088. font-size: 24rpx;
  1089. color: #838383;
  1090. }
  1091. .check-all {
  1092. margin-left: auto;
  1093. color: rgba(131, 131, 131, 1);
  1094. font-size: 24rpx;
  1095. }
  1096. }
  1097. }
  1098. // 用电量
  1099. .statistics-e {
  1100. padding: 40rpx;
  1101. .electricity {
  1102. background-color: #fff;
  1103. .item:last-of-type {
  1104. border: none;
  1105. padding-bottom: 0;
  1106. }
  1107. .item {
  1108. padding: 16rpx 0;
  1109. display: flex;
  1110. align-items: center;
  1111. justify-content: space-between;
  1112. border-bottom: 1px solid rgba(245, 245, 245, 1);
  1113. .item-content {
  1114. width: 93%;
  1115. }
  1116. .equipment {
  1117. display: flex;
  1118. align-items: center;
  1119. .equipment1 {
  1120. color: rgba(51, 51, 51, 1);
  1121. font-size: 32rpx;
  1122. max-width: 40%;
  1123. font-weight: bold;
  1124. white-space: nowrap;
  1125. overflow: hidden;
  1126. text-overflow: ellipsis;
  1127. }
  1128. .equipment2 {
  1129. color: rgba(119, 119, 119, 1);
  1130. margin-left: 16rpx;
  1131. max-width: 40%;
  1132. white-space: nowrap;
  1133. overflow: hidden;
  1134. text-overflow: ellipsis;
  1135. }
  1136. }
  1137. // 状态
  1138. .state {
  1139. width: 64rpx;
  1140. height: 36rpx;
  1141. line-height: 36rpx;
  1142. border-radius: 8rpx;
  1143. font-size: 22rpx;
  1144. text-align: center;
  1145. border: 1px solid rgba(255, 123, 0, 1);
  1146. color: rgba(255, 123, 0, 1);
  1147. margin-left: auto;
  1148. // .dot {
  1149. // margin-right: 8rpx;
  1150. // width: 16rpx;
  1151. // height: 16rpx;
  1152. // background-color: rgba(255, 123, 0, 1);
  1153. // border-radius: 999px;
  1154. // margin-left: auto;
  1155. // }
  1156. }
  1157. .state2 {
  1158. border: 1px solid rgba(0, 185, 98, 1);
  1159. color: rgba(0, 185, 98, 1);
  1160. }
  1161. .electricity {
  1162. display: flex;
  1163. justify-content: space-between;
  1164. align-items: center;
  1165. margin-top: 8rpx;
  1166. text-align: center;
  1167. .electricity-item {
  1168. display: flex;
  1169. align-items: center;
  1170. width: 33.3%;
  1171. height: 40rpx;
  1172. line-height: 40rpx;
  1173. .number {
  1174. color: rgba(51, 51, 51, 1);
  1175. font-weight: bold;
  1176. font-size: 24rpx;
  1177. margin-left: 8rpx;
  1178. }
  1179. .date {
  1180. color: rgba(119, 119, 119, 1);
  1181. font-size: 24rpx;
  1182. }
  1183. }
  1184. }
  1185. }
  1186. }
  1187. }
  1188. // 统计1
  1189. .statistics-1 {
  1190. background-color: rgba(255, 255, 255, 1);
  1191. width: 100%;
  1192. padding: 24rpx;
  1193. box-shadow: 0px 1px 6px 0px rgba(0, 59, 142, 0.05);
  1194. border-radius: 8px;
  1195. margin-bottom: 24rpx;
  1196. .item {
  1197. margin-top: 32rpx;
  1198. display: flex;
  1199. align-items: center;
  1200. .item-progess {
  1201. display: flex;
  1202. align-items: center;
  1203. .img {
  1204. width: 88rpx;
  1205. height: 88rpx;
  1206. margin-right: 24rpx;
  1207. vertical-align: middle;
  1208. }
  1209. }
  1210. .total {
  1211. margin-left: 24rpx;
  1212. color: rgba(119, 119, 119, 1);
  1213. .total1 {
  1214. display: flex;
  1215. color: rgba(51, 51, 51, 1);
  1216. font-size: 32rpx;
  1217. font-weight: bold;
  1218. .normal {
  1219. margin-bottom: 12rpx;
  1220. }
  1221. }
  1222. .total2 {
  1223. color: rgba(119, 119, 119, 1);
  1224. }
  1225. .abnormal {
  1226. margin-left: 24rpx;
  1227. }
  1228. }
  1229. .total-number {
  1230. color: rgba(255, 123, 0, 1);
  1231. margin: 0 8rpx;
  1232. font-weight: bold;
  1233. }
  1234. }
  1235. }
  1236. // 统计2异常报警记录
  1237. .statistics-2 {
  1238. .abnormal-item:last-of-type {
  1239. border-bottom: none !important;
  1240. padding-bottom: 0;
  1241. }
  1242. .abnormal-item {
  1243. display: flex;
  1244. justify-content: space-between;
  1245. align-items: center;
  1246. padding: 16rpx;
  1247. border-bottom: 1px solid rgba(245, 245, 245, 1);
  1248. .item-title {
  1249. color: rgba(51, 51, 51, 1);
  1250. .img {
  1251. width: 32rpx;
  1252. height: 32rpx;
  1253. margin-right: 8rpx;
  1254. }
  1255. .name {
  1256. color: rgba(51, 51, 51, 1);
  1257. font-weight: bold;
  1258. }
  1259. .date {
  1260. color: rgba(119, 119, 119, 1);
  1261. font-size: 24rpx;
  1262. }
  1263. }
  1264. .item-value {
  1265. text-align: right;
  1266. display: flex;
  1267. align-items: center;
  1268. .more {
  1269. margin-left: 8rpx;
  1270. }
  1271. .value1 {
  1272. font-weight: bold;
  1273. color: rgba(51, 51, 51, 1);
  1274. }
  1275. .value2 {
  1276. color: rgba(119, 119, 119, 1);
  1277. font-size: 24rpx;
  1278. }
  1279. }
  1280. }
  1281. }
  1282. // 统计3设备实时监控
  1283. .statistics-3 {
  1284. .monitoring-item {
  1285. padding: 16rpx 0;
  1286. border-bottom: 1px solid rgba(245, 245, 245, 1);
  1287. .item-title {
  1288. display: flex;
  1289. align-items: center;
  1290. .text1 {
  1291. color: rgba(51, 51, 51, 1);
  1292. }
  1293. }
  1294. .company-name {
  1295. color: rgba(119, 119, 119, 1);
  1296. font-size: 24rpx;
  1297. display: flex;
  1298. align-items: center;
  1299. .state {
  1300. margin-left: 12rpx;
  1301. display: flex;
  1302. align-items: center;
  1303. color: rgba(255, 123, 0, 1);
  1304. text {
  1305. margin-right: 8rpx;
  1306. display: inline-block;
  1307. width: 16rpx;
  1308. height: 16rpx;
  1309. border-radius: 999px;
  1310. }
  1311. .off-line {
  1312. background-color: rgba(255, 123, 0, 1);
  1313. }
  1314. .on-line {
  1315. background-color: rgba(0, 185, 98, 1);
  1316. }
  1317. }
  1318. .state2 {
  1319. color: rgba(0, 185, 98, 1);
  1320. }
  1321. }
  1322. .state {
  1323. margin-left: auto;
  1324. display: flex;
  1325. .state1,
  1326. .state2 {
  1327. display: flex;
  1328. align-items: center;
  1329. margin-left: 24rpx;
  1330. }
  1331. .more {
  1332. margin-left: 8rpx;
  1333. }
  1334. .img {
  1335. width: 32rpx;
  1336. height: 32rpx;
  1337. vertical-align: middle;
  1338. margin-right: 8rpx;
  1339. }
  1340. }
  1341. // 监控信息
  1342. .infos {
  1343. margin-top: 8rpx;
  1344. display: flex;
  1345. align-items: center;
  1346. justify-content: space-between;
  1347. flex-wrap: wrap;
  1348. .infos-item {
  1349. width: 38%;
  1350. display: flex;
  1351. align-items: center;
  1352. color: rgba(51, 51, 51, 1);
  1353. font-size: 22rpx;
  1354. // margin-right: 16rpx;
  1355. margin-bottom: 8rpx;
  1356. .icon {}
  1357. }
  1358. .text {
  1359. font-weight: bold;
  1360. }
  1361. }
  1362. }
  1363. }
  1364. // 设备状态
  1365. .statistics-4 {
  1366. .chat-img {
  1367. width: 100%;
  1368. height: 620rpx;
  1369. }
  1370. }
  1371. // 故障类型
  1372. .statistics-5,
  1373. .statistics-6 {
  1374. .chat-img {
  1375. width: 100%;
  1376. height: 410rpx;
  1377. }
  1378. }
  1379. // 异常设备排名
  1380. .statistics-ranking {
  1381. .total {
  1382. color: rgba(16, 16, 16, 1);
  1383. padding-left: 52rpx;
  1384. text {
  1385. color: #1677FF;
  1386. padding: 0 8rpx;
  1387. }
  1388. }
  1389. .ranking-main {
  1390. margin-top: 40rpx;
  1391. border-radius: 16px;
  1392. background-color: #fff;
  1393. .item:last-of-type {
  1394. margin-bottom: 0;
  1395. }
  1396. .item {
  1397. display: flex;
  1398. align-items: center;
  1399. margin-bottom: 32rpx;
  1400. .ranking {
  1401. color: rgba(16, 16, 16, 1);
  1402. font-weight: bold;
  1403. }
  1404. .icon {
  1405. width: 72rpx;
  1406. height: 72rpx;
  1407. border-radius: 4px;
  1408. background-color: rgba(219, 234, 255, 1);
  1409. display: flex;
  1410. align-items: center;
  1411. justify-content: center;
  1412. margin-left: 24rpx;
  1413. .img {
  1414. width: 48rpx;
  1415. height: 48rpx;
  1416. }
  1417. }
  1418. .name {
  1419. margin-left: 16rpx;
  1420. .name1 {
  1421. color: rgba(51, 51, 51, 1);
  1422. font-weight: bold;
  1423. }
  1424. .name2 {
  1425. color: rgba(119, 119, 119, 1);
  1426. font-size: 24rpx;
  1427. margin-top: 4rpx;
  1428. }
  1429. }
  1430. .time {
  1431. color: rgba(16, 16, 16, 1);
  1432. margin-left: auto;
  1433. font-weight: bold;
  1434. }
  1435. }
  1436. }
  1437. // 查看全部排名
  1438. .check-all {
  1439. text-align: center;
  1440. color: rgba(119, 119, 119, 1);
  1441. font-size: 12px;
  1442. }
  1443. }
  1444. // 能源管理
  1445. .statistics-manage {
  1446. padding: 40rpx 0;
  1447. .title,
  1448. .chart,
  1449. .search,
  1450. .meter-statistic {
  1451. padding: 0 32rpx;
  1452. }
  1453. // 图表
  1454. .chart {
  1455. padding-top: 32rpx;
  1456. border-top: 1px solid rgba(242, 242, 242, 1);
  1457. /deep/.u-subsection {
  1458. padding: 2px;
  1459. }
  1460. /deep/.u-item {
  1461. padding: 0;
  1462. font-size: 24rpx
  1463. }
  1464. .chat-box {
  1465. margin-top: 24rpx;
  1466. width: 100%;
  1467. height: 480rpx;
  1468. img {
  1469. width: 100%;
  1470. height: 100%;
  1471. }
  1472. }
  1473. }
  1474. .search {
  1475. border-top: 1px solid rgba(242, 242, 242, 1);
  1476. border-bottom: 1px solid rgba(242, 242, 242, 1);
  1477. display: flex;
  1478. align-items: center;
  1479. justify-content: space-between;
  1480. padding: 40rpx 32rpx;
  1481. .switch {
  1482. display: flex;
  1483. align-items: center;
  1484. text {
  1485. margin-left: 8rpx;
  1486. color: rgba(51, 51, 51, 1);
  1487. }
  1488. }
  1489. .search-box {
  1490. border-radius: 50px;
  1491. background-color: rgba(242, 244, 246, 1);
  1492. color: rgba(136, 136, 136, 1);
  1493. height: 56rpx;
  1494. line-height: 56rpx;
  1495. padding-left: 16rpx;
  1496. padding-right: 8rpx;
  1497. flex: 1;
  1498. margin-left: 28rpx;
  1499. display: flex;
  1500. align-items: center;
  1501. justify-content: space-between;
  1502. uni-input {
  1503. height: 56rpx;
  1504. line-height: 56rpx !important;
  1505. font-size: 28rpx;
  1506. width: 75%;
  1507. }
  1508. .icon {
  1509. display: flex;
  1510. align-items: center;
  1511. justify-content: center;
  1512. width: 64rpx;
  1513. height: 40rpx;
  1514. border-radius: 50px;
  1515. background-color: rgba(22, 119, 255, 1);
  1516. }
  1517. }
  1518. }
  1519. }
  1520. // 电表统计
  1521. .meter-statistic {
  1522. margin-top: 32rpx;
  1523. .meter-statistic-main{
  1524. display: flex;
  1525. align-items: center;
  1526. }
  1527. .sum {
  1528. .meter-name {
  1529. color: rgba(51, 51, 51, 1);
  1530. font-size: 32rpx;
  1531. margin-left: 8rpx;
  1532. font-weight: bold;
  1533. }
  1534. .icon {
  1535. margin-right: 8rpx;
  1536. img {
  1537. width: 40rpx;
  1538. height: 40rpx;
  1539. vertical-align: middle;
  1540. }
  1541. }
  1542. .meter-state {
  1543. margin-left: 8rpx;
  1544. width: 64rpx;
  1545. height: 36rpx;
  1546. line-height: 36rpx;
  1547. border-radius: 4px;
  1548. background-color: rgba(255, 255, 255, 1);
  1549. color: rgba(0, 185, 98, 1);
  1550. font-size: 22rpx;
  1551. text-align: center;
  1552. border: 1px solid rgba(0, 185, 98, 1);
  1553. }
  1554. .meter-state2 {
  1555. border: 1px solid rgba(255, 123, 0, 1);
  1556. color: rgba(255, 123, 0, 1);
  1557. }
  1558. .meter-number {
  1559. margin-left: auto;
  1560. color: rgba(51, 51, 51, 1);
  1561. font-size: 32rpx;
  1562. /deep/.u-icon--right {
  1563. margin-left: 8rpx;
  1564. }
  1565. }
  1566. }
  1567. .sum2 {
  1568. padding: 0 32rpx;
  1569. margin-top: 8rpx;
  1570. display: flex;
  1571. align-items: center;
  1572. justify-content: space-between;
  1573. .title {
  1574. color: rgba(119, 119, 119, 1);
  1575. }
  1576. .value {
  1577. color: rgba(119, 119, 119, 1);
  1578. }
  1579. }
  1580. // 一级表
  1581. .first-level {
  1582. padding-left: 16rpx;
  1583. margin-top: 20rpx;
  1584. .meter-name {
  1585. font-size: 28rpx
  1586. }
  1587. }
  1588. .first-level-list{
  1589. width: 100%;
  1590. display: flex;
  1591. align-items: center;
  1592. }
  1593. // 二级表
  1594. .second-level {
  1595. padding-left: 32rpx;
  1596. margin-top: 20rpx;
  1597. .meter-name {
  1598. font-size: 24rpx
  1599. }
  1600. }
  1601. .else-switch {
  1602. padding-left: 72rpx;
  1603. .meter-name {
  1604. font-size: 24rpx
  1605. }
  1606. .item {
  1607. margin-top: 24rpx;
  1608. }
  1609. }
  1610. }
  1611. }
  1612. /deep/.u-drawer {
  1613. z-index: 999 !important;
  1614. }
  1615. </style>