微调
This commit is contained in:
@@ -335,6 +335,11 @@ const shouldShowOption = (item) => {
|
||||
}
|
||||
}
|
||||
|
||||
//开始创建webSocket客户端
|
||||
const dataSocket = reactive({
|
||||
socketServe: socketClient.Instance,
|
||||
});
|
||||
|
||||
tableHeight.value = window.innerHeight - 600
|
||||
const deviceData = ref<Device.ResPqDev[]>([])
|
||||
const operationShow = ref(false)
|
||||
@@ -983,16 +988,13 @@ const handleTest = async (val: string) => {
|
||||
// return;
|
||||
// }
|
||||
|
||||
//开始创建webSocket客户端
|
||||
const data = reactive({
|
||||
socketServe: socketClient.Instance,
|
||||
});
|
||||
const url = 'ws://192.168.1.127:7777/hello?name=cdf';
|
||||
|
||||
const url = 'ws://localhost:7777/hello?name=cdf';
|
||||
socketClient.Instance.connect(url);
|
||||
data.socketServe = socketClient.Instance;
|
||||
data.socketServe.registerCallBack('aaa', (res: { code: number; }) => {
|
||||
dataSocket.socketServe = socketClient.Instance;
|
||||
dataSocket.socketServe.registerCallBack('aaa', (res: { code: number; }) => {
|
||||
// 处理来自服务器的消息
|
||||
console.log('Received message:', res)
|
||||
//console.log('Received message:', res)
|
||||
// 根据需要在这里添加更多的处理逻辑
|
||||
if (res.code === 20000) {
|
||||
ElMessage.error(message.message)
|
||||
@@ -1136,6 +1138,8 @@ onBeforeMount(async () => {
|
||||
})
|
||||
|
||||
const handleQuitClicked = () => {
|
||||
console.log('handleQuitClicked')
|
||||
dataSocket.socketServe.closeWs()
|
||||
emit('batchGenerateClicked') // 触发事件
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user