用户管理

This commit is contained in:
2023-05-24 09:58:48 +08:00
parent ce3e78f13c
commit 59ca5ef790
6 changed files with 614 additions and 534 deletions

View File

@@ -9,7 +9,7 @@
<table>
<tr>
<th>序号</th>
<th>任务号</th>
<th>用户名</th>
<th>姓名</th>
<th>电话</th>
<th>性别</th>
@@ -18,16 +18,16 @@
</tr>
<tr v-for="(e, i) in datalist" :key="i">
<td>{{i+1}}</td>
<td>admin</td>
<td>管理员</td>
<td>18888888888</td>
<td></td>
<td>2023-05-05 08:50:08</td>
<td>{{ e.username }}</td>
<td>{{ e.personName }}</td>
<td>{{ e.phone }}</td>
<td>{{ e.gender }}</td>
<td>{{ e.createTime }}</td>
<td>
<div class="row">
<button class="button button--primary grid_button" @click="showDialog('2')">修改</button>
<button class="button button--primary grid_button" @click="showDialog('3')">重置密码</button>
<button class="button button--primary grid_button" @click="showDialog('4')">删除</button>
<button class="button button--primary grid_button" @click="showDialog('2', e)">修改</button>
<button class="button button--primary grid_button" @click="showDialog('3', e)">重置密码</button>
<button class="button button--primary grid_button" @click="showDialog('4', e)">删除</button>
</div>
</td>
</tr>
@@ -37,6 +37,7 @@
ref="child"
:title="title"
:type="type"
:unclick="unclick"
@toSure="toSureDialog"
>
<div v-if="type === '1' || type === '2'" class="form_wraper">
@@ -87,9 +88,9 @@
<el-select v-model="value" placeholder="请选择">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
:key="item.roleId"
:label="item.name"
:value="item.roleId">
</el-option>
</el-select>
</div>
@@ -104,36 +105,28 @@
<script>
import jxDialog from '@components/dialog.vue'
import {usersQuery, sysRoleQuery, usersAdd, usersEdit, usersDelete} from '@config/getData2.js'
export default {
components: {
jxDialog
},
data () {
return {
datalist: [{name: ''}, {name: 'a'}, {name: 'a'}, {name: 'a'}, {name: 'a'}, {name: 'a'}, {name: 'a'}],
datalist: [],
active: false,
type: '',
title: '',
username: '',
phone: '',
name: '',
sexArr: [{label: '男', value: '1'}, {label: '女', value: '2'}],
sex: '1',
sexArr: [{label: '男', value: ''}, {label: '女', value: ''}],
sex: '',
password: '',
options: [{
value: '选项1',
label: '超级管理员'
}, {
value: '选项2',
label: '系统管理员'
}, {
value: '选项3',
label: '普通用户'
}, {
value: '选项4',
label: '开发人员'
}],
value: ''
options: [],
value: '',
disabled1: false,
pkObj: {},
unclick: false
}
},
watch: {
@@ -154,33 +147,181 @@ export default {
default:
this.title = ''
}
},
username (val) {
if (this.type === '1' && this.password !== '' && val !== '') {
this.unclick = false
}
if (this.type === '2' && val !== '') {
this.unclick = false
}
},
password (val) {
if (this.type === '1' && this.password !== '' && val !== '') {
this.unclick = false
}
}
},
created () {
this._usersQuery()
this._sysRoleQuery()
},
methods: {
showDialog (type) {
async _usersQuery () {
let res = await usersQuery('0', '100')
this.datalist = [...res]
},
async _sysRoleQuery () {
let res = await sysRoleQuery('0', '100')
this.options = [...res]
},
showDialog (type, e) {
this.type = type
this.$refs.child.active = true
switch (type) {
case '1':
this.username = ''
this.phone = ''
this.name = ''
this.sex = ''
this.password = ''
this.value = ''
this.unclick = true
break
case '2':
this.pkObj = e
this.username = e.username
this.phone = e.phone
this.name = e.personName
this.sex = this.gender
this.options.map(el => {
if (el.roleId === e.roles[0].roleId) {
this.value = el.roleId
}
})
if (this.username && this.password) {
this.unclick = true
}
break
case '3':
this.pkObj = e
this.unclick = false
break
case '4':
this.pkObj = e
this.unclick = false
break
}
},
toSureDialog (type) {
switch (type) {
case '1':
console.log(type)
this._usersAdd()
break
case '2':
console.log(type)
this._usersEdit()
break
case '3':
console.log(type)
this.resetPassword()
break
case '4':
console.log(type)
this._usersDelete()
break
default:
console.log(type)
}
},
toRadio (e) {
this.sex = e.value
},
async _usersAdd () {
this.$refs.child.disabled = true
if (!this.username) {
this.toast('用户名不能为空')
this.$refs.child.disabled = false
return
}
if (!this.password) {
this.toast('密码不能为空')
this.$refs.child.disabled = false
return
}
try {
let rolesIds = []
this.options.map(el => {
if (el.roleId === this.value) {
rolesIds.push(el)
}
})
await usersAdd(this.username, this.name, this.sex, this.phone, rolesIds, this.password)
this.toast('操作成功')
this._usersQuery()
this.$refs.child.active = false
this.$refs.child.disabled = false
} catch (e) {
this.$refs.child.active = false
this.$refs.child.disabled = false
}
},
async _usersEdit () {
this.$refs.child.disabled = true
if (!this.username) {
this.toast('用户名不能为空')
this.$refs.child.disabled = false
return
}
try {
let rolesIds = []
this.options.map(el => {
if (el.roleId === this.value) {
rolesIds.push(el)
}
})
let obj = {
userId: this.pkObj.userId,
username: this.username,
personName: this.name,
gender: this.sex,
phone: this.phone,
rolesIds: rolesIds
}
await usersEdit(obj)
this.toast('操作成功')
this._usersQuery()
this.$refs.child.active = false
this.$refs.child.disabled = false
} catch (e) {
this.$refs.child.active = false
this.$refs.child.disabled = false
}
},
async resetPassword () {
this.$refs.child.disabled = true
try {
let obj = {
userId: this.pkObj.userId,
password: '123456'
}
await usersEdit(obj)
this.toast('操作成功')
this._usersQuery()
this.$refs.child.active = false
this.$refs.child.disabled = false
} catch (e) {
this.$refs.child.active = false
this.$refs.child.disabled = false
}
},
async _usersDelete () {
this.$refs.child.disabled = true
try {
await usersDelete([this.pkObj.userId])
this.toast('操作成功')
this._usersQuery()
this.$refs.child.active = false
this.$refs.child.disabled = false
} catch (e) {
this.$refs.child.active = false
this.$refs.child.disabled = false
}
}
}
}

