#
luxiaotao1123
2024-04-08 033b100768dab566c313a1835d886f08f79fd137
#
1个文件已修改
23 ■■■■■ 已修改文件
zy-asrs-flow/src/pages/map/utils.js 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-flow/src/pages/map/utils.js
@@ -631,26 +631,29 @@
    // shuttleVo
    for (const shuttleVo of mapVo.shuttleVos) {
        // path
        drawTravelPath(shuttleVo.travelPath, shuttleVo.shuttleNo, curFloor);
        drawTravelPath(shuttleVo, curFloor);
        // shuttle
        showShuttle(shuttleVo.shuttleNo, shuttleVo.curLocNo, curFloor, setCurSPrite);
        showShuttle(shuttleVo, curFloor, setCurSPrite);
    }
}
export const drawTravelPath = (path, shuttleNo, curFloor) => {
export const drawTravelPath = (shuttleVo, curFloor) => {
    const { shuttleNo, curLocNo, travelPath: path } = shuttleVo;
    if (!mapContainer) {
        return;
    }
    const pathLineName = 'preTravelPath-' + shuttleNo;
    let pathLine = mapContainer.getChildByName(pathLineName);
    if (pathLine) mapContainer.removeChild(pathLine);
    if (pathLine) {
        mapContainer.removeChild(pathLine);
    }
    pathLine = new PIXI.Graphics();
    pathLine.name = pathLineName;
    pathLine.lineStyle(3 * (1 / mapContainer.scale.x), 0x3498db, 1);
    pathLine.zIndex = SENSOR_ZINDEX.TRAVEL_PATH;
    let firstNode = true;
    for (let i = 0; i < path.length; i++) {
    for (let i = path.indexOf(curLocNo) - 1; i < path.length; i++) {
        const { row, bay, lev } = parseLocNo(path[i]);
        if (Number(lev) !== curFloor) { continue }
        const shelf = querySprite(SENSOR_TYPE.SHELF, row + '-' + bay);
@@ -669,22 +672,24 @@
    mapContainer.addChild(pathLine);
}
export const showShuttle = (shuttleNo, curLocNo, curFloor, setCurSPrite) => {
export const showShuttle = (shuttleVo, curFloor, setCurSPrite) => {
    const { shuttleNo, curLocNo } = shuttleVo;
    if (!curLocNo) { return }
    const { row, bay, lev } = parseLocNo(curLocNo);
    if (Number(lev) !== curFloor) { return }
    const shelf = querySprite(SENSOR_TYPE.SHELF, row + '-' + bay);
    if (!shelf) { return }
    let shuttle = querySprite(SENSOR_TYPE.SHUTTLE, shuttleNo);
    if (!shuttle) {
        shuttle = generateSprite(SENSOR_TYPE.SHUTTLE);
        initSprite(shuttle, SENSOR_TYPE.SHUTTLE);
        shuttle.data.no = shuttleNo;
        shuttle.position.set(shelf.position.x, shelf.position.y);
        mapContainer.addChild(shuttle);
        viewFeature(shuttle, setCurSPrite);
    }
    const shelf = querySprite(SENSOR_TYPE.SHELF, row + '-' + bay);
    if (!shelf) { return }
    new TWEEDLE.Tween(shuttle?.position).easing(TWEEDLE.Easing.Linear.None).to({
        x: shelf.position.x,