|  |  |  | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | methods: { | 
|---|
|  |  |  | init(){ | 
|---|
|  |  |  | let that = this | 
|---|
|  |  |  | ws = new WebSocket("ws://" + window.location.host + baseUrl + "/console/websocket"); | 
|---|
|  |  |  | ws.onopen = this.webSocketOnOpen | 
|---|
|  |  |  | ws.onerror = this.webSocketOnError | 
|---|
|  |  |  | ws.onmessage = this.webSocketOnMessage | 
|---|
|  |  |  | ws.onclose = this.webSocketClose | 
|---|
|  |  |  |  | 
|---|
|  |  |  | this.getMap(this.currentLev) | 
|---|
|  |  |  | this.initLev()//初始化楼层信息 | 
|---|
|  |  |  |  | 
|---|
|  |  |  | this.consoleInterval = setInterval(() => { | 
|---|
|  |  |  | this.getMap(this.currentLev) //获取实时地图数据 | 
|---|
|  |  |  | this.getShuttleStateInfo() //获取四向穿梭车信息 | 
|---|
|  |  |  | this.getLiftStateInfo() //获取提升机信息 | 
|---|
|  |  |  | this.getSiteInfo() //获取输送站点数据 | 
|---|
|  |  |  | // this.getCodeData()//获取条码 | 
|---|
|  |  |  | }, 1000) | 
|---|
|  |  |  | this.initLev()//初始化楼层信息 | 
|---|
|  |  |  | setTimeout(() => { | 
|---|
|  |  |  | that.getMap(this.currentLev) | 
|---|
|  |  |  | }, 1000); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // this.consoleInterval = setInterval(() => { | 
|---|
|  |  |  | //   this.getMap(this.currentLev) //获取实时地图数据 | 
|---|
|  |  |  | //   this.getShuttleStateInfo() //获取四向穿梭车信息 | 
|---|
|  |  |  | //   this.getLiftStateInfo() //获取提升机信息 | 
|---|
|  |  |  | //   this.getSiteInfo() //获取输送站点数据 | 
|---|
|  |  |  | //   // this.getCodeData()//获取条码 | 
|---|
|  |  |  | // }, 1000) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | initLev(){ | 
|---|
|  |  |  | 
|---|
|  |  |  | //获取地图数据 | 
|---|
|  |  |  | getMap(lev) { | 
|---|
|  |  |  | this.sendWs(JSON.stringify({ | 
|---|
|  |  |  | "url": "/console/map/auth", | 
|---|
|  |  |  | "url": "/console/locMap/auth", | 
|---|
|  |  |  | "data": lev | 
|---|
|  |  |  | })) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | 
|---|
|  |  |  | this.setSiteInfo(JSON.parse(result.data)) | 
|---|
|  |  |  | }else if (result.url == "/console/map/auth") { | 
|---|
|  |  |  | this.setMap(JSON.parse(result.data)) | 
|---|
|  |  |  | }else if (result.url == "/console/locMap/auth") { | 
|---|
|  |  |  | this.setMap(JSON.parse(result.data)) | 
|---|
|  |  |  | }else if (result.url == "/console/barcode/output/site") { | 
|---|
|  |  |  | this.setCodeData(JSON.parse(result.data)) | 
|---|
|  |  |  | } | 
|---|