websocket代码提交
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user