index.vue 43 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185
  1. <template>
  2. <view>
  3. <u-navbar v-show="false" title="首页" title-color="#101010"></u-navbar>
  4. <u-picker v-model="body2data.vue.show" :params="body2data.vue.params" :default-time="body2data.query.startTime"
  5. @confirm="body2dataconfirm" mode="time"></u-picker>
  6. <!-- <u-picker v-model="body5data.vue.show" :default-time="body5data.query.queryDate" :params="body5data.vue.params"
  7. @confirm="body5dataconfirm" mode="time"></u-picker> -->
  8. <u-calendar v-model="body5data.vue.show" mode="date" @change="body5dataconfirm"></u-calendar>
  9. <view class="navbar">
  10. 智泊e家 运管端
  11. </view>
  12. <view class="tabs-box">
  13. <u-picker-jp v-model="showselect1" range-key="name" :num="3" @confirm="showselect1confirm"
  14. :range="companyList"></u-picker-jp>
  15. <template v-if="companyListTabs.length>2">
  16. <u-tabs ref="tabs" :list="companyListTabs" bg-color="#1677ff" :current="current1" inactive-color="#fff"
  17. @change="utabsChange1" item-width="180" height="70" gutter="10" active-color="#fff"></u-tabs>
  18. <view class="tabs-box-other" v-if="companyList.length>3" @click="utabsChange1other">
  19. 更多
  20. </view>
  21. </template>
  22. </view>
  23. <view class="main">
  24. <u-picker-jp v-model="showselect2" range-key="name" :num='3' @confirm="showselect2confirm"
  25. :range="parkingList"></u-picker-jp>
  26. <view class="tabs-box2" v-show="parkingListTabs.length>2">
  27. <u-tabs ref="tabs2" gutter="10" :list="parkingListTabs" :current="current2" @change="utabsChange2"
  28. item-width="180" bg-color="#f2f4f6" height="70"></u-tabs>
  29. <view v-if="parkingList.length>3" class="tabs-box-other" @click="utabsChange2other">
  30. 更多
  31. </view>
  32. </view>
  33. <view class="statistics ">
  34. <view class="title">
  35. <view class="icon">
  36. <image class="img" src="@/assets/img/circleCopy1@1x.png" mode=""></image>
  37. </view>
  38. <view class="text">
  39. 综合统计
  40. </view>
  41. </view>
  42. <view class="contentBody">
  43. <jpContent :status="jpContentMap.body1">
  44. <view class="body1pie-table">
  45. <view class="tr">
  46. <view class="td td1">
  47. <view id="body1pie1" class="body1pie">
  48. </view>
  49. </view>
  50. <view class="td td2">
  51. <view class="td td3">
  52. <view class="td td4">空闲<span
  53. class="body1pie-num color53B56B">{{body1data.data.idleNum}}</span>台
  54. </view>
  55. <view class="td td4">占用<span
  56. class="body1pie-num colorAAAAAA">{{body1data.data.useNum}}</span>台
  57. </view>
  58. </view>
  59. <view class="td td3">
  60. <view class="td td4">公共地锁<span
  61. class="body1pie-num colorEF8132">{{body1data.data.publicNum}}</span>台
  62. </view>
  63. <view class="td td4">私家地锁<span
  64. class="body1pie-num colorDC4441">{{body1data.data.privateNum}}</span>台
  65. </view>
  66. </view>
  67. </view>
  68. </view>
  69. <view class="tr">
  70. <view class="td td1">
  71. <view id="body1pie2" class="body1pie">
  72. </view>
  73. </view>
  74. <view class="td td2">
  75. <view class="td td3">
  76. <view class="td td4">正常<span
  77. class="body1pie-num color53B56B">{{body1data.data.normalNum}}</span>台
  78. </view>
  79. <view class="td td4">离线<span
  80. class="body1pie-num colorAAAAAA">{{body1data.data.loseNum}}</span>台
  81. </view>
  82. </view>
  83. <view class="td td3">
  84. <view class="td td4">故障<span
  85. class="body1pie-num colorEF8132">{{body1data.data.errorNum}}</span>台
  86. </view>
  87. <view class="td td4" v-if="0">低电量<span
  88. class="body1pie-num colorDC4441">5</span>台</view>
  89. </view>
  90. </view>
  91. </view>
  92. <view class="tr" v-if="0">
  93. <view class="td td1">
  94. <view id="body1pie3" class="body1pie">
  95. </view>
  96. </view>
  97. <view class="td td2">
  98. <view class="td td3">
  99. <view class="td td4">管理员<span class="body1pie-num color307AF6">5</span>人</view>
  100. <view class="td td4">白名单<span class="body1pie-num color53B56B">5</span>人</view>
  101. </view>
  102. <view class="td td3">
  103. <view class="td td4">游客<span class="body1pie-num colorEF8375">5</span>人次</view>
  104. <view class="td td4"></view>
  105. </view>
  106. </view>
  107. </view>
  108. </view>
  109. </jpContent>
  110. </view>
  111. </view>
  112. <view class="statistics " v-show="1||companyId">
  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. <view>地锁列表</view>
  119. <view class="check-all" @click="gotoDeviceList()">查看全部<u-icon name="arrow-right"></u-icon>
  120. </view>
  121. </view>
  122. </view>
  123. <view class="contentBody">
  124. <jpContent :status="jpContentMap.body7">
  125. <view class="body7main">
  126. <view class="line" v-for="(item,index) in equipmentList"
  127. @click="gotoUrl('/pages/deviceTab/dataLock?id='+item.id)" :key="index">
  128. <view class="item">
  129. <!--
  130. -->
  131. <view class="item-title">
  132. <view class="item-name">
  133. {{item.name}}
  134. </view>
  135. <view class="item-tags">
  136. <view class="tag " :class="'tag'+item.type">
  137. {{item.typeN}}
  138. </view>
  139. <view class="tag" :class="'lockStatus lockStatus'+item.lockStatus">
  140. {{item.lockStatusN}}
  141. </view>
  142. </view>
  143. </view>
  144. <view class="item-body">
  145. <span>编号:{{item.lockNo}}</span> <span v-if="item.batteryLevel" style=" margin-left: 16rpx;">电压:{{item.batteryLevel}}V</span>
  146. </view>
  147. </view>
  148. <view class="goto">
  149. <view :class="'statusN statusN'+item.status">
  150. {{item.status==1?'在线':'离线'}}
  151. </view>
  152. <u-icon name="arrow-right" size="24" color="#BBBBBB"></u-icon>
  153. </view>
  154. </view>
  155. <u-divider border-color="#CFD2D5" @click="gotoDeviceList()"
  156. v-if="equipmentList.length==10">最多显示10条,点击查看更多</u-divider>
  157. </view>
  158. </jpContent>
  159. </view>
  160. </view>
  161. <view class="statistics " v-show="1||companyId">
  162. <view class="title">
  163. <view class="icon">
  164. <image class="img" src="@/assets/img/circleCopy1@1x.png" mode=""></image>
  165. </view>
  166. <view class="text">
  167. <view>停车记录</view>
  168. <view class="check-all" @click="gotoUrl('/pages/record/parkingRecord?compamyId='+companyId+'&parkingId='+parkingId)">查看全部<u-icon name="arrow-right"></u-icon>
  169. </view>
  170. </view>
  171. </view>
  172. <view class="contentBody">
  173. <jpContent :status="jpContentMap.body8">
  174. <view class="body8main">
  175. <view class="line" v-for="(item,index) in parkingRecord"
  176. @click="gotoUrl('/pages/record/parkingInfo?id='+item.id)" :key="index">
  177. <view class="data">
  178. <view class="view3">
  179. <u-icon name="clock"></u-icon>
  180. {{showTime(item.startTime)}}
  181. <template v-if="item.status!=0">
  182. {{item.endTime?'-'+showTime(item.endTime):'-当前'}}
  183. </template>
  184. </view>
  185. <view class="view1">
  186. {{item.parkingName}} {{item.lockName}}
  187. </view>
  188. </view>
  189. <view class="goto " :class="'status'+item.status">
  190. {{item.status==2?getTime(item):''}}
  191. {{item.status==1?'使用中':''}}
  192. {{item.status==0?'启动中':''}}
  193. <u-icon name="arrow-right" size="24" style="margin-left: 8rpx;" color="#BBBBBB"></u-icon>
  194. </view>
  195. </view>
  196. <u-divider border-color="#CFD2D5" @click="gotoUrl('/pages/record/parkingRecord?compamyId='+companyId+'&parkingId='+parkingId)"
  197. v-if="parkingRecord.length==5">最多显示5条,点击查看更多</u-divider>
  198. </view>
  199. </jpContent>
  200. </view>
  201. </view>
  202. <view class="statistics ">
  203. <view class="title">
  204. <view class="icon">
  205. <image class="img" src="@/assets/img/circleCopy1@1x.png" mode=""></image>
  206. </view>
  207. <view class="text">
  208. <view>时空矩阵图</view>
  209. <view class="tag" @click="body5data.vue.show=true">{{body5data.vue.queryN}}<u-icon
  210. name="arrow-down"></u-icon></view>
  211. </view>
  212. </view>
  213. <view class="contentBody">
  214. <jpContent :status="jpContentMap.body5">
  215. <view class="body5main">
  216. <view id="body5echart" class="body5class">
  217. </view>
  218. </view>
  219. </jpContent>
  220. </view>
  221. </view>
  222. <view class="statistics " v-show="companyId">
  223. <view class="title">
  224. <view class="icon">
  225. <image class="img" src="@/assets/img/circleCopy1@1x.png" mode=""></image>
  226. </view>
  227. <view class="text">
  228. <view>地锁异常记录</view>
  229. <view class="check-all" @click="gotoUrl('/pages/myTab/abnormalList?companyId='+companyId)">
  230. 查看全部<u-icon name="arrow-right"></u-icon></view>
  231. </view>
  232. </view>
  233. <view class="contentBody">
  234. <jpContent :status="jpContentMap.body6">
  235. <view class="body6main">
  236. <view class="line" v-for="(item,index) in abnormalRecordsList" :key="index">
  237. <view class="abnormal-item">
  238. <!-- @click="gotoUrl('/pages/abnormal/abnormalAlarmDetails?id='+item.id)"
  239. -->
  240. <view class="item-title">
  241. <view class="name">
  242. <span v-if="item.level==1" class="level level1 ">一级</span>
  243. <span v-if="item.level==2" class="level level2">二级</span>
  244. {{item.content}}
  245. </view>
  246. <view class="date"
  247. style="display: flex; justify-content: space-between;margin-top: 4rpx;">
  248. <view>{{item.title}}</view>
  249. <view>{{item.createTime}}</view>
  250. </view>
  251. </view>
  252. </view>
  253. <u-icon name="arrow-right" size="24" color="#BBBBBB"></u-icon>
  254. </view>
  255. </view>
  256. </jpContent>
  257. </view>
  258. </view>
  259. <view class="statistics ">
  260. <view class="title">
  261. <view class="icon">
  262. <image class="img" src="@/assets/img/circleCopy1@1x.png" mode=""></image>
  263. </view>
  264. <view class="text">
  265. <view>地锁平均占用率(%)</view>
  266. <view class="tag" @click="body2data.vue.show=true">{{body2data.vue.queryN}}<u-icon
  267. name="arrow-down"></u-icon></view>
  268. </view>
  269. </view>
  270. <view class="contentBody">
  271. <jpContent :status="jpContentMap.body2">
  272. <view class="body2lineChart">
  273. <view id="body2line1" class="body2line">
  274. </view>
  275. </view>
  276. </jpContent>
  277. </view>
  278. </view>
  279. <view class="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. <view>高频使用时段分布</view>
  286. </view>
  287. </view>
  288. <view class="contentBody">
  289. <jpContent :status="jpContentMap.body3">
  290. <view class="body3barChart">
  291. <view id="body3bar1" class="body3bar">
  292. </view>
  293. </view>
  294. </jpContent>
  295. </view>
  296. </view>
  297. <view class="statistics ">
  298. <view class="title">
  299. <view class="icon">
  300. <image class="img" src="@/assets/img/circleCopy1@1x.png" mode=""></image>
  301. </view>
  302. <view class="text">
  303. <view>用户停留时长分群特征</view>
  304. </view>
  305. </view>
  306. <view class="contentBody">
  307. <jpContent :status="jpContentMap.body4">
  308. <view class="body4pieChart">
  309. <view id="body4pie1" class="body4pie">
  310. </view>
  311. </view>
  312. </jpContent>
  313. </view>
  314. </view>
  315. <u-divider border-color="#CFD2D5">已经到底了</u-divider>
  316. </view>
  317. <tabbar :current="0"></tabbar>
  318. </view>
  319. </template>
  320. <script>
  321. import Tabbar from '@/components/Tabbar.vue'
  322. import jpContent from '@/components/JPcontent.vue'
  323. import * as echarts from 'echarts';
  324. import * as API from '@/apis/pagejs/index.js'
  325. import {
  326. parseUnixTime,
  327. beforeTimeStamp,
  328. newDate
  329. } from '@/apis/utils'
  330. export default {
  331. components: {
  332. Tabbar,
  333. jpContent
  334. },
  335. data() {
  336. return {
  337. current1: 0,
  338. showselect1: false,
  339. current2: 0,
  340. showselect2: false,
  341. isReady: false,
  342. companyList: [],
  343. parkingList: [],
  344. //companyListIndex:0,
  345. companyId: "",
  346. parkingId: "",
  347. echartsList: {},
  348. parkingRecord:[],
  349. equipmentList: [],
  350. abnormalRecordsList: [{
  351. level: 1,
  352. content: "1111111",
  353. title: "11",
  354. createTime: "123:123"
  355. },
  356. {
  357. level: 2,
  358. content: "1111111",
  359. title: "11",
  360. createTime: "123:123"
  361. }
  362. ],
  363. body2data: {
  364. query: {},
  365. vue: {
  366. queryN: "",
  367. show: false,
  368. params: {
  369. year: true,
  370. month: true,
  371. day: false,
  372. hour: false,
  373. minute: false,
  374. second: false
  375. }
  376. },
  377. data: {}
  378. },
  379. body1data: {
  380. query: {},
  381. data: {},
  382. data1: {}
  383. },
  384. body4data: {
  385. query: {},
  386. data: {}
  387. },
  388. body3data: {
  389. query: {},
  390. data: {}
  391. },
  392. body5data: {
  393. query: {},
  394. data: {},
  395. vue: {
  396. queryN: "",
  397. show: false,
  398. params: {
  399. year: true,
  400. month: true,
  401. day: true,
  402. hour: false,
  403. minute: false,
  404. second: false
  405. }
  406. },
  407. },
  408. jpContentMap: {
  409. body1: 0,
  410. body2: 0,
  411. body3: 0,
  412. body4: 0,
  413. body5: 0,
  414. body6: 1,
  415. body7: 0,
  416. body8: 0,
  417. body9: 0,
  418. body10: 0,
  419. }
  420. }
  421. },
  422. onLoad() {
  423. },
  424. onReady() {
  425. this.getfindByOpenId();
  426. },
  427. computed: {
  428. companyListTabs() {
  429. var sz = []
  430. if (this.companyList.length > 3) {
  431. sz = [{
  432. id: "",
  433. name: '全部'
  434. }]
  435. sz.push(this.companyList[0])
  436. sz.push(this.companyList[1])
  437. } else {
  438. sz = [{
  439. id: "",
  440. name: '全部'
  441. },
  442. ...this.companyList
  443. ]
  444. }
  445. return sz
  446. },
  447. parkingListTabs() {
  448. var sz = []
  449. if (this.parkingList.length > 3) {
  450. sz = [{
  451. id: "",
  452. name: '综合查询'
  453. }]
  454. sz.push(this.parkingList[0])
  455. sz.push(this.parkingList[1])
  456. } else {
  457. sz = [{
  458. id: "",
  459. name: '综合查询'
  460. },
  461. ...this.parkingList
  462. ]
  463. }
  464. return sz
  465. },
  466. },
  467. methods: {
  468. showTime(time){
  469. if(time){
  470. return time.substr(5).replace('-','.')
  471. }else{
  472. return ''
  473. }
  474. },
  475. getTime(item){
  476. if(item.startTime&&item.endTime){
  477. var stime=newDate(item.startTime)
  478. var etime=newDate(item.endTime)
  479. //etime=new Date()
  480. var k=(etime.getTime()-stime.getTime())/1000/60
  481. var H=k/60
  482. var fen=k%(60)
  483. var str="";
  484. if(k>60){
  485. str+=parseInt(H)+'小时'
  486. }
  487. if(fen==0&&str!=''){
  488. }else{
  489. str+=parseInt(fen)+'分钟'
  490. }
  491. return str
  492. }else{
  493. return '已完成'
  494. }
  495. },
  496. gotoDeviceList() {
  497. if (this.parkingId) {
  498. this.gotoUrl('/pages/deviceTab/deviceList?parkingId=' + this.parkingId)
  499. } else {
  500. uni.switchTab({
  501. url: '/pages/deviceTab/index'
  502. })
  503. }
  504. },
  505. getfloorStatus() {
  506. this.jpContentMap.body1 = 0
  507. API.floorStatus({
  508. companyId: this.companyId,
  509. parkingId: this.parkingId
  510. }).then((response) => {
  511. this.body1data.data = response.data
  512. uni.hideLoading();
  513. this.jpContentMap.body1 = 2
  514. this.getbody1pie1()
  515. this.getbody1pie2()
  516. this.getbody1pie3()
  517. }).catch(error => {
  518. uni.showToast({
  519. title: error,
  520. icon: "none"
  521. })
  522. })
  523. },
  524. getParkingRecordList() {
  525. this.jpContentMap.body8 = 0
  526. API.parkingRecordList({
  527. companyId: this.companyId,
  528. parkingId: this.parkingId,
  529. pageSize: 5
  530. }).then((response) => {
  531. uni.hideLoading();
  532. if (response.data.totalPage) {
  533. this.jpContentMap.body8 = 2
  534. this.parkingRecord = response.data.data
  535. } else {
  536. this.jpContentMap.body8 = 1
  537. }
  538. }).catch(error => {
  539. uni.showToast({
  540. title: error,
  541. icon: "none"
  542. })
  543. })
  544. },
  545. getfloorlockList() {
  546. this.jpContentMap.body7 = 0
  547. API.floorlockList({
  548. companyId: this.companyId,
  549. parkingId: this.parkingId,
  550. pageSize: 10
  551. }).then((response) => {
  552. uni.hideLoading();
  553. if (response.data.totalPage) {
  554. this.jpContentMap.body7 = 2
  555. this.equipmentList = response.data.data
  556. } else {
  557. this.jpContentMap.body7 = 1
  558. }
  559. }).catch(error => {
  560. uni.showToast({
  561. title: error,
  562. icon: "none"
  563. })
  564. })
  565. },
  566. getApi1() {
  567. if (this.companyId == "") {
  568. this.getApi2()
  569. } else {
  570. this.parkingInfoList()
  571. }
  572. },
  573. getApi2() {
  574. this.getfloorStatus()
  575. this.getfloorlockList()
  576. this.occupancyByTime(1);
  577. this.occupancyByTimeBar(1);
  578. this.occupancyByDay(1);
  579. this.durationDistribution();
  580. this.getParkingRecordList()
  581. if (this.parkingId == "") {
  582. } else {
  583. }
  584. },
  585. change1companyList(i) {
  586. //this.companyListIndex=i
  587. var companyId = ""
  588. if (i == -1) {
  589. if (this.companyId == companyId) {
  590. } else {
  591. this.companyId = ""
  592. this.parkingList = [];
  593. this.getApi1()
  594. }
  595. } else {
  596. var item = this.companyList[i]
  597. companyId = item.id
  598. if (this.companyId == companyId) {
  599. } else {
  600. this.companyId = companyId
  601. this.parkingId = "";
  602. this.current2 = 0;
  603. this.$refs.tabs2.showBar = true
  604. this.getApi1()
  605. }
  606. }
  607. },
  608. change2parkingList(i) {
  609. var parkingId = ""
  610. if (i == -1) {
  611. if (this.parkingId == parkingId) {
  612. } else {
  613. this.parkingId = "";
  614. this.getApi2()
  615. }
  616. } else {
  617. var item = this.parkingList[i]
  618. parkingId = item.id
  619. if (this.parkingId == parkingId) {
  620. } else {
  621. this.parkingId = parkingId;
  622. this.getApi2()
  623. }
  624. }
  625. },
  626. showselect2confirm(e) {
  627. this.change2parkingList(e[0])
  628. },
  629. utabsChange2other() {
  630. this.$refs.tabs2.showBar = false
  631. this.current2 = -1;
  632. this.showselect2 = true;
  633. },
  634. utabsChange2(index) {
  635. this.current2 = index;
  636. this.change2parkingList(index - 1)
  637. this.$refs.tabs2.showBar = true
  638. },
  639. showselect1confirm(e) {
  640. this.change1companyList(e[0])
  641. },
  642. utabsChange1other() {
  643. this.$refs.tabs.showBar = false
  644. this.current1 = -1;
  645. this.showselect1 = true;
  646. },
  647. utabsChange1(index) {
  648. this.current1 = index;
  649. this.change1companyList(index - 1)
  650. this.$refs.tabs.showBar = true
  651. },
  652. parkingInfoList() {
  653. uni.showLoading({
  654. title: "加载中",
  655. mask: true,
  656. })
  657. this.parkingList = [];
  658. API.parkingList({
  659. companyId: this.companyId,
  660. pageSize: 999
  661. }).then((response) => {
  662. uni.hideLoading();
  663. var parkingInfoList = response.data.parkingInfoList
  664. this.parkingList = [
  665. ...parkingInfoList,
  666. ];
  667. if (this.parkingList.length == 1) {
  668. this.change2parkingList(0)
  669. } else {
  670. this.change2parkingList(-1)
  671. this.getApi2()
  672. }
  673. this.getfloorlockList()
  674. }).catch(error => {
  675. uni.showToast({
  676. title: error,
  677. icon: "none"
  678. })
  679. })
  680. },
  681. companyInfoList() {
  682. uni.showLoading({
  683. title: "加载中",
  684. mask: true,
  685. })
  686. this.companyList = [];
  687. API.companyInfoList({
  688. }).then((response) => {
  689. uni.hideLoading();
  690. var companyInfoList = response.data.companyInfoList
  691. this.companyList = [
  692. ...companyInfoList,
  693. ];
  694. if (this.companyList.length == 1) {
  695. this.change1companyList(0)
  696. } else {
  697. this.change1companyList(-1)
  698. this.getApi1()
  699. }
  700. }).catch(error => {
  701. uni.showToast({
  702. title: error,
  703. icon: "none"
  704. })
  705. })
  706. },
  707. init() {
  708. this.companyInfoList()
  709. //this.occupancyByTime();
  710. //this.getbody3()
  711. //this.getbody4()
  712. //this.getbody5()
  713. },
  714. body2dataconfirm(e) {
  715. var date = new Date(e.year + "-" + e.month + "-1");
  716. this.body2data.vue.queryN = date.getFullYear() + "年" + (date.getMonth() + 1) + '月';
  717. this.body2data.query.startTime = date.getFullYear() + "-" + (date.getMonth() + 1) + "-1"
  718. var endOfMonth = new Date(date.getFullYear(), date.getMonth() + 1, 0)
  719. this.body2data.query.endTime = parseUnixTime(endOfMonth, '{y}-{m}-{d}')
  720. this.occupancyByTime()
  721. },
  722. body5dataconfirm(e) {
  723. console.log(e)
  724. var date = new Date(e.year + "-" + e.month + "-" + e.day);
  725. this.body5data.query.queryDate = parseUnixTime(date, '{y}-{m}-{d}')
  726. this.body5data.vue.queryN = parseUnixTime(date, '{y}年{m}月{d}日');
  727. this.occupancyByDay()
  728. },
  729. occupancyByTimeBar(init) {
  730. if (init) {
  731. var date = new Date();
  732. //test
  733. //this.body3data.query.startTime = date.getFullYear() + "-" + (date.getMonth() + 1) + "-1"
  734. var endOfMonth = new Date(date.getFullYear(), date.getMonth() + 1, 0)
  735. //this.body3data.query.endTime = parseUnixTime(endOfMonth, '{y}-{m}-{d}')
  736. }
  737. this.jpContentMap.body3 = 0
  738. this.body3data.query.companyId = this.companyId
  739. this.body3data.query.parkingId = this.parkingId
  740. API.occupancyByTimeBar(
  741. this.body3data.query
  742. ).then((response) => {
  743. this.body3data.data = [
  744. ...response.data.locksTimeList,
  745. // ...response.data.locksTimeList,
  746. ];
  747. if (this.body3data.data.length == 0) {
  748. this.jpContentMap.body3 = 1
  749. } else {
  750. this.jpContentMap.body3 = 2
  751. this.getbody3()
  752. }
  753. }).catch(error => {
  754. uni.showToast({
  755. title: error,
  756. icon: "none"
  757. })
  758. })
  759. },
  760. durationDistribution() {
  761. this.jpContentMap.body4 = 0
  762. var date = new Date();
  763. //test
  764. //this.body4data.query.startTime = date.getFullYear() + "-" + (date.getMonth() + 1) + "-1"
  765. var endOfMonth = new Date(date.getFullYear(), date.getMonth() + 1, 0)
  766. // this.body4data.query.endTime = parseUnixTime(endOfMonth, '{y}-{m}-{d}')
  767. this.body4data.query.companyId = this.companyId
  768. this.body4data.query.parkingId = this.parkingId
  769. API.durationDistribution(
  770. this.body4data.query
  771. ).then((response) => {
  772. this.body4data.data = response.data.distribution;
  773. if (this.body4data.data.length == 0) {
  774. this.jpContentMap.body4 = 1
  775. } else {
  776. this.jpContentMap.body4 = 2
  777. //this.getbody3()
  778. this.getbody4()
  779. }
  780. }).catch(error => {
  781. uni.showToast({
  782. title: error,
  783. icon: "none"
  784. })
  785. })
  786. },
  787. occupancyByDay(init) {
  788. if (init) {
  789. var date = new Date();
  790. this.body5data.query.queryDate = parseUnixTime(date, '{y}-{m}-{d}')
  791. this.body5data.vue.queryN = parseUnixTime(date, '{y}年{m}月{d}日');
  792. }
  793. this.jpContentMap.body5 = 0
  794. this.body5data.query.companyId = this.companyId
  795. this.body5data.query.parkingId = this.parkingId
  796. API.occupancyByDay(
  797. this.body5data.query
  798. ).then((response) => {
  799. this.body5data.data = [
  800. ...response.data.locksTimeList,
  801. ];
  802. if (this.body5data.data.length == 0) {
  803. this.jpContentMap.body5 = 1
  804. } else {
  805. this.jpContentMap.body5 = 2
  806. //this.getbody3()
  807. this.getbody5()
  808. }
  809. }).catch(error => {
  810. uni.showToast({
  811. title: error,
  812. icon: "none"
  813. })
  814. })
  815. },
  816. occupancyByTime(init) {
  817. if (init) {
  818. var date = new Date();
  819. this.body2data.vue.queryN = date.getFullYear() + "年" + (date.getMonth() + 1) + '月';
  820. this.body2data.query.startTime = date.getFullYear() + "-" + (date.getMonth() + 1) + "-1"
  821. var endOfMonth = new Date(date.getFullYear(), date.getMonth() + 1, 0)
  822. this.body2data.query.endTime = parseUnixTime(endOfMonth, '{y}-{m}-{d}')
  823. }
  824. this.jpContentMap.body2 = 0
  825. this.body2data.query.companyId = this.companyId
  826. this.body2data.query.parkingId = this.parkingId
  827. API.occupancyByTime(
  828. this.body2data.query
  829. ).then((response) => {
  830. this.body2data.data = [
  831. ...response.data.locksTimeList,
  832. // ...response.data.locksTimeList,
  833. ];
  834. if (this.body2data.data.length == 0) {
  835. this.jpContentMap.body2 = 1
  836. } else {
  837. this.jpContentMap.body2 = 2
  838. this.getbody2()
  839. }
  840. }).catch(error => {
  841. uni.showToast({
  842. title: error,
  843. icon: "none"
  844. })
  845. })
  846. },
  847. getbody5() {
  848. // 颜色映射
  849. var colorMap = [
  850. '#FFA500',
  851. '#00FF00',
  852. '#F44336',
  853. '#E91E63',
  854. '#9C27B0',
  855. '#673AB7',
  856. '#3F51B5',
  857. '#2196F3',
  858. '#03A9F4',
  859. '#00BCD4',
  860. '#009688',
  861. '#CDDC39',
  862. '#FFEB3B',
  863. '#FFC107',
  864. '#FF9800',
  865. '#FF5722',
  866. '#795548',
  867. '#607D8B'
  868. ];
  869. var key = "body5echart"
  870. var dataApi = this.body5data.data;
  871. var head = 40 * (parseInt(dataApi.length / 4)) + 20
  872. var body = 20 * (parseInt(dataApi.length))
  873. var myChart = this.echartsList[key];
  874. if (!myChart) {
  875. myChart = echarts.init(document.getElementById(key), null, {
  876. width: uni.upx2px(300 * 2),
  877. height: uni.upx2px((170 + head) * 2 + body)
  878. })
  879. }
  880. myChart.clear()
  881. var dataName = []
  882. var dataTime = []
  883. var series = []
  884. var i = 0;
  885. var isPush=false
  886. dataApi.forEach(item => {
  887. dataName.push(item.lockName)
  888. var itemList = []
  889. var j = 0
  890. item.timeUseList.forEach(item2 => {
  891. Object.keys(item2).forEach(key1 => {
  892. console.log(item2[key1])
  893. if (item2[key1]) {
  894. var ob = [j, i, i]
  895. itemList.push(ob)
  896. isPush=true
  897. } else {
  898. // var ob=[j,i,i]
  899. // itemList.push(ob)
  900. }
  901. });
  902. j += 1;
  903. })
  904. var obj = {
  905. tooltip: {
  906. trigger: 'item',
  907. axisPointer: {
  908. type: 'shadow'
  909. },
  910. formatter: function(params) {
  911. console.log(params)
  912. var result = params.marker+params.name +'点<br/>' + params.seriesName + ' 占用 ';
  913. return result;
  914. }
  915. },
  916. //silent: true,
  917. type: 'custom',
  918. "name": item.lockName,
  919. // tooltip: {
  920. // //trigger: 'none',
  921. // show: false
  922. // },
  923. itemStyle: {
  924. color: colorMap[i % colorMap.length]
  925. },
  926. renderItem: function(params, api) {
  927. var xIndex = api.value(0); // x轴索引
  928. var yIndex = api.value(1); // y轴索引
  929. var value = api.value(2); // 值
  930. // 获取颜色
  931. var color = colorMap[value % colorMap.length] || '#ffffff';
  932. // 计算矩形的位置和大小
  933. var x = api.coord([xIndex, yIndex])[0];
  934. var y = api.coord([xIndex, yIndex])[1];
  935. var width = api.size([1, 0])[0];
  936. var height = api.size([0, 1])[1];
  937. return {
  938. type: 'rect',
  939. shape: {
  940. x: x - uni.upx2px(25),
  941. y: y - uni.upx2px(20),
  942. width: width,
  943. height: 20,
  944. },
  945. style: {
  946. fill: color
  947. }
  948. };
  949. },
  950. }
  951. obj.data = itemList
  952. series.push(obj)
  953. i += 1;
  954. })
  955. dataApi[0].timeUseList.forEach(item => {
  956. Object.keys(item).forEach(key1 => {
  957. dataTime.push(key1)
  958. });
  959. })
  960. var option = {
  961. tooltip: {
  962. trigger: 'axis',
  963. axisPointer: {
  964. type: 'shadow'
  965. }
  966. },
  967. grid: {
  968. top: 30 + head,
  969. left: -10+(isPush?0:20),
  970. right: 0,
  971. bottom: 0,
  972. containLabel: true
  973. },
  974. legend: {
  975. data: dataName
  976. },
  977. xAxis: {
  978. type: 'category',
  979. data: dataTime
  980. },
  981. yAxis: {
  982. type: 'category',
  983. },
  984. series: series
  985. };
  986. myChart.setOption(option);
  987. this.echartsList[key] = myChart;
  988. },
  989. getbody4() {
  990. var key = "body4pie1"
  991. var myChart = this.echartsList[key];
  992. if (!myChart) {
  993. myChart = echarts.init(document.getElementById(key), null, {
  994. width: uni.upx2px(300 * 2),
  995. height: uni.upx2px(170 * 2)
  996. })
  997. }
  998. myChart.clear()
  999. var dataApi = this.body4data.data;
  1000. var data = []
  1001. var num = 0
  1002. var sum = 0
  1003. Object.keys(dataApi).forEach(key1 => {
  1004. num += dataApi[key1]
  1005. });
  1006. var i = 0
  1007. Object.keys(dataApi).forEach(key1 => {
  1008. var value = dataApi[key1]
  1009. if(value!=0){
  1010. var obj = {
  1011. value: value,
  1012. name: key1
  1013. }
  1014. if (num != 0) {
  1015. var valueInt = parseInt(value / num * 100)
  1016. if (valueInt == 0 && value != 0) {
  1017. valueInt = 1
  1018. }
  1019. sum += valueInt;
  1020. if (i == Object.keys(dataApi).length - 1) {
  1021. if (sum != 100) {
  1022. valueInt += (100 - sum)
  1023. }
  1024. }
  1025. obj.name += '\n' + (valueInt) + '%'
  1026. }
  1027. data.push(obj)
  1028. }
  1029. i++;
  1030. });
  1031. var option = {
  1032. grid: {
  1033. top: 20,
  1034. left: 0,
  1035. right: 0,
  1036. bottom: 0,
  1037. containLabel: true
  1038. },
  1039. series: [{
  1040. type: 'pie',
  1041. radius: ['80%', '50%'],
  1042. radius: [45, 60],
  1043. data: data
  1044. }]
  1045. };
  1046. console.log(option)
  1047. myChart.setOption(option);
  1048. this.echartsList[key] = myChart;
  1049. },
  1050. getbody3() {
  1051. var key = "body3bar1"
  1052. var myChart = this.echartsList[key];
  1053. if (!myChart) {
  1054. myChart = echarts.init(document.getElementById(key), null, {
  1055. width: uni.upx2px(300 * 2),
  1056. height: uni.upx2px(170 * 2)
  1057. })
  1058. }
  1059. var dataApi = this.body3data.data;
  1060. myChart.clear()
  1061. var data1 = []
  1062. var data2 = [] //useDays
  1063. var i = 0
  1064. dataApi[0].timeUseList.forEach(item => {
  1065. Object.keys(item).forEach(key1 => {
  1066. data1.push(key1 + '点')
  1067. var num = 0
  1068. dataApi.forEach(item2 => {
  1069. num += item2.timeUseList[i][key1].useDays
  1070. })
  1071. data2.push(num)
  1072. });
  1073. i += 1
  1074. })
  1075. var axisLabel = {
  1076. rotate: 40,
  1077. interval: 0,
  1078. textStyle: {
  1079. color: "#333"
  1080. }
  1081. }
  1082. if (data1.length < 7) {
  1083. axisLabel = {
  1084. interval: 0,
  1085. textStyle: {
  1086. color: "#333"
  1087. },
  1088. }
  1089. } else {
  1090. axisLabel.interval = 0;
  1091. }
  1092. var option = {
  1093. xAxis: {
  1094. type: 'category',
  1095. data: data1,
  1096. axisLabel: axisLabel,
  1097. },
  1098. tooltip: {
  1099. trigger: 'axis',
  1100. axisPointer: {
  1101. type: 'shadow'
  1102. },
  1103. formatter: function(params) {
  1104. var result = params[0].name + '<br/>';
  1105. for (var i = 0; i < params.length; i++) {
  1106. result += params[i].marker+ ' ' + params[i].value + '次<br/>';
  1107. }
  1108. return result;
  1109. }
  1110. },
  1111. yAxis: {
  1112. type: 'value'
  1113. },
  1114. grid: {
  1115. top: 20,
  1116. left: 0,
  1117. right: 0,
  1118. bottom: 0,
  1119. containLabel: true
  1120. },
  1121. series: [{
  1122. itemStyle: {
  1123. color: "#5A88E5"
  1124. },
  1125. data: data2,
  1126. type: 'bar'
  1127. }]
  1128. };
  1129. myChart.setOption(option);
  1130. this.echartsList[key] = myChart;
  1131. },
  1132. getbody2() {
  1133. var key = "body2line1"
  1134. var myChart = this.echartsList[key];
  1135. var dataApi = this.body2data.data;
  1136. var head = 20 * (parseInt(dataApi.length / 4)) + 20
  1137. if (!myChart) {
  1138. myChart = echarts.init(document.getElementById(key), null, {
  1139. width: uni.upx2px(300 * 2),
  1140. height: uni.upx2px((170 + head) * 2)
  1141. })
  1142. }
  1143. myChart.clear()
  1144. var data1 = []
  1145. var series = [];
  1146. dataApi.forEach(item => {
  1147. var obj = {
  1148. name: item.lockName,
  1149. //areaStyle: {},
  1150. // itemStyle: {
  1151. // color: "#BBD4FB"
  1152. // },
  1153. label: {
  1154. show: true,
  1155. position: 'top',
  1156. // color: "#307AF6"
  1157. },
  1158. data: [],
  1159. type: 'line'
  1160. }
  1161. if (dataApi.length == 1) {
  1162. obj.label.color = "#307AF6"
  1163. obj.areaStyle = {}
  1164. obj.itemStyle = {
  1165. color: "#BBD4FB"
  1166. }
  1167. }
  1168. item.timeUseList.forEach(item2 => {
  1169. Object.keys(item2).forEach(key1 => {
  1170. obj.data.push(item2[key1].useRate)
  1171. });
  1172. })
  1173. series.push(obj)
  1174. })
  1175. dataApi[0].timeUseList.forEach(item => {
  1176. Object.keys(item).forEach(key1 => {
  1177. data1.push(key1)
  1178. });
  1179. })
  1180. var axisLabel = {
  1181. rotate: 40,
  1182. interval: 0,
  1183. textStyle: {
  1184. color: "#333"
  1185. }
  1186. }
  1187. if (data1.length < 7) {
  1188. axisLabel = {
  1189. interval: 0,
  1190. textStyle: {
  1191. color: "#333"
  1192. },
  1193. }
  1194. } else {
  1195. axisLabel.interval = 0;
  1196. }
  1197. var option = {
  1198. legend: {},
  1199. xAxis: {
  1200. type: 'category',
  1201. data: data1,
  1202. axisLabel: axisLabel,
  1203. },
  1204. tooltip: {
  1205. trigger: 'axis',
  1206. axisPointer: {
  1207. type: 'shadow'
  1208. },
  1209. formatter: function(params) {
  1210. var result = params[0].name + '点<br/>';
  1211. for (var i = 0; i < params.length; i++) {
  1212. result += params[i].marker+params[i].seriesName + ': ' + params[i].value + '%<br/>';
  1213. }
  1214. return result;
  1215. }
  1216. },
  1217. yAxis: {
  1218. type: 'value'
  1219. },
  1220. grid: {
  1221. top: (20 + head),
  1222. left: 0,
  1223. right: 0,
  1224. bottom: 0,
  1225. containLabel: true
  1226. },
  1227. series: series
  1228. };
  1229. myChart.setOption(option);
  1230. this.echartsList[key] = myChart;
  1231. },
  1232. getbody1pie1() {
  1233. var img = require("@/assets/img/index/pie1-1.svg")
  1234. var key = "body1pie1"
  1235. var myChart = this.echartsList[key];
  1236. if (!myChart) {
  1237. myChart = echarts.init(document.getElementById(key), null, {
  1238. width: uni.upx2px(88),
  1239. height: uni.upx2px(88)
  1240. })
  1241. }
  1242. myChart.clear()
  1243. var option = {
  1244. series: [{
  1245. silent: true,
  1246. type: 'pie',
  1247. radius: ['70%', '100%'],
  1248. label: {
  1249. show: false,
  1250. },
  1251. data: [{
  1252. value: this.body1data.data.useNum,
  1253. itemStyle: {
  1254. color: '#AAAAAA'
  1255. }
  1256. },
  1257. {
  1258. value: this.body1data.data.idleNum,
  1259. itemStyle: {
  1260. color: '#53B56B'
  1261. }
  1262. }
  1263. ]
  1264. }],
  1265. grid: {
  1266. top: 0,
  1267. left: 0,
  1268. right: 0,
  1269. bottom: 0,
  1270. containLabel: true
  1271. },
  1272. graphic: [{
  1273. type: 'image',
  1274. id: 'logo',
  1275. left: 'center',
  1276. top: 'center',
  1277. style: {
  1278. image: img, // 图片路径
  1279. width: uni.upx2px(40),
  1280. height: uni.upx2px(40)
  1281. }
  1282. }]
  1283. }
  1284. myChart.setOption(option);
  1285. this.echartsList[key] = myChart;
  1286. },
  1287. getbody1pie2() {
  1288. var img = require("@/assets/img/index/pie1-2.svg")
  1289. var key = "body1pie2"
  1290. var myChart = this.echartsList[key];
  1291. if (!myChart) {
  1292. myChart = echarts.init(document.getElementById(key), null, {
  1293. width: uni.upx2px(88),
  1294. height: uni.upx2px(88)
  1295. })
  1296. }
  1297. myChart.clear()
  1298. var option = {
  1299. series: [{
  1300. silent: true,
  1301. type: 'pie',
  1302. radius: ['70%', '100%'],
  1303. label: {
  1304. show: false,
  1305. },
  1306. data: [{
  1307. value: this.body1data.data.loseNum,
  1308. itemStyle: {
  1309. color: '#AAAAAA'
  1310. }
  1311. },
  1312. {
  1313. value: this.body1data.data.normalNum,
  1314. itemStyle: {
  1315. color: '#53B56B'
  1316. }
  1317. },
  1318. {
  1319. value: this.body1data.data.errorNum,
  1320. itemStyle: {
  1321. color: '#EF8132'
  1322. }
  1323. }
  1324. //, {
  1325. // value: 735,
  1326. // itemStyle: {
  1327. // color: '#DC4441'
  1328. // }
  1329. // }
  1330. ]
  1331. }],
  1332. grid: {
  1333. top: 0,
  1334. left: 0,
  1335. right: 0,
  1336. bottom: 0,
  1337. containLabel: true
  1338. },
  1339. graphic: [{
  1340. type: 'image',
  1341. id: 'logo',
  1342. left: 'center',
  1343. top: 'center',
  1344. style: {
  1345. image: img, // 图片路径
  1346. width: uni.upx2px(40),
  1347. height: uni.upx2px(40)
  1348. }
  1349. }]
  1350. }
  1351. myChart.setOption(option);
  1352. this.echartsList[key] = myChart;
  1353. },
  1354. getbody1pie3() {
  1355. var img = require("@/assets/img/index/pie1-3.svg")
  1356. var key = "body1pie3"
  1357. var myChart = this.echartsList[key];
  1358. if (!myChart) {
  1359. myChart = echarts.init(document.getElementById(key), null, {
  1360. width: uni.upx2px(88),
  1361. height: uni.upx2px(88)
  1362. })
  1363. }
  1364. myChart.clear()
  1365. var option = {
  1366. series: [{
  1367. type: 'pie',
  1368. silent: true, // 禁用交互效果
  1369. radius: ['70%', '100%'],
  1370. label: {
  1371. show: false,
  1372. },
  1373. data: [{
  1374. value: 735,
  1375. itemStyle: {
  1376. color: '#53B56B'
  1377. }
  1378. },
  1379. {
  1380. value: 735,
  1381. itemStyle: {
  1382. color: '#EF8375'
  1383. }
  1384. },
  1385. {
  1386. value: 735,
  1387. itemStyle: {
  1388. color: '#307AF6'
  1389. }
  1390. }
  1391. ]
  1392. }],
  1393. grid: {
  1394. top: 0,
  1395. left: 0,
  1396. right: 0,
  1397. bottom: 0,
  1398. containLabel: true
  1399. },
  1400. graphic: [{
  1401. type: 'image',
  1402. id: 'logo',
  1403. left: 'center',
  1404. top: 'center',
  1405. style: {
  1406. image: img, // 图片路径
  1407. width: uni.upx2px(40),
  1408. height: uni.upx2px(40)
  1409. }
  1410. }]
  1411. }
  1412. myChart.setOption(option);
  1413. this.echartsList[key] = myChart;
  1414. },
  1415. getfindByOpenId() {
  1416. uni.showLoading({
  1417. title: "加载中",
  1418. mask: true,
  1419. })
  1420. API.findByOpenId({
  1421. openId: this.jphelp.getOpenId(),
  1422. }).then((response) => {
  1423. uni.hideLoading();
  1424. this.isReady = true;
  1425. this.loginset(response)
  1426. try {
  1427. this.init()
  1428. } catch (e) {
  1429. uni.showToast({
  1430. title: e,
  1431. icon: "none"
  1432. })
  1433. }
  1434. }).catch(error => {
  1435. uni.showToast({
  1436. title: error,
  1437. icon: "none"
  1438. })
  1439. uni.redirectTo({
  1440. url: '/pages/login/login'
  1441. })
  1442. })
  1443. }
  1444. }
  1445. }
  1446. </script>
  1447. <style scoped lang="scss">
  1448. .color307AF6 {
  1449. color: #307AF6
  1450. }
  1451. .color53B56B {
  1452. color: #53B56B
  1453. }
  1454. .colorAAAAAA {
  1455. color: #AAAAAA
  1456. }
  1457. .colorEF8132 {
  1458. color: #EF8132
  1459. }
  1460. .colorDC4441 {
  1461. color: #DC4441
  1462. }
  1463. .colorEF8375 {
  1464. color: #EF8375
  1465. }
  1466. .body1pie-table {
  1467. color: rgba(51, 51, 51, 1);
  1468. font-size: 32rpx;
  1469. font-weight: bold;
  1470. .tr {
  1471. .td1 {
  1472. padding-right: 24rpx;
  1473. }
  1474. display: flex;
  1475. margin-bottom: 40rpx;
  1476. .td2 {
  1477. width: 100%;
  1478. .td3 {
  1479. display: flex;
  1480. .td4 {
  1481. width: 120px;
  1482. }
  1483. }
  1484. }
  1485. }
  1486. // td{
  1487. // padding-right: 24rpx;
  1488. // }
  1489. .body1pie {}
  1490. .body1pie-num {
  1491. margin: 0 8rpx;
  1492. }
  1493. }
  1494. // 导航栏
  1495. .navbar {
  1496. box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.15);
  1497. background-color: rgba(22, 119, 255, 1);
  1498. color: #fff;
  1499. line-height: 88rpx;
  1500. display: flex;
  1501. justify-content: space-between;
  1502. align-items: center;
  1503. padding: 0 32rpx;
  1504. color: rgba(255, 255, 255, 1);
  1505. font-size: 36rpx;
  1506. position: fixed;
  1507. left: 0;
  1508. right: 0;
  1509. top: 0;
  1510. z-index: 999999;
  1511. font-weight: bold;
  1512. }
  1513. .main {
  1514. border-radius: 16px 16px 0px 0px;
  1515. background: linear-gradient(180deg, rgba(242, 244, 246, 1) 61%, rgba(255, 255, 255, 0) 100%);
  1516. margin-top: -24rpx;
  1517. padding: 32rpx;
  1518. .statistics {
  1519. border-radius: 8px;
  1520. background-color: rgba(255, 255, 255, 1);
  1521. box-shadow: 0px 1px 6px 0px rgba(0, 59, 142, 0.05);
  1522. margin-bottom: 24rpx;
  1523. padding: 40rpx;
  1524. .title {
  1525. display: flex;
  1526. align-items: center;
  1527. margin-bottom: 32rpx;
  1528. font-weight: bold;
  1529. .img {
  1530. width: 36rpx;
  1531. height: 36rpx;
  1532. vertical-align: middle;
  1533. border-radius: 999px;
  1534. }
  1535. .change {
  1536. display: flex;
  1537. align-items: center;
  1538. .change-img {
  1539. width: 32rpx;
  1540. height: 32rpx;
  1541. vertical-align: middle;
  1542. }
  1543. text {
  1544. margin-left: 8rpx;
  1545. }
  1546. }
  1547. .text {
  1548. color: rgba(16, 16, 16, 1);
  1549. font-size: 36rpx;
  1550. margin-left: 16rpx;
  1551. display: flex;
  1552. justify-content: space-between;
  1553. align-items: center;
  1554. width: 100%;
  1555. .tag {
  1556. border-radius: 4px;
  1557. border: 1px solid rgba(187, 187, 187, 1);
  1558. color: rgba(51, 51, 51, 1);
  1559. font-size: 24rpx;
  1560. padding: 1px 8rpx;
  1561. margin-left: 8rpx;
  1562. }
  1563. }
  1564. .change {
  1565. margin-left: 16rpx;
  1566. font-size: 24rpx;
  1567. color: #838383;
  1568. }
  1569. .check-all {
  1570. margin-left: auto;
  1571. color: rgba(131, 131, 131, 1);
  1572. font-size: 24rpx;
  1573. font-weight: 400;
  1574. }
  1575. }
  1576. }
  1577. .statistics-end {
  1578. padding-bottom: 0;
  1579. }
  1580. }
  1581. .tabs-box2 {
  1582. margin-bottom: 8rpx;
  1583. padding-right: 16rpx;
  1584. display: flex;
  1585. align-items: center;
  1586. justify-content: space-between;
  1587. .tabs-box-other {
  1588. padding-bottom: 12rpx;
  1589. }
  1590. }
  1591. .tabs-box {
  1592. padding: 42rpx 0;
  1593. margin-top: 66rpx;
  1594. padding-right: 32rpx;
  1595. background-color: rgba(22, 119, 255, 1);
  1596. display: flex;
  1597. align-items: center;
  1598. justify-content: space-between;
  1599. .tabs {
  1600. width: 97%;
  1601. }
  1602. .more {
  1603. padding-right: 12rpx;
  1604. }
  1605. .tabs-box-other {
  1606. padding-bottom: 12rpx;
  1607. height: 80rpx;
  1608. line-height: 70rpx;
  1609. font-size: 30rpx;
  1610. color: rgb(255, 255, 255);
  1611. }
  1612. }
  1613. .body6main {
  1614. .line {
  1615. display: flex;
  1616. justify-content: space-between;
  1617. }
  1618. .abnormal-item:last-of-type {
  1619. border-bottom: none !important;
  1620. padding-bottom: 0;
  1621. }
  1622. .abnormal-item {
  1623. width: 100%;
  1624. display: flex;
  1625. justify-content: space-between;
  1626. align-items: center;
  1627. padding: 16rpx;
  1628. border-bottom: 1px solid rgba(245, 245, 245, 1);
  1629. .item-title {
  1630. .level {
  1631. color: #fff;
  1632. border-radius: 8rpx;
  1633. font-weight: 400;
  1634. padding: 4rpx 8rpx;
  1635. font-size: 22rpx;
  1636. margin-right: 2px;
  1637. }
  1638. .level1 {
  1639. background: red;
  1640. }
  1641. .level2 {
  1642. background-color: rgba(255, 123, 0, 1);
  1643. }
  1644. color: rgba(51, 51, 51, 1);
  1645. width: 100%;
  1646. .img {
  1647. width: 32rpx;
  1648. height: 32rpx;
  1649. margin-right: 8rpx;
  1650. }
  1651. .name {
  1652. color: rgba(51, 51, 51, 1);
  1653. font-weight: bold;
  1654. overflow: hidden;
  1655. white-space: nowrap;
  1656. text-overflow: ellipsis;
  1657. }
  1658. .date {
  1659. color: rgba(119, 119, 119, 1);
  1660. font-size: 24rpx;
  1661. }
  1662. }
  1663. .item-value {
  1664. text-align: right;
  1665. display: flex;
  1666. align-items: center;
  1667. .more {
  1668. margin-left: 8rpx;
  1669. }
  1670. .value1 {
  1671. font-weight: bold;
  1672. color: rgba(51, 51, 51, 1);
  1673. }
  1674. .value2 {
  1675. color: rgba(119, 119, 119, 1);
  1676. font-size: 24rpx;
  1677. }
  1678. }
  1679. }
  1680. }
  1681. .body7main {
  1682. border-radius: 4px;
  1683. background-color: rgba(245, 245, 245, 1);
  1684. padding: 32rpx;
  1685. .line {
  1686. display: flex;
  1687. display: flex;
  1688. justify-content: space-between;
  1689. margin-bottom: 24rpx;
  1690. .goto{
  1691. display: flex;
  1692. align-items: center;
  1693. }
  1694. .item-body{
  1695. font-size: 24rpx;
  1696. }
  1697. .item-title {
  1698. color: rgba(51, 51, 51, 1);
  1699. font-size: 28rpx;
  1700. display: flex;
  1701. align-items: center;
  1702. .item-name{
  1703. margin-right: 8rpx;
  1704. font-size: 32rpx;
  1705. font-weight: bold;
  1706. }
  1707. }
  1708. .statusN{
  1709. border-radius: 4px;
  1710. font-size: 24rpx;
  1711. padding: 2rpx 8rpx;
  1712. margin-right: 8rpx;
  1713. }
  1714. .statusN1 {
  1715. color: rgba(0,185,98,1);
  1716. border: 1px solid rgba(0,185,98,1);
  1717. }
  1718. .statusN0 {
  1719. color: rgba(51,51,51,1);
  1720. border: 1px solid rgba(119,119,119,1);
  1721. }
  1722. .item-tags {
  1723. display: flex;
  1724. .tag {
  1725. border-radius: 4px;
  1726. white-space: pre;
  1727. background-color: rgba(39, 177, 72, 1);
  1728. color: rgba(255, 255, 255, 1);
  1729. font-size: 20rpx;
  1730. padding: 2rpx 8rpx;
  1731. margin-right: 8rpx;
  1732. }
  1733. .tag1 {
  1734. background-color: rgba(22, 119, 255, 1);
  1735. }
  1736. .tag2 {
  1737. background-color: rgba(129, 97, 255, 1);
  1738. }
  1739. .lockStatus {
  1740. background-color: rgba(153, 153, 153, 1);
  1741. }
  1742. .lockStatus2 {
  1743. background-color: #ff7b00
  1744. }
  1745. .lockStatus1 {
  1746. background-color: #03A9F4
  1747. }
  1748. .lockStatus3 {
  1749. background-color: #27b148
  1750. }
  1751. }
  1752. }
  1753. }
  1754. .body8main{
  1755. .line{
  1756. display: flex;
  1757. justify-content: space-between;
  1758. align-items: center;
  1759. background: #fff;
  1760. padding:16rpx 0rpx;
  1761. border-top: 1px solid rgba(232,232,232,1);
  1762. .data{
  1763. .view1{
  1764. color: rgba(16,16,16,1);
  1765. font-size: 32rpx;
  1766. font-weight: bold;
  1767. }
  1768. .view3{
  1769. color: rgba(119,119,119,1);
  1770. font-size: 28rpx;
  1771. }
  1772. }
  1773. .goto{
  1774. display: flex;
  1775. font-size: 32rpx;
  1776. }
  1777. .status1{
  1778. color:#FF5100
  1779. }
  1780. .status2{
  1781. color: rgba(22,119,255,1);
  1782. }
  1783. }
  1784. .line:first-child{
  1785. border-top: 0px ;
  1786. padding-top: 0px;
  1787. }
  1788. }
  1789. </style>