#
Junjie
2023-09-19 ff1be9fa2dba6eaffc449d09e62998348ea3b830
src/main/webapp/views/console.html
@@ -22,16 +22,16 @@
                  <div v-for="(col,idx) in row" :key="idx">
                     <div v-if="col.value == 0">
                        <!-- 子轨道 路径为穿梭车预计路径则显示穿梭车颜色和穿梭车号 -->
                        <div :style="{background: checkAdvancePath(index,idx) == null ? '':shuttleColorList[checkAdvancePath(index,idx)]}" class="item" v-if="col.data.length > 0">{{col.data}}</div>
                        <div :style="{background: checkAdvancePath(index,idx) == null ? '':shuttleColorList[checkAdvancePath(index,idx)]}" class="item" v-else>{{checkAdvancePath(index,idx) == null ? idx:checkAdvancePath(index,idx)}}</div>
                        <div :style="{background: checkAdvancePath(index,idx).length == 0 ? '':shuttleColorList[checkAdvancePath(index,idx)[0]]}" class="item" v-if="col.data.length > 0">{{col.data}}</div>
                        <div :style="{background: checkAdvancePath(index,idx).length == 0 ? '':shuttleColorList[checkAdvancePath(index,idx)[0]]}" class="item" v-else>{{checkAdvancePath(index,idx).length == 0 ? idx:checkAdvancePath(index,idx)}}</div>
                     </div>
                     <div v-else-if="col.value == 3">
                        <!-- 母轨道 路径为穿梭车预计路径则显示穿梭车颜色和穿梭车号 -->
                        <div :style="{background: checkAdvancePath(index,idx) == null ? '#5af':shuttleColorList[checkAdvancePath(index,idx)]}" class="item">{{checkAdvancePath(index,idx) == null ? '&#x21c5;&#x21c4;':checkAdvancePath(index,idx)}}</div>
                        <div :style="{background: checkAdvancePath(index,idx).length == 0 ? '#5af':shuttleColorList[checkAdvancePath(index,idx)[0]]}" class="item">{{checkAdvancePath(index,idx).length == 0 ? '&#x21c5;&#x21c4;':checkAdvancePath(index,idx)}}</div>
                     </div>
                     <div v-else-if="col.value == 4">
                        <!-- 站点 -->
                        <div class="site" @click="openSite(col.data)">{{col.data}}</div>
                        <div class="site" :id="'site-' + col.data" @click="openSite(col.data)">{{col.data}}</div>
                     </div>
                     <div v-else-if="col.value == 5">
                        <!-- 充电桩 -->
@@ -73,7 +73,7 @@
            <!--输出楼层-->
            <div style="height: 100%;">
               <div class="floorBtnBox" v-for="(lev,idx) in floorList">
                  <el-button @click="changFloor(lev)">{{lev}}F</el-button>
                  <el-button :style="{background:currentLev === lev ? '#7DCDFF':''}" @click="changFloor(lev)">{{lev}}F</el-button>
               </div>
               <div>
                  <el-button @click="testMove()">测试移动车</el-button>
@@ -354,6 +354,7 @@
                  this.consoleInterval = setInterval(() => {
                     this.getShuttleStateInfo() //获取四向穿梭车信息
                     this.getLiftStateInfo() //获取提升机信息
                     this.getSiteInfo() //获取输送站点数据
                  }, 1000)
               },
               //获取地图数据
@@ -400,6 +401,32 @@
                  })
               },
               getSiteInfo() {
                  //获取输送站点数据
                  $.ajax({
                     url: baseUrl+ "/console/latest/data/site",
                     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].siteId);
                              siteEl.attr("class", "site " + sites[i].siteStatus);
                              if (sites[i].workNo != null && sites[i].workNo>0) {
                                 siteEl.html(sites[i].siteId + "[" + sites[i].workNo + "]");
                              } else {
                                 siteEl.html(sites[i].siteId);
                              }
                           }
                        } else if (res.code === 403){
                           parent.location.href = baseUrl+"/login";
                        }  else {
                           console.log(res.msg);
                        }
                     }
                  });
               },
               changFloor(lev) {
                  this.currentLev = lev
                  this.currentLevShuttleList = []
@@ -418,8 +445,10 @@
                        if (res.code == 200) {
                           let currentLevShuttle = []//当前楼层小车集合
                           res.data.forEach((item,idx) => {
                              if (item.point.z == that.currentLev) {
                                 currentLevShuttle.push(item)
                              if (item != null && item.point != undefined && item.point != null) {
                                 if (item.point.z == that.currentLev) {
                                    currentLevShuttle.push(item);
                                 }
                              }
                           })
                           that.currentLevShuttleList = currentLevShuttle
@@ -593,6 +622,7 @@
                        })
                     }
                  })
                  let data = []
                  let shuttleList = this.currentLevShuttleList;
                  for (var i = 0; i < shuttleList.length; i++) {
                     let shuttle = shuttleList[i]
@@ -601,12 +631,13 @@
                        for (var j = 0; j < moveAdvancePath.length; j++) {
                           let path = moveAdvancePath[j]
                           if (path.x-1 === x && path.y === y) {//路径符合
                              return shuttle.shuttleNo;//返回小车号
                              data.push(shuttle.shuttleNo)
                              continue;
                           }
                        }
                     }
                  }
                  return null;
                  return data;//返回小车号集合
               }
            }
         })