123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812 |
- <template>
- <view>
- <u-navbar :title="title" :backIconColor="'#ffffff'" title-color="#ffffff"
- :background="backgroundObj"></u-navbar>
- <view class="gradient-header">
- <view class="jpback">
- </view>
- </view>
- <u-picker title="日期选择" :maskCloseAble="true" v-model="body0data.tabsFrom.show" :defaultTime="body0data.tabsFrom.showIndex+'-1'"
- mode="time" :params="body0data.tabsFrom.params" @confirm="selector2confirm" @cancel="selector2cancel"
- >
- </u-picker>
-
- <view class="main">
- <view class="statistics ">
- <view class="data1">
- <view class="item">
- <view class="line">
- <view class="name">
- {{info.name}}
- </view>
- <view class="item-tags">
- <view class="tag tag1" :class="'typeN typeN'+info.type">
- {{info.typeN}}
-
- </view>
- <!-- <view class="tag" :class="'statusN statusN'+info.status">
- {{info.statusN}}
-
- </view>
- <view class="tag" :class="'lockStatusN lockStatusN'+info.lockStatus">
- {{info.lockStatusN}}
- </view> -->
- </view>
- </view>
- <view class="line">
- 编号:{{info.lockNo}}
- </view>
- <view class="line" style=" color: #909399;">
- 更新时间:{{info.lastOnlineTime}}
- </view>
- </view>
- <view class="value" v-if="0">
- <u-button type="primary" size="mini" shape="circle">
- <img class="img" src="@/assets/img/button/lock.svg" alt="">
- 降锁
- </u-button>
- </view>
- </view>
-
- <view class="top-span">
- <view class="item-span">
- <img src="@/assets/img/topspan/span1.png">
- <span>地锁</span>
- <span v-if="info.parkingStatus==1" style="color: #1677FF;" >有车</span>
- <span v-else-if="info.parkingStatus==0" style="color: #00B962;" >无车</span>
- </view>
- <view class="item-span">
- <img src="@/assets/img/topspan/span2.png">
- <span>地锁</span>
- <span style="color: red;"
- v-if="info.lockStatus==4||info.lockStatus==0">
- 错误</span>
- <span v-else-if="info.lockStatus==1" style="color: #1677FF;" >升起</span>
- <span v-else-if="info.lockStatus==2" style="color: #00B962;" >降落</span>
- <span v-else >其他</span>
-
- </view>
-
- <view class="item-span">
- <img src="@/assets/img/topspan/span3.png">
- <span>电压</span>
- <span v-if="info.batteryLevel">{{info.batteryLevel}}V</span>
- <span v-else>未知</span>
- </view>
- <view class="item-span">
- <img src="@/assets/img/topspan/span4.png">
- <span>网络</span>
-
- <span v-if="info.status==1" style="color: #00B962;" >在线</span>
- <span v-else-if="info.status==0" style="color: red" >离线</span>
-
-
- </view>
-
- <view class="item-span">
- <img src="@/assets/img/topspan/span5.png">
- <span>雷达</span>
-
-
- <span v-if="info.radarStatus==0" style="color: #00B962;" >正常</span>
- <span v-else-if="info.radarStatus==1" style="color: red" >故障</span>
-
-
- </view>
- </view>
- </view>
- <view class=" no_statistics">
- <view class="data2">
- <view class="top">
- <view class="item">
- <view class="name">
- 停车时长
- </view>
- <view class="value" v-html="durationShow()">
-
- </view>
- </view>
- <view class="item">
- <view class="name">
- 使用率
- </view>
- <view class="value" v-if="lockUsageRateData&&lockUsageRateData.usageRate">
- {{lockUsageRateData.usageRate=='∞'?'/':lockUsageRateData.usageRate+'%'}}
- </view>
- </view>
- <view class="item">
- <view class="name">
- 异常次数
- </view>
- <view class="value">
- 0
- </view>
- </view>
- </view>
- <view class="body">
- <u-radio-group v-model="radiovalue" @change="radioGroupChange">
- <u-radio @change="radioChange" v-for="(item, index) in radiolist" :key="index"
- :name="item.value">
- {{item.name}}
- </u-radio>
- </u-radio-group>
- </view>
- </view>
- </view>
-
- <u-picker v-model="body2data.vue.show" :params="body2data.vue.params" :default-time="body2data.query.startTime"
- @confirm="body2dataconfirm" mode="time"></u-picker>
-
-
- <view class="statistics ">
- <view class="title">
- <view class="icon">
- <image class="img" src="@/assets/img/circleCopy1@1x.png" mode=""></image>
- </view>
- <view class="text">
- <view>地锁平均占用率(%)</view>
- <view class="tag" @click="body2data.vue.show=true">{{body2data.vue.queryN}}<u-icon
- name="arrow-down"></u-icon></view>
- </view>
- </view>
- <view class="contentBody">
- <jpContent :status="jpContentMap.body2">
- <view class="body2lineChart">
- <view id="body2line1" class="body2line">
- </view>
- </view>
- </jpContent>
- </view>
- </view>
- <view class="statistics " v-if="0">
- <view class="title">
- <view class="icon">
- <image class="img" src="@/assets/img/circleCopy1@1x.png" mode=""></image>
- </view>
- <view class="text">
- <view>地锁历史异常状态</view>
- </view>
- </view>
- <view class="contentBody">
- <jpContent :status="jpContentMap.body1">
- <view class="body1pieChart">
- <view id="body1pie1" class="body1pie">
- </view>
- </view>
- </jpContent>
- </view>
- </view>
- <view class="statistics ">
- <view class="title">
- <view class="icon">
- <image class="img" src="@/assets/img/circleCopy1@1x.png" mode=""></image>
- </view>
- <view class="text">
- <view>高频使用时段分布</view>
- </view>
- </view>
- <view class="contentBody">
- <jpContent :status="jpContentMap.body3">
- <view class="body3barChart">
- <view id="body3bar1" class="body3bar">
- </view>
- </view>
- </jpContent>
- </view>
- </view>
- <view class="statistics ">
- <view class="title">
- <view class="icon">
- <image class="img" src="@/assets/img/circleCopy1@1x.png" mode=""></image>
- </view>
- <view class="text">
- <view>用户停留时长分群特征</view>
- </view>
- </view>
- <view class="contentBody">
- <jpContent :status="jpContentMap.body4">
- <view class="body4pieChart">
- <view id="body4pie1" class="body4pie">
- </view>
- </view>
- </jpContent>
- </view>
- </view>
- <view class="statistics " v-if="0">
- <view class="title">
- <view class="icon">
- <image class="img" src="@/assets/img/circleCopy1@1x.png" mode=""></image>
- </view>
- <view class="text">
- <view>高频使用用户TOP</view>
- </view>
- </view>
- <view class="contentBody">
- <jpContent :status="jpContentMap.body5">
- <view class="body5data">
- <view class="line">
- <view class="data">
- <view class="item">
- 王二
- </view>
- <view class="value">
- 鄂DDT1268
- </view>
- <view class="value">
- 28次
- </view>
- </view>
- <view class="goto">
- <u-icon name="arrow-right" size="24" color="#BBBBBB"></u-icon>
- </view>
- </view>
- <view class="line">
- <view class="data">
- <view class="item">
- 王三
- </view>
- <view class="value">
- 鄂DDT1268
- </view>
- <view class="value">
- 8次
- </view>
- </view>
- <view class="goto">
- <u-icon name="arrow-right" size="24" color="#BBBBBB"></u-icon>
- </view>
- </view>
- </view>
- </jpContent>
- </view>
- </view>
- <!-- end-->
- <view class="statistics " v-if="0">
- <view class="title">
- <view class="icon">
- <image class="img" src="@/assets/img/circleCopy1@1x.png" mode=""></image>
- </view>
- <view class="text">
- <view>白名单用户清单</view>
- <view class="check-all">查看全部<u-icon name="arrow-right"></u-icon></view>
- </view>
- </view>
- <view class="contentBody">
- <jpContent :status="jpContentMap.body7">
- <view class="body7data">
- <view class="line">
- <view class="value">
- 用户姓名
- </view>
- <view class="value">
- 车主身份
- </view>
- <view class="value">
- 使用次数
- </view>
- </view>
- <view class="line">
- <view class="value">
- 孙培军
- </view>
- <view class="value">
- 地锁所有人
- </view>
- <view class="value">
- 22
- </view>
- </view>
- <view class="line">
- <view class="value">
- 刘洋
- </view>
- <view class="value">
- 白名单用户
- </view>
- <view class="value">
- 11
- </view>
- </view>
- </view>
- </jpContent>
- </view>
- </view>
- <!-- end-->
- <view class="statistics " v-if="0" >
- <view class="title">
- <view class="icon">
- <image class="img" src="@/assets/img/circleCopy1@1x.png" mode=""></image>
- </view>
- <view class="text">
- <view>地锁异常记录</view>
- <view class="check-all">查看全部<u-icon name="arrow-right"></u-icon></view>
- </view>
- </view>
- <view class="contentBody" >
- <jpContent :status="jpContentMap.body6">
- <view class="body6main">
- <view class="line" v-for="(item,index) in abnormalRecordsList" :key="index">
- <view class="abnormal-item">
- <!-- @click="gotoUrl('/pages/abnormal/abnormalAlarmDetails?id='+item.id)"
- -->
- <view class="item-title">
- <view class="name">
- <span v-if="item.level==1" class="level level1 ">一级</span>
- <span v-if="item.level==2" class="level level2">二级</span>
- {{item.content}}
- </view>
- <view class="date"
- style="display: flex; justify-content: space-between;margin-top: 4rpx;">
- <view>{{item.title}}</view>
- <view>{{item.createTime}}</view>
- </view>
- </view>
- </view>
- <u-icon name="arrow-right" size="24" color="#BBBBBB"></u-icon>
- </view>
- </view>
- </jpContent>
- </view>
- </view>
- <!-- end-->
-
- <view class="body8data-popup">
- <u-popup v-model="body8data.popup" mode="bottom" height="80%" border-radius="12">
- <view class="content">
- <view class="headline">
- 地锁信息
- </view>
- <view class="infos">
- <view class="item">
- <view class="item-title">
- 地锁名称
- </view>
- <view class="item-value">
- {{info.name}}
- </view>
- </view>
- <view class="item">
- <view class="item-title">
- 地锁管理者
- </view>
- <view class="item-value">
- {{info.administrator}}
- </view>
- </view>
- <view class="item">
- <view class="item-title">
- 地锁类型
- </view>
- <view class="item-value">
- {{info.typeN}}
- </view>
- </view>
- <view class="item">
- <view class="item-title">
- 地锁状态
- </view>
- <view class="item-value">
- {{info.lockStatusN}}
- </view>
- </view>
- <view class="item">
- <view class="item-title">
- 地锁型号
- </view>
- <view class="item-value">
- {{info.model}}
- </view>
- </view>
- <view class="item">
- <view class="item-title">
- 出厂编号
- </view>
- <view class="item-value">
- <span>{{info.factoryNumber}}</span>
-
- </view>
- </view>
- <view class="item">
- <view class="item-title">
- 固件版号
- </view>
- <view class="item-value">
- {{info.solidVersion}}
- </view>
- </view>
- <view class="item">
- <view class="item-title">
- 防护等级
- </view>
- <view class="item-value">
- {{info.protectionGrade}}
- </view>
- </view>
-
- <view class="item">
- <view class="item-title">
- 生产日期
- </view>
- <view class="item-value">
- {{info.manufactureDate}}
- </view>
- </view>
- <view class="item">
- <view class="item-title">
- 标准依据
- </view>
- <view class="item-value">
- {{info.enablingTime}}
- </view>
- </view>
- <view class="item">
- <view class="item-title">
- 联网卡号
- </view>
- <view class="item-value">
- {{info.standardBasis}}
- </view>
- </view>
- <view class="item" v-if="info.tariffStandard">
- <view class="item-title">
- 资费标准
- </view>
- <view class="item-value">
- {{info.tariffStandard}}元/月
- </view>
- </view>
- <view class="item">
- <view class="item-title">
- 地锁启动时间
- </view>
- <view class="item-value">
- {{info.activationTime}}
- </view>
- </view>
- <view class="item">
- <view class="item-title">
- 地锁质保期
- </view>
- <view class="item-value">
- {{info.shelfLife}}年
- </view>
- </view>
-
-
-
- </view>
- <button class="get" @click="body8data.popup=false">知道了</button>
- </view>
- </u-popup>
- </view>
- <view class="statistics ">
- <view class="title">
- <view class="icon">
- <image class="img" src="@/assets/img/circleCopy1@1x.png" mode=""></image>
- </view>
- <view class="text">
- <view>地锁信息</view>
- <view class="check-all" @click="body8data.popup=true" >查看全部<u-icon name="arrow-right"></u-icon></view>
- </view>
- </view>
- <view class="contentBody">
- <jpContent :status="jpContentMap.body8">
- <view class="body8main">
- <view class="line">
- <view class="value">
- 地锁型号
- </view>
- <view class="value">
- 出厂编号
- </view>
- <view class="value">
- 固件版号
- </view>
- </view>
- <view class="line">
- <view class="value">
- {{info.model}}
- </view>
- <view class="value">
- {{info.factoryNumber}}
- </view>
- <view class="value">
- {{info.solidVersion}}
- </view>
- </view>
- </view>
- </jpContent>
- </view>
- </view>
- <!-- end-->
- <u-divider border-color="#CFD2D5">已经到底了</u-divider>
- </view>
- </view>
- </template>
- <script>
- import jpContent from '@/components/JPcontent.vue'
- import * as echarts from 'echarts';
- import * as API from '@/apis/pagejs/deviceTab.js'
- import * as API_index from '@/apis/pagejs/index.js'
- import {
- parseUnixTime,
- beforeTimeStamp,
- newDate
- } from '@/apis/utils'
-
- export default {
- components: {
- jpContent
- },
- data() {
- return {
- id:"",
- info:{},
- echartsList: {},
- lockUsageRateData:{},
- body2data: {
- query: {},
- vue: {
- queryN: "",
- show: false,
- params: {
- year: true,
- month: true,
- day: false,
- hour: false,
- minute: false,
- second: false
- }
- },
- data: {}
- },
- body0data: {
- query: {},
- data: {},
- tabsFrom:{
- show:false,
- showIndex:"",
- params:{
- year: true,
- month: true,
- day: false,
- hour: false,
- minute: false,
- second: false
- }
- }
-
- },
- body4data: {
- query: {},
- data: {}
- },
- body8data: {
- query: {},
- data: {},
- popup:false,
- },
- body3data: {
- query: {},
- data: {}
- },
- jpContentMap: {
- body1: 2,
- body2: 2,
- body3: 2,
- body4: 2,
- body5: 2,
- body6: 2,
- body7: 2,
- body8: 2,
- body9: 2,
- body10: 2,
- },
- title: "",
- backgroundObj: {
- background: '#307AF6'
- },
- radiovalue: "1",
- radiolist: [{
- name: '上月',
- value: "3"
- },
- {
- name: '当月',
- value: "1"
- },
- {
- name: '今日',
- value: "2"
- }, {
- name: '当年',
- value: "4"
- }, {
- name: '合计',
- value: "5"
- },
- {
- name: '指定月份',
- value: "0"
- }
- ],
- abnormalRecordsList: [{
- level: 1,
- content: "1111111",
- title: "11",
- createTime: "123:123"
- },
- {
- level: 2,
- content: "1111111",
- title: "11",
- createTime: "123:123"
- }
- ],
- };
- },
- onLoad(op) {
- if(op.id){
- this.id=op.id
- this.init();
- }
- this.body0data.tabsFrom.showIndex=new Date().getFullYear()+'-'+(new Date().getMonth()+1)
- },
- onReady() {
- // if(this.id){
-
- // }
-
- },
- methods: {
-
- durationShow(){
- if(this.lockUsageRateData.duration){
- var m=this.lockUsageRateData.duration%60
- var h=parseInt(this.lockUsageRateData.duration/60)
- if(h>0){
- if(h>24){
- var day=parseInt(h/24)
- h=h%24
- var px= uni.upx2px(12*2)
- if(day>100){
- return `${day}<span style='font-size: ${px}px;'>天</span>`
- }else{
- return `${day}<span style='font-size: ${px}px;'>天</span>${h}h`
- }
-
- }else{
- return `${h}h${m}m`
- }
-
- }else{
- return `${m}m`
- }
- }else{
- return '0m'
- }
- },
- radioChange(e) {
- // console.log(e);
- },
- // 选中任一radio时,由radio-group触发
- selector2confirm(e){
- var time=e.year + "-" + e.month
- this.radiolist[5].name=e.year + "年" + e.month+"月"
- this.body0data.tabsFrom.showIndex=time
- this.getLockUsageRate()
- },
- selector2cancel(){
- this.radiovalue= "1"
- this.radiolist[5].name="指定月份"
- this.getLockUsageRate()
- },
- radioGroupChange(e) {
- console.log(e);
- if(e==0){
- this.body0data.tabsFrom.show=true
- }else{
- this.radiolist[5].name="指定月份"
- this.getLockUsageRate()
- }
-
- },
- init() {
- this.getInfo()
- this.getLockUsageRate()
- this.occupancyByTime(1)
- //this.getbody1()
- //this.getbody2()
- this.occupancyByTimeBar(1);
- //this.getbody3()
- //this.getbody4()
- this.durationDistribution()
- },
- occupancyByTime(init) {
- if (init) {
- var date = new Date();
-
- this.body2data.vue.queryN = date.getFullYear() + "年" + (date.getMonth() + 1) + '月';
- this.body2data.query.startTime = date.getFullYear() + "-" + (date.getMonth() + 1) + "-1"
-
- var endOfMonth = new Date(date.getFullYear(), date.getMonth() + 1, 0)
- this.body2data.query.endTime = parseUnixTime(endOfMonth, '{y}-{m}-{d}')
-
- }
- this.jpContentMap.body2 = 0
- this.body2data.query.floorId = this.id
-
- API_index.occupancyByTime(
- this.body2data.query
- ).then((response) => {
- this.body2data.data = [
- ...response.data.locksTimeList,
- // ...response.data.locksTimeList,
- ];
-
- if (this.body2data.data.length == 0) {
- this.jpContentMap.body2 = 1
-
-
- } else {
- this.jpContentMap.body2 = 2
-
- this.getbody2()
-
-
- }
-
-
-
- }).catch(error => {
- uni.showToast({
- title: error,
- icon: "none"
- })
-
- })
- },
- body2dataconfirm(e) {
-
- var date = new Date(e.year + "-" + e.month + "-1");
- this.body2data.vue.queryN = date.getFullYear() + "年" + (date.getMonth() + 1) + '月';
- this.body2data.query.startTime = date.getFullYear() + "-" + (date.getMonth() + 1) + "-1"
-
- var endOfMonth = new Date(date.getFullYear(), date.getMonth() + 1, 0)
- this.body2data.query.endTime = parseUnixTime(endOfMonth, '{y}-{m}-{d}')
-
- this.occupancyByTime()
- },
- getLockUsageRate(){
- var obj = {
- floorId: this.id,
- queryType:this.radiovalue
- }
- if(this.radiovalue==0){
- obj.queryMonth=this.body0data.tabsFrom.showIndex
- }
- API.lockUsageRate(obj).then((res) => {
- this.lockUsageRateData=res.data
-
- }).catch(error => {
-
- uni.hideLoading();
- uni.showToast({
- title: error,
- icon: "none"
- })
- })
- },
- durationDistribution() {
- this.jpContentMap.body4 = 0
-
- var date = new Date();
- //test
- //this.body4data.query.startTime = date.getFullYear() + "-" + (date.getMonth() + 1) + "-1"
-
- var endOfMonth = new Date(date.getFullYear(), date.getMonth() + 1, 0)
- // this.body4data.query.endTime = parseUnixTime(endOfMonth, '{y}-{m}-{d}')
-
-
- this.body4data.query.floorId = this.id
- API_index.durationDistribution(
- this.body4data.query
- ).then((response) => {
- this.body4data.data = response.data.distribution;
-
- if (this.body4data.data.length == 0) {
- this.jpContentMap.body4 = 1
-
- } else {
- this.jpContentMap.body4 = 2
- //this.getbody3()
- this.getbody4()
- }
-
- }).catch(error => {
- uni.showToast({
- title: error,
- icon: "none"
- })
-
- })
- },
- getInfo(){
- uni.showLoading({
- title: "加载中",
- mask: true,
- })
- var obj = {
- id: this.id
- }
- this.jpContentMap.body8 =0
- API.lockDetails(obj).then((res) => {
- this.info = res.data.floorlockInfo
- this.title =this.info.parkingName
- uni.hideLoading();
- this.jpContentMap.body8 =2
- //this.getWhiteList()
- }).catch(error => {
-
- uni.hideLoading();
- uni.showToast({
- title: error,
- icon: "none"
- })
- })
- },
- getbody1() {
- var key = "body1pie1"
- var myChart = this.echartsList[key];
- if (!myChart) {
- myChart = echarts.init(document.getElementById(key), null, {
- width: uni.upx2px(300 * 2),
- height: uni.upx2px(170 * 2)
- })
- }
- myChart.clear()
- var option = {
- grid: {
- top: 20,
- left: 0,
- right: 0,
- bottom: 0,
- containLabel: true
- },
- series: [{
- type: 'pie',
- radius: ['80%', '50%'],
- radius: [35, 50],
- data: [{
- itemStyle: {
- color: "#EB3C31"
- },
- value: 1048,
- name: '0.5小时\n20%',
- },
- {
- itemStyle: {
- color: "#EF8132"
- },
- value: 735,
- name: '2小时\n10%'
- },
- {
- itemStyle: {
- color: "#929292"
- },
- value: 580,
- name: '2-6小时\n30%'
- },
- ]
- }]
- };
- myChart.setOption(option);
- this.echartsList[key] = myChart;
- },
- getbody4() {
- var key = "body4pie1"
- var myChart = this.echartsList[key];
- if (!myChart) {
- myChart = echarts.init(document.getElementById(key), null, {
- width: uni.upx2px(300 * 2),
- height: uni.upx2px(170 * 2)
- })
- }
- myChart.clear()
- var dataApi = this.body4data.data;
-
- var data = []
- var num = 0
- var sum = 0
- Object.keys(dataApi).forEach(key1 => {
- num += dataApi[key1]
- });
- var i = 0
- Object.keys(dataApi).forEach(key1 => {
- var value = dataApi[key1]
- if(value!=0){
- var obj = {
- value: value,
- name: key1
- }
-
- if (num != 0) {
- var valueInt = parseInt(value / num * 100)
- if (valueInt == 0 && value != 0) {
- valueInt = 1
- }
- sum += valueInt;
-
- if (i == Object.keys(dataApi).length - 1) {
- if (sum != 100) {
- valueInt += (100 - sum)
- }
- }
- obj.name += '\n' + (valueInt) + '%'
- }
- data.push(obj)
- }
- i++;
- });
- var option = {
- grid: {
- top: 20,
- left: 0,
- right: 0,
- bottom: 0,
- containLabel: true
- },
- series: [{
- type: 'pie',
- radius: ['80%', '50%'],
- radius: [45, 60],
- data: data
-
- }]
- };
- myChart.setOption(option);
- this.echartsList[key] = myChart;
- },
- occupancyByTimeBar(init) {
- if (init) {
- var date = new Date();
- //test
- //this.body3data.query.startTime = date.getFullYear() + "-" + (date.getMonth() + 1) + "-1"
-
- var endOfMonth = new Date(date.getFullYear(), date.getMonth() + 1, 0)
- //this.body3data.query.endTime = parseUnixTime(endOfMonth, '{y}-{m}-{d}')
-
- }
- this.jpContentMap.body3 = 0
-
- this.body3data.query.floorId = this.id
- API_index.occupancyByTimeBar(
- this.body3data.query
- ).then((response) => {
- this.body3data.data = [
- ...response.data.locksTimeList,
- // ...response.data.locksTimeList,
- ];
-
- if (this.body3data.data.length == 0) {
- this.jpContentMap.body3 = 1
-
- } else {
- this.jpContentMap.body3 = 2
- this.getbody3()
-
- }
-
-
-
- }).catch(error => {
- uni.showToast({
- title: error,
- icon: "none"
- })
-
- })
- },
- getbody3() {
- var key = "body3bar1"
- var myChart = this.echartsList[key];
- if (!myChart) {
- myChart = echarts.init(document.getElementById(key), null, {
- width: uni.upx2px(300 * 2),
- height: uni.upx2px(170 * 2)
- })
- }
- var dataApi = this.body3data.data;
-
- myChart.clear()
- var data1 = []
- var data2 = [] //useDays
- var i = 0
- dataApi[0].timeUseList.forEach(item => {
-
- Object.keys(item).forEach(key1 => {
-
- data1.push(key1 + '点')
- var num = 0
-
- dataApi.forEach(item2 => {
- num += item2.timeUseList[i][key1].useDays
-
- })
- data2.push(num)
- });
- i += 1
-
- })
-
- var axisLabel = {
- rotate: 40,
- interval: 0,
- textStyle: {
- color: "#333"
- }
- }
- if (data1.length < 7) {
- axisLabel = {
- interval: 0,
- textStyle: {
- color: "#333"
- },
- }
- } else {
- axisLabel.interval = 0;
- }
- var option = {
- xAxis: {
- type: 'category',
- data: data1,
- axisLabel: axisLabel,
- },
- tooltip: {
- trigger: 'axis',
- axisPointer: {
- type: 'shadow'
- },
- formatter: function(params) {
- var result = params[0].name + '<br/>';
- for (var i = 0; i < params.length; i++) {
- result += params[i].marker+ ' ' + params[i].value + '次<br/>';
- }
- return result;
- }
- },
- yAxis: {
- type: 'value'
- },
- grid: {
- top: 20,
- left: 0,
- right: 0,
- bottom: 0,
- containLabel: true
- },
- series: [{
- itemStyle: {
- color: "#5A88E5"
- },
- data: data2,
- type: 'bar'
- }]
- };
- myChart.setOption(option);
- this.echartsList[key] = myChart;
- },
- getbody2() {
- var key = "body2line1"
- var myChart = this.echartsList[key];
- var dataApi = this.body2data.data;
-
- var head = 20 * (parseInt(dataApi.length / 4)) + 20
-
-
- if (!myChart) {
- myChart = echarts.init(document.getElementById(key), null, {
- width: uni.upx2px(300 * 2),
- height: uni.upx2px((170 + head) * 2)
- })
-
- }
- myChart.clear()
-
- var data1 = []
- var series = [];
-
- dataApi.forEach(item => {
-
- var obj = {
- name: item.lockName,
- areaStyle: {},
- itemStyle: {
- color: "#BBD4FB"
- },
- label: {
- show: true,
- position: 'top',
- color: "#307AF6"
- },
- data: [],
- type: 'line'
- }
- if (dataApi.length == 1) {
- obj.label.color = "#307AF6"
- obj.areaStyle = {}
- obj.itemStyle = {
- color: "#BBD4FB"
- }
- }
-
- item.timeUseList.forEach(item2 => {
- Object.keys(item2).forEach(key1 => {
-
- obj.data.push(item2[key1].useRate)
- });
- })
- series.push(obj)
- })
- dataApi[0].timeUseList.forEach(item => {
-
- Object.keys(item).forEach(key1 => {
- data1.push(key1)
-
- });
-
- })
- var axisLabel = {
- rotate: 40,
- interval: 0,
- textStyle: {
- color: "#333"
- }
- }
- if (data1.length < 7) {
- axisLabel = {
- interval: 0,
- textStyle: {
- color: "#333"
- },
- }
- } else {
- axisLabel.interval = 0;
- }
- var option = {
- xAxis: {
- type: 'category',
- data: data1,
- axisLabel: axisLabel,
- },
- tooltip: {
- trigger: 'axis',
- axisPointer: {
- type: 'shadow'
- },
-
- formatter: function(params) {
- var result = params[0].name + '点<br/>';
- for (var i = 0; i < params.length; i++) {
- result += params[i].marker+params[i].seriesName + ': ' + params[i].value + '%<br/>';
- }
- return result;
- }
- },
- yAxis: {
- type: 'value'
- },
- grid: {
- top: (20 + head),
- left: 0,
- right: 0,
- bottom: 0,
- containLabel: true
- },
- series: series,
-
- };
- myChart.setOption(option);
- this.echartsList[key] = myChart;
- },
- }
- }
- </script>
- <style lang="scss">
- .gradient-header {
- height: 0px;
- }
- .jpback {
- height: 268rpx;
- background: linear-gradient(180deg, rgba(22, 119, 255, 1) 20%, rgba(121, 177, 255, 1) 100%);
- }
- .main {
- padding: 32rpx;
- .no_statistics {
- margin-bottom: 24rpx;
- }
- .statistics {
- border-radius: 8px;
- background-color: rgba(255, 255, 255, 1);
- box-shadow: 0px 1px 6px 0px rgba(0, 59, 142, 0.05);
- margin-bottom: 24rpx;
- padding: 40rpx;
- .title {
- display: flex;
- align-items: center;
- margin-bottom: 32rpx;
- font-weight: bold;
- .img {
- width: 36rpx;
- height: 36rpx;
- vertical-align: middle;
- border-radius: 999px;
- }
- .change {
- display: flex;
- align-items: center;
- .change-img {
- width: 32rpx;
- height: 32rpx;
- vertical-align: middle;
- }
- text {
- margin-left: 8rpx;
- }
- }
- .text {
- color: rgba(16, 16, 16, 1);
- font-size: 36rpx;
- margin-left: 16rpx;
- display: flex;
- justify-content: space-between;
- align-items: center;
- width: 100%;
- .tag {
- border-radius: 4px;
- border: 1px solid rgba(187, 187, 187, 1);
- color: rgba(51, 51, 51, 1);
- font-size: 24rpx;
- padding: 1px 8rpx;
- margin-left: 8rpx;
- }
- }
- .change {
- margin-left: 16rpx;
- font-size: 24rpx;
- color: #838383;
- }
- .check-all {
- margin-left: auto;
- color: rgba(131, 131, 131, 1);
- font-size: 24rpx;
- }
- }
- }
- }
- .data1 {
- display: flex;
- align-items: center;
- justify-content: space-between;
- .item {
- .line{
- display: flex;
- align-items: center;
- }
- .name {
- color: rgba(51, 51, 51, 1);
- font-size: 36rpx;
- font-weight: bold;
- margin-right: 8rpx;
- }
- .item-tags {
- display: flex;
- .tag {
- border-radius: 4px;
- background-color: rgba(39, 177, 72, 1);
- color: rgba(255, 255, 255, 1);
- font-size: 24rpx;
- padding: 2rpx 8rpx;
- margin-right: 8rpx;
- }
- .typeN1 {
- background-color: rgba(22, 119, 255, 1);
- }
- .typeN2{
- background-color: #8161ff;
- background-color: #8161ff;
- }
- .statusN{
- background-color:#838383
- }
- .lockStatusN {
-
- background-color: rgba(153, 153, 153, 1);
- }
-
- .lockStatusN2 {
- background-color: #03A9F4
- }
-
- }
- }
- .value {
- .img {
- margin-right: 8rpx;
- width: 32rpx;
- height: 32rpx;
- }
- }
- }
- .data2 {
- height: 336rpx;
- padding: 32rpx;
- border-radius: 12px;
- background: linear-gradient(180deg, rgba(222, 222, 222, 1) 3%, rgba(255, 255, 255, 1) 5%, rgba(232, 232, 232, 1) 56%, rgba(255, 255, 255, 1) 59%, rgba(236, 236, 236, 1) 95%, rgba(215, 215, 215, 1) 98%);
- .top {
- background-repeat: round;
- background-image: url('@/assets/img/deviceTab/index3-2.png');
- display: flex;
- justify-content: space-around;
- text-align: center;
- height: 152rpx;
- align-items: center;
- .item {
- .name {
- color: rgba(16, 16, 16, 1);
- font-size: 32rpx;
- }
- .value {
- color: rgba(16, 16, 16, 1);
- font-size: 48rpx;
- font-weight: bold;
- }
- }
- }
- .body {
- padding: 16rpx;
- }
- }
- .body5data {
- .line {
- display: flex;
- align-items: center;
- justify-content: space-between;
- .data {
- display: flex;
- width: 80%;
- justify-content: space-between;
- .item {
- color: rgba(51, 51, 51, 1);
- font-size: 16px;
- }
- .value {
- color: rgba(119, 119, 119, 1);
- font-size: 16px;
- }
- }
- }
- }
- .body7data {
- .line {
- display: flex;
- align-items: center;
- justify-content: space-between;
- .value {
- width: 33%;
- padding: 16rpx;
- color: rgba(51, 51, 51, 1);
- }
- .value:nth-child(3) {
- text-align: center;
- }
- }
- /* 隔行变色: 偶数行设置背景色 */
- .line:nth-child(odd) {
- background-color: #F2F2F2;
- /* 偶数行 */
- }
- .line:nth-child(even) {
- background-color: #FFFFFF
- /* 奇数行 */
- }
- }
- .body8main {
- .line {
- display: flex;
- align-items: center;
- justify-content: space-between;
- .value {
- width: 33%;
- padding: 16rpx;
- text-align: center;
-
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- }
- }
- /* 隔行变色: 偶数行设置背景色 */
- .line:nth-child(odd) {
- color: rgba(119, 119, 119, 1);
- font-size: 14px;
- /* 偶数行 */
- }
- .line:nth-child(even) {
- color: rgba(16, 16, 16, 1);
- font-size: 16px;
- /* 奇数行 */
- }
- }
- .body6main {
- .line {
- display: flex;
- justify-content: space-between;
- }
- .abnormal-item:last-of-type {
- border-bottom: none !important;
- padding-bottom: 0;
- }
- .abnormal-item {
- width: 100%;
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 16rpx;
- border-bottom: 1px solid rgba(245, 245, 245, 1);
- .item-title {
- .level {
- color: #fff;
- border-radius: 8rpx;
- font-weight: 400;
- padding: 4rpx 8rpx;
- font-size: 22rpx;
- margin-right: 2px;
- }
- .level1 {
- background: red;
- }
- .level2 {
- background-color: rgba(255, 123, 0, 1);
- }
- color: rgba(51, 51, 51, 1);
- width: 100%;
- .img {
- width: 32rpx;
- height: 32rpx;
- margin-right: 8rpx;
- }
- .name {
- color: rgba(51, 51, 51, 1);
- font-weight: bold;
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- }
- .date {
- color: rgba(119, 119, 119, 1);
- font-size: 24rpx;
- }
- }
- .item-value {
- text-align: right;
- display: flex;
- align-items: center;
- .more {
- margin-left: 8rpx;
- }
- .value1 {
- font-weight: bold;
- color: rgba(51, 51, 51, 1);
- }
- .value2 {
- color: rgba(119, 119, 119, 1);
- font-size: 24rpx;
- }
- }
- }
- }
-
- // 地锁信息弹窗
- .body8data-popup {
-
- .content {
-
- padding: 32rpx;
-
- .headline {
- color: rgba(16, 16, 16, 1);
- font-size: 36rpx;
- text-align: center;
- font-weight: bold;
- margin-bottom: 24rpx;
- }
-
- .infos {
- //padding-bottom: 100rpx;
-
- .item:last-of-type {
- border: none;
- }
-
- .item {
- display: flex;
- align-items: center;
-
- //line-height: 48rpx;
- padding: 20rpx 0;
- border-bottom: 1px solid #cccccc;
-
- .item-title {
- color: rgba(51, 51, 51, 1);
- width: 200rpx;
- }
-
- .item-value {
- color: #666666;
- flex: 1;
- margin-left: 16rpx;
- display: flex;
- align-items: center;
- justify-content: space-between;
-
- .img{
- width: 32rpx;
- height: 32rpx;
- transform: rotate(90deg);
- margin-left: 96rpx;
- }
- }
- }
-
- }
-
- .get {
- height: 80rpx;
- line-height: 80rpx;
- border-radius: 4px;
- background-color: rgba(22, 119, 255, 1);
- color: rgba(255, 255, 255, 1);
- font-size: 32rpx;
- }
- }
- }
-
- .top-span{
- border-top: 1px solid rgba(245, 245, 245, 1);
- display: flex;
- flex-wrap: wrap;
- justify-content: space-between;
- padding-top: 16rpx;
- margin-top: 16rpx;
- .item-span{
- white-space: pre;
- display: flex;
- align-items: center;
- margin-top: 4rpx;
- width: 30%;
- font-size: 28rpx;
- span{
- margin: 0 8rpx;
- }
- img{
- width: 28rpx;
- height: 28rpx;
- }
- }
-
- .lockStatusX1{
- color: #00B962;
- }
- .lockStatusX2{
- color: #1677FF;
- }
-
- .statusX1{
- color: #00B962;
- }
- .statusX2{
- color: #1677FF;
- }
- }
- </style>
|