<template slot-scope="scope">
<div v-if="scope.row.state">
<span v-if="scope.row.state==='0'">关闭</span>
<span v-else-if="scope.row.state==='1'">打开</span>
<span v-else>获取失败</span>
</div>
<el-button v-else :loading="true"></el-button>
</template>
methods:{
getTableDate(){
queryDoorByDoorNo(parma).then(res=>{
this.tableDate = res.data
this.id = res.id
this.getLockStatus()
})
}
getLockStatus(){
doorDevStatus({maindecid:this.id}).then(res=>{
this.lockStateList = res.lockStateList
})
}
}
watch:{
lockStateList:{
handler(newVal){
this.$nextTick(()=>{
for(let i=0;i<this.tabledata.length;i++){
this.lockStateList.map(item=>{
if(item.subDeviceId ===this.tabledata[i].subDeviceId){
this.$set(this.tableData[i],'state',item.state)
}
})
}
})
}
},
deep:true
}
console