statistics.vue 49 KB

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