From b1dd7463eebcd7e67f94244988ebbc3b9d29c1b7 Mon Sep 17 00:00:00 2001
From: value <z1292839451@163.com>
Date: 星期一, 28 八月 2023 16:35:22 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
src/store/modules/user.js | 2
src/views/chart/work/index.vue | 25 +
src/views/laboratory/measure/index.vue | 22 +-
src/components/experiment/checkTheReport/index.vue | 34 ++
src/views/login/index.vue | 396 +++++++++++++++++++-------------------
src/layout/components/Navbar.vue | 84 ++++---
src/views/laboratory/role/index.vue | 12
src/assets/404_images/login-form-bg.png | 0
src/router/index.js | 2
.env.development | 2
src/views/laboratory/measure/Add.vue | 1
src/assets/404_images/login-bg.png | 0
src/views/experiment/checkTheReport/index.vue | 2
13 files changed, 314 insertions(+), 268 deletions(-)
diff --git a/.env.development b/.env.development
index ab9be2d..d00c942 100644
--- a/.env.development
+++ b/.env.development
@@ -2,4 +2,4 @@
ENV = 'development'
# base api
-VUE_APP_BASE_API = 'http://localhost:1234/'
+VUE_APP_BASE_API = 'http://192.168.110.107:1234/'
diff --git a/src/assets/404_images/login-bg.png b/src/assets/404_images/login-bg.png
new file mode 100644
index 0000000..5436ea0
--- /dev/null
+++ b/src/assets/404_images/login-bg.png
Binary files differ
diff --git a/src/assets/404_images/login-form-bg.png b/src/assets/404_images/login-form-bg.png
new file mode 100644
index 0000000..aacbd1b
--- /dev/null
+++ b/src/assets/404_images/login-form-bg.png
Binary files differ
diff --git a/src/components/experiment/checkTheReport/index.vue b/src/components/experiment/checkTheReport/index.vue
index 3c005d9..7d22893 100644
--- a/src/components/experiment/checkTheReport/index.vue
+++ b/src/components/experiment/checkTheReport/index.vue
@@ -40,13 +40,15 @@
<td>妫�娴嬬粨鏋�</td>
<td>鍗曢」鍒ゆ柇</td>
</tr>
- <tr v-for="(item,index) in reportData.products" :key="item">
+ <tr v-for="(item,index) in arr" :key="index">
<td>{{index+1}}</td>
<td>{{item.ipName}}</td>
<td>{{item.unit}}</td>
<td>{{item.required}}</td>
<td>{{item.testValue}}</td>
- <td>{{item.testState === 1 ? "鈭�" : "X"}}</td>
+ <td >
+ {{isIfState(item.testState) }}
+ </td>
</tr>
<tr>
<td colspan="6">妫�楠岀粨璁猴細{{reportData.type == 1 ? "鍚堟牸" : "涓嶅悎鏍�"}}</td>
@@ -74,7 +76,24 @@
data() {
return {
logoSrc : require("@/assets/404_images/logo.png"),
- now: new Date().toLocaleDateString()
+ now: new Date().toLocaleDateString(),
+ arr: []
+ }
+ },
+ mounted(){
+ this.arr = this.reportData.products;
+ if(this.reportData.products.length < 10){
+ let size = this.reportData.products.length;
+ let num=10-size
+ for(let i=0;i< num;i++){
+ this.arr.push({
+ code: null,
+ ipName: "",
+ required: "",
+ testState: null,
+ testValue: "",
+ unit: ""})
+ }
}
},
methods:{
@@ -84,6 +103,11 @@
let month = (dt.getMonth() + 1).toString().padStart(2,'0');
let date = dt.getDate().toString().padStart(2,'0');
return `${year}-${month}-${date}`;
+ },
+ isIfState(val){
+ if(val===1)return "鈭�"
+ else if(val===null || val=== undefined) return null
+ else return "X"
}
},
props:["reportData"]
@@ -117,7 +141,7 @@
border: 2px solid black;
}
tr,td,th{
- padding: 10px 10px;
+ padding: 15px 10px;
}
.date-group{
width: 90%;
@@ -135,7 +159,7 @@
margin-left: 5%;
color: lightgray;
text-align: center;
- margin-top: 250px;
+ margin-top: 300px;
}
}
}
diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue
index ba4d987..0fe19aa 100644
--- a/src/layout/components/Navbar.vue
+++ b/src/layout/components/Navbar.vue
@@ -7,18 +7,18 @@
<div class="right-menu">
<div class="right-serves">
<!-- <i class="el-icon-setting" /> -->
-
+
<p @click="toMessage"><el-badge is-dot class="el-icon-bell message-icon"></el-badge></p>
<!-- <i class="el-icon-time" /> -->
</div>
<el-dropdown class="avatar-container" trigger="click">
<div class="avatar-wrapper">
- <a class="user-avatar">{{ user.name.slice(0,1) }}</a>
+ <a class="user-avatar">{{ user.name.slice(0, 1) }}</a>
</div>
<el-dropdown-menu slot="dropdown" class="user-dropdown">
- <el-dropdown-item >
- <p @click="dialogFormVisible = true">淇敼瀵嗙爜</p>
- </el-dropdown-item>
+ <el-dropdown-item>
+ <p @click="dialogFormVisible = true">淇敼瀵嗙爜</p>
+ </el-dropdown-item>
<el-dropdown-item divided @click.native="logout">
<span style="display:block;">閫�鍑虹櫥褰�</span>
</el-dropdown-item>
@@ -49,15 +49,15 @@
import { mapGetters } from 'vuex'
// import Breadcrumb from '@/components/Breadcrumb'
// import Hamburger from '@/components/Hamburger'
- import {
- get,
- post,
- wpost,
- postFile
- } from "@/api/util/requestUtil.js"
+import {
+ get,
+ post,
+ wpost,
+ postFile
+} from "@/api/util/requestUtil.js"
export default {
- data(){
+ data() {
return {
form: {
oldPwd: '',
@@ -65,15 +65,15 @@
confirmPwd: ''
},
user: {
- id: null,
- name: 'value'
- },
+ id: null,
+ name: 'value'
+ },
dialogFormVisible: false,
formLabelWidth: '120px',
- user: {
- id: null,
- name: 'value'
- }
+ user: {
+ id: null,
+ name: 'value'
+ }
}
},
components: {
@@ -86,20 +86,20 @@
'avatar'
])
},
- mounted() {
- this.getUser()
- },
+ mounted() {
+ this.getUser()
+ },
methods: {
- reset(){
+ reset() {
this.dialogFormVisible = false;
this.form.oldPwd = '';
this.form.newPwd = '';
this.form.confirmPwd = '';
},
- toMessage(){
+ toMessage() {
this.$router.push('/message/toDo');
},
- editPwd(){
+ editPwd() {
console.log(1);
},
toggleSideBar() {
@@ -108,16 +108,18 @@
async logout() {
// await this.$store.dispatch('user/logout')
sessionStorage.removeItem("user")
+ localStorage.removeItem("autoenter");
this.$router.push(`/login?redirect=${this.$route.fullPath}`)
this.$router.replace({path: '/login'});
location.reload();
+
},
- getUser(){
- get(this.$url.info).then(res=>{
- this.user = res.data
- sessionStorage.setItem("user",JSON.stringify(res.data))
- })
- }
+ getUser() {
+ get(this.$url.info).then(res => {
+ this.user = res.data
+ sessionStorage.setItem("user", JSON.stringify(res.data))
+ })
+ }
}
}
</script>
@@ -130,21 +132,24 @@
background: #fff;
display: flex;
border-bottom: 1px solid #f0f2f5;
+
// box-shadow: 0 0 0.857143rem rgba(0, 0, 0, 0.12);
// box-shadow: 0 1px 4px rgba(0,21,41,.08);
- .message-icon{
+ .message-icon {
margin-right: 10px;
cursor: pointer;
}
- .v-modal{
+
+ .v-modal {
z-index: 8;
}
+
.hamburger-container {
line-height: 46px;
height: 100%;
cursor: pointer;
transition: background .3s;
- -webkit-tap-highlight-color:transparent;
+ -webkit-tap-highlight-color: transparent;
&:hover {
background: rgba(0, 0, 0, .025)
@@ -161,11 +166,13 @@
line-height: 50px;
display: flex;
justify-content: right;
- .right-serves{
+
+ .right-serves {
height: 100%;
display: flex;
align-items: center;
- >i{
+
+ >i {
display: inline-block;
margin: auto 10px;
font-size: 20px;
@@ -198,6 +205,7 @@
.avatar-container {
margin-right: 24px;
height: 100%;
+
.avatar-wrapper {
// margin-top: 5px;
width: 40px;
@@ -206,6 +214,7 @@
display: flex;
align-items: center;
justify-content: center;
+
.user-avatar {
cursor: pointer;
width: 30px;
@@ -229,5 +238,4 @@
}
}
}
-}
-</style>
+}</style>
diff --git a/src/router/index.js b/src/router/index.js
index e932803..3f4bca3 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -528,7 +528,7 @@
function createRouter(Routees) {
if (JSON.parse(sessionStorage.getItem("user")) != undefined && JSON.parse(sessionStorage.getItem("user")) != null) {
let sessionLayerId=JSON.parse(sessionStorage.getItem("user")).sessionLayerId
- if(sessionLayerId!='c3284d0f94606de1fd2af172aba15bf3'){
+ if(sessionLayerId!='f5c8bcb7d5a0fd27e2323280f7e98cad'){
let role = JSON.parse(sessionStorage.getItem("user")).role
let menuFather = baseRouter
const dataMenuFather = fn3(menuFather)
diff --git a/src/store/modules/user.js b/src/store/modules/user.js
index 3ff12ca..8f614de 100644
--- a/src/store/modules/user.js
+++ b/src/store/modules/user.js
@@ -42,7 +42,7 @@
commit('SET_REFRESH', data.refresh)
setToken(data.token)
setRefresh(data.refresh)
- resolve()
+ resolve(response)
}).catch(error => {
reject(error)
})
diff --git a/src/views/chart/work/index.vue b/src/views/chart/work/index.vue
index 46e1da2..399ab21 100644
--- a/src/views/chart/work/index.vue
+++ b/src/views/chart/work/index.vue
@@ -90,23 +90,34 @@
},
}
},
- mounted(){},
+ mounted(){
+ this.queryData();
+ },
methods: {
async queryData(){
- let date = this.formInline.date;
+ let date = [];
+ let type;
+ if(this.formInline.date == null || this.formInline.date == ""){
+ let currentDate = new Date();
+ let year = currentDate.getFullYear();
+ let month = currentDate.getMonth() + 1;
+ let day = currentDate.getDate();
+ date.push(year +"-" + month + "-01");
+ date.push(year +"-" + month + "-" + day);
+ type = 0;
+ }else{
+ date = this.formInline.date;
+ type = this.formInline.type;
+ }
let obj = {
startTime : date[0],
endTime : date[1],
- type : this.formInline.type
+ type : type
}
const dutyMater = await getDutyMater(obj);
const dutyTimely = await getDutyTimely(obj);
const executeMater = await getExecuteMater(obj);
const executeTimely = await getExecuteTimely(obj);
- console.log("dm",dutyMater.data);
- console.log("dt",dutyTimely.data);
- console.log("em",executeMater.data.length);
- console.log("et",executeTimely.data);
this.initLeaderStatiChart("leaderStati",dutyMater.data);
this.initLeaderTimelyChart("leaderTimely",dutyTimely.data);
this.initTesterStatiChart("testerStati",executeMater.data);
diff --git a/src/views/experiment/checkTheReport/index.vue b/src/views/experiment/checkTheReport/index.vue
index 47cd9c1..dce2174 100644
--- a/src/views/experiment/checkTheReport/index.vue
+++ b/src/views/experiment/checkTheReport/index.vue
@@ -214,11 +214,11 @@
async queryReportByRCode(code){
const resp = await getReportData({code:code});
this.reportData = resp.data;
+ this.dialogVisible = true;
console.log(this.reportData);
},
//鏌ョ湅鎶ュ憡鎸夐挳
previewFun(row){
- this.dialogVisible = true;
this.reportType = row.type;
this.queryReportByRCode(row.reportCode);
},
diff --git a/src/views/laboratory/measure/Add.vue b/src/views/laboratory/measure/Add.vue
index bbc0fe9..0533251 100644
--- a/src/views/laboratory/measure/Add.vue
+++ b/src/views/laboratory/measure/Add.vue
@@ -140,7 +140,6 @@
res.data.instrumentList.forEach(item => {
this.insList.push({ label: item.equipmentName, value: item.id })
})
- console.log(this.insList);
},
methods: {
addcodePointsTable() {
diff --git a/src/views/laboratory/measure/index.vue b/src/views/laboratory/measure/index.vue
index a4b0dbb..d70dd9c 100644
--- a/src/views/laboratory/measure/index.vue
+++ b/src/views/laboratory/measure/index.vue
@@ -129,7 +129,7 @@
<Add ref="add" />
</div>
<div id="myMOdel"
- :style="`position: absolute;transition: 1s;top:${mymodelTop}vh; left: 9px; width: 99%; height: 85vh; background-color: #fff;z-index: 20;`">
+ :style="`position: absolute;transition: 1s;top:${mymodelTop}px; left: 9px; width: 99%; height: 100vh; background-color: #fff;z-index: 20;`">
<el-col :span="10">
<p style="font-size: 13px;padding-left: 40px;">璁″垝淇℃伅</p>
</el-col>
@@ -338,7 +338,7 @@
createPerson: '鏌愭煇璐熻矗浜�',
createTime: '2021-09-08'
},
- mymodelTop: -85,//14
+ mymodelTop: -1000,//14
addTop: -85,
planId: 0
}
@@ -391,9 +391,9 @@
this.currentPage
await this.limitGetPlanMeasureInstrument()
},
- async handleCurrentChangePllan(num) {
- this.currentPagePlan = num
- await this.limitGetPlanMeasureInstrument()
+ handleCurrentChangePllan(num) {
+ this.currentPagePlan = num;
+ this.limitGetPlanMeasureInstrument();
},
addPlan() {
this.addTop = 2
@@ -407,9 +407,11 @@
currentPage: this.currentPagePlan,
pageSize: this.pageSizePlan
}
- let res = await limitGetPlanMeasureRequest(param)
- this.totalPlan = res.data.taotal
- this.measureData = res.data.list
+ const res = await limitGetPlanMeasureRequest(param);
+ console.log(res.data.total);
+ // this.totalPlan = res.data.taotal;
+ this.measureData = res.data.list;
+ console.log(this.totalPlan);
},
lookPalan(id) {
this.planId = id
@@ -437,7 +439,7 @@
},
combackLookPlan() {
this.lookVisible = false
- this.mymodelTop = -85
+ this.mymodelTop = -1000
this.selectInfoBtn=false
},
blurSearch() {
@@ -520,7 +522,7 @@
}
</script>
-<style scoped>
+<style scoped lang="scss">
.top-bar {
margin: -25px -15px;
background: #fff;
diff --git a/src/views/laboratory/role/index.vue b/src/views/laboratory/role/index.vue
index c4f696c..26da055 100644
--- a/src/views/laboratory/role/index.vue
+++ b/src/views/laboratory/role/index.vue
@@ -2,14 +2,16 @@
<div>
<div class="content-main">
<div class="top-bar">
- <el-form ref="form" :inline="true" :model="searchData">
+ <el-form style="display: flex;align-items: center;" ref="form" :inline="true" :model="searchData">
<el-form-item label="瑙掕壊鍚嶇О锛�" class="sermargin">
<el-input v-model="searchData.roleName" class="input-form" placeholder="璇疯緭鍏ヨ鑹插悕绉�" style="width:250px">
</el-input>
</el-form-item>
<el-form-item class="rightBtn">
- <el-button type="primary" @click="searchRole">鏌ヨ</el-button>
- <el-button type="primary" plain>閲嶇疆</el-button>
+ <el-col>
+ <el-button type="primary" @click="searchRole">鏌ヨ</el-button>
+ <el-button type="primary" plain>閲嶇疆</el-button>
+ </el-col>
</el-form-item>
</el-form>
<el-form>
@@ -358,13 +360,11 @@
},
async upRole(scope) {
- console.log(scope);
this.updateRole.roleId = scope.row.roleId
this.updateRole.roleName = scope.row.roleName
this.updateRole.lastName = scope.row.roleName
let menuSelect = scope.row.roleMenuList
this.updateRole.lastMenuSelect = scope.row.roleMenuList
- console.log(menuSelect);
let res = await getMenusTree();
this.menuUpdateInfo = res.data
this.menuUpdateInfo.forEach(item => {
@@ -386,7 +386,6 @@
})
}
})
- console.log(this.menuUpdateInfo);
menuSelect.forEach(ms => {
this.menuUpdateInfo.forEach(item => {
if (ms.menuName === item.name) {
@@ -784,6 +783,7 @@
#selectRolecheck .el-checkbox__input.is-disabled.is-checked .el-checkbox__inner::after {
border-color: #fff !important;
}
+
#selectRoleCheck .el-checkbox__input.is-disabled.is-checked .el-checkbox__inner {
background-color: #409EFF;
border-color: #409EFF;
diff --git a/src/views/login/index.vue b/src/views/login/index.vue
index 627125e..e50cf91 100644
--- a/src/views/login/index.vue
+++ b/src/views/login/index.vue
@@ -1,73 +1,188 @@
+<style scoped>
+.enter {
+ width: 100vw;
+ height: 100vh;
+ display: flex;
+ background-image: url("../../assets/404_images/login-form-bg.png");
+ background-size: 100% 100%;
+}
+
+.left {
+ width: calc(100% - 500px);
+ height: 100%;
+ overflow: hidden;
+}
+
+.left img {
+ width: 100%;
+ min-height: 100%;
+}
+
+.right {
+ width: 600px;
+ overflow-y: auto;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}
+
+.title_big {
+ color: #004EA2;
+ font-size: 40px;
+ margin-bottom: 8px;
+}
+
+.title_small {
+ color: #004EA2;
+ font-size: 24px;
+}
+
+.elform {
+ margin-top: 50px;
+}
+
+.sao {
+ font-size: 14px;
+ color: #004EA2;
+ width: 100%;
+ text-align: right;
+}
+</style>
+
+<style>
+.enter .el-form-item__label {
+ font-size: 20px;
+ color: #333;
+ line-height: 48px;
+}
+
+.enter .el-form-item {
+ margin-bottom: 30px;
+}
+
+.enter .el-input__inner {
+ height: 48px;
+}
+
+.enter .el-button {
+ background-color: #1763EB;
+ color: #fff;
+ border: 0;
+ border-radius: 16px;
+ width: 100%;
+ height: 48px;
+}
+
+.enter input::-webkit-input-placeholder,
+.enter textarea::-webkit-input-placeholder {
+ font-size: 14px;
+}
+
+.enter input::-moz-placeholder,
+.enter textarea::-moz-placeholder {
+ font-size: 10px;
+}
+
+.enter input:-ms-input-placeholder,
+.enter textarea:-ms-input-placeholder {
+ font-size: 10px;
+}
+
+.enter input:-moz-placeholder,
+.enter textarea:-moz-placeholder {
+ font-size: 10px;
+}
+.copyright{
+ width: 100%;
+ position: relative;
+ top: 140px;
+}
+.copyright p{
+ padding: 2px 0px;
+ font-size: 5px;
+ text-align: center;
+ color: lightgray;
+}
+.copyright >p:nth-child(3){
+ text-decoration: underline;
+}
+</style>
+
<template>
- <div class="login-container">
- <el-form ref="loginForm" :model="loginForm" class="login-form" auto-complete="on" label-position="left">
- <!-- <el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form" auto-complete="on" label-position="left"> -->
- <!-- form 琛ㄥ崟鏍¢獙 -->
- <div class="title-container">
- <h3 class="title">鐧� 褰�</h3>
+ <div class="enter">
+ <div class="left">
+ <img src="@/assets/404_images/login-bg.png">
+ </div>
+ <div class="right">
+ <div style="width: calc(100% - 100px);">
+ <div class="title_big">娆㈣繋鎮ㄧ櫥褰曪紒</div>
+ <div class="title_small">瑁呭鐢电紗LIMS瀹為獙瀹ょ鐞嗙郴缁�</div>
+ <el-form :model="ruleForm" :rules="rules" ref="ruleForm" class="elform" :hide-required-asterisk="true">
+ <el-form-item label="鐢ㄦ埛鍚�" prop="username">
+ <el-input v-model="ruleForm.username" placeholder="璇疯緭鍏ヨ处鍙�" clearable></el-input>
+ </el-form-item>
+ <el-form-item label="瀵嗙爜" prop="password">
+ <el-input v-model="ruleForm.password" placeholder="璇疯緭鍏ュ瘑鐮�" clearable show-password></el-input>
+ </el-form-item>
+ <el-form-item style="margin-bottom: 8px;">
+ <el-col :span="12"><el-checkbox v-model="ruleForm.remumberme">璁颁綇瀵嗙爜</el-checkbox></el-col>
+ <el-col :span="12" style="text-align: right;"><el-checkbox
+ v-model="ruleForm.autoenter">鑷姩鐧诲綍</el-checkbox></el-col>
+ </el-form-item>
+ <el-form-item style="margin-bottom: 15px;">
+ <el-button type="primary" @click="submitForm('ruleForm')" :loading="btnload">绔嬪嵆鐧诲綍</el-button>
+ </el-form-item>
+ </el-form>
+ <div class="sao">寰俊鎵爜鐧诲綍</div>
+ <div class="copyright">
+ <p>姹熶笢閲戝叿璁惧鏈夐檺鍏徃</p>
+ <p>鐗堟潈鎵�鏈塁opyright 漏锔� 2012-2021 ZTT.All Rights Reserved.</p>
+ <p>[鑻廔CP澶�10047815鍙�-1]</p>
+ </div>
</div>
-
- <el-form-item prop="username">
- <span class="svg-container">
- <svg-icon icon-class="user" />
- </span>
- <el-input ref="username" v-model="loginForm.username" placeholder="鐢ㄦ埛鍚�" name="username" type="text"
- tabindex="1" auto-complete="on" />
- </el-form-item>
-
- <el-form-item prop="password">
- <span class="svg-container">
- <svg-icon icon-class="password" />
- </span>
- <el-input :key="passwordType" ref="password" v-model="loginForm.password" :type="passwordType"
- placeholder="瀵嗙爜" name="password" tabindex="2" auto-complete="on" @keyup.enter.native="handleLogin" />
- <span class="show-pwd" @click="showPwd">
- <svg-icon :icon-class="passwordType === 'password' ? 'eye' : 'eye-open'" />
- </span>
- </el-form-item>
-
- <el-button :loading="loading" type="primary" style="width:100%;margin-bottom:30px;"
- @click.native.prevent="handleLogin">Login</el-button>
- <!-- <div class="tips">
- <span style="margin-right:20px;">username: admin</span>
- <span> password: any</span>
- </div> -->
- </el-form>
+ </div>
</div>
</template>
<script>
-import { validUsername } from '@/utils/validate'
import { get } from "@/api/util/requestUtil.js"
export default {
- name: 'Login',
data() {
- const validateUsername = (rule, value, callback) => {
- if (!validUsername(value)) {
- callback(new Error('Please enter the correct user name'))
- } else {
- callback()
- }
- }
- const validatePassword = (rule, value, callback) => {
- if (value.length < 6) {
- callback(new Error('The password can not be less than 6 digits'))
- } else {
- callback()
- }
- }
return {
- loginForm: {
- username: 'admin',
- password: 'admin'
+ ruleForm: {
+ username: "admin",
+ password: "admin",
+ remumberme: false,
+ autoenter: false
},
- loginRules: {
- username: [{ required: true, trigger: 'blur', validator: validateUsername }],
- password: [{ required: true, trigger: 'blur', validator: validatePassword }]
+ rules: {
+ username: [{
+ required: true,
+ message: '璇疯緭鍏ヨ处鍙�',
+ trigger: ['blur', 'change']
+ }],
+ password: [{
+ required: true,
+ message: '璇疯緭鍏ュ瘑鐮�',
+ trigger: ['blur', 'change']
+ }]
},
- loading: false,
- passwordType: 'password',
+ btnload: false,
redirect: undefined
+ }
+ },
+ mounted() {
+ this.ruleForm.remumberme = JSON.parse(localStorage.getItem('rememberme'))==null?false:JSON.parse(localStorage.getItem('rememberme'))
+ this.ruleForm.autoenter = JSON.parse(localStorage.getItem('autoenter'))==null?false:JSON.parse(localStorage.getItem('autoenter'))
+ var user = JSON.parse(localStorage.getItem('user'))
+ if (user != null && user != undefined) {
+ if (this.ruleForm.remumberme==true) {
+ this.ruleForm.username = user.username;
+ this.ruleForm.password = user.password;
+ }
+ if (this.ruleForm.autoenter==true) {
+ this.submitForm('ruleForm');
+ }
}
},
watch: {
@@ -79,154 +194,41 @@
}
},
methods: {
- showPwd() {
- if (this.passwordType === 'password') {
- this.passwordType = ''
- } else {
- this.passwordType = 'password'
- }
- this.$nextTick(() => {
- this.$refs.password.focus()
- })
- },
- handleLogin() {
- this.$refs.loginForm.validate(valid => {
+ submitForm(formName) {
+ this.btnload = true
+ this.$refs[formName].validate((valid) => {
if (valid) {
- this.loading = true
- this.$store.dispatch('user/login', this.loginForm).then(async () => {
+ this.$store.dispatch('user/login', this.ruleForm).then(async (res) => {
+ let name = "";
await get(this.$url.info).then(res => {
- this.user = res.data
- sessionStorage.setItem("user", JSON.stringify(res.data))
- sessionStorage.setItem("flushPage",0)
+ this.user = res.data;
+ name = res.data.name;
+ sessionStorage.setItem("user", JSON.stringify(res.data));
+ sessionStorage.setItem("flushPage",0);
})
+ localStorage.setItem('rememberme', this.ruleForm.remumberme);
+ localStorage.setItem('autoenter', this.ruleForm.autoenter);
+ if (this.ruleForm.remumberme==true||this.ruleForm.autoenter==true) {
+ localStorage.setItem("user", JSON.stringify({
+ username: this.ruleForm.username,
+ password: this.ruleForm.password,
+ name: name,
+ }));
+ }
+ this.$message.success("鐧诲綍鎴愬姛")
+ this.btnload = false
this.$router.push({ path: this.redirect || '/' })
- this.loading = false
- }).catch(() => {
- this.loading = false
+ }).catch((error) => {
+ this.$message.error(error.message)
+ this.btnload = false
})
} else {
- console.log('鐧诲綍澶辫触!')
- return false
+ this.btnload = false
+ this.$message.error('璐﹀彿鎴栧瘑鐮佹湭杈撳叆锛�')
+ return false;
}
})
- }
+ },
}
}
</script>
-
-<style lang="scss">
-/* 淇input 鑳屾櫙涓嶅崗璋� 鍜屽厜鏍囧彉鑹� */
-/* Detail see https://github.com/PanJiaChen/vue-element-admin/pull/927 */
-
-$bg: #283443;
-$light_gray: #fff;
-$cursor: #fff;
-
-@supports (-webkit-mask: none) and (not (cater-color: $cursor)) {
- .login-container .el-input input {
- color: $cursor;
- }
-}
-
-/* reset element-ui css */
-.login-container {
- .el-input {
- display: inline-block;
- height: 47px;
- width: 85%;
-
- input {
- background: transparent;
- border: 0px;
- -webkit-appearance: none;
- border-radius: 0px;
- padding: 12px 5px 12px 15px;
- color: $light_gray;
- height: 47px;
- caret-color: $cursor;
-
- &:-webkit-autofill {
- box-shadow: 0 0 0px 1000px $bg inset !important;
- -webkit-text-fill-color: $cursor !important;
- }
- }
- }
-
- .el-form-item {
- border: 1px solid rgba(255, 255, 255, 0.1);
- background: rgba(0, 0, 0, 0.1);
- border-radius: 5px;
- color: #454545;
- }
-}
-</style>
-
-<style lang="scss" scoped>
-$bg: #2d3a4b;
-$dark_gray: #889aa4;
-$light_gray: #eee;
-
-.login-container {
- min-height: 100%;
- width: 100%;
- background: url('../../assets/404_images/backgroud.png') no-repeat;
- background-size: 100vw 100vh;
- overflow: hidden;
-
- .login-form {
- position: relative;
- width: 520px;
- max-width: 100%;
- padding: 0 35px;
- margin: 0 auto;
- overflow: hidden;
- position: absolute;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%);
-
- }
-
- .tips {
- font-size: 14px;
- color: #fff;
- margin-bottom: 10px;
-
- span {
- &:first-of-type {
- margin-right: 16px;
- }
- }
- }
-
- .svg-container {
- padding: 6px 5px 6px 15px;
- color: $dark_gray;
- vertical-align: middle;
- width: 30px;
- display: inline-block;
- }
-
- .title-container {
- position: relative;
-
- .title {
- font-size: 26px;
- color: $light_gray;
- margin: 0px auto 40px auto;
- text-align: center;
- font-weight: bold;
- }
- }
-
- .show-pwd {
- position: absolute;
- right: 10px;
- top: 7px;
- font-size: 16px;
- color: $dark_gray;
- cursor: pointer;
- user-select: none;
- }
-}
-</style>
--
Gitblit v1.9.3