| | |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date createTime; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | private Integer result; |
| | | |
| | | public HttpRequestLog() {} |
| | | |
| | | public HttpRequestLog(String name,String request,String response,Date createTime) { |
| | | public HttpRequestLog(String name,String request,String response,Date createTime,Integer result) { |
| | | this.name = name; |
| | | this.request = request; |
| | | this.response = response; |
| | |
| | | package com.zy.asrs.ws; |
| | | |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.core.common.R; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.asrs.controller.CrnController; |
| | | import com.zy.asrs.controller.RgvController; |
| | | import com.zy.asrs.controller.BasMapController; |
| | | import com.zy.asrs.controller.ConsoleController; |
| | | import lombok.Data; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Component; |
| | |
| | | */ |
| | | @OnMessage |
| | | public void onMessage(String message, Session session) throws IOException { |
| | | // log.info("收到来自连接:" + sessionId + "的信息:" + message); |
| | | Object resObj = null; |
| | | String url = null; |
| | | try { |
| | | JSONObject req = JSON.parseObject(message); |
| | | url = req.getString("url"); |
| | | if (url == null) { |
| | | return; |
| | | } |
| | | if (url.startsWith("/basMap/lev/") && url.endsWith("/auth")) { |
| | | String[] segs = url.split("/"); |
| | | Integer lev = null; |
| | | for (int i = 0; i < segs.length; i++) { |
| | | if ("lev".equals(segs[i]) && i + 1 < segs.length) { |
| | | try { |
| | | lev = Integer.parseInt(segs[i + 1]); |
| | | } catch (Exception ignore) {} |
| | | break; |
| | | } |
| | | } |
| | | BasMapController basMapController = SpringUtils.getBean(BasMapController.class); |
| | | R r = basMapController.getByLev(lev); |
| | | resObj = r; |
| | | } else if ("/console/latest/data/station".equals(url)) { |
| | | ConsoleController consoleController = SpringUtils.getBean(ConsoleController.class); |
| | | resObj = consoleController.stationLatestData(); |
| | | } else if ("/console/latest/data/crn".equals(url)) { |
| | | ConsoleController consoleController = SpringUtils.getBean(ConsoleController.class); |
| | | resObj = consoleController.crnLatestData(); |
| | | } else if ("/console/latest/data/rgv".equals(url)) { |
| | | ConsoleController consoleController = SpringUtils.getBean(ConsoleController.class); |
| | | resObj = consoleController.rgvLatestData(); |
| | | } else if ("/crn/table/crn/state".equals(url)) { |
| | | resObj = SpringUtils.getBean(CrnController.class).crnStateTable(); |
| | | } else if ("/rgv/table/rgv/state".equals(url)) { |
| | | resObj = SpringUtils.getBean(RgvController.class).rgvStateTable(); |
| | | } |
| | | } catch (Exception e) { |
| | | R err = R.error(e.getMessage()); |
| | | JSONObject out = new JSONObject(); |
| | | out.put("url", "error"); |
| | | out.put("data", JSON.toJSONString(err)); |
| | | this.sendMessage(out.toJSONString()); |
| | | return; |
| | | } |
| | | if (resObj != null && url != null) { |
| | | JSONObject out = new JSONObject(); |
| | | out.put("url", url); |
| | | out.put("data", JSON.toJSONString(resObj)); |
| | | this.sendMessage(out.toJSONString()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | |
| | | //检测浅库位状态 |
| | | public synchronized boolean checkShallowLocStatus(String locNo, Integer taskNo) { |
| | | String checkDeepLocOutTaskBlockReport = "Y"; |
| | | Object systemConfigMapObj = redisUtil.get(RedisKeyType.SYSTEM_CONFIG_MAP.key); |
| | | if (systemConfigMapObj != null) { |
| | | HashMap<String, String> systemConfigMap = (HashMap<String, String>) systemConfigMapObj; |
| | | checkDeepLocOutTaskBlockReport = systemConfigMap.get("checkDeepLocOutTaskBlockReport"); |
| | | } |
| | | |
| | | if (!checkDeepLocOutTaskBlockReport.equals("Y")) { |
| | | return true; |
| | | } |
| | | |
| | | Object lock = redisUtil.get(RedisKeyType.CHECK_SHALLOW_LOC_STATUS_LIMIT.key + taskNo); |
| | | if (lock != null) { |
| | | return false; |
| | |
| | | package com.zy.core.utils; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.common.Cools; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.BasCrnp; |
| | | import com.zy.asrs.entity.HttpRequestLog; |
| | | import com.zy.asrs.entity.WrkMast; |
| | |
| | | |
| | | HashMap<String, Object> requestParam = new HashMap<>(); |
| | | String response = null; |
| | | int result = 0; |
| | | try { |
| | | requestParam.put("barcode", barcode); |
| | | requestParam.put("sourceStaNo", sourceStaNo); |
| | |
| | | .setTimeout(360, TimeUnit.SECONDS) |
| | | .build() |
| | | .doPost(); |
| | | News.info("请求WMS入库接口成功!!!url:{};request:{};response:{}", wmsUrl + wmsSystemInUrl, JSON.toJSONString(requestParam), response); |
| | | if (response != null) { |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | if (jsonObject.getInteger("code") == 200) { |
| | | result = 1; |
| | | News.info("请求WMS入库接口成功!!!url:{};request:{};response:{}", wmsUrl + wmsSystemInUrl, JSON.toJSONString(requestParam), response); |
| | | }else { |
| | | News.info("请求WMS入库接口失败,接口返回Code异常!!!url:{};request:{};response:{}", wmsUrl + wmsSystemInUrl, JSON.toJSONString(requestParam), response); |
| | | } |
| | | }else { |
| | | News.info("请求WMS入库接口失败,接口未响应!!!url:{};request:{};response:{}", wmsUrl + wmsSystemInUrl, JSON.toJSONString(requestParam), response); |
| | | } |
| | | } catch (Exception e) { |
| | | News.error("请求WMS入库接口异常!!!url:{};request:{};response:{}", wmsUrl + wmsSystemInUrl, JSON.toJSONString(requestParam), response, e); |
| | | } finally { |
| | |
| | | httpRequestLog.setRequest(JSON.toJSONString(requestParam)); |
| | | httpRequestLog.setResponse(response); |
| | | httpRequestLog.setCreateTime(new Date()); |
| | | httpRequestLog.setResult(result); |
| | | httpRequestLogService.insert(httpRequestLog); |
| | | } |
| | | return response; |
| | |
| | | |
| | | HashMap<String, Object> requestParam = new HashMap<>(); |
| | | String response = null; |
| | | int result = 0; |
| | | try { |
| | | requestParam.put("taskNo", wrkMast.getWmsWrkNo()); |
| | | requestParam.put("row", Utils.getInTaskEnableRow(new ArrayList<>(wrkMast.getCrnNo()), false)); |
| | |
| | | .setTimeout(360, TimeUnit.SECONDS) |
| | | .build() |
| | | .doPost(); |
| | | News.info("请求申请任务重新分配入库接口成功!!!url:{};request:{};response:{}", wmsUrl + wmsSystemReassignInTaskUrl, JSON.toJSONString(requestParam), response); |
| | | if (response != null) { |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | if (jsonObject.getInteger("code") == 200) { |
| | | result = 1; |
| | | News.info("请求申请任务重新分配入库接口成功!!!url:{};request:{};response:{}", wmsUrl + wmsSystemReassignInTaskUrl, JSON.toJSONString(requestParam), response); |
| | | }else { |
| | | News.info("请求申请任务重新分配入库接口失败,接口返回Code异常!!!url:{};request:{};response:{}", wmsUrl + wmsSystemReassignInTaskUrl, JSON.toJSONString(requestParam), response); |
| | | } |
| | | }else { |
| | | News.info("请求申请任务重新分配入库接口失败,接口未响应!!!url:{};request:{};response:{}", wmsUrl + wmsSystemReassignInTaskUrl, JSON.toJSONString(requestParam), response); |
| | | } |
| | | } catch (Exception e) { |
| | | News.error("请求申请任务重新分配入库接口异常!!!url:{};request:{}; response:{}", wmsUrl + wmsSystemReassignInTaskUrl, JSON.toJSONString(requestParam), response, e); |
| | | } finally { |
| | |
| | | httpRequestLog.setRequest(JSON.toJSONString(requestParam)); |
| | | httpRequestLog.setResponse(response); |
| | | httpRequestLog.setCreateTime(new Date()); |
| | | httpRequestLog.setResult(result); |
| | | httpRequestLogService.insert(httpRequestLog); |
| | | } |
| | | return response; |
| | |
| | | |
| | | HashMap<String, Object> requestParam = new HashMap<>(); |
| | | String response = null; |
| | | int result = 0; |
| | | try { |
| | | requestParam.put("locNo", locNo); |
| | | requestParam.put("row", crnRows); |
| | |
| | | .setTimeout(360, TimeUnit.SECONDS) |
| | | .build() |
| | | .doPost(); |
| | | News.info("请求WMS申请更换库位接口成功!!!url:{};request:{};response:{}", wmsUrl + wmsSystemChangeLocNoUrl, JSON.toJSONString(requestParam), response); |
| | | |
| | | return response; |
| | | if (response != null) { |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | if (jsonObject.getInteger("code") == 200) { |
| | | result = 1; |
| | | News.info("请求WMS申请更换库位接口成功!!!url:{};request:{};response:{}", wmsUrl + wmsSystemChangeLocNoUrl, JSON.toJSONString(requestParam), response); |
| | | }else { |
| | | News.info("请求WMS申请更换库位接口失败,接口返回Code异常!!!url:{};request:{};response:{}", wmsUrl + wmsSystemChangeLocNoUrl, JSON.toJSONString(requestParam), response); |
| | | } |
| | | }else { |
| | | News.info("请求WMS申请更换库位接口失败,接口未响应!!!url:{};request:{};response:{}", wmsUrl + wmsSystemChangeLocNoUrl, JSON.toJSONString(requestParam), response); |
| | | } |
| | | } catch (Exception e) { |
| | | News.error("请求WMS申请更换库位接口异常!!!url:{};request:{};response:{}", wmsUrl + wmsSystemChangeLocNoUrl, JSON.toJSONString(requestParam), response, e); |
| | | } finally { |
| | |
| | | httpRequestLog.setRequest(JSON.toJSONString(requestParam)); |
| | | httpRequestLog.setResponse(response); |
| | | httpRequestLog.setCreateTime(new Date()); |
| | | httpRequestLog.setResult(result); |
| | | httpRequestLogService.insert(httpRequestLog); |
| | | } |
| | | return null; |
| | | return response; |
| | | } |
| | | |
| | | } |
| | |
| | | import com.zy.common.entity.Parameter; |
| | | import com.zy.system.entity.Config; |
| | | import com.zy.system.service.ConfigService; |
| | | import com.zy.common.utils.RedisUtil; |
| | | import com.zy.core.enums.RedisKeyType; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | |
| | | @Autowired |
| | | private ConfigService configService; |
| | | @Autowired |
| | | private RedisUtil redisUtil; |
| | | |
| | | @RequestMapping(value = "/config/refreshCache") |
| | | @ManagerAuth |
| | | public R refreshCache(){ |
| | | HashMap<String, String> systemConfigMap = new HashMap<>(); |
| | | List<Config> configList = configService.selectList(new EntityWrapper<>()); |
| | | for (Config config : configList) { |
| | | systemConfigMap.put(config.getCode(), config.getValue()); |
| | | } |
| | | redisUtil.set(RedisKeyType.SYSTEM_CONFIG_MAP.key, systemConfigMap); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/config/{id}/auth") |
| | | @ManagerAuth |
| | |
| | | <result column="request" property="request" /> |
| | | <result column="response" property="response" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="result" property="result" /> |
| | | |
| | | </resultMap> |
| | | |
| | |
| | | this.currentPage = 1; |
| | | }, |
| | | getDevpStateInfo() { |
| | | if (this.$root.sendWs) { |
| | | this.$root.sendWs(JSON.stringify({ |
| | | "url": "/console/latest/data/station", |
| | | "data": {} |
| | | })); |
| | | } |
| | | }, |
| | | setStationList(res) { |
| | | let that = this; |
| | | $.ajax({ |
| | | url: baseUrl + "/console/latest/data/station", |
| | | headers: { |
| | | token: localStorage.getItem("token"), |
| | | }, |
| | | method: "post", |
| | | success: (res) => { |
| | | // 堆垛机信息表获取 |
| | | if (res.code == 200) { |
| | | let list = res.data; |
| | | if (res.code == 200) { |
| | | let list = res.data; |
| | | |
| | | if (that.searchStationId == "") { |
| | | that.stationList = list; |
| | | } else { |
| | | let tmp = []; |
| | | list.forEach((item) => { |
| | | if (item.stationId == that.searchStationId) { |
| | | tmp.push(item); |
| | | } |
| | | }); |
| | | that.stationList = tmp; |
| | | that.currentPage = 1; |
| | | if (that.searchStationId == "") { |
| | | that.stationList = list; |
| | | } else { |
| | | let tmp = []; |
| | | list.forEach((item) => { |
| | | if (item.stationId == that.searchStationId) { |
| | | tmp.push(item); |
| | | } |
| | | } |
| | | }, |
| | | }); |
| | | }); |
| | | that.stationList = tmp; |
| | | that.currentPage = 1; |
| | | } |
| | | } |
| | | }, |
| | | openControl() { |
| | | this.showControl = !this.showControl; |
| | |
| | | map: [], |
| | | currentLev: 1, |
| | | mapFps: 0, |
| | | ws: null, |
| | | pixiApp: null, |
| | | pixiStageList: [], |
| | | pixiStaMap: new Map(), |
| | |
| | | mounted() { |
| | | this.currentLev = this.lev || 1; |
| | | this.createMap(); |
| | | this.getMap(this.currentLev); |
| | | 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; |
| | | |
| | | setTimeout(() => { |
| | | this.getMap(this.currentLev); |
| | | }, 1000); |
| | | |
| | | this.timer = setInterval(() => { |
| | | this.getCrnInfo(); |
| | | this.getSiteInfo(); |
| | |
| | | } |
| | | }, |
| | | getMap() { |
| | | $.ajax({ |
| | | url: baseUrl + "/basMap/lev/" + this.currentLev + "/auth", |
| | | headers: { 'token': localStorage.getItem('token') }, |
| | | method: 'get', |
| | | success: (res) => { |
| | | const data = res.data; |
| | | const mapData = JSON.parse(data); |
| | | this.createMapData(mapData); |
| | | } |
| | | }) |
| | | this.sendWs(JSON.stringify({ url: "/basMap/lev/" + this.currentLev + "/auth", data: {} })); |
| | | }, |
| | | changeFloor(lev) { |
| | | this.currentLev = lev; |
| | |
| | | }, |
| | | getCrnInfo() { |
| | | if (this.isSwitchingFloor) { return; } |
| | | $.ajax({ |
| | | url: baseUrl + "/console/latest/data/crn", |
| | | headers: { 'token': localStorage.getItem('token') }, |
| | | method: 'POST', |
| | | success: (res) => { |
| | | if (res.code === 200) { |
| | | var crns = res.data; |
| | | for (var i = 0; i < crns.length; i++) { |
| | | const id = parseInt(crns[i].crnId); |
| | | const sprite = this.pixiCrnMap.get(id); |
| | | if (!sprite) { continue; } |
| | | const taskNo = crns[i].taskNo; |
| | | if (taskNo != null && taskNo > 0) { sprite.textObj.text = id + "(" + taskNo + ")"; } else { sprite.textObj.text = String(id); } |
| | | const status = crns[i].crnStatus; |
| | | const statusColor = this.getCrnStatusColor(status); |
| | | this.updateCrnTextureColor(sprite, statusColor); |
| | | let bay = parseInt(crns[i].bay, 10); |
| | | if (isNaN(bay) || bay < 1 || bay === -2) { bay = 1; } |
| | | let rowIndex = (sprite.rowIndex != null) ? sprite.rowIndex : -1; |
| | | if (rowIndex === -1) { |
| | | for (let r = 0; r < this.map.length; r++) { |
| | | if (this.map[r].length > 0) { |
| | | const rowY = this.map[r][0].posY; |
| | | if (Math.abs(rowY - sprite.y) < 0.5) { rowIndex = r; break; } |
| | | } |
| | | } |
| | | if (rowIndex === -1) { rowIndex = 0; } |
| | | } |
| | | let targetCell = null; |
| | | let crnCount = 0; |
| | | for (let c = 0; c < this.map[rowIndex].length; c++) { |
| | | const cell = this.map[rowIndex][c]; |
| | | if (cell && cell.type === 'crn') { crnCount++; if (crnCount === bay) { targetCell = cell; break; } } |
| | | } |
| | | if (!targetCell) { |
| | | for (let c = this.map[rowIndex].length - 1; c >= 0; c--) { |
| | | const cell = this.map[rowIndex][c]; |
| | | if (cell && cell.type === 'crn') { targetCell = cell; break; } |
| | | } |
| | | } |
| | | if (!targetCell) { continue; } |
| | | const targetX = targetCell.posX + (targetCell.width - sprite.width) / 2; |
| | | const dx = Math.abs(targetX - sprite.x); |
| | | if (dx < 1) { |
| | | } else if (dx < 5) { |
| | | sprite.x = targetX; |
| | | } else if (window.gsap) { |
| | | window.gsap.killTweensOf(sprite); |
| | | window.gsap.to(sprite, { x: targetX, duration: 0.3, ease: "power1.inOut" }); |
| | | } else { |
| | | sprite.x = targetX; |
| | | } |
| | | } |
| | | } |
| | | this.scheduleAdjustLabels(); |
| | | } |
| | | }); |
| | | this.sendWs(JSON.stringify({ url: "/console/latest/data/crn", data: {} })); |
| | | }, |
| | | getSiteInfo() { |
| | | if (this.isSwitchingFloor) { return; } |
| | | $.ajax({ |
| | | url: baseUrl + "/console/latest/data/station", |
| | | headers: { 'token': localStorage.getItem('token') }, |
| | | method: 'POST', |
| | | success: (res) => { this.setSiteInfo(res); } |
| | | }); |
| | | this.sendWs(JSON.stringify({ url: "/console/latest/data/station", data: {} })); |
| | | }, |
| | | getRgvInfo() { |
| | | if (this.isSwitchingFloor) { return; } |
| | | $.ajax({ |
| | | url: baseUrl + "/console/latest/data/rgv", |
| | | headers: { 'token': localStorage.getItem('token') }, |
| | | method: 'POST', |
| | | success: (res) => { |
| | | if (res.code === 200) { |
| | | const rgvs = res.data; |
| | | for (let i = 0; i < rgvs.length; i++) { |
| | | const id = parseInt(rgvs[i].rgvNo, 10); |
| | | const sprite = this.pixiRgvMap.get(id); |
| | | if (!sprite) { continue; } |
| | | const taskNo = rgvs[i].taskNo; |
| | | if (sprite.textObj) { if (taskNo != null && taskNo > 0) { sprite.textObj.text = id + "(" + taskNo + ")"; } else { sprite.textObj.text = String(id); } } |
| | | const statusColor = this.getRgvStatusColor(rgvs[i].rgvStatus); |
| | | this.updateRgvTextureColor(sprite, statusColor); |
| | | let trackSiteNo = parseInt(rgvs[i].trackSiteNo, 10); |
| | | if (!trackSiteNo || trackSiteNo <= 0) { continue; } |
| | | let rowIndex = (sprite.rowIndex != null) ? sprite.rowIndex : 0; |
| | | let targetCell = null; |
| | | for (let c = 0; c < this.map[rowIndex].length; c++) { |
| | | const cell = this.map[rowIndex][c]; |
| | | if (!cell || cell.type !== 'rgv') { continue; } |
| | | const ts = this.getTrackSiteNo(cell.value); |
| | | if (ts === trackSiteNo) { targetCell = cell; break; } |
| | | } |
| | | if (!targetCell) { |
| | | for (let c = this.map[rowIndex].length - 1; c >= 0; c--) { |
| | | const cell = this.map[rowIndex][c]; |
| | | if (cell && cell.type === 'rgv') { targetCell = cell; break; } |
| | | } |
| | | } |
| | | if (!targetCell) { continue; } |
| | | const targetX = targetCell.posX + (targetCell.width - sprite.width) / 2; |
| | | const dx = Math.abs(targetX - sprite.x); |
| | | if (dx < 1) { |
| | | } else if (dx < 5) { |
| | | sprite.x = targetX; |
| | | } else if (window.gsap) { |
| | | window.gsap.killTweensOf(sprite); |
| | | window.gsap.to(sprite, { x: targetX, duration: 0.3, ease: "power1.inOut" }); |
| | | } else { |
| | | sprite.x = targetX; |
| | | } |
| | | this.sendWs(JSON.stringify({ url: "/console/latest/data/rgv", data: {} })); |
| | | }, |
| | | setCrnInfo(res) { |
| | | let crns = Array.isArray(res) ? res : (res && res.code === 200 ? res.data : null); |
| | | if (!crns) { return; } |
| | | for (var i = 0; i < crns.length; i++) { |
| | | const id = parseInt(crns[i].crnId); |
| | | const sprite = this.pixiCrnMap.get(id); |
| | | if (!sprite) { continue; } |
| | | const taskNo = crns[i].taskNo; |
| | | if (taskNo != null && taskNo > 0) { sprite.textObj.text = id + "(" + taskNo + ")"; } else { sprite.textObj.text = String(id); } |
| | | const status = crns[i].crnStatus; |
| | | const statusColor = this.getCrnStatusColor(status); |
| | | this.updateCrnTextureColor(sprite, statusColor); |
| | | let bay = parseInt(crns[i].bay, 10); |
| | | if (isNaN(bay) || bay < 1 || bay === -2) { bay = 1; } |
| | | let rowIndex = (sprite.rowIndex != null) ? sprite.rowIndex : -1; |
| | | if (rowIndex === -1) { |
| | | for (let r = 0; r < this.map.length; r++) { |
| | | if (this.map[r].length > 0) { |
| | | const rowY = this.map[r][0].posY; |
| | | if (Math.abs(rowY - sprite.y) < 0.5) { rowIndex = r; break; } |
| | | } |
| | | } |
| | | this.scheduleAdjustLabels(); |
| | | if (rowIndex === -1) { rowIndex = 0; } |
| | | } |
| | | }); |
| | | let targetCell = null; |
| | | let crnCount = 0; |
| | | for (let c = 0; c < this.map[rowIndex].length; c++) { |
| | | const cell = this.map[rowIndex][c]; |
| | | if (cell && cell.type === 'crn') { crnCount++; if (crnCount === bay) { targetCell = cell; break; } } |
| | | } |
| | | if (!targetCell) { |
| | | for (let c = this.map[rowIndex].length - 1; c >= 0; c--) { |
| | | const cell = this.map[rowIndex][c]; |
| | | if (cell && cell.type === 'crn') { targetCell = cell; break; } |
| | | } |
| | | } |
| | | if (!targetCell) { continue; } |
| | | const targetX = targetCell.posX + (targetCell.width - sprite.width) / 2; |
| | | const dx = Math.abs(targetX - sprite.x); |
| | | if (dx < 1) { |
| | | } else if (dx < 5) { |
| | | sprite.x = targetX; |
| | | } else if (window.gsap) { |
| | | window.gsap.killTweensOf(sprite); |
| | | window.gsap.to(sprite, { x: targetX, duration: 0.3, ease: "power1.inOut" }); |
| | | } else { |
| | | sprite.x = targetX; |
| | | } |
| | | } |
| | | this.scheduleAdjustLabels(); |
| | | }, |
| | | setRgvInfo(res) { |
| | | let rgvs = Array.isArray(res) ? res : (res && res.code === 200 ? res.data : null); |
| | | if (!rgvs) { return; } |
| | | for (let i = 0; i < rgvs.length; i++) { |
| | | const id = parseInt(rgvs[i].rgvNo, 10); |
| | | const sprite = this.pixiRgvMap.get(id); |
| | | if (!sprite) { continue; } |
| | | const taskNo = rgvs[i].taskNo; |
| | | if (sprite.textObj) { if (taskNo != null && taskNo > 0) { sprite.textObj.text = id + "(" + taskNo + ")"; } else { sprite.textObj.text = String(id); } } |
| | | const statusColor = this.getRgvStatusColor(rgvs[i].rgvStatus); |
| | | this.updateRgvTextureColor(sprite, statusColor); |
| | | let trackSiteNo = parseInt(rgvs[i].trackSiteNo, 10); |
| | | if (!trackSiteNo || trackSiteNo <= 0) { continue; } |
| | | let rowIndex = (sprite.rowIndex != null) ? sprite.rowIndex : 0; |
| | | let targetCell = null; |
| | | for (let c = 0; c < this.map[rowIndex].length; c++) { |
| | | const cell = this.map[rowIndex][c]; |
| | | if (!cell || cell.type !== 'rgv') { continue; } |
| | | const ts = this.getTrackSiteNo(cell.value); |
| | | if (ts === trackSiteNo) { targetCell = cell; break; } |
| | | } |
| | | if (!targetCell) { |
| | | for (let c = this.map[rowIndex].length - 1; c >= 0; c--) { |
| | | const cell = this.map[rowIndex][c]; |
| | | if (cell && cell.type === 'rgv') { targetCell = cell; break; } |
| | | } |
| | | } |
| | | if (!targetCell) { continue; } |
| | | const targetX = targetCell.posX + (targetCell.width - sprite.width) / 2; |
| | | const dx = Math.abs(targetX - sprite.x); |
| | | if (dx < 1) { |
| | | } else if (dx < 5) { |
| | | sprite.x = targetX; |
| | | } else if (window.gsap) { |
| | | window.gsap.killTweensOf(sprite); |
| | | window.gsap.to(sprite, { x: targetX, duration: 0.3, ease: "power1.inOut" }); |
| | | } else { |
| | | sprite.x = targetX; |
| | | } |
| | | } |
| | | this.scheduleAdjustLabels(); |
| | | }, |
| | | setMap(res) { |
| | | this.createMapData(JSON.parse(res.data)); |
| | | }, |
| | | webSocketOnOpen(e) { |
| | | }, |
| | | webSocketOnError(e) { |
| | | }, |
| | | webSocketOnMessage(e) { |
| | | const result = JSON.parse(e.data); |
| | | if (result.url === "/console/latest/data/station" || result.url === "/console/latest/data/site") { |
| | | this.setSiteInfo(JSON.parse(result.data)); |
| | | } else if (result.url === "/console/latest/data/crn") { |
| | | this.setCrnInfo(JSON.parse(result.data)); |
| | | } else if (result.url === "/console/latest/data/rgv") { |
| | | this.setRgvInfo(JSON.parse(result.data)); |
| | | } else if (typeof result.url === "string" && result.url.indexOf("/basMap/lev/") === 0) { |
| | | this.setMap(JSON.parse(result.data)); |
| | | } |
| | | }, |
| | | webSocketClose(e) { |
| | | }, |
| | | sendWs(message) { |
| | | if (this.ws && this.ws.readyState === WebSocket.OPEN) { |
| | | this.ws.send(message); |
| | | } |
| | | }, |
| | | createShelfSprite(width, height) { |
| | | let idx = width + "-" + height; |
| | |
| | | this.currentPage = 1; |
| | | }, |
| | | getCrnStateInfo() { |
| | | if (this.$root.sendWs) { |
| | | this.$root.sendWs(JSON.stringify({ |
| | | "url": "/crn/table/crn/state", |
| | | "data": {} |
| | | })); |
| | | } |
| | | }, |
| | | setCrnList(res) { |
| | | let that = this; |
| | | $.ajax({ |
| | | url: baseUrl + "/crn/table/crn/state", |
| | | headers: { |
| | | token: localStorage.getItem("token"), |
| | | }, |
| | | method: "post", |
| | | success: (res) => { |
| | | // 堆垛机信息表获取 |
| | | if (res.code == 200) { |
| | | let list = res.data; |
| | | if (res.code == 200) { |
| | | let list = res.data; |
| | | |
| | | if (that.searchCrnNo == "") { |
| | | that.crnList = list; |
| | | } else { |
| | | let tmp = []; |
| | | list.forEach((item) => { |
| | | if (item.crnNo == that.searchCrnNo) { |
| | | tmp.push(item); |
| | | } |
| | | }); |
| | | that.crnList = tmp; |
| | | that.currentPage = 1; |
| | | if (that.searchCrnNo == "") { |
| | | that.crnList = list; |
| | | } else { |
| | | let tmp = []; |
| | | list.forEach((item) => { |
| | | if (item.crnNo == that.searchCrnNo) { |
| | | tmp.push(item); |
| | | } |
| | | } |
| | | }, |
| | | }); |
| | | }); |
| | | that.crnList = tmp; |
| | | that.currentPage = 1; |
| | | } |
| | | } |
| | | }, |
| | | openControl() { |
| | | this.showControl = !this.showControl; |
| | |
| | | this.currentPage = 1; |
| | | }, |
| | | getRgvStateInfo() { |
| | | if (this.$root.sendWs) { |
| | | this.$root.sendWs(JSON.stringify({ |
| | | "url": "/rgv/table/rgv/state", |
| | | "data": {} |
| | | })); |
| | | } |
| | | }, |
| | | setRgvList(res) { |
| | | let that = this; |
| | | $.ajax({ |
| | | url: baseUrl + "/rgv/table/rgv/state", |
| | | headers: { |
| | | token: localStorage.getItem("token"), |
| | | }, |
| | | method: "post", |
| | | success: (res) => { |
| | | if (res.code == 200) { |
| | | let list = res.data || []; |
| | | if (that.searchRgvNo == "") { |
| | | that.rgvList = list; |
| | | } else { |
| | | let tmp = []; |
| | | list.forEach((item) => { |
| | | if (item.rgvNo == that.searchRgvNo) { |
| | | tmp.push(item); |
| | | } |
| | | }); |
| | | that.rgvList = tmp; |
| | | that.currentPage = 1; |
| | | if (res.code == 200) { |
| | | let list = res.data || []; |
| | | if (that.searchRgvNo == "") { |
| | | that.rgvList = list; |
| | | } else { |
| | | let tmp = []; |
| | | list.forEach((item) => { |
| | | if (item.rgvNo == that.searchRgvNo) { |
| | | tmp.push(item); |
| | | } |
| | | } |
| | | }, |
| | | }); |
| | | }); |
| | | that.rgvList = tmp; |
| | | that.currentPage = 1; |
| | | } |
| | | } |
| | | }, |
| | | openControl() { |
| | | this.showControl = !this.showControl; |
| | |
| | | #btn-into { |
| | | display: none; |
| | | } |
| | | #btn-server-info { |
| | | display: none; |
| | | } |
| | | #btn-activate { |
| | | display: none; |
| | | } |
| | | |
| | | /*修改复选框颜色*/ |
| | | /*.layui-form-checked[lay-skin=primary] i {*/ |
| | |
| | | }); |
| | | } |
| | | break; |
| | | case 'refreshCache': |
| | | layer.confirm('确定刷新Redis缓存吗', function(){ |
| | | $.ajax({ |
| | | url: baseUrl+"/config/refreshCache", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | layer.msg('刷新成功'); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }) |
| | | }); |
| | | break; |
| | | case 'exportData': |
| | | layer.confirm('确定导出Excel吗', {shadeClose: true}, function(){ |
| | | var titles=[]; |
| | |
| | | }); |
| | | }); |
| | | break; |
| | | case 'serverInfo': |
| | | $.ajax({ |
| | | url: baseUrl + "/license/getServerInfos", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'GET', |
| | | success: function (res) { |
| | | var pretty = ''; |
| | | try { |
| | | pretty = JSON.stringify(res, null, 2); |
| | | } catch (e) { |
| | | pretty = res; |
| | | } |
| | | var html = '' |
| | | + '<div style="padding:15px 20px 5px 20px;">' |
| | | + '<div style="font-weight:600;margin-bottom:8px;">系统配置信息</div>' |
| | | + '<pre id="server-info-pre" style="background:#f7f7f7;border:1px solid #e6e6e6;border-radius:6px;padding:12px;white-space:pre-wrap;word-wrap:break-word;max-height:360px;overflow:auto;">' |
| | | + pretty |
| | | + '</pre>' |
| | | + '<div class="layui-btn-container" style="text-align:right;margin-top:6px;">' |
| | | + '<button class="layui-btn layui-btn-primary" id="copy-server-info">复制</button>' |
| | | + '</div>' |
| | | + '</div>'; |
| | | layer.open({ |
| | | type: 1, |
| | | title: '获取系统配置', |
| | | area: ['640px','480px'], |
| | | shadeClose: true, |
| | | content: html, |
| | | success: function (layero, index) { |
| | | layero.find('#copy-server-info').on('click', function () { |
| | | var text = layero.find('#server-info-pre').text(); |
| | | if (navigator.clipboard && navigator.clipboard.writeText) { |
| | | navigator.clipboard.writeText(text).then(function () { |
| | | layer.msg('已复制到剪贴板'); |
| | | }).catch(function () { |
| | | try { |
| | | var textarea = document.createElement('textarea'); |
| | | textarea.value = text; |
| | | textarea.style.position = 'fixed'; |
| | | textarea.style.opacity = '0'; |
| | | document.body.appendChild(textarea); |
| | | textarea.select(); |
| | | document.execCommand('copy'); |
| | | document.body.removeChild(textarea); |
| | | layer.msg('已复制到剪贴板'); |
| | | } catch (err) { |
| | | layer.msg('复制失败'); |
| | | } |
| | | }); |
| | | } else { |
| | | try { |
| | | var textarea = document.createElement('textarea'); |
| | | textarea.value = text; |
| | | textarea.style.position = 'fixed'; |
| | | textarea.style.opacity = '0'; |
| | | document.body.appendChild(textarea); |
| | | textarea.select(); |
| | | document.execCommand('copy'); |
| | | document.body.removeChild(textarea); |
| | | layer.msg('已复制到剪贴板'); |
| | | } catch (err) { |
| | | layer.msg('复制失败'); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | }, |
| | | error: function () { |
| | | layer.msg('获取系统配置信息失败'); |
| | | } |
| | | }); |
| | | break; |
| | | case 'activate': |
| | | layer.confirm('确定执行一键激活吗', function(){ |
| | | $.ajax({ |
| | | url: baseUrl + "/license/activate", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | layer.msg('激活成功'); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg) |
| | | } |
| | | }, |
| | | error: function () { |
| | | layer.msg('激活失败'); |
| | | } |
| | | }); |
| | | }); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | |
| | | ,{field: 'name', align: 'center',title: 'URL'} |
| | | ,{field: 'request', align: 'center',title: '请求参数'} |
| | | ,{field: 'response', align: 'center',title: '响应参数'} |
| | | ,{field: 'result$', align: 'center',title: '结果', templet: '#resTpl', width: 80} |
| | | ,{field: 'createTime$', align: 'center',title: '请求时间'} |
| | | |
| | | ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:120} |
| | |
| | | <button class="layui-btn layui-btn-sm" id="btn-add" lay-event="addData">新增</button> |
| | | <button class="layui-btn layui-btn-sm" id="btn-delete" lay-event="deleteData">删除</button> |
| | | <button class="layui-btn layui-btn-primary layui-btn-sm" id="btn-export" lay-event="exportData">导出</button> |
| | | <button class="layui-btn layui-btn-warm layui-btn-sm" id="btn-refresh-cache" lay-event="refreshCache">刷新缓存</button> |
| | | <button class="layui-btn layui-btn-normal layui-btn-sm" id="btn-server-info" lay-event="serverInfo">获取系统配置</button> |
| | | <button class="layui-btn layui-btn-normal layui-btn-sm" id="btn-activate" lay-event="activate">一键激活</button> |
| | | </div> |
| | | </script> |
| | | |
| | |
| | | <a class="layui-btn layui-btn-danger layui-btn-xs btn-edit" lay-event="del">删除</a> |
| | | </script> |
| | | |
| | | <script type="text/html" id="resTpl"> |
| | | <span name="settle" |
| | | {{# if( d.result === 1){ }} |
| | | class="layui-badge layui-badge-green" >成功</span> |
| | | {{# }else { }} |
| | | class="layui-badge layui-badge-red" >失败</span> |
| | | {{# } }} |
| | | </script> |
| | | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | |
| | | <div style="width: 20%;height: 60vh;margin-right: 20px;margin-top: 30px;"> |
| | | <el-tabs type="border-card" v-model="activateCard" @tab-click="handleCardClick"> |
| | | <el-tab-pane label="堆垛机" name="crn"> |
| | | <watch-crn-card :param="crnParam"></watch-crn-card> |
| | | <watch-crn-card ref="watchCrnCard" :param="crnParam"></watch-crn-card> |
| | | </el-tab-pane> |
| | | <el-tab-pane label="输送站" name="devp"> |
| | | <devp-card :param="devpParam"></devp-card> |
| | | <devp-card ref="devpCard" :param="devpParam"></devp-card> |
| | | </el-tab-pane> |
| | | <el-tab-pane label="RGV" name="rgv"> |
| | | <watch-rgv-card :param="rgvParam"></watch-rgv-card> |
| | | <watch-rgv-card ref="watchRgvCard" :param="rgvParam"></watch-rgv-card> |
| | | </el-tab-pane> |
| | | <!-- <el-tab-pane label="地图配置" name="mapSetting"> |
| | | <map-setting-card :param="mapSettingParam"></map-setting-card> |
| | |
| | | <script src="../../components/WatchRgvCard.js"></script> |
| | | <script src="../../components/MapCanvas.js"></script> |
| | | <script> |
| | | let ws; |
| | | var app = new Vue({ |
| | | el: '#app', |
| | | data: { |
| | |
| | | |
| | | }, |
| | | methods: { |
| | | sendWs(data) { |
| | | if (ws && ws.readyState === WebSocket.OPEN) { |
| | | ws.send(data); |
| | | } |
| | | }, |
| | | webSocketOnOpen() { |
| | | console.log("WebSocket连接成功"); |
| | | }, |
| | | webSocketOnError() { |
| | | console.log("WebSocket连接发生错误"); |
| | | }, |
| | | webSocketClose() { |
| | | console.log("WebSocket连接关闭"); |
| | | }, |
| | | webSocketOnMessage(e) { |
| | | const result = JSON.parse(e.data); |
| | | if (result.url == "/crn/table/crn/state") { |
| | | if(this.$refs.watchCrnCard) { |
| | | this.$refs.watchCrnCard.setCrnList(JSON.parse(result.data)); |
| | | } |
| | | } else if (result.url == "/console/latest/data/station") { |
| | | if(this.$refs.devpCard) { |
| | | this.$refs.devpCard.setStationList(JSON.parse(result.data)); |
| | | } |
| | | } else if (result.url == "/rgv/table/rgv/state") { |
| | | if(this.$refs.watchRgvCard) { |
| | | this.$refs.watchRgvCard.setRgvList(JSON.parse(result.data)); |
| | | } |
| | | } else if (result.url == "/basMap/lev/" + this.currentLev + "/auth") { |
| | | // 地图数据 |
| | | let res = JSON.parse(result.data); |
| | | if (res.code === 200) { |
| | | this.map = res.data; |
| | | } |
| | | } |
| | | }, |
| | | getMap() { |
| | | this.sendWs(JSON.stringify({ |
| | | "url": "/basMap/lev/" + this.currentLev + "/auth", |
| | | "data": {} |
| | | })) |
| | | }, |
| | | init() { |
| | | this.getMap() |
| | | 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.getSystemRunningStatus() //获取系统运行状态 |
| | | this.getLevList() //获取地图层级列表 |
| | | this.getLocMastData() //获取库位数据 |
| | | }, |
| | | |
| | | getLevList() { |
| | | let that = this; |
| | | $.ajax({ |
| | |
| | | success: (res) => { |
| | | let data = res.data; |
| | | that.levList = data; |
| | | } |
| | | }) |
| | | }, |
| | | //获取地图数据 |
| | | getMap() { |
| | | let that = this |
| | | let rowPx = 35; |
| | | let colPx = 35; |
| | | |
| | | $.ajax({ |
| | | url: baseUrl + "/basMap/lev/" + this.currentLev + "/auth", |
| | | headers: { |
| | | 'token': localStorage.getItem('token') |
| | | }, |
| | | method: "get", |
| | | success: (res) => { |
| | | let data = res.data; |
| | | let mapData = JSON.parse(data) |
| | | mapData.forEach((row) => { |
| | | let shelfIdx = 1; |
| | | row.forEach((col) => { |
| | | if (col.type == 'shelf') { |
| | | col.shelfIdx = shelfIdx; |
| | | shelfIdx++; |
| | | } |
| | | |
| | | col.rowPx = (col.rowSpan * rowPx) + "px"; |
| | | col.colPx = (col.colSpan * colPx) + "px"; |
| | | |
| | | col.width = (col.cellWidth / 30) + "px"; |
| | | }) |
| | | }) |
| | | that.map = mapData; |
| | | } |
| | | }) |
| | | }, |
| | |
| | | openSite(id) { |
| | | this.devpParam.stationId = id; |
| | | this.activateCard = 'devp'; |
| | | }, |
| | | getSiteInfo() { |
| | | //获取输送站点数据 |
| | | $.ajax({ |
| | | url: baseUrl + "/console/latest/data/station", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | var sites = res.data; |
| | | for (var i = 0; i < sites.length; i++){ |
| | | var siteEl = $("#site-"+sites[i].stationId); |
| | | siteEl.attr("class", "site " + sites[i].stationStatus); |
| | | if (sites[i].taskNo != null && sites[i].taskNo>0) { |
| | | siteEl.html(sites[i].stationId + "[" + sites[i].taskNo + "]"); |
| | | } else { |
| | | siteEl.html(sites[i].stationId); |
| | | } |
| | | } |
| | | } else if (res.code === 403) { |
| | | parent.location.href = baseUrl + "/login"; |
| | | } else { |
| | | console.log(res.msg); |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | getCrnInfo() { |
| | | let that = this |
| | | //获取堆垛机数据 |
| | | $.ajax({ |
| | | url: baseUrl + "/console/latest/data/crn", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | var crns = res.data; |
| | | |
| | | let crnList = [] |
| | | for (var i = 0; i < crns.length; i++) { |
| | | var crnEl = $("#crn-" + crns[i].crnId); |
| | | crnEl.attr("class", "crn-item " + crns[i].crnStatus); |
| | | |
| | | if (crns[i].taskNo != null && crns[i].taskNo > 0) { |
| | | crnEl.html(crns[i].crnId + "[" + crns[i].taskNo + "]"); |
| | | } else { |
| | | crnEl.html(crns[i].crnId); |
| | | } |
| | | |
| | | let bay = parseInt(crns[i].bay, 10); |
| | | if (isNaN(bay) || bay < 1 || bay === -2) { |
| | | bay = 1; |
| | | } |
| | | |
| | | // 根据列值定位到当前行的目标单元格,避免随机偏移导致的误差 |
| | | let targetCell = that.getCrnTargetCell(crnEl, bay); |
| | | if (!targetCell || targetCell.length === 0) { |
| | | continue; |
| | | } |
| | | if (targetCell.offset() == undefined) { |
| | | continue; |
| | | } |
| | | if (crnEl.offsetParent().offset() == undefined) { |
| | | continue; |
| | | } |
| | | |
| | | let parentLeft = crnEl.offsetParent().offset().left; |
| | | let cellLeft = targetCell.offset().left - parentLeft; |
| | | let offsetWithinCell = (targetCell.outerWidth() - crnEl.outerWidth()) / 2; |
| | | let zoomFactor = that.mapSettingParam.zoom ? (that.mapSettingParam.zoom / 100) : 1; |
| | | if (zoomFactor <= 0) { zoomFactor = 1; } |
| | | |
| | | let finalOffset = (cellLeft + offsetWithinCell) / zoomFactor; |
| | | if(finalOffset < 0) { |
| | | finalOffset = 0; |
| | | } |
| | | |
| | | crnEl.animate({left: finalOffset + 'px'}, 500); |
| | | |
| | | crnList.push({ |
| | | crnNo: crns[i].crnId, |
| | | crnStatus: crns[i].crnStatus |
| | | }) |
| | | } |
| | | } else if (res.code === 403) { |
| | | parent.location.href = baseUrl + "/login"; |
| | | } else { |
| | | console.log(res.msg); |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | getRgvInfo() { |
| | | let that = this |
| | | //获取RGV数据 |
| | | $.ajax({ |
| | | url: baseUrl + "/console/latest/data/rgv", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | var rgvs = res.data; |
| | | |
| | | if (that.rgvPosition.length == 0) { |
| | | let position = [] |
| | | for (var i = 0; i < rgvs.length; i++) { |
| | | var rgvEl = $("#rgv-" + rgvs[i].rgvNo); |
| | | if(rgvEl.offset() == undefined) { |
| | | continue; |
| | | } |
| | | position.push({ |
| | | id: rgvs[i].rgvNo, |
| | | trackSiteNo: rgvs[i].trackSiteNo, |
| | | initLeft: rgvEl.offset().left |
| | | }) |
| | | } |
| | | that.rgvPosition = position |
| | | return; |
| | | } |
| | | |
| | | for (var i = 0; i < rgvs.length; i++) { |
| | | var rgvEl = $("#rgv-" + rgvs[i].rgvNo); |
| | | if (rgvs[i].rgvStatus == 'idle') { |
| | | rgvEl.attr("class", "rgv-item"); |
| | | }else if (rgvs[i].rgvStatus == 'working') { |
| | | rgvEl.attr("class", "rgv-item machine-working"); |
| | | }else if (rgvs[i].rgvStatus == 'waiting') { |
| | | rgvEl.attr("class", "rgv-item machine-working"); |
| | | }else { |
| | | rgvEl.attr("class", "rgv-item machine-un-auto"); |
| | | } |
| | | |
| | | let trackSiteNo = rgvs[i].trackSiteNo; |
| | | let trackSiteEl = $("#rgvTrackSiteNo-" + trackSiteNo); |
| | | |
| | | if(rgvEl.offsetParent().offset() == undefined) { |
| | | continue; |
| | | } |
| | | |
| | | let parentLeft = rgvEl.offsetParent().offset().left; |
| | | let targetPosition = trackSiteEl.parent().parent().offset().left - parentLeft; |
| | | let rgvPosition = rgvEl.position().left; |
| | | let zoomFactor = that.mapSettingParam.zoom ? (that.mapSettingParam.zoom / 100) : 1; |
| | | if (zoomFactor <= 0) { zoomFactor = 1; } |
| | | let finalOffset = targetPosition / zoomFactor; |
| | | rgvEl.animate({left: finalOffset + "px"}, 500); |
| | | } |
| | | } else if (res.code === 403) { |
| | | parent.location.href = baseUrl + "/login"; |
| | | } else { |
| | | console.log(res.msg); |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | systemSwitch() { |
| | | // 系统开关 |
| | |
| | | return locInfo.row1 + '-' + locInfo.bay1; |
| | | } |
| | | return ''; |
| | | } |
| | | }, |
| | | } |
| | | }) |
| | | </script> |