123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925 |
- <template>
- <view>
- <!-- 导航栏 -->
- <view class="navbar">
- <view class="title">
- 能源中心
- </view>
- <view class="icon" @click="toDataMonitoringList" v-if="false">
- <image class="img" src="@/assets/img/riLine-equalizer-line.svg" mode=""></image>
- </view>
- </view>
- <!-- 标签 -->
- <view class="tabs-box" >
- <view class="tabs" v-if="companyList.length >2">
- <u-tabs :list="merchantList1" :is-scroll="false" active-color="#fff" inactive-color="#CCE2FF" bg-color="#1677FF"
- :current="current" @change="change"></u-tabs>
- </view>
- <view class="more" @click="popShow=true" v-if="companyList.length >2">
- <u-icon name="arrow-down" color="#fff" size="40"></u-icon>
- </view>
- </view>
- <!-- 标签弹出层 -->
- <u-popup v-model="popShow" duration="10" mode="top" :negative-top="88" border-radius="16">
- <view class="popup-tabs">
- <view class="tabs">
- <u-tabs :list="merchantList1" :is-scroll="false" :current="current" @change="change"></u-tabs>
- </view>
- <view class="more">
- <u-icon name="arrow-up" color="#777777" size="40" @click="popShow=false"></u-icon>
- </view>
- </view>
- <view class="tabs-options">
- <view class="item" v-for="(item, index) in merchantList2" :key="index"
- @click="merchantChange(item,index)">
- {{item.name}}
- </view>
- </view>
- </u-popup>
- <view class="main">
- <!-- 统计1 -->
- <view class="statistics-1">
- <view class="item" @click="toDataMonitoringList">
- <view class="item-top">
- <view class="img-box">
- <u-circle-progress active-color="#2979ff" :percent="alarmsPercent" width="88">
- </u-circle-progress>
- </view>
- <view class="number">
- <view class="normal">
- 正常:{{alarmsForm.okNum}}台
- </view>
- <view class="abnormal">
- 异常:{{alarmsForm.errorNum}}台
- </view>
- </view>
- </view>
- <!-- 累计 -->
- <view class="total">
- 本月累计报警 <text class="total-number">{{alarmsForm.errorMonthNum}}</text> 次
- </view>
- </view>
- <view class="item" @click="toWorkOrderManagement()">
- <view class="item-top">
- <view class="img-box">
- <u-circle-progress active-color="#2979ff" :percent="0" width="88">
- </u-circle-progress>
- </view>
- <view class="number">
- <view class="normal">
- 未处理:0
- </view>
- <view class="abnormal">
- 已处理:0
- </view>
- </view>
- </view>
- <!-- 累计 -->
- <view class="total">
- 本月累计工单 <text class="total-number">0</text> 条
- </view>
- </view>
- </view>
- <!-- 用电量 -->
- <view class="statistics-e statistics" v-if="codes.indexOf('reading') != -1">
- <view class="title">
- <view class="icon">
- <image class="img" src="@/assets/img/circleCopy1@1x.png" mode=""></image>
- </view>
- <view class="text">
- 用电量 (度)
- </view>
- <view class="change" @click="getPowerConsumption(1)">
- <image class="change-img" src="@/assets/img/refresh-line.svg" mode=""></image>
- <text>换一批</text>
- </view>
- <view class="check-all" @click="toEquipmentElectricity">
- 查看全部<u-icon name="arrow-right" size="24" color="#838383"></u-icon>
- </view>
- </view>
- <view class="electricity">
- <view class="item" v-for="(item, index) in kWhList" :key="index"
- @click="toElectronicMonitoring(item)">
- <view class="equipment">
- <view class="equipment1">
- {{item.name}}
- </view>
- <view class="equipment2">
- {{item.companyName}}
- </view>
- </view>
- <view class="electricity">
- <view class="electricity-item">
- <view class="number">
- {{item.yesterdayKwh}}
- </view>
- <view class="date">
- 昨日
- </view>
- </view>
- <view class="electricity-item">
- <view class="number">
- {{item.thisDayKwh}}
- </view>
- <view class="date">
- 今日
- </view>
- </view>
- <view class="electricity-item">
- <view class="number">
- {{item.thisMonthKwh}}
- </view>
- <view class="date">
- 本月
- </view>
- </view>
- </view>
- </view>
- </view>
- </view>
- <!-- 统计2 异常告警记录 -->
- <view class="statistics-2 statistics" v-if="false">
- <view class="title">
- <view class="icon">
- <image class="img" src="@/assets/img/circleCopy1@1x.png" mode=""></image>
- </view>
- <view class="text">
- 异常告警记录
- </view>
- <view class="check-all">
- 查看全部<u-icon name="arrow-right" size="24" color="#838383"></u-icon>
- </view>
- </view>
- <!-- 异常 -->
- <view class="abnormal-item" v-for="item in 3">
- <view class="item-title">
- <!-- <image class="img" src="@/assets/img/riFill-error-warning-fill 1.svg"></image> -->
- <view class="name">
- 温度异常
- </view>
- <view class="date">
- 2024-02-14 09:00:01
- </view>
- </view>
- <view class="item-value">
- <view class="value1">
- 荆鹏软件园01
- </view>
- <view class="value2">
- 荆鹏集团
- </view>
- </view>
- </view>
- </view>
- <!-- 统计3 设备数据监测-->
- <view class="statistics-3 statistics" v-if="codes.indexOf('detector') != -1">
- <view class="title">
- <view class="icon">
- <image class="img" src="@/assets/img/circleCopy1@1x.png" mode=""></image>
- </view>
- <view class="text">
- 设备数据监测
- </view>
- <view class="change" @click="getEquipmentDataMonitoring(1)">
- <image class="change-img" src="@/assets/img/refresh-line.svg" mode=""></image>
- <text>换一批</text>
- </view>
- <view class="check-all" @click="toDataMonitoringList">
- 查看全部<u-icon name="arrow-right" size="24" color="#838383"></u-icon>
- </view>
- </view>
- <view class="monitoring-item" v-for="(item, index) in deviceList" :key="index"
- @click="toElectronicMonitoring(item)">
- <view class="item-title">
- <view class="text1">
- {{item.name}}
- </view>
- <view class="text2">
- {{item.companyName}}
- </view>
- <view class="state">
- <view class="state1">
- <view class="icon">
- <image class="img" src="@/assets/img/antFill-alert.svg" mode=""></image>
- </view>
- {{item.temperatureStatus=='1' ? '正常' : '异常'}}
- </view>
- <view class="state2">
- <view class="icon">
- <image class="img" src="@/assets/img/smoke.svg" mode=""></image>
- </view>
- {{item.smokeStatus=='1' ? '正常' : '异常'}}
- </view>
- </view>
- </view>
- <!-- 监控信息 -->
- <view class="infos">
- <view class="infos-item">
- <view class="icon">
- <img src="../../assets/img/iconPark-electric-wave 1.svg" alt="" />
- </view>
- <view class="text">
- {{item.remoteMonitorRecord.dcaTotal.toFixed(2)}}A
- </view>
- </view>
- <view class="infos-item">
- <view class="icon">
- <img src="../../assets/img/voltage.svg" alt="" />
- </view>
- <view class="text">
- {{item.remoteMonitorRecord.dcvTop.toFixed(2)}}V
- </view>
- </view>
- <view class="infos-item">
- <view class="icon">
- <img src="../../assets/img/iconPark-thermometer.svg" alt="" />
- </view>
- <view class="text">
- {{item.remoteMonitorRecord.temperatureTop}}℃
- </view>
- </view>
- <view class="infos-item">
- <view class="icon">
- <img src="../../assets/img/power.svg" alt="" />
- </view>
- <view class="text">
- {{(item.remoteMonitorRecord.totalPower).toFixed(2)}}kW
- </view>
- </view>
- <view class="infos-item">
- <view class="icon">
- <img src="../../assets/img/powerFactor.svg" alt="" />
- </view>
- <view class="text">
- {{item.remoteMonitorRecord.averPowerFactor}} /
- {{item.remoteMonitorRecord.averPowerFactorHistory}}
- </view>
- </view>
- </view>
- </view>
- </view>
-
-
-
- </view>
- <energyCenterTabbar :current="0"></energyCenterTabbar>
- </view>
- </template>
- <script>
- import energyCenterTabbar from '@/components/energyCenterTabbar.vue'
- import * as echarts from 'echarts';
- import * as API from '@/apis/pagejs/energy/index.js'
- export default {
- components: {
- energyCenterTabbar
- },
- data() {
- return {
- alarmsPercent: 0,
- alarmsForm: {
- okNum: 0,
- errorNum: 0,
- errorMonthNum: 0
- }, // 累计报警
- companyId: '', // 商户ID
- pageIndexe: 1, // 设备数据检测
- totalPagee: 1,
- deviceList: [],
- pageIndexp: 1, // 用电量
- totalPagep: 1,
- kWhList: [],
- codes: '', // 判断:reading用电量 detector设备数据检测
- merchantList1: [], // 商户
- merchantList2: [],
- companyList: [],
- popShow: false,
- current: 0
- }
- },
- onReady() {
- this.getfindByOpenId();
- this.getPowerConsumption(0);
- this.getEquipmentDataMonitoring(0);
- this.getCompanyInfoList();
- this.getAccumulatedAlarms();
- },
- methods: {
- merchantChange(item,index) {
- var m = item;
- var n = this.merchantList1[this.current];
- this.merchantList1[this.current] = m;
- this.merchantList2[index] = n;
-
- this.companyId = item.id;
- this.getPowerConsumption(0);
- this.getEquipmentDataMonitoring(0);
- this.getAccumulatedAlarms();
-
- this.popShow = false;
- },
- // 单位
- getCompanyInfoList() {
- this.merchantList1 = [];
- this.merchantList2 = [];
-
- uni.showLoading({
- title: "加载中",
- mask: true,
- })
- API.deviceCompanyList().then((response) => {
- uni.hideLoading();
- this.companyList = response.data.companyInfoList;
- if(this.companyList.length >3) {
- this.merchantList1.push(this.companyList.slice(0, 3));
- this.merchantList2.push(this.companyList.slice(3));
- } else {
- this.merchantList1 = this.companyList;
- }
- this.merchantList1.unshift({id: '', name: '全部'});
- }).catch(error => {
- uni.showToast({
- title: error,
- icon: "none"
- })
- })
- },
- // 商户ID
- getfindByOpenId() {
- uni.showLoading({
- title: "加载中",
- mask: true,
- })
- API.findByOpenId({
- openId: this.carhelp.getOpenId()
- }).then((response) => {
- uni.hideLoading();
- this.codes = response.data.regUser.codes;
- }).catch(error => {
- uni.showToast({
- title: error,
- icon: "none"
- })
- })
- },
- // 设备数据监测
- getEquipmentDataMonitoring(pl) {
- this.pageIndexe = this.pageIndexe + pl;
- if (this.pageIndexe > this.totalPagee) {
- this.pageIndexe = 1;
- }
- uni.showLoading({
- title: "加载中",
- mask: true,
- })
- API.homePageDeviceData({
- pageIndex: this.pageIndexe,
- pageSize: 5,
- companyId: this.companyId
- }).then((response) => {
- uni.hideLoading();
- this.deviceList = response.data.data;
- this.totalPagee = response.data.totalPage;
- }).catch(error => {
- uni.showToast({
- title: error,
- icon: "none"
- })
- })
- },
- // 异常告警记录
- getAbnormalAlarmRecord() {
- },
- // 用电量
- getPowerConsumption(pl) {
- this.pageIndexp = this.pageIndexp + pl;
- if (this.pageIndexp > this.totalPagep) {
- this.pageIndexp = 1;
- }
-
- uni.showLoading({
- title: "加载中",
- mask: true,
- })
- API.homePageKwh({
- pageIndex: this.pageIndexp,
- pageSize: 5,
- companyId: this.companyId
- }).then((response) => {
- uni.hideLoading();
- this.kWhList = response.data.data;
- this.totalPagep = response.data.totalPage;
- }).catch(error => {
- uni.showToast({
- title: error,
- icon: "none"
- })
- })
- },
- // 累计工单
- getAccumulatedWorkOrders() {
- },
- // 累计报警
- getAccumulatedAlarms() {
- uni.showLoading({
- title: "加载中",
- mask: true,
- })
- API.deviceStatus({
- companyId: this.companyId
- }).then((response) => {
- uni.hideLoading();
- this.alarmsForm = response.data;
- this.alarmsPercent = this.alarmsForm.okNum/(this.alarmsForm.okNum+this.alarmsForm.errorNum)*100;
- }).catch(error => {
- uni.showToast({
- title: error,
- icon: "none"
- })
- })
- },
- change(index) {
- this.current = index;
- this.companyId = this.merchantList1[index].id;
- this.getPowerConsumption(0);
- this.getEquipmentDataMonitoring(0);
- this.getAccumulatedAlarms();
- },
- toDataMonitoringList() {
- return
- uni.navigateTo({
- url: '/pages/equipmentDataMonitoring/dataMonitoring-list'
- })
- },
- toWorkOrderManagement() {
- return
- uni.navigateTo({
- url: '/pages/workOrderManagement/workOrderManagement'
- })
- },
- toEquipmentElectricity() {
- uni.navigateTo({
- url: '/pages/equipmentDataMonitoring/equipmentElectricity'
- })
- },
- toElectronicMonitoring(item) {
- uni.navigateTo({
- url: '/pages/equipmentDataMonitoring/electronicMonitoring?id=' + item.id + '&name=' + item.name
- })
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- page {
- padding-bottom: 200rpx;
- }
- /deep/.u-drawer-content {
- margin-top: 88rpx;
- }
- .popup-tabs {
- background-color: #fff;
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding-top: 32rpx;
- padding-right: 32rpx;
- color: rgba(51, 51, 51, 1);
- font-size: 32rpx;
- .tabs {
- width: 80%;
- }
- }
- .tabs-options {
- display: flex;
- padding: 24rpx 32rpx 0;
- flex-wrap: wrap;
- .item {
- width: 25%;
- margin-bottom: 40rpx;
- }
- }
- // 导航栏
- .navbar {
- background-color: rgba(22, 119, 255, 1);
- color: #fff;
- line-height: 88rpx;
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 0 32rpx;
- color: rgba(255, 255, 255, 1);
- font-size: 36rpx;
- position: fixed;
- left: 0;
- right: 0;
- top: 0;
- z-index: 999999;
- .img {
- width: 48rpx;
- height: 48rpx;
- vertical-align: middle;
- }
- }
- // 标签
- .tabs-box {
- padding: 32rpx 0;
- margin-top: 88rpx;
- padding-right: 32rpx;
- background-color: rgba(22, 119, 255, 1);
- display: flex;
- align-items: center;
- justify-content: space-between;
- .tabs {
- width: 80%;
- }
- }
- .main {
- border-radius: 16px 16px 0px 0px;
- background: linear-gradient(180deg, rgba(242, 244, 246, 1) 61%, rgba(255, 255, 255, 0) 100%);
- margin-top: -24rpx;
- padding: 32rpx;
- .statistics {
- border-radius: 8px;
- background-color: rgba(255, 255, 255, 1);
- box-shadow: 0px 1px 6px 0px rgba(0, 59, 142, 0.05);
- margin-top: 24rpx;
- padding: 40rpx;
- .title {
- display: flex;
- align-items: center;
- margin-bottom: 20rpx;
-
- .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;
- font-weight: bold;
- }
- .change {
- margin-left: 16rpx;
- font-size: 24rpx;
- color: #838383;
- }
- .check-all {
- margin-left: auto;
- color: rgba(131, 131, 131, 1);
- font-size: 24rpx;
- }
- }
- }
- // 用电量
- .statistics-e {
- .electricity {
- background-color: #fff;
- .item {
- padding: 16rpx 0;
- display: flex;
- align-items: center;
- border-bottom: 1px solid rgba(245, 245, 245, 1);
- .equipment {
- width: 30%;
-
- .equipment1 {
- color: rgba(51, 51, 51, 1);
- font-size: 32rpx;
- font-weight: bold;
- }
- .equipment2 {
- color: rgba(119, 119, 119, 1);
- }
- }
- .electricity {
- display: flex;
- justify-content: space-between;
- flex: 1;
- margin-left: 48rpx;
- text-align: center;
- .electricity-item {
- width: 33.3%;
- .number {
- color: rgba(51, 51, 51, 1);
- font-size: 32rpx;
- font-weight: bold;
- }
- .date {
- color: rgba(119, 119, 119, 1);
- margin-top: 4rpx;
- }
- }
- }
- }
- }
- }
- // 统计1
- .statistics-1 {
- display: flex;
- align-items: center;
- justify-content: space-between;
- .item {
- width: 330rpx;
- padding: 24rpx;
- box-shadow: 0px 1px 6px 0px rgba(0, 59, 142, 0.05);
- border-radius: 8px;
- background-color: rgba(255, 255, 255, 1);
- .item-top {
- display: flex;
- align-items: center;
- .img {
- width: 88rpx;
- height: 88rpx;
- margin-right: 24rpx;
- vertical-align: middle;
- }
- .number {
- color: rgba(51, 51, 51, 1);
- font-size: 32rpx;
- .normal {
- margin-bottom: 12rpx;
- }
- }
- }
- .total {
- margin-top: 28rpx;
- text-align: center;
- color: rgba(119, 119, 119, 1);
- }
- .total-number {
- color: #EE3138;
- margin: 0 8rpx;
- }
- }
- }
- // 统计2异常报警记录
- .statistics-2 {
- .abnormal-item {
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 16rpx;
- border-bottom: 1px solid rgba(245, 245, 245, 1);
- .item-title {
- color: rgba(51, 51, 51, 1);
- .img {
- width: 32rpx;
- height: 32rpx;
- margin-right: 8rpx;
- }
- .name {
- color: rgba(51, 51, 51, 1);
- }
- .date {
- color: rgba(119, 119, 119, 1);
- font-size: 24rpx;
- }
- }
- .item-value {
- text-align: right;
- .value1 {
- font-weight: bold;
- color: rgba(51, 51, 51, 1);
- }
- .value2 {
- color: rgba(119, 119, 119, 1);
- font-size: 24rpx;
- }
- }
- }
- }
- // 统计3设备实时监控
- .statistics-3 {
- .monitoring-item {
- padding: 16rpx 0;
- border-bottom: 1px solid rgba(245, 245, 245, 1);
- .item-title {
- display: flex;
- align-items: center;
- .text1 {
- color: rgba(51, 51, 51, 1);
- }
- .text2 {
- color: rgba(119, 119, 119, 1);
- font-size: 24rpx;
- margin-left: 8rpx;
- }
- }
- .state {
- margin-left: auto;
- display: flex;
- .state1,
- .state2 {
- display: flex;
- align-items: center;
- margin-left: 24rpx;
- }
- .img {
- width: 32rpx;
- height: 32rpx;
- vertical-align: middle;
- margin-right: 8rpx;
- }
- }
- // 监控信息
- .infos {
- margin-top: 8rpx;
- display: flex;
- align-items: center;
- justify-content: space-between;
- .infos-item {
- display: flex;
- align-items: center;
- }
- .text {
- margin-left: 4rpx;
- }
- }
- }
- }
- // 设备状态
- .statistics-4 {
- .chat-img {
- width: 100%;
- height: 620rpx;
- }
- }
- // 故障类型
- .statistics-5,
- .statistics-6 {
- .chat-img {
- width: 100%;
- height: 410rpx;
- }
- }
- // 异常设备排名
- .statistics-ranking {
- .total {
- color: rgba(16, 16, 16, 1);
- text {
- color: #1677FF;
- padding: 0 8rpx;
- }
- }
- .ranking-main {
- margin-top: 48rpx;
- border-radius: 16px;
- background-color: #fff;
- .item {
- display: flex;
- align-items: center;
- margin-bottom: 32rpx;
- .ranking {
- color: rgba(16, 16, 16, 1);
- font-weight: bold;
- }
- .icon {
- width: 72rpx;
- height: 72rpx;
- border-radius: 4px;
- background-color: rgba(219, 234, 255, 1);
- display: flex;
- align-items: center;
- justify-content: center;
- margin-left: 24rpx;
- .img {
- width: 48rpx;
- height: 48rpx;
- }
- }
- .name {
- margin-left: 16rpx;
- .name1 {
- color: rgba(51, 51, 51, 1);
- font-weight: bold;
- }
- .name2 {
- color: rgba(119, 119, 119, 1);
- font-size: 24rpx;
- margin-top: 4rpx;
- }
- }
- .time {
- color: rgba(16, 16, 16, 1);
- margin-left: auto;
- font-weight: bold;
- }
- }
- }
- // 查看全部排名
- .check-all {
- text-align: center;
- color: rgba(119, 119, 119, 1);
- font-size: 12px;
- }
- }
- }
- </style>
|