#
DELL
9 天以前 5d0461e985b9244cfbea910bc6df9e3f62caaed2
#
3个文件已修改
64 ■■■■■ 已修改文件
src/main/java/com/zy/asrs/controller/LocMastController.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/css/watch/console_vue.css 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/watch/console.html 52 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/controller/LocMastController.java
@@ -17,12 +17,9 @@
import com.zy.asrs.service.BasMapService;
import com.zy.asrs.service.LocMastService;
import com.zy.asrs.utils.Utils;
import com.zy.common.model.NavigateNode;
import com.zy.common.utils.RedisUtil;
import com.zy.common.web.BaseController;
import com.zy.core.enums.LocStsType;
import com.zy.core.enums.MapNodeType;
import com.zy.core.enums.RedisKeyType;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
@@ -165,7 +162,7 @@
                String nodeType = map.getString("type");
                if("shelf".equals(nodeType)) {
                    if(initBay == -1) {
                        initBay = 1;
                        initBay = 2;
                    }
                    HashMap<String, Object> locNoMap = new HashMap<>();
src/main/webapp/static/css/watch/console_vue.css
@@ -28,12 +28,19 @@
    cursor: default;
    color: rgb(194, 76, 65);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    user-select: none;
    background: #fff;
}
.shelf-loc-info {
    font-size: 12px;
    color: #666;
    margin-top: 2px;
}
.track-item {
    width: 100%;
    height: 35px;
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,49 @@
                    },
                    handleCardClick(tab, event) {
                    },
                    //获取库位数据
                    getLocMastData() {
                        let that = this;
                        $.ajax({
                            url: baseUrl + "/locMast/list/auth",
                            headers: {
                                'token': localStorage.getItem('token')
                            },
                            method: "get",
                            data: {
                                curr: 1,
                                limit: 10000,
                                lev1: this.currentLev
                            },
                            success: (res) => {
                                if (res.code === 200) {
                                    that.locMastData = res.data.records;
                                }
                            }
                        })
                    },
                    //根据地图坐标获取库位的排列信息
                    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 '';
                    }
                }
            })