Commit 7549bb79 authored by wanghao's avatar wanghao

1 托盘信息管理 增加 老化开始时间 预计老化结束时间,及状态判断,如果是 老化中 状态 才显示 这两个时间。

2 老化柜看板 柜号显示调整, 定时巡检任务 判断问题修复。
parent 227fe38e
...@@ -88,6 +88,14 @@ public class SysConfigController extends BaseController ...@@ -88,6 +88,14 @@ public class SysConfigController extends BaseController
return AjaxResult.success(configService.selectAgingStageTime()); return AjaxResult.success(configService.selectAgingStageTime());
} }
/**
* 获取老化阶段时间
*/
@GetMapping(value = "/getAgingStage3Time")
public AjaxResult selectAgingStage3Time() {
return AjaxResult.success(configService.selectAgingStageTime().get(2));
}
/** /**
* 修改老化阶段时间 * 修改老化阶段时间
*/ */
......
...@@ -32,6 +32,7 @@ public interface ISysConfigService ...@@ -32,6 +32,7 @@ public interface ISysConfigService
public List<SysConfig> selectAgingStageTime(); public List<SysConfig> selectAgingStageTime();
public SysConfig selectAgingStage3Time();
public int updateAgingStageTime(List<SysConfig> sysConfigs); public int updateAgingStageTime(List<SysConfig> sysConfigs);
/** /**
......
...@@ -118,6 +118,12 @@ public class SysConfigServiceImpl implements ISysConfigService ...@@ -118,6 +118,12 @@ public class SysConfigServiceImpl implements ISysConfigService
return new ArrayList<>(); return new ArrayList<>();
} }
@Override
public SysConfig selectAgingStage3Time() {
return configMapper.checkConfigKeyUnique(RoboticArmConstans.AGING_STAGE3_TIME);
}
/** /**
* 更新 agingStage1Time agingStage2Time agingStage3Time * 更新 agingStage1Time agingStage2Time agingStage3Time
* *
......
...@@ -200,7 +200,7 @@ public class AgingCabinetInspectionAndPowerCheckTask { ...@@ -200,7 +200,7 @@ public class AgingCabinetInspectionAndPowerCheckTask {
modbusDeviceData.setfStatus("0"); modbusDeviceData.setfStatus("0");
} }
} else { } else {
modbusDeviceData.setfStatus("0"); modbusDeviceData.setfStatus("2");
} }
} }
return deviceDataList; return deviceDataList;
......
...@@ -41,7 +41,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -41,7 +41,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectConfigVo"/> <include refid="selectConfigVo"/>
where config_key in ('agingStage1Time','agingStage2Time','agingStage3Time') where config_key in ('agingStage1Time','agingStage2Time','agingStage3Time')
</select> </select>
<select id="selectConfigList" parameterType="SysConfig" resultMap="SysConfigResult"> <select id="selectConfigList" parameterType="SysConfig" resultMap="SysConfigResult">
<include refid="selectConfigVo"/> <include refid="selectConfigVo"/>
<where> <where>
......
...@@ -41,6 +41,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -41,6 +41,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="fUnbindingTime != null "> and trayInfo.f_unbinding_time = #{fUnbindingTime}</if> <if test="fUnbindingTime != null "> and trayInfo.f_unbinding_time = #{fUnbindingTime}</if>
<if test="fCreateTime != null "> and trayInfo.f_create_time = #{fCreateTime}</if> <if test="fCreateTime != null "> and trayInfo.f_create_time = #{fCreateTime}</if>
</where> </where>
ORDER BY trayInfo.f_tray_id
</select> </select>
<select id="selectTTrayInfoById" parameterType="Long" resultMap="TTrayInfoResult"> <select id="selectTTrayInfoById" parameterType="Long" resultMap="TTrayInfoResult">
......
...@@ -39,6 +39,13 @@ export function getAgingStageTime() { ...@@ -39,6 +39,13 @@ export function getAgingStageTime() {
}) })
} }
export function getAgingStage3Time() {
return request({
url: '/system/config/getAgingStage3Time',
method: 'get'
})
}
export function updateAgingStageTime(data) { export function updateAgingStageTime(data) {
return request({ return request({
url: '/system/config/updateAgingStageTime', url: '/system/config/updateAgingStageTime',
......
...@@ -56,9 +56,9 @@ ...@@ -56,9 +56,9 @@
font-weight: bold;" font-weight: bold;"
@click.native="handleCardClick(item)" @click.native="handleCardClick(item)"
> >
<!-- {{ item.fEquipmentCode + "号柜" }}--> {{ item.fEquipmentCode + "号柜" }}
<!-- 核心:调用方法生成编号,传入总索引 = 行索引*6 + 列索引 --> <!-- 核心:调用方法生成编号,传入总索引 = 行索引*6 + 列索引 -->
{{ getCabinetNumber(rowIndex * 6 + colIndex) }} <!-- {{ getCabinetNumber(rowIndex * 6 + colIndex) }}-->
</el-card> </el-card>
</el-tooltip> </el-tooltip>
</el-col> </el-col>
......
...@@ -259,7 +259,7 @@ export default { ...@@ -259,7 +259,7 @@ export default {
trayStatusText() { trayStatusText() {
const map = { const map = {
'0': '空闲', '0': '空闲',
'1': '运行中', '1': '老化中',
'2': '老化完成', '2': '老化完成',
'3': '标定完成', '3': '标定完成',
'4': '已绑定' '4': '已绑定'
...@@ -748,7 +748,6 @@ body { ...@@ -748,7 +748,6 @@ body {
background: linear-gradient(to right, #64c8ff, #3a7bd5); background: linear-gradient(to right, #64c8ff, #3a7bd5);
-webkit-background-clip: text; -webkit-background-clip: text;
color: transparent; color: transparent;
min-width: 250px;
text-align: center; text-align: center;
} }
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
label="托盘编号" label="托盘编号"
align="center" align="center"
fixed="left" fixed="left"
width="150px" width="150"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<div class="tray-id">{{ scope.row.fTrayCode }}</div> <div class="tray-id">{{ scope.row.fTrayCode }}</div>
...@@ -64,10 +64,10 @@ ...@@ -64,10 +64,10 @@
label="状态" label="状态"
align="center" align="center"
fixed="left" fixed="left"
width="150px" width="150"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag :type="statusTagType(scope.row.fStatus)" v-if="scope.row.fStatus === '1'" class="status-tag">运行</el-tag> <el-tag :type="statusTagType(scope.row.fStatus)" v-if="scope.row.fStatus === '1'" class="status-tag">老化</el-tag>
<el-tag :type="statusTagType(scope.row.fStatus)" v-else-if="scope.row.fStatus === '2'" class="status-tag">老化完成</el-tag> <el-tag :type="statusTagType(scope.row.fStatus)" v-else-if="scope.row.fStatus === '2'" class="status-tag">老化完成</el-tag>
<el-tag :type="statusTagType(scope.row.fStatus)" v-else-if="scope.row.fStatus === '3'" class="status-tag">标定完成</el-tag> <el-tag :type="statusTagType(scope.row.fStatus)" v-else-if="scope.row.fStatus === '3'" class="status-tag">标定完成</el-tag>
<el-tag :type="statusTagType(scope.row.fStatus)" v-else-if="scope.row.fStatus === '4'" class="status-tag">已绑定</el-tag> <el-tag :type="statusTagType(scope.row.fStatus)" v-else-if="scope.row.fStatus === '4'" class="status-tag">已绑定</el-tag>
...@@ -76,30 +76,30 @@ ...@@ -76,30 +76,30 @@
</el-table-column> </el-table-column>
<!-- 可滚动列:老化开始时间 --> <!-- 可滚动列:老化开始时间 -->
<el-table-column prop="fAgingStartTime" label="老化开始时间" align="center" width="200px"> <el-table-column prop="fAgingStartTime" label="老化开始时间" align="center" width="200">
<template slot-scope="scope"> <template slot-scope="scope">
<div class="device-code">{{ scope.row.fAgingStartTime ? formatDate(scope.row.fAgingStartTime) : '-' }}</div> <div class="device-code">{{ scope.row.fAgingStartTime ? formatDate(scope.row.fAgingStartTime) : '-' }}</div>
</template> </template>
</el-table-column> </el-table-column>
<!-- 可滚动列:预计老化结束时间 --> <!-- 可滚动列:预计老化结束时间 -->
<el-table-column prop="fAgingStartTime" label="预计老化结束时间" align="center" width="200px"> <el-table-column prop="fAgingEndTime" label="预计老化结束时间" align="center" width="200">
<template slot-scope="scope"> <template slot-scope="scope">
<div class="device-code">{{ scope.row.fAgingStartTime ? formatDate(scope.row.fAgingStartTime) : '-' }}</div> <div class="device-code">{{ scope.row.fAgingEndTime ? formatDate(scope.row.fAgingEndTime) : '-' }}</div>
</template> </template>
</el-table-column> </el-table-column>
<!-- 可滚动列:主板数量 --> <!-- 可滚动列:主板数量 -->
<el-table-column prop="boardCount" label="主板数量" align="center" width="150px"> <el-table-column prop="boardCount" label="主板数量" align="center" :width="boardCountWidth">
<template slot-scope="scope"> <template slot-scope="scope">
<div class="board-count"> <div class="board-count">
<span class="count-number">{{ (scope.row.boardCount == null || scope.row.boardCount == 0) ? '0' : scope.row.boardCount }}</span> <span class="count-number">{{ (scope.row.boardCount == null || scope.row.boardCount === 0) ? '0' : scope.row.boardCount }}</span>
<span class="count-label"></span> <span class="count-label"></span>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<!-- 可滚动列:位置 --> <!-- 可滚动列:位置 -->
<el-table-column prop="location" label="位置" align="center"> <el-table-column prop="location" label="位置" align="center" :width="locationWidth">
<template slot-scope="scope"> <template slot-scope="scope">
<div class="location-text">{{ scope.row.fStoreyCode }}</div> <div class="location-text">{{ scope.row.fStoreyCode }}</div>
</template> </template>
...@@ -126,6 +126,7 @@ ...@@ -126,6 +126,7 @@
<script> <script>
import { listTray } from "@/api/tray/tray" import { listTray } from "@/api/tray/tray"
import {formatDate} from "@/utils"; import {formatDate} from "@/utils";
import {getAgingStage3Time} from "@/api/system/config";
export default { export default {
name: "TrayInformation", name: "TrayInformation",
...@@ -142,6 +143,10 @@ export default { ...@@ -142,6 +143,10 @@ export default {
pageSize: 10, pageSize: 10,
fTrayCode: undefined, fTrayCode: undefined,
}, },
// 动态列宽
boardCountWidth: '150',
locationWidth: '150',
agingStage3Time: 0,
}; };
}, },
created() { created() {
...@@ -154,6 +159,7 @@ export default { ...@@ -154,6 +159,7 @@ export default {
this.$nextTick(() => { this.$nextTick(() => {
this.adjustTableLayout(); this.adjustTableLayout();
}); });
this.initAgingStage3Time();
}, },
beforeDestroy() { beforeDestroy() {
window.removeEventListener('resize', this.handleResize); window.removeEventListener('resize', this.handleResize);
...@@ -201,20 +207,44 @@ export default { ...@@ -201,20 +207,44 @@ export default {
getRowKey(row) { getRowKey(row) {
return row.fTrayCode || row.trayId; return row.fTrayCode || row.trayId;
}, },
initAgingStage3Time() {
getAgingStage3Time().then(response => {
this.agingStage3Time = response.data.configValue;
})
},
// 获取托盘数据 // 获取托盘数据
// 获取托盘数据
fetchTrays() { fetchTrays() {
listTray(this.queryParams).then(response => { listTray(this.queryParams).then(response => {
this.trays = response.rows; this.trays = response.rows.map(item => {
// 如果是运行中状态且有老化开始时间,计算预计老化结束时间
if (item.fStatus === '1' && item.fAgingStartTime) {
try {
// 将开始时间转换为Date对象
const startTime = new Date(item.fAgingStartTime);
// 加上配置的分钟数(agingStage3Time以分钟为单位)
const endTime = new Date(startTime.getTime() + this.agingStage3Time * 60 * 1000);
// 添加到item对象中
item.fAgingEndTime = endTime;
} catch (e) {
console.error('计算预计老化结束时间失败:', e);
item.fAgingEndTime = null;
}
} else {
item.fAgingEndTime = null;
item.fAgingStartTime = null;
}
return item;
});
this.total = response.total; this.total = response.total;
this.loading = false; this.loading = false;
// 数据加载完成后调整表格布局 // 数据加载完成后调整表格布局
this.$nextTick(() => { this.$nextTick(() => {
this.adjustTableLayout(); this.adjustTableLayout();
}); });
}) });
}, },
// 搜索托盘 // 搜索托盘
searchTray() { searchTray() {
this.queryParams.pageNum = 1; this.queryParams.pageNum = 1;
...@@ -266,33 +296,32 @@ export default { ...@@ -266,33 +296,32 @@ export default {
const tableContainer = this.$el.querySelector('.tray-table-container'); const tableContainer = this.$el.querySelector('.tray-table-container');
if (tableContainer) { if (tableContainer) {
const containerWidth = tableContainer.clientWidth; const containerWidth = tableContainer.clientWidth;
// 计算所有列的总宽度
const fixedColsWidth = 150 + 120; // 固定列宽度 // 计算所有固定宽度的列的总宽度
const scrollableColsWidth = 200 + 200 + 130 + 150; // 可滚动列宽度 const fixedColsWidth = 150 + 170; // 固定列宽度(托盘编号150 + 状态120)
const totalColsWidth = fixedColsWidth + scrollableColsWidth; const timeColsWidth = 200 + 200; // 时间列宽度(老化开始时间200 + 预计老化结束时间200)
const fixedTotalWidth = fixedColsWidth + timeColsWidth;
// 如果容器宽度大于列总宽度,自动调整可滚动列宽度
if (containerWidth > totalColsWidth) { // 计算剩余可用宽度
// 计算额外的可用宽度 const remainingWidth = containerWidth - fixedTotalWidth;
const extraWidth = containerWidth - totalColsWidth;
// 按比例分配给可滚动列 // 如果剩余宽度大于0,平均分配给主板数量和位置列
const widthPerCol = extraWidth / 4; // 有4个可滚动列 if (remainingWidth > 300) { // 确保有最小宽度
const averageWidth = Math.floor(remainingWidth / 2);
// 更新可滚动列的宽度 this.boardCountWidth = averageWidth.toString();
this.updateScrollableColumnsWidth(widthPerCol); this.locationWidth = averageWidth.toString();
} else {
// 如果宽度不足,使用最小宽度
this.boardCountWidth = '150';
this.locationWidth = '150';
} }
}
},
// 更新可滚动列宽度 // 触发表格重新布局
updateScrollableColumnsWidth(extraWidth) { if (this.$refs.trayTable) {
// 更新列宽度 this.$refs.trayTable.doLayout();
const table = this.$refs.trayTable; }
if (table && table.columns) {
// 这里主要是样式调整,实际列宽会在CSS中控制
// 我们通过CSS来确保表格填满容器
} }
} },
} }
} }
</script> </script>
...@@ -460,7 +489,7 @@ export default { ...@@ -460,7 +489,7 @@ export default {
overflow: hidden; overflow: hidden;
width: 100% !important; /* 确保表格宽度100% */ width: 100% !important; /* 确保表格宽度100% */
min-width: auto !important; /* 移除最小宽度限制 */ min-width: auto !important; /* 移除最小宽度限制 */
table-layout: auto !important; /* 使用自动布局,让列宽自适应 */ table-layout: fixed !important; /* 使用固定布局,让列宽平均分配 */
} }
/* 固定列样式 */ /* 固定列样式 */
...@@ -497,20 +526,6 @@ export default { ...@@ -497,20 +526,6 @@ export default {
min-width: 0; /* 允许表头列收缩 */ min-width: 0; /* 允许表头列收缩 */
} }
/* 大屏幕优化:列宽自适应 */
@media (min-width: 1200px) {
.tray-table >>> .el-table th,
.tray-table >>> .el-table td {
min-width: 0; /* 允许列宽自适应 */
max-width: none; /* 移除最大宽度限制 */
}
/* 可滚动列宽度自适应 */
.tray-table >>> .el-table .el-table__body-wrapper .el-table__body td:not(.is-fixed-left):not(.is-fixed-right) {
min-width: 120px; /* 设置一个最小宽度 */
}
}
.tray-table >>> .el-table tr { .tray-table >>> .el-table tr {
background: rgba(8, 28, 65, 0.5); background: rgba(8, 28, 65, 0.5);
transition: all 0.3s ease; transition: all 0.3s ease;
...@@ -729,13 +744,7 @@ export default { ...@@ -729,13 +744,7 @@ export default {
} }
.tray-table >>> .el-table { .tray-table >>> .el-table {
table-layout: fixed !important; /* 大屏幕上使用固定布局,确保列宽平均分配 */ table-layout: fixed !important; /* 确保使用固定布局 */
}
/* 在大屏幕上平均分配列宽 */
.tray-table >>> .el-table .el-table__body-wrapper .el-table__body td:not(.is-fixed-left):not(.is-fixed-right) {
width: calc((100% - 270px) / 4) !important; /* 4个可滚动列平均分配剩余宽度 */
min-width: 150px; /* 保持最小宽度 */
} }
} }
</style> </style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment