Files
screen-lnsh/src/pages/Setup.vue

216 lines
5.4 KiB
Vue
Raw Normal View History

2023-02-28 14:02:39 +08:00
<template>
2023-05-09 10:35:11 +08:00
<div class="login-container">
2023-02-28 14:02:39 +08:00
<vue-particles
2023-05-09 10:35:11 +08:00
color="#fff"
:particleOpacity="0.7"
:particlesNumber="60"
shapeType="circle"
:particleSize="4"
linesColor="#fff"
:linesWidth="1"
:lineLinked="true"
:lineOpacity="0.4"
:linesDistance="150"
:moveSpeed="2"
:hoverEffect="true"
hoverMode="grab"
:clickEffect="true"
clickMode="push"
class="lizi"
>
</vue-particles>
<div class="body-container">
<div class="login_wrap">
<div class="login_cnt">
<div class="title-name">系统配置</div>
<div class="login_card">
<div class="card_wrap">
<div class="inputOuter">
<label>域名地址</label>
<input type="text" class="inputStyle" v-model="baseUrl">
</div>
<div class="inputOuter">
<label>刷新时间</label>
<input type="number" class="inputStyle" v-model="setTime">
</div>
<div class="inputOuter">
<label>设备看板</label>
<!-- <select name="equipment" v-model="equipId">
<option :value="e.id" v-for="e in equipment" :key="e.id">{{e.name}}</option>
</select> -->
<div class="select-wraper">
<selectOpt :option="option" :index="index" @change="change"></SelectOpt>
</div>
</div>
2023-02-28 14:02:39 +08:00
</div>
2023-05-09 10:35:11 +08:00
<div class="submit"><input type="submit" value="配 置" class="btn" @click="_config"></div>
2023-02-28 14:02:39 +08:00
</div>
</div>
</div>
</div>
</div>
</template>
<script>
2023-05-09 10:35:11 +08:00
import SelectOpt from '@components/select.vue'
2023-02-28 14:02:39 +08:00
export default {
2023-05-09 10:35:11 +08:00
components: {
SelectOpt
},
2023-02-28 14:02:39 +08:00
data () {
return {
loginname: '',
password: '',
2023-05-30 14:03:58 +08:00
// option: [{index: '1', label: '生产统计'}, {index: '2', label: '仓储监控'}, {index: '3', label: '设备监控'}],
option: [{index: '1', label: '工序生产-左'}, {index: '2', label: '工序生产-右'}],
2023-05-09 10:35:11 +08:00
index: this.$store.getters.equipId,
2023-02-28 14:02:39 +08:00
baseUrl: this.$store.getters.baseUrl,
setTime: this.$store.getters.setTime / 1000,
2023-05-09 10:35:11 +08:00
fullscreen: false
2023-02-28 14:02:39 +08:00
}
},
mounted () {
document.getElementsByTagName('body')[0].className = 'login_bg'
},
beforeDestroy () {
document.body.removeAttribute('class', 'login_bg')
},
methods: {
2023-05-09 10:35:11 +08:00
change (e) {
this.index = e
},
2023-02-28 14:02:39 +08:00
_config () {
let obj = {
baseUrl: this.baseUrl,
setTime: this.setTime * 1000,
2023-05-09 10:35:11 +08:00
equipId: this.index
2023-02-28 14:02:39 +08:00
}
this.$store.dispatch('setConfig', obj)
2023-05-09 10:35:11 +08:00
if (this.index === '1') {
2023-05-30 14:03:58 +08:00
this.$router.push('/homepageone')
2023-05-09 10:35:11 +08:00
} else if (this.index === '2') {
2023-05-30 14:03:58 +08:00
this.$router.push('/homepagetwo')
2023-02-28 14:02:39 +08:00
}
2023-05-30 14:03:58 +08:00
// if (this.index === '1') {
// this.$router.push('/prodcount')
// } else if (this.index === '2') {
// this.$router.push('/storagemonitor')
// } else if (this.index === '3') {
// this.$router.push('/devicemonitor')
// }
2023-02-28 14:02:39 +08:00
let element = document.documentElement
if (this.fullscreen) {
if (document.exitFullscreen) {
document.exitFullscreen()
} else if (document.webkitCancelFullScreen) {
document.webkitCancelFullScreen()
} else if (document.mozCancelFullScreen) {
document.mozCancelFullScreen()
} else if (document.msExitFullscreen) {
document.msExitFullscreen()
}
} else {
if (element.requestFullscreen) {
element.requestFullscreen()
} else if (element.webkitRequestFullScreen) {
element.webkitRequestFullScreen()
} else if (element.mozRequestFullScreen) {
element.mozRequestFullScreen()
} else if (element.msRequestFullscreen) {
// IE11
element.msRequestFullscreen()
}
}
this.fullscreen = !this.fullscreen
}
}
}
</script>
<style lang="stylus" scoped>
2023-05-09 10:35:11 +08:00
@import '~@css/mixin'
.login-container
position relative
_wh(100%, 100%)
z-index 1
background url('../assets/images/loginbg.jpg') center center / 100% 100% no-repeat
.lizi
position absolute
top 0
left 0
z-index 2
_wh(100%, 100%)
.body-container
position relative
z-index 3
_wh(100%, 100%)
_fj(row, center)
margin 0 auto
2023-02-28 14:02:39 +08:00
.login_wrap
2023-05-09 10:35:11 +08:00
width 500px
2023-02-28 14:02:39 +08:00
background-color rgba(255, 255, 255, 0.8)
border-radius 5px
.login_tab
position relative
height 50px
font-size 0
background-color rgba(255, 255, 255, 0.9)
border-radius 5px 5px 0 0
.login_tab_item
float left
width 50%
font-size 16px
line-height 50px
color #333333
text-align center
cursor pointer
.login_tab_line
position absolute
width 50%
height 2px
background-color #2778f3
left 0
bottom 0
.login_cnt
2023-05-09 10:35:11 +08:00
width 100%
padding 15px
.title-name
_font(16px, 28px, #000,,center)
margin-bottom 10px
2023-02-28 14:02:39 +08:00
.login_card
2023-05-09 10:35:11 +08:00
width 100%
2023-02-28 14:02:39 +08:00
.inputOuter
2023-05-09 10:35:11 +08:00
_fj(row)
2023-02-28 14:02:39 +08:00
height 38px
2023-05-09 10:35:11 +08:00
line-height 38px
2023-02-28 14:02:39 +08:00
width 100%
margin-bottom 12px
2023-05-09 10:35:11 +08:00
.inputStyle, .select-wraper
_wh(calc(100% - 100px), 38px)
font-size 15px
2023-02-28 14:02:39 +08:00
background none
line-height 38px
color #999999
text-indent 10px
border none
box-sizing border-box
background-color #ffffff
.submit
width 100%
background-color #2778f3
border-radius 3px
margin-top 5px
.btn
background none
height 40px
line-height 39px
width 100%
outline none
font-weight normal
label
2023-05-09 10:35:11 +08:00
width 100px
font-size 15px
2023-02-28 14:02:39 +08:00
line-height 38px
color #333333
</style>