diff --git a/.env.development b/.env.development index 150a2db..6780fbc 100644 --- a/.env.development +++ b/.env.development @@ -8,4 +8,5 @@ VUE_APP_PACS_URL='http://192.168.0.85:8001' # VUE_APP_PACS_URL='http://z1.huimucloud.com:8085' # websocket地址 -VUE_APP_WS_URL='ws://192.168.0.119:8036/xiangan-crf/websocket/2017710013' +VUE_APP_WS_URL='ws://192.168.0.151:1894/data' +# VUE_APP_WS_URL='ws://192.168.0.119:8036/xiangan-crf/websocket/2017710013' diff --git a/.env.staging b/.env.staging index f062419..4bf3780 100644 --- a/.env.staging +++ b/.env.staging @@ -8,4 +8,5 @@ VUE_APP_PACS_URL='http://192.168.0.85:8001' # VUE_APP_PACS_URL='http://z1.huimucloud.com:8085' # websocket地址 -VUE_APP_WS_URL='ws://192.168.0.119:8036/xiangan-crf/websocket/2017710013' +VUE_APP_WS_URL='ws://192.168.0.151:1894/data' +# VUE_APP_WS_URL='ws://192.168.0.119:8036/xiangan-crf/websocket/2017710013' diff --git a/dist.zip b/dist.zip deleted file mode 100644 index 3502acc..0000000 Binary files a/dist.zip and /dev/null differ diff --git a/src/components/360View/commonForm/optometryForm.vue b/src/components/360View/commonForm/optometryForm.vue index ced7785..404513e 100644 --- a/src/components/360View/commonForm/optometryForm.vue +++ b/src/components/360View/commonForm/optometryForm.vue @@ -578,9 +578,9 @@ export default { caseId: { handler: function(newV, oldV) { this.queryForm() - if (this.isSearch === '3') { - this.initWebSoket() - } + // if (this.isSearch === '3') { + // this.initWebSoket() + // } } } }, @@ -591,6 +591,7 @@ export default { clearTimeout(this.timeoutObj) clearTimeout(this.serverTimeoutObj) this.ws.close() + this.ws = null } }, mounted() { @@ -749,6 +750,7 @@ export default { if (self.ws.readyState == 1) { // 如果连接正常 self.ws.send('heartCheck') } else { // 否则重连 + console.log('start') self.reconnect() } self.serverTimeoutObj = setTimeout(function() { @@ -769,26 +771,26 @@ export default { } this.ws.onclose = function() { self.connectFlag = false - self.reconnect() } this.ws.onerror = function() { self.connectFlag = false self.reconnect() } this.ws.onmessage = (msg) => { - if (this.dataForm.ygjcDsOd || - this.dataForm.ygjcDcOd || - this.dataForm.ygjcAOd || - this.dataForm.ygjcVaOd || - this.dataForm.ygjcAddOd || - this.dataForm.ygjcDsOs || - this.dataForm.ygjcDcOs || - this.dataForm.ygjcAOs || - this.dataForm.ygjcVaOs || - this.dataForm.ygjcAddOs) { + const message = JSON.parse(msg.data) + if (!(this.dataForm.ygjcDsOd === message.RData.DS && + this.dataForm.ygjcDcOd === message.RData.DC && + this.dataForm.ygjcAOd === message.RData.AXIS && + this.dataForm.ygjcVaOd === message.RData.VA && + this.dataForm.ygjcAddOd === message.RData.ADD && + this.dataForm.ygjcDsOs === message.LData.DS && + this.dataForm.ygjcDcOs === message.LData.DC && + this.dataForm.ygjcAOs === message.LData.AXIS && + this.dataForm.ygjcVaOs === message.LData.VA && + this.dataForm.ygjcAddOs === message.LData.ADD)) { this.$confirm('是否确定更新数据?').then(() => { this.setYgData(msg) - }).catch() + }).catch(() => {}) } self.resetHeart() }