故障列表

This commit is contained in:
2023-05-23 17:32:12 +08:00
parent 392f28cfff
commit ce4c21e32e

View File

@@ -1,87 +1,79 @@
<template>
<section>
<div class="tasklist">
<nav-bar></nav-bar>
<div class="con1">
<button v-if="dataInfo.button_name" @click="clickSave">{{dataInfo.button_name}}</button>
<table class="filter-table">
<tr>
<!-- <th>当前状态</th> -->
<th>故障名称</th>
<th>故障类别</th>
<th>故障内容</th>
<th>处理办法</th>
</tr>
<tr v-for="(e,index) in dataList" :key="index">
<!-- <td><span class="status-box" :class="{bgyellow:e.error_status ==='1',bgred:e.error_status ==='2',bggreen:e.error_status ==='0',}"></span></td> -->
<td>{{e.error_name}}</td>
<td :class="{cyellow:e.errorcategory_code ==='01',cred:e.errorcategory_code ==='02',cgreen:e.errorcategory_code ==='00',}">{{e.errorcategory_name}}</td>
<!-- <td>{{e.error_category}}<span class="status-box" :class="{bgyellow:e.error_status ==='1',bgred:e.error_status ==='2',bggreen:e.error_status ==='0',}"></span></td> -->
<td>{{e.error_content}}</td>
<td class="last-td">{{e.handing_method}}</td>
</tr>
</table>
</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>
</div>
</template>
<script>
import {queryHomePage, clickSave} from '@/config/getData.js'
import {querryError} from '@/config/getData.js'
import NavBar from '@components/NavBar.vue'
export default {
name: 'Home',
name: 'ErrorManage',
components: {
NavBar
},
data () {
return {
interTime: this.$store.getters.setTime,
timer: null,
dataInfo: {}
pkId: '',
dataList: []
// dataList: [
// {
// task_id: '1',
// error_status: '1',
// error_status_name: '一类故障',
// error_name: '障碍物报警',
// error_category: '一类',
// error_content: '车辆安全避障范围内有障碍物出现',
// handing_method: '检查车辆行驶路线,移除障碍物'
// },
// {
// task_id: '2',
// error_status: '2',
// error_status_name: '二类故障',
// error_name: '障碍物报警',
// error_category: '一类',
// error_content: '车辆安全避障范围内有障碍物出现',
// handing_method: '检查车辆行驶路线,移除障碍物'
// },
// {
// task_id: '3',
// error_status: '0',
// error_status_name: '无故障',
// error_name: '障碍物报警',
// error_category: '一类',
// error_content: '车辆安全避障范围内有障碍物出现',
// handing_method: '检查车辆行驶路线,移除障碍物'
// }
// ]
}
},
created () {
this.initData()
this.refresh()
},
beforeDestroy () {
clearInterval(this.timer)
},
methods: {
refresh () {
this.timer = setInterval(() => {
this.initData()
}, this.interTime)
},
async initData () {
let res = await queryHomePage()
let res = await querryError()
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()
this.dataList = res.result
} else {
this.toast(res.desc)
}
@@ -91,84 +83,31 @@ export default {
</script>
<style lang="stylus" scoped>
@import '~@style/mixin'
.bgyellow
background #ECA800
.bgred
background #fa6400
background #FA6400
.bggreen
background #54C0B3
background #00C852
.cyellow
color #ECA800
.cred
color #fa6400
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
color #00C852
.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
box-sizing border-box
width 100%
padding .25rem
.last-td
width 4.4rem
text-align left
padding-left 0.5rem
box-sizing border-box
.status-box
display inline-block
width .4rem
height .4rem
border-radius .2rem
</style>