2025-12-08 11:48:20 +08:00
|
|
|
|
<template>
|
2025-12-19 18:06:55 +08:00
|
|
|
|
<div class="multi-layer-grid" @click="closeContextMenu" @keydown.esc="closeContextMenu">
|
2025-12-08 11:48:20 +08:00
|
|
|
|
<!-- 顶部列标尺 -->
|
|
|
|
|
|
<div class="col-ruler" :style="{ '--cell-width': `${cellWidth}px` }">
|
|
|
|
|
|
<div class="ruler-empty"></div>
|
2025-12-19 18:06:55 +08:00
|
|
|
|
<div v-for="col in sortedColumnKeys" :key="`col-${col}`" class="ruler-item">
|
2025-12-08 11:48:20 +08:00
|
|
|
|
{{ col }}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 左侧行标尺 + 库位网格 -->
|
|
|
|
|
|
<div class="row-grid-wrapper">
|
2025-12-19 18:06:55 +08:00
|
|
|
|
<!-- 左侧行标尺(高度固定) -->
|
|
|
|
|
|
<div class="row-ruler" :style="{ '--total-height': `${rulerTotalHeight}px` }">
|
|
|
|
|
|
<div v-for="row in rulerMaxRow" :key="`row-${row}`" class="ruler-item">
|
2025-12-08 11:48:20 +08:00
|
|
|
|
{{ row }}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
2025-12-19 18:06:55 +08:00
|
|
|
|
<!-- 网格容器(列→左右容器→格子) -->
|
|
|
|
|
|
<div class="grid-container" :style="{
|
|
|
|
|
|
'--half-cell-width': `${halfCellWidth}px`,
|
|
|
|
|
|
'--cell-width': `${cellWidth}px`,
|
|
|
|
|
|
'--column-count': sortedColumnKeys.length * 2,
|
|
|
|
|
|
'--total-height': `${rulerTotalHeight}px`
|
|
|
|
|
|
}">
|
|
|
|
|
|
<!-- 逐列渲染:每列对应左右两个容器 -->
|
|
|
|
|
|
<template v-for="column in sortedColumnKeys">
|
|
|
|
|
|
<!-- 左容器:承载当前列的layer1库位 -->
|
|
|
|
|
|
<div
|
|
|
|
|
|
class="column-container layer-1-container"
|
|
|
|
|
|
:style="{
|
|
|
|
|
|
gridRow: '1 / -1',
|
|
|
|
|
|
gridColumn: `${(column - 1) * 2 + 1} / ${(column - 1) * 2 + 2}`,
|
|
|
|
|
|
'--item-height': `${getWarehouseCellHeight(column)}px`
|
|
|
|
|
|
}"
|
|
|
|
|
|
>
|
|
|
|
|
|
<!-- 左容器内渲染layer1的单个格子(无偏移) -->
|
|
|
|
|
|
<div
|
|
|
|
|
|
v-for="warehouse in getColumnLayerWarehouses(column, 1)"
|
|
|
|
|
|
:key="`warehouse-1-${warehouse.actualWarehouseId}`"
|
|
|
|
|
|
class="warehouse-cell layer-1"
|
|
|
|
|
|
:class="{ disabled: warehouse.isEnabled === 0 }"
|
|
|
|
|
|
@click="handleCellClick(warehouse)"
|
|
|
|
|
|
@contextmenu.prevent="(e) => openContextMenu(e, warehouse)"
|
|
|
|
|
|
>
|
|
|
|
|
|
<div class="cell-name">
|
|
|
|
|
|
<div class="cell-line1">{{ warehouse.actualWarehouseName || '-' }}</div>
|
|
|
|
|
|
<div class="cell-line2">{{ warehouse.currentCoilNo || '-' }}</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2025-12-08 11:48:20 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
|
2025-12-19 18:06:55 +08:00
|
|
|
|
<!-- 右容器:承载当前列的layer2库位(核心修改:新增高度计算) -->
|
|
|
|
|
|
<div
|
|
|
|
|
|
class="column-container layer-2-container"
|
|
|
|
|
|
:style="{
|
|
|
|
|
|
gridRow: '1 / -1',
|
|
|
|
|
|
gridColumn: `${(column - 1) * 2 + 2} / ${(column - 1) * 2 + 3}`,
|
|
|
|
|
|
'--item-height': `${getWarehouseCellHeight(column)}px`,
|
|
|
|
|
|
'--offset-value': `${getWarehouseCellHeight(column) * 0.5}px`,
|
|
|
|
|
|
// 新增:第二层容器高度 = 格子总高度 + 偏移量(半个格子)
|
|
|
|
|
|
height: `${(getColumnLayerWarehouses(column, 2).length * getWarehouseCellHeight(column))}px`
|
|
|
|
|
|
}"
|
|
|
|
|
|
>
|
|
|
|
|
|
<!-- 右容器内渲染layer2的单个格子(向下偏移半个高度) -->
|
|
|
|
|
|
<div
|
|
|
|
|
|
v-for="warehouse in getColumnLayerWarehouses(column, 2)"
|
|
|
|
|
|
:key="`warehouse-2-${warehouse.actualWarehouseId}`"
|
|
|
|
|
|
class="warehouse-cell layer-2"
|
|
|
|
|
|
:class="{ disabled: warehouse.isEnabled === 0 }"
|
|
|
|
|
|
:style="{
|
|
|
|
|
|
transform: `translateY(var(--offset-value))`
|
|
|
|
|
|
}"
|
|
|
|
|
|
@click="handleCellClick(warehouse)"
|
|
|
|
|
|
@contextmenu.prevent="(e) => openContextMenu(e, warehouse)"
|
|
|
|
|
|
>
|
|
|
|
|
|
<div class="cell-name">
|
|
|
|
|
|
<div class="cell-line1">{{ warehouse.actualWarehouseName || '-' }}</div>
|
|
|
|
|
|
<div class="cell-line2">{{ warehouse.currentCoilNo || '-' }}</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2025-12-08 11:48:20 +08:00
|
|
|
|
</div>
|
2025-12-19 18:06:55 +08:00
|
|
|
|
</template>
|
2025-12-08 11:48:20 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
2025-12-19 18:06:55 +08:00
|
|
|
|
<!-- 自定义右键菜单 -->
|
|
|
|
|
|
<div
|
|
|
|
|
|
v-if="contextMenuVisible"
|
|
|
|
|
|
class="custom-contextmenu"
|
|
|
|
|
|
:style="{
|
|
|
|
|
|
top: `${contextMenuTop}px`,
|
|
|
|
|
|
left: `${contextMenuLeft}px`,
|
|
|
|
|
|
zIndex: 9999
|
|
|
|
|
|
}"
|
|
|
|
|
|
@click.stop
|
2025-12-08 11:48:20 +08:00
|
|
|
|
>
|
2025-12-19 18:06:55 +08:00
|
|
|
|
<ul>
|
|
|
|
|
|
<li @click="handleContextMenuClick('view')">查看详情</li>
|
|
|
|
|
|
<li class="menu-divider"></li>
|
|
|
|
|
|
<li
|
|
|
|
|
|
@click="handleContextMenuClick('delete')"
|
|
|
|
|
|
:class="{ disabled: currentContextWarehouse.isEnabled === 0 }"
|
|
|
|
|
|
>
|
|
|
|
|
|
删除库位
|
|
|
|
|
|
</li>
|
|
|
|
|
|
<li class="menu-divider"></li>
|
|
|
|
|
|
<li @click="handleContextMenuClick('split')" v-if="currentContextWarehouse.splitStatus == 0">拆分整列</li>
|
|
|
|
|
|
<li @click="handleContextMenuClick('merge')" v-if="currentContextWarehouse.splitStatus == 1">合并整列</li>
|
|
|
|
|
|
</ul>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 库位详情弹窗 -->
|
|
|
|
|
|
<el-dialog title="钢卷库位详情" :visible.sync="dialogVisible" width="600px" destroy-on-close append-to-body center>
|
2025-12-08 11:48:20 +08:00
|
|
|
|
<el-descriptions :column="2" border size="small" v-if="currentWarehouse">
|
|
|
|
|
|
<el-descriptions-item label="库位编码">{{ currentWarehouse.actualWarehouseCode }}</el-descriptions-item>
|
|
|
|
|
|
<el-descriptions-item label="库位名称">{{ currentWarehouse.actualWarehouseName || '无' }}</el-descriptions-item>
|
|
|
|
|
|
<el-descriptions-item label="钢卷编号">{{ currentWarehouse.currentCoilNo || '无' }}</el-descriptions-item>
|
|
|
|
|
|
<el-descriptions-item label="所属层级">{{ currentWarehouse.parsedInfo.layer || '未知' }}</el-descriptions-item>
|
|
|
|
|
|
<el-descriptions-item label="行号">{{ currentWarehouse.parsedInfo.row || '未知' }}</el-descriptions-item>
|
|
|
|
|
|
<el-descriptions-item label="列号">{{ currentWarehouse.parsedInfo.column || '未知' }}</el-descriptions-item>
|
2025-12-19 18:06:55 +08:00
|
|
|
|
<el-descriptions-item label="一级编码">{{ currentWarehouse.parsedInfo.warehouseFirst || '未知' }}</el-descriptions-item>
|
|
|
|
|
|
<el-descriptions-item label="二级编码">{{ currentWarehouse.parsedInfo.warehouseSecond || '未知' }}</el-descriptions-item>
|
2025-12-08 11:48:20 +08:00
|
|
|
|
<el-descriptions-item label="启用状态">
|
|
|
|
|
|
<el-tag :type="currentWarehouse.isEnabled === 1 ? 'success' : 'danger'">
|
2025-12-19 18:06:55 +08:00
|
|
|
|
{{ currentWarehouse.isEnabled === 1 ? '未占用' : currentWarehouse.currentCoilNo }}
|
2025-12-08 11:48:20 +08:00
|
|
|
|
</el-tag>
|
|
|
|
|
|
</el-descriptions-item>
|
2025-12-19 18:06:55 +08:00
|
|
|
|
<el-descriptions-item label="库位码">
|
|
|
|
|
|
<QRCode :content="currentWarehouse.actualWarehouseId" :size="60" />
|
|
|
|
|
|
</el-descriptions-item>
|
|
|
|
|
|
<el-descriptions-item label="备注信息" span="2">{{ currentWarehouse.remark || '无' }}</el-descriptions-item>
|
2025-12-08 11:48:20 +08:00
|
|
|
|
</el-descriptions>
|
|
|
|
|
|
<template slot="footer">
|
|
|
|
|
|
<el-button @click="dialogVisible = false">关闭</el-button>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
2025-12-19 18:06:55 +08:00
|
|
|
|
import QRCode from '@/components/QRCode/index.vue';
|
|
|
|
|
|
import { Message } from 'element-ui';
|
|
|
|
|
|
|
2025-12-08 11:48:20 +08:00
|
|
|
|
export default {
|
|
|
|
|
|
name: "SteelCoilWarehouse",
|
2025-12-19 18:06:55 +08:00
|
|
|
|
components: {
|
|
|
|
|
|
QRCode
|
|
|
|
|
|
},
|
2025-12-08 11:48:20 +08:00
|
|
|
|
props: {
|
2025-12-19 18:06:55 +08:00
|
|
|
|
columns: {
|
2025-12-08 11:48:20 +08:00
|
|
|
|
type: Object,
|
|
|
|
|
|
required: true,
|
|
|
|
|
|
default: () => ({})
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
data() {
|
|
|
|
|
|
return {
|
|
|
|
|
|
dialogVisible: false,
|
|
|
|
|
|
currentWarehouse: null,
|
|
|
|
|
|
containerWidth: 0,
|
2025-12-19 18:06:55 +08:00
|
|
|
|
resizeTimer: null,
|
|
|
|
|
|
// 右键菜单
|
|
|
|
|
|
contextMenuVisible: false,
|
|
|
|
|
|
contextMenuTop: 0,
|
|
|
|
|
|
contextMenuLeft: 0,
|
|
|
|
|
|
currentContextWarehouse: null,
|
|
|
|
|
|
// 标尺配置
|
|
|
|
|
|
rulerRowHeight: 80,
|
|
|
|
|
|
rulerMaxRow: 0
|
2025-12-08 11:48:20 +08:00
|
|
|
|
};
|
|
|
|
|
|
},
|
|
|
|
|
|
computed: {
|
2025-12-19 18:06:55 +08:00
|
|
|
|
// 排序后的列号(数字升序)
|
|
|
|
|
|
sortedColumnKeys() {
|
|
|
|
|
|
return Object.keys(this.columns)
|
|
|
|
|
|
.map(key => Number(key))
|
|
|
|
|
|
.sort((a, b) => a - b);
|
2025-12-08 11:48:20 +08:00
|
|
|
|
},
|
2025-12-19 18:06:55 +08:00
|
|
|
|
// 标尺总高度
|
|
|
|
|
|
rulerTotalHeight() {
|
|
|
|
|
|
return this.rulerMaxRow * this.rulerRowHeight;
|
2025-12-08 11:48:20 +08:00
|
|
|
|
},
|
2025-12-19 18:06:55 +08:00
|
|
|
|
// 列宽度(原始列)
|
2025-12-08 11:48:20 +08:00
|
|
|
|
cellWidth() {
|
2025-12-19 18:06:55 +08:00
|
|
|
|
if (!this.containerWidth || this.sortedColumnKeys.length === 0) return 60;
|
2025-12-08 11:48:20 +08:00
|
|
|
|
const availableWidth = Math.max(0, this.containerWidth - 30);
|
2025-12-19 18:06:55 +08:00
|
|
|
|
return availableWidth / this.sortedColumnKeys.length;
|
2025-12-08 11:48:20 +08:00
|
|
|
|
},
|
2025-12-19 18:06:55 +08:00
|
|
|
|
// 半列宽度(小列/容器宽度)
|
2025-12-08 11:48:20 +08:00
|
|
|
|
halfCellWidth() {
|
|
|
|
|
|
return this.cellWidth / 2;
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2025-12-19 18:06:55 +08:00
|
|
|
|
watch: {
|
|
|
|
|
|
// 初始化标尺最大行数(仅一次)
|
|
|
|
|
|
columns: {
|
|
|
|
|
|
immediate: true,
|
|
|
|
|
|
handler(newVal) {
|
|
|
|
|
|
if (this.rulerMaxRow === 0 && Object.keys(newVal).length > 0) {
|
|
|
|
|
|
const allMaxRows = Object.values(newVal).map(col => col.maxRow);
|
|
|
|
|
|
this.rulerMaxRow = allMaxRows.length > 0 ? Math.max(...allMaxRows) : 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
this.calcContainerWidth();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2025-12-08 11:48:20 +08:00
|
|
|
|
mounted() {
|
|
|
|
|
|
this.calcContainerWidth();
|
|
|
|
|
|
window.addEventListener('resize', this.handleResize);
|
2025-12-19 18:06:55 +08:00
|
|
|
|
document.addEventListener('click', this.closeContextMenu);
|
2025-12-08 11:48:20 +08:00
|
|
|
|
},
|
|
|
|
|
|
beforeUnmount() {
|
|
|
|
|
|
window.removeEventListener('resize', this.handleResize);
|
2025-12-19 18:06:55 +08:00
|
|
|
|
document.removeEventListener('click', this.closeContextMenu);
|
2025-12-08 11:48:20 +08:00
|
|
|
|
clearTimeout(this.resizeTimer);
|
|
|
|
|
|
},
|
|
|
|
|
|
methods: {
|
2025-12-19 18:06:55 +08:00
|
|
|
|
// 获取指定列、指定层的库位(按行号排序)
|
|
|
|
|
|
getColumnLayerWarehouses(column, layer) {
|
|
|
|
|
|
const columnData = this.columns[column];
|
|
|
|
|
|
if (!columnData) return [];
|
|
|
|
|
|
const layerKey = `layer${layer}`;
|
|
|
|
|
|
return columnData[layerKey].sort((a, b) => a.parsedInfo.row - b.parsedInfo.row);
|
|
|
|
|
|
},
|
|
|
|
|
|
// 获取指定列的总行数(layer1 + layer2)
|
|
|
|
|
|
getColTotalRows(column) {
|
|
|
|
|
|
const columnData = this.columns[column];
|
|
|
|
|
|
if (!columnData) return 0;
|
|
|
|
|
|
return columnData.layer1.length;
|
|
|
|
|
|
},
|
|
|
|
|
|
// 判断列是否超限
|
|
|
|
|
|
isColOverflow(column) {
|
|
|
|
|
|
const totalRows = this.getColTotalRows(column);
|
|
|
|
|
|
return totalRows > this.rulerMaxRow;
|
|
|
|
|
|
},
|
|
|
|
|
|
// 计算列内格子高度
|
|
|
|
|
|
getWarehouseCellHeight(column) {
|
|
|
|
|
|
const totalRows = this.getColTotalRows(column);
|
|
|
|
|
|
if (totalRows === 0) return this.rulerRowHeight;
|
|
|
|
|
|
return this.isColOverflow(column)
|
|
|
|
|
|
? this.rulerTotalHeight / totalRows
|
|
|
|
|
|
: this.rulerRowHeight;
|
|
|
|
|
|
},
|
|
|
|
|
|
// 获取整列库位ID
|
|
|
|
|
|
getInterlacedWarehouseIds(warehouse) {
|
|
|
|
|
|
if (!warehouse?.parsedInfo) return [];
|
|
|
|
|
|
const { column, row } = warehouse.parsedInfo;
|
|
|
|
|
|
const columnData = this.columns[column];
|
|
|
|
|
|
if (!columnData) return [];
|
|
|
|
|
|
|
|
|
|
|
|
const ids = [];
|
|
|
|
|
|
const layer1Warehouse = columnData.layer1.find(w => w.parsedInfo.row === row);
|
|
|
|
|
|
const layer2Warehouse = columnData.layer2.find(w => w.parsedInfo.row === row);
|
|
|
|
|
|
if (layer1Warehouse) ids.push(layer1Warehouse.actualWarehouseId);
|
|
|
|
|
|
if (layer2Warehouse) ids.push(layer2Warehouse.actualWarehouseId);
|
|
|
|
|
|
return ids;
|
|
|
|
|
|
},
|
|
|
|
|
|
// 容器宽度计算
|
2025-12-08 11:48:20 +08:00
|
|
|
|
calcContainerWidth() {
|
|
|
|
|
|
this.containerWidth = this.$el.parentElement?.clientWidth || this.$el.clientWidth || 0;
|
|
|
|
|
|
},
|
|
|
|
|
|
handleResize() {
|
|
|
|
|
|
clearTimeout(this.resizeTimer);
|
|
|
|
|
|
this.resizeTimer = setTimeout(() => {
|
|
|
|
|
|
this.calcContainerWidth();
|
|
|
|
|
|
}, 100);
|
|
|
|
|
|
},
|
2025-12-19 18:06:55 +08:00
|
|
|
|
// 单个格子点击
|
2025-12-08 11:48:20 +08:00
|
|
|
|
handleCellClick(warehouse) {
|
|
|
|
|
|
this.currentWarehouse = warehouse;
|
|
|
|
|
|
this.dialogVisible = true;
|
2025-12-19 18:06:55 +08:00
|
|
|
|
},
|
|
|
|
|
|
// 单个格子右键
|
|
|
|
|
|
openContextMenu(e, warehouse) {
|
|
|
|
|
|
e.stopPropagation();
|
|
|
|
|
|
this.currentContextWarehouse = warehouse;
|
|
|
|
|
|
this.contextMenuTop = e.clientY;
|
|
|
|
|
|
this.contextMenuLeft = e.clientX;
|
|
|
|
|
|
this.contextMenuVisible = true;
|
|
|
|
|
|
},
|
|
|
|
|
|
closeContextMenu() {
|
|
|
|
|
|
this.contextMenuVisible = false;
|
|
|
|
|
|
this.currentContextWarehouse = null;
|
|
|
|
|
|
},
|
|
|
|
|
|
// 右键菜单处理
|
|
|
|
|
|
handleContextMenuClick(type) {
|
|
|
|
|
|
this.contextMenuVisible = false;
|
|
|
|
|
|
if (!this.currentContextWarehouse) return;
|
|
|
|
|
|
|
|
|
|
|
|
switch (type) {
|
|
|
|
|
|
case 'view':
|
|
|
|
|
|
this.handleCellClick(this.currentContextWarehouse);
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 'delete':
|
|
|
|
|
|
this.handleDeleteWarehouse(this.currentContextWarehouse);
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 'split':
|
|
|
|
|
|
this.handleSplitWarehouse();
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 'merge':
|
|
|
|
|
|
this.handleMergeWarehouse();
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
// 分割库位
|
|
|
|
|
|
handleSplitWarehouse() {
|
|
|
|
|
|
if (!this.currentContextWarehouse) {
|
|
|
|
|
|
this.$message.warning('请先选择要分割的库位');
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (this.currentContextWarehouse.isEnabled === 0) {
|
|
|
|
|
|
this.$message.warning('已占用库位无法分割');
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
this.$emit('split-warehouse', this.currentContextWarehouse);
|
|
|
|
|
|
},
|
|
|
|
|
|
// 合并库位
|
|
|
|
|
|
handleMergeWarehouse() {
|
|
|
|
|
|
if (!this.currentContextWarehouse) {
|
|
|
|
|
|
this.$message.warning('请先选择要合并的库位');
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (this.currentContextWarehouse.isEnabled === 0) {
|
|
|
|
|
|
this.$message.warning('已占用库位无法合并');
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
this.$emit('merge-warehouse', this.currentContextWarehouse);
|
|
|
|
|
|
},
|
|
|
|
|
|
// 删除库位
|
|
|
|
|
|
handleDeleteWarehouse(warehouse) {
|
|
|
|
|
|
if (warehouse.isEnabled === 0) {
|
|
|
|
|
|
Message.warning('禁用状态的库位无法删除');
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
this.$emit('delete-warehouse', warehouse);
|
2025-12-08 11:48:20 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
2025-12-19 18:06:55 +08:00
|
|
|
|
/* 外层容器 */
|
2025-12-08 11:48:20 +08:00
|
|
|
|
.multi-layer-grid {
|
|
|
|
|
|
width: 100% !important;
|
|
|
|
|
|
height: 100%;
|
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
|
margin: 0 !important;
|
|
|
|
|
|
padding: 0 !important;
|
|
|
|
|
|
overflow: hidden !important;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* 列标尺 */
|
|
|
|
|
|
.col-ruler {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
height: 30px;
|
|
|
|
|
|
line-height: 30px;
|
2025-12-19 18:06:55 +08:00
|
|
|
|
background: #f5f7fa;
|
2025-12-08 11:48:20 +08:00
|
|
|
|
border-bottom: 1px solid #e4e7ed;
|
|
|
|
|
|
width: 100% !important;
|
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
|
overflow: hidden !important;
|
|
|
|
|
|
|
|
|
|
|
|
.ruler-empty {
|
|
|
|
|
|
width: 30px;
|
|
|
|
|
|
text-align: center;
|
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
|
color: #606266;
|
|
|
|
|
|
border-right: 1px solid #e4e7ed;
|
|
|
|
|
|
flex-shrink: 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.ruler-item {
|
|
|
|
|
|
width: var(--cell-width);
|
|
|
|
|
|
text-align: center;
|
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
|
color: #606266;
|
|
|
|
|
|
border-right: 1px solid #e4e7ed;
|
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
|
flex-shrink: 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-12-19 18:06:55 +08:00
|
|
|
|
/* 行标尺 + 网格外层 */
|
2025-12-08 11:48:20 +08:00
|
|
|
|
.row-grid-wrapper {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
width: 100% !important;
|
|
|
|
|
|
height: calc(100% - 30px);
|
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
|
overflow: hidden !important;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-12-19 18:06:55 +08:00
|
|
|
|
/* 左侧行标尺 */
|
2025-12-08 11:48:20 +08:00
|
|
|
|
.row-ruler {
|
|
|
|
|
|
width: 30px;
|
2025-12-19 18:06:55 +08:00
|
|
|
|
background: #f5f7fa;
|
2025-12-08 11:48:20 +08:00
|
|
|
|
border-right: 1px solid #e4e7ed;
|
|
|
|
|
|
flex-shrink: 0;
|
|
|
|
|
|
overflow: hidden !important;
|
2025-12-19 18:06:55 +08:00
|
|
|
|
height: var(--total-height);
|
2025-12-08 11:48:20 +08:00
|
|
|
|
|
|
|
|
|
|
.ruler-item {
|
|
|
|
|
|
height: 80px;
|
|
|
|
|
|
line-height: 80px;
|
|
|
|
|
|
text-align: center;
|
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
|
color: #606266;
|
|
|
|
|
|
border-bottom: 1px solid #e4e7ed;
|
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* 网格容器 */
|
|
|
|
|
|
.grid-container {
|
|
|
|
|
|
display: grid;
|
|
|
|
|
|
width: 100% !important;
|
|
|
|
|
|
grid-template-columns: repeat(var(--column-count), minmax(0, var(--half-cell-width)));
|
2025-12-19 18:06:55 +08:00
|
|
|
|
grid-auto-rows: var(--total-height); /* 每行高度=标尺总高度 */
|
|
|
|
|
|
gap: 0px;
|
2025-12-08 11:48:20 +08:00
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
|
margin: 0 !important;
|
|
|
|
|
|
padding: 0 !important;
|
2025-12-19 18:06:55 +08:00
|
|
|
|
height: var(--total-height);
|
2025-12-08 11:48:20 +08:00
|
|
|
|
overflow: hidden !important;
|
|
|
|
|
|
-ms-overflow-style: none;
|
|
|
|
|
|
scrollbar-width: none;
|
|
|
|
|
|
|
|
|
|
|
|
&::-webkit-scrollbar {
|
|
|
|
|
|
display: none !important;
|
|
|
|
|
|
width: 0 !important;
|
|
|
|
|
|
height: 0 !important;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-12-19 18:06:55 +08:00
|
|
|
|
/* 列容器(左右小列的外层容器)- 核心修改:移除底部padding,区分两层容器高度 */
|
|
|
|
|
|
.column-container {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
justify-content: flex-start;
|
|
|
|
|
|
padding: 1px;
|
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
|
border: 1px solid #e4e7ed;
|
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
|
|
|
|
|
|
|
/* 移除:原填补空隙的底部padding */
|
|
|
|
|
|
/* padding-bottom: calc(var(--offset-value, 0px) + 2px); */
|
|
|
|
|
|
|
|
|
|
|
|
/* 左容器(layer1)基础样式:强制100%高度 */
|
|
|
|
|
|
&.layer-1-container {
|
|
|
|
|
|
background-color: #fff3e020;
|
|
|
|
|
|
height: 100%;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* 右容器(layer2)基础样式:自动高度,覆盖100% */
|
|
|
|
|
|
&.layer-2-container {
|
|
|
|
|
|
background-color: #e8f5e920;
|
|
|
|
|
|
height: 100%;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* 单个库位格子(容器内的子元素) */
|
2025-12-08 11:48:20 +08:00
|
|
|
|
.warehouse-cell {
|
2025-12-19 18:06:55 +08:00
|
|
|
|
height: var(--item-height); /* 动态高度:超限列缩小 */
|
2025-12-08 11:48:20 +08:00
|
|
|
|
border: 1px solid #e4e7ed;
|
2025-12-19 18:06:55 +08:00
|
|
|
|
border-radius: 4px;
|
2025-12-08 11:48:20 +08:00
|
|
|
|
display: flex;
|
|
|
|
|
|
justify-content: center;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
transition: all 0.2s;
|
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
|
position: relative;
|
|
|
|
|
|
z-index: 1;
|
|
|
|
|
|
overflow: hidden;
|
2025-12-19 18:06:55 +08:00
|
|
|
|
margin: 1px 0;
|
|
|
|
|
|
/* 确保transform偏移不影响点击区域 */
|
|
|
|
|
|
transform-origin: top center;
|
2025-12-08 11:48:20 +08:00
|
|
|
|
|
2025-12-19 18:06:55 +08:00
|
|
|
|
/* 第一层格子样式 */
|
2025-12-08 11:48:20 +08:00
|
|
|
|
&.layer-1:not(.disabled) {
|
2025-12-19 18:06:55 +08:00
|
|
|
|
background: #fff3e0;
|
|
|
|
|
|
color: #e65100;
|
2025-12-08 11:48:20 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2025-12-19 18:06:55 +08:00
|
|
|
|
/* 第二层格子样式 */
|
2025-12-08 11:48:20 +08:00
|
|
|
|
&.layer-2:not(.disabled) {
|
2025-12-19 18:06:55 +08:00
|
|
|
|
background: #e8f5e9;
|
|
|
|
|
|
color: #2e7d32;
|
|
|
|
|
|
/* 偏移后增加z-index,避免被遮挡 */
|
|
|
|
|
|
z-index: 1;
|
2025-12-08 11:48:20 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2025-12-19 18:06:55 +08:00
|
|
|
|
/* 禁用状态 */
|
2025-12-08 11:48:20 +08:00
|
|
|
|
&.disabled {
|
2025-12-19 18:06:55 +08:00
|
|
|
|
background: #fafafa;
|
|
|
|
|
|
color: #909399;
|
|
|
|
|
|
cursor: not-allowed;
|
|
|
|
|
|
opacity: 0.8;
|
|
|
|
|
|
|
2025-12-08 11:48:20 +08:00
|
|
|
|
&:hover {
|
|
|
|
|
|
border-color: #e4e7ed;
|
|
|
|
|
|
background: #fafafa;
|
|
|
|
|
|
z-index: 1;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-12-19 18:06:55 +08:00
|
|
|
|
/* 单个格子独立hover */
|
2025-12-08 11:48:20 +08:00
|
|
|
|
&:not(.disabled):hover {
|
2025-12-19 18:06:55 +08:00
|
|
|
|
border-color: #90caf9;
|
|
|
|
|
|
background: #f0f8ff;
|
2025-12-08 11:48:20 +08:00
|
|
|
|
z-index: 2;
|
2025-12-19 18:06:55 +08:00
|
|
|
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
|
2025-12-08 11:48:20 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2025-12-19 18:06:55 +08:00
|
|
|
|
/* 格子文字 */
|
2025-12-08 11:48:20 +08:00
|
|
|
|
.cell-name {
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
height: 90%;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
justify-content: center;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
text-align: center;
|
|
|
|
|
|
padding: 0 4px;
|
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
|
|
|
|
|
|
|
.cell-line1 {
|
2025-12-19 18:06:55 +08:00
|
|
|
|
font-size: 12px;
|
2025-12-08 11:48:20 +08:00
|
|
|
|
font-weight: 600;
|
|
|
|
|
|
line-height: 1.2;
|
2025-12-19 18:06:55 +08:00
|
|
|
|
margin-bottom: 2px;
|
2025-12-08 11:48:20 +08:00
|
|
|
|
overflow: hidden;
|
|
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
|
|
white-space: nowrap;
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.cell-line2 {
|
2025-12-19 18:06:55 +08:00
|
|
|
|
font-size: 11px;
|
2025-12-08 11:48:20 +08:00
|
|
|
|
line-height: 1.2;
|
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
|
|
white-space: nowrap;
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.disabled & .cell-line1,
|
|
|
|
|
|
.disabled & .cell-line2 {
|
|
|
|
|
|
color: #909399 !important;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.layer-1:not(.disabled) & .cell-line1,
|
|
|
|
|
|
.layer-1:not(.disabled) & .cell-line2 {
|
|
|
|
|
|
color: #e65100;
|
|
|
|
|
|
}
|
2025-12-19 18:06:55 +08:00
|
|
|
|
|
2025-12-08 11:48:20 +08:00
|
|
|
|
.layer-2:not(.disabled) & .cell-line1,
|
|
|
|
|
|
.layer-2:not(.disabled) & .cell-line2 {
|
|
|
|
|
|
color: #2e7d32;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-12-19 18:06:55 +08:00
|
|
|
|
|
|
|
|
|
|
/* 右键菜单 */
|
|
|
|
|
|
.custom-contextmenu {
|
|
|
|
|
|
position: fixed;
|
|
|
|
|
|
width: 120px;
|
|
|
|
|
|
background: #ffffff;
|
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
|
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
|
|
|
|
|
|
border: 1px solid #ebeef5;
|
|
|
|
|
|
padding: 5px 0;
|
|
|
|
|
|
margin: 0;
|
|
|
|
|
|
list-style: none;
|
|
|
|
|
|
z-index: 9999;
|
|
|
|
|
|
|
|
|
|
|
|
ul {
|
|
|
|
|
|
margin: 0;
|
|
|
|
|
|
padding: 0;
|
|
|
|
|
|
list-style: none;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
li {
|
|
|
|
|
|
padding: 6px 15px;
|
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
|
color: #606266;
|
|
|
|
|
|
transition: background-color 0.2s;
|
|
|
|
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
|
|
background-color: #f5f7fa;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
&.disabled {
|
|
|
|
|
|
color: #c0c4cc;
|
|
|
|
|
|
cursor: not-allowed;
|
|
|
|
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
|
|
background-color: #ffffff;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.menu-divider {
|
|
|
|
|
|
height: 1px;
|
|
|
|
|
|
margin: 4px 0;
|
|
|
|
|
|
background-color: #ebeef5;
|
|
|
|
|
|
padding: 0;
|
|
|
|
|
|
cursor: default;
|
|
|
|
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
|
|
background-color: #ebeef5;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-12-08 11:48:20 +08:00
|
|
|
|
</style>
|