This commit is contained in:
2023-10-20 17:31:19 +08:00
parent 1f8f22839d
commit 1ffb98419b
10 changed files with 273 additions and 264 deletions

View File

@@ -1,174 +0,0 @@
<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

@@ -1,20 +1,22 @@
<template>
<div class="main-container">
<div class="box0">
<div class="title">故障信息</div>
</div>
<div class="tasklist">
<div class="con1 grid_wrapper">
<table>
<tr>
<!-- <th>当前状态</th> -->
<tr class="t-head">
<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>{{index + 1}}</td>
<td>{{e.error_name}}</td>
<td :class="{cyellow:e.errorcategory_name ==='一类',cred:e.errorcategory_name ==='二类'}">{{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><span class="icon" :class="{bgyellow: e.errorcategory_name ==='一类', bgred: e.errorcategory_name ==='二类'}"></span>{{e.errorcategory_name}}</td>
<td>{{e.error_content}}</td>
<td>{{e.handing_method}}</td>
</tr>
@@ -30,6 +32,8 @@ export default {
name: 'ErrorManage',
data () {
return {
interTime: this.$store.getters.setTime,
timer: null,
pkId: '',
dataList: []
// dataList: [
@@ -65,8 +69,17 @@ export default {
},
created () {
this.initData()
this.refresh()
},
beforeDestroy () {
clearInterval(this.timer)
},
methods: {
refresh () {
this.timer = setInterval(() => {
this.initData()
}, this.interTime)
},
async initData () {
let res = await querryError()
if (res.code === '1') {
@@ -80,33 +93,60 @@ export default {
</script>
<style lang="stylus" scoped>
.icon
display inline-block
width 43px
height 43px
position relative
top 10px
.bgyellow
background #ECA800
background center / 100% 100% url(../../../images/new/icon-error1.png) no-repeat
.bgred
background #FA6400
.bggreen
background #00C852
.cyellow
color #ECA800
.cred
color #FA6400
.cgreen
color #00C852
background center / 100% 100% url(../../../images/new/icon-error2.png) no-repeat
.t-head
height 80px
line-height 80px
background center / 100% 100% url(../../../images/new/bg-head-tb-in.png) no-repeat
.main-container
margin 0 auto
padding-left 67px
.box0
width 1785px
height 102px
background center / 100% 100% url(../../../images/new/bg-title-l.png) no-repeat
.title
font-size 36px
color #F6F9FE
padding-left 40px
padding-top 53px
.con1
width 1787px
height 819px
background center / 100% 100% url(../../../images/new/bg-con-l.png) no-repeat
float left
box-sizing border-box
width 100%
padding .25rem
.last-td
width 4.4rem
text-align left
padding-left 0.5rem
box-sizing border-box
padding 40px
.status-box
display inline-block
width .4rem
height .4rem
border-radius .2rem
.grid_wrapper table th
color #ffffff
font-size 30px
background rgba(31,46,73,0.5)
line-height 80px
border-right none
padding 0
padding-left 30px
text-align left
.grid_wrapper table td
color #ffffff
font-size 30px
background rgba(31,46,73,0.5)
line-height 80px
border-bottom 1px solid #20395D
border-right none
padding 0
padding-left 30px
text-align left
</style>