2023-05-22 19:02:04 +08:00
|
|
|
|
<template>
|
|
|
|
|
|
<div class="login-container">
|
|
|
|
|
|
<div class="login-wraper">
|
|
|
|
|
|
<div class="login-logo-wraper">
|
|
|
|
|
|
<div class="login-logo"></div>
|
|
|
|
|
|
<div class="login-logo-txts">
|
|
|
|
|
|
<p class="login-logo-txt1">诺力智能搬运车系统</p>
|
|
|
|
|
|
<p class="login-logo-txt2">NoBleLift intelligent truck system</p>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="login-content">
|
2023-05-24 09:58:28 +08:00
|
|
|
|
<div v-show="tab === 0" class="login-content_wraper">
|
2023-05-22 19:02:04 +08:00
|
|
|
|
<div class="dl">登录</div>
|
|
|
|
|
|
<div class="login-items-wraper">
|
|
|
|
|
|
<div class="login-item">
|
2023-05-24 09:58:28 +08:00
|
|
|
|
<div class="login-label" @click="toFocus(1)">用户名</div>
|
|
|
|
|
|
<input type="text" class="login-input" ref="input1" v-model="username">
|
2023-05-22 19:02:04 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<div class="login-item">
|
2023-05-24 09:58:28 +08:00
|
|
|
|
<div class="login-label" @click="toFocus(2)">密码</div>
|
|
|
|
|
|
<input type="password" class="login-input" ref="input2" v-model="password">
|
2023-05-22 19:02:04 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2023-05-24 09:58:28 +08:00
|
|
|
|
<div class="login-setup-wraper">
|
|
|
|
|
|
<div class="setup-info pointer" @click="toSetup">配置信息</div>
|
2023-06-01 09:34:14 +08:00
|
|
|
|
<!-- <router-link to="/home">忘记密码</router-link> -->
|
2023-05-24 09:58:28 +08:00
|
|
|
|
</div>
|
2023-05-22 19:02:04 +08:00
|
|
|
|
<div class="login-buttons-wraper">
|
2023-05-24 09:58:28 +08:00
|
|
|
|
<button class="button button--primary button-login" :disabled="disabled" @click="saveLogin">登录</button>
|
2023-05-22 19:02:04 +08:00
|
|
|
|
</div>
|
2023-05-24 09:58:28 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<div v-show="tab === 1" class="login-content_wraper">
|
|
|
|
|
|
<div class="dl">配置</div>
|
|
|
|
|
|
<div class="login-items-wraper">
|
|
|
|
|
|
<div class="login-item">
|
|
|
|
|
|
<div class="login-label" @click="toFocus(3)">域名地址</div>
|
|
|
|
|
|
<input type="text" class="login-input" ref="input3" v-model="baseUrl">
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="login-item">
|
|
|
|
|
|
<div class="login-label" @click="toFocus(4)">刷新时间(秒)</div>
|
|
|
|
|
|
<input type="number" class="login-input" ref="input4" v-model="setTime">
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="login-setup-wraper login-setup-wraper__r">
|
|
|
|
|
|
<div class="setup-info pointer" @click="toLogin">立即登录</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="login-buttons-wraper">
|
|
|
|
|
|
<button class="button button--primary button-login" @click="saveSetup">配置</button>
|
2023-05-22 19:02:04 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
2023-05-24 09:58:28 +08:00
|
|
|
|
<script>
|
|
|
|
|
|
import {authlogin} from '@config/getData2.js'
|
|
|
|
|
|
import {encrypt} from '../../../main.js'
|
|
|
|
|
|
export default {
|
|
|
|
|
|
data () {
|
|
|
|
|
|
return {
|
|
|
|
|
|
tab: 0,
|
|
|
|
|
|
username: '',
|
|
|
|
|
|
password: '',
|
|
|
|
|
|
baseUrl: this.$store.getters.baseUrl,
|
|
|
|
|
|
setTime: this.$store.getters.setTime / 1000,
|
|
|
|
|
|
disabled: false
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
mounted () {
|
|
|
|
|
|
// 点对点项目分辨率 1024 * 768
|
|
|
|
|
|
// alert(document.body.clientWidth, 'a')
|
|
|
|
|
|
// alert(document.body.clientHeight, 'b')
|
|
|
|
|
|
// alert(window.screen.width, 'c')
|
|
|
|
|
|
// alert(window.screen.height, 'd')
|
|
|
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
|
|
|
toFocus (i) {
|
|
|
|
|
|
switch (i) {
|
|
|
|
|
|
case 1:
|
|
|
|
|
|
this.$refs.input1.focus()
|
|
|
|
|
|
break
|
|
|
|
|
|
case 2:
|
|
|
|
|
|
this.$refs.input2.focus()
|
|
|
|
|
|
break
|
|
|
|
|
|
case 3:
|
|
|
|
|
|
this.$refs.input3.focus()
|
|
|
|
|
|
break
|
|
|
|
|
|
case 4:
|
|
|
|
|
|
this.$refs.input4.focus()
|
|
|
|
|
|
break
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
toSetup () {
|
|
|
|
|
|
this.tab = 1
|
|
|
|
|
|
},
|
|
|
|
|
|
toLogin () {
|
|
|
|
|
|
this.tab = 0
|
|
|
|
|
|
},
|
|
|
|
|
|
saveSetup () {
|
|
|
|
|
|
let obj = {
|
|
|
|
|
|
baseUrl: this.baseUrl,
|
|
|
|
|
|
setTime: this.setTime * 1000
|
|
|
|
|
|
}
|
|
|
|
|
|
this.$store.dispatch('setConfig', obj)
|
|
|
|
|
|
this.toLogin()
|
|
|
|
|
|
},
|
|
|
|
|
|
saveLogin () {
|
|
|
|
|
|
this.disabled = true
|
|
|
|
|
|
if (!this.username) {
|
|
|
|
|
|
this.toast('请输入用户名')
|
|
|
|
|
|
this.disabled = false
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
if (!this.password) {
|
|
|
|
|
|
this.toast('请输入密码')
|
|
|
|
|
|
this.disabled = false
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
this._authlogin()
|
|
|
|
|
|
},
|
|
|
|
|
|
async _authlogin () {
|
|
|
|
|
|
try {
|
|
|
|
|
|
let res = await authlogin(this.username, encrypt(this.password))
|
|
|
|
|
|
let obj = {}
|
|
|
|
|
|
obj = Object.assign({}, res)
|
|
|
|
|
|
this.$store.dispatch('userInfo', JSON.stringify(obj))
|
2023-05-30 14:04:57 +08:00
|
|
|
|
this.$router.push('/index/home')
|
2023-05-24 09:58:28 +08:00
|
|
|
|
} catch (err) {
|
|
|
|
|
|
this.disabled = false
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
2023-05-22 19:02:04 +08:00
|
|
|
|
<style lang="stylus" scoped>
|
|
|
|
|
|
@import '~@style/mixin'
|
|
|
|
|
|
.login-container
|
|
|
|
|
|
_wh(100%, 100%)
|
|
|
|
|
|
background-color #64b4dc
|
|
|
|
|
|
background-image linear-gradient(to right bottom,#4489e0, #55a1df, #64b4dc)
|
|
|
|
|
|
_fj(center)
|
|
|
|
|
|
.login-wraper
|
|
|
|
|
|
_fj()
|
2023-05-24 09:58:28 +08:00
|
|
|
|
_wh(70vw, 65vh)
|
2023-05-22 19:02:04 +08:00
|
|
|
|
padding 20px
|
|
|
|
|
|
background-color #fff
|
|
|
|
|
|
border-radius 20px
|
|
|
|
|
|
.login-logo-wraper
|
|
|
|
|
|
width 50%
|
|
|
|
|
|
padding 20px
|
|
|
|
|
|
_fj(center,,column)
|
|
|
|
|
|
.login-logo
|
|
|
|
|
|
width 100px
|
|
|
|
|
|
height 112px
|
|
|
|
|
|
background center / 100% 100% url(../../../images/aio/car1.png) no-repeat
|
|
|
|
|
|
.login-logo-txts
|
|
|
|
|
|
// margin-top 20px
|
|
|
|
|
|
text-align center
|
|
|
|
|
|
.login-logo-txt1
|
|
|
|
|
|
_font(24px, 34px, $red2,bold,center)
|
|
|
|
|
|
.login-logo-txt2
|
|
|
|
|
|
_font(20px, 34px, #464646,,center)
|
|
|
|
|
|
.login-content
|
|
|
|
|
|
width 50%
|
|
|
|
|
|
padding 20px
|
|
|
|
|
|
.login-content_wraper
|
|
|
|
|
|
width 100%
|
2023-05-24 09:58:28 +08:00
|
|
|
|
max-width 260px
|
2023-05-22 19:02:04 +08:00
|
|
|
|
margin 0 auto
|
|
|
|
|
|
_fj(center,,column)
|
|
|
|
|
|
.dl
|
|
|
|
|
|
width 100%
|
|
|
|
|
|
_font(16px, 28px, #333, bold, center)
|
2023-05-24 09:58:28 +08:00
|
|
|
|
margin-bottom 30px
|
2023-05-22 19:02:04 +08:00
|
|
|
|
.login-items-wraper
|
|
|
|
|
|
width 100%
|
|
|
|
|
|
.login-item
|
2023-05-24 09:58:28 +08:00
|
|
|
|
_fj()
|
|
|
|
|
|
_wh(100%, 42px)
|
|
|
|
|
|
background-color #fff
|
|
|
|
|
|
padding 5px 12px
|
|
|
|
|
|
border 1px solid $gray2
|
|
|
|
|
|
border-radius 20px
|
2023-05-22 19:02:04 +08:00
|
|
|
|
+.login-item
|
|
|
|
|
|
margin-top 20px
|
2023-05-24 09:58:28 +08:00
|
|
|
|
.login-label
|
|
|
|
|
|
width 102px
|
|
|
|
|
|
line-height 30px
|
|
|
|
|
|
_font(14px, 30px, $gray1,,)
|
2023-05-22 19:02:04 +08:00
|
|
|
|
.login-input
|
2023-05-24 09:58:28 +08:00
|
|
|
|
width calc(100% - 102px)
|
|
|
|
|
|
line-height 30px
|
|
|
|
|
|
_font(14px, 30px, $gray1,,)
|
|
|
|
|
|
.login-setup-wraper
|
2023-05-22 19:02:04 +08:00
|
|
|
|
width 100%
|
2023-05-24 09:58:28 +08:00
|
|
|
|
margin-top 10px
|
|
|
|
|
|
_fj()
|
2023-05-22 19:02:04 +08:00
|
|
|
|
a
|
|
|
|
|
|
_font(14px, 20px, $red1,,)
|
2023-05-24 09:58:28 +08:00
|
|
|
|
.login-setup-wraper__r
|
|
|
|
|
|
justify-content flex-end
|
|
|
|
|
|
.setup-info
|
|
|
|
|
|
color $red1
|
|
|
|
|
|
.setup-info
|
|
|
|
|
|
_font(14px, 20px, $fc1,,)
|
2023-05-22 19:02:04 +08:00
|
|
|
|
.login-buttons-wraper
|
|
|
|
|
|
width 100%
|
2023-05-24 09:58:28 +08:00
|
|
|
|
margin-top 10px
|
2023-05-22 19:02:04 +08:00
|
|
|
|
.button-login
|
|
|
|
|
|
width 100%
|
2023-05-24 09:58:28 +08:00
|
|
|
|
border-radius 20px
|
|
|
|
|
|
letter-spacing 5px
|
2023-05-22 19:02:04 +08:00
|
|
|
|
</style>
|