Browse Source

2024-10-19

develop
王钦 1 month ago
parent
commit
dbc9be06fb
  1. BIN
      ruoyi-ui/src/views/JiHeExpressway/images/title/title-solar.png
  2. 912
      ruoyi-ui/src/views/login.vue

BIN
ruoyi-ui/src/views/JiHeExpressway/images/title/title-solar.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

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

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

Loading…
Cancel
Save