Revert "fix:排放系统登陆页面更改样式"

This reverts commit 89f05ee8e8.
This commit is contained in:
caoqianming 2024-04-16 16:54:37 +08:00
parent 373b461549
commit 2ce50e7bac
2 changed files with 252 additions and 404 deletions

View File

@ -1,18 +1,7 @@
<template> <template>
<el-form <el-form ref="loginForm" :model="form" :rules="rules" label-width="0" size="large">
ref="loginForm"
:model="form"
:rules="rules"
label-width="0"
size="large"
>
<el-form-item prop="user"> <el-form-item prop="user">
<el-input <el-input v-model="form.user" prefix-icon="el-icon-user" clearable :placeholder="$t('login.userPlaceholder')">
v-model="form.user"
prefix-icon="el-icon-user"
clearable
:placeholder="$t('login.userPlaceholder')"
>
<!-- <template #append> <!-- <template #append>
<el-select v-model="userType" style="width: 130px"> <el-select v-model="userType" style="width: 130px">
<el-option :label="$t('login.admin')" value="admin"></el-option> <el-option :label="$t('login.admin')" value="admin"></el-option>
@ -22,44 +11,20 @@
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item prop="password"> <el-form-item prop="password">
<el-input <el-input v-model="form.password" prefix-icon="el-icon-lock" clearable show-password
v-model="form.password" :placeholder="$t('login.PWPlaceholder')" @keyup.enter="login"></el-input>
prefix-icon="el-icon-lock"
clearable
show-password
:placeholder="$t('login.PWPlaceholder')"
@keyup.enter="login"
></el-input>
</el-form-item> </el-form-item>
<el-form-item style="margin-bottom: 10px"> <el-form-item style="margin-bottom: 10px">
<el-col :span="12" class="login-reg"> <el-col :span="12" class="login-reg">
<!-- <el-link @click="visitors">{{$t('login.fangke')}}</el-link> --> <!-- <el-link @click="visitors">{{$t('login.fangke')}}</el-link> -->
</el-col> </el-col>
<el-col :span="12" class="login-forgot"> <el-col :span="12" class="login-forgot">
<router-link to="/reset_password" <router-link to="/reset_password">{{ $t("login.forgetPassword") }}</router-link>
>{{ $t("login.forgetPassword") }}</router-link
>
</el-col> </el-col>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button <el-button type="primary" style="width: 100%" :loading="islogin" round @click="login">{{ $t("login.signIn")
v-if="deptCodePf" }}</el-button>
type="success"
style="width: 100%"
:loading="islogin"
round
@click="login"
>{{ $t("login.signIn") }}</el-button
>
<el-button
v-else
type="primary"
style="width: 100%"
:loading="islogin"
round
@click="login"
>{{ $t("login.signIn") }}</el-button
>
</el-form-item> </el-form-item>
<!-- <div class="login-reg"> <!-- <div class="login-reg">
@ -74,22 +39,14 @@
<el-row> <el-row>
<el-col :md="24" :sm="24"> <el-col :md="24" :sm="24">
<el-form-item label="姓名" prop="name"> <el-form-item label="姓名" prop="name">
<el-input <el-input v-model="visitorform.name" placeholder="请输入姓名" clearable></el-input>
v-model="visitorform.name"
placeholder="请输入姓名"
clearable
></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :md="24" :sm="24"> <el-col :md="24" :sm="24">
<el-form-item label="用户名" prop="username"> <el-form-item label="用户名" prop="username">
<el-input <el-input v-model="visitorform.username" placeholder="请输入用户名" clearable></el-input>
v-model="visitorform.username"
placeholder="请输入用户名"
clearable
></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -105,7 +62,6 @@
export default { export default {
data() { data() {
return { return {
deptCodePf: false,
redirect: undefined, redirect: undefined,
userType: "admin", userType: "admin",
visitorsdialog: false, visitorsdialog: false,
@ -151,20 +107,11 @@ export default {
immediate: true, immediate: true,
}, },
}, },
mounted() { mounted() { },
let base_info = this.$TOOL.data.get("BASE_INFO");
if (base_info) {
if (base_info.base.base_name_short.indexOf("智慧环保") != -1) {
this.deptCodePf = true;
}
}
},
methods: { methods: {
async login() { async login() {
let that = this; let that = this;
var validate = await that.$refs.loginForm var validate = await that.$refs.loginForm.validate().catch(() => { });
.validate()
.catch(() => {});
if (!validate) { if (!validate) {
return false; return false;
} }
@ -185,22 +132,15 @@ export default {
that.$TOOL.data.set("USER_INFO", res1); that.$TOOL.data.set("USER_INFO", res1);
that.$TOOL.data.set("PERMISSIONS", Object.keys(res1.perms)); that.$TOOL.data.set("PERMISSIONS", Object.keys(res1.perms));
let base_dashboard = let base_dashboard = this.$TOOL.data.get('BASE_INFO').base.base_dashboard;
this.$TOOL.data.get("BASE_INFO").base.base_dashboard;
if (this.redirect) { if (this.redirect) {
base_dashboard = this.redirect; base_dashboard = this.redirect;
} else if (
base_dashboard == null ||
base_dashboard == undefined
) {
base_dashboard = "/dashboard";
} }
if ( else if (base_dashboard == null || base_dashboard == undefined) {
this.$TOOL.data base_dashboard = '/dashboard'
.get("BASE_INFO") }
.base.base_name_short.indexOf("曲阳") != -1 if (this.$TOOL.data.get('BASE_INFO').base.base_name_short.indexOf('曲阳') != -1) {
) { if (res1.type === 'employee') {
if (res1.type === "employee") {
this.$router.replace({ this.$router.replace({
path: base_dashboard, path: base_dashboard,
}); });
@ -211,19 +151,14 @@ export default {
} }
that.$message.success("Login Success 登录成功"); that.$message.success("Login Success 登录成功");
that.islogin = false; that.islogin = false;
that.$API.am.area.list that.$API.am.area.list.req({ page_size: 999 }).then(res => {
.req({ page_size: 999 })
.then((res) => {
if (res.err_msg) { if (res.err_msg) {
} else { } else {
debugger; debugger;
let areaList = res.results; let areaList = res.results;
that.$TOOL.data.set( that.$TOOL.data.set("qyjyAreaList", areaList);
"qyjyAreaList",
areaList
);
} }
}); })
} else { } else {
this.$router.replace({ this.$router.replace({
path: base_dashboard, path: base_dashboard,
@ -254,7 +189,7 @@ export default {
.catch((err) => { .catch((err) => {
return err; return err;
}); });
}, }
}, },
}; };
</script> </script>

View File

@ -1,22 +1,8 @@
<template> <template>
<div :class="{ 'login-container': deptCodePf }"> <div class="login_bg">
<!-- <div class="right-con" :style="{backgroundImage: 'url(' + baseConfig.base_logo + ')'}"></div> --> <!-- <div class="right-con" :style="{backgroundImage: 'url(' + baseConfig.base_logo + ')'}"></div> -->
<div class="login_adv" v-if="deptCodePf"> <div class="login_adv"
<div class="login_adv__title"> :style="{ 'background-image': baseConfig.base_logo_side == '' ? 'url(img/logo_side.png)' : 'url(' + baseConfig.base_logo_side + ')' }">
<h2 v-if="baseConfig.base_name">{{ baseConfig.base_name }}</h2>
</div>
<div class="login_adv__mask"></div>
</div>
<div
class="login_adv"
v-else
:style="{
'background-image':
baseConfig.base_logo_side == ''
? 'url(img/logo_side.png)'
: 'url(' + baseConfig.base_logo_side + ')',
}"
>
<div class="login_adv__title"> <div class="login_adv__title">
<h2 v-if="baseConfig.base_name">{{ baseConfig.base_name }}</h2> <h2 v-if="baseConfig.base_name">{{ baseConfig.base_name }}</h2>
</div> </div>
@ -25,32 +11,19 @@
© {{$CONFIG.APP_NAMES}} {{$CONFIG.APP_VER}} © {{$CONFIG.APP_NAMES}} {{$CONFIG.APP_VER}}
</div> --> </div> -->
</div> </div>
<div class="login_main">
<div class="login_main" style="height: 100%; z-index: 10">
<div class="login_config"> <div class="login_config">
<el-button <el-button :icon="config.dark ? 'el-icon-sunny' : 'el-icon-moon'" circle type="info"
:icon="config.dark ? 'el-icon-sunny' : 'el-icon-moon'" @click="configDark"></el-button>
circle
type="info"
@click="configDark"
></el-button>
</div> </div>
<div <div class="login-form">
:class="[deptCodePf ? 'login-form_huanbao' : '', 'login-form']"
>
<div class="login-header"> <div class="login-header">
<div class="logo" v-if="baseConfig.name == 'photon'"> <div class="logo" v-if="baseConfig.name == 'photon'">
<img <img id="photonImg" :alt="baseConfig.base_login" :src="baseConfig.base_login">
id="photonImg"
:alt="baseConfig.base_login"
:src="baseConfig.base_login"
/>
</div> </div>
<div class="logo" v-else> <div class="logo" v-else>
<img <img :alt="baseConfig.base_name_short" :src="baseConfig.base_logo">
:alt="baseConfig.base_name_short"
:src="baseConfig.base_logo"
/>
<label>{{ baseConfig.base_name }}</label> <label>{{ baseConfig.base_name }}</label>
</div> </div>
</div> </div>
@ -62,6 +35,7 @@
<el-tab-pane :label="$t('login.mobileLogin')" lazy> <el-tab-pane :label="$t('login.mobileLogin')" lazy>
<phone-form></phone-form> <phone-form></phone-form>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
<!-- 微信登陆 <!-- 微信登陆
<el-divider>{{ $t('login.signInOther') }}</el-divider> <el-divider>{{ $t('login.signInOther') }}</el-divider>
@ -69,20 +43,11 @@
<el-button type="success" icon="sc-icon-wechat" circle @click="wechatLogin"></el-button> <el-button type="success" icon="sc-icon-wechat" circle @click="wechatLogin"></el-button>
</div> </div>
--> -->
<div <div class="login-oauth" v-if="baseConfig.base_name == '曲阳金隅安全智能管控平台'">
class="login-oauth" <el-button type="default" @click="appDown">安卓APP</el-button>
v-if="baseConfig.base_name == '曲阳金隅安全智能管控平台'"
>
<el-button type="default" @click="appDown"
>安卓APP</el-button
>
<el-button type="default" @click="h5Show">H5访问</el-button> <el-button type="default" @click="h5Show">H5访问</el-button>
<el-button <el-button type="primary" @click="MonitorOpen"
type="primary" style="background-color:orange;border-color:orange">监控视频</el-button>
@click="MonitorOpen"
style="background-color: orange; border-color: orange"
>监控视频</el-button
>
</div> </div>
<!-- <div class="login-oauth" v-else> <!-- <div class="login-oauth" v-else>
<el-button type="default" @click="faceLogin">刷脸登录</el-button> <el-button type="default" @click="faceLogin">刷脸登录</el-button>
@ -90,38 +55,17 @@
</div> </div>
</div> </div>
</div> </div>
<el-dialog <el-dialog v-model="showWechatLogin" :title="$t('login.wechatLoginTitle')" :width="400" destroy-on-close>
v-model="showWechatLogin"
:title="$t('login.wechatLoginTitle')"
:width="400"
destroy-on-close
>
<div class="qrCodeLogin"> <div class="qrCodeLogin">
<sc-qr-code <sc-qr-code class="qrCode" :text="WechatLoginCode" :size="200"></sc-qr-code>
class="qrCode" <p class="msg">{{ $tc('login.wechatLoginMsg', 1) }}<br />{{ $tc('login.wechatLoginMsg', 2) }}</p>
:text="WechatLoginCode"
:size="200"
></sc-qr-code>
<p class="msg">
{{ $tc("login.wechatLoginMsg", 1) }}<br />{{
$tc("login.wechatLoginMsg", 2)
}}
</p>
<div class="qrCodeLogin-result" v-if="isWechatLoginResult"> <div class="qrCodeLogin-result" v-if="isWechatLoginResult">
<el-result <el-result icon="success" :title="$tc('login.wechatLoginResult', 1)"
icon="success" :sub-title="$tc('login.wechatLoginResult', 2)"></el-result>
:title="$tc('login.wechatLoginResult', 1)"
:sub-title="$tc('login.wechatLoginResult', 2)"
></el-result>
</div> </div>
</div> </div>
</el-dialog> </el-dialog>
<el-dialog <el-dialog v-model="showApp" title="安卓APP下载" :width="400" destroy-on-close>
v-model="showApp"
title="安卓APP下载"
:width="400"
destroy-on-close
>
<div class="qrCodeLogin"> <div class="qrCodeLogin">
<sc-qr-code class="qrCode" :size="200" :text="appUrl"></sc-qr-code> <sc-qr-code class="qrCode" :size="200" :text="appUrl"></sc-qr-code>
</div> </div>
@ -131,105 +75,94 @@
<sc-qr-code class="qrCode" :size="200" :text="h5Url"></sc-qr-code> <sc-qr-code class="qrCode" :size="200" :text="h5Url"></sc-qr-code>
</div> </div>
</el-dialog> </el-dialog>
<el-dialog <el-dialog v-model="limitedPhoto" @close="closeCamera" id="loginFaceWrap" style="width: 664px;">
v-model="limitedPhoto" <h1 style="text-align: center;">人脸登录</h1>
@close="closeCamera"
id="loginFaceWrap"
style="width: 664px"
>
<h1 style="text-align: center">人脸登录</h1>
<div class="testTracking"> <div class="testTracking">
<faceLogin <faceLogin ref="faceTracking" @close="closeCamera" name="faceLogin" @func="getMsgFormSon"></faceLogin>
ref="faceTracking"
@close="closeCamera"
name="faceLogin"
@func="getMsgFormSon"
></faceLogin>
</div> </div>
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
import { Monitor } from "@element-plus/icons-vue"; import { Monitor } from '@element-plus/icons-vue'
import passwordForm from "./components/passwordForm"; import passwordForm from './components/passwordForm'
import phoneForm from "./components/phoneForm"; import phoneForm from './components/phoneForm'
import faceLogin from "@/components/faceLogin"; import faceLogin from '@/components/faceLogin'
export default { export default {
components: { components: {
passwordForm, passwordForm,
phoneForm, phoneForm,
faceLogin, faceLogin
}, },
data() { data() {
return { return {
config: { config: {
lang: this.$TOOL.data.get("APP_LANG") || this.$CONFIG.LANG, lang: this.$TOOL.data.get('APP_LANG') || this.$CONFIG.LANG,
dark: this.$TOOL.data.get("APP_DARK") || false, dark: this.$TOOL.data.get('APP_DARK') || false
}, },
lang: [ lang: [
{ {
name: "简体中文", name: '简体中文',
value: "zh-cn", value: 'zh-cn',
}, },
{ {
name: "English", name: 'English',
value: "en", value: 'en',
}, }
], ],
deptCodePf: false,
baseConfig: {}, baseConfig: {},
limitedPhoto: false, limitedPhoto: false,
WechatLoginCode: "", WechatLoginCode: "",
showWechatLogin: false, showWechatLogin: false,
isWechatLoginResult: false, isWechatLoginResult: false,
showApp: false, showApp: false,
appUrl: "http://222.222.144.147:6013/media/zc_ehs.apk", appUrl: 'http://222.222.144.147:6013/media/zc_ehs.apk',
showH5: false, showH5: false,
h5Url: "http://222.222.144.147:6013/h5/", h5Url: 'http://222.222.144.147:6013/h5/'
};
},
watch: {
"config.dark"(val) {
if (val) {
document.documentElement.classList.add("dark");
this.$TOOL.data.set("APP_DARK", val);
} else {
document.documentElement.classList.remove("dark");
this.$TOOL.data.remove("APP_DARK");
} }
}, },
"config.lang"(val) { watch: {
this.$i18n.locale = val; 'config.dark'(val) {
this.$TOOL.data.set("APP_LANG", val); if (val) {
document.documentElement.classList.add("dark")
this.$TOOL.data.set("APP_DARK", val)
} else {
document.documentElement.classList.remove("dark")
this.$TOOL.data.remove("APP_DARK")
}
}, },
'config.lang'(val) {
this.$i18n.locale = val
this.$TOOL.data.set("APP_LANG", val)
}
}, },
created: function () { created: function () {
this.$TOOL.data.remove("TOKEN"); this.$TOOL.data.remove("TOKEN")
this.$TOOL.data.remove("TOKEN_TIME"); this.$TOOL.data.remove("TOKEN_TIME")
this.$TOOL.data.remove("TOKEN_REFRESH"); this.$TOOL.data.remove("TOKEN_REFRESH")
this.$TOOL.data.remove("USER_INFO"); this.$TOOL.data.remove("USER_INFO")
this.$TOOL.data.remove("MENU"); this.$TOOL.data.remove("MENU")
this.$TOOL.data.remove("PERMISSIONS"); this.$TOOL.data.remove("PERMISSIONS")
this.$TOOL.data.remove("DASHBOARDGRID"); this.$TOOL.data.remove("DASHBOARDGRID")
this.$TOOL.data.remove("grid"); this.$TOOL.data.remove("grid")
this.$store.commit("clearViewTags"); this.$store.commit("clearViewTags")
this.$store.commit("clearKeepLive"); this.$store.commit("clearKeepLive")
this.$store.commit("clearIframeList"); this.$store.commit("clearIframeList")
//console.log('%c SCUI %c Gitee: https://gitee.com/lolicode/scui', 'background:#666;color:#fff;border-radius:3px;', '') //console.log('%c SCUI %c Gitee: https://gitee.com/lolicode/scui', 'background:#666;color:#fff;border-radius:3px;', '')
}, },
mounted() { mounted() {
let url1 = window.location.href; let url1 = window.location.href;
this.project_code = url1.split("/")[3]; this.project_code = url1.split('/')[3];
this.getDept(); this.getDept();
}, },
methods: { methods: {
getDept() { getDept() {
let that = this; let that = this;
let req = {}; let req = {};
if (that.project_code == undefined || that.project_code == "#") { if (that.project_code == undefined || that.project_code == '#') {
if (process.env.NODE_ENV == "development") { if (process.env.NODE_ENV == 'development') {
req.project_code = process.env.VUE_APP_PJ; req.project_code = process.env.VUE_APP_PJ;
} }
} else { } else {
@ -239,12 +172,8 @@ export default {
that.baseConfig = res.base; that.baseConfig = res.base;
that.$store.commit("SET_baseName", res.base.base_name); that.$store.commit("SET_baseName", res.base.base_name);
that.$store.commit("SET_baseLogo", res.base.base_logo); that.$store.commit("SET_baseLogo", res.base.base_logo);
that.$TOOL.data.set("BASE_INFO", res); that.$TOOL.data.set("BASE_INFO", res)
console.log("BASE_INFO", res); })
if (res.base.base_name_short.indexOf("智慧环保") != -1) {
this.deptCodePf = true;
}
});
}, },
appDown() { appDown() {
this.showApp = true; this.showApp = true;
@ -253,7 +182,7 @@ export default {
this.showH5 = true; this.showH5 = true;
}, },
MonitorOpen() { MonitorOpen() {
window.open("http://10.99.5.79:5515/"); window.open('http://10.99.5.79:5515/')
}, },
// //
faceLogin() { faceLogin() {
@ -266,33 +195,24 @@ export default {
// this.thisVideo.srcObject.getTracks()[0].stop(); // this.thisVideo.srcObject.getTracks()[0].stop();
}, },
configDark() { configDark() {
this.config.dark = this.config.dark ? false : true; this.config.dark = this.config.dark ? false : true
}, },
configLang(command) { configLang(command) {
this.config.lang = command.value; this.config.lang = command.value
}, },
wechatLogin() { wechatLogin() {
this.showWechatLogin = true; this.showWechatLogin = true
this.WechatLoginCode = this.WechatLoginCode = "SCUI-823677237287236-" + new Date().getTime()
"SCUI-823677237287236-" + new Date().getTime();
this.isWechatLoginResult = false; this.isWechatLoginResult = false;
setTimeout(() => { setTimeout(() => {
this.isWechatLoginResult = true; this.isWechatLoginResult = true
}, 3000); }, 3000)
}, }
}, }
}; }
</script> </script>
<style scoped> <style scoped>
.login-container {
background-image: url("/public/img/pfBackgroundImg.jpg");
width: 100%;
height: 100%;
background-size: cover;
background-position: center;
position: relative;
}
.login_bg { .login_bg {
width: 100%; width: 100%;
height: 100%; height: 100%;
@ -386,13 +306,7 @@ export default {
margin: auto; margin: auto;
padding: 20px 0; padding: 20px 0;
} }
.login-form_huanbao {
width: 450px;
margin: auto;
padding: 20px;
background: rgba(255, 255, 255, 0.6);
border-radius: 20px;
}
.login-header { .login-header {
margin-bottom: 40px; margin-bottom: 40px;
width: 460px; width: 460px;
@ -425,8 +339,7 @@ export default {
margin-top: 40px; margin-top: 40px;
} }
.login-form { .login-form {}
}
.login-form:deep(.el-tabs) .el-tabs__header { .login-form:deep(.el-tabs) .el-tabs__header {
margin-bottom: 25px; margin-bottom: 25px;