statistics.vue 45 KB

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