12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706 |
- <template>
- <view>
- <view class="background">
- <!-- 日期选择器 -->
- <u-picker-select title="日期选择" v-model="tabsFrom.show2" :defaultTime="tabsFrom.show2Index" :endYear="endYear"
- mode="time" :params="params" :noselect="false" @confirm="selector2confirm" @cancel="selector2cancel"
- @reset="selector2reset">
- </u-picker-select>
- <view class="navbar-c">
- <view class="back" @click="backDataMonitoringList">
- <u-icon name="arrow-left" color="#fff" size="36"></u-icon>
- </view>
- <view class="title" @click="titleCk">
- <view class="e">
- {{tabsFrom.title}}
- </view>
- <u-icon name="arrow-down" color="#fff" v-if="tabsFrom.selector1.length"
- size="24"></u-icon>
- </view>
- </view>
- </view>
- <!-- 设备选择器 -->
- <u-select title="设备选择" v-model="tabsFrom.show1" mode="mutil-column-auto" :list="tabsFrom.selector1"
- @confirm="selector1confirm" cancel-text="重置" @cancel="selector1cancel">
- </u-select>
- <!-- 用电量 -->
- <view class="electricity-consumption">
- <!-- <view class="title">
- 用电量统计 (度)
- </view> -->
- <!-- <view class="degree">
- <view class="item">
- <view class="item-text">
- 百万
- </view>
- <view class="item-number" v-text="showTop[0]">
- 0
- </view>
- </view>
- <view class="item">
- <view class="item-text">
- 拾万
- </view>
- <view class="item-number" v-text="showTop[1]">
- 0
- </view>
- </view>
- <view class="item">
- <view class="item-text">
- 万
- </view>
- <view class="item-number" v-text="showTop[2]">
- 0
- </view>
- </view>
- <view class="item">
- <view class="item-text">
- 千
- </view>
- <view class="item-number" v-text="showTop[3]">
- 0
- </view>
- </view>
- <view class="item">
- <view class="item-text">
- 百
- </view>
- <view class="item-number" v-text="showTop[4]">
- 0
- </view>
- </view>
- <view class="item">
- <view class="item-text">
- 拾
- </view>
- <view class="item-number" v-text="showTop[5]">
- 7
- </view>
- </view>
- <view class="item">
- <view class="item-text">
- 1
- </view>
- <view class="item-number" v-text="showTop[6]">
- 7
- </view>
- </view>
- <view class="item">
- <view class="item-text">
- 0.1
- </view>
- <view class="item-number decimal" v-text="showTop[7]">
- 7
- </view>
- </view>
- </view> -->
- <!-- 统计 -->
- <view class="statistics-content">
- <view class="statistics-item">
- <!-- @click="gotoUrl('/pages/equipmentDataMonitoring/electricityConsumptionDetail?id='
- +FormData.meterId+'&name='+tabsFrom.title+'&type='+FormData.type)"> -->
- <view class="item-title">
- <image class="img" src="@/assets/img/meterStatistics@3x.png"></image>电量统计(度)
- </view>
- <view class="item-value">
- <text>{{electricity}}</text>
- <!-- <u-icon name="arrow-right" color="#cccccc" size="24" ></u-icon> -->
- </view>
- </view>
- <view class="statistics-item" >
- <view class="item-title item-title2">
- <image class="img" src="@/assets/img/electricityStatistics@3x.png"></image>电费统计(元)
- </view>
- <view class="item-value">
- {{fee}}
- </view>
- </view>
- </view>
- <view class="radio">
- <u-radio-group v-model="value" @change="radioGroupChange">
- <u-radio @change="radioChange" v-for="(item, index) in list" :key="index" :name="item.id"
- :disabled="item.disabled">
- {{item.name}}
- </u-radio>
- </u-radio-group>
- </view>
- </view>
- <!-- 各时段用电量 -->
- <view class="electricity-chart">
- <view class="title">
- <view class="icon">
- </view>
- <view class="text">
- 各时段电量 (度)
- </view>
- <view class="more" @click="tabsFrom.show2=true,params.day=true">
- {{queryDay}}<u-icon name="arrow-down" color="#bbbbbb"></u-icon>
- </view>
- </view>
- <view class="chart">
- <view id="barEcharts" style="min-height:440rpx;">
- </view>
- </view>
- <view class="total" >
- <view class="total-item">
- 电量合计:{{sumQuantity}}度
- </view>
- <view class="total-item">
- 电费合计:{{sumFee}}元
- </view>
- </view>
- </view>
- <!-- 异常波动 -->
- <view class="abnormal" v-if="abnormalRecordsList.length != 0">
- <view class="headline">
- <view class="title">
- <view class="icon">
- </view>
- <view class="text">
- 异常告警
- </view>
- </view>
- <view class="more" @click="gotoUrl('/pages/abnormal/abnormalAlarmRecord?id='+companyId)">
- 查看全部
- <u-icon name="arrow-right" size="24" color="#d4d4d4"></u-icon>
- </view>
- </view>
- <view class="details">
- <view class="item" v-for="(item, index) in abnormalRecordsList" :key="index"
- @click="gotoUrl('/pages/abnormal/abnormalAlarmDetails?id='+item.id)">
- <view class="name">
- {{item.configName}}
- </view>
- <view class="time">
- {{item.createTime}}
- <!-- 箭头 -->
- <view class="more">
- <u-icon name="arrow-right" color="#acacac" size="24"></u-icon>
- </view>
- </view>
-
- </view>
- </view>
- </view>
- <!-- 能源监测 -->
- <view class="energy-inspection">
- <view class="title">
- <view class="icon">
- </view>
- <view class="text">
- 能源监测
- </view>
- </view>
- <view class="grid">
- <u-grid :col="3" :border="false">
- <u-grid-item @click="gotoInfo('3PhaseCurrentDetails','A','三相电流')">
- <view class="icon icon1">
- <image class="img" src="@/assets/img/Image@1.png" mode=""></image>
- </view>
- <view class="grid-text">三相电流</view>
- </u-grid-item>
- <u-grid-item @click="gotoInfo('3PhaseCurrentDetails','V','三相电压')">
- <view class="icon icon2">
- <image class="img" src="@/assets/img/Image@2.png" mode=""></image>
- </view>
- <view class="grid-text">三相电压</view>
- </u-grid-item>
- <u-grid-item @click="gotoInfo('3PhaseCurrentDetails','T','三相温度')">
- <view class="icon icon3">
- <image class="img" src="@/assets/img/Image@3.png" mode=""></image>
- </view>
- <view class="grid-text">三相温度</view>
- </u-grid-item>
- <u-grid-item @click="gotoInfo('3PhaseCurrentDetails','P','三相有功功率')">
- <view class="icon icon4">
- <image class="img" src="@/assets/img/Image@4.png" mode=""></image>
- </view>
- <view class="grid-text">三相有功功率</view>
- </u-grid-item>
- <u-grid-item @click="gotoInfo('3PhaseCurrentDetails','F','三相功率因数')">
- <view class="icon icon5">
- <image class="img" src="@/assets/img/Image@5.png" mode=""></image>
- </view>
- <view class="grid-text">三相功率因数</view>
- </u-grid-item>
- <u-grid-item @click="gotoInfo('3PhaseCurrentDetails','AF','平均功率因数')">
- <view class="icon icon6">
- <image class="img" src="@/assets/img/Image@5.png" mode=""></image>
- </view>
- <view class="grid-text">平均功率因数</view>
- </u-grid-item>
- </u-grid>
- </view>
- </view>
- <!-- 数据分析 -->
- <view class="data-analysis">
- <view class="title">
- <view class="icon">
- </view>
- <view class="text">
- 数据分析
- </view>
- </view>
- <view class="grid">
- <u-grid :col="3" :border="false">
- <u-grid-item @click="gotoInfo('chartYoY','','')">
- <view class="icon icon7">
- <image class="img" src="@/assets/img/Image@7.png" mode=""></image>
- </view>
- <view class="grid-text">同比分析</view>
- </u-grid-item>
- <u-grid-item @click="gotoInfo('chartMoM','','')">
- <view class="icon icon8">
- <image class="img" src="@/assets/img/Image@8.png" mode=""></image>
- </view>
- <view class="grid-text">环比分析</view>
- </u-grid-item>
- <u-grid-item @click="gotoUrl('/pages/equipmentDataMonitoring/electricityStatistics?id='+meterId)">
- <view class="icon icon9">
- <image class="img" src="@/assets/img/Image@9.svg" mode=""></image>
- </view>
- <view class="grid-text">用电统计</view>
- </u-grid-item>
- </u-grid>
- </view>
- </view>
- <!-- 设备信息 -->
- <view class="equipment-information">
- <view class="title">
- <view class="icon">
- </view>
- <view class="text">
- 设备信息
- </view>
- <view class="more" @click="equipmentInfosShow=true">
- 查看全部<u-icon name="arrow-right" size="24" color="#d4d4d4"></u-icon>
- </view>
- </view>
- <view class="infos">
- <view class="item" style="width: 30%;">
- <view class="item-title">
- 设备类型
- </view>
- <view class="item-value">
- {{meterDetail.deviceTypeN}}
- </view>
- </view>
- <view class="border">
- </view>
- <view class="item" style="width: 30%;">
- <view class="item-title">
- 设备编号
- </view>
- <view class="item-value">
- {{meterDetail.deviceNo}}
- </view>
- </view>
- <view class="border">
- </view>
- <view class="item" style="width: 30%;">
- <view class="item-title">
- 设备地址
- </view>
- <view class="item-value">
- {{meterDetail.installationAddressSimple}}
- </view>
- </view>
- </view>
- </view>
- <!-- 设备信息弹窗 -->
- <view class="equipment-popup">
- <u-popup v-model="equipmentInfosShow" height='90%' mode="bottom" 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">
- {{meterDetail.name}}
- </view>
- </view>
- <view class="item">
- <view class="item-title">
- 设备类型
- </view>
- <view class="item-value">
- {{meterDetail.deviceTypeN}}
- </view>
- </view>
- <view class="item">
- <view class="item-title">
- 设备编号
- </view>
- <view class="item-value">
- {{meterDetail.deviceNo}}
- </view>
- </view>
- <view class="item">
- <view class="item-title">
- 产权单位
- </view>
- <view class="item-value">
- {{meterDetail.companyFullName}}
- </view>
- </view>
- <view class="item" @click="toMeterLocation">
- <view class="item-title">
- 设备地址
- </view>
- <view class="item-value">
- <span>{{meterDetail.installationAddress}}</span>
- <!-- <image class="img" src="@/assets/img/riFill-navigation-fill 1.svg"></image> -->
- </view>
- </view>
- <view class="item">
- <view class="item-title">
- 地址简称
- </view>
- <view class="item-value">
- {{meterDetail.installationAddressSimple}}
- </view>
- </view>
- <view class="item">
- <view class="item-title">
- 使用单位
- </view>
- <view class="item-value">
- {{meterDetail.customer}}
- </view>
- </view>
- <view class="item">
- <view class="item-title">
- 启用时间
- </view>
- <view class="item-value">
- {{meterDetail.enablingTime}}
- </view>
- </view>
- <view class="item" v-if="dtuInfo.id">
- <view class="item-title">
- 通讯模块
- </view>
- <view class="item-value">
- {{dtuInfo.name}} {{dtuInfo.imei}}({{meterDetail.address?meterDetail.address:'无'}})
- </view>
- </view>
- </view>
- <button class="get" @click="equipmentInfosShow=false">知道了</button>
- </view>
- </u-popup>
- </view>
- <!-- 故障上报 -->
- <view class="create-order" v-if="false">
- <view class="img-box">
- <image class="img" src="@/assets/img/fas fa-exclamation-triangle Copy 2@3x.png" mode=""></image>
- </view>
- <view class="text">
- 故障上报
- </view>
- </view>
- </view>
- </template>
- <script>
- import {
- parseUnixTime,
- beforeTimeStamp,
- getWeek
- } from '@/apis/utils'
- import * as echarts from 'echarts';
- import * as API from '@/apis/pagejs/index.js'
- import * as API_electricityMeter from '@/apis/pagejs/electricityMeter.js'
- import * as WxJsApi from '@/apis/utils/wxJsApi.js'
- export default {
- data() {
- return {
- meterDetail: {}, //设备信息
- electricity: 0, //电量统计
- fee: 0, //电费统计
- abnormalRecordsList: [], //异常list
- companyId: '', //企业id
- meterId: '', //设备id
- titleName: '',
- clickType: -1,
- sumQuantity: 0,
- sumFee: 0,
- equipmentInfosShow: false,
- kWhList: [],
- queryDay: '',
- showTop: [0, 0, 0, 0, 0, 0, 0, 0],
- FormData: {
- queryDate: '',
- meterId: '',
- type: 0
- },
- FormData2: {
- queryDate: '',
- meterId: ''
- },
- myChart: null,
- endYear: '',
- equipmentShow: false,
- multiSelector: [],
- equipmentList: [],
- params: {
- year: true,
- month: true,
- day: true,
- hour: false,
- minute: false,
- second: false
- },
- tabsFrom: {
- show1: false,
- show1Index: 0,
- show2Index: '',
- show2: false,
- show1Text: "全部类型",
- show2Text: "全部时间",
- selector1: [{
- label: '全部类型',
- value: '',
- },
- {
- label: '线上充值',
- value: '1',
- },
- {
- label: '线下充值',
- value: '2',
- },
- ]
- },
- background: {
- backgroundColor: '#1677FF',
- },
- list: [{
- id: 1,
- name: '本月',
- disabled: false
- }, {
- id: 4,
- name: '今日',
- disabled: false
- }, {
- id: 2,
- name: '上月',
- disabled: false
- }, {
- id: 3,
- name: '本年',
- disabled: false
- }, {
- id: 0,
- name: '合计',
- disabled: false
- }, {
- id: 10,
- name: '指定月份',
- disabled: false
- }],
- value: '4',
- intervalId: null, // 用于存储间隔ID
- intervalReady: true, // 用于存储间隔ID
- dtuInfo:{},
- };
- },
- onLoad(op) {
- if (op.id) {
- this.FormData.meterId = op.id;
- this.FormData2.meterId = op.id;
- this.tabsFrom.title = op.name;
- this.meterId = op.id;
- this.titleName = op.name;
- this.companyId = op.companyId;
- }
- this.endYear = new Date().getFullYear();
- this.FormData.queryDate = parseUnixTime(new Date(), '{y}-{m}-{d}');
- this.FormData2.queryDate = parseUnixTime(new Date(), '{y}-{m}-{d}');
- this.FormData.type = 4;
- this.getElectricityStatistics();
- this.getTimeSlotStatistics();
- this.getCompanyInfoList();
- this.getAbnormalAlarmRecord();
- this.getMeterDetails(this.meterId);
- },
- onReady() {
- WxJsApi.getWxConfig(['getLocation', 'openLocation', 'addEventListener', 'scanQRCode']).then((res) => {
- // //(res)
- }).catch(error => {
- //(res)
- })
- },
- beforeDestroy() {
- this.clearTimer(); // 组件销毁前清除定时器
- this.intervalReady = false;
- console.log("组件销毁前清除定时器")
- },
- methods: {
- toMeterLocation() {
- // WxJsApi.openLocation({
- // latitude: parseFloat(this.meterDetail.latitude), //目的地latitude
- // longitude: parseFloat(this.meterDetail.longitude), //目的地longitude
- // name: this.meterDetail.name,
- // address: this.meterDetail.installationAddress,
- // scale: 15, //地图缩放大小,可根据情况具体调整
- // success(res) {
- // uni.hideLoading()
- // },
- // complete() {
- // // uni.hideLoading()
- // }
- // });
- },
- getMeterDetails(meterId) {
- uni.showLoading({
- title: "加载中",
- mask: true,
- })
- API_electricityMeter.meterDetails({
- meterId: meterId
- }).then((res) => {
- uni.hideLoading();
- this.meterDetail = res.data.meter;
- this.dtuInfo = res.data.dtuInfo;
- }).catch(error => {
- uni.showToast({
- title: error,
- icon: "none"
- })
- })
- },
- clearTimer() {
- if (this.intervalId) {
- clearInterval(this.intervalId); // 清除定时器
- this.intervalId = null; // 重置定时器ID
- }
- },
- startInterval() {
- this.clearTimer(); // 组件销毁前清除定时器
- this.intervalId = setInterval(() => {
- // 每隔5秒运行的代码
- // console.log('这段代码每隔5秒运行一次');
- this.getElectricityStatistics(true)
- this.getTimeSlotStatistics(true)
- }, 60000);
- },
- gotoInfo(path, type, name) {
- if (!this.FormData.meterId) {
- uni.showToast({
- title: "未查询到电表",
- icon: "none"
- })
- return
- }
- uni.navigateTo({
- url: "/pages/equipmentDataMonitoring/" + path + "?id=" + this.FormData.meterId + "&type=" + type +
- "&typeName=" + name+"&title="+this.tabsFrom.title
- })
- },
- // 异常告警记录
- getAbnormalAlarmRecord() {
- var queryDate = parseUnixTime(new Date(), '{y}-{m}');
- uni.showLoading({
- title: "加载中",
- mask: true,
- })
- API.alarmRecord({
- queryDate: queryDate,
- configId: '',
- pageIndex: 1,
- pageSize: 2,
- companyId: this.companyId,
- meterId: this.meterId
- }).then((res) => {
- uni.hideLoading();
- this.abnormalRecordsList = res.data.data;
- }).catch(error => {
- uni.showToast({
- title: error,
- icon: "none"
- })
- })
- },
- titleCk() {
- if(this.tabsFrom.selector1.length){
- this.tabsFrom.show1 = true
- }
-
- },
- selector1confirm(e) {
- console.log(e)
- // var index = e[2];
- // this.tabsFrom.show1Index = index;
- if (e[2].value != null) {
- this.tabsFrom.show1Text = e[2].label;
- this.tabsFrom.title = e[2].label;
- this.FormData.meterId = e[2].value;
- this.FormData.queryDate = parseUnixTime(new Date(), '{y}-{m}-{d}');
- this.FormData2.meterId = e[2].value;
- this.FormData2.queryDate = parseUnixTime(new Date(), '{y}-{m}-{d}');
- //this.meterId =e[2].value;
- this.FormData.type = 4;
- this.value = '4';
- this.getTimeSlotStatistics();
- this.getElectricityStatistics();
- this.getMeterDetails(e[2].value);
- }
- },
- selector1cancel() {
- this.tabsFrom.show1Text = this.titleName;
- this.tabsFrom.title = this.titleName;
- this.FormData.meterId = this.meterId;
- this.FormData.queryDate = parseUnixTime(new Date(), '{y}-{m}-{d}');
- this.FormData2.meterId = this.meterId;
- this.FormData2.queryDate = parseUnixTime(new Date(), '{y}-{m}-{d}');
- this.FormData.type = 4;
- this.value = '4';
- this.getTimeSlotStatistics();
- this.getElectricityStatistics();
- this.getMeterDetails(this.meterId);
- },
- queryDate(queryTime, day) {
- if (day) {
- this.FormData2.queryDate = queryTime;
- //this.FormData2.type =day?"9":"10"
- //this.value="-1"
- this.getTimeSlotStatistics();
- } else {
- this.FormData.queryDate = queryTime + "-01";
- this.FormData.type = 10;
- this.value = "10";
- this.list[5].name = queryTime;
- this.getElectricityStatistics();
- }
- },
- getCompanyInfoList() {
- uni.showLoading({
- title: "加载中",
- mask: true,
- })
- API.deviceCompanyList().then((response) => {
- uni.hideLoading();
- var list = response.data.companyInfoList;
- this.tabsFrom.selector1 = [];
- this.tabsFrom.selector1 = list.map(item => {
- if (item.remoteReadingMeterList.length != 0 && item.remoteMonitorMeterList.length != 0) {
- return {
- label: item.name,
- value: item.id,
- children: [
- // {
- // label: '抄表',
- // value: '1',
- // children: item.remoteReadingMeterList.map(item => {
- // return {
- // label: item.name,
- // value: item.id,
- // }
- // })
- // },
- {
- label: '监控表',
- value: '1',
- children: item.remoteMonitorMeterList.map(item => {
- return {
- label: item.name,
- value: item.id,
- }
- })
- }
- ]
- }
- } else if (item.remoteReadingMeterList.length != 0 && item.remoteMonitorMeterList.length == 0) {
- // return {
- // label: item.name,
- // value: item.id,
- // children: [{
- // label: '抄表',
- // value: '1',
- // children: item.remoteReadingMeterList.map(item => {
- // return {
- // label: item.name,
- // value: item.id,
- // }
- // })
- // }]
- // }
- } else if (item.remoteReadingMeterList.length == 0 && item.remoteMonitorMeterList.length != 0) {
- return {
- label: item.name,
- value: item.id,
- children: [{
- label: '监控表',
- value: '1',
- children: item.remoteMonitorMeterList.map(item => {
- return {
- label: item.name,
- value: item.id,
- }
- })
- }]
- }
- } else {
- }
- })
- }).catch(error => {
- uni.showToast({
- title: error,
- icon: "none"
- })
- })
- },
- getTimeSlotStatistics(interval) {
- if (!interval) {
- uni.showLoading({
- title: "加载中",
- mask: true,
- })
- }
- this.queryDay = parseUnixTime(new Date(this.FormData2.queryDate), '{y}年{m}月{d}日');
- API.timeSlotStatistics(this.FormData2).then((response) => {
- if (!interval) {
- uni.hideLoading();
- }
- this.hourMap = response.data.hourMap;
- this.sumQuantity = response.data.kwhMap.kwh;
- this.sumFee = response.data.kwhMap.fee;
-
- this.getBarCharts(this.hourMap, interval);
- if (!interval) {
- this.startInterval(); // 组件挂载后开始间隔
- }
- }).catch(error => {
- uni.showToast({
- title: error,
- icon: "none"
- })
- })
- },
- getElectricityStatistics(interval) {
- if (!interval) {
- uni.showLoading({
- title: "加载中",
- mask: true,
- })
- }
- var obj = {
- ...this.FormData
- }
- if (obj.type != 10) {
- this.list[5].name = '指定月份';
- }
- // if(obj.type==10){
- // obj.queryDate+="-01"
- // }
- API.electricityStatistics(obj).then((response) => {
- if (!interval) {
- uni.hideLoading();
- }
- this.showTop = [0, 0, 0, 0, 0, 0, 0, 0]
- var electricity = response.data.kwhMap.kwh + "";
- this.electricity = response.data.kwhMap.kwh;
- this.fee = response.data.kwhMap.fee;
- if (electricity) {
- var sz = electricity.split(".")
- var str1 = sz[0];
- var str2 = [];
- if (sz.length > 1) {
- str2 = sz[1];
- this.showTop[7] = str2[0];
- }
- var j = 0;
- for (var i in str1) {
- if (i != undefined) {
- this.showTop[6 - str1.length + j + 1] = str1[i]
- }
- j++;
- }
- this.$forceUpdate()
- }
- if (!interval) {
- this.startInterval(); // 组件挂载后开始间隔
- }
- }).catch(error => {
- uni.showToast({
- title: error,
- icon: "none"
- })
- })
- },
- getBarCharts(list, interval) {
- if (!this.myChart) {
- this.myChart = echarts.init(document.getElementById('barEcharts'), null, {
- // width: uni.upx2px(700),
- height: uni.upx2px(480)
- });
- }
- if (!interval) {
- this.myChart.clear();
- }
- var data1 = [];
- var data2 = [];
- // var sumQuantity=0
- for (var i in list) {
- data1.push(i)
- data2.push(list[i].kwh)
- // sumQuantity+=list[i]
- }
- var axisLabel = {
- rotate: 40,
- interval: 0,
- textStyle: {
- color: "#333"
- }
- }
- if (data1.length < 4) {
- axisLabel = {
- interval: 0,
- textStyle: {
- color: "#333"
- },
- }
- }
- // this.sumQuantity = sumQuantity.toFixed(2);
- var headitemby = "";
- var showkey = "";
- var option = {
- tooltip: {
- trigger: 'axis',
- axisPointer: {
- type: 'shadow'
- },
- formatter: (value) => {
-
- var name = value[0].name;
- var obj=list[name]
- var text= `<p>${name}</p>`
-
-
- if (obj.electricityPrice != undefined) {
- text += `<p>电价:${obj.electricityPrice}元/度</p>`
- }
- if (obj.kwh != undefined) {
- text += `电量:${obj.kwh}度`
- }
- if (obj.amount != undefined) {
- text += ` <p>电费:${obj.amount}元</p>`
- }
- return text
- }
- },
- grid: {
- top: 20,
- left: 5,
- right: 10,
- bottom: 20,
- containLabel: true
- },
- xAxis: {
- type: 'category',
- data: data1,
- axisLabel: axisLabel,
- },
- yAxis: {
- type: 'value',
- },
- series: [{
- name: '合计',
- data: data2,
- type: 'bar',
- label: {
- show: true,
- position: 'top',
- color: '#5C7BD9'
- }
- }]
- }
- console.log(option)
- this.myChart.setOption(option);
- },
- selector2confirm(e) {
- this.tabsFrom.show2Text = e.year + "年" + e.month + "月"
- this.tabsFrom.show2Index = e.year + "-" + e.month
- if (e.day) {
- this.tabsFrom.show2Text += e.day + "日"
- this.tabsFrom.show2Index += '-' + e.day
- this.queryDate(this.tabsFrom.show2Index, true)
- } else {
- this.queryDate(this.tabsFrom.show2Index, false)
- }
- },
- selector2cancel() {
- if(this.clickType != -1) {
-
- }
- this.value = this.clickType;
- },
- selector2reset(e) {
- console.log(e)
- this.tabsFrom.show2Text = '全部时间'
- this.tabsFrom.show2Index = '';
- if (e.day) {
- this.FormData2.queryDate = parseUnixTime(new Date(), '{y}-{m}-{d}');
- this.queryDay = parseUnixTime(new Date(this.FormData2.queryDate), '{y}年{m}月{d}日');
- this.getTimeSlotStatistics();
- } else {
- this.clickType="4"
- this.FormData.type = this.clickType;
- this.value = this.clickType;
- if (this.value != 10) {
- this.list[5].name = '指定月份';
- }
- this.getElectricityStatistics();
- }
- },
- // 选中某个单选框时,由radio时触发
- radioChange(e) {
- console.log(`选择前的值: ${this.value}`);
- //this.clickType = this.value;
- },
- // 选中任一radio时,由radio-group触发
- radioGroupChange(e) {
- console.log(e)
- this.clickType = this.FormData.type;
- this.FormData.type = e;
- if (e == 10) {
- this.tabsFrom.show2 = true;
- this.params.day = false;
- } else {
- this.list[5].name = '指定月份'
- this.getElectricityStatistics();
- }
- },
- backDataMonitoringList() {
- uni.navigateBack()
- },
- }
- };
- </script>
- <style lang="scss" scoped>
- page {
- padding-bottom: 184rpx;
- }
- ::v-deep.u-select__header__title {
- font-size: 36rpx;
- font-weight: bold;
- }
- .navbar-c {
- background-color: rgba(22, 119, 255, 1);
- position: fixed;
- top: 0;
- left: 0;
- right: 0;
- z-index: 999;
- width: 100%;
- .back {
- z-index: 999;
- width: 200rpx;
- }
- .title {
- color: #fff;
- display: flex;
- align-items: center;
- justify-content: center;
- flex: 1;
- .e{
- width: 70%;
- white-space: nowrap;
- text-overflow: ellipsis;
- overflow: hidden;
- }
- }
- .right {
- .img {
- width: 48rpx;
- height: 48rpx;
- }
- }
- }
- ::v-deep.uicon-nav-back {
- color: #fff !important;
- }
- .background {
- background-color: rgba(22, 119, 255, 1);
- padding-top: 88rpx;
- height: 150px;
- padding-bottom: 100rpx;
- position: relative;
- ::v-deep.u-border-bottom:after {
- border: none;
- }
- .u-nav-slot {
- margin-right: 32rpx;
- .img {
- width: 48rpx;
- height: 48rpx;
- vertical-align: middle;
- }
- }
- }
- .background::after {
-
- content: '';
- position: absolute;
- bottom:-39rpx;
- width: 100%;
- height: 40rpx; /* 弧形的高度 */
- background-color: rgba(22, 119, 255, 1); /* 弧形的颜色 */
- border-radius: 50%; /* 创建圆形 */
- border-top-left-radius: 0;
- border-top-right-radius: 0;
- }
- // // 日期
- .date-box {
- display: flex;
- align-items: center;
- justify-content: space-between;
- margin: 24rpx 32rpx;
- .item {
- border-radius: 8px;
- background-color: rgba(255, 255, 255, 0.1);
- border: 1px solid rgba(255, 255, 255, 0.15);
- width: 120rpx;
- height: 120rpx;
- color: #fff;
- text-align: center;
- display: flex;
- flex-direction: column;
- justify-content: center;
- .date {
- font-size: 40rpx;
- }
- }
- .item-today {
- background-color: rgba(255, 255, 255, 1);
- position: relative;
- .date {
- color: rgba(22, 119, 255, 1);
- }
- .week {
- color: rgba(16, 16, 16, 1);
- }
- .dot {
- width: 10rpx;
- height: 10rpx;
- background-color: rgba(255, 150, 0, 1);
- border-radius: 999px;
- position: absolute;
- bottom: -5rpx;
- left: 50%;
- transform: translateX(-50%);
- }
- }
- }
- // 用电量
- .electricity-consumption {
- background-color: #fff;
- padding: 32rpx 32rpx 0rpx;
- border-radius: 8px;
- margin: -188rpx 32rpx 0;
- position: relative;
- border: 1px solid rgba(255,255,255,1);
- background: linear-gradient(180deg, rgba(187,216,255,1) 0%,rgba(255,255,255,1) 63%);
- // 统计
- .statistics-content{
- display: flex;
- align-items: center;
- justify-content: space-between;
-
-
- .statistics-item{
- width: 300rpx;
- padding: 24rpx 0 24rpx 24rpx;
- border-radius: 8px;
- box-shadow: 0px 0px 8px 0px rgba(22,119,255,0.3);
- background-color: #fff;
- }
- .item-title{
- color: rgba(22,119,255,1);
- font-size: 32rpx;
- display: flex;
- align-items: center;
- font-weight: bold;
- .img{
- width: 32rpx;
- height: 32rpx;
- vertical-align: middle;
- margin-right: 4rpx;
- }
- }
- .item-title2{
- color: rgba(129,97,255,1);
- }
- .item-value{
- color: rgba(16,16,16,1);
- font-size: 48rpx;
- font-weight: bold;
- margin-top: 8rpx;
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- text{
- display: inline-block;
- width: 80%;
- margin-right: 4rpx;
- }
- }
- }
- .title {
- color: rgba(16, 16, 16, 1);
- font-size: 36rpx;
- }
- .degree {
- display: flex;
- margin-top: 32rpx;
- .item {
- margin-right: 6rpx;
- text-align: center;
- .item-text {
- color: rgba(16, 16, 16, 1);
- }
- .item-number {
- margin-top: 24rpx;
- width: 72rpx;
- height: 96rpx;
- background-color: rgba(16, 16, 16, 1);
- color: #fff;
- font-size: 72rpx;
- }
- .decimal {
- background-color: #900005;
- }
- }
- }
- // .tab {
- // width: 240rpx;
- // height: 0;
- // border-width: 0px 48rpx 72rpx 0px;
- // border-radius: 8px 8px 0 0;
- // border-style: none solid solid none;
- // border-color: transparent transparent #fff;
- // position: absolute;
- // top: -72rpx;
- // left: 0rpx;
- // right: 0rpx;
- // color: #101010;
- // color: rgba(16, 16, 16, 1);
- // text-align: center;
- // line-height: 72rpx;
- // z-index: 999;
- // text-indent: 16rpx;
- // }
- // .tab2 {
- // width: 240rpx;
- // height: 0;
- // border-width: 0px 48rpx 72rpx 0px;
- // border-radius: 8px 8px 0 0;
- // border-style: none solid solid none;
- // border-color: transparent transparent #D4DBE4;
- // position: absolute;
- // top: -72rpx;
- // left: 210rpx;
- // right: 0rpx;
- // color: #777777;
- // text-align: center;
- // line-height: 72rpx;
- // text-indent: 16rpx;
- // }
- .radio {
- margin-top: 24rpx;
- padding-left: 8rpx;
- ::v-deep.u-radio {
- margin-bottom: 8px;
- min-width: 25% !important;
-
-
-
-
- }
- ::v-deep.u-radio__label{
- margin-left: 24rpx;
- font-size: 28rpx; ;
- }
- }
- }
- //各时段用电量
- .electricity-chart {
- margin: 24rpx 32rpx;
-
- padding: 40rpx 0rpx;
- background-color: #fff;
- border-radius: 8px;
- .title {
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding: 0 32rpx;
- margin-bottom: 40rpx;
- .icon {
- width: 36rpx;
- height: 36rpx;
- background-color: rgba(182, 212, 255, 1);
- border: 6px solid rgba(22, 119, 255, 1);
- border-radius: 100px;
- }
- .text {
- color: rgba(51, 51, 51, 1);
- font-size: 36rpx;
- margin-left: 16rpx;
- font-weight: bold;
- }
- .more {
- margin-left: auto;
- border: 1px solid rgba(187,187,187,1);
- border-radius: 4px;
- padding: 8rpx;
- font-size: 24rpx;
- }
- }
- .total{
- text-align: center;
- color: rgba(51,51,51,1);
- font-weight: bold;
- }
- .chart {
- width: 100%;
- height: 500rpx;
- .img {
- width: 100%;
- height: 440rpx;
- }
- }
- }
- .equipment-information {
- margin: 24rpx 32rpx;
- padding: 40rpx 0rpx;
- background-color: #fff;
- border-radius: 8px;
- .title {
- display: flex;
- align-items: center;
- padding: 0 32rpx;
- margin-bottom: 40rpx;
- .icon {
- width: 36rpx;
- height: 36rpx;
- background-color: rgba(182, 212, 255, 1);
- border: 6px solid rgba(22, 119, 255, 1);
- border-radius: 100px;
- }
- .text {
- display: flex;
- align-items: center;
- color: rgba(51, 51, 51, 1);
- font-size: 36rpx;
- margin-left: 16rpx;
- font-weight: bold;
- }
- .date {
- margin-left: auto;
- }
- .more {
- color: #838383;
- font-size: 24rpx;
- margin-left: auto;
- }
- }
- .chart {
- width: 100%;
- height: 440rpx;
- .img {
- width: 100%;
- height: 440rpx;
- }
- }
- .infos {
- padding: 0 32rpx;
- display: flex;
- justify-content: space-between;
- text-align: center;
- .border {
- margin: auto 0;
- height: 70rpx;
- width: 2rpx;
- background-color: rgba(204, 204, 204, 1);
- ;
- }
- .item-title {
- color: rgba(119, 119, 119, 1);
- }
- .item-value {
- color: rgba(16, 16, 16, 1);
- font-size: 32rpx;
- margin-top: 16rpx;
- }
- }
- }
- // 异常
- .abnormal {
- margin: 24rpx 32rpx;
- padding: 40rpx 32rpx;
- background-color: #fff;
- border-radius: 8px;
- .headline {
- display: flex;
- align-items: center;
- justify-content: space-between;
- }
- .title {
- display: flex;
- align-items: center;
- font-weight: bold;
- .icon {
- width: 36rpx;
- height: 36rpx;
- background-color: rgba(182, 212, 255, 1);
- border: 6px solid rgba(22, 119, 255, 1);
- border-radius: 100px;
- }
- .text {
- color: rgba(51, 51, 51, 1);
- font-size: 36rpx;
- margin-left: 16rpx;
- }
- }
- .more {
- color: #838383;
- font-size: 24rpx
- }
- .details {
- margin-top: 40rpx;
- .item {
- display: flex;
- align-items: center;
- justify-content: space-between;
- margin-top: 32rpx;
- .name {
- color: rgba(51, 51, 51, 1);
- }
- .time {
- color: rgba(119, 119, 119, 1);
- font-size: 24rpx;
- display: flex;
- align-items: center;
- .more{
- margin-left: 4rpx;
- }
- }
- }
- }
- }
- // 能源监测
- .energy-inspection,
- .data-analysis {
- margin: 24rpx 32rpx;
- padding: 40rpx 32rpx;
- background-color: #fff;
- border-radius: 8px;
- .title {
- display: flex;
- align-items: center;
- font-weight: bold;
- .icon {
- width: 36rpx;
- height: 36rpx;
- background-color: rgba(182, 212, 255, 1);
- border: 6px solid rgba(22, 119, 255, 1);
- border-radius: 100px;
- }
- .text {
- color: rgba(51, 51, 51, 1);
- font-size: 36rpx;
- margin-left: 16rpx;
- }
- }
- .grid {
- .icon {
- width: 128rpx;
- height: 128rpx;
- border-radius: 12px;
- background-color: rgba(35, 186, 178, 1);
- display: flex;
- align-items: center;
- justify-content: center;
- margin-bottom: 16rpx;
- .img {
- width: 80rpx;
- height: 80rpx;
- }
- }
- .icon2 {
- background-color: rgba(42, 186, 72, 1);
- }
- .icon3 {
- background-color: rgba(78, 96, 246, 1);
- }
- .icon4 {
- background-color: rgba(22, 119, 255, 1);
- }
- .icon5 {
- background-color: rgba(35, 186, 178, 1);
- }
- .icon6 {
- background-color: rgba(42, 186, 72, 1);
- }
- .icon7 {
- background-color: rgba(22, 119, 255, 1);
- }
- .icon8 {
- background-color: rgba(35, 186, 178, 1);
- }
- .icon9 {
- background-color: rgba(42, 186, 72, 1);
- }
- .grid-text {
- color: #333333;
- }
- }
- }
- // 设备信息弹窗
- .equipment-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;
- }
- }
- }
- // 创建工单
- .create-order {
- width: 120rpx;
- height: 120rpx;
- border-radius: 20px;
- background: linear-gradient(180.29deg, rgba(255, 124, 112, 1) 0.9%, rgba(255, 79, 63, 1) 100.4%);
- box-shadow: 0px 2px 6px 0px rgba(0, 0, 0, 0.4);
- text-align: center;
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- position: fixed;
- right: 32rpx;
- bottom: 64rpx;
- .img {
- width: 56rpx;
- height: 56rpx;
- vertical-align: middle;
- }
- .text {
- color: rgba(255, 255, 255, 1);
- font-size: 22rpx;
- }
- }
- </style>
|