Commit 17a83e40 by 延飞 李

继续修改 loading 加载问题

parent db01bd32
......@@ -549,11 +549,17 @@
// 存储当前产线的设备数据
this.apiData.currentLineEquipment = lineEquipment;
// 更新设备选择器的设备列表
this.devices = lineEquipment.map((device) => ({
id: device.code,
name: device.name || device.code,
}));
// 更新设备选择器的设备列表,去重
const uniqueDevices = new Map();
lineEquipment.forEach((device) => {
if (device.code && !uniqueDevices.has(device.code)) {
uniqueDevices.set(device.code, {
id: device.code,
name: device.name || device.code,
});
}
});
this.devices = Array.from(uniqueDevices.values());
console.log("更新后的设备列表:", JSON.stringify(this.devices));
......@@ -570,10 +576,12 @@
// 使用当前产线的设备编码,而不是所有设备
const deviceList = [];
// 从当前产线的设备数据中获取设备编码
// 从当前产线的设备数据中获取设备编码,去重
if (this.apiData.currentLineEquipment && this.apiData.currentLineEquipment.length > 0) {
const uniqueCodes = new Set();
this.apiData.currentLineEquipment.forEach((device) => {
if (device.code) {
if (device.code && !uniqueCodes.has(device.code)) {
uniqueCodes.add(device.code);
deviceList.push(device.code);
}
});
......
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