feat(仓库管理): 实现交错式多层仓库可视化组件

- 新增 WarehouseInterlaced 组件用于展示交错式多层仓库布局
- 修改仓库编码解析规则以支持新的格式
- 移除不再使用的 layerCount 字段
- 更新仓库鸟瞰图组件以使用新的交错式布局
- 调整图例样式和颜色区分不同层级
This commit is contained in:
砂糖
2025-12-08 11:48:20 +08:00
parent 86f56d386c
commit b5e053671f
4 changed files with 394 additions and 17 deletions

View File

@@ -25,8 +25,12 @@
<!-- 图例 -->
<div class="legend-container">
<div class="legend-item">
<div class="legend-color normal"></div>
<span class="legend-text">正常未占用</span>
<div class="legend-color layer-1"></div>
<span class="legend-text">一层</span>
</div>
<div class="legend-item">
<div class="legend-color layer-2"></div>
<span class="legend-text">二层</span>
</div>
<div class="legend-item">
<div class="legend-color occupied"></div>
@@ -36,29 +40,26 @@
<!-- 分层库位容器 -->
<div class="layers-container">
<!-- 遍历每层渲染 Grid 组件 -->
<div v-for="(layerData, layer) in layers" :key="layer" class="layer-section">
<WarehouseGrid :layer="layer" :layer-data="layerData" />
</div>
<!-- 无数据提示 -->
<div class="empty-tip" v-if="Object.keys(layers).length === 0 && warehouseList.length > 0">
暂无解析到有效的库位分层数据
</div>
<div class="empty-tip" v-if="warehouseList.length === 0">
<div class="empty-tip" v-else-if="warehouseList.length === 0">
<div class="empty-text">该分类下暂无库位数据</div>
<el-button type="primary" icon="el-icon-plus" @click="openInitDialog">初始化库位</el-button>
</div>
<warehouse-interlaced v-else="warehouseList.length" :layers="layers" />
</div>
</div>
</template>
<script>
import WarehouseGrid from './WarehouseGrid.vue';
import WarehouseInterlaced from './WarehouseInterlaced.vue';
export default {
name: "WarehouseBird",
components: { WarehouseGrid },
components: { WarehouseGrid, WarehouseInterlaced },
props: {
// 原始库位列表
warehouseList: {
@@ -93,7 +94,7 @@ export default {
*/
parseWarehouseCode(code) {
if (!code) return null;
const reg = /^([A-Za-z])(\d+[A-Za-z])(\d)(\d{2})-(\d+)$/;
const reg = /^([A-Za-z])(\d+[A-Za-z])(\d)-(\d{2})-(\d+)$/;
const match = code.match(reg);
if (!match) {
@@ -239,8 +240,16 @@ export default {
background-color: #ffffff;
}
.layer-1 {
background-color: #fff3e0;
}
.layer-2 {
background-color: #e8f5e9;
}
.occupied {
background-color: #eeff6f;
background-color: #111;
}
.legend-text {