| | |
| | | </template> |
| | | <script> |
| | | |
| | | import { listOrderScheduling, forceUploadMethod, getOrderScheduling, delOrderScheduling, addOrderScheduling, updateOrderScheduling } from "@/api/main/bs/orderScheduling/orderScheduling"; |
| | | import { listOrderScheduling, forceUploadMethod, getUrl, getOrderScheduling, delOrderScheduling, addOrderScheduling, updateOrderScheduling } from "@/api/main/bs/orderScheduling/orderScheduling"; |
| | | import { listPassingStationCollection, getPassingStationCollection, delPassingStationCollection, addPassingStationCollection, updatePassingStationCollection } from "@/api/main/da/passingStationCollection/passingStationCollection"; |
| | | import {listLineInfo} from "@/api/main/bs/lineInfo/lineInfo"; |
| | | import WebSocketReconnect from "@/utils/WebsocketTool"; |
| | |
| | | props: [], |
| | | data() { |
| | | return { |
| | | websocketUrl: '', |
| | | websocket: null, |
| | | result: {}, |
| | | transEngineNo: '', |
| | |
| | | // immediate:true |
| | | // } |
| | | }, |
| | | created() {}, |
| | | created() { |
| | | |
| | | }, |
| | | mounted() { |
| | | this.initWebSocket() |
| | | this.getWebUrl() |
| | | |
| | | }, |
| | | methods: { |
| | | getWebUrl(){ |
| | | console.log("1111") |
| | | getUrl().then(res=>{ |
| | | console.log("res",res) |
| | | this.websocketUrl = res+"OP120" |
| | | this.initWebSocket() |
| | | }) |
| | | }, |
| | | forceUpload() { |
| | | console.log('0000', this.form.engineNo) |
| | | if (this.form.engineNo !== null) { |
| | |
| | | //判断当前浏览器是否支持WebSocket |
| | | if ('WebSocket' in window) { |
| | | //连接WebSocket节点 |
| | | this.websocket = new WebSocketReconnect('ws://127.0.0.1:8086/websocket/111122') |
| | | console.log("9999",this.websocketUrl) |
| | | this.websocket = new WebSocketReconnect(this.websocketUrl) |
| | | |
| | | //接收到消息的回调方法 |
| | | this.websocket.socket.onmessage = (event) => { |