statistics.vue 41 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923
  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: true, // 用于存储间隔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. var getPersonInfoPlus=this.carhelp.getPersonInfoPlus()
  457. if(getPersonInfoPlus){
  458. this.companyType=getPersonInfoPlus.wuye
  459. }
  460. this.getCompanyInfoList();
  461. },
  462. onReady() {
  463. // this.current=1
  464. // this.getHomePageManage()
  465. },
  466. beforeDestroy() {
  467. this.clearTimer(); // 组件销毁前清除定时器
  468. this.intervalReady = false;
  469. console.log("组件销毁前清除定时器")
  470. },
  471. methods: {
  472. switchBtnApiMethod(node,key){
  473. uni.showLoading({
  474. title: "加载中",
  475. mask: true,
  476. })
  477. API.remoteSwitch({
  478. meterId:node.id,
  479. enabled:key
  480. }).then((res) => {
  481. uni.hideLoading();
  482. node.switchStatus=key
  483. }).catch(error => {
  484. uni.showToast({
  485. title: error,
  486. icon: "none"
  487. })
  488. })
  489. },
  490. switchBtnApi(node,key){
  491. uni.showModal({
  492. confirmColor:`${key?'#3CC51F':'red'}`,
  493. confirmText:`${key?'开启':'关闭'}`,
  494. content: `确认是否要"${key?'开启':'关闭'}"${node.name}`,
  495. title: "提示",
  496. success:res=> {
  497. if(res.confirm){
  498. this.switchBtnApiMethod(node,key);
  499. }
  500. }
  501. })
  502. console.log(node,key)
  503. },
  504. getIncomeExpenditure(){
  505. API.incomeExpenditure({
  506. //parentMeterId:item.id,
  507. queryDate:this.queryDate,
  508. companyId: this.companyId,
  509. type: this.list[this.homePageManageType].value
  510. }).then((response) => {
  511. this.incomeExpenditureObj=response.data
  512. this.incomeExpenditureObj.id=1
  513. }).catch(error => {
  514. uni.showToast({
  515. title: error,
  516. icon: "none"
  517. })
  518. })
  519. },
  520. // 设备数据监测
  521. getHomePageManageChildMeter(item,bl) {
  522. if(!bl){
  523. // uni.showLoading({
  524. // title: "加载中",
  525. // mask: true,
  526. // })
  527. }
  528. API.homePageManageChildMeter({
  529. parentMeterId:item.id,
  530. queryDate:this.queryDate,
  531. companyId: this.companyId,
  532. type: this.list[this.homePageManageType].value
  533. }).then((response) => {
  534. // if(!bl){
  535. // uni.hideLoading();
  536. // }
  537. // this.meterList = response.data.meterList;
  538. // if(!this.meterListShow.id){
  539. // this.meterListShow.id=1
  540. // this.recursionList(this.meterList)
  541. // }
  542. var childMeterList=response.data.childMeterList
  543. item.childMeterList=childMeterList
  544. if(!bl){
  545. for(var i in childMeterList){
  546. var obj=childMeterList[i]
  547. this.getHomePageManageChildMeter(obj,true)
  548. }
  549. }
  550. }).catch(error => {
  551. uni.showToast({
  552. title: error,
  553. icon: "none"
  554. })
  555. })
  556. },
  557. recursionList(list){
  558. if(list){
  559. for(var i in list){
  560. var obj=list[i]
  561. this.meterListShow[obj.id]=false
  562. this.recursionList(obj.childMeterList)
  563. }
  564. }
  565. },
  566. ifBtnShow(item){
  567. return this.meterListShow[item.id]
  568. },
  569. showBtn(item){
  570. var key=this.meterListShow[item.id];
  571. this.$set(this.meterListShow,item.id,!key)
  572. console.log("showBtn,",key)
  573. this.$forceUpdate()
  574. },
  575. selector2reset(e) {
  576. console.log(e)
  577. this.tabsFrom.show2Text = '全部时间'
  578. this.tabsFrom.show2Index = '';
  579. if (e.day) {
  580. this.queryDate = parseUnixTime(new Date(), '{y}-{m}-{d}');
  581. this.getHomePageManage();
  582. } else {
  583. this.homePageManageType = this.clickType;
  584. if (this.homePageManageType != 5) {
  585. this.list[5].name = '指定月份';
  586. }
  587. this.getHomePageManage();
  588. }
  589. },
  590. selector2cancel() {
  591. if(this.clickType != -1) {
  592. this.homePageManageType = this.clickType;
  593. }
  594. },
  595. selector2confirm(e) {
  596. this.tabsFrom.show2Text = e.year + "年" + e.month + "月"
  597. this.tabsFrom.show2Index = e.year + "-" + e.month
  598. if (e.day) {
  599. this.tabsFrom.show2Text += e.day + "日"
  600. this.tabsFrom.show2Index += '-' + e.day
  601. this.queryDateMethod(this.tabsFrom.show2Index, true)
  602. } else {
  603. this.queryDateMethod(this.tabsFrom.show2Index, false)
  604. }
  605. },
  606. queryDateMethod(queryTime, day) {
  607. if (day) {
  608. this.queryDate = queryTime;
  609. //this.FormData2.type =day?"9":"10"
  610. //this.value="-1"
  611. //this.getHomePageManage();
  612. } else {
  613. this.queryDate = queryTime + "-01";
  614. this.homePageManageType = "5";
  615. this.list[5].name = queryTime;
  616. this.getHomePageManage();
  617. }
  618. },
  619. clearTimer() {
  620. if (this.intervalId) {
  621. clearInterval(this.intervalId); // 清除定时器
  622. this.intervalId = null; // 重置定时器ID
  623. }
  624. },
  625. startInterval() {
  626. this.clearTimer(); // 组件销毁前清除定时器
  627. this.intervalId = setInterval(() => {
  628. // 每隔5秒运行的代码
  629. // console.log('这段代码每隔5秒运行一次');
  630. this.getHomePageKwh(0, true)
  631. }, 60000);
  632. },
  633. merchantChangeApi() {
  634. this.popShow=false
  635. this.getDeviceStatus()
  636. this.getAbnormalAlarmRecord();
  637. if (this.companyId) {
  638. this.getHomePageManage(true);
  639. }
  640. },
  641. change(index) {
  642. this.current = index;
  643. this.companyId = this.merchantList1[index].id;
  644. this.merchantChangeApi()
  645. },
  646. merchantChange(item, index) {
  647. if(this.current==0){
  648. this.current=1;
  649. }
  650. var m = item;
  651. var n = this.merchantList1[this.current];
  652. this.merchantList1[this.current] = m;
  653. this.merchantList2[index] = n;
  654. //this.$forceUpdate()
  655. this.utabsone=false
  656. this.companyId = item.id;
  657. this.merchantChangeApi()
  658. this.popShow = false;
  659. },
  660. // 单位
  661. getCompanyInfoList() {
  662. // uni.showLoading({
  663. // title: "加载中",
  664. // mask: true,
  665. // })
  666. API.deviceCompanyList().then((response) => {
  667. //uni.hideLoading();
  668. var list = response.data.companyInfoList;
  669. var mList1 = [];
  670. var mList2 = [];
  671. mList1.push({
  672. id: '',
  673. name: '全部'
  674. });
  675. for (var i = 0; i < list.length; i++) {
  676. if (i >= 3) {
  677. mList2.push(list[i]);
  678. } else {
  679. mList1.push(list[i]);
  680. }
  681. }
  682. this.companyList = list;
  683. if(list.length==1){
  684. this.companyId=list[0].id
  685. }else{
  686. this.getHomePageKwh(0);
  687. }
  688. this.merchantList1 = mList1;
  689. this.merchantList2 = mList2;
  690. this.merchantChangeApi()
  691. }).catch(error => {
  692. uni.showToast({
  693. title: error,
  694. icon: "none"
  695. })
  696. })
  697. },
  698. sectionChange(index) {
  699. this.clickType = index;
  700. this.homePageManageType = index;
  701. if (index == 5) {
  702. this.tabsFrom.show2 = true;
  703. this.params.day = false;
  704. } else {
  705. this.list[5].name = '指定月份'
  706. this.getHomePageManage()
  707. }
  708. },
  709. // 设备数据监测
  710. getHomePageManage(bl) {
  711. this.getHomePageManageReady=false
  712. if(bl){
  713. this.getHomePageManageshowLoading=false
  714. }else{
  715. uni.showLoading({
  716. title: "加载中",
  717. mask: true,
  718. })
  719. }
  720. this.incomeExpenditureObj={}
  721. API.homePageManage({
  722. queryDate:this.queryDate,
  723. companyId: this.companyId,
  724. type: this.list[this.homePageManageType].value
  725. }).then((response) => {
  726. this.getHomePageManageReady=true
  727. if(bl){
  728. this.getHomePageManageshowLoading=true
  729. }else{
  730. uni.hideLoading();
  731. }
  732. this.codes =this.carhelp.getPersonInfo().codes;
  733. this.meterList = response.data.meterList;
  734. this.homePageManageObj = response.data;
  735. if(!this.companyType){
  736. this.myBarChart=null;
  737. this.$nextTick(()=>{
  738. this.getBarCharts()
  739. })
  740. this.getIncomeExpenditure();
  741. }
  742. }).catch(error => {
  743. uni.showToast({
  744. title: error,
  745. icon: "none"
  746. })
  747. })
  748. },
  749. // 异常告警记录
  750. getAbnormalAlarmRecord() {
  751. API.alarmRecord({
  752. queryDate: this.queryDateMonth,
  753. configId: '',
  754. pageIndex: 1,
  755. pageSize: 3,
  756. companyId: this.companyId
  757. }).then((response) => {
  758. this.abnormalRecordsList = response.data.data;
  759. }).catch(error => {
  760. uni.showToast({
  761. title: error,
  762. icon: "none"
  763. })
  764. })
  765. },
  766. // 用电量
  767. getHomePageKwh(pl, interval) {
  768. this.pageIndexp = this.pageIndexp + pl;
  769. if (this.pageIndexp > this.totalPagep) {
  770. this.pageIndexp = 1;
  771. }
  772. if (!interval) {
  773. // uni.showLoading({
  774. // title: "加载中",
  775. // mask: true,
  776. // })
  777. this.getHomePageKwhshowLoading=true;
  778. }
  779. API.homePageKwh({
  780. pageIndex: this.pageIndexp,
  781. pageSize: 5,
  782. companyId: this.companyId
  783. }).then((response) => {
  784. if (!interval) {
  785. //uni.hideLoading();
  786. this.getHomePageKwhshowLoading=false;
  787. }
  788. this.kWhList = response.data.data;
  789. this.totalPagep = response.data.totalPage;
  790. if (!interval) {
  791. this.startInterval(); // 组件挂载后开始间隔
  792. }
  793. }).catch(error => {
  794. uni.showToast({
  795. title: error,
  796. icon: "none"
  797. })
  798. })
  799. },
  800. // 累计报警
  801. getDeviceStatus() {
  802. API.deviceStatus({
  803. companyId: this.companyId
  804. }).then((response) => {
  805. this.utabsone=true
  806. this.alarmsForm = response.data;
  807. if (this.alarmsForm.okNum != 0) {
  808. this.alarmsPercent = this.alarmsForm.okNum / (this.alarmsForm.okNum + this.alarmsForm
  809. .errorNum) * 100;
  810. }
  811. }).catch(error => {
  812. uni.showToast({
  813. title: error,
  814. icon: "none"
  815. })
  816. })
  817. },
  818. // 故障类型
  819. getBarCharts() {
  820. if (!this.myBarChart) {
  821. this.myBarChart = echarts.init(document.getElementById('barEcharts'),null,{
  822. width:uni.upx2px(690),height:uni.upx2px(480)
  823. });
  824. }
  825. this.myBarChart.clear()
  826. var thismax=Math.max(this.homePageManageObj.parkKwh,this.homePageManageObj.differenceKwh,this.homePageManageObj.childKwh)
  827. var option = {
  828. polar: {
  829. center:['35%','50%'],
  830. radius:[20, '70%']
  831. },
  832. angleAxis: {
  833. startAngle: 75,
  834. label: {
  835. rotate: 45, // 旋转标签,使得重叠的概率降低
  836. // margin: 5 // 设置标签与轴线之间的距离,增加空间
  837. }
  838. },
  839. legend: {
  840. x:"65%",
  841. y: '0',
  842. data: ['园区电量', '表计电量', '电损量'],
  843. orient :'vertical'
  844. },
  845. radiusAxis: {
  846. type: 'category',
  847. data: ['']
  848. },
  849. tooltip: {},
  850. series: [
  851. {
  852. name:'电损量',
  853. type: 'bar',
  854. data: [
  855. this.homePageManageObj.differenceKwh
  856. ],
  857. coordinateSystem: 'polar',
  858. label: {
  859. show: true,
  860. position: 'middle',
  861. formatter: '{c}度'
  862. }
  863. },
  864. {
  865. name:'表计电量',
  866. type: 'bar',
  867. data: [
  868. this.homePageManageObj.childKwh
  869. ],
  870. coordinateSystem: 'polar',
  871. label: {
  872. show: true,
  873. position: 'middle',
  874. formatter: '{c}度'
  875. }
  876. },
  877. {
  878. name:'园区电量',
  879. type: 'bar',
  880. data: [
  881. this.homePageManageObj.parkKwh,
  882. ],
  883. coordinateSystem: 'polar',
  884. label: {
  885. show: true,
  886. position: 'middle',
  887. formatter: '{c}度'
  888. }
  889. },
  890. ]
  891. };
  892. console.log(option)
  893. this.myBarChart.setOption(option);
  894. },
  895. toDataMonitoringList() {
  896. uni.navigateTo({
  897. url: '/pages/equipmentDataMonitoring/dataMonitoring-list'
  898. })
  899. },
  900. toEquipmentConditionMonitoring() {
  901. uni.navigateTo({
  902. url: '/pages/equipmentConditionMonitoring/equipmentConditionMonitoring?companyId='+this.companyId
  903. })
  904. },
  905. toWorkOrderManagement() {
  906. uni.navigateTo({
  907. url: '/pages/workOrderManagement/workOrderManagement'
  908. })
  909. },
  910. toEquipmentElectricity() {
  911. uni.navigateTo({
  912. url: '/pages/equipmentDataMonitoring/equipmentElectricity'
  913. })
  914. },
  915. toElectronicMonitoring(item) {
  916. uni.navigateTo({
  917. url: '/pages/equipmentDataMonitoring/electronicMonitoring?id=' + item.id + '&name=' + item
  918. .name +
  919. '&companyId=' + item.companyId
  920. })
  921. }
  922. }
  923. }
  924. </script>
  925. <style lang="scss" scoped>
  926. .incomeExpenditureClass{
  927. display: flex;
  928. justify-content: space-evenly;
  929. width: 100%;
  930. padding:32rpx 0;
  931. .income1:last-child{
  932. .income11,.income12{
  933. border-right: 1px solid #c5c3c3;
  934. }
  935. }
  936. .income1{
  937. .income121{
  938. font-size: 24rpx;
  939. color:#c5c3c3;
  940. }
  941. width: 33.33%;
  942. text-align: center;
  943. .income11{
  944. padding:12rpx 0;
  945. background-color: #1677FF ;
  946. color:#fff;
  947. font-size: 36rpx;
  948. border-top: 1px solid #c5c3c3;
  949. border-left: 1px solid #c5c3c3;
  950. }
  951. .income12{
  952. padding:12rpx 0;
  953. border-top: 1px solid #c5c3c3;
  954. border-bottom: 1px solid #c5c3c3;
  955. border-left: 1px solid #c5c3c3;
  956. font-size: 40rpx;
  957. }
  958. }
  959. }
  960. page {
  961. padding-bottom: 200rpx;
  962. }
  963. /deep/.u-drawer-content {
  964. margin-top: 88rpx;
  965. }
  966. .popup-tabs {
  967. background-color: #fff;
  968. display: flex;
  969. align-items: center;
  970. justify-content: space-between;
  971. padding-top: 32rpx;
  972. padding-right: 32rpx;
  973. color: rgba(51, 51, 51, 1);
  974. font-size: 32rpx;
  975. .tabs {
  976. width: 88%;
  977. }
  978. }
  979. /deep/.u-tab-item {
  980. width: 25% !important;
  981. flex: none !important;
  982. }
  983. .tabs-options {
  984. display: flex;
  985. padding: 24rpx 32rpx 0;
  986. flex-wrap: wrap;
  987. .item {
  988. width: 25%;
  989. margin-bottom: 40rpx;
  990. }
  991. }
  992. // 导航栏
  993. .navbar {
  994. background-color: rgba(22, 119, 255, 1);
  995. color: #fff;
  996. line-height: 88rpx;
  997. display: flex;
  998. justify-content: space-between;
  999. align-items: center;
  1000. padding: 0 32rpx;
  1001. color: rgba(255, 255, 255, 1);
  1002. font-size: 36rpx;
  1003. position: fixed;
  1004. left: 0;
  1005. right: 0;
  1006. top: 0;
  1007. z-index: 999999;
  1008. .img {
  1009. width: 48rpx;
  1010. height: 48rpx;
  1011. vertical-align: middle;
  1012. }
  1013. }
  1014. // 标签
  1015. .tabs-box {
  1016. padding: 32rpx 0;
  1017. margin-top: 88rpx;
  1018. padding-right: 32rpx;
  1019. background-color: rgba(22, 119, 255, 1);
  1020. display: flex;
  1021. align-items: center;
  1022. justify-content: space-between;
  1023. .tabs {
  1024. width: 88%;
  1025. }
  1026. }
  1027. .main {
  1028. border-radius: 16px 16px 0px 0px;
  1029. background: linear-gradient(180deg, rgba(242, 244, 246, 1) 61%, rgba(255, 255, 255, 0) 100%);
  1030. margin-top: -24rpx;
  1031. padding: 32rpx;
  1032. .statistics {
  1033. border-radius: 8px;
  1034. background-color: rgba(255, 255, 255, 1);
  1035. box-shadow: 0px 1px 6px 0px rgba(0, 59, 142, 0.05);
  1036. margin-bottom: 24rpx;
  1037. padding: 40rpx;
  1038. .title {
  1039. display: flex;
  1040. align-items: center;
  1041. margin-bottom: 20rpx;
  1042. .img {
  1043. width: 36rpx;
  1044. height: 36rpx;
  1045. vertical-align: middle;
  1046. border-radius: 999px;
  1047. }
  1048. .change {
  1049. display: flex;
  1050. align-items: center;
  1051. .change-img {
  1052. width: 32rpx;
  1053. height: 32rpx;
  1054. vertical-align: middle;
  1055. }
  1056. text {
  1057. margin-left: 8rpx;
  1058. }
  1059. }
  1060. .text {
  1061. color: rgba(16, 16, 16, 1);
  1062. font-size: 36rpx;
  1063. margin-left: 16rpx;
  1064. font-weight: bold;
  1065. }
  1066. .change {
  1067. margin-left: 16rpx;
  1068. font-size: 24rpx;
  1069. color: #838383;
  1070. }
  1071. .check-all {
  1072. margin-left: auto;
  1073. color: rgba(131, 131, 131, 1);
  1074. font-size: 24rpx;
  1075. }
  1076. }
  1077. }
  1078. // 用电量
  1079. .statistics-e {
  1080. padding: 40rpx;
  1081. .electricity {
  1082. background-color: #fff;
  1083. .item:last-of-type {
  1084. border: none;
  1085. padding-bottom: 0;
  1086. }
  1087. .item {
  1088. padding: 16rpx 0;
  1089. display: flex;
  1090. align-items: center;
  1091. justify-content: space-between;
  1092. border-bottom: 1px solid rgba(245, 245, 245, 1);
  1093. .item-content {
  1094. width: 93%;
  1095. }
  1096. .equipment {
  1097. display: flex;
  1098. align-items: center;
  1099. .equipment1 {
  1100. color: rgba(51, 51, 51, 1);
  1101. font-size: 32rpx;
  1102. max-width: 40%;
  1103. font-weight: bold;
  1104. white-space: nowrap;
  1105. overflow: hidden;
  1106. text-overflow: ellipsis;
  1107. }
  1108. .equipment2 {
  1109. color: rgba(119, 119, 119, 1);
  1110. margin-left: 16rpx;
  1111. max-width: 40%;
  1112. white-space: nowrap;
  1113. overflow: hidden;
  1114. text-overflow: ellipsis;
  1115. }
  1116. }
  1117. // 状态
  1118. .state {
  1119. width: 64rpx;
  1120. height: 36rpx;
  1121. line-height: 36rpx;
  1122. border-radius: 8rpx;
  1123. font-size: 22rpx;
  1124. text-align: center;
  1125. border: 1px solid rgba(255, 123, 0, 1);
  1126. color: rgba(255, 123, 0, 1);
  1127. margin-left: auto;
  1128. // .dot {
  1129. // margin-right: 8rpx;
  1130. // width: 16rpx;
  1131. // height: 16rpx;
  1132. // background-color: rgba(255, 123, 0, 1);
  1133. // border-radius: 999px;
  1134. // margin-left: auto;
  1135. // }
  1136. }
  1137. .state2 {
  1138. border: 1px solid rgba(0, 185, 98, 1);
  1139. color: rgba(0, 185, 98, 1);
  1140. }
  1141. .electricity {
  1142. display: flex;
  1143. justify-content: space-between;
  1144. align-items: center;
  1145. margin-top: 8rpx;
  1146. text-align: center;
  1147. .electricity-item {
  1148. display: flex;
  1149. align-items: center;
  1150. width: 33.3%;
  1151. height: 40rpx;
  1152. line-height: 40rpx;
  1153. .number {
  1154. color: rgba(51, 51, 51, 1);
  1155. font-weight: bold;
  1156. font-size: 24rpx;
  1157. margin-left: 8rpx;
  1158. }
  1159. .date {
  1160. color: rgba(119, 119, 119, 1);
  1161. font-size: 24rpx;
  1162. }
  1163. }
  1164. }
  1165. }
  1166. }
  1167. }
  1168. // 统计1
  1169. .statistics-1 {
  1170. background-color: rgba(255, 255, 255, 1);
  1171. width: 100%;
  1172. padding: 24rpx;
  1173. box-shadow: 0px 1px 6px 0px rgba(0, 59, 142, 0.05);
  1174. border-radius: 8px;
  1175. margin-bottom: 24rpx;
  1176. .item {
  1177. margin-top: 32rpx;
  1178. display: flex;
  1179. align-items: center;
  1180. .item-progess {
  1181. display: flex;
  1182. align-items: center;
  1183. .img {
  1184. width: 88rpx;
  1185. height: 88rpx;
  1186. margin-right: 24rpx;
  1187. vertical-align: middle;
  1188. }
  1189. }
  1190. .total {
  1191. margin-left: 24rpx;
  1192. color: rgba(119, 119, 119, 1);
  1193. .total1 {
  1194. display: flex;
  1195. color: rgba(51, 51, 51, 1);
  1196. font-size: 32rpx;
  1197. font-weight: bold;
  1198. .normal {
  1199. margin-bottom: 12rpx;
  1200. }
  1201. }
  1202. .total2 {
  1203. color: rgba(119, 119, 119, 1);
  1204. }
  1205. .abnormal {
  1206. margin-left: 24rpx;
  1207. }
  1208. }
  1209. .total-number {
  1210. color: rgba(255, 123, 0, 1);
  1211. margin: 0 8rpx;
  1212. font-weight: bold;
  1213. }
  1214. }
  1215. }
  1216. // 统计2异常报警记录
  1217. .statistics-2 {
  1218. .abnormal-item:last-of-type {
  1219. border-bottom: none !important;
  1220. padding-bottom: 0;
  1221. }
  1222. .abnormal-item {
  1223. display: flex;
  1224. justify-content: space-between;
  1225. align-items: center;
  1226. padding: 16rpx;
  1227. border-bottom: 1px solid rgba(245, 245, 245, 1);
  1228. .item-title {
  1229. color: rgba(51, 51, 51, 1);
  1230. .img {
  1231. width: 32rpx;
  1232. height: 32rpx;
  1233. margin-right: 8rpx;
  1234. }
  1235. .name {
  1236. color: rgba(51, 51, 51, 1);
  1237. font-weight: bold;
  1238. }
  1239. .date {
  1240. color: rgba(119, 119, 119, 1);
  1241. font-size: 24rpx;
  1242. }
  1243. }
  1244. .item-value {
  1245. text-align: right;
  1246. display: flex;
  1247. align-items: center;
  1248. .more {
  1249. margin-left: 8rpx;
  1250. }
  1251. .value1 {
  1252. font-weight: bold;
  1253. color: rgba(51, 51, 51, 1);
  1254. }
  1255. .value2 {
  1256. color: rgba(119, 119, 119, 1);
  1257. font-size: 24rpx;
  1258. }
  1259. }
  1260. }
  1261. }
  1262. // 统计3设备实时监控
  1263. .statistics-3 {
  1264. .monitoring-item {
  1265. padding: 16rpx 0;
  1266. border-bottom: 1px solid rgba(245, 245, 245, 1);
  1267. .item-title {
  1268. display: flex;
  1269. align-items: center;
  1270. .text1 {
  1271. color: rgba(51, 51, 51, 1);
  1272. }
  1273. }
  1274. .company-name {
  1275. color: rgba(119, 119, 119, 1);
  1276. font-size: 24rpx;
  1277. display: flex;
  1278. align-items: center;
  1279. .state {
  1280. margin-left: 12rpx;
  1281. display: flex;
  1282. align-items: center;
  1283. color: rgba(255, 123, 0, 1);
  1284. text {
  1285. margin-right: 8rpx;
  1286. display: inline-block;
  1287. width: 16rpx;
  1288. height: 16rpx;
  1289. border-radius: 999px;
  1290. }
  1291. .off-line {
  1292. background-color: rgba(255, 123, 0, 1);
  1293. }
  1294. .on-line {
  1295. background-color: rgba(0, 185, 98, 1);
  1296. }
  1297. }
  1298. .state2 {
  1299. color: rgba(0, 185, 98, 1);
  1300. }
  1301. }
  1302. .state {
  1303. margin-left: auto;
  1304. display: flex;
  1305. .state1,
  1306. .state2 {
  1307. display: flex;
  1308. align-items: center;
  1309. margin-left: 24rpx;
  1310. }
  1311. .more {
  1312. margin-left: 8rpx;
  1313. }
  1314. .img {
  1315. width: 32rpx;
  1316. height: 32rpx;
  1317. vertical-align: middle;
  1318. margin-right: 8rpx;
  1319. }
  1320. }
  1321. // 监控信息
  1322. .infos {
  1323. margin-top: 8rpx;
  1324. display: flex;
  1325. align-items: center;
  1326. justify-content: space-between;
  1327. flex-wrap: wrap;
  1328. .infos-item {
  1329. width: 38%;
  1330. display: flex;
  1331. align-items: center;
  1332. color: rgba(51, 51, 51, 1);
  1333. font-size: 22rpx;
  1334. // margin-right: 16rpx;
  1335. margin-bottom: 8rpx;
  1336. .icon {}
  1337. }
  1338. .text {
  1339. font-weight: bold;
  1340. }
  1341. }
  1342. }
  1343. }
  1344. // 设备状态
  1345. .statistics-4 {
  1346. .chat-img {
  1347. width: 100%;
  1348. height: 620rpx;
  1349. }
  1350. }
  1351. // 故障类型
  1352. .statistics-5,
  1353. .statistics-6 {
  1354. .chat-img {
  1355. width: 100%;
  1356. height: 410rpx;
  1357. }
  1358. }
  1359. // 异常设备排名
  1360. .statistics-ranking {
  1361. .total {
  1362. color: rgba(16, 16, 16, 1);
  1363. padding-left: 52rpx;
  1364. text {
  1365. color: #1677FF;
  1366. padding: 0 8rpx;
  1367. }
  1368. }
  1369. .ranking-main {
  1370. margin-top: 40rpx;
  1371. border-radius: 16px;
  1372. background-color: #fff;
  1373. .item:last-of-type {
  1374. margin-bottom: 0;
  1375. }
  1376. .item {
  1377. display: flex;
  1378. align-items: center;
  1379. margin-bottom: 32rpx;
  1380. .ranking {
  1381. color: rgba(16, 16, 16, 1);
  1382. font-weight: bold;
  1383. }
  1384. .icon {
  1385. width: 72rpx;
  1386. height: 72rpx;
  1387. border-radius: 4px;
  1388. background-color: rgba(219, 234, 255, 1);
  1389. display: flex;
  1390. align-items: center;
  1391. justify-content: center;
  1392. margin-left: 24rpx;
  1393. .img {
  1394. width: 48rpx;
  1395. height: 48rpx;
  1396. }
  1397. }
  1398. .name {
  1399. margin-left: 16rpx;
  1400. .name1 {
  1401. color: rgba(51, 51, 51, 1);
  1402. font-weight: bold;
  1403. }
  1404. .name2 {
  1405. color: rgba(119, 119, 119, 1);
  1406. font-size: 24rpx;
  1407. margin-top: 4rpx;
  1408. }
  1409. }
  1410. .time {
  1411. color: rgba(16, 16, 16, 1);
  1412. margin-left: auto;
  1413. font-weight: bold;
  1414. }
  1415. }
  1416. }
  1417. // 查看全部排名
  1418. .check-all {
  1419. text-align: center;
  1420. color: rgba(119, 119, 119, 1);
  1421. font-size: 12px;
  1422. }
  1423. }
  1424. // 能源管理
  1425. .statistics-manage {
  1426. padding: 40rpx 0;
  1427. .title,
  1428. .chart,
  1429. .search,
  1430. .meter-statistic {
  1431. padding: 0 32rpx;
  1432. }
  1433. // 图表
  1434. .chart {
  1435. padding-top: 32rpx;
  1436. border-top: 1px solid rgba(242, 242, 242, 1);
  1437. /deep/.u-subsection {
  1438. padding: 2px;
  1439. }
  1440. /deep/.u-item {
  1441. padding: 0;
  1442. font-size: 24rpx
  1443. }
  1444. .chat-box {
  1445. margin-top: 24rpx;
  1446. width: 100%;
  1447. height: 480rpx;
  1448. img {
  1449. width: 100%;
  1450. height: 100%;
  1451. }
  1452. }
  1453. }
  1454. .search {
  1455. border-top: 1px solid rgba(242, 242, 242, 1);
  1456. border-bottom: 1px solid rgba(242, 242, 242, 1);
  1457. display: flex;
  1458. align-items: center;
  1459. justify-content: space-between;
  1460. padding: 40rpx 32rpx;
  1461. .switch {
  1462. display: flex;
  1463. align-items: center;
  1464. text {
  1465. margin-left: 8rpx;
  1466. color: rgba(51, 51, 51, 1);
  1467. }
  1468. }
  1469. .search-box {
  1470. border-radius: 50px;
  1471. background-color: rgba(242, 244, 246, 1);
  1472. color: rgba(136, 136, 136, 1);
  1473. height: 56rpx;
  1474. line-height: 56rpx;
  1475. padding-left: 16rpx;
  1476. padding-right: 8rpx;
  1477. flex: 1;
  1478. margin-left: 28rpx;
  1479. display: flex;
  1480. align-items: center;
  1481. justify-content: space-between;
  1482. uni-input {
  1483. height: 56rpx;
  1484. line-height: 56rpx !important;
  1485. font-size: 28rpx;
  1486. width: 75%;
  1487. }
  1488. .icon {
  1489. display: flex;
  1490. align-items: center;
  1491. justify-content: center;
  1492. width: 64rpx;
  1493. height: 40rpx;
  1494. border-radius: 50px;
  1495. background-color: rgba(22, 119, 255, 1);
  1496. }
  1497. }
  1498. }
  1499. }
  1500. // 电表统计
  1501. .meter-statistic {
  1502. margin-top: 32rpx;
  1503. .meter-statistic-main{
  1504. display: flex;
  1505. align-items: center;
  1506. }
  1507. .sum {
  1508. .meter-name {
  1509. color: rgba(51, 51, 51, 1);
  1510. font-size: 32rpx;
  1511. margin-left: 8rpx;
  1512. font-weight: bold;
  1513. }
  1514. .icon {
  1515. margin-right: 8rpx;
  1516. img {
  1517. width: 40rpx;
  1518. height: 40rpx;
  1519. vertical-align: middle;
  1520. }
  1521. }
  1522. .meter-state {
  1523. margin-left: 8rpx;
  1524. width: 64rpx;
  1525. height: 36rpx;
  1526. line-height: 36rpx;
  1527. border-radius: 4px;
  1528. background-color: rgba(255, 255, 255, 1);
  1529. color: rgba(0, 185, 98, 1);
  1530. font-size: 22rpx;
  1531. text-align: center;
  1532. border: 1px solid rgba(0, 185, 98, 1);
  1533. }
  1534. .meter-state2 {
  1535. border: 1px solid rgba(255, 123, 0, 1);
  1536. color: rgba(255, 123, 0, 1);
  1537. }
  1538. .meter-number {
  1539. margin-left: auto;
  1540. color: rgba(51, 51, 51, 1);
  1541. font-size: 32rpx;
  1542. /deep/.u-icon--right {
  1543. margin-left: 8rpx;
  1544. }
  1545. }
  1546. }
  1547. .sum2 {
  1548. padding: 0 32rpx;
  1549. margin-top: 8rpx;
  1550. display: flex;
  1551. align-items: center;
  1552. justify-content: space-between;
  1553. .title {
  1554. color: rgba(119, 119, 119, 1);
  1555. }
  1556. .value {
  1557. color: rgba(119, 119, 119, 1);
  1558. }
  1559. }
  1560. // 一级表
  1561. .first-level {
  1562. padding-left: 16rpx;
  1563. margin-top: 20rpx;
  1564. .meter-name {
  1565. font-size: 28rpx
  1566. }
  1567. }
  1568. .first-level-list{
  1569. width: 100%;
  1570. display: flex;
  1571. align-items: center;
  1572. }
  1573. // 二级表
  1574. .second-level {
  1575. padding-left: 32rpx;
  1576. margin-top: 20rpx;
  1577. .meter-name {
  1578. font-size: 24rpx
  1579. }
  1580. }
  1581. .else-switch {
  1582. padding-left: 72rpx;
  1583. .meter-name {
  1584. font-size: 24rpx
  1585. }
  1586. .item {
  1587. margin-top: 24rpx;
  1588. }
  1589. }
  1590. }
  1591. }
  1592. /deep/.u-drawer {
  1593. z-index: 999 !important;
  1594. }
  1595. </style>