#
Junjie
6 天以前 7d6921a3cd3c6bcf04bf5503fa78275d09aa26f9
src/main/webapp/views/watch/console.html
@@ -53,7 +53,9 @@
                           <div class="item" style="visibility: hidden">{{idx}}</div>
                        </div>
                        <div v-else-if="col.type == 'shelf'">
                           <div class="shelf">{{col.shelfIdx}}</div>
                           <div class="shelf">
                              <div class="shelf-loc-info" v-if="getShelfLocInfo(index, idx)">{{getShelfLocInfo(index, idx)}}</div>
                           </div>
                        </div>
                        <div v-else-if="col.type == 'devp'">
                           <div class="site" :style="{height: col.rowPx}" :id="'site-' + getStationId(col.value)" @click="openSite(getStationId(col.value))">{{getStationId(col.value)}}</div>
@@ -103,7 +105,8 @@
               },
               rgvParam: {
                  rgvNo: 0
               }
               },
               locMastData: []//库位数据
            },
            created() {
               this.init()
@@ -116,6 +119,7 @@
                  this.getMap()
                  this.getSystemRunningStatus() //获取系统运行状态
                  this.getLevList() //获取地图层级列表
                  this.getLocMastData() //获取库位数据
                  this.consoleInterval = setInterval(() => {
                     this.getCrnInfo() //获取堆垛机数据
@@ -173,6 +177,7 @@
               switchLev(lev) {
                  this.currentLev = lev;
                  this.getMap()
                  this.getLocMastData() //切换层级时重新获取库位数据
               },
               openCrn(id) {
                  this.crnParam.crnNo = id;
@@ -502,6 +507,45 @@
               },
               handleCardClick(tab, event) {
               },
               //获取库位数据
               getLocMastData() {
                  let that = this;
                  $.ajax({
                     url: baseUrl + "/console/map/locList",
                     headers: {
                        'token': localStorage.getItem('token')
                     },
                     method: "get",
                     data: {},
                     success: (res) => {
                        if (res.code === 200) {
                           that.locMastData = res.data;
                        }
                     }
                  })
               },
               //根据地图坐标获取库位的排列信息
               getShelfLocInfo(rowIdx, colIdx) {
                  if (!this.locMastData || this.locMastData.length === 0) {
                     return '';
                  }
                  // 在locMastData中查找匹配的库位
                  // locType字段存储的是地图坐标信息
                  let locInfo = this.locMastData.find(loc => {
                     if (!loc.locType) return false;
                     // locType格式类似 "0-1-1" (mapX-mapY-lev)
                     let parts = loc.locType.split('-');
                     if (parts.length >= 2) {
                        return parseInt(parts[0]) === rowIdx && parseInt(parts[1]) === colIdx;
                     }
                     return false;
                  });
                  if (locInfo && locInfo.row1 && locInfo.bay1) {
                     return locInfo.row1 + '-' + locInfo.bay1;
                  }
                  return '';
               }
            }
         })