Junjie
2023-12-18 7cb91edeb02a377e3bdf1ef98e60fa2e6d9d5c96
src/main/webapp/views/console4.html
@@ -14,7 +14,7 @@
  <script type="text/javascript" src="../static/vue/js/vue.min.js"></script>
  <script type="text/javascript" src="../static/vue/element/element.js"></script>
  <script src="../static/js/gsap.min.js"></script>
  <script src="../static/js/pixi.min.js"></script>
  <script src="../static/js/pixi-legacy.min.js"></script>
  <style>
    *{
      margin: 0;
@@ -249,8 +249,8 @@
                const shuttle = new PIXI.Sprite(resources.shuttle.texture);
                shuttle.width = width
                shuttle.height = height
                shuttle.x = item.point.x * width;//更新坐标x
                shuttle.y = item.point.y * height;//更新坐标y
                shuttle.x = item.wcsPoint.x * height;//更新坐标x
                shuttle.y = item.wcsPoint.y * width;//更新坐标y
                shuttle.updateMoveStatus = true;//动画执行完成
                shuttle.interactive = true; // 必须要设置才能接收事件
                shuttle.buttonMode = true; // 让光标在hover时变为手型指针
@@ -544,15 +544,17 @@
          return false;//两个集合长度不一致
        }
        let flag = false;
        list1.forEach((item,index) => {
          for (var i = 0; i < list2.length; i++) {
            if (item.shuttleNo != list2[i].shuttleNo) {
              return false;//找不到小车号
            if (item.shuttleNo == list2[i].shuttleNo) {
              flag = true;
              break;
            }
          }
        });
        return true;
        return flag;
      },
      findShuttlePathDiffList(list1, list2) {
        //检测集合1里面的小车预计路径是否在集合2中有变动
@@ -567,7 +569,7 @@
          let item = list1[index];
          for (var i = 0; i < list2.length; i++) {
            if (item.shuttleNo != list2[i].shuttleNo) {
              return false;//找不到小车号
              continue;//找不到小车号
            }
            if (item.moveAdvancePath == null) {
@@ -578,7 +580,7 @@
              list2[i].moveAdvancePath = [];
            }
            if (item.moveAdvancePath.length != list2[i].moveAdvancePath.length) {
            if (!(item.moveAdvancePath.length == list2[i].moveAdvancePath.length)) {
              return false;//小车预计路径长度不一致
            }
          }
@@ -845,38 +847,55 @@
            })
            if (pixiShuttleMoveAdvancePathList[shuttleNo] == null) {
              pixiShuttleMoveAdvancePathList[shuttleNo] = [locNo];
            } else {
              pixiShuttleMoveAdvancePathList[shuttleNo].push(locNo);
              let locNos = new Set()
              locNos.add(locNo);
              pixiShuttleMoveAdvancePathList[shuttleNo] = locNos;
            }else {
              pixiShuttleMoveAdvancePathList[shuttleNo].add(locNo);
            }
          }else {
            let pathMap = pixiShuttleMoveAdvancePathMap.get(locNo)
            let shuttleNos = pathMap.shuttleNos;
            shuttleNos.push(shuttleNo);
            pathMap.textObj.text = JSON.stringify(shuttleNos);
            pixiShuttleMoveAdvancePathMap.set(locNo, pathMap);
            if (pixiShuttleMoveAdvancePathList[shuttleNo] == null) {
              let locNos = new Set()
              locNos.add(locNo);
              pixiShuttleMoveAdvancePathList[shuttleNo] = locNos;
            }else {
              pixiShuttleMoveAdvancePathList[shuttleNo].add(locNo);
            }
          }
        });
      },
      removeMoveAdvancePath(shuttleNo) {//删除预计路径
        let locNos = pixiShuttleMoveAdvancePathList[shuttleNo];
        locNos.forEach((locNo,index) => {
          let pathMap = pixiShuttleMoveAdvancePathMap.get(locNo);
          if (pathMap != null) {
            let shuttleNos = pathMap.shuttleNos;
            let shuttleNosNew = [];
            shuttleNos.forEach((shuttle, idx) => {
              if (shuttle != shuttleNo) {
                shuttleNosNew.push(shuttle);
              }
            });
        if (locNos != null) {
          locNos.forEach((locNo,index) => {
            let pathMap = pixiShuttleMoveAdvancePathMap.get(locNo);
            if (pathMap != null) {
              let shuttleNos = pathMap.shuttleNos;
              let shuttleNosNew = [];
              shuttleNos.forEach((shuttle, idx) => {
                if (shuttle != shuttleNo) {
                  shuttleNosNew.push(shuttle);
                }
              });
            if (shuttleNosNew.length === 0) {
              //预计路径没有小车,直接删除路径
              objectsContainer2.removeChild(pathMap.sprite);
              pixiShuttleMoveAdvancePathMap.delete(locNo)
            }else {
              //预计路径存在其他小车,更新文字信息
              pathMap.textObj.text = JSON.stringify(shuttleNosNew);
              pathMap.shuttleNos = shuttleNosNew;
              pixiShuttleMoveAdvancePathMap.set(locNo, pathMap);
              if (shuttleNosNew.length === 0) {
                //预计路径没有小车,直接删除路径
                objectsContainer2.removeChild(pathMap.sprite);
                pixiShuttleMoveAdvancePathMap.delete(locNo)
              }else {
                //预计路径存在其他小车,更新文字信息
                pathMap.textObj.text = JSON.stringify(shuttleNosNew);
                pathMap.shuttleNos = shuttleNosNew;
                pixiShuttleMoveAdvancePathMap.set(locNo, pathMap);
              }
            }
          }
        })
          })
        }
      },
    }
  })