This commit is contained in:
BianLzhaoMin 2025-09-29 17:09:08 +08:00
parent e897d9de4b
commit 588f026e5f
2 changed files with 9 additions and 2 deletions

View File

@ -1689,6 +1689,7 @@ export default {
this.webSocket = new WebSocket( this.webSocket = new WebSocket(
this.idCardReaderForm.idCardReaderAddress, this.idCardReaderForm.idCardReaderAddress,
) )
const _this = this const _this = this
this.webSocket.onopen = function (evt) { this.webSocket.onopen = function (evt) {
console.log('连接成功', evt) console.log('连接成功', evt)
@ -1780,7 +1781,10 @@ export default {
// websocket // websocket
closeWebSocket() { closeWebSocket() {
this.webSocket.close() if (this.isConnected) {
this.webSocket.close()
}
this.webSocket = null
}, },
// //
@ -1829,7 +1833,6 @@ export default {
}) })
this.getLotProjectSelectList() this.getLotProjectSelectList()
this.createWebSocket()
}, },
beforeDestroy() { beforeDestroy() {

View File

@ -247,6 +247,10 @@ export default {
this.queryDetailsId = '' this.queryDetailsId = ''
this.dialogConfig.outerVisible = true this.dialogConfig.outerVisible = true
} }
this.$nextTick(() => {
this.$refs.addOrEditFormContentRef.createWebSocket()
})
}, },
// //