View File

@@ -1,342 +0,0 @@
<template>
<div class="right_side">
<div class="right_side_box_1">
<ul class="site_btn_box site_btn_box_1">
<li class="site_btn">{{status.inLineStatus_name}}</li>
<li class="site_btn">{{status.UpdateStatus_name}}</li>
</ul>
<ul class="site_btn_box site_btn_box_2">
<li class="site_btn_1">
<button class="btn_big" type="button" @click="_softStart" :disabled="disabled1">
<span class="state_icon state_icon_1"></span>
<span class="state_title">软启动</span>
</button>
</li>
<li class="site_btn_1">
<button class="btn_big" @click="_skipStartPoint" :disabled="disabled2">
<span class="state_icon state_icon_2"></span>
<span class="state_title">跳过起点</span>
</button>
</li>
<li class="site_btn_1">
<button class="btn_big" @click="_exit" :disabled="disabled5">
<span class="state_icon state_icon_3"></span>
<span class="state_title">退出</span>
</button>
</li>
<li class="site_btn_1">
<button class="btn_big" @click="_fullscreen">
<span class="state_icon state_icon_4"></span>
<span class="state_title">全屏</span>
</button>
</li>
<li class="site_btn_1">
<button class="btn_big" @click="_ShutDown" :disabled="disabled3">
<span class="state_icon state_icon_5"></span>
<span class="state_title">关机</span>
</button>
</li>
</ul>
<ul class="site_btn_box site_btn_box_2 site_btn_box_3">
<li class="site_btn_3"><button class="btn_big" @click="_queryRestPoint">初始化坐标</button></li>
<!-- <li class="site_btn_3">SLAM页面</li> -->
</ul>
</div>
</div>
</template>
<script>
import {softStart, skipStartPoint, ShutDown, queryRestPoint, restCoordinate, queryAgvStatus, quitNow} from '@/config/getData2.js'
export default {
data () {
return {
interTime: this.$store.getters.setTime,
timer: null,
disabled1: false,
disabled2: false,
disabled3: false,
disabled4: false,
disabled5: false,
show: false,
fullscreen: false,
result: [],
obj: {},
status: {}
}
},
created () {
// this._queryAgvStatus()
// this.refresh()
},
beforeDestroy () {
clearInterval(this.timer)
},
methods: {
refresh () {
this.timer = setInterval(() => {
this._queryAgvStatus()
}, this.interTime)
},
async _softStart () {
this.disabled1 = true
try {
let res = await softStart()
if (res.code === '1') {
this.toast(res.desc)
} else {
this.toast(res.desc)
}
this.disabled1 = false
} catch (e) {
this.disabled1 = false
}
},
async _skipStartPoint () {
this.disabled2 = true
try {
let res = await skipStartPoint()
if (res.code === '1') {
this.toast(res.desc)
} else {
this.toast(res.desc)
}
this.disabled2 = false
} catch (e) {
this.disabled2 = false
}
},
async _ShutDown () {
this.disabled3 = true
try {
let res = await ShutDown()
if (res.code === '1') {
this.toast(res.desc)
} else {
this.toast(res.desc)
}
this.disabled3 = false
} catch (e) {
this.disabled3 = false
}
},
async _exit () {
// window.close()
this.disabled5 = true
try {
let res = await quitNow()
if (res.code === '1') {
this.toast(res.desc)
} else {
this.toast(res.desc)
}
this.disabled5 = false
} catch (e) {
this.disabled5 = false
}
},
_fullscreen () {
// let element = document.documentElement
if (document.exitFullscreen) {
document.exitFullscreen()
} else if (document.webkitCancelFullScreen) {
document.webkitCancelFullScreen()
} else if (document.mozCancelFullScreen) {
document.mozCancelFullScreen()
} else if (document.msExitFullscreen) {
document.msExitFullscreen()
}
// 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
},
async _queryRestPoint () {
let res = await queryRestPoint()
if (res.code === '1') {
this.result = res.result
this.show = true
} else {
this.toast(res.desc)
}
},
tocheck (e) {
this.obj = e
},
async _restCoordinate () {
this.disabled4 = true
if (JSON.stringify(this.obj) === '{}') {
this.toast('请选择坐标')
this.disabled4 = false
return
}
try {
let res = await restCoordinate(this.obj.point_code, this.obj.point_name, this.obj.x, this.obj.y, this.obj.t)
if (res.code === '1') {
this.toast(res.desc)
this.show = false
} else {
this.toast(res.desc)
}
this.disabled4 = false
} catch (e) {
this.disabled4 = false
}
},
async _queryAgvStatus () {
let res = await queryAgvStatus()
if (res.code === '1') {
this.status = res.result
} else {
this.toast(res.desc)
}
}
}
}
</script>
<style lang="stylus" scoped>
@import '~@style/mixin'
.pop_btns_box
_wh(100%,.88rem)
_fj(center)
.pop_btn
_wh(1.8rem,.88rem)
background #989EBB
border 2px solid #8B90A6
border-radius: .28rem
_font(.32rem,.88rem,#fff,500,center)
margin 0 .12rem
&:disabled
background #989EBB
border 2px solid #8B90A6
.pop_btn_primary
background #FD6A35
border 2px solid #E74F19
.right_side_box_1
_wh(100%,100%)
padding .26rem .34rem 0 .48rem
.site_btn_box
_wh(100%,auto)
overflow hidden
.site_btn_box_2
width 10rem
margin-top .7rem
_fj()
.site_btn_box_3
_fj(flex-start)
margin-top .2rem
.site_btn
float left
_wh(2.6rem,1rem)
background #FFFFFF
border 1.6px solid #54C0B3
box-shadow 2px 0px 5px 0px rgba(222,222,222,1)
border-radius .16rem
_font(.32rem,1rem,#54C0B3,600,center)
margin-right .3rem
.site_btn_1
float left
_wh(1.84rem,1.84rem)
_bis('../../../images/aio/agv_btn_bg.png', 100%)
.btn_big
_wh(100%,100%)
background none
_fj(center,,column)
cursor pointer
.state_icon
_wh(.6rem,.6rem)
margin-bottom .13rem
.state_icon_1
_bis('../../../images/aio/agv_1.png', 100%)
.state_icon_2
_bis('../../../images/aio/agv_2.png', 100%)
.state_icon_3
_bis('../../../images/aio/agv_3.png', 100%)
.state_icon_4
_bis('../../../images/aio/agv_4.png', 100%)
.state_icon_5
_bis('../../../images/aio/agv_5.png', 100%)
.state_title
_font(.32rem,.45rem,#464646,500,)
.site_btn_3
_wh(4.74rem,1.44rem)
_font(.32rem,1.44rem,#464646,600,center)
_bis('../../../images/aio/agv_btn_bg_1.png',100%)
.pop_wrapper
position fixed
top 0
bottom 0
left 0
right 0
text-align center
z-index 10000
&::after
content ""
display inline-block
height 100%
width 0
vertical-align middle
.modal
position fixed
left 0
top 0
_wh(100%,100%)
opacity .5
background #000
z-index 999
.pop_box
display inline-block
vertical-align middle
_wh(9rem,6.4rem)
padding .2rem
background-color #fff
border-radius .16rem
overflow hidden
h2
_font(.4rem,.56rem,#464646,600,center)
.pop_ul_wrapper
_wh(6.88rem,4.1rem)
margin .15rem auto
overflow hidden
.pop_ul
_wh(100%, 100%)
overflow-y auto
li
_wh(100%,.8rem)
padding 0 .2rem
border-bottom 2px dotted #D6D6D6
text-align left
span
display inline-block
_font(.28rem,.8rem,#323232,600,)
vertical-align top
padding-right .15rem
&:nth-child(1)
_font(.24rem,.8rem,#323232,600,)
background #DFE1E6
border-top-left-radius 0.1rem
border-top-right-radius 0.1rem
.pop_ul .checked
background-color #FD6A35
.pop_ul li.checked span
color #fff
</style>

View File

@@ -1,76 +0,0 @@
<template>
<div class="right_side">
<div class="right_side_box_1">
<ul class="site_btn_box">
<li class="site_btn" :class="result.stopButton_status === '0' ? 'site_btn_disabled' : ''">
<span class="state_color"></span>
<span class="state_title">急停按钮</span>
</li>
<li class="site_btn" :class="result.speedReduction_status === '0' ? 'site_btn_disabled' : ''">
<span class="state_color"></span>
<span class="state_title">避障减速</span>
</li>
<li class="site_btn" :class="result.resetButton_status === '0' ? 'site_btn_disabled' : ''">
<span class="state_color"></span>
<span class="state_title">复位按钮</span>
</li>
<li class="site_btn" :class="result.speedStop_status === '0' ? 'site_btn_disabled' : ''">
<span class="state_color"></span>
<span class="state_title">避障停车</span>
</li>
<li class="site_btn" :class="result.securityTentacle_status === '0' ? 'site_btn_disabled' : ''">
<span class="state_color"></span>
<span class="state_title">安全触边</span>
</li>
</ul>
</div>
</div>
</template>
<script>
export default {
data () {
return {
interTime: this.$store.getters.setTime,
timer: null,
result: {}
}
}
}
</script>
<style lang="stylus" scoped>
@import '~@style/mixin'
.right_side_box_1
_wh(8rem,100%)
padding .26rem .34rem 0 0
.site_btn_box
_wh(100%,auto)
margin .24rem 0 0 .24rem
overflow hidden
.site_btn
float left
_wh(2.84rem,1.24rem)
background #FFFFFF
border .12rem solid #DFE1E6
border-radius .16rem
margin 0 .24rem .2rem
_fj(center)
span
display block
.state_color
_wh(.32rem,.32rem)
background #00C852
border-radius .2rem
.state_title
_font(.32rem,1rem,#696969,,)
padding-left .24rem
.site_btn_disabled
opacity .5
.site_btn
border .12rem solid #DFE1E6
.state_color
background #C6C6C6
.state_title
color #696969
</style>

View File

@@ -1,19 +1,33 @@
<template>
<div class="right_side">
<div class="content_wrap">
<div class="content_wrap_inner">
<div class="state_wrap">
<div class="state_tip">偏离状态</div>
<div class="state_content">
<div class="state_item_1">{{status.inLineStatus_name}}</div>
</div>
</div>
<div class="state_wrap">
<div class="state_tip">更新状态</div>
<div class="state_content">
<div class="state_item_1">{{status.UpdateStatus_name}}</div>
</div>
</div>
</div>
<div class="state_wrap">
<div class="state_tip">显示屏控制</div>
<div class="state_content state_content_1">
<div class="state_item_switch is-checked">
<div class="state_content">
<button class="state_item_switch" :class="{'is-checked': switch1 === '1'}" :disabled="sdisabled1" @click="switchDown1('2', switch1)">
<input type="checkbox" class="switch__input">
<span class="switch_core"></span>
</div>
</button>
</div>
</div>
<div class="state_wrap">
<div class="state_tip">TCS控制</div>
<div class="state_content state_content_1">
<div class="state_item_switch is-checked">
<div class="state_content">
<div class="state_item_switch" :class="{'is-checked': switch2 === '1'}" :disabled="sdisabled2" @click="switchDown2('3', switch1)">
<input type="checkbox" class="switch__input">
<span class="switch_core"></span>
</div>
@@ -21,8 +35,8 @@
</div>
<div class="state_wrap">
<div class="state_tip">RC控制</div>
<div class="state_content state_content_1">
<div class="state_item_switch is-checked">
<div class="state_content">
<div class="state_item_switch" :class="{'is-checked': switch3 === '1'}" :disabled="sdisabled3" @click="switchDown3('4', switch1)">
<input type="checkbox" class="switch__input">
<span class="switch_core"></span>
</div>
@@ -30,8 +44,8 @@
</div>
<div class="state_wrap">
<div class="state_tip">Joy控制</div>
<div class="state_content state_content_1">
<div class="state_item_switch is-checked">
<div class="state_content">
<div class="state_item_switch" :class="{'is-checked': switch4 === '1'}" :disabled="sdisabled4" @click="switchDown4('5', switch1)">
<input type="checkbox" class="switch__input">
<span class="switch_core"></span>
</div>
@@ -40,47 +54,299 @@
<div class="state_wrap">
<div class="state_tip">AGV</div>
<div class="state_content">
<div class="state_item_4">
<button class="state_item_4 pointer" @click="_skipStartPoint" :disabled="disabled2">
<div class="state_item_4_wrap">
<span class="state_item_4_btn state_icon_2"></span>
<span class="state_item_4_txt">跳过起点</span>
</div>
<div class="state_item_4">
</button>
<button class="state_item_4 pointer" @click="_queryRestPoint" :disabled="disabled6">
<div class="state_item_4_wrap">
<span class="state_item_4_btn state_icon_6"></span>
<span class="state_item_4_txt">初始化坐标</span>
</div>
<div class="state_item_4">
</button>
<button class="state_item_4 pointer" @click="_fullscreen">
<div class="state_item_4_wrap">
<span class="state_item_4_btn state_icon_4"></span>
<span class="state_item_4_txt">全屏</span>
</div>
<div class="state_item_4">
</button>
<button class="state_item_4 pointer" @click="_exit" :disabled="disabled5">
<div class="state_item_4_wrap">
<span class="state_item_4_btn state_icon_3"></span>
<span class="state_item_4_txt">退出</span>
</div>
<div class="state_item_4">
</button>
<button class="state_item_4 pointer" @click="switchDown('1', '0')" :disabled="disabled3">
<div class="state_item_4_wrap">
<span class="state_item_4_btn state_icon_5"></span>
<span class="state_item_4_txt">关机</span>
</div>
<div class="state_item_4">
</button>
<button class="state_item_4 pointer" @click="_softStart" :disabled="disabled1">
<div class="state_item_4_wrap">
<span class="state_item_4_btn state_icon_1"></span>
<span class="state_item_4_txt">软启动</span>
</div>
</button>
</div>
</div>
</div>
<div v-show="show" class="pop_wrapper">
<div class="pop_box">
<h2>初始化坐标</h2>
<div class="pop_ul_wrapper">
<ul class="pop_ul">
<li>坐标信息</li>
<li v-for="(e,i) in result" :key="i" @click="tocheck(e)" :class="{'checked': e === obj}"><span class="pop_ul_span">{{e.point_code}}</span><span class="pop_ul_span">{{e.point_name}}</span><span class="pop_ul_span">{{e.x}}</span><span class="pop_ul_span">{{e.y}}</span><span class="pop_ul_span">{{e.t}}</span></li>
</ul>
</div>
<div class="pop_btns_box">
<button class="button button--primary" :class="{'button--info': JSON.stringify(obj) ==='{}'}" :disabled="disabled4" @click="_restCoordinate">确定</button>
<button class="button button--primary" @click="show=false">退出</button>
</div>
</div>
</div>
<div v-show="show" class="modal"></div>
</div>
</template>
<script>
import {softStart, skipStartPoint, ShutDown, queryRestPoint, restCoordinate, queryAgvStatus, quitNow} from '@config/getData2.js'
export default {
data () {
return {
interTime: this.$store.getters.setTime,
timer: null,
disabled1: false,
disabled2: false,
disabled3: false,
disabled4: false,
disabled5: false,
disabled6: false,
show: false,
fullscreen: false,
result: [],
obj: {},
status: {},
switch1: '0',
switch2: '0',
switch3: '0',
switch4: '0',
sdisabled1: false,
sdisabled2: false,
sdisabled3: false,
sdisabled4: false
}
},
created () {
this._queryAgvStatus()
this.refresh()
},
beforeDestroy () {
clearInterval(this.timer)
},
methods: {
refresh () {
this.timer = setInterval(() => {
this._queryAgvStatus()
}, this.interTime)
},
async _softStart () {
this.disabled1 = true
try {
let res = await softStart()
if (res.code === '1') {
this.toast(res.desc)
} else {
this.toast(res.desc)
}
this.disabled1 = false
} catch (e) {
this.disabled1 = false
}
},
async _skipStartPoint () {
this.disabled2 = true
try {
let res = await skipStartPoint()
if (res.code === '1') {
this.toast(res.desc)
} else {
this.toast(res.desc)
}
this.disabled2 = false
} catch (e) {
this.disabled2 = false
}
},
switchDown1 (type, bool) {
this.sdisabled1 = false
this._ShutDown(type, bool)
},
switchDown2 (type, bool) {
this.sdisabled2 = false
this._ShutDown(type, bool)
},
switchDown3 (type, bool) {
this.sdisabled3 = false
this._ShutDown(type, bool)
},
switchDown4 (type, bool) {
this.sdisabled4 = false
this._ShutDown(type, bool)
},
switchDown (type, bool) {
this.disabled3 = false
this._ShutDown(type, bool)
},
async _ShutDown (type, bool) {
try {
let res = await ShutDown(type, bool) // type : 1-关机、2-显示屏控制、3-TCS控制、4-RC控制、5-Joy控制 bool : 开关的值开启传1关闭传0
if (res.code === '1') {
this.toast(res.desc)
switch (type) {
case 2:
this.switch1 = this.switch1 === '0' ? '1' : '0'
break
case 3:
this.switch2 = this.switch2 === '0' ? '1' : '0'
break
case 4:
this.switch3 = this.switch3 === '0' ? '1' : '0'
break
case 5:
this.switch4 = this.switch4 === '0' ? '1' : '0'
break
}
} else {
this.toast(res.desc)
}
this.disabled3 = false
this.sdisabled1 = false
this.sdisabled2 = false
this.sdisabled3 = false
this.sdisabled4 = false
} catch (e) {
this.disabled3 = false
this.disabled3 = false
this.sdisabled1 = false
this.sdisabled2 = false
this.sdisabled3 = false
this.sdisabled4 = false
}
},
async _exit () {
this.disabled5 = true
try {
let res = await quitNow()
if (res.code === '1') {
this.toast(res.desc)
} else {
this.toast(res.desc)
}
this.disabled5 = false
} catch (e) {
this.disabled5 = false
}
},
_fullscreen () {
if (document.exitFullscreen) {
document.exitFullscreen()
} else if (document.webkitCancelFullScreen) {
document.webkitCancelFullScreen()
} else if (document.mozCancelFullScreen) {
document.mozCancelFullScreen()
} else if (document.msExitFullscreen) {
document.msExitFullscreen()
}
},
async _queryRestPoint () {
this.disabled6 = true
try {
let res = await queryRestPoint()
if (res.code === '1') {
this.result = res.result
this.show = true
} else {
this.toast(res.desc)
}
this.disabled6 = false
} catch (e) {
this.disabled6 = false
}
},
tocheck (e) {
this.obj = e
},
async _restCoordinate () {
this.disabled4 = true
if (JSON.stringify(this.obj) === '{}') {
this.toast('请选择坐标')
this.disabled4 = false
return
}
try {
let res = await restCoordinate(this.obj.point_code, this.obj.point_name, this.obj.x, this.obj.y, this.obj.t)
if (res.code === '1') {
this.toast(res.desc)
this.show = false
} else {
this.toast(res.desc)
}
this.disabled4 = false
} catch (e) {
this.disabled4 = false
}
},
async _queryAgvStatus () {
let res = await queryAgvStatus()
if (res.code === '1') {
this.status = res.result
} else {
this.toast(res.desc)
}
}
}
}
</script>
<style lang="stylus" scoped>
@import '~@style/mixin'
.state_content_1
height 100px
.content_wrap_inner
_fj()
.state_item_4
_fj(center,,column)
_wh(184px,184px)
_bis('../../../images/aio/agv_btn_bg.png', 100%)
background linear-gradient(0deg, #dfe1e7, #f1f1f6)
border-radius 32px
padding 16px
margin-bottom 16px
margin-right 16px
overflow hidden
&:hover, &:active
background linear-gradient(0deg, #FA6400, #ffc3a7)
.state_item_4_txt
color #FA6400
.state_item_4_btn
position relative
overflow hidden
&:after
content: ''
display block
height 100%
transform translateX(-100%)
background inherit
_shadow(60px,#fa6400)
.state_item_4_wrap
_wh(100%, 100%)
background-color #fff
border-radius 20px
box-shadow 0 2px 2px 0 rgba(0, 0, 0, 0.1)
_fj(center,,column)
.state_item_4_btn
display block
_wh(60px,60px)
margin-bottom 13px
.state_item_4_txt
@@ -97,4 +363,70 @@
_bis('../../../images/aio/agv_5.png', 100%)
.state_icon_6
_bis('../../../images/aio/agv_6.png', 100%)
.pop_wrapper
position fixed
top 0
bottom 0
left 0
right 0
text-align center
z-index 10000
&::after
content ""
display inline-block
height 100%
width 0
vertical-align middle
.modal
position fixed
left 0
top 0
_wh(100%,100%)
opacity .5
background #000
z-index 999
.pop_box
position relative
margin 0 auto 50px
width 65%
height 70vh
margin-top 15vh
padding 20px
background-color #fff
border-radius 16px
overflow hidden
h2
_font(20px,40px,#464646,600,center)
.pop_ul_wrapper
width 90%
height calc(100% - 100px)
margin 0 auto
overflow hidden
.pop_ul
_wh(100%, 100%)
overflow-y auto
li
_wh(100%,40px)
padding 0 20px
border-bottom 2px dotted #D6D6D6
text-align left
span
display inline-block
_font(16px,40px,#323232,600,)
vertical-align top
padding-right .15rem
&:nth-child(1)
position: sticky;
top: -1px;
_font(14px,40px,#323232,600,)
background #DFE1E6
border-top-left-radius 10px
border-top-right-radius 10px
.pop_ul .checked
background-color #FD6A35
.pop_ul li.checked span
color #fff
.pop_btns_box
margin-top 20px
</style>

View File

@@ -4,29 +4,35 @@
<div class="state_wrap">
<div class="state_tip">车辆状态</div>
<div class="state_content">
<div class="state_item_1">正常</div>
<div class="state_item_1">{{result.vehicle_status}}</div>
</div>
</div>
<div class="state_wrap">
<div class="state_tip">工作状态</div>
<div class="state_content">
<div class="state_item_1">{{result.working_status}}</div>
</div>
</div>
<div class="state_wrap">
<div class="state_tip">传感器状态</div>
<div class="state_content">
<div class="state_item_2">
<div class="state_item_2" :class="result1.stopButton_status === '0' ? 'site_btn_disabled' : 'site_btn_active'">
<span class="state_item_2_dot"></span>
<span class="state_item_2_txt">急停按钮</span>
</div>
<div class="state_item_2">
<div class="state_item_2" :class="result1.speedReduction_status === '0' ? 'site_btn_disabled' : 'site_btn_active'">
<span class="state_item_2_dot"></span>
<span class="state_item_2_txt">避障减速</span>
</div>
<div class="state_item_2">
<div class="state_item_2" :class="result1.resetButton_status === '0' ? 'site_btn_disabled' : 'site_btn_active'">
<span class="state_item_2_dot"></span>
<span class="state_item_2_txt">复位按钮</span>
</div>
<div class="state_item_2">
<div class="state_item_2" :class="result1.speedStop_status === '0' ? 'site_btn_disabled' : 'site_btn_active'">
<span class="state_item_2_dot"></span>
<span class="state_item_2_txt">避障停车</span>
</div>
<div class="state_item_2">
<div class="state_item_2" :class="result1.securityTentacle_status === '0' ? 'site_btn_disabled' : 'site_btn_active'">
<span class="state_item_2_dot"></span>
<span class="state_item_2_txt">安全触边</span>
</div>
@@ -37,64 +43,83 @@
<div class="state_content">
<div class="state_item_3">
<span class="state_item_3_txt1">X坐标</span>
<span class="state_item_3_txt2">111111</span>
<span class="state_item_3_txt2">{{result.x}}</span>
</div>
<div class="state_item_3">
<span class="state_item_3_txt1">Y坐标</span>
<span class="state_item_3_txt2">111111</span>
<span class="state_item_3_txt2">{{result.y}}</span>
</div>
<div class="state_item_3">
<span class="state_item_3_txt1">Z坐标</span>
<span class="state_item_3_txt2">111111</span>
<span class="state_item_3_txt1">航向角</span>
<span class="state_item_3_txt2">{{result.z}}</span>
</div>
<div class="state_item_3">
<span class="state_item_3_txt1">下发速度</span>
<span class="state_item_3_txt2">111111</span>
<span class="state_item_3_txt2">{{result.send_speed}}</span>
</div>
<div class="state_item_3">
<span class="state_item_3_txt1">实际速度</span>
<span class="state_item_3_txt2">111111</span>
<span class="state_item_3_txt2">{{result.real_speed}}</span>
</div>
<div class="state_item_3">
<span class="state_item_3_txt1">舵轮角度</span>
<span class="state_item_3_txt2">111111</span>
<span class="state_item_3_txt2">{{result.carrier}}</span>
</div>
<div class="state_item_3">
<span class="state_item_3_txt1">偏差</span>
<span class="state_item_3_txt2">111111</span>
<span class="state_item_3_txt1">横向偏差</span>
<span class="state_item_3_txt2">{{result.landscape_deviation}}</span>
</div>
<div class="state_item_3">
<span class="state_item_3_txt1">偏差</span>
<span class="state_item_3_txt2">111111</span>
<span class="state_item_3_txt1">航向偏差</span>
<span class="state_item_3_txt2">{{result.course_deviation}}</span>
</div>
</div>
</div>
</div>
<!-- <div class="right_side_box_1">
<ul class="site_btn_box">
<li class="site_btn">正常</li>
</ul>
<ul class="site_btn_box site_btn_box_1">
<li class="site_btn site_btn_1">X坐标{{result.x}}</li>
<li class="site_btn site_btn_1">Y坐标{{result.y}}</li>
<li class="site_btn site_btn_1">航向角{{result.z}}</li>
<li class="site_btn site_btn_1">下发速度{{result.send_speed}}</li>
<li class="site_btn site_btn_1">实际速度{{result.real_speed}}</li>
<li class="site_btn site_btn_1">舵轮角度{{result.carrier}}</li>
<li class="site_btn site_btn_1">横向偏差{{result.landscape_deviation}}</li>
<li class="site_btn site_btn_1">航向偏差{{result.course_deviation}}</li>
</ul>
</div> -->
</div>
</template>
<script>
import {queryVehicleStatus, querrySensor} from '@config/getData2.js'
export default {
data () {
return {
interTime: this.$store.getters.setTime,
timer: null,
result: {}
result: {},
result1: {}
}
},
created () {
this._queryVehicleStatus()
this._querrySensor()
this.refresh()
},
beforeDestroy () {
clearInterval(this.timer)
},
methods: {
refresh () {
this.timer = setInterval(() => {
this._queryVehicleStatus()
this._querrySensor()
}, this.interTime)
},
async _queryVehicleStatus () {
let res = await queryVehicleStatus()
if (res.code === '1') {
this.result = res.result
} else {
this.toast(res.desc)
}
},
async _querrySensor () {
let res = await querrySensor()
if (res.code === '1') {
this.result1 = res.result
} else {
this.toast(res.desc)
}
}
}
}
@@ -128,4 +153,12 @@ export default {
color: #696969
margin-right 3%
margin-bottom .24rem
.site_btn_disabled
opacity 0.5
.state_item_2_dot
background-color #c6c6c6
.site_btn_active
opacity 1
.state_item_2_dot
background-color #00c852
</style>

View File

@@ -22,8 +22,6 @@ const ErrorDeal = r => require.ensure([], () => r(require('@page/modules/errorma
const VehicleInformation = r => require.ensure([], () => r(require('@page/modules/vehicleinformation/index.vue')), 'modules')
const VehicleStatus = r => require.ensure([], () => r(require('@page/modules/vehicleinformation/vehiclestatus.vue')), 'modules')
const VehicleControl = r => require.ensure([], () => r(require('@page/modules/vehicleinformation/vehiclecontrol.vue')), 'modules')
const SensorStatus = r => require.ensure([], () => r(require('@page/modules/vehicleinformation/sensorstatus.vue')), 'modules')
const AgvStatus = r => require.ensure([], () => r(require('@page/modules/vehicleinformation/agvstatus.vue')), 'modules')
const Teach = r => require.ensure([], () => r(require('@page/modules/teach/teach.vue')), 'modules')
@@ -116,12 +114,6 @@ export default new Router({
}, {
path: '/vehiclecontrol',
component: VehicleControl
}, {
path: '/sensorstatus',
component: SensorStatus
}, {
path: '/agvstatus',
component: AgvStatus
}]
},
{