去掉注释代码
This commit is contained in:
parent
e6f1aed780
commit
9051e38eb8
@ -363,36 +363,6 @@ const StatusListData = () => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// 添加响应式属性以存储故障代码字典
|
|
||||||
/*const malFunctionEnums = ref<{ [key: string]: { [code: string]: string } }>({});
|
|
||||||
|
|
||||||
const requestedParams = new Set<string>();
|
|
||||||
const failedRequests = new Set<string>();
|
|
||||||
|
|
||||||
const fetchData = async (item: any) => {
|
|
||||||
const key = `${item.madeinFactory}-${item.model}`;
|
|
||||||
|
|
||||||
if (requestedParams.has(key)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
requestedParams.add(key);
|
|
||||||
|
|
||||||
try {
|
|
||||||
const response = await queryfaultCodeDict({ madeinfactory: item.madeinFactory, model: item.model });
|
|
||||||
if (response.code === 200) {
|
|
||||||
const data: any = {};
|
|
||||||
response.data.forEach((item: any) => {
|
|
||||||
data[item.code] = item.description;
|
|
||||||
});
|
|
||||||
malFunctionEnums.value[key] = data;
|
|
||||||
} else {
|
|
||||||
console.warn('查询故障代码字典失败:', response.message);
|
|
||||||
failedRequests.add(key);
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
failedRequests.add(key);
|
|
||||||
}
|
|
||||||
};*/
|
|
||||||
|
|
||||||
|
|
||||||
let autoUpdateForSecondTimer: any = null
|
let autoUpdateForSecondTimer: any = null
|
||||||
|
@ -411,57 +411,6 @@ const getSafeImagePath = (item, type) => {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/*const getFaultDescription=(item)=>{
|
|
||||||
const key = `${item.madeinFactory}-${item.model}`;
|
|
||||||
if (failedRequests.has(key)) {
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!malFunctionEnums[key]) {
|
|
||||||
fetchData(item); // 如果还没有请求过,则发起请求
|
|
||||||
// return item.attributeMap.firsttriggeredcode;
|
|
||||||
}
|
|
||||||
|
|
||||||
let firsttriggeredcode = item.attributeMap.firsttriggeredcode;
|
|
||||||
if (malFunctionKeys.includes('FirstTriggeredCode') && malFunctionEnums[key]) {
|
|
||||||
if(firsttriggeredcode==0){
|
|
||||||
return ''
|
|
||||||
}else{
|
|
||||||
firsttriggeredcode = malFunctionEnums[key][firsttriggeredcode] ?? '';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return firsttriggeredcode;
|
|
||||||
}
|
|
||||||
|
|
||||||
let malFunctionEnums: { [key: string]: { [code: string]: string } } = {};
|
|
||||||
const requestedParams = new Set<string>();
|
|
||||||
const failedRequests = new Set<string>();
|
|
||||||
|
|
||||||
const fetchData = async (item: any) => {
|
|
||||||
const key = `${item.madeinFactory}-${item.model}`;
|
|
||||||
|
|
||||||
if (requestedParams.has(key)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
requestedParams.add(key);
|
|
||||||
|
|
||||||
try {
|
|
||||||
const response = await queryfaultCodeDict({ madeinfactory: item.madeinFactory, model: item.model });
|
|
||||||
if (response.code === 200) {
|
|
||||||
const data: any = {};
|
|
||||||
response.data.forEach((item: any) => {
|
|
||||||
data[item.code] = item.description;
|
|
||||||
});
|
|
||||||
malFunctionEnums[key] = data;
|
|
||||||
} else {
|
|
||||||
console.warn('查询故障代码字典失败:', response.message);
|
|
||||||
failedRequests.add(key);
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
failedRequests.add(key);
|
|
||||||
}
|
|
||||||
};*/
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
Loading…
Reference in New Issue
Block a user