Browse Source

关闭对话框时断开设备

origin/feature/monitoring
ZhaoTongYao 4 years ago
parent
commit
34d178baea
  1. 11
      src/views/modules/epidemic/reader.vue

11
src/views/modules/epidemic/reader.vue

@ -130,7 +130,7 @@ export default {
}) })
}, },
handleClose () { handleClose () {
// this.disconnect() this.disconnect()
this.visible = false this.visible = false
this.$emit('refreshDataList') this.$emit('refreshDataList')
}, },
@ -147,9 +147,11 @@ export default {
// }) // })
this.connectStatus = true this.connectStatus = true
} else { } else {
this.connectStatus = false
this.$message.error(res.errorMsg) this.$message.error(res.errorMsg)
} }
}).catch(() => { }).catch(() => {
this.connectStatus = false
this.$message.error('连接失败') this.$message.error('连接失败')
}) })
}, },
@ -197,12 +199,7 @@ export default {
disconnect () { disconnect () {
axios.get(`http://127.0.0.1:19196/CloseDevice`).then(({ data: res }) => { axios.get(`http://127.0.0.1:19196/CloseDevice`).then(({ data: res }) => {
if (res.resultFlag == 0) { if (res.resultFlag == 0) {
this.$message(res.errorMsg) // this.$message(res.errorMsg)
this.connectStatus = false
this.btnAble = false
this.visible = true
this.$refs['dataForm'].resetFields()
this.imageSrc = ''
} else { } else {
this.$message.error(res.errorMsg) this.$message.error(res.errorMsg)
} }

Loading…
Cancel
Save