123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575 |
- <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">
- {{tabsFrom.title}}
- <u-icon name="arrow-down" color="#fff" 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">
- <view class="item-title">
- <image class="img" src="@/assets/img/meterStatistics@3x.png"></image>电量统计(度)
- </view>
- <view class="item-value">
- {{electricity}}
- </view>
- </view>
- <view class="statistics-item">
- <view class="item-title">
- <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>
- </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 v-if="false">
- <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">
- <view class="item-title">
- 类型
- </view>
- <view class="item-value">
- 变压器
- </view>
- </view>
- <view class="border">
- </view>
- <view class="item">
- <view class="item-title">
- 设备编号
- </view>
- <view class="item-value">
- SN9015001
- </view>
- </view>
- <view class="border">
- </view>
- <view class="item">
- <view class="item-title">
- 上次故障时间
- </view>
- <view class="item-value">
- 2024-02-14
- </view>
- </view>
- </view>
- </view>
- <!-- 设备信息弹窗 -->
- <view class="equipment-popup">
- <u-popup v-model="equipmentInfosShow" 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">
- 变压器
- </view>
- </view>
- <view class="item">
- <view class="item-title">
- 编号
- </view>
- <view class="item-value">
- SN9015001
- </view>
- </view>
- <view class="item">
- <view class="item-title">
- 所属公司
- </view>
- <view class="item-value">
- 荆鹏集团
- </view>
- </view>
- <view class="item">
- <view class="item-title">
- 地址
- </view>
- <view class="item-value">
- 荆州市沙市区江津东路155号
- </view>
- </view>
- <view class="item">
- <view class="item-title">
- 上线时间
- </view>
- <view class="item-value">
- 2024-01-01
- </view>
- </view>
- <view class="item">
- <view class="item-title">
- 上次故障时间
- </view>
- <view class="item-value">
- 2024-02-14
- </view>
- </view>
- </view>
- <button class="get" @click="equipmentInfosShow=false">知道了</button>
- </view>
- </u-popup>
- </view>
- <!-- 故障上报 -->
- <view class="create-order">
- <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'
- export default {
- data() {
- return {
- electricity: 0, //电量统计
- fee: 0, //电费统计
- abnormalRecordsList: [], //异常list
- companyId: '', //企业id
- meterId: '', //设备id
- titleName: '',
- clickType: 0,
- 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: '2',
- intervalId: null, // 用于存储间隔ID
- intervalReady: true, // 用于存储间隔ID
- };
- },
- 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 = 2;
- this.getElectricityStatistics();
- this.getTimeSlotStatistics();
- this.getCompanyInfoList();
- this.getAbnormalAlarmRecord();
- },
- beforeDestroy() {
- this.clearTimer(); // 组件销毁前清除定时器
- this.intervalReady = false;
- console.log("组件销毁前清除定时器")
- },
- methods: {
- 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
- })
- },
- // 异常告警记录
- 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 > 1) {
- 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 = 2;
- this.value = '2';
- this.getTimeSlotStatistics();
- this.getElectricityStatistics();
- }
- },
- 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 = 2;
- this.value = '2';
- this.getTimeSlotStatistics();
- this.getElectricityStatistics();
- },
- 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){
- // 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: '10%',
- left: '3%',
- right: '8%',
- bottom: '8%',
- 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() {
- 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.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.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;
- }
- /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;
- .back {
- z-index: 999;
- width: 200rpx;
- }
- .title {
- color: #fff;
- display: flex;
- align-items: center;
- justify-content: center;
- }
- .right {
- .img {
- width: 48rpx;
- height: 48rpx;
- }
- }
- }
- /deep/.uicon-nav-back {
- color: #fff !important;
- }
- .background {
- background-color: rgba(22, 119, 255, 1);
- padding-top: 88rpx;
- padding-bottom: 100rpx;
- /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;
- width: 160%;
- height: 150px;
- background-color: rgba(22, 119, 255, 1);
- left: -30%;
- border-radius: 0 0 50% 50%;
- }
- // // 日期
- .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: -88rpx 32rpx 0;
- position: relative;
- 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-value{
- color: rgba(16,16,16,1);
- font-size: 48rpx;
- font-weight: bold;
- margin-top: 8rpx;
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- }
- }
- .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;
- /deep/.u-radio {
- margin-bottom: 8px;
- min-width: 25% !important;
-
-
-
-
- }
- /deep/.u-radio__label{
- margin-left: 24rpx;
- font-size: 28rpx; ;
- }
- }
- }
- //各时段用电量
- .electricity-chart {
- margin: 24rpx 32rpx;
- padding: 40rpx 32rpx;
- background-color: #fff;
- border-radius: 8px;
- .title {
- display: flex;
- align-items: center;
-
- 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{
- display: flex;
- align-items: center;
- justify-content: space-between;
- 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;
- }
- }
- }
- }
- // 能源监测
- .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;
- }
- .infos {
- padding-bottom: 100rpx;
- .item:last-of-type {
- border: none;
- }
- .item {
- display: flex;
- align-items: center;
- height: 80rpx;
- line-height: 80rpx;
- border-bottom: 1px solid #cccccc;
- .item-title {
- color: rgba(51, 51, 51, 1);
- width: 200rpx;
- }
- .item-value {
- color: #666666;
- flex: 1;
- margin-left: 16rpx;
- }
- }
- }
- .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>
|