系统名称修改

This commit is contained in:
zhanghan11 2024-06-27 15:03:57 +08:00
parent 34456d8b29
commit 0c93b0686f
8 changed files with 228 additions and 100 deletions

View File

@ -1,10 +1,10 @@
# 页面标题
VUE_APP_TITLE = 设备健康管理系统
VUE_APP_TITLE = 设备预测性维护系统
# 开发环境配置
ENV = 'development'
# 设备健康管理系统/开发环境
# 设备预测性维护系统/开发环境
VUE_APP_BASE_API = '/dev-api'
# 路由懒加载

View File

@ -1,8 +1,8 @@
# 页面标题
VUE_APP_TITLE = 设备健康管理系统
VUE_APP_TITLE = 设备预测性维护系统
# 生产环境配置
ENV = 'production'
# 设备健康管理系统/生产环境
# 设备预测性维护系统/生产环境
VUE_APP_BASE_API = '/ehms-api'

View File

@ -1,10 +1,10 @@
# 页面标题
VUE_APP_TITLE = 设备健康管理系统
VUE_APP_TITLE = 设备预测性维护系统
NODE_ENV = production
# 测试环境配置
ENV = 'staging'
# 设备健康管理系统/测试环境
# 设备预测性维护系统/测试环境
VUE_APP_BASE_API = '/stage-api'

View File

@ -1,7 +1,7 @@
{
"name": "ehms",
"version": "3.8.4",
"description": "设备健康管理系统",
"description": "设备预测性维护系统",
"author": "",
"license": "MIT",
"scripts": {

View File

@ -1,45 +1,74 @@
<template>
<div class="sidebar-logo-container" :class="{'collapse':collapse}" :style="{ backgroundColor: sideTheme === 'theme-dark' ? variables.menuBackground : variables.menuLightBackground }">
<div
class="sidebar-logo-container"
:class="{'collapse':collapse}"
:style="{ backgroundColor: sideTheme === 'theme-dark' ? variables.menuBackground : variables.menuLightBackground }"
>
<transition name="sidebarLogoFade">
<router-link v-if="collapse" key="collapse" class="sidebar-logo-link" to="/">
<img v-if="logo" :src="logo" class="sidebar-logo" />
<h1 v-else class="sidebar-title" :style="{ color: sideTheme === 'theme-dark' ? variables.logoTitleColor : variables.logoLightTitleColor }">{{ title }} </h1>
<router-link
v-if="collapse"
key="collapse"
class="sidebar-logo-link"
to="/"
>
<img
v-if="logo"
:src="logo"
class="sidebar-logo"
/>
<h1
v-else
class="sidebar-title"
:style="{ color: sideTheme === 'theme-dark' ? variables.logoTitleColor : variables.logoLightTitleColor }"
>{{ title }} </h1>
</router-link>
<router-link v-else key="expand" class="sidebar-logo-link" to="/">
<img v-if="logo" :src="logo" class="sidebar-logo" />
<h1 class="sidebar-title" :style="{ color: sideTheme === 'theme-dark' ? variables.logoTitleColor : variables.logoLightTitleColor }">{{ title }} </h1>
<router-link
v-else
key="expand"
class="sidebar-logo-link"
to="/"
>
<img
v-if="logo"
:src="logo"
class="sidebar-logo"
/>
<h1
class="sidebar-title"
:style="{ color: sideTheme === 'theme-dark' ? variables.logoTitleColor : variables.logoLightTitleColor }"
>{{ title }} </h1>
</router-link>
</transition>
</div>
</template>
<script>
import logoImg from '@/assets/logo/inspur.png'
import variables from '@/assets/styles/variables.scss'
import logoImg from "@/assets/logo/inspur.png";
import variables from "@/assets/styles/variables.scss";
export default {
name: 'SidebarLogo',
name: "SidebarLogo",
props: {
collapse: {
type: Boolean,
required: true
}
required: true,
},
},
computed: {
variables() {
return variables;
},
sideTheme() {
return this.$store.state.settings.sideTheme
}
return this.$store.state.settings.sideTheme;
},
},
data() {
return {
title: '设备健康管理系统',
logo: logoImg
}
}
}
title: "设备预测性维护系统",
logo: logoImg,
};
},
};
</script>
<style lang="scss" scoped>

View File

@ -46,7 +46,7 @@
>
<span class="title1">欢迎登录</span>
<br />
<span class="vlaue">设备健康管理系统</span>
<span class="vlaue">设备预测性维护系统</span>
</el-col>
</el-col>
</el-row>

View File

