故障处理

This commit is contained in:
2023-05-11 18:39:53 +08:00
parent c56417d3dc
commit d213802846
6 changed files with 396 additions and 3 deletions

View File

@@ -0,0 +1,170 @@
<template>
<section>
<div class="con1">
<div class="desc">当前状态</div>
<div class="status"></div>
<div class="txt">一类故障</div>
</div>
<div class="con2">
<div class="infoli">
<img src="../../../images/aio/icon2.png">
<span class="title">故障名称</span>
<span class="txt">{{dataInfo.device_info}}</span>
</div>
<div class="infoli">
<img src="../../../images/aio/icon5.png">
<span class="title">故障类别</span>
<span class="txt">{{dataInfo.task_status}}</span>
</div>
<div class="infoli">
<img src="../../../images/aio/icon5.png">
<span class="title">故障内容</span>
<span class="txt">{{dataInfo.task_status}}</span>
</div>
<div class="infoli">
<img src="../../../images/aio/icon4.png">
<span class="title">处理办法</span>
<span class="txt">{{dataInfo.task_num}}</span>
</div>
</div>
</section>
</template>
<script>
import {queryHomePage, clickSave} from '@/config/getData.js'
import NavBar from '@components/NavBar.vue'
export default {
name: 'Home',
components: {
NavBar
},
data () {
return {
interTime: this.$store.getters.setTime,
timer: null,
dataInfo: {}
}
},
created () {
this.initData()
this.refresh()
},
beforeDestroy () {
clearInterval(this.timer)
},
methods: {
refresh () {
this.timer = setInterval(() => {
this.initData()
}, this.interTime)
},
async initData () {
let res = await queryHomePage()
if (res.code === '1') {
this.dataInfo = res.result
} else {
this.toast(res.desc)
}
},
async clickSave () {
if (!this.dataInfo.button_name) {
return
}
let res = await clickSave(this.dataInfo.button_code)
if (res.code === '1') {
this.toast(res.desc)
this.initData()
} else {
this.toast(res.desc)
}
}
}
}
</script>
<style lang="stylus" scoped>
@import '~@style/mixin'
.bgred
background #fa6400
.bggreen
background #54C0B3
.cred
color #fa6400
.cgreen
color #54C0B3
.con0
height 1rem
margin-top .26rem
margin-bottom .5rem
margin-left .4rem
.site_nav
_wh(2rem,1rem)
_bis('../../../images/aio/btn_dis.png',100%,100%)
margin-bottom .2rem
margin-right .3rem
&:nth-of-type(3)
margin-right 1.8rem
.site_nav_a
display block
_font(.32rem,1rem,,,center)
cursor pointer
color #ffffff
.active
_bis('../../../images/aio/btn_checked.png',100%,100%)
.white
color #464646
.con1
float left
position relative
width 4.62rem
height 4.62rem
background center / 100% 100% url(../../../images/aio/bg3.png) no-repeat
margin-left .18rem
margin-right .35rem
margin-top 1rem
font-size .34rem
.desc
margin-left 1rem
margin-top .5rem
color #ffffff
.status
margin .8rem 0 .8rem 2rem
width .48rem
height .48rem
border-radius .24rem
background-color $yellow
.txt
width 4.62rem
text-align center
color $yellow
.con2
float left
width 6.4rem
height 5.02rem
background center / 100% 100% url(../../../images/aio/bg2.png) no-repeat
padding-top .2rem
margin-top 1rem
.infoli
width 6rem
line-height 1.08rem
height 1.08rem
background #ffffff
margin 0 auto
// margin-bottom 2px
border-bottom 1px dotted #cccccc
img
float left
margin .4rem .15rem 0 .31rem
width .26rem
height .26rem
.title
float left
display inline-block
font-size .24rem
color #323232
.txt
float left
display inline-block
font-size .3rem
color #FA6400
</style>

View File

