Commit 8814cb68 by 延飞 李

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

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