This commit is contained in:
高云鹏 2024-12-20 17:17:05 +08:00
commit ac1dd150a8
5 changed files with 383 additions and 206 deletions

View File

@ -128,6 +128,9 @@ public class FaultRecorderServiceImpl implements FaultRecorderService {
queryWrapper.eq("madeinfactory",madeinfactory); queryWrapper.eq("madeinfactory",madeinfactory);
queryWrapper.eq("MODEL",model); queryWrapper.eq("MODEL",model);
TheoreticalPowerCurveEntity theoreticalPowerCurveEntity = theoreticalPowerCurveMapper.selectOne(queryWrapper); TheoreticalPowerCurveEntity theoreticalPowerCurveEntity = theoreticalPowerCurveMapper.selectOne(queryWrapper);
if (theoreticalPowerCurveEntity == null) {
return Collections.emptyList();
}
QueryWrapper<SysFaultCodeDict> sysFaultCodeDictQueryWrapper = new QueryWrapper<>(); QueryWrapper<SysFaultCodeDict> sysFaultCodeDictQueryWrapper = new QueryWrapper<>();
sysFaultCodeDictQueryWrapper.eq("parent",theoreticalPowerCurveEntity.getId()); sysFaultCodeDictQueryWrapper.eq("parent",theoreticalPowerCurveEntity.getId());
sysFaultCodeDictQueryWrapper.orderByAsc("code"); sysFaultCodeDictQueryWrapper.orderByAsc("code");

View File

@ -37,10 +37,12 @@
<el-main class="mainMain"> <el-main class="mainMain">
<div class="tabsPart"> <div class="tabsPart">
<el-table :data="alarmsTableData" class="tablePart" highlight-current-row> <el-table :data="alarmsTableData" class="tablePart" highlight-current-row>
<el-table-column prop="eventTimeFormate" :label="AlarmsFieldsEnums['alarmTime']" align="center"> </el-table-column> <el-table-column prop="eventTimeFormate" :label="AlarmsFieldsEnums['alarmTime']" align="center" width="180">
<el-table-column prop="deviceName" :label="AlarmsFieldsEnums['airBlowerName']" align="center"> </el-table-column> </el-table-column>
<el-table-column prop="deviceCode" :label="AlarmsFieldsEnums['airBlowerNumber']" align="center"> </el-table-column> <el-table-column prop="deviceName" :label="AlarmsFieldsEnums['airBlowerName']" align="center" width="120"> </el-table-column>
<el-table-column prop="codeDescriptions" :label="AlarmsFieldsEnums['deflautCode']" align="center"> <el-table-column prop="deviceCode" :label="AlarmsFieldsEnums['airBlowerNumber']" align="center" width="180">
</el-table-column>
<el-table-column prop="codeDescriptions" :label="AlarmsFieldsEnums['deflautCode']" align="center" width="180">
<template #default="scope"> <template #default="scope">
<div class="tableColumnClick" @click="openDefalt(scope.row)">{{ scope.row.codeDescriptions }}</div> <div class="tableColumnClick" @click="openDefalt(scope.row)">{{ scope.row.codeDescriptions }}</div>
</template> </template>
@ -50,7 +52,7 @@
<span v-html="formatText(row.eventText)"></span> <span v-html="formatText(row.eventText)"></span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="eventLevel" :label="AlarmsFieldsEnums['alarmType']" align="center"> <el-table-column prop="eventLevel" :label="AlarmsFieldsEnums['alarmType']" align="center" width="180">
<template #default="scope"> <template #default="scope">
<div class="tip" v-if="scope.row.eventLevel === 0">提示</div> <div class="tip" v-if="scope.row.eventLevel === 0">提示</div>
<div class="alarm" v-if="scope.row.eventLevel === 1">告警</div> <div class="alarm" v-if="scope.row.eventLevel === 1">告警</div>
@ -211,13 +213,12 @@ const getalarmsList = async () => {
if (res.code == 200) { if (res.code == 200) {
paginationOptions.total = res.total paginationOptions.total = res.total
alarmsTableData.value = res.rows.map((item: any) => { alarmsTableData.value = res.rows.map((item: any) => {
const descriptions = descriptionMap.value[`${item.madeinfactory}_${item.model}`] || {} console.log('🚀 ~ alarmsTableData.value=res.rows.map ~ item:', item)
console.log('🚀 ~ alarmsTableData.value=res.rows.map ~ descriptions:', descriptions) const descriptions = descriptionMap.value[`${item.madeinFactory}_${item.model}`] || {}
return { return {
...item, ...item,
eventTimeFormate: timestampToTime(item.eventTime), eventTimeFormate: timestampToTime(item.eventTime),
codeDescriptions: descriptions['firstTriggeredCode'] || '-', codeDescriptions: descriptions[item.firstTriggeredCode] || item.firstTriggeredCode,
} }
}) })
} else { } else {
@ -426,7 +427,6 @@ $paginationHeight: 32px;
height: calc(100% - $paginationHeight); height: calc(100% - $paginationHeight);
padding-bottom: 5px; padding-bottom: 5px;
.tableColumnClick { .tableColumnClick {
text-decoration: underline;
color: #00a4ff; color: #00a4ff;
cursor: pointer; cursor: pointer;
} }

View File

@ -23,14 +23,14 @@
<div class="small-base">实时无功:<span>{{ realData.attributeMap.windfarmreactivepower}}kVar</span></div> <div class="small-base">实时无功:<span>{{ realData.attributeMap.windfarmreactivepower}}kVar</span></div>
<div class="small-base">日发电量:<span>{{ realData.attributeMap.windfarmdayprodenergy}}万kWh</span></div> <div class="small-base">日发电量:<span>{{ realData.attributeMap.windfarmdayprodenergy}}万kWh</span></div>
<div class="small-base">月发电量:<span>{{ realData.attributeMap.windfarmmonthprodenergy}}万kWh</span></div> <div class="small-base">月发电量:<span>{{ realData.attributeMap.windfarmmonthprodenergy}}万kWh</span></div>
<div class="small-base">年发电量:<span>{{ realData.attributeMap.windfarmyearprodenergy}}万kWh</span></div> <div style="padding: 0;" class="small-base">年发电量:<span>{{ realData.attributeMap.windfarmyearprodenergy}}万kWh</span></div>
</div> </div>
<div class="overviewItem" style="border: none;"> <div class="overviewItem" style="border: none;">
<div class="small-base">并网:<span>{{ realData.attributeMap.turbinecountpowerprod}}</span></div> <div class="small-base"><i class="powerprod"></i>并网:<span>{{ realData.attributeMap.turbinecountpowerprod}}</span></div>
<div class="small-base">停机/待机:<span>{{ realData.attributeMap.turbinecountidle}}</span></div> <div class="small-base"><i class="idle"></i>停机/待机:<span>{{ realData.attributeMap.turbinecountidle}}</span></div>
<div class="small-base">故障:<span>{{ realData.attributeMap.turbinecountfaulted}}</span></div> <div class="small-base"><i class="faulted"></i>故障:<span>{{ realData.attributeMap.turbinecountfaulted}}</span></div>
<div class="small-base">维护:<span>{{ realData.attributeMap.turbinecountservice}}</span></div> <div class="small-base"><i class="service"></i>维护:<span>{{ realData.attributeMap.turbinecountservice}}</span></div>
<div style="padding: 0;" class="small-base">无通讯:<span>{{ realData.attributeMap.turbinecountdisconnected}}</span></div> <div style="padding: 0;" class="small-base"><i class="disconnected"></i>无通讯:<span>{{ realData.attributeMap.turbinecountdisconnected}}</span></div>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
@ -359,23 +359,6 @@ const StatusListData = () => {
}) })
} }
let malFunctionEnums: any = {} let malFunctionEnums: any = {}
/*const getMalfunctionEnums = () => {
windList.value.forEach((item)=> {
console.log({madeinfactory: item.madeinfactory, model: item.model })
queryfaultCodeDict({madeinfactory: item.madeinfactory, model: item.model }).then((res) => {
if (res.code == 200) {
const data: any = {}
res.data.forEach((item: any) => {
data[item.code] = item.description
})
malFunctionEnums = data
} else {
console.warn('查询故障代码字典失败:', res.message);
}
})
})
}*/
/*const requestedParams = new Set<string>(); /*const requestedParams = new Set<string>();
@ -535,40 +518,69 @@ $labelHeight: 30px;
height: v-bind('computedHeight.centerHeight'); height: v-bind('computedHeight.centerHeight');
margin-bottom: 0; margin-bottom: 0;
.el-scrollbar { .el-scrollbar {
height: calc(100% - 20px); height: calc(100% - 50px);
} }
.homeHeader{ .homeHeader{
display: flex; display: flex;
justify-content: space-between; justify-content: flex-start;
/*justify-content: space-between;*/
.cardLabel{ .cardLabel{
margin-right: 10px; margin-right: 10px;
white-space: nowrap; white-space: nowrap;
display: flex;
justify-content: center;
align-items: center;
vertical-align: middle
} }
.cardBtn{ .cardBtn{
white-space: nowrap; white-space: nowrap;
:deep(.el-radio-group){ :deep(.el-radio-group){
flex-wrap: nowrap; flex-wrap: nowrap;
} }
:deep(.el-radio){ :deep(.el-radio){
margin-right: 12px; margin-right: 10px;
} }
} }
.headerRight{ .headerRight{
width: 100%; /*width: 100%;*/
margin-left: auto;
text-align: right;
display: flex; display: flex;
background: #F0F6FF; background: #F0F6FF;
border-radius: 8px; border-radius: 8px;
line-height: 30px; line-height: 30px;
padding: 0 10px; padding: 0 10px;
.overviewItem{ .overviewItem{
display: inline-block;
.small-base{ .small-base{
display: inline-block; display: inline-block;
padding-right: 8px; padding-right: 15px;
color: #4E5969; color: #4E5969;
i{
width: 10px;
height: 10px;
aspect-ratio: 1 / 1;
border-radius: 50%;
display: inline-block;
margin-right: 5px;
}
.powerprod{
background-color: #0277B3;
}
.idle{
background-color: #FFB600;
}
.faulted{
background-color: #FE3731;
}
.service{
background-color: #00A096;
}
.disconnected{
background-color: #999999;
}
span{ span{
color: #000000; color: #000000;
font-weight: 600;
} }
} }
} }

View File

@ -1,10 +1,11 @@
<template> <template>
<div class="FanList-content"> <div class="FanList-content">
<el-row :gutter="10"> <!-- <el-row :gutter="10">
<el-col :xs="12" :sm="8" :md="8" :lg="4" :xl="3" v-for="item in props.parentData" style="margin-bottom: 5px"> <el-col :xs="12" :sm="8" :md="8" :lg="4" :xl="3" v-for="item in props.parentData" style="margin-bottom: 5px">-->
<div class="grid-content ep-bg-purple" <div class="overviewPart" v-for="item in props.parentData">
@click="handleClick(item)" <div class="grid-content"
@contextmenu.prevent="windContextMenu($event,item)" @click="handleClick(item)"
@contextmenu.prevent="windContextMenu($event,item)"
> >
<div class="FanList-panel wind-default" :class="{ <div class="FanList-panel wind-default" :class="{
'': item.standard==1, '': item.standard==1,
@ -37,9 +38,40 @@
>通讯中断</el-tag> >通讯中断</el-tag>
</div> </div>
<div class="fanlist-main"> <div class="fanlist-main">
<WindContentleft :item="item" v-if="item.layout==='风格1'"></WindContentleft> <el-row>
<WindContentright :item="item" v-else-if="item.layout==='风格2'"></WindContentright> <el-col :span="24">
<WindContentcenter :item="item" v-else-if="item.layout==='风格3'"></WindContentcenter> <div class="fanlist-pic">
<div class="mask">
<div class="heart"><img :src="getSafeImagePath(item, 'heart')" alt="" /></div>
<div class="leafs" :style="getAnimationStyle(item)">
<div class="leaf_1"><img :src="getSafeImagePath(item, 'leaf')" alt="" /></div>
<div class="leaf_2"><img :src="getSafeImagePath(item, 'leaf')" alt="" /></div>
<div class="leaf_3"><img :src="getSafeImagePath(item, 'leaf')" alt="" /></div>
</div>
</div>
</div>
<div class="fanlist-pic">
<img :src="getSafeImagePath(item, 'fan')" alt="" />
</div>
<!-- <div class="fanlist-pic" style="margin: 0;">
<img src="~assets/dashboard/fannew/base.png" alt="" />
</div>-->
</el-col>
</el-row>
<el-row class="fanlist-data">
<div class="fanlist-text">
<span class="content-number">{{ item.attributeMap.iwindspeed }}</span>
<span>m/s</span>
</div>
<div class="fanlist-text">
<span class="content-number">{{ item.attributeMap.igenpower }}</span>
<span>kW</span>
</div>
<div class="fanlist-text">
<span class="content-number">{{ item.attributeMap.ikwhthisday }}</span>
<span>kWh</span>
</div>
</el-row>
</div> </div>
<div class="fanlist-bottom"> <div class="fanlist-bottom">
<!-- <el-tag class="tag-panel is-danger">已锁定</el-tag>--> <!-- <el-tag class="tag-panel is-danger">已锁定</el-tag>-->
@ -48,8 +80,9 @@
</div> </div>
</div> </div>
</el-col> </div>
</el-row> <!-- </el-col>
</el-row>-->
<ContextMenu :pos="contextMenuPos" v-model:visible="OperateVisible"> <ContextMenu :pos="contextMenuPos" v-model:visible="OperateVisible">
<template #default> <template #default>
@ -105,6 +138,31 @@ const props = defineProps({
default: () => [], default: () => [],
}, },
}) })
const getAnimationStyle = (item) => {
const irotorspeed = item.attributeMap?.irotorspeed ?? 0
let animationDuration;
animationDuration = 60 / irotorspeed / 3
const processedoperationmode = item.attributeMap?.processedoperationmode ?? 0
if(processedoperationmode==33){
return {
'animation-duration': `0s`,
'animation-timing-function': 'linear',
'animation-iteration-count': 'infinite',
'animation-direction': 'normaL',
}
}else{
return {
'animation-duration': `${animationDuration}s`,
'animation-timing-function': 'linear',
'animation-iteration-count': 'infinite',
'animation-direction': 'normaL',
}
}
}
const handleClick = (row) => { const handleClick = (row) => {
if (!router.hasRoute('windTurbine')) { if (!router.hasRoute('windTurbine')) {
router.addRoute('admin', { router.addRoute('admin', {
@ -264,6 +322,92 @@ const hexToRgba = (hex, alpha) => {
} }
return `rgba(${r}, ${g}, ${b}, ${alpha})`; return `rgba(${r}, ${g}, ${b}, ${alpha})`;
} }
const imagePathMap = {
'#9C27B0': {
heart: 'heart1.png',
leaf: 'leaf1.png',
fan: 'fan1.png',
},
'#673AB7': {
heart: 'heart2.png',
leaf: 'leaf2.png',
fan: 'fan2.png',
},
'#3F51B5': {
heart: 'heart3.png',
leaf: 'leaf3.png',
fan: 'fan3.png',
},
'#3059EC': {
heart: 'heart4.png',
leaf: 'leaf4.png',
fan: 'fan4.png',
},
'#0277B3': {
heart: 'heart5.png',
leaf: 'leaf5.png',
fan: 'fan5.png',
},
'#00A096': {
heart: 'heart6.png',
leaf: 'leaf6.png',
fan: 'fan6.png',
},
'#06B429': {
heart: 'heart7.png',
leaf: 'leaf7.png',
fan: 'fan7.png',
},
'#64DD17': {
heart: 'heart8.png',
leaf: 'leaf8.png',
fan: 'fan8.png',
},
'#EEFF41': {
heart: 'heart9.png',
leaf: 'leaf9.png',
fan: 'fan9.png',
},
'#FFB600': {
heart: 'heart10.png',
leaf: 'leaf10.png',
fan: 'fan10.png',
},
'#FF7E00': {
heart: 'heart11.png',
leaf: 'leaf11.png',
fan: 'fan11.png',
},
'#FE3731': {
heart: 'heart12.png',
leaf: 'leaf12.png',
fan: 'fan12.png',
},
'#999999': {
heart: 'heart13.png',
leaf: 'leaf13.png',
fan: 'fan13.png',
}
};
const getImagePath = (item, type) => {
const color = item.attributeMap.color;
return imagePathMap[color]?.[type];
};
const getSafeImagePath = (item, type) => {
const path = getImagePath(item, type);
if (!getSafeImagePath.cache) {
getSafeImagePath.cache = {};
}
if (getSafeImagePath.cache[path]) {
return getSafeImagePath.cache[path];
}
const imagePath = new URL(`/src/assets/dashboard/fan/${path}`, import.meta.url).href;
getSafeImagePath.cache[path] = imagePath;
return imagePath;
};
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
@ -312,146 +456,157 @@ const hexToRgba = (hex, alpha) => {
} }
.FanList-content { .FanList-content {
overflow-x: hidden; overflow-x: hidden;
.FanList-panel { display: grid;
border-radius: 8px; justify-content: space-between;
cursor: pointer; grid-template-columns: repeat(auto-fill, 170px);
.fanlist-top { .overviewPart{
display: flex; display: flex;
width: 100%; box-sizing: border-box;
} width: 170px;
.fanlist-icon { height: 140px;
display: flex; margin-top: 8px;
justify-content: center; margin-bottom: 8px;
align-items: center; .FanList-panel {
width: 40px; border-radius: 8px;
height: 30px; cursor: pointer;
vertical-align: middle; .fanlist-top {
} display: flex;
.fanlist-name { width: 100%;
width: 100%; }
margin-top: 5px; .fanlist-icon {
}
.tag-panel {
border-radius: 0 8px 0 0;
line-height: 20px;
}
.is-primary {
background: rgba(2, 119, 179, 0.2);
border: 1px solid #0277b3;
color: #0277b3;
}
.is-success {
background: rgba(6, 180, 41, 0.2);
border: 1px solid #06b429;
color: #06b429;
}
.is-info {
background: rgba(48, 89, 236, 0.2);
border: 1px solid #3059ec;
color: #3059ec;
}
.is-warning {
background: rgba(255, 126, 0, 0.2);
border: 1px solid #ff7e00;
color: #ff7e00;
}
.is-danger {
background: rgba(254, 55, 49, 0.2);
border: 1px solid #fe3731;
color: #fe3731;
}
.is-offline {
background: rgba(153, 153, 153, 0.2);
border: 1px solid #999999;
color: #999999;
}
.is-maintenance {
background: rgba(0, 160, 150, 0.2);
border: 1px solid #00a096;
color: #00a096;
}
.fanlist-main {
width: 100%;
display: flex;
justify-content: space-between;
padding: 5px 10px 0 10px;
text-align: center;
.fanlist-pic {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
margin-top: -10px; width: 40px;
.mask { height: 30px;
width: 43px; vertical-align: middle;
height: 38px;
.heart {
position: absolute;
text-align: center;
top: 5px;
left: 17px;
/* z-index: 3;*/
}
.leafs {
/* z-index: 1;*/
position: absolute;
/* animation: leafRotate 1s infinite linear;*/
transform-origin: center center;
width: 44px;
height: 46px;
/*animation-duration: 1s;*/
animation-name: leafRotate;
/*animation-iteration-count: infinite;
animation-timing-function: linear;*/
.leaf_1 {
width: 9px;
height: 19px;
position: absolute;
left: 17px;
top: -1px;
/* transform-origin: left top;*/
}
.leaf_2 {
width: 9px;
height: 19px;
position: absolute;
left: 31px;
top: 20px;
/* transform-origin: left top;*/
transform: rotate(120deg);
}
.leaf_3 {
width: 9px;
height: 19px;
position: absolute;
left: 5px;
top: 22px;
/*transform-origin: left top;*/
transform: rotate(240deg);
}
}
}
} }
.fanlist-text { .fanlist-name {
margin-top: 5px;
width: 100%; width: 100%;
text-align: right; margin-top: 5px;
.content-number { }
color: #333333; .tag-panel {
font-size: 20px; border-radius: 0 8px 0 0;
padding-right: 5px; line-height: 20px;
}
.is-primary {
background: rgba(2, 119, 179, 0.2);
border: 1px solid #0277b3;
color: #0277b3;
}
.is-success {
background: rgba(6, 180, 41, 0.2);
border: 1px solid #06b429;
color: #06b429;
}
.is-info {
background: rgba(48, 89, 236, 0.2);
border: 1px solid #3059ec;
color: #3059ec;
}
.is-warning {
background: rgba(255, 126, 0, 0.2);
border: 1px solid #ff7e00;
color: #ff7e00;
}
.is-danger {
background: rgba(254, 55, 49, 0.2);
border: 1px solid #fe3731;
color: #fe3731;
}
.is-offline {
background: rgba(153, 153, 153, 0.2);
border: 1px solid #999999;
color: #999999;
}
.is-maintenance {
background: rgba(0, 160, 150, 0.2);
border: 1px solid #00a096;
color: #00a096;
}
.fanlist-main {
width: 100%;
display: flex;
justify-content: space-between;
padding: 5px 10px 0 10px;
text-align: center;
.fanlist-pic {
display: flex;
justify-content: center;
align-items: center;
margin-top: -10px;
.mask {
width: 43px;
height: 38px;
.heart {
position: absolute;
text-align: center;
top: 5px;
left: 17px;
/* z-index: 3;*/
}
.leafs {
/* z-index: 1;*/
position: absolute;
/* animation: leafRotate 1s infinite linear;*/
transform-origin: center center;
width: 44px;
height: 46px;
/*animation-duration: 1s;*/
animation-name: leafRotate;
/*animation-iteration-count: infinite;
animation-timing-function: linear;*/
.leaf_1 {
width: 9px;
height: 19px;
position: absolute;
left: 17px;
top: -1px;
/* transform-origin: left top;*/
}
.leaf_2 {
width: 9px;
height: 19px;
position: absolute;
left: 31px;
top: 20px;
/* transform-origin: left top;*/
transform: rotate(120deg);
}
.leaf_3 {
width: 9px;
height: 19px;
position: absolute;
left: 5px;
top: 22px;
/*transform-origin: left top;*/
transform: rotate(240deg);
}
}
}
}
.fanlist-text {
margin-top: 5px;
width: 100%;
text-align: right;
.content-number {
color: #333333;
font-size: 20px;
padding-right: 5px;
}
}
.fanlist-text span {
display: inline-block;
} }
} }
.fanlist-text span { .fanlist-bottom {
display: inline-block; display: flex;
} justify-content: end;
} height: 24px;
.fanlist-bottom { .tag-panel {
display: flex; border-radius: 0 0 8px 0;
justify-content: end; line-height: 20px;
height: 24px; }
.tag-panel {
border-radius: 0 0 8px 0;
line-height: 20px;
} }
} }
} }

View File

@ -411,59 +411,66 @@ const getSafeImagePath = (item, type) => {
return imagePath; return imagePath;
}; };
const getFaultDescription=(item)=>{ const getFaultDescription=(item)=>{
//getMalfunctionEnums(item) /*fetchData(item)
fetchData(item)
let firsttriggeredcode=item.attributeMap.firsttriggeredcode let firsttriggeredcode=item.attributeMap.firsttriggeredcode
if (malFunctionKeys.includes('FirstTriggeredCode')) { if (malFunctionKeys.includes('FirstTriggeredCode')) {
firsttriggeredcode = malFunctionEnums?.[firsttriggeredcode] ?? firsttriggeredcode firsttriggeredcode = malFunctionEnums?.[firsttriggeredcode] ?? firsttriggeredcode
} }
return firsttriggeredcode return firsttriggeredcode*/
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: any = {} let malFunctionEnums: { [key: string]: { [code: string]: string } } = {};
/*const getMalfunctionEnums = (item) => {
/!*queryfaultCodeDict({ madeinfactory: item!.madeinFactory, model: item!.model }).then((res) => {*!/
queryfaultCodeDict({ madeinfactory: '广东明阳风电', model: 'MY1.5/89' }).then((res) => {
if (res.code == 200) {
const data: any = {}
res.data.forEach((item: any) => {
data[item.code] = item.description
})
malFunctionEnums = data
} else {
console.warn('查询故障代码字典失败:', res.message);
}
})
}*/
const requestedParams = new Set<string>(); const requestedParams = new Set<string>();
const failedRequests = new Set<string>();
const fetchData = async (item: any) => { const fetchData = async (item: any) => {
const key = `${item.madeinFactory}-${item.model}`; const key = `${item.madeinFactory}-${item.model}`;
if (requestedParams.has(key)) { if (requestedParams.has(key)) {
console.log('Duplicate request detected, skipping...');
return; return;
} }
requestedParams.add(key); requestedParams.add(key);
try { try {
malFunctionEnums={}
const response = await queryfaultCodeDict({ madeinfactory: item.madeinFactory, model: item.model }); const response = await queryfaultCodeDict({ madeinfactory: item.madeinFactory, model: item.model });
if (response.code === 200) { if (response.code === 200) {
const data: any = {}; const data: any = {};
response.data.forEach((item: any) => { response.data.forEach((item: any) => {
data[item.code] = item.description; data[item.code] = item.description;
}); });
malFunctionEnums = data; //malFunctionEnums = data;
malFunctionEnums[key] = data;
} else { } else {
console.warn('查询故障代码字典失败:', response.message); console.warn('查询故障代码字典失败:', response.message);
failedRequests.add(key);
} }
} catch (error) { } catch (error) {
console.error('请求出错:', error); //console.error('', error);
failedRequests.add(key);
} }
}; };
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">