diff --git a/src/views/OperationalOverview/websocket.js b/src/views/OperationalOverview/websocket.js
index 82a96847..f3b5eedd 100644
--- a/src/views/OperationalOverview/websocket.js
+++ b/src/views/OperationalOverview/websocket.js
@@ -1,10 +1,3 @@
-/*
- * @Author: zhp
- * @Date: 2024-01-29 17:05:25
- * @LastEditTime: 2024-01-29 17:05:25
- * @LastEditors: zhp
- * @Description:
- */
/**
* 发起websocket请求函数
* @param {string} url ws连接地址
@@ -49,7 +42,7 @@ export function WsConnect(url, agentData, successCallback, errCallback) {
this.lockReconnect = true;
this.wsCreateHandler && clearTimeout(this.wsCreateHandler);
// 关闭心跳检查
- // heartCheck.stop();
+ heartCheck.stop();
}
};
const initWsEventHandle = () => {
@@ -57,13 +50,13 @@ export function WsConnect(url, agentData, successCallback, errCallback) {
// 连接成功
this.wsObj.onopen = (event) => {
onWsOpen(event);
- // heartCheck.start();
+ heartCheck.start();
};
// 监听服务器端返回的信息
this.wsObj.onmessage = (event) => {
onWsMessage(event);
- // heartCheck.start();
+ heartCheck.start();
};
this.wsObj.onclose = (event) => {
@@ -130,7 +123,7 @@ export function WsConnect(url, agentData, successCallback, errCallback) {
if (this.lockReconnect) {
return;
}
- writeToScreen("3秒后重连");
+ writeToScreen("5秒后重连");
this.lockReconnect = true;
// 没连接上会一直重连,设置延迟避免请求过多
this.wsCreateHandler && clearTimeout(this.wsCreateHandler);
@@ -139,10 +132,40 @@ export function WsConnect(url, agentData, successCallback, errCallback) {
this.createWebSoket();
this.lockReconnect = false;
writeToScreen("重连完成");
- }, 3000);
+ }, 5000);
};
- // 心跳检查(看看websocket是否还在正常连接中)
+ // 心跳检查(看看websocket是否还在正常连接中,不需要服务端返回,单向的)
+ let _this = this
+ let heartCheck = {
+ timeout: 55000,
+ timeoutObj: null,
+ // 重启
+ reset() {
+ clearTimeout(this.timeoutObj);
+ this.start();
+ },
+ // 停止
+ stop() {
+ clearTimeout(this.timeoutObj);
+ },
+ // 开启定时器
+ start() {
+ this.timeoutObj && clearTimeout(this.timeoutObj);
+ this.timeoutObj = setTimeout(() => {
+ writeToScreen("心跳检查,发送ping到后台");
+ try {
+ const datas = { ping: true };
+ _this.wsObj.send(JSON.stringify(datas));
+ } catch (err) {
+ writeToScreen("发送ping异常");
+ }
+ }, this.timeout);
+ },
+ };
+
+
+ // 心跳检查(看看websocket是否还在正常连接中,和服务端通信,双向的)
// let heartCheck = {
// timeout: 15000,
// timeoutObj: null,
@@ -167,7 +190,7 @@ export function WsConnect(url, agentData, successCallback, errCallback) {
// writeToScreen("心跳检查,发送ping到后台");
// try {
// const datas = { ping: true };
- // this.wsObj.send(JSON.stringify(datas));
+ // _this.wsObj.send(JSON.stringify(datas));
// } catch (err) {
// writeToScreen("发送ping异常");
// }
diff --git a/src/views/report/glass/day.vue b/src/views/report/glass/day.vue
index b6c68cc1..6d408a77 100644
--- a/src/views/report/glass/day.vue
+++ b/src/views/report/glass/day.vue
@@ -1,7 +1,7 @@
@@ -16,9 +16,9 @@
- 查询
- 导出
diff --git a/src/views/report/glass/inputTable.vue b/src/views/report/glass/inputTable.vue
index e112eb3f..4b33c779 100644
--- a/src/views/report/glass/inputTable.vue
+++ b/src/views/report/glass/inputTable.vue
@@ -1,7 +1,7 @@
@@ -206,12 +206,10 @@ const cols = [
},
methods: {
handleReturn() {
- // this.disabled = true
this.edit = false
+ console.log(this.$parent.getDataList());
},
handleChange(e) {
- // console.log(q)
- console.log(e);
},
updateData() {
let obj = {}
diff --git a/src/views/report/glass/month.vue b/src/views/report/glass/month.vue
index ddbb382d..e958185d 100644
--- a/src/views/report/glass/month.vue
+++ b/src/views/report/glass/month.vue
@@ -7,7 +7,7 @@
- 查询
导出
diff --git a/src/views/report/glass/weekly.vue b/src/views/report/glass/weekly.vue
index 2b167a9a..5c1cdd66 100644
--- a/src/views/report/glass/weekly.vue
+++ b/src/views/report/glass/weekly.vue
@@ -14,7 +14,7 @@
- 查询
导出
diff --git a/src/views/report/glass/year.vue b/src/views/report/glass/year.vue
index 1d76ed21..31547716 100644
--- a/src/views/report/glass/year.vue
+++ b/src/views/report/glass/year.vue
@@ -9,7 +9,7 @@
- 查询
导出
diff --git a/src/views/report/productionDayReport/index.vue b/src/views/report/productionDayReport/index.vue
index 23563c5c..f16e7da3 100644
--- a/src/views/report/productionDayReport/index.vue
+++ b/src/views/report/productionDayReport/index.vue
@@ -1,7 +1,7 @@
@@ -456,6 +456,8 @@ export default {
handleReturn() {
this.disabled = true
this.isSave = false
+ this.getDataList()
+
},
format(shijianchuo) {
//shijianchuo是整数,否则要parseInt转换