Commit 6c0e3067 authored by xiedong's avatar xiedong

开关机器人swith状态不变bug

parent 91f59d97
...@@ -34,13 +34,13 @@ ...@@ -34,13 +34,13 @@
</p> </p>
</div> </div>
<div class="switch"> <div class="switch">
<span v-show="robotDetailInfo.status=='normal'">关闭</span> <span v-show="robotInfo.status==='normal'">关闭</span>
<span v-show="!robotDetailInfo.status=='normal'">开启</span> <span v-show="!robotInfo.status==='normal'">开启</span>
<el-switch <el-switch
:value="robotDetailInfo.status=='normal'" :value="robotInfo.status==='normal'"
active-color="rgba(119,146,167,1)" active-color="rgba(119,146,167,1)"
inactive-color="rgba(236,239,241,1)" inactive-color="rgba(236,239,241,1)"
@change="clickSwitch(robotDetailInfo)" @change="clickSwitch(robotInfo)"
> >
</el-switch> </el-switch>
</div> </div>
...@@ -1127,7 +1127,7 @@ ...@@ -1127,7 +1127,7 @@
}, },
//机器人开关 //机器人开关
clickSwitch(val) { clickSwitch(val) {
const Tips = val.status=='close' ? '此操作将开启机器人, 是否继续?' : '此操作将关闭机器人, 是否继续?'; const Tips = val.status=='stop' ? '此操作将开启机器人, 是否继续?' : '此操作将关闭机器人, 是否继续?';
// const Message = val.status=='close' ? '开启机器人成功' : '关闭机器人成功'; // const Message = val.status=='close' ? '开启机器人成功' : '关闭机器人成功';
this.$confirm( Tips, '提示', { this.$confirm( Tips, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
...@@ -1141,8 +1141,10 @@ ...@@ -1141,8 +1141,10 @@
}).then(res=>{ }).then(res=>{
if(res.data.code==200){ if(res.data.code==200){
//为了改变switch的状态 //为了改变switch的状态
this.robotBankList.status=res.data.data.new_status console.log(res)
sessionStorage.robotDetailInfo.status=res.data.data.new_status this.getCurrentRobot()
// this.robotBankList.status=res.data.data.new_status
// sessionStorage.robotDetailInfo.status=res.data.data.new_status
this.$message({ this.$message({
type: 'success', type: 'success',
......
...@@ -398,7 +398,7 @@ ...@@ -398,7 +398,7 @@
this.$router.push(`/monitor/${this.$route.params.name}/RobotDetail`); this.$router.push(`/monitor/${this.$route.params.name}/RobotDetail`);
}, },
clickSwitch(val) { clickSwitch(val) {
const Tips = val.status=='close' ? '此操作将开启机器人, 是否继续?' : '此操作将关闭机器人, 是否继续?'; const Tips = val.status=='stop' ? '此操作将开启机器人, 是否继续?' : '此操作将关闭机器人, 是否继续?';
// const Message = val.status=='close' ? '开启机器人成功' : '关闭机器人成功'; // const Message = val.status=='close' ? '开启机器人成功' : '关闭机器人成功';
this.$confirm( Tips, '提示', { this.$confirm( Tips, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment