Commit f73f9799 by 延飞 李

时间利用率-设备默认选择一个

parent c0958ecb
...@@ -159,7 +159,7 @@ ...@@ -159,7 +159,7 @@
idle_rate_loading: false, // 加载效果 idle_rate_loading: false, // 加载效果
chart_loading: false, chart_loading: false,
deviceList: [], // 设备列表 deviceList: [], // 设备列表
selectedDevice: null, // 选中的设备 selectedDevice: "", // 选中的设备,默认为空字符串而不是null
yAxisValues: ["1440", "1152", "864", "576", "288", "0"], // Y轴刻度值(分钟) yAxisValues: ["1440", "1152", "864", "576", "288", "0"], // Y轴刻度值(分钟)
pickingOrderList: [], // 拣选单列表 pickingOrderList: [], // 拣选单列表
dateList: [], // 日期列表 dateList: [], // 日期列表
...@@ -224,6 +224,10 @@ ...@@ -224,6 +224,10 @@
} }
}); });
}); });
// 设备列表加载完成后,默认选择第一个设备
if (this.deviceList.length > 0) {
this.selectedDevice = this.deviceList[0].code;
}
this.get_plan_time(); this.get_plan_time();
console.log("获取到所有已绑定设备数据:", this.deviceList.length, "条"); console.log("获取到所有已绑定设备数据:", this.deviceList.length, "条");
} else { } else {
...@@ -297,9 +301,11 @@ ...@@ -297,9 +301,11 @@
.then((res) => { .then((res) => {
if (res.data.result.code == 0) { if (res.data.result.code == 0) {
this.plan_time_list = res.data.result.data; this.plan_time_list = res.data.result.data;
// 只有在选择了设备时才调用单设备空闲率接口 // 获取单设备空闲率接口数据
if (this.selectedDevice) { if (this.selectedDevice) {
this.get_series_utilization_rate(); this.get_series_utilization_rate();
// 同时获取日均运行时间数据
this.get_daily_running_time();
} }
// 初始化多设备图表 // 初始化多设备图表
if (this.multiUtilizationChart) { if (this.multiUtilizationChart) {
......
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