websocket代码提交

This commit is contained in:
2025-01-17 09:14:19 +08:00
parent 07a5e32579
commit 9e8ed310fc
3 changed files with 19 additions and 12 deletions

View File

@@ -216,8 +216,7 @@ const open = (selection: Device.ResPqDev[], title: string, time: boolean) => {
preTestStatus.value = 'waiting';//预检测执行状态
//开始创建webSocket客户端
const url = 'ws://localhost:7777/hello?name=cdf';
socketClient.Instance.connect(url);
socketClient.Instance.connect();
dataSocket.socketServe = socketClient.Instance;
dataSocket.socketServe.registerCallBack('aaa', (res) => {
// 处理来自服务器的消息
@@ -249,16 +248,16 @@ const handleSubmit = () => {
let deviceIds = checkStore.devices.map((item) => item.deviceId)
let planId = checkStore.planId
if(!dataSocket.socketServe.connected){
ElMessage.error('webSocket连接中断')
return
}
switch (stepsActiveIndex.value) {
case 0:
// preTestStatus.value = 'start'
/* loading = ElLoading.service({
lock: true,
text: '',
background: 'rgb(255, 255, 255, 0)',
})*/
startPreTest({
userPageId: "cdf",
devIds: deviceIds,