@@ -0,0 +1,174 @@
<template>
<section>
<div class="con1">
<button v-if="dataInfo.button_name" @click="clickSave">{{dataInfo.button_name}}</button>
</div>
<div class="con2">
<div class="infoli">
<img src="../../../images/aio/icon2.png">
<span class="title">设备信息</span>
<span class="txt">{{dataInfo.device_info}}</span>
</div>
<div class="infoli">
<img src="../../../images/aio/icon5.png">
<span class="title">当前任务</span>
<span class="txt">{{dataInfo.task_status}}</span>
</div>
<div class="infoli">
<img src="../../../images/aio/icon5.png">
<span class="title">任务状态</span>
<span class="txt">{{dataInfo.task_status}}</span>
</div>
<div class="infoli">
<img src="../../../images/aio/icon5.png">
<span class="title">任务数量</span>
<span class="txt">{{dataInfo.task_num}}</span>
</div>
<div class="infoli">
<img src="../../../images/aio/icon6.png">
<span class="title">当前速度</span>
<span class="txt">{{dataInfo.task_num}}</span>
</div>
<div class="infoli">
<img src="../../../images/aio/icon4.png">
<span class="title">AGV故障</span>
<span class="txt">{{dataInfo.agv_error}}</span>
</div>
</div>
</section>
</template>
<script>
import {queryHomePage, clickSave} from '@/config/getData.js'
import NavBar from '@components/NavBar.vue'
export default {
name: 'Home',
components: {
NavBar
},
data () {
return {
interTime: this.$store.getters.setTime,
timer: null,
dataInfo: {}
}
},
created () {
this.initData()
this.refresh()
},
beforeDestroy () {
clearInterval(this.timer)
},
methods: {
refresh () {
this.timer = setInterval(() => {
this.initData()
}, this.interTime)
},
async initData () {
let res = await queryHomePage()
if (res.code === '1') {
this.dataInfo = res.result
} else {
this.toast(res.desc)
}
},
async clickSave () {
if (!this.dataInfo.button_name) {
return
}
let res = await clickSave(this.dataInfo.button_code)
if (res.code === '1') {
this.toast(res.desc)
this.initData()
} else {
this.toast(res.desc)
}
}
}
}
</script>
<style lang="stylus" scoped>
@import '~@style/mixin'
.bgred
background #fa6400
.bggreen
background #54C0B3
.cred
color #fa6400
.cgreen
color #54C0B3
.con0
height 1rem
margin-top .26rem
margin-bottom .5rem
margin-left .4rem
.site_nav
_wh(2rem,1rem)
_bis('../../../images/aio/btn_dis.png',100%,100%)
margin-bottom .2rem
margin-right .3rem
&:nth-of-type(3)
margin-right 1.8rem
.site_nav_a
display block
_font(.32rem,1rem,,,center)
cursor pointer
color #ffffff
.active
_bis('../../../images/aio/btn_checked.png',100%,100%)
.white
color #464646
.con1
float left
position relative
width 4.62rem
height 4.62rem
background center / 100% 100% url(../../../images/aio/car2.png) no-repeat
margin-left .18rem
margin-right .35rem
margin-top 1rem
button
box-sizing border-box
width 3.7rem
height 1.08rem
border 8px solid #F1F1F5
border-radius 16px
font-size .3rem
background #ffffff
margin-top .1rem
margin-left .1rem
padding .03rem
.con2
float left
width 6.4rem
height 5.02rem
background center / 100% 100% url(../../../images/aio/bg2.png) no-repeat
padding-top .2rem
margin-top 1rem
.infoli
width 6rem
line-height 0.68rem
height 0.68rem
background #ffffff
margin 0 auto
// margin-bottom 2px
border-bottom 1px dotted #cccccc
img
float left
margin .22rem .15rem 0 .31rem
width .26rem
height .26rem
.title
float left
display inline-block
font-size .24rem
color #323232
.txt
float left
display inline-block
font-size .3rem
color #FA6400
</style>

View File

@@ -0,0 +1,32 @@
<template>
<div class="body-conatiner">
<div class="side-bar-container">
<jxSidebar :menus="menus"></jxSidebar>
</div>
<div class="main-container">
<router-view></router-view>
</div>
</div>
</template>
<script>
import jxSidebar from '../../shells/sidebar/sidebar.vue'
export default {
components: {
jxSidebar
},
data () {
return {
menus: [{
label: '故障信息',
index: '1',
router: '/ErrorInfo'
}, {
label: '故障处理',
index: '2',
router: '/ErrorDeal'
}]
}
}
}
</script>

View File

@@ -93,6 +93,7 @@ export default {
.box1
width 10.4rem
height 4.2rem
margin-top .5rem
.point
width 2rem
line-height .9rem
@@ -111,6 +112,7 @@ export default {
border .16rem solid #DFE1E6
border-radius .08rem
background #ffffff
margin-top 1rem
span
position absolute
left .3rem

View File

@@ -52,7 +52,7 @@ export default {
}, {
label: '故障管理',
index: '3',
router: ''
router: '/ErrorDeal'
}, {
label: '车辆信息',
index: '4',