|
@@ -888,9 +888,12 @@ const mockStart = async (state: boolean = false) => {
|
|
},
|
|
},
|
|
];
|
|
];
|
|
xAxisData.value = [];
|
|
xAxisData.value = [];
|
|
- wsMockClient.connect();
|
|
|
|
- // 向服务器发送消息
|
|
|
|
- wsMockClient.send("你好!");
|
|
|
|
|
|
+
|
|
|
|
+ if (wsMockClient.readyState === WebSocket.CLOSED) {
|
|
|
|
+ wsMockClient.connect();
|
|
|
|
+ // 向服务器发送消息
|
|
|
|
+ wsMockClient.send("你好!");
|
|
|
|
+ }
|
|
|
|
|
|
handleDateRangeChange({
|
|
handleDateRangeChange({
|
|
start: queryParamsMock.value.sDate,
|
|
start: queryParamsMock.value.sDate,
|
|
@@ -1019,7 +1022,7 @@ const saveAttr = () => {
|
|
showModal.value = false;
|
|
showModal.value = false;
|
|
}
|
|
}
|
|
onUnmounted(() => {
|
|
onUnmounted(() => {
|
|
- wsMockClient.onClose();
|
|
|
|
|
|
+ wsMockClient.close();
|
|
});
|
|
});
|
|
// 获取警告提示
|
|
// 获取警告提示
|
|
const getTip = () => {
|
|
const getTip = () => {
|