This commit is contained in:
高云鹏 2024-11-21 15:23:24 +08:00
commit 87125d6275

View File

@ -8,6 +8,7 @@
<span class="transferTitle">可添加的测点</span>
<el-radio-group v-model="radioActiveName" @change="handleradioChange">
<el-radio value="138">模拟量</el-radio>
<el-radio value="199">计算量</el-radio>
<el-radio value="140">状态量</el-radio>
</el-radio-group>
</div>
@ -61,7 +62,7 @@
</el-main>
<div class="mainFooter" style="display: flex; justify-content: left">
<!-- <div class="mainFooter" style="display: flex; justify-content: left">
<el-pagination
v-model:current-page="selectcurrentPage"
v-model:page-size="selectcurrentPageSize"
@ -72,7 +73,7 @@
@current-change="selecthandleCurrentChange"
layout="prev, pager, next"
></el-pagination>
</div>
</div>-->
</div>
</el-col>
</el-row>
@ -131,9 +132,18 @@ const tableItem0: any = [
title: '风机列表'
}]
const tableItem1: any = [
{
label: '机组运行状态',
unit: ' ',
prop: 'iturbineoperationmode',
align: 'center',
custom: 'header',
name: 'iTurbineOperationMode',
title: '机组运行状态'
},
{
label: '风速 (m/s)',
unit:' (m/s)',
unit: ' (m/s)',
prop: 'iwindspeed',
align: 'center',
custom: 'header',
@ -141,49 +151,13 @@ const tableItem1: any = [
title: '风速'
},
{
label: '有功功率 (MW)',
unit:' (MW)',
prop: 'igenpower',
label: '风向',
unit: '',
prop: 'iwinddirection',
align: 'center',
custom: 'header',
name:'iGenPower',
title: '有功功率'
},
{
label: '日发电量 (kWh)',
unit:' (kWh)',
prop: 'ikwhthisday',
align: 'center',
custom: 'header',
name:'iKWhThisDay',
title: '日发电量'
},
{
label: '总发电量 (万kWh)',
unit:' (万kWh)',
prop: 'ikwhoverall',
align: 'center',
custom: 'header',
name:'iKWhOverall',
title: '总发电量'
},
{
label: '机舱角度',
unit:'',
prop: 'ivanedirection',
align: 'center',
custom: 'header',
name:'iVaneDirection',
title: '机舱角度'
},
{
label: '叶轮转速 (rmp)',
unit:' (rmp)',
prop: 'irotorspeed',
align: 'center',
custom: 'header',
name:'iRotorSpeed',
title: '叶轮转速'
name:'iWindDirection',
title: '风向'
},
{
label: '发电机转速 (rmp)',
@ -195,32 +169,94 @@ const tableItem1: any = [
title: '发电机转速'
},
{
label: '机舱温度 (℃)',
unit:' ()',
prop: 'itempnacelle_1sec',
label: '有功功率 (MW)',
unit:' (MW)',
prop: 'igenpower',
align: 'center',
custom: 'header',
name:'iTempNacelle_1sec',
title: '机舱温度'
name:'iGenPower',
title: '有功功率'
},
{
label: '主油路压力 (kpa)',
unit:' (kpa)',
prop: 'ihydrpress',
label: '给定有功功率 (kW)',
unit:' (kW)',
prop: 'iactivepowersetpointvalue',
align: 'center',
custom: 'header',
name:'iHydrPress',
title: '主油路压力'
name:'iActivePowerSetPointValue',
title: '给定有功功率'
},
{
label: '变桨角度',
unit:' ',
//prop: 'ipitchangle1',
prop: 'ipitchangle',
label: '无功功率 (kvar)',
unit:' (kvar)',
prop: 'ireactivepower',
align: 'center',
custom: 'header',
name:'iReactivePower',
title: '无功功率'
},
{
label: '给定无功功率 (kvar)',
unit:' (kvar)',
prop: 'ireactivepowersetpointvalue',
align: 'center',
custom: 'header',
name:'iReactivePowerSetPointValue',
title: '给定无功功率'
},
{
label: '桨叶1角度',
unit: ' ',
prop: 'ipitchangle1',
align: 'center',
custom: 'header',
name:'iPitchAngle1',
title: '变桨角度'
title: '桨叶1角度'
},
{
label: '桨叶2角度',
unit: ' ',
prop: 'ipitchangle2',
align: 'center',
custom: 'header',
name:'iPitchAngle2',
title: '桨叶2角度'
},
{
label: '桨叶3角度',
unit: ' ',
prop: 'ipitchangle3',
align: 'center',
custom: 'header',
name:'iPitchAngle3',
title: '桨叶1角度'
},
{
label: '限电原因',
unit: ' ',
prop: '',
align: 'center',
custom: 'header',
name:'',
title: '限电原因'
},
{
label: '机舱位置',
unit: ' ',
prop: 'ivanedirection',
align: 'center',
custom: 'header',
name:'iVaneDirection',
title: '机舱位置'
},
{
label: '日发电量 (kWh)',
unit:' (kWh)',
prop: 'ikwhthisday',
align: 'center',
custom: 'header',
name:'iKWhThisDay',
title: '日发电量'
}
]
const tableColumn=ref(
@ -264,7 +300,6 @@ const defaultdeviceQuery = () => {
deviceId.forEach((item,index) => {
objparms.deviceId=item
attributesCode=tableColumn.value.map((item1)=>item1.prop)
attributesCode.push('iPitchAngle1','iPitchAngle2', 'iPitchAngle3')
objparms.attributes=attributesCode
snapshotParms.push({...objparms})
})
@ -281,16 +316,12 @@ const defaultdeviceQuery = () => {
const attributeCodeLower = item1.prop;
if(attributeCodeLower!='name'){
if (attributeCodeLower) {
const ipitchangle=Math.min(tsnapshotVoItem.ipitchangle1, tsnapshotVoItem.ipitchangle2, tsnapshotVoItem.ipitchangle3)
let ipitchanglevalue;
if(isNaN(ipitchangle)){
ipitchanglevalue='-'
}else{
ipitchanglevalue=ipitchangle !== undefined ? (ipitchangle % 1 === 0 ? ipitchangle : ipitchangle.toFixed(3)) : '-';
}
const value=tsnapshotVoItem[attributeCodeLower];
const formattedValue = value !== undefined ? (value % 1 === 0 ? value : value.toFixed(3)) : '-';
acc[i] = { ...item, [attributeCodeLower]: formattedValue,ipitchangle:ipitchanglevalue};
let formattedValue = value !== undefined ? (value % 1 === 0 ? value : value.toFixed(3)) : '-';
if (enumStore.keys.includes(item1.name)) {
formattedValue = enumStore.data[item1.name][formattedValue]?enumStore.data[item1.name][formattedValue]:'-'
}
acc[i] = { ...item, [attributeCodeLower]: formattedValue};
}
}
@ -367,14 +398,6 @@ const getSel = () => {
console.error('Error in tableColumn processing:', error);
}
multipleSelection.value=selectList.value
/*RealtableRef.value.clearSelection()
if (selectList.value.length > 0) {
//setTimeout(()=>{
selectList.value.forEach((item1, index1) => {
RealtableRef.value.toggleRowSelection(item1, undefined, true);
});
//},0)
}*/
};
let isCheckRow = false;
const RealtableRef=ref<any>()
@ -391,7 +414,6 @@ const selectTable = (selected: TableType[] | null) => {
}
});
}
//const getRowKey = (row) => row.id;
const getRowKey = (row) => row.attributeCode;
const visible = ref(false)
const openMeasure=() =>{
@ -400,7 +422,6 @@ const openMeasure=() =>{
queryListData.attributeType=radioActiveName.value
modelAttributeList(queryListData)
nextTick(() => {
//RealtableRef.value.clearSelection()
getSel()
})
}
@ -515,8 +536,8 @@ const getTableData = () => {
multipleSelection.value.forEach(item => {
if (item.attributeCode) {
const attributeCodeLower = item.attributeCode.toLowerCase();
if(attributeCodeLower==='ipitchangle1'||attributeCodeLower==='ipitchangle2'||attributeCodeLower==='ipitchangle3'){
tableColumnEnds.value.push({
// if(attributeCodeLower==='ipitchangle1'||attributeCodeLower==='ipitchangle2'||attributeCodeLower==='ipitchangle3'){
/* tableColumnEnds.value.push({
label: '变桨角度',
unit:'',
prop: 'ipitchangle',
@ -524,8 +545,8 @@ const getTableData = () => {
custom: 'header',
name: 'ipitchangle',
title: '变桨角度',
});
}else{
});*/
//}else{
tableColumnEnds.value.push({
label: item.attributeName+'\n'+item.unit,
unit:item.unit,
@ -535,7 +556,7 @@ const getTableData = () => {
name: item.attributeCode,
title: item.attributeName,
});
}
//}
}
});
tableColumn.value = [...tableItem0, ...tableColumnEnds.value];
@ -553,27 +574,13 @@ const getTableData = () => {
for (const itemKey in tsnapshotVoObject) {
if (item.id === itemKey) {
const attributeCodeLower = item1.attributeCode?.toLowerCase();
const ipitchangle='';
const ipitchangle1=Math.min(item1.ipitchangle1, item1.ipitchangle2, item1.ipitchangle3)
let ipitchanglevalue;
if(isNaN(ipitchangle1)){
ipitchanglevalue='-'
}else{
ipitchanglevalue=ipitchangle1 !== undefined ? (ipitchangle1 % 1 === 0 ? ipitchangle1 : ipitchangle1.toFixed(3)) : '-';
}
const value = tsnapshotVoObject[itemKey]?.[attributeCodeLower];
let formattedValue = value !== undefined ? (value % 1 === 0 ? value : value.toFixed(3)) : '-';
if (enumStore.keys.includes(item1.attributeCode)) {
formattedValue = enumStore.data[item1.attributeCode][formattedValue]?enumStore.data[item1.attributeCode][formattedValue]:'-'
}
if(attributeCodeLower==='ipitchangle'||
attributeCodeLower==='ipitchangle1'||
attributeCodeLower==='ipitchangle2'||
attributeCodeLower==='ipitchangle3'){
arr[i] = { ...item, [attributeCodeLower]: formattedValue,[ipitchangle]: ipitchanglevalue};
}else{
arr[i] = { ...item, [attributeCodeLower]: formattedValue};
}
arr[i] = { ...item, [attributeCodeLower]: formattedValue};
}
}
});
@ -638,7 +645,7 @@ const downFun=(tableColumn,tableData)=>{
let uri = 'data:text/csv;charset=utf-8,\ufeff' + encodeURIComponent(str);
let link = document.createElement('a');
link.href = uri;
link.download = Date.now() + ".csv";
link.download = '实时数据'+Date.now() + ".csv";
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
@ -714,7 +721,7 @@ $paginationHeight: 32px;
border: 1px solid #E1EDF6;
border-radius: 6px;
.transferMain{
height: 600px;
height: 655px;
/*padding: 10px;*/
padding:0;
::v-deep .el-table__row{