#
Junjie
2025-08-01 728ad81fa10d2879654c5f9ae4314db94eafb865
src/main/webapp/views/shuttleNew.html
@@ -202,7 +202,7 @@
                        </div>
                    </div>
                    <div class="bg-slate-700 p-4 rounded-lg">
                        <h3 class="text-lg font-medium mb-2">设备维护</h3>
                        <h3 class="text-lg font-medium mb-2">设备指令</h3>
                        <div class="flex flex-wrap gap-2" style="display: flex;justify-content: center;">
                            <button class="btn bg-slate-600 hover:bg-slate-500" @click="shuttleOperator('palletLift')">
                                <i class="fas fa-level-up mr-1"></i>托盘顶升
@@ -406,9 +406,9 @@
        },
        methods: {
            init() {
                this.websocketConnect();
                this.consoleInterval = setInterval(() => {
                    this.websocketConnect();
                    this.getShuttleStateInfo() //获取四向穿梭车信息
                }, 1000)
            },
@@ -594,18 +594,20 @@
                });
            },
            websocketConnect() {
                this.ws = new WebSocket("ws://" + window.location.host + baseUrl + "/console/websocket");
                this.ws.onopen = this.webSocketOnOpen
                this.ws.onerror = this.webSocketOnError
                this.ws.onmessage = this.webSocketOnMessage
                this.ws.onclose = this.webSocketClose
                if (this.ws == null) {
                    this.ws = new WebSocket("ws://" + window.location.host + baseUrl + "/console/websocket");
                    this.ws.onopen = this.webSocketOnOpen
                    this.ws.onerror = this.webSocketOnError
                    this.ws.onmessage = this.webSocketOnMessage
                    this.ws.onclose = this.webSocketClose
                }
            },
            webSocketOnOpen(e) {
                console.log("open");
            },
            webSocketOnError(e) {
                this.ws = null;
                console.log(e);
                this.websocketConnect();
            },
            webSocketOnMessage(e) {
                const result = JSON.parse(e.data);
@@ -614,12 +616,16 @@
                }
            },
            webSocketClose(e) {
                this.ws = null;
                console.log("close");
                this.websocketConnect();
            },
            sendWs(message) {
                if (this.ws == null) {
                    return;
                }
                if (this.ws.readyState == WebSocket.OPEN) {
                    this.ws.send(message)
                    this.ws.send(message);
                }
            }
        }