Browse Source

控制面板的控制按钮添加防误触功能

master
huanglingchen 4 months ago
parent
commit
0374fd0683
6 changed files with 48 additions and 35 deletions
  1. +48
    -35
      components/controlPage/index.vue
  2. BIN
      static/image/error.png
  3. BIN
      static/image/logo.png
  4. BIN
      static/image/logo2.png
  5. BIN
      static/image/normal.png
  6. BIN
      static/image/stopIcon.png

+ 48
- 35
components/controlPage/index.vue View File

@ -15,8 +15,8 @@
<image class="Icon" :src="deviceData.autoDockLightFlag==0?errorIcon:normalIcon"/>
</view>
<view>
<span>急停有效</span>
<image class="Icon" :src="deviceData.stopLightFlag==0?errorIcon:normalIcon"/>
<span>急停状态</span>
<image class="Icon" :src="deviceData.stopLightFlag==0?errorIcon:stopIcon"/>
</view>
<view>
<span>自动装填</span>
@ -46,14 +46,14 @@
</view>
<view>
<view style="width: 25%;">急停有效:</view>
<view style="width: 25%;">急停状态:</view>
<view >
<image class="Icon" :src="normalIcon"/>
<span>有效</span>
<image class="Icon" :src="stopIcon"/>
<span>急停</span>
</view>
<view >
<image class="Icon" :src="errorIcon"/>
<span>无效</span>
<span>正常</span>
</view>
</view>
@ -149,7 +149,7 @@
</view>
<view style="width: 24%;">
<span class="infoTitle">编码器位置</span>
<span class="detail">{{deviceData.encoderPosition}}mm</span>
<span class="detail">{{deviceData.encoderPosition}}</span>
</view>
<view style="width: 10%;opacity: 0;">
@ -186,11 +186,11 @@
<view class="controlButton">
<view class="deviceitle control">设备控制</view>
<view class="controlContent">
<view @click="controlDevice(1)">对接</view>
<view @click="controlDevice(2)">装填</view>
<view @click="controlDevice(3)">退货</view>
<view @click="controlDevice(4)">急停</view>
<view @click="controlDevice(5)">恢复</view>
<view @click="controlDevice(1,'对接')">对接</view>
<view @click="controlDevice(2,'装填')">装填</view>
<view @click="controlDevice(3,'退货')">退货</view>
<view @click="controlDevice(4,'急停')">急停</view>
<view @click="controlDevice(5,'恢复')">恢复</view>
</view>
</view>
</view>
@ -235,32 +235,45 @@
lightFlag: 1,//0-1-
},
errorIcon:'../../static/image/error.png',
normalIcon:'../../static/image/normal.png'
normalIcon:'../../static/image/normal.png',
stopIcon:'../../static/image/stopIcon.png'
}
},
methods:{
controlDevice(value){
controlDevice(value,contents){
console.log(value)
httpPost({
url:`/zhxx/dt/horizonLoadIControl/${value}`,
data:{}
}).then((res)=>{
console.log(res)
if(res.data.code==200){
this.$eventBus.emit('showToast',{title:res.data.msg,duration:1000,icon:'success'})
}else {
console.log(22222)
this.$eventBus.emit('showToast',{title:res.data.msg?res.data.msg:'请求失败',duration:1000,icon:'error'})
let that=this;
uni.showModal({
title:'提示',
content:`是否执行${contents}操作?`,
success:function(states) {
if(states.confirm){
httpPost({
url:`/zhxx/dt/horizonLoadIControl/${value}`,
data:{}
}).then((res)=>{
console.log(res)
if(res.data.code==200){
that.$eventBus.emit('showToast',{title:res.data.msg,duration:1000,icon:'success'})
}else {
console.log(res.data.msg)
that.$eventBus.emit('showToast',{title:res.data.msg?res.data.msg:'请求失败',duration:1000,icon:'error'})
}
}).catch((Error)=>{
// console.log(Error)
uni.showToast({
title: Error,
icon: "error",
duration: 1000
})
})
}else{
console.log('fewfewfew')
}
}
}).catch((Error)=>{
// console.log(Error)
uni.showToast({
title: Error,
icon: "error",
duration: 1000
})
})
})
}
},
computed:{
@ -393,8 +406,8 @@
}
.Icon{
width: 24px;
height: 24px;
width: 18px;
height: 20px;
}
.left-bottom{


BIN
static/image/error.png View File

Before After
Width: 48  |  Height: 48  |  Size: 649 B Width: 19  |  Height: 20  |  Size: 1.2 KiB

BIN
static/image/logo.png View File

Before After
Width: 192  |  Height: 192  |  Size: 6.3 KiB Width: 192  |  Height: 192  |  Size: 8.3 KiB

BIN
static/image/logo2.png View File

Before After
Width: 192  |  Height: 192  |  Size: 6.3 KiB

BIN
static/image/normal.png View File

Before After
Width: 48  |  Height: 48  |  Size: 699 B Width: 19  |  Height: 20  |  Size: 1.2 KiB

BIN
static/image/stopIcon.png View File

Before After
Width: 19  |  Height: 20  |  Size: 1.2 KiB

Loading…
Cancel
Save