首页修改故障

This commit is contained in:
fengrong 2024-12-19 16:23:48 +08:00
parent 75db505167
commit c0a2713124
2 changed files with 48 additions and 12 deletions

View File

@ -203,6 +203,7 @@ const StatusListData = () => {
getWindTurbineMatrixData(
{
objectType: 10002,
/*belongProject: overviewSlotData.value,*/
belongProject: '',
attributesList: [
'iwindspeed',
@ -233,9 +234,12 @@ const StatusListData = () => {
let color:any=''
const state = getRealTimeState(item.attributeMap)
let firsttriggeredcode=item.attributeMap.firsttriggeredcode
/* if (enumStore.keys.includes('FirstTriggeredCode')) {
if (enumStore.keys.includes('FirstTriggeredCode')) {
firsttriggeredcode = enumStore.data['FirstTriggeredCode'][firsttriggeredcode]
}*/
}
if (malFunctionKeys.includes('FirstTriggeredCode')) {
firsttriggeredcode = malFunctionEnums?.[firsttriggeredcode] ?? firsttriggeredcode
}
paramColorData.value.forEach((item, index) => {
if (item.state == state) {
@ -329,6 +333,7 @@ const StatusListData = () => {
belongLine: item.belongLine || '-',
standard: item.standard,
layout:paramLayoutData.value[0],
madeinFactory: item.madeinFactory || '-',
attributeMap: {
iwindspeed: item.attributeMap.iwindspeed,
igenpower: item.attributeMap.igenpower,
@ -338,7 +343,7 @@ const StatusListData = () => {
color:color,
locked: item.attributeMap.locked,
irotorspeed: item.attributeMap.irotorspeed,
firsttriggeredcode:item.attributeMap.firsttriggeredcode,
firsttriggeredcode:firsttriggeredcode,
},
}
})
@ -351,7 +356,21 @@ const StatusListData = () => {
}
})
}
let malFunctionEnums: any = {}
const getMalfunctionEnums = () => {
/*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);
}
})
}
let autoUpdateForSecondTimer: any = null
@ -386,7 +405,7 @@ onMounted(() => {
getList()
window.addEventListener('resize', sizeChange)
sizeChange()
//getAllChartData()
getMalfunctionEnums()
overviewList()
StatusListData()
autoUpdate()

View File

@ -70,8 +70,11 @@
</div>
<div class="fanlist-bottom">
<span :style="item.attributeMap.locked == 1 ? 'max-width:120px;' : 'max-width:150px;'">
{{ item.attributeMap.firsttriggeredcode }}
{{ item.attributeMap.firsttriggeredcode }}
</span>
<!-- <span :style="item.attributeMap.locked == 1 ? 'max-width:120px;' : 'max-width:150px;'">
{{ getFaultDescription(item) }}
</span>-->
<!-- <el-tag class="tag-panel is-danger">已锁定</el-tag>-->
<el-tag v-if="item.attributeMap.locked === 1" class="tag-panel is-danger">已锁定</el-tag>
</div>
@ -125,6 +128,10 @@ import { sendCommandReq, sendManualCommandReq } from '/@/api/backend/control/req
import {ElMessage, ElMessageBox} from "element-plus";
import {equipUpdate} from '/@/api/backend/index.ts'
import {queryfaultCodeDict} from "/@/api/backend/theoreticalpowerCurve/request";
import { malFunctionKeys } from '/@/views/backend/equipment/airBlower/utils'
import { useEnumStore } from '/@/stores/enums'
const enumStore = useEnumStore()
const router = useRouter()
const props = defineProps({
@ -404,20 +411,30 @@ const getSafeImagePath = (item, type) => {
return imagePath;
};
/*const getFaultDescription=(item)=>{
getMalfunctionEnums(item)
let firsttriggeredcode=item.attributeMap.firsttriggeredcode
if (malFunctionKeys.includes('FirstTriggeredCode')) {
firsttriggeredcode = malFunctionEnums?.[firsttriggeredcode] ?? firsttriggeredcode
}
return firsttriggeredcode
}*/
let malFunctionEnums: any = {}
const getMalfunctionEnums = () => {
const curWindBlower = airBlowerList.value.find((item) => item.irn === route.query.irn)
queryfaultCodeDict({ madeinfactory: curWindBlower!.madeinfactory, model: curWindBlower!.model }).then((res) => {
/*let malFunctionEnums: any = {}
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);
}
})
}
}*/
</script>
<style scoped lang="scss">