Commit 8814cb68 by 延飞 李

OEE 时间利用率中日均运行时间统计显示的百分比改为显示分钟

parent 9d819237
......@@ -65,7 +65,7 @@
<div class="status-chart glass-effect">
<div class="section-title">
<div class="title-bar"></div>
<span class="title-text">日均运行时间统计</span>
<span class="title-text">日均运行时间统计(分钟)</span>
</div>
<div class="chart-container">
......@@ -92,7 +92,7 @@
<div class="y-axis">
<span v-for="(value, index) in yAxisValues" :key="index" class="y-axis-label">
[[value]]
<span class="unit">%</span>
<span class="unit">分钟</span>
</span>
</div>
<!-- 图表主体区域 -->
......@@ -116,14 +116,14 @@
v-for="(segment, stackIndex) in item"
:key="stackIndex"
:style="{
'height': calculateHeight(segment.duration_percentage) + '%',
'height': calculateHeightByMinutes(convertSecondsToMinutes(segment.duration)) + '%',
'background-color': segment.state,
'margin-top': '0px'
}"
>
<el-tooltip
effect="dark"
:content="calculateHeight(segment.duration_percentage) + '%'"
:content="convertSecondsToMinutes(segment.duration) + '分钟'"
placement="top"
>
<div style="height: 100%; width: 100%"></div>
......@@ -160,7 +160,7 @@
chart_loading: false,
deviceList: [], // 设备列表
selectedDevice: null, // 选中的设备
yAxisValues: ["100", "80", "60", "40", "20", "0"], // Y轴刻度值
yAxisValues: ["1440", "1152", "864", "576", "288", "0"], // Y轴刻度值(分钟)
pickingOrderList: [], // 拣选单列表
dateList: [], // 日期列表
start_time: "", // 开始时间
......@@ -445,12 +445,16 @@
this.utilizationChart.resize();
}, 300); // 延迟300ms初始化
},
// 计算高度百分比
calculateHeight(hours) {
// 直接使用百分比值
// yAxisValues = ["100", "80", "60", "40", "20", "0"],每个刻度区间是20%
// 确保高度在0-100%之间
return Math.min(Math.max(hours, 0), 100);
// 将秒转换为分钟
convertSecondsToMinutes(seconds) {
return Math.round(seconds / 60);
},
// 基于分钟数计算高度百分比
calculateHeightByMinutes(minutes) {
// 将分钟数转换为相对于1440分钟(一天)的百分比
const percentage = (minutes / 1440) * 100;
return Math.min(Math.max(percentage, 0), 100);
},
// 获取最后指定天数的日期
getLastAssignDays(num = 10) {
......
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