故障码字典
This commit is contained in:
parent
0bb6eb8a58
commit
1c02c50481
@ -136,3 +136,38 @@ export function queryplcDesc(params: object = {}) {
|
||||
data: params,
|
||||
})
|
||||
}
|
||||
|
||||
export const importfaultCodeDict = (data: FormData, v: string) => {
|
||||
const token = encrypt_aes(adminInfo.token, v)
|
||||
return createAxios(
|
||||
{
|
||||
url: '/api/fdr/faultCodeDict/import',
|
||||
method: 'POST',
|
||||
data: data,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data',
|
||||
v,
|
||||
token,
|
||||
},
|
||||
},
|
||||
{ customEncrypt: true }
|
||||
)
|
||||
}
|
||||
|
||||
// 导出
|
||||
export function exportfaultCodeDict(params: object = {}) {
|
||||
return createAxios({
|
||||
url: '/api/fdr/faultCodeDict/export',
|
||||
method: 'POST',
|
||||
data: params,
|
||||
responseType: 'blob',
|
||||
})
|
||||
}
|
||||
|
||||
export function queryfaultCodeDict(params: object = {}) {
|
||||
return createAxios({
|
||||
url: '/api/fdr/faultCodeDict/query',
|
||||
method: 'POST',
|
||||
data: params,
|
||||
})
|
||||
}
|
||||
|
@ -67,6 +67,8 @@ import { queryWindTurbinesPages, historyReq, powerCurveExport } from '/@/api/bac
|
||||
import { theoreticalpowerCurveList, powerCurveQuery } from '/@/api/backend/theoreticalpowerCurve/request'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import * as echarts from 'echarts'
|
||||
import { getCutDecimalsValue } from '/@/views/backend/equipment/airBlower/utils'
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
const statAnalysisFatory = ref('')
|
||||
@ -327,11 +329,12 @@ const statAnalysisOperate = () => {
|
||||
ElMessage.info(`实时值数据为空`)
|
||||
} else {
|
||||
const seriesData = iGenPower.map((item: any, index: number) => {
|
||||
return [iWindSpeed[index], item]
|
||||
return [getCutDecimalsValue(iWindSpeed[index], 2), getCutDecimalsValue(item, 2)]
|
||||
})
|
||||
seriesData.sort((a: any, b: any) => {
|
||||
return a[0] - b[0]
|
||||
})
|
||||
|
||||
const series = {
|
||||
type: 'line',
|
||||
data: seriesData,
|
||||
@ -345,7 +348,7 @@ const statAnalysisOperate = () => {
|
||||
}
|
||||
if (resData1.length) {
|
||||
const seriesData = resData1.map((item: any) => {
|
||||
return [item.speed, item.power]
|
||||
return [getCutDecimalsValue(item.speed, 2), getCutDecimalsValue(item.power, 2)]
|
||||
})
|
||||
const series = {
|
||||
type: 'line',
|
||||
|
@ -104,6 +104,7 @@ import { ElMessage } from 'element-plus'
|
||||
import { DArrowRight, Plus, Delete, Close } from '@element-plus/icons-vue'
|
||||
import MeasurementPage from './analysisAttributes.vue'
|
||||
import { getModelAttributeListReq } from '/@/api/backend/deviceModel/request'
|
||||
import { getCutDecimalsValue } from '/@/views/backend/equipment/airBlower/utils'
|
||||
|
||||
import * as echarts from 'echarts'
|
||||
const { t } = useI18n()
|
||||
@ -502,7 +503,7 @@ const historyDataReq = (promises: any) => {
|
||||
.map((item: any) => {
|
||||
const matchData = xDatas.filter((x: any) => x.series == item.seriesName)
|
||||
const x = timestampToTime(matchData[0]['data'][item.dataIndex])
|
||||
return `${item.marker}${item.seriesName} (${x}): ${item.data}${statAnalysisSelect.unit}`
|
||||
return `${item.marker}${item.seriesName} (${x}): ${item.data.value}${statAnalysisSelect.unit}`
|
||||
})
|
||||
.join('<br/>')
|
||||
},
|
||||
@ -511,7 +512,9 @@ const historyDataReq = (promises: any) => {
|
||||
const seriesData = {
|
||||
name: customName[index],
|
||||
type: 'line',
|
||||
data: yData,
|
||||
data: yData.map((value: any) => ({
|
||||
value: getCutDecimalsValue(value, 2),
|
||||
})),
|
||||
showSymbol: true,
|
||||
animation: false,
|
||||
}
|
||||
|
@ -122,6 +122,7 @@ import { ElMessage, ElMenu } from 'element-plus'
|
||||
import { DArrowRight, Plus, Crop, Close } from '@element-plus/icons-vue'
|
||||
import * as echarts from 'echarts'
|
||||
import { getModelAttributeListReq } from '/@/api/backend/deviceModel/request'
|
||||
import { getCutDecimalsValue } from '/@/views/backend/equipment/airBlower/utils'
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
@ -216,7 +217,12 @@ const queryWindTurbines = () => {
|
||||
queryWindTurbinesPages()
|
||||
.then((res) => {
|
||||
if (res.code == 200) {
|
||||
const resData = res.data
|
||||
const resData = res.data.map((item: any, index: any) => {
|
||||
return {
|
||||
index: index,
|
||||
...item,
|
||||
}
|
||||
})
|
||||
if (resData.length) {
|
||||
iotModelId.value = resData[0]['modelId']
|
||||
const middleIndex = Math.ceil(resData.length / 2)
|
||||
@ -399,7 +405,6 @@ function generateDeviceAttributes(devices: any, attributes: any) {
|
||||
|
||||
const statAnalysisOperate = () => {
|
||||
const allDevices = [...selectedLeft.value, ...selectedRight.value]
|
||||
console.log('🚀 ~ statAnalysisOperate ~ selectedRight.value:', selectedRight.value)
|
||||
if (!statAnalysisTime.value) {
|
||||
ElMessage.info('请选择查询时间!')
|
||||
return
|
||||
@ -420,6 +425,9 @@ const statAnalysisOperate = () => {
|
||||
}
|
||||
const calculate: any = ref([{ max: '', min: '', average: '' }])
|
||||
const historyDataReq = (data: any) => {
|
||||
const selectAllDevices = [...selectedLeft.value, ...selectedRight.value].sort((a: any, b: any) => {
|
||||
return a.index - b.index
|
||||
})
|
||||
historyReq(data)
|
||||
.then((res) => {
|
||||
isLoading.value = false
|
||||
@ -427,14 +435,17 @@ const historyDataReq = (data: any) => {
|
||||
const resData = res.data
|
||||
const deviceIdKeys = Object.keys(resData)
|
||||
if (deviceIdKeys.length) {
|
||||
deviceIdKeys.forEach((item) => {
|
||||
const deviceRow = [...selectedLeft.value, ...selectedRight.value].filter((value: any) => value.irn === item)
|
||||
const deviceName = deviceRow[0]['name']
|
||||
Object.keys(resData[item]).forEach((val) => {
|
||||
selectAllDevices.forEach((item: any) => {
|
||||
if (!resData[item.irn]) {
|
||||
ElMessage.info(`${item.name}没有数据`)
|
||||
return
|
||||
}
|
||||
const deviceName = item.name
|
||||
Object.keys(resData[item.irn]).forEach((val) => {
|
||||
const attRow = multipleSelection.value.filter((value: any) => value.attributeCode === val)
|
||||
const attName = attRow[0]['attributeName']
|
||||
const unit = attRow[0]['unit']
|
||||
const historyData = resData[item][val]
|
||||
const historyData = resData[item.irn][val]
|
||||
const xData = historyData['times']
|
||||
const yData = historyData['values']
|
||||
if (!yData.length) {
|
||||
@ -445,7 +456,7 @@ const historyDataReq = (data: any) => {
|
||||
name: deviceName + attName,
|
||||
type: 'line',
|
||||
data: yData.map((value: any) => ({
|
||||
value: value,
|
||||
value: getCutDecimalsValue(value, 2),
|
||||
unit: unit, // 将单位添加到每个数据点
|
||||
})),
|
||||
animation: false,
|
||||
|
@ -35,20 +35,57 @@
|
||||
></el-pagination>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card class="box-card2">
|
||||
<div class="mainHeader">
|
||||
<el-text class="mx-1 title">理论功率曲线</el-text>
|
||||
<div class="right">
|
||||
<el-upload :show-file-list="false" :http-request="update">
|
||||
<template #trigger>
|
||||
<el-button :icon="Refresh" type="primary">更新</el-button>
|
||||
</template>
|
||||
</el-upload>
|
||||
<el-button :icon="Download" type="primary" @click="download">下载</el-button>
|
||||
<div class="bottom">
|
||||
<el-card class="box-card2 bottom-left">
|
||||
<div class="mainHeader">
|
||||
<el-text class="mx-1 title">理论功率曲线</el-text>
|
||||
<div class="right">
|
||||
<el-upload :show-file-list="false" :http-request="update">
|
||||
<template #trigger>
|
||||
<el-button :icon="Refresh" type="primary">更新</el-button>
|
||||
</template>
|
||||
</el-upload>
|
||||
<el-button :icon="Download" type="primary" @click="download">下载</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div ref="chartContainer" class="chartContainer"></div>
|
||||
</el-card>
|
||||
<div ref="chartContainer" class="chartContainer"></div>
|
||||
</el-card>
|
||||
<el-card class="box-card3">
|
||||
<div>
|
||||
<div class="mainHeader">
|
||||
<el-text class="mx-1 title">故障码字典</el-text>
|
||||
<div class="right">
|
||||
<el-upload :show-file-list="false" :http-request="update3">
|
||||
<template #trigger>
|
||||
<el-button :icon="Refresh" type="primary">更新</el-button>
|
||||
</template>
|
||||
</el-upload>
|
||||
<el-button :icon="Download" type="primary" @click="download3">下载</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tabsPart">
|
||||
<el-table :data="faultCodeDictpageData" class="tablePart">
|
||||
<el-table-column prop="variable" label="编码" align="center"> </el-table-column>
|
||||
<el-table-column prop="description" label="描述" align="center"> </el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="mainFooter">
|
||||
<el-pagination
|
||||
v-model:current-page="paginationOptions3.current"
|
||||
v-model:page-size="paginationOptions3.pageSize"
|
||||
:total="paginationOptions3.total"
|
||||
:page-sizes="paginationOptions3.pageSizes"
|
||||
background
|
||||
:pager-count="5"
|
||||
layout="prev, pager, next"
|
||||
@size-change="handleSizeChange3"
|
||||
@current-change="handleCurrentChange3"
|
||||
></el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
|
||||
<div class="bottom">
|
||||
<el-card class="box-card3 bottom-left">
|
||||
<div>
|
||||
@ -180,6 +217,9 @@ import {
|
||||
exportplcData,
|
||||
queryFdrDesc,
|
||||
queryplcDesc,
|
||||
importfaultCodeDict,
|
||||
exportfaultCodeDict,
|
||||
queryfaultCodeDict,
|
||||
} from '/@/api/backend/theoreticalpowerCurve/request'
|
||||
import * as echarts from 'echarts'
|
||||
// 导入
|
||||
@ -292,6 +332,42 @@ const download2 = () => {
|
||||
})
|
||||
}
|
||||
|
||||
// 导入
|
||||
const update3 = (file: any) => {
|
||||
const formData = new FormData()
|
||||
formData.append('file', file.file)
|
||||
const v = generateRandomNumber(16)
|
||||
const id = encrypt_aes(currentRow.value.id, v)
|
||||
formData.append('id', id)
|
||||
return importfaultCodeDict(formData, v)
|
||||
.then((res: any) => {
|
||||
if (res.success) {
|
||||
ElMessage.success('更新成功')
|
||||
getRunLog()
|
||||
} else {
|
||||
ElMessage.error(res.msg)
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
ElMessage.error(err?.response?.data?.msg ?? '更新失败')
|
||||
})
|
||||
}
|
||||
|
||||
// 导出
|
||||
const download3 = () => {
|
||||
console.log(currentRow)
|
||||
exportfaultCodeDict({ id: currentRow.value.id }).then((res: any) => {
|
||||
const downloadUrl = window.URL.createObjectURL(res)
|
||||
const a = document.createElement('a')
|
||||
a.href = downloadUrl
|
||||
a.download = '故障码字典' + new Date().getTime()
|
||||
document.body.appendChild(a)
|
||||
a.click()
|
||||
window.URL.revokeObjectURL(downloadUrl)
|
||||
document.body.removeChild(a)
|
||||
})
|
||||
}
|
||||
|
||||
const rowClassName = ({ row, rowIndex }: any) => {
|
||||
if (currentRow.value === row) {
|
||||
return 'current-row'
|
||||
@ -339,10 +415,6 @@ const option: any = reactive({
|
||||
},
|
||||
},
|
||||
series: [],
|
||||
grid: {
|
||||
left: '3%',
|
||||
right: '3%',
|
||||
},
|
||||
})
|
||||
const chart: any = ref(null)
|
||||
const chartContainer = ref<HTMLElement | null>(null)
|
||||
@ -457,6 +529,8 @@ const faultRecordingData: any = ref([])
|
||||
const faultRecordingpageData: any = ref([])
|
||||
const runLogData: any = ref([])
|
||||
const runLogpageData: any = ref([])
|
||||
const faultCodeDictData: any = ref([])
|
||||
const faultCodeDictpageData: any = ref([])
|
||||
|
||||
const handleSizeChange1 = (val: any) => {
|
||||
paginationOptions1.pageSize = val
|
||||
@ -483,6 +557,20 @@ const handleCurrentChange2 = (val: any) => {
|
||||
const end = start + paginationOptions2.pageSize
|
||||
runLogpageData.value = runLogData.value.slice(start, end)
|
||||
}
|
||||
|
||||
const handleSizeChange3 = (val: any) => {
|
||||
paginationOptions3.pageSize = val
|
||||
paginationOptions3.current = 1
|
||||
runLogpageData.value = runLogData.value.slice(0, paginationOptions1.pageSize)
|
||||
}
|
||||
// 当前页改变时触发
|
||||
const handleCurrentChange3 = (val: any) => {
|
||||
paginationOptions3.current = val
|
||||
const start = (paginationOptions3.current - 1) * paginationOptions3.pageSize
|
||||
const end = start + paginationOptions3.pageSize
|
||||
runLogpageData.value = runLogData.value.slice(start, end)
|
||||
}
|
||||
|
||||
const getList = () => {
|
||||
const transparams = searchParams()
|
||||
theoreticalpowerCurveList(transparams)
|
||||
@ -498,6 +586,7 @@ const getList = () => {
|
||||
getpowerCurve()
|
||||
getFaultRecording()
|
||||
getRunLog()
|
||||
getfaultCodeDict()
|
||||
} else {
|
||||
ElMessage.error(res.msg ?? '查询失败')
|
||||
}
|
||||
@ -574,6 +663,19 @@ const getRunLog = () => {
|
||||
})
|
||||
}
|
||||
|
||||
const getfaultCodeDict = () => {
|
||||
currentRow.value = currentRow.value ?? theoreticalTableData.value[0]
|
||||
queryfaultCodeDict({ madeinfactory: currentRow.value.madeinfactory, model: currentRow.value.model }).then((res) => {
|
||||
if (res.code == 200) {
|
||||
faultCodeDictData.value = [...res.data]
|
||||
paginationOptions3.total = faultCodeDictData.value.length
|
||||
faultCodeDictpageData.value = faultCodeDictData.value.slice(0, paginationOptions3.pageSize)
|
||||
} else {
|
||||
ElMessage.warning('查询失败')
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const paginationOptions = reactive({
|
||||
current: 1,
|
||||
pageSize: 5,
|
||||
@ -592,6 +694,13 @@ const paginationOptions2 = reactive({
|
||||
total: 0,
|
||||
pageSizes: [5, 50, 100],
|
||||
})
|
||||
|
||||
const paginationOptions3 = reactive({
|
||||
current: 1,
|
||||
pageSize: 5,
|
||||
total: 0,
|
||||
pageSizes: [5, 50, 100],
|
||||
})
|
||||
const getcurrentPage = () => {
|
||||
getList()
|
||||
}
|
||||
@ -694,7 +803,7 @@ $paginationHeight: 32px;
|
||||
}
|
||||
|
||||
.chartContainer {
|
||||
width: 100%;
|
||||
width: 50%;
|
||||
height: 240px;
|
||||
border: 1px solid rgb(217, 217, 217);
|
||||
margin-top: 10px;
|
||||
@ -705,8 +814,7 @@ $paginationHeight: 32px;
|
||||
}
|
||||
}
|
||||
.box-card2 {
|
||||
width: 100%;
|
||||
margin-bottom: 20px;
|
||||
width: 50%;
|
||||
.chartContainer {
|
||||
width: 100%;
|
||||
height: 200px;
|
||||
|
Loading…
Reference in New Issue
Block a user