Browse Source

update solader map

develop
mbp 1 month ago
parent
commit
855e435344
  1. 6
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/HomeVector/index.vue
  2. 5
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/index.vue
  3. 2
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/map.js
  4. 604
      ruoyi-ui/src/views/JiHeExpressway/pages/maintenanceOperations/solar/index.vue
  5. 895
      ruoyi-ui/src/views/login.vue

6
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/HomeVector/index.vue

@ -24,17 +24,19 @@ export default {
data() { data() {
return { return {
activeIcon: null, activeIcon: null,
isshow: false
}; };
}, },
created() { created() {
this.activeIcon = window.showStakeText ? 'Vector' : null; this.activeIcon = window.showStakeText ? 'Vector' : null;
Vue.prototype.mapIns.pileIsShow("jhlayers", false); //Vue.prototype.mapIns.pileIsShow("jhlayers", false);
}, },
methods: { methods: {
handleClick(type) { handleClick(type) {
this.activeIcon = this.activeIcon === type ? null : type; this.activeIcon = this.activeIcon === type ? null : type;
this.isshow = !this.isshow;
Vue.prototype.isMapStatck = (this.activeIcon === type); Vue.prototype.isMapStatck = (this.activeIcon === type);
Vue.prototype.mapIns.pileIsShow("jhlayers", (this.activeIcon === type)); Vue.prototype.mapIns.pileIsShow("jhlayers", this.isshow);
if (this.activeIcon) window.showStakeText = true; if (this.activeIcon) window.showStakeText = true;
else window.showStakeText = false; else window.showStakeText = false;
// markerClusterIns.setData(); // markerClusterIns.setData();

5
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/index.vue

@ -460,7 +460,7 @@ export default {
display: flex; display: flex;
overflow: hidden; overflow: hidden;
gap: 24px; gap: 24px;
height: 30px; height: 30px !important;
.tabs-item { .tabs-item {
display: flex; display: flex;
@ -489,6 +489,9 @@ export default {
.bottom { .bottom {
display: flex; display: flex;
justify-content: end; justify-content: end;
position: absolute;
right: 20px;
bottom: 15px;
.cleared-btn { .cleared-btn {
// position: absolute; // position: absolute;

2
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/map.js

@ -171,8 +171,8 @@ export class MarkerCluster {
); );
await sleep(1000) await sleep(1000)
console.log('执行show完毕',aryPoints,'点位数组') console.log('执行show完毕',aryPoints,'点位数组')
Vue.prototype.mapIsLoading = false
} }
Vue.prototype.mapIsLoading = false
if(Vue.prototype.isMapStatck){ if(Vue.prototype.isMapStatck){
Vue.prototype.mapIns.pileIsShow("jhlayers", true); Vue.prototype.mapIns.pileIsShow("jhlayers", true);
} }

604
ruoyi-ui/src/views/JiHeExpressway/pages/maintenanceOperations/solar/index.vue

@ -1,5 +1,12 @@
<template> <template>
<div class="solar"> <div class="solar">
<gisMap2d ref="gisMap2dsolar" style="width:100vw;height:100vh"
:mapZoom = "mapZoom"
:mapCenter="mapCenter"
radarSliderBottom="33%"
radarSliderRight="14%"
mapBoxHeight="100vh" @clickPointEvent="clickPointEvent" widgetBoxDisplay="none"></gisMap2d>
<div class="solar_left"> <div class="solar_left">
<div> <div>
<Bg2 class="content-l-t"> <Bg2 class="content-l-t">
@ -8,70 +15,459 @@
</div> </div>
<div class="content-l-t-content"> <div class="content-l-t-content">
<div class="content-k1"> <div class="content-k1">
<div>当前累计发电量</div> <div>当年累计发电量</div>
<div class="content-kk"><div v-for="(item,index) in titles[0].value">{{item}}</div></div> <div class="content-kk">
<div>万度</div> <div v-for="(item, index) in titles0" :key="index">{{ item }}</div>
</div>
<div class="content-unit" style="margin-top: 10px;width:30px;text-align:right;"></div>
</div>
<div class="content-k1">
<div>当年累计用电量</div>
<div class="content-kk">
<div v-for="(item, index) in titles1" :key="index">{{ item }}</div>
</div>
<div class="content-unit" style="margin-top: 10px;width:30px;text-align:right;"></div>
</div>
<div class="content-k1">
<div>今日累计发电量</div>
<div class="content-ll">
<div class="content-llc">
<div v-for="(item, index) in titles2p" :key="index"></div>
</div>
</div>
<div class="content-unit" style="width:50px;text-align:right;">{{ titles2 }}</div>
</div>
<div class="content-k1">
<div>今日累计用电量</div>
<div class="content-ll">
<div class="content-llc">
<div v-for="(item, index) in titles3p" :key="index"></div>
</div>
</div>
<div class="content-unit" style="width:50px;text-align:right;">{{ titles3 }}</div>
</div>
</div>
</Bg2>
</div>
<div>
<Bg2 class="content-l-t">
<div class="focuse-header">
<div class="title">设备统计</div>
</div>
<div class="content-l-sec-content">
<div id="chartp1" class="secleft"></div>
<div class="secright">
<div class="d1"><span>{{device0}}</span> </div>
<div class="d2">设备总数</div>
<div class="d1"><span>{{device1}}</span> </div>
<div class="d2">放电异常设备</div>
</div>
</div>
</Bg2>
</div>
<div>
<Bg2 class="content-l-t">
<div class="focuse-header">
<div class="title">环境贡献</div>
</div>
<div class="content-l-third-content">
<div class="thirditem">
<img :src="require('@screen/images/solar/CO2.png')" />
<div class="thirdNum"><span>{{titles4}}</span> </div>
<div>CO减排</div>
</div>
<div class="thirditem">
<img :src="require('@screen/images/solar/tree.png')" />
<div class="thirdNum"><span>{{titles5}}</span> </div>
<div>等效植树</div>
</div>
<div class="thirditem">
<img :src="require('@screen/images/solar/coal.png')" />
<div class="thirdNum"><span>{{titles6}}</span> </div>
<div>节约标准煤</div>
</div> </div>
</div> </div>
</Bg2> </Bg2>
</div> </div>
<div>2</div>
<div>3</div>
</div> </div>
<div class="solar_right"> <div class="solar_right">
223 <div>
<Bg2 class="content-l-t" style="width:420px;">
<div class="focuse-header">
<div class="title2"></div>
</div>
<div class="content-box">
<div class="box-title " style="margin-top: 15px;">
<span>今日发电统计</span>
<span style="margin-left: 140px;">总计{{ chart1Total1 }}</span>
</div>
<div id="charts1" class="chart"></div>
<div class="box-title " style="margin-top: 15px;">
<span>今日用电统计</span>
<span style="margin-left: 140px;">总计{{ chart1Total1 }}</span>
</div>
<div id="charts2" class="chart"></div>
<div class="box-title " style="margin-top: 15px;">
<span>今日功率统计</span>
<span style="margin-left: 140px;">总计{{ chart1Total3 }}千瓦</span>
</div>
<div id="charts3" class="chart"></div>
</div> </div>
</Bg2>
</div>
</div>
<component :dialogData="dialogConfig.data" visible :selectedDevice="dialogConfig.data" :is="dialogConfig.component"
@change="handleHidden" @update:visible="handleHidden" />
<!-- <SolarEnergy v-if="info" :dialogData="info" :visible="visible"
@update:visible="handleHidden" ></SolarEnergy> -->
</div> </div>
</template> </template>
<script> <script>
import Vue from "vue";
import { gisMap2d } from 'gis-map-universal'
import Bg2 from "@screen/components/Decorations/bg-2.vue" import Bg2 from "@screen/components/Decorations/bg-2.vue"
import request from "@/utils/request"; import request from "@/utils/request";
import * as echarts from "echarts"; import * as echarts from "echarts";
import SolarEnergy from "./../../Home/components/Dialogs/SolarEnergy/index.vue";
const lnglat = [117.16515148266497,35.2797674572588]
export default { export default {
components: { components: {
Bg2 Bg2,
gisMap2d,
SolarEnergy,
}, },
name: "Soler", name: "Soler",
data() { data() {
return { return {
titles:[ mapBoxHeight: '100vh',
{icon:'total.png',label:'当年累计发电量',unit:'度',value:'0022.4512'}, mapZoom: '7.5', // '7.5' String
{icon:'used.png',label:'当年累计用电量',unit:'度',value:'-'}, mapCenter: lnglat, //[118.75, 36.46] Array
{icon:'CO2.png',label:'CO₂减排',unit:'kg',value:'-'},
{icon:'tree.png',label:'等效植树',unit:'棵',value:'-'}, dialogConfig:{
{icon:'coal.png',label:'节约标准煤',unit:'kg',value:'-'}, component: void 0,
{icon:'error.png',label:'放电异常设备',unit:'个',value:'-'}, data: void 0,
], },
chart1:null, titles0:'000000000',
chart2:null, titles1:'000000000',
chart3:null, titles2:'-',
chart1Total1:'-', titles2p:1,
chart1Total2:'-', titles3:'-',
chart1Total3:'-', titles3p:1,
loading:false, titles4: 0,
titles5: 0,
titles6: 0,
device0:0,
device1:0,
chartp1: null,
chart1: null,
chart2: null,
chart3: null,
chart1Total1: '-',
chart1Total2: '-',
chart1Total3: '-',
loading: false,
}; };
}, },
mounted() { mounted() {
this.initTotal();
this.initP1();
this.initChart();
this.initPoint();
}, },
methods: { methods: {
initPoint(){
request({
url: 'business/device/pileNumberQuery',
method: 'post',
data: {
deviceType: "15",
}
}).then(result => {
const aryPoints = [];
const sa = require(`@screen/images/layerb/路测设备/太阳能板_active.svg`)
const sb = require(`@screen/images/layerb/路测设备/太阳能板_fault.svg`)
for(let i of result.data){
aryPoints.push({
type: 'event', //
longitude: parseFloat(i.longitude), //
latitude: parseFloat(i.latitude), //
iconUrl: i.deviceState==='1'?sa:sb, //
offset: [0,-48],
size: [42,100],
GGoffsetX: 0,
GGoffsetY: -5,
GGimgOffset:[0,0],
GGimgsize:[42,103],
GGstakeOffsetY:45,
stakeOffsetY:25,
otherInfo: {
...i,
stake: i.stakeMark,
state: i.deviceState==="1"?1:0,
name: i.deviceName
}
})
}
this.$refs.gisMap2dsolar.addPointByArr(
{pointList:aryPoints}, //
'jhlayerssolar', // //.//.svg
true //
);
console.log('initPoint',result)
})
},
clickPointEvent(obj) {
this.dialogConfig = {
component: SolarEnergy,
data: obj.otherInfo
}
},
handleHidden(){
this.dialogConfig = {
component: null,
data: null
}
},
initTotal() {
request({
url: 'business/device/properties/latestOne',
method: 'get'
}).then(result => {
if (result.code != 200) return;
console.log('initTotal',result)
this.titles0 = result.data.theAccumulatedChargeOfTheYear.toString().padStart(9,'0'); //
this.titles1 = result.data.cumulativeElectricityConsumptionInTheYear.toString().padStart(9,'0');
this.titles2 = result.data.dailyAccumulatedCharge;
this.titles3 = result.data.cumulativeElectricityConsumptionOnTheDay;
let _titles2p = (result.data.dailyAccumulatedCharge/10000) * 24
if(_titles2p > 24){
_titles2p = 24;
} else if(_titles2p===0){
_titles2p = 1;
}
this.titles2p = parseInt(_titles2p);
let _titles3p = (result.data.cumulativeElectricityConsumptionOnTheDay/10000) * 24
if(_titles3p > 24){
_titles3p = 24;
} else if(_titles3p===0){
_titles3p = 1;
}
this.titles3p = parseInt(_titles3p);
this.titles4 = (result.data.standardCoal/1000).toFixed(2);
this.titles5 = result.data.equivalentTree;
this.titles6 = (result.data.carbonEmissionReduction/1000).toFixed(2);
})
},
initP1() {
request({
url: 'business/device/properties/solarDeviceStatistics',
method: 'get'
}).then(result => {
if (result.code != 200) return;
console.log('initP1',result)
this.device0 = result.data.size;
this.device1 = result.data.count;
const _chartsOptions = {
tooltip: {
trigger: 'item',
position: ['80%', '50%']
},
series: [
{
name: '设备统计',
type: 'pie',
radius: '70%',
center: ['50%', '50%'],
avoidLabelOverlap: false,
data: [
{ value: result.data.size-result.data.count, name: '正常设备总数', itemStyle: { color: '#38737f' } },
{ value: result.data.count, name: '异常设备数量', itemStyle: { color: '#9ff501' } },
],
label: {
show: false,
},
labelLine: {
show: false,
}
}
]
}
if (!this.chartp1) {
this.chartp1 = echarts.init(document.getElementById("chartp1"));
let option1 = JSON.parse(JSON.stringify(_chartsOptions));
this.chartp1.setOption(option1);
this.chartp1.resize();
}
})
},
initChart(){
const _chartsOptions = {
color:['#00bead'],
title: {
text: '度',
textStyle:{
color:'#E5E7E8',
fontSize: 15,
fontStyle:'normal'
},
top:'10px',
left: '10px'
},
tooltip: {
trigger: 'axis'
},
xAxis: {
type: 'category',
data: ['0点', '1点', '2点','3点', '4点','5点','6点','7点','8点', '9点','10点','11点',
'12点','13点','14点','15点','16点','17点','18点','19点','20点','21点','22点','23点'],
axisLine:{
show:true,
lineStyle:{
color:'#fff'
}
},
axisLabel: {
align: "center",
rotate: "1",
margin: 20,
textStyle: {
fontSize: 10,
color: "#E5E7E8",
}
},
},
yAxis: {
type: 'value',
axisLabel: {
show: false,
color: "#E5E7E8",
textStyle: {
fontSize: 10,
},
},
axisLine:{
show:true,
lineStyle:{
color:'#fff'
}
},
splitLine: {
show: false
},
},
grid: {
left: "40px",
right: "20px",
top: "10px",
bottom: "0px",
containLabel: true,
},
series: [
{
data: [],
type: 'line',
smooth: true
}
]
}
if(!this.chart1){
this.chart1 = echarts.init(document.getElementById("charts1"));
let option1 = JSON.parse(JSON.stringify(_chartsOptions));
request({
url: 'business/device/properties/history/oneDay/dailyAccumulatedCharge',
method: 'get'
}).then(result => {
console.log('chart1',result)
if (result.code != 200) return;
const data = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
let total = 0;
for(let i in result.data){
total += result.data[i]
const idx = parseInt(i.substr(11,2));
data[idx] = result.data[i];
}
this.chart1Total1 = total;
option1.series[0].data = data;
this.chart1.setOption(option1);
this.chart1.resize();
})
this.chart2 = echarts.init(document.getElementById("charts2"));
let option2 = JSON.parse(JSON.stringify(_chartsOptions));
request({
url: 'business/device/properties/history/oneDay/cumulativeElectricityConsumptionOnTheDay',
method: 'get'
}).then(result => {
if (result.code != 200) return;
const data = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
let total = 0;
for(let i in result.data){
total += result.data[i]
const idx = parseInt(i.substr(11,2));
data[idx] = result.data[i];
}
this.chart1Total2 = total;
option2.series[0].data = data;
this.chart2.setOption(option2);
this.chart2.resize();
})
//
this.chart3 = echarts.init(document.getElementById("charts3"));
let option3 = JSON.parse(JSON.stringify(_chartsOptions));
request({
url: 'business/device/properties/history/oneDay/generatingPower',
method: 'get'
}).then(result => {
if (result.code != 200) return;
const data = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
let total = 0;
for(let i in result.data){
total += result.data[i]
const idx = parseInt(i.substr(11,2));
data[idx] = result.data[i];
}
this.chart1Total3 = total;
option3.series[0].data = data;
this.chart3.setOption(option3);
this.chart3.resize()
})
}
window.addEventListener("resize", () => {
if(this.chart1){
this.chart1.resize();
this.chart2.resize();
this.chart3.resize();
}
});
}
}, },
}; };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
.solar{ .solar {
width: 100%; width: 100%;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
height: 100vh; height: 100vh;
.solar_left{
width: 480px; .solar_left {
margin-left:20px; position: absolute;
margin-top: 20px; width: 420px;
left: 20px;
top: 120px;
overflow: hidden; overflow: hidden;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@ -79,7 +475,11 @@ export default {
height: 100%; height: 100%;
gap: 10px; gap: 10px;
} }
.solar_right{
.solar_right {
position: absolute;
right: 20px;
top: 120px;
width: 480px; width: 480px;
overflow: hidden; overflow: hidden;
display: flex; display: flex;
@ -88,9 +488,9 @@ export default {
overflow: hidden; overflow: hidden;
height: 100%; height: 100%;
} }
} }
.content-l-t { .content-l-t {
::v-deep { ::v-deep {
.BackgroundClip.bg { .BackgroundClip.bg {
display: flex; display: flex;
@ -98,47 +498,175 @@ export default {
justify-content: space-around; justify-content: space-around;
} }
} }
.focuse-header { .focuse-header {
width: 100%; width: 100%;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
.title2 {
width: 220px;
height: 40px;
margin-top: 10px;
margin-left: 10px;
display: flex;
align-items: center;
background: url("~@screen/images/title/title-solar.png") no-repeat;
background-size: 100% 100%;
}
.title { .title {
font-size: 24px; font-size: 24px;
font-family: YouSheBiaoTiHei; font-family: YouSheBiaoTiHei;
font-weight: 400; font-weight: 400;
margin-left: 30px; margin-left: 30px;
background-image: -webkit-linear-gradient(bottom,#217176,#34adb6, #3fd6e1); margin-top: 5px;
background-image: -webkit-linear-gradient(bottom, #217176, #34adb6, #3fd6e1);
-webkit-background-clip: text; -webkit-background-clip: text;
-webkit-text-fill-color: transparent; -webkit-text-fill-color: transparent;
} }
} }
.content-l-sec-content {
display: flex;
flex-direction: row;
.secleft {
height: 180px;
width: 250px;
}
.secright {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
gap: 10px;
font-size: 14px;
.d1 {
font-size: 12px;
span {
font-size: 30px;
font-weight: bold;
color: #d3d51c;
}
}
}
}
.content-l-t-content { .content-l-t-content {
margin-top: 10px; margin-top: 10px;
padding: 20px; padding: 20px;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: flex-start; justify-content: flex-start;
gap: 10px 15px; gap: 15px 15px;
// justify-content: center; // justify-content: center;
flex:1; flex: 1;
flex-wrap: wrap; flex-wrap: wrap;
.content-k1{
display:flex; .content-k1 {
display: flex;
flex-direction: row; flex-direction: row;
.content-kk{
display:flex; .content-ll {
flex: 1;
width: 200px;
margin-right: 5px;
.content-llc {
display: flex;
flex-direction: row;
margin-left: 10px;
margin-top: 3px;
gap: 3px;
>div {
background-color: #9ff501;
width: 5px;
height: 17px;
}
}
}
.content-kk {
display: flex;
flex-direction: row; flex-direction: row;
margin-left: 10px; margin-left: 10px;
margin-right: 3px; margin-right: 3px;
gap: 3px; gap: 3px;
> div{
>div {
border: 1px solid #0c7f8a; border: 1px solid #0c7f8a;
padding: 2px 5px; padding: 2px 5px;
} }
} }
.content-unit {
font-size: 13px;
margin-left: 2px;
}
}
}
.content-l-third-content {
display: flex;
width: 100%;
margin: 20px 20px 20px 10px;
.thirditem {
flex: 1;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
gap: 10px;
font-size: 14px;
img {
width: 40px;
height: 40px;
margin-bottom: 10px;
}
span {
font-size: 30px;
font-weight: bold;
color: #d3d51c;
}
} }
} }
} }
.content-box {
flex: 1;
display: flex;
flex-direction: column;
}
.box-title {
width: 100%;
height: 26px;
margin: 7px;
background: url("~@screen/images/title/title_bg_002.png") no-repeat;
span {
display: inline-block;
margin-left: 35px;
font-size: 16px;
font-family: Source Han Sans SC, Source Han Sans SC;
font-weight: 500;
color: #ffffff;
}
}
.chart{
height: 155px;
}
</style> </style>

895
ruoyi-ui/src/views/login.vue

@ -1,569 +1,456 @@
<template> <template>
<div class="solar"> <div class="login">
<gisMap2d ref="gisMap2d" <div class="login-content">
:mapZoom = "mapZoom" <div class="login-l">
:mapCenter="mapCenter" <div class="logo"><img src="../assets/images/login/logo.png" /></div>
<span>齐鲁高速</span>
radarSliderBottom="33%" <span>济菏数智运营管理平台</span>
radarSliderRight="14%" </div>
:mapBoxHeight="height" @clickPointEvent="clickPointEvent" widgetBoxDisplay="none"></gisMap2d> <div class="login-r">
<div class="solar_left"> <span class="title">欢迎登录</span>
<div> <img class="line" src="../assets/images/login/139.png" />
<Bg2 class="content-l-t"> <el-form
<div class="focuse-header"> ref="loginForm"
<div class="title">重点数据</div> :model="loginForm"
</div> :rules="loginRules"
<div class="content-l-t-content"> class="login-form"
<div class="content-k1"> ><el-form-item prop="username">
<div>当年累计发电量</div> <el-input
<div class="content-kk"> v-model="loginForm.username"
<div v-for="(item, index) in titles[0].value">{{ item }}</div> type="text"
</div> auto-complete="off"
<div class="content-unit" style="margin-top: 0px;">万度</div> placeholder="请输入用户名"
</div> class="username"
<div class="content-k1"> >
<div>当年累计用电量</div> <img
<div class="content-kk"> slot="prefix"
<div v-for="(item, index) in titles[1].value">{{ item }}</div> src="../assets/images/login/user.png"
</div> class="el-input__icon input-icon"
<div class="content-unit">万度</div> />
</div> </el-input>
<div class="content-k1"> </el-form-item>
<div>今日累计发电量</div> <el-form-item prop="password">
<div class="content-ll"> <el-input
<div class="content-llc"> v-model="loginForm.password"
<div v-for="(item, index) in 10"></div> type="password"
</div> auto-complete="off"
</div> placeholder="请输入密码"
<div class="content-unit">{{ titles[2].value }}</div> @keyup.enter.native="handleLogin"
</div> class="password"
<div class="content-k1"> >
<div>今日累计用电量</div> <img
<div class="content-ll"> slot="prefix"
<div class="content-llc"> src="../assets/images/login/password.png"
<div v-for="(item, index) in 24"></div> class="el-input__icon input-icon"
</div> />
</div> </el-input>
<div class="content-unit">{{ titles[2].value }}</div> </el-form-item>
</div> <Verify
</div> @success="capctchaCheckSuccess"
</Bg2> :mode="'pop'"
</div> :captchaType="'blockPuzzle'"
<div> :imgSize="{ width: '330px', height: '155px' }"
<Bg2 class="content-l-t"> ref="verify"
<div class="focuse-header"> ></Verify>
<div class="title">设备统计</div> <el-checkbox v-model="loginForm.rememberMe">记住密码</el-checkbox>
</div> <el-form-item>
<div class="content-l-sec-content"> <el-button
<div id="chartp1" class="secleft"></div> class="btn"
<div class="secright"> :loading="loading"
<div class="d1"><span>1000</span> </div> size="medium"
<div class="d2">设备总数</div> type="goon"
<div class="d1"><span>10</span> </div> style="width: 100%"
<div class="d2">放电异常设备</div> @click.native.prevent="handleLogin"
</div> >
</div> <span v-if="!loading"> </span>
</Bg2> <span v-else> 中...</span>
</div> </el-button>
<div> <div style="float: right" v-if="register">
<Bg2 class="content-l-t"> <router-link class="link-type" :to="'/register'"
<div class="focuse-header"> >立即注册</router-link
<div class="title">环境贡献</div> >
</div> </div>
<div class="content-l-third-content"> </el-form-item>
<div class="thirditem"> </el-form>
<img :src="require('@screen/images/solar/CO2.png')" /> </div>
<div class="thirdNum"><span>88.88</span></div> </div>
<div>CO减排</div> <!-- 底部 -->
</div> <div class="el-login-footer">
<div class="thirditem"> <!-- <span>Copyright ©hamdell All Rights Reserved.</span> -->
<img :src="require('@screen/images/solar/tree.png')" />
<div class="thirdNum"><span>88.88</span></div>
<div>等效植树</div>
</div>
<div class="thirditem">
<img :src="require('@screen/images/solar/coal.png')" />
<div class="thirdNum"><span>8888</span>Kg</div>
<div>节约标准煤</div>
</div>
</div>
</Bg2>
</div>
</div>
<div class="solar_right">
<div>
<Bg2 class="content-l-t" style="width:420px;">
<div class="focuse-header">
<div class="title2"></div>
</div>
<div class="content-box">
<div class="box-title " style="margin-top: 15px;">
<span>今日发电统计</span>
<span style="margin-left: 140px;">总计{{ chart1Total1 }}</span>
</div>
<div id="charts1" class="chart"></div>
<div class="box-title " style="margin-top: 15px;">
<span>今日用电统计</span>
<span style="margin-left: 140px;">总计{{ chart1Total1 }}</span>
</div>
<div id="charts1" class="chart"></div>
<div class="box-title " style="margin-top: 15px;">
<span>今日功率统计</span>
<span style="margin-left: 140px;">总计{{ chart1Total3 }}千瓦</span>
</div>
<div id="charts1" class="chart"></div>
</div>
</Bg2>
</div>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import Cookies from "js-cookie";
import { encrypt, decrypt } from "@/utils/jsencrypt";
import Verify from "@/components/Verifition/Verify";
import { getCaptchaOnOff } from "@/api/login.js";
import { listOrder } from "@/api/payment/order";
import { getUserDeptId } from "@/api/system/user";
import { listTunnels } from "@/api/equipment/tunnel/api.js";
import { getConfigKey } from "@/api/system/config.js";
import Bg2 from "@screen/components/Decorations/bg-2.vue";
import Bg2 from "@screen/components/Decorations/bg-2.vue"
import request from "@/utils/request";
import * as echarts from "echarts";
export default { export default {
components: { components: { Verify, Bg2 },
Bg2 name: "Login",
},
name: "Soler",
data() { data() {
return { return {
titles: [ title: "", //
{ icon: 'total.png', label: '当年累计发电量', unit: '度', value: '0022.4512' }, cookiePassword: "",
{ icon: 'used.png', label: '当年累计用电量', unit: '度', value: '0022.4512' }, loginForm: {
{ icon: 'total.png', label: '今日累计发电量', unit: '度', value: '5555' }, // username: "admin",
{ icon: 'used.png', label: '今日累计用电量', unit: '度', value: '6666' }, // password: "dxc123!@#",
{ icon: 'CO2.png', label: 'CO₂减排', unit: 'kg', value: '7777' }, //dxc123!@#
{ icon: 'tree.png', label: '等效植树', unit: '棵', value: '8888' }, username: "",
{ icon: 'coal.png', label: '节约标准煤', unit: 'kg', value: '-' }, password: "",
{ icon: 'error.png', label: '放电异常设备', unit: '个', value: '-' }, rememberMe: false,
], code: "",
chartp1: null, uuid: "",
chart1: null,
chart2: null,
chart3: null,
chart1Total1: '-',
chart1Total2: '-',
chart1Total3: '-',
loading: false,
};
},
mounted() {
this.initTotal();
this.initChart();
},
methods: {
initTotal() {
this.initP1();
},
initP1() {
const _chartsOptions = {
tooltip: {
trigger: 'item',
position: ['80%', '50%']
}, },
series: [ loginRules: {
{ username: [
name: '设备统计', { required: true, trigger: "blur", message: "请输入您的账号" },
type: 'pie', ],
radius: '70%', password: [
center: ['50%', '50%'], { required: true, trigger: "blur", message: "请输入您的密码" },
avoidLabelOverlap: false,
data: [
{ value: 900, name: '正常设备总数', itemStyle: { color: '#38737f' } },
{ value: 100, name: '异常设备数量', itemStyle: { color: '#9ff501' } },
], ],
label: {
show: false,
},
labelLine: {
show: false,
}
}
]
}
if (!this.chartp1) {
this.chartp1 = echarts.init(document.getElementById("chartp1"));
let option1 = JSON.parse(JSON.stringify(_chartsOptions));
this.chartp1.setOption(option1);
this.chartp1.resize();
}
},
initChart(){
const _chartsOptions = {
color:['#00bead'],
title: {
text: '度',
textStyle:{
color:'#E5E7E8',
fontSize: 15,
fontStyle:'normal'
},
top:'10px',
left: '10px'
},
tooltip: {
trigger: 'axis'
},
xAxis: {
type: 'category',
data: ['0点', '1点', '2点','3点', '4点','5点','6点','7点','8点', '9点','10点','11点',
'12点','13点','14点','15点','16点','17点','18点','19点','20点','21点','22点','23点'],
axisLine:{
show:true,
lineStyle:{
color:'#fff'
}
},
axisTick:{
show:false,
}, },
axisLabel: { loading: false,
align: "center", //
rotate: "1", captchaOnOff: false,
margin: 20, //
textStyle: { register: false,
fontSize: 10, redirect: undefined,
color: "#E5E7E8", };
}
}, },
watch: {
$route: {
handler: function (route) {
this.redirect = route.query && route.query.redirect;
}, },
yAxis: { immediate: true,
type: 'value',
axisLabel: {
show: false,
color: "#E5E7E8",
textStyle: {
fontSize: 10,
}, },
}, },
axisLine:{ created() {
show:true, this.getCookie();
lineStyle:{ //this.getCaptchaOnOffFun();
color:'#fff' this.title = systemConfig.title(systemConfig.systemType);
}
}, },
splitLine: { methods: {
show: false //
getCaptchaOnOffFun() {
getCaptchaOnOff().then((response) => {
this.captchaOnOff = response.captchaOnOff;
});
}, },
//
capctchaCheckSuccess(params) {
this.loginForm.code = params.captchaVerification;
this.loading = true;
console.log(this.loginForm.rememberMe, "=======================");
if (this.loginForm.rememberMe == true) {
Cookies.set("username", this.loginForm.username, { expires: 30 });
Cookies.set("password", encrypt(this.loginForm.password), {
expires: 30,
});
Cookies.set("rememberMe", this.loginForm.rememberMe, { expires: 30 });
} else {
Cookies.remove("username");
Cookies.remove("password");
Cookies.remove("rememberMe");
}
this.$store
.dispatch("Login", this.loginForm)
.then(() => {
this.$router.push({ path: this.redirect || "/" }).catch(() => {});
})
.catch(() => {
this.loading = false;
});
}, },
grid: { getCookie() {
left: "40px", const username = Cookies.get("username");
right: "20px", const password = Cookies.get("password");
top: "10px", const rememberMe = Cookies.get("rememberMe");
bottom: "0px", this.loginForm = {
containLabel: true, username: username === undefined ? this.loginForm.username : username,
password:
password === undefined ? this.loginForm.password : decrypt(password),
rememberMe: rememberMe === undefined ? false : Boolean(rememberMe),
};
}, },
series: [ handleLogin() {
{ if (this.captchaOnOff) {
data: [], this.$refs.loginForm.validate((valid) => {
type: 'line', if (valid) {
smooth: true this.$refs.verify.show();
}
]
}
this.chart1 = echarts.init(document.getElementById("charts1"));
let option1 = JSON.parse(JSON.stringify(_chartsOptions));
const data = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
let total = 0;
this.chart1Total1 = total;
option1.series[0].data = data;
this.chart1.setOption(option1);
this.chart1.resize();
return;
if(!this.chart1){
this.chart1 = echarts.init(document.getElementById("charts1"));
let option1 = JSON.parse(JSON.stringify(_chartsOptions));
request({
url: 'business/device/properties/history/oneDay/dailyAccumulatedCharge',
method: 'get'
}).then(result => {
if (result.code != 200) return;
const data = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
let total = 0;
for(let i in result.data){
total += result.data[i]
const idx = parseInt(i.substr(11,2));
data[idx] = result.data[i];
}
this.chart1Total1 = total;
option1.series[0].data = data;
this.chart1.setOption(option1);
this.chart1.resize();
})
this.chart2 = echarts.init(document.getElementById("charts2"));
let option2 = JSON.parse(JSON.stringify(_chartsOptions));
request({
url: 'business/device/properties/history/oneDay/cumulativeElectricityConsumptionOnTheDay',
method: 'get'
}).then(result => {
if (result.code != 200) return;
const data = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
let total = 0;
for(let i in result.data){
total += result.data[i]
const idx = parseInt(i.substr(11,2));
data[idx] = result.data[i];
} }
this.chart1Total2 = total; });
option2.series[0].data = data; } else {
this.chart2.setOption(option2); if (this.loginForm.rememberMe == true) {
this.chart2.resize(); Cookies.set("username", this.loginForm.username, { expires: 30 });
}) Cookies.set("password", encrypt(this.loginForm.password), {
// expires: 30,
this.chart3 = echarts.init(document.getElementById("charts3")); });
let option3 = JSON.parse(JSON.stringify(_chartsOptions)); Cookies.set("rememberMe", this.loginForm.rememberMe, { expires: 30 });
request({ } else {
url: 'business/device/properties/history/oneDay/generatingPower', Cookies.remove("username");
method: 'get' Cookies.remove("password");
}).then(result => { Cookies.remove("rememberMe");
if (result.code != 200) return; }
const data = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
let total = 0; this.$store
for(let i in result.data){ .dispatch("Login", this.loginForm)
total += result.data[i] .then(() => {
const idx = parseInt(i.substr(11,2)); this.$store.commit("menu/resetRecent");
data[idx] = result.data[i]; // this.$router.push({ path: this.redirect || "/" }).catch(() => {});
} this.$router.push({ path: "/" }).catch(() => {});
this.chart1Total3 = total; // this.getManageStation();
option3.series[0].data = data;
this.chart3.setOption(option3);
this.chart3.resize()
}) })
.catch(() => {
} this.loading = false;
window.addEventListener("resize", () => {
if(this.chart1){
this.chart1.resize();
this.chart2.resize();
this.chart3.resize();
}
}); });
} }
},
getManageStation() {
getConfigKey("sd.moduleSwitch").then((res) => {
console.log(res, "管理站01");
this.$cache.local.set("manageStation", res.msg);
});
getConfigKey("sd.navigationBar").then((res) => {
console.log(res, "res");
let sideTheme = "theme-blue";
if (res.msg == "0") {
sideTheme = "theme-dark";
} else {
sideTheme = "theme-blue";
}
// console.log(res, "");
this.$cache.local.set("navigationBar", res.msg);
this.$store.dispatch("settings/changeSetting", {
key: "sideTheme",
value: sideTheme,
});
// this.sideTheme = val;
this.$cache.local.set(
"layout-setting",
`{
"topNav":${this.$store.state.settings.topNav},
"tagsView":${this.$store.state.settings.tagsView},
"weatherView":${this.$store.state.settings.weatherView},
"fixedHeader":${this.$store.state.settings.fixedHeader},
"sidebarLogo":${this.$store.state.settings.sidebarLogo},
"dynamicTitle":${this.$store.state.settings.dynamicTitle},
"sideTheme":"${sideTheme}",
"theme":"${this.$store.state.settings.theme}"
}`
);
// console.log(this.$store.state.settings.sideTheme)
});
},
}, },
}; };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
.solar { ::v-deep .el-input__inner {
width: 100%; background-color: #fff !important;
display: flex; height: 34px;
justify-content: space-between; font-size: 14px;
height: 100vh; font-weight: 400;
color: #999999;
border: 1px solid rgba(0, 145, 67, 0.5);
caret-color: #39adff;
// margin-left: 20px;
}
.solar_left { ::v-deep .el-checkbox__label {
position: absolute; color: #999;
width: 420px; font-size: 12px !important;
left: 20px; font-weight: 400;
top: 20px; color: #999 !important;
overflow: hidden; margin-bottom: 10px;
display: flex; margin-top: 6px;
flex-direction: column; }
overflow: hidden;
height: 100%;
gap: 10px;
}
.solar_right { ::v-deep .el-input__inner::placeholder {
position: absolute; color: #999999;
right: 20px; }
top: 20px;
width: 480px; .login {
overflow: hidden; position: relative;
display: flex;
flex-direction: column;
align-items: flex-end;
overflow: hidden;
height: 100%; height: 100%;
} background-image: url("../assets/images/login/login-background.png");
// background-size: 100% auto;
background-repeat: no-repeat;
background-size: 100% 100%;
} }
.content-l-t { .login-content {
::v-deep { position: absolute;
.BackgroundClip.bg { left: 50%;
top: 367px;
transform: translateX(-50%);
width: 700px;
height: 367px;
background: rgba(10, 82, 123, 0.6);
display: flex; display: flex;
flex-direction: column; .login-l {
justify-content: space-around; // width: 300px;
} margin-top: 42px;
} margin-left: 25px;
.logo {
.focuse-header { width: 177px;
height: 135px;
margin: auto;
margin-bottom: 10px;
img {
width: 100%; width: 100%;
display: flex; height: 100%;
align-items: center;
justify-content: space-between;
.title2 {
width: 220px;
height: 40px;
margin-top: 10px;
margin-left: 10px;
display: flex;
align-items: center;
background: url("~@screen/images/title/title-solar.png") no-repeat;
background-size: 100% 100%;
}
.title {
font-size: 24px;
font-family: YouSheBiaoTiHei;
font-weight: 400;
margin-left: 30px;
margin-top: 5px;
background-image: -webkit-linear-gradient(bottom, #217176, #34adb6, #3fd6e1);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
} }
.content-l-sec-content {
display: flex;
flex-direction: row;
.secleft {
height: 180px;
width: 250px;
} }
.secright {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
gap: 10px;
font-size: 14px;
.d1 {
font-size: 12px;
span { span {
display: block;
font-family: PingFang;
font-weight: 600;
font-size: 30px; font-size: 30px;
font-weight: bold; color: rgba(42, 217, 253, 0.7);
color: #d3d51c; line-height: 35px;
} text-align: center;
} margin-top: 20px;
} }
} }
.login-r {
width: 320px;
height: 290px;
margin-right: 27px;
margin-top: 42px;
margin-left: 20px;
background: #c9e5eb;
padding: 25px 22px;
.content-l-t-content { .title {
margin-top: 10px; display: block;
padding: 20px; width: 100%;
font-family: PingFang;
font-weight: 600;
font-size: 28px;
color: #009143;
text-align: center;
}
.line {
width: 210px;
height: 3px;
display: block;
margin: auto;
margin-bottom: 20px;
}
.btn {
margin: auto;
width: 155px;
height: 34px;
background: #009143;
border-radius: 1px;
color: #fff;
font-size: 16px;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: flex-start; justify-content: center;
gap: 15px 15px; margin-top: 5px;
// justify-content: center;
flex: 1;
flex-wrap: wrap;
.content-k1 {
display: flex;
flex-direction: row;
.content-ll {
flex: 1;
width: 200px;
margin-right: 5px;
.content-llc {
display: flex;
flex-direction: row;
margin-left: 10px;
margin-top: 3px;
gap: 3px;
>div {
background-color: #9ff501;
width: 5px;
height: 17px;
}
} }
} }
// .loginTitle {
// display: inline-flex;
// width: 100%;
// height: 45px;
// font-size: 30px;
// font-family: Source Han Sans CN, Source Han Sans CN;
// font-weight: 500;
// color: #ffffff;
// justify-content: center;
// align-items: center;
// }
.el-input {
width: 275px;
height: 36px;
border-radius: 2px;
background: #fff;
padding-left: 20px;
.content-kk { ::v-deep .el-input__inner {
display: flex; font-size: 14px !important;
flex-direction: row;
margin-left: 10px;
margin-right: 3px;
gap: 3px;
>div {
border: 1px solid #0c7f8a;
padding: 2px 5px;
}
} }
.content-unit { input {
font-size: 13px; border: 0;
height: 36px;
margin-left: 2px;
} }
} }
}
.content-l-third-content {
display: flex;
width: 100%;
margin: 20px 20px 20px 10px;
.thirditem {
flex: 1;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
gap: 10px;
font-size: 14px;
img { .input-icon {
width: 40px; height: 20px;
height: 40px; width: 20px;
margin-bottom: 10px; margin-right: 10px;
position: relative;
left: 10px;
top: 7px;
} }
}
span { // .login-tip {
font-size: 30px; // font-size: 13px;
font-weight: bold; // text-align: center;
color: #d3d51c; // color: #bfbfbf;
} // }
} // .login-code {
// width: 37%;
// height: 35px;
// float: right;
// img {
// cursor: pointer;
// vertical-align: middle;
// }
// }
.login-form{
::v-deep .el-form-item{
margin-bottom: 22px;
} }
} }
.content-box { .el-login-footer {
flex: 1; height: 40px;
display: flex; line-height: 40px;
flex-direction: column; position: fixed;
bottom: 0;
width: 100%;
text-align: center;
color: #fff;
font-family: Arial;
font-size: 12px;
letter-spacing: 1px;
}
.login-code-img {
height: 35px;
} }
.box-title { /* 重置按钮 */
width: 100%; .el-button--goon {
height: 26px; font-size: 24px;
margin: 7px; font-weight: 400;
background: url("~@screen/images/title/title_bg_002.png") no-repeat; color: #fff;
width: 380px;
height: 55px;
background: #07caf6;
border-radius: 4px;
opacity: 1;
border: none;
}
span { .el-button--goon:hover {
display: inline-block;
margin-left: 35px;
font-size: 16px;
font-family: Source Han Sans SC, Source Han Sans SC;
font-weight: 500;
color: #ffffff;
}
} }
.chart{
height: 155px;
}
</style> </style>
Loading…
Cancel
Save