|
|
|
@ -12,12 +12,24 @@ |
|
|
|
</div> |
|
|
|
<h3 class="login-title">用户登录</h3> |
|
|
|
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" status-icon> |
|
|
|
<el-form-item> |
|
|
|
<el-select v-model="dataForm.site" style="width: 230px" |
|
|
|
placeholder="请选择工厂"> |
|
|
|
<el-option |
|
|
|
v-for="(item,index) in siteList" |
|
|
|
:key="index" |
|
|
|
:label="item.siteID+' - '+item.siteName" |
|
|
|
:value="item.siteID" |
|
|
|
> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item prop="userName"> |
|
|
|
<div class="input-with-label"> |
|
|
|
<span class="input-label">用户名</span> |
|
|
|
<el-input |
|
|
|
v-model="dataForm.userName" |
|
|
|
placeholder="请输入账号" |
|
|
|
<el-input |
|
|
|
v-model="dataForm.userName" |
|
|
|
placeholder="请输入账号" |
|
|
|
size="large" |
|
|
|
prefix-icon="el-icon-user"> |
|
|
|
</el-input> |
|
|
|
@ -26,10 +38,10 @@ |
|
|
|
<el-form-item prop="password" style="margin-top: 20px"> |
|
|
|
<div class="input-with-label"> |
|
|
|
<span class="input-label">密码</span> |
|
|
|
<el-input |
|
|
|
v-model="dataForm.password" |
|
|
|
type="password" |
|
|
|
placeholder="请输入密码" |
|
|
|
<el-input |
|
|
|
v-model="dataForm.password" |
|
|
|
type="password" |
|
|
|
placeholder="请输入密码" |
|
|
|
size="large" |
|
|
|
prefix-icon="el-icon-lock"> |
|
|
|
</el-input> |
|
|
|
@ -48,7 +60,9 @@ |
|
|
|
<script> |
|
|
|
import { getConfigParams } from '@/api/sysConfig.js'; |
|
|
|
import { getUUID } from '@/utils'; |
|
|
|
|
|
|
|
import { |
|
|
|
getSiteDataActive, |
|
|
|
} from "@/api/base/site.js" |
|
|
|
export default { |
|
|
|
data () { |
|
|
|
return { |
|
|
|
@ -59,6 +73,7 @@ export default { |
|
|
|
uuid: '', |
|
|
|
captcha: '' |
|
|
|
}, |
|
|
|
siteList:[], |
|
|
|
dataRule: { |
|
|
|
userName: [ |
|
|
|
{ required: true, message: '帐号不能为空', trigger: 'blur' } |
|
|
|
@ -96,6 +111,7 @@ export default { |
|
|
|
}, |
|
|
|
created () { |
|
|
|
this.userName(); |
|
|
|
this.getSiteData(); |
|
|
|
const currentPath = localStorage.getItem('redirectPath'); |
|
|
|
if (!currentPath) { |
|
|
|
localStorage.setItem('redirectPath', this.$route.fullPath); |
|
|
|
@ -105,6 +121,15 @@ export default { |
|
|
|
userName(){ |
|
|
|
this.dataForm.userName = localStorage.getItem('userName'); |
|
|
|
}, |
|
|
|
getSiteData(){ |
|
|
|
let data={}; |
|
|
|
getSiteDataActive(data).then(({data}) => { |
|
|
|
this.siteList = data.rows |
|
|
|
if(this.siteList.length>0){ |
|
|
|
this.dataForm.site=this.siteList[0].siteID |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
dataFormSubmit () { |
|
|
|
this.$refs['dataForm'].validate((valid) => { |
|
|
|
if (valid) { |
|
|
|
@ -170,17 +195,17 @@ export default { |
|
|
|
height: 45px; |
|
|
|
width: 70%; /* 缩短输入框长度 */ |
|
|
|
transition: all 0.3s ease; |
|
|
|
|
|
|
|
|
|
|
|
&:focus { |
|
|
|
border-color: #409EFF; |
|
|
|
box-shadow: 0 0 0 3px rgba(64, 158, 255, 0.2); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.el-input { |
|
|
|
width: 70%; /* 缩短输入框长度 */ |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.el-input__inner { |
|
|
|
border: 1px solid #e1e5eb; |
|
|
|
border-radius: 25px; |
|
|
|
@ -188,19 +213,19 @@ export default { |
|
|
|
font-size: 15px; |
|
|
|
height: 45px; |
|
|
|
transition: all 0.3s ease; |
|
|
|
|
|
|
|
|
|
|
|
&:focus { |
|
|
|
border-color: #409EFF; |
|
|
|
box-shadow: 0 0 0 3px rgba(64, 158, 255, 0.2); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.input-with-label { |
|
|
|
display: flex; |
|
|
|
align-items: center; |
|
|
|
width: 100%; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.input-label { |
|
|
|
margin-right: 15px; |
|
|
|
font-size: 15px; |
|
|
|
@ -209,11 +234,11 @@ export default { |
|
|
|
text-align: left; |
|
|
|
font-weight: 500; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.el-input__prefix { |
|
|
|
color: #909399; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.el-button--medium { |
|
|
|
margin-top: 10px; |
|
|
|
padding: 10px 0; /* 减小按钮高度 */ |
|
|
|
|