fix(表格): 修复表格交互问题并优化显示

修复RealTimeInventory表格双击事件中单元格值检查过于严格的问题,允许空字符串和'-'触发对话框。同时优化表格显示:
- 为RepairSummary表格的最近维修时间列添加排序功能
- 设置RealTimeInventory表格固定高度和最大高度
- 改进表头样式,使其固定并添加底部边框
- 添加调试日志帮助排查双击事件问题
- 将获取转移概率失败的错误提示改为警告级别
master
huangjinysf 2 months ago
parent 3d986df030
commit b38301a62a

@ -30,7 +30,7 @@
<el-table-column prop="equipment_name" label="设备名称" align="center" min-width="200" />
<el-table-column prop="record_count" label="维修次数" align="center" width="100" />
<el-table-column prop="first_apply_time" label="首次维修时间" align="center" min-width="180" />
<el-table-column prop="last_apply_time" label="最近维修时间" align="center" min-width="180" />
<el-table-column prop="last_apply_time" label="最近维修时间" align="center" min-width="180" sortable/>
<el-table-column label="距离上次维修天数" align="center" width="150">
<template #default="scope">
<el-tag

@ -57,6 +57,8 @@
:header-cell-style="{ backgroundColor: '#f5f7fa', color: '#606266' }"
empty-text="暂无数据"
:scrollbar-always-on="true"
height="1000"
:max-height="1000"
@cell-click="handleCellClick"
@cell-dblclick="handleCellDblClick"
>
@ -674,7 +676,7 @@ const fetchTransitionProbabilities = async (equipmentCode, axleNumber, model, sp
}
} else {
console.error('获取转移概率数据失败:', result.code, result.message);
ElMessage.error(`获取转移概率数据失败: ${result.message || '未知错误'}`);
ElMessage.warning(`获取转移概率数据失败: ${result.message || '未知错误'}`);
return null;
}
} catch (error) {
@ -1223,14 +1225,27 @@ const handleCellDblClick = async (row, column, cell, event) => {
clickTimeoutId = null;
console.log('双击事件已清除单击延时器');
}
//
console.log('双击事件触发:', {
row,
column,
columnProperty: column.property,
cellValue: row[column.property],
cellValueType: typeof row[column.property]
});
const cellValue = row[column.property];
//
if (!cellValue || cellValue === '-' || cellValue === null || cellValue === undefined) {
//
if (cellValue === null || cellValue === undefined) {
ElMessage.warning('该单元格暂无数据');
return;
}
// '-'
console.log('单元格值检查通过,继续执行');
// WMS
if (column.property === 'specification' || column.property === 'total') {
ElMessage.info('该列不支持查看详情');
@ -1940,6 +1955,10 @@ onMounted(() => {
white-space: nowrap;
text-align: center; /* 可选:居中对齐列头 */
padding: 8px 0; /* 调整列头内间距,以适应两行显示 */
position: sticky;
top: 0;
z-index: 10;
border-bottom: 2px solid #dcdfe6;
}
:deep(.el-table td) {

Loading…
Cancel
Save