@ -1,7 +1,12 @@
<template>
<div class="login">
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form">
<h3 class="title">设备健康管理系统</h3>
<el-form
ref="loginForm"
:model="loginForm"
:rules="loginRules"
class="login-form"
>
<h3 class="title">设备预测性维护系统</h3>
<el-form-item prop="username">
<el-input
v-model="loginForm.username"
@ -9,7 +14,11 @@
auto-complete="off"
placeholder="账号"
>
<svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon" />
<svg-icon
slot="prefix"
icon-class="user"
class="el-input__icon input-icon"
/>
</el-input>
</el-form-item>
<el-form-item prop="password">
@ -20,10 +29,17 @@
placeholder="密码"
@keyup.enter.native="handleLogin"
>
<svg-icon slot="prefix" icon-class="password" class="el-input__icon input-icon" />
<svg-icon
slot="prefix"
icon-class="password"
class="el-input__icon input-icon"
/>
</el-input>
</el-form-item>
<el-form-item prop="code" v-if="captchaEnabled">
<el-form-item
prop="code"
v-if="captchaEnabled"
>
<el-input
v-model="loginForm.code"
auto-complete="off"
@ -31,13 +47,24 @@
style="width: 63%"
@keyup.enter.native="handleLogin"
>
<svg-icon slot="prefix" icon-class="validCode" class="el-input__icon input-icon" />
<svg-icon
slot="prefix"
icon-class="validCode"
class="el-input__icon input-icon"
/>
</el-input>
<div class="login-code">
<img :src="codeUrl" @click="getCode" class="login-code-img"/>
<img
:src="codeUrl"
@click="getCode"
class="login-code-img"
/>
</div>
</el-form-item>
<el-checkbox v-model="loginForm.rememberMe" style="margin:0px 0px 25px 0px;">记住密码</el-checkbox>
<el-checkbox
v-model="loginForm.rememberMe"
style="margin:0px 0px 25px 0px;"
>记住密码</el-checkbox>
<el-form-item style="width:100%;">
<el-button
:loading="loading"
@ -49,8 +76,14 @@
<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
style="float: right;"
v-if="register"
>
<router-link
class="link-type"
:to="'/register'"
>立即注册</router-link>
</div>
</el-form-item>
</el-form>
@ -64,7 +97,7 @@
<script>
import { getCodeImg } from "@/api/login";
import Cookies from "js-cookie";
import { encrypt, decrypt } from '@/utils/jsencrypt'
import { encrypt, decrypt } from "@/utils/jsencrypt";
export default {
name: "Login",
@ -76,32 +109,32 @@ export default {
password: "",
rememberMe: false,
code: "",
uuid: ""
uuid: "",
},
loginRules: {
username: [
{ required: true, trigger: "blur", message: "请输入您的账号" }
{ required: true, trigger: "blur", message: "请输入您的账号" },
],
password: [
{ required: true, trigger: "blur", message: "请输入您的密码" }
{ required: true, trigger: "blur", message: "请输入您的密码" },
],
code: [{ required: true, trigger: "change", message: "请输入验证码" }]
code: [{ required: true, trigger: "change", message: "请输入验证码" }],
},
loading: false,
//
captchaEnabled: true,
//
register: false,
redirect: undefined
redirect: undefined,
};
},
watch: {
$route: {
handler: function(route) {
handler: function (route) {
this.redirect = route.query && route.query.redirect;
},
immediate: true
}
immediate: true,
},
},
created() {
this.getCode();
@ -109,8 +142,9 @@ export default {
},
methods: {
getCode() {
getCodeImg().then(res => {
this.captchaEnabled = res.captchaEnabled === undefined ? true : res.captchaEnabled;
getCodeImg().then((res) => {
this.captchaEnabled =
res.captchaEnabled === undefined ? true : res.captchaEnabled;
if (this.captchaEnabled) {
this.codeUrl = "data:image/gif;base64," + res.img;
this.loginForm.uuid = res.uuid;
@ -120,38 +154,46 @@ export default {
getCookie() {
const username = Cookies.get("username");
const password = Cookies.get("password");
const rememberMe = Cookies.get('rememberMe')
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)
password:
password === undefined ? this.loginForm.password : decrypt(password),
rememberMe: rememberMe === undefined ? false : Boolean(rememberMe),
};
},
handleLogin() {
this.$refs.loginForm.validate(valid => {
this.$refs.loginForm.validate((valid) => {
if (valid) {
this.loading = true;
if (this.loginForm.rememberMe) {
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 });
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');
Cookies.remove("rememberMe");
}
this.$store.dispatch("Login", this.loginForm).then(() => {
this.$router.push({ path: this.redirect || "/" }).catch(()=>{});
}).catch(() => {
this.loading = false;
if (this.captchaEnabled) {
this.getCode();
}
});
this.$store
.dispatch("Login", this.loginForm)
.then(() => {
this.$router.push({ path: this.redirect || "/" }).catch(() => {});
})
.catch(() => {
this.loading = false;
if (this.captchaEnabled) {
this.getCode();
}
});
}
});
}
}
},
},
};
</script>

View File

@ -1,10 +1,24 @@
<template>
<div class="register">
<el-form ref="registerForm" :model="registerForm" :rules="registerRules" class="register-form">
<h3 class="title">设备健康管理系统</h3>
<el-form
ref="registerForm"
:model="registerForm"
:rules="registerRules"
class="register-form"
>
<h3 class="title">设备预测性维护系统</h3>
<el-form-item prop="username">
<el-input v-model="registerForm.username" type="text" auto-complete="off" placeholder="账号">
<svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon" />
<el-input
v-model="registerForm.username"
type="text"
auto-complete="off"
placeholder="账号"
>
<svg-icon
slot="prefix"
icon-class="user"
class="el-input__icon input-icon"
/>
</el-input>
</el-form-item>
<el-form-item prop="password">
@ -15,7 +29,11 @@
placeholder="密码"
@keyup.enter.native="handleRegister"
>
<svg-icon slot="prefix" icon-class="password" class="el-input__icon input-icon" />
<svg-icon
slot="prefix"
icon-class="password"
class="el-input__icon input-icon"
/>
</el-input>
</el-form-item>
<el-form-item prop="confirmPassword">
@ -26,10 +44,17 @@
placeholder="确认密码"
@keyup.enter.native="handleRegister"
>
<svg-icon slot="prefix" icon-class="password" class="el-input__icon input-icon" />
<svg-icon
slot="prefix"
icon-class="password"
class="el-input__icon input-icon"
/>
</el-input>
</el-form-item>
<el-form-item prop="code" v-if="captchaEnabled">
<el-form-item
prop="code"
v-if="captchaEnabled"
>
<el-input
v-model="registerForm.code"
auto-complete="off"
@ -37,10 +62,18 @@
style="width: 63%"
@keyup.enter.native="handleRegister"
>
<svg-icon slot="prefix" icon-class="validCode" class="el-input__icon input-icon" />
<svg-icon
slot="prefix"
icon-class="validCode"
class="el-input__icon input-icon"
/>
</el-input>
<div class="register-code">
<img :src="codeUrl" @click="getCode" class="register-code-img"/>
<img
:src="codeUrl"
@click="getCode"
class="register-code-img"
/>
</div>
</el-form-item>
<el-form-item style="width:100%;">
@ -55,7 +88,10 @@
<span v-else> 中...</span>
</el-button>
<div style="float: right;">
<router-link class="link-type" :to="'/login'">使用已有账户登录</router-link>
<router-link
class="link-type"
:to="'/login'"
>使用已有账户登录</router-link>
</div>
</el-form-item>
</el-form>
@ -85,25 +121,35 @@ export default {
password: "",
confirmPassword: "",
code: "",
uuid: ""
uuid: "",
},
registerRules: {
username: [
{ required: true, trigger: "blur", message: "请输入您的账号" },
{ min: 2, max: 20, message: '用户账号长度必须介于 2 和 20 之间', trigger: 'blur' }
{
min: 2,
max: 20,
message: "用户账号长度必须介于 2 和 20 之间",
trigger: "blur",
},
],
password: [
{ required: true, trigger: "blur", message: "请输入您的密码" },
{ min: 5, max: 20, message: '用户密码长度必须介于 5 和 20 之间', trigger: 'blur' }
{
min: 5,
max: 20,
message: "用户密码长度必须介于 5 和 20 之间",
trigger: "blur",
},
],
confirmPassword: [
{ required: true, trigger: "blur", message: "请再次输入您的密码" },
{ required: true, validator: equalToPassword, trigger: "blur" }
{ required: true, validator: equalToPassword, trigger: "blur" },
],
code: [{ required: true, trigger: "change", message: "请输入验证码" }]
code: [{ required: true, trigger: "change", message: "请输入验证码" }],
},
loading: false,
captchaEnabled: true
captchaEnabled: true,
};
},
created() {
@ -111,8 +157,9 @@ export default {
},
methods: {
getCode() {
getCodeImg().then(res => {
this.captchaEnabled = res.captchaEnabled === undefined ? true : res.captchaEnabled;
getCodeImg().then((res) => {
this.captchaEnabled =
res.captchaEnabled === undefined ? true : res.captchaEnabled;
if (this.captchaEnabled) {
this.codeUrl = "data:image/gif;base64," + res.img;
this.registerForm.uuid = res.uuid;
@ -120,27 +167,37 @@ export default {
});
},
handleRegister() {
this.$refs.registerForm.validate(valid => {
this.$refs.registerForm.validate((valid) => {
if (valid) {
this.loading = true;
register(this.registerForm).then(res => {
const username = this.registerForm.username;
this.$alert("<font color='red'>恭喜你,您的账号 " + username + " 注册成功!</font>", '系统提示', {
dangerouslyUseHTMLString: true,
type: 'success'
}).then(() => {
this.$router.push("/login");
}).catch(() => {});
}).catch(() => {
this.loading = false;
if (this.captchaEnabled) {
this.getCode();
}
})
register(this.registerForm)
.then((res) => {
const username = this.registerForm.username;
this.$alert(
"<font color='red'>恭喜你,您的账号 " +
username +
" 注册成功!</font>",
"系统提示",
{
dangerouslyUseHTMLString: true,
type: "success",
}
)
.then(() => {
this.$router.push("/login");
})
.catch(() => {});
})
.catch(() => {
this.loading = false;
if (this.captchaEnabled) {
this.getCode();
}
});
}
});
}
}
},
},
};
</script>