|
|
|
@ -12,7 +12,12 @@ |
|
|
|
<span :class="optionIndex==2?'pitch':''" @click="outLogin()">退出</span> |
|
|
|
</view> --> |
|
|
|
<controlPage v-if="optionIndex==0" :Data='deviceData'></controlPage> |
|
|
|
<carPage v-if="optionIndex==1" :carData1='carData1' :carData2='carData2' :carData3='carData3'></carPage> |
|
|
|
<carPage v-if="optionIndex==1" :carData='deviceData'></carPage> |
|
|
|
|
|
|
|
<view class="showToast" v-if="showToastState==1"> |
|
|
|
<image :src="showToastIcon=='success'?successIcon:errorIcon"></image> |
|
|
|
<span>{{showToastTitle}}</span> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
|
|
|
|
@ -20,6 +25,8 @@ |
|
|
|
import controlPage from '/components/controlPage/index.vue'; |
|
|
|
import carPage from '/components/carPage/index.vue'; |
|
|
|
import {httpPost} from '../../utils/requset.js'; |
|
|
|
import error from '../../static/image/errorToast.png'; |
|
|
|
import successImage from '@/static/image/successToast.png'; |
|
|
|
export default { |
|
|
|
components: { |
|
|
|
controlPage, |
|
|
|
@ -28,66 +35,17 @@ |
|
|
|
data() { |
|
|
|
return { |
|
|
|
optionIndex:0, |
|
|
|
dataInter:[ |
|
|
|
{ |
|
|
|
name:'支架车在线状态:', |
|
|
|
width:0, |
|
|
|
val:'' |
|
|
|
},{ |
|
|
|
name:'左横移限位:', |
|
|
|
width:1, |
|
|
|
val:'' |
|
|
|
},{ |
|
|
|
name:'右横移限位:', |
|
|
|
width:1, |
|
|
|
val:'' |
|
|
|
},{ |
|
|
|
name:'上限位:', |
|
|
|
width:1, |
|
|
|
val:'' |
|
|
|
},{ |
|
|
|
name:'下限位:', |
|
|
|
width:1, |
|
|
|
val:'' |
|
|
|
},{ |
|
|
|
name:'左滚转限位:', |
|
|
|
width:1, |
|
|
|
val:'' |
|
|
|
},{ |
|
|
|
name:'右滚转限位:', |
|
|
|
width:1, |
|
|
|
val:'' |
|
|
|
},{ |
|
|
|
name:'行进位置:', |
|
|
|
width:1, |
|
|
|
val:'' |
|
|
|
},{ |
|
|
|
name:'横移位置:', |
|
|
|
width:1, |
|
|
|
val:'' |
|
|
|
},{ |
|
|
|
name:'滚转位置:', |
|
|
|
width:1, |
|
|
|
val:'' |
|
|
|
},{ |
|
|
|
name:'超重限位:', |
|
|
|
width:1, |
|
|
|
val:'' |
|
|
|
},{ |
|
|
|
name:'升降位置:', |
|
|
|
width:0, |
|
|
|
val:'' |
|
|
|
} |
|
|
|
], |
|
|
|
carData1:[], |
|
|
|
carData2:[], |
|
|
|
carData3:[], |
|
|
|
deviceData:{}, |
|
|
|
showToastTitle:'', |
|
|
|
showToastIcon:'', |
|
|
|
showToastState:0, |
|
|
|
errorIcon:error, |
|
|
|
successIcon:successImage |
|
|
|
} |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
cutOption(value){ |
|
|
|
this.optionIndex=value |
|
|
|
this.optionIndex=value; |
|
|
|
}, |
|
|
|
outLogin(){ |
|
|
|
uni.showModal({ |
|
|
|
@ -117,59 +75,29 @@ |
|
|
|
url:'/zhxx/dt/horizonLoadInfo', |
|
|
|
data:{} |
|
|
|
}).then((res)=>{ |
|
|
|
if(res.code==200){ |
|
|
|
this.deviceData=res.data; |
|
|
|
this.carData1=this.carEntsorgen(res.data,1); |
|
|
|
this.carData2=this.carEntsorgen(res.data,2); |
|
|
|
this.carData3=this.carEntsorgen(res.data,3); |
|
|
|
if(res.data.code==200){ |
|
|
|
this.deviceData=res.data.data[0]; |
|
|
|
} |
|
|
|
}).catch((err)=>{ |
|
|
|
console.log(err) |
|
|
|
if(err.errMsg.includes('Failed to connect')){ |
|
|
|
this.showToat({ |
|
|
|
title:'请确保成功连接网络', |
|
|
|
icon:'error', |
|
|
|
duration:1800 |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
carEntsorgen(value,type){ |
|
|
|
let data=value; |
|
|
|
let arrData=this.dataInter; |
|
|
|
if(type==1){ |
|
|
|
arrData[0].val=value.online==1?'在线':'离线'; |
|
|
|
arrData[1].val=value.leftHorizontalLimit; |
|
|
|
arrData[2].val=value.rightHorizontalLimit; |
|
|
|
arrData[3].val=value.downLimit; |
|
|
|
arrData[4].val=value.upLimit; |
|
|
|
arrData[5].val=value.leftTurnLimit; |
|
|
|
arrData[6].val=value.rightTurnLimit; |
|
|
|
arrData[7].val=value.walkAxisPosition; |
|
|
|
arrData[8].val=value.horizontalAxisPosition; |
|
|
|
arrData[9].val=value.turnPosition; |
|
|
|
arrData[10].val=value.overWeightLimit; |
|
|
|
arrData[11].val=value.liftPosition; |
|
|
|
}else if(type==2){ |
|
|
|
arrData[0].val=value.onlineTwo==1?'在线':'离线'; |
|
|
|
arrData[1].val=value.leftHorizontalLimitTwo; |
|
|
|
arrData[2].val=value.rightHorizontalLimitTwo; |
|
|
|
arrData[3].val=value.downLimitTwo; |
|
|
|
arrData[4].val=value.upLimitTwo; |
|
|
|
arrData[5].val=value.leftTurnLimitTwo; |
|
|
|
arrData[6].val=value.rightTurnLimitTwo; |
|
|
|
arrData[7].val=value.walkAxisPositionTwo; |
|
|
|
arrData[8].val=value.horizontalAxisPositionTwo; |
|
|
|
arrData[9].val=value.turnPositionTwo; |
|
|
|
arrData[10].val=value.overWeightLimitTwo; |
|
|
|
arrData[11].val=value.liftPositionTwo; |
|
|
|
}else{ |
|
|
|
arrData[0].val=value.onlineThree==1?'在线':'离线'; |
|
|
|
arrData[1].val=value.leftHorizontalLimitThree; |
|
|
|
arrData[2].val=value.rightHorizontalLimitThree; |
|
|
|
arrData[3].val=value.downLimitThree; |
|
|
|
arrData[4].val=value.upLimitThree; |
|
|
|
arrData[5].val=value.leftTurnLimitThree; |
|
|
|
arrData[6].val=value.rightTurnLimitThree; |
|
|
|
arrData[7].val=value.walkAxisPositionThree; |
|
|
|
arrData[8].val=value.horizontalAxisPositionThree; |
|
|
|
arrData[9].val=value.turnPositionThree; |
|
|
|
arrData[10].val=value.overWeightLimitThree; |
|
|
|
arrData[11].val=value.liftPositionThree; |
|
|
|
} |
|
|
|
return arrData; |
|
|
|
showToat(value){ |
|
|
|
this.showToastState=1; |
|
|
|
this.showToastTitle=value.title; |
|
|
|
this.showToastIcon=value.icon; |
|
|
|
|
|
|
|
setTimeout(()=>{ |
|
|
|
this.showToastState=0; |
|
|
|
},value.duration) |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
@ -191,6 +119,13 @@ |
|
|
|
setInterval(()=>{ |
|
|
|
this.deviceAjax(); |
|
|
|
},1000) |
|
|
|
// ,{title:res.data.msg?res.data.msg:'请求失败',duration:1000,icon:'error'} |
|
|
|
|
|
|
|
this.$eventBus.on('showToast',(data)=>{ |
|
|
|
console.log(3333333); |
|
|
|
this.showToat(data); |
|
|
|
|
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
@ -235,4 +170,30 @@ |
|
|
|
right: 2%; |
|
|
|
} |
|
|
|
|
|
|
|
.showToast{ |
|
|
|
position: absolute; |
|
|
|
left: 50%; |
|
|
|
transform: translateX(-50%); |
|
|
|
padding: 16px 12px; |
|
|
|
background-color: rgb(0,0,0,0.7); |
|
|
|
z-index: 2000; |
|
|
|
top: 40%; |
|
|
|
border-radius: 10px; |
|
|
|
display: flex; |
|
|
|
flex-direction: column; |
|
|
|
align-items: center; |
|
|
|
justify-content: space-between; |
|
|
|
} |
|
|
|
|
|
|
|
.showToast>image{ |
|
|
|
width: 40px; |
|
|
|
height: 40px; |
|
|
|
margin-bottom: 20px; |
|
|
|
} |
|
|
|
|
|
|
|
.showToast>span{ |
|
|
|
color: #ffffff; |
|
|
|
font-size: 18px; |
|
|
|
} |
|
|
|
|
|
|
|
</style> |