修改一点库位图的显示功能

This commit is contained in:
葛林强 2026-02-26 16:17:53 +08:00
parent f7c1f7a82d
commit 25c9b7e028
3 changed files with 17 additions and 6 deletions

View File

@ -94,6 +94,15 @@ const filterData = (row: number, line: number, layer: number, depth: number) : I
status: -2 status: -2
}; };
} }
//
const tooltipString = (row: number, line: number, layer: number, depth: number) => {
const data = filterData(row, line, layer, depth);
const locationId = data.locationId;
if(data.vehicleNo != null && data.vehicleNo.length > 0) {
return locationId + ' [ ' + data.vehicleNo + ' ]';
}
return locationId;
};
const test = () => { const test = () => {
console.log(layerMax, depthMax); console.log(layerMax, depthMax);
@ -130,19 +139,19 @@ const test = () => {
<span style="margin-left: 2px;font-size: .7rem">禁用</span> <span style="margin-left: 2px;font-size: .7rem">禁用</span>
</el-col> </el-col>
</el-row> </el-row>
<el-scrollbar height="50vh" style="width: 100%"> <el-scrollbar height="70vh" style="width: 100%">
<el-row> <el-row>
<el-row v-for="(layer, layerIndex) in layerMax" :key="layerIndex"> <el-row v-for="(layer, layerIndex) in layerMax" :key="layerIndex">
<el-divider v-if="layer != 1"></el-divider> <el-divider v-if="layer != 1"></el-divider>
<el-scrollbar> <el-scrollbar>
<el-col :span="24" :style="{width: 16*lineMax + 'px', minWidth: '51vw'}"> <el-col :span="24" :style="{width: 16 * lineMax + 'px', height: 18 * (depthMax * 2 + 1) + 30 + 'px'}">
<!-- 2--> <!-- 2-->
<el-row v-for="(line, lineIndex) in lineMax" :key="lineIndex" style="display: inline"> <el-row v-for="(line, lineIndex) in lineMax" :key="lineIndex" style="display: inline">
<span style="width: 15px;height: 15px;background-color: white;border: 1px solid #ccc;margin-right: 1px;text-align: center;font-size: .6rem; display: inline-block">{{line}}</span> <span style="width: 15px;height: 15px;background-color: white;border: 1px solid #ccc;margin-right: 1px;text-align: center;font-size: .6rem; display: inline-block">{{line}}</span>
</el-row> </el-row>
<el-row v-for="(depth, depthIndex) in depthMax" :key="depthIndex"> <el-row v-for="(depth, depthIndex) in depthMax" :key="depthIndex">
<el-row v-for="(line, lineIndex) in lineMax" :key="lineIndex" style="display: inline;height: 16px;width: 16px"> <el-row v-for="(line, lineIndex) in lineMax" :key="lineIndex" style="display: inline;height: 16px;width: 16px">
<el-tooltip effect="dark" :content="filterData(1, line, layerMax - layer + 1, depthMax - depth + 1).locationId" placement="top-start" style="margin: 0"> <el-tooltip effect="dark" :content="tooltipString(1, line, layerMax - layer + 1, depthMax - depth + 1)" placement="top-start" style="margin: 0">
<span :style="blockStyle(filterData(1, line, layerMax - layer + 1, depthMax - depth + 1).status ?? -2)"> <span :style="blockStyle(filterData(1, line, layerMax - layer + 1, depthMax - depth + 1).status ?? -2)">
</span> </span>
</el-tooltip> </el-tooltip>
@ -154,7 +163,7 @@ const test = () => {
<!-- 1--> <!-- 1-->
<el-row v-for="(depth, depthIndex) in depthMax" :key="depthIndex"> <el-row v-for="(depth, depthIndex) in depthMax" :key="depthIndex">
<el-row v-for="(line, lineIndex) in lineMax" :key="lineIndex" style="display: inline;height: 16px;width: 16px"> <el-row v-for="(line, lineIndex) in lineMax" :key="lineIndex" style="display: inline;height: 16px;width: 16px">
<el-tooltip effect="dark" :content="filterData(2, line, layerMax - layer + 1, depth).locationId" placement="top-start"> <el-tooltip effect="dark" :content="tooltipString(2, line, layerMax - layer + 1, depth)" placement="top-start">
<span :style="blockStyle(filterData(2, line, layerMax - layer + 1, depth).status ?? -2)"></span> <span :style="blockStyle(filterData(2, line, layerMax - layer + 1, depth).status ?? -2)"></span>
</el-tooltip> </el-tooltip>
</el-row> </el-row>

View File

@ -36,7 +36,8 @@ const query = () => {
line: item.lLine, line: item.lLine,
layer: item.lLayer, layer: item.lLayer,
depth: item.lDepth, depth: item.lDepth,
status: item.locationStatus status: item.locationStatus,
vehicleNo: item.vehicleNo
}); });
}); });
laneData.value = newData; laneData.value = newData;
@ -89,7 +90,7 @@ const getLaneIdList = () => {
</script> </script>
<template> <template>
<el-drawer v-model="modelValue" title="仓库货位图" direction="btt" size="80vh" @close="close" :close-on-click-modal="false" @opened="open"> <el-drawer v-model="modelValue" title="仓库货位图" direction="ltr" size="90vw" @close="close" :close-on-click-modal="false" @opened="open">
<el-row> <el-row>
<el-form class="searchForm" label-position="left" label-width="100px" inline> <el-form class="searchForm" label-position="left" label-width="100px" inline>
<el-form-item label="堆垛机号:" style="width: 250px;"> <el-form-item label="堆垛机号:" style="width: 250px;">

View File

@ -6,4 +6,5 @@ export default interface IStackerLocationInfo {
layer?: number, layer?: number,
depth?: number, depth?: number,
status?: number, status?: number,
vehicleNo?: string,
} }