单风机:故障枚举
量测:故障枚举
This commit is contained in:
parent
6229b1b4c7
commit
fe312b8d06
@ -327,7 +327,7 @@ import { useRoute, useRouter } from 'vue-router'
|
||||
import Overview from './overview.vue'
|
||||
import { TableInstance } from 'element-plus'
|
||||
import { dayjs, ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { getRealTimeState, getCutDecimalsValue } from '/@/views/backend/equipment/airBlower/utils'
|
||||
import { getRealTimeState, getCutDecimalsValue, malFunctionKeys } from '/@/views/backend/equipment/airBlower/utils'
|
||||
import { sendCommandReq, sendManualCommandReq } from '/@/api/backend/control/request'
|
||||
import { getAlarmListReq } from '/@/api/backend/alarms/request'
|
||||
import { queryfaultCodeDict } from '/@/api/backend/theoreticalpowerCurve/request'
|
||||
@ -1037,7 +1037,7 @@ const createRealTimeData = async () => {
|
||||
val = enumStore.data[item.attributeCode][val]
|
||||
}
|
||||
if (malFunctionKeys.includes(item.attributeCode)) {
|
||||
val = malFunctionEnums?.[item.attributeCode] ?? val
|
||||
val = malFunctionEnums?.[val] ?? val
|
||||
}
|
||||
if (sigleDataKeys.includes(item.attributeCode.toLowerCase())) {
|
||||
realTimeDataForSingle.value[item.attributeCode.toLowerCase()] = val === '-' ? val : val
|
||||
@ -1345,29 +1345,16 @@ const getAlarmList = () => {
|
||||
})
|
||||
}
|
||||
|
||||
const malFunctionKeys = [
|
||||
'ActiveStatusCode01',
|
||||
'ActiveStatusCode02',
|
||||
'ActiveStatusCode03',
|
||||
'ActiveStatusCode04',
|
||||
'ActiveStatusCode05',
|
||||
'ActiveStatusCode06',
|
||||
'ActiveStatusCode07',
|
||||
'ActiveStatusCode08',
|
||||
'FirstTriggeredCode',
|
||||
]
|
||||
|
||||
const malFunctionEnums: any = {}
|
||||
let malFunctionEnums: any = {}
|
||||
const getMalfunctionEnums = () => {
|
||||
const curWindBlower = airBlowerList.value.find((item) => item.irn === route.query.irn)
|
||||
console.log(curWindBlower)
|
||||
|
||||
queryfaultCodeDict({ madeinfactory: curWindBlower!.madeinfactory, model: curWindBlower!.model }).then((res) => {
|
||||
if (res.code == 200) {
|
||||
const data: any = {}
|
||||
res.data.forEach((item: any) => {
|
||||
data[item.code] = item.description
|
||||
})
|
||||
malFunctionEnums = data
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -36,3 +36,15 @@ export const getEnumToValue = (key: string, value: any) => {
|
||||
return value
|
||||
}
|
||||
}
|
||||
|
||||
export const malFunctionKeys = [
|
||||
'ActiveStatusCode01',
|
||||
'ActiveStatusCode02',
|
||||
'ActiveStatusCode03',
|
||||
'ActiveStatusCode04',
|
||||
'ActiveStatusCode05',
|
||||
'ActiveStatusCode06',
|
||||
'ActiveStatusCode07',
|
||||
'ActiveStatusCode08',
|
||||
'FirstTriggeredCode',
|
||||
]
|
||||
|
@ -487,6 +487,8 @@
|
||||
:iotModelId="measureData.iotModelId"
|
||||
:autoUpdate="measureData.autoUpdate"
|
||||
:attributeType="measureData.measureType"
|
||||
:madein-factory="measureData.madeinFactory"
|
||||
:model="measureData.model"
|
||||
></MeasurementPage>
|
||||
</div>
|
||||
</el-dialog>
|
||||
@ -765,8 +767,6 @@ const modelList = ref<{ model: string; madeinFactory: string }[]>([])
|
||||
const getModelList = () => {
|
||||
theoreticalpowerCurveList().then((res) => {
|
||||
if (res.rows) {
|
||||
console.log(res)
|
||||
|
||||
modelList.value = (res.rows as any[]).map((item: any) => {
|
||||
return {
|
||||
model: item.model,
|
||||
@ -1060,16 +1060,22 @@ const measureData = reactive<{
|
||||
iotModelId: string
|
||||
autoUpdate: boolean
|
||||
measureType: ModelAttributeType
|
||||
madeinFactory:string
|
||||
model:string
|
||||
}>({
|
||||
deviceId: '',
|
||||
iotModelId: '',
|
||||
autoUpdate: false,
|
||||
measureType: 138,
|
||||
madeinFactory:'',
|
||||
model:''
|
||||
})
|
||||
const showMeasure = ref(false)
|
||||
const openMeasure = (data: any) => {
|
||||
measureData.deviceId = data.row.id
|
||||
measureData.iotModelId = data.row.iotModelId
|
||||
measureData.madeinFactory = data.row.madeinFactory
|
||||
measureData.model = data.row.model
|
||||
if (measureData.iotModelId) {
|
||||
showMeasure.value = true
|
||||
} else {
|
||||
|
@ -89,16 +89,21 @@ import { getModelAttributeListReq, getRealValueListReq } from '/@/api/backend/de
|
||||
import * as echarts from 'echarts'
|
||||
import { getRealValueRangeReq } from '/@/api/backend/deviceModel/request'
|
||||
import { useEnumStore } from '/@/stores/enums'
|
||||
import { queryfaultCodeDict } from '/@/api/backend/theoreticalpowerCurve/request'
|
||||
import { malFunctionKeys} from '/@/views/backend/equipment/airBlower/utils'
|
||||
|
||||
const enumStore = useEnumStore()
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{ iotModelId: string; deviceId: string; show: boolean; autoUpdate: boolean; attributeType: ModelAttributeType }>(),
|
||||
defineProps<{ iotModelId: string; deviceId: string; show: boolean; autoUpdate: boolean; attributeType: ModelAttributeType;model:string;madeinFactory:string }>(),
|
||||
{
|
||||
iotModelId: '',
|
||||
deviceId: '',
|
||||
show: false,
|
||||
autoUpdate: false,
|
||||
attributeType: 138,
|
||||
model:'',
|
||||
madeinFactory:''
|
||||
}
|
||||
)
|
||||
|
||||
@ -204,6 +209,20 @@ const getRealValueList = (data: { deviceId: string; attributes: string[] }, list
|
||||
})
|
||||
}
|
||||
|
||||
let malFunctionEnums: any = {}
|
||||
const getMalfunctionEnums = () => {
|
||||
queryfaultCodeDict({ madeinfactory: props.madeinFactory, model: props.model }).then((res) => {
|
||||
if (res.code == 200) {
|
||||
const data: any = {}
|
||||
res.data.forEach((item: any) => {
|
||||
data[item.code] = item.description
|
||||
})
|
||||
malFunctionEnums = data
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
const getCompleteData = () => {
|
||||
getAttributeList()
|
||||
.then(({ data, codeList }: any) => {
|
||||
@ -217,6 +236,9 @@ const getCompleteData = () => {
|
||||
if (enumStore.keys.includes(item.attributeCode)) {
|
||||
realValItem = enumStore.data[item.attributeCode][realValItem]
|
||||
}
|
||||
if(malFunctionKeys.includes(item.attributeCode)){
|
||||
realValItem = malFunctionEnums?.[realValItem] ?? realValItem
|
||||
}
|
||||
return {
|
||||
...item,
|
||||
realTimeValue: realValItem
|
||||
@ -505,6 +527,7 @@ watch(
|
||||
(newVal) => {
|
||||
if (newVal) {
|
||||
getCompleteData()
|
||||
getMalfunctionEnums()
|
||||
searchOptions.datePickerValue = shortcuts[0].value()
|
||||
} else {
|
||||
autoUpdateTimer.value && clearInterval(autoUpdateTimer.value)
|
||||
|
Loading…
Reference in New Issue
Block a user