风机风速功率系数维护合并行
This commit is contained in:
parent
7931f6abc8
commit
4badcfcc03
@ -17,18 +17,18 @@
|
|||||||
:row-key="getRowKey"
|
:row-key="getRowKey"
|
||||||
:span-method="objectSpanMethod"
|
:span-method="objectSpanMethod"
|
||||||
class="tablePart">
|
class="tablePart">
|
||||||
<el-table-column type="selection" width="55"/>
|
<!-- <el-table-column type="selection" width="55"/>-->
|
||||||
<el-table-column prop="name" label="风机名称" align="center"> </el-table-column>
|
<el-table-column prop="name" label="风机名称" align="center"> </el-table-column>
|
||||||
<el-table-column prop="windspeedvalue" label="风速" align="center"> </el-table-column>
|
<el-table-column prop="windspeedvalue" label="风速" align="center"> </el-table-column>
|
||||||
<el-table-column prop="factorK" label="系数K" align="center"> </el-table-column>
|
<el-table-column prop="factorK" label="系数K" align="center"> </el-table-column>
|
||||||
<el-table-column prop="factorB" label="系数B" align="center"> </el-table-column>
|
<el-table-column prop="factorB" label="系数B" align="center"> </el-table-column>
|
||||||
<el-table-column label="操作" width="400" align="center">
|
<!-- <el-table-column label="操作" width="400" align="center">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<div class="tableOperate">
|
<div class="tableOperate">
|
||||||
<a @click="viewDetails(scope.row)">查看</a>
|
<a @click="viewDetails(scope.row)">查看</a>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>-->
|
||||||
</el-table>
|
</el-table>
|
||||||
<div style="display: flex; justify-content: right">
|
<div style="display: flex; justify-content: right">
|
||||||
<el-pagination
|
<el-pagination
|
||||||
@ -45,52 +45,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</el-main>
|
</el-main>
|
||||||
</el-container>
|
</el-container>
|
||||||
<el-dialog v-model="dialogOpen" title="查看参数" width="500">
|
|
||||||
<el-from
|
|
||||||
ref="formRef"
|
|
||||||
:inline="true"
|
|
||||||
label-width="auto"
|
|
||||||
:model="fromUpDate"
|
|
||||||
style="padding: 5px 15px; line-height: 1.5; word-wrap: break-word;">
|
|
||||||
<el-row>
|
|
||||||
<el-col :span="24">
|
|
||||||
<el-form-item label="风机名称:">
|
|
||||||
<el-input v-model="fromUpDate.name" disabled></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label=" 最小值:">
|
|
||||||
<el-input v-model="fromUpDate.speedMin" disabled></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label=" 最大值:">
|
|
||||||
<el-input v-model="fromUpDate.speedMax" disabled></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<!-- <el-col :span="24">
|
|
||||||
<el-form-item label=" 风速:">
|
|
||||||
<el-input v-model="fromUpDate.windspeedvalue" disabled></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>-->
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label=" 系数K:">
|
|
||||||
<el-input v-model="fromUpDate.factorK" disabled></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label=" 系数B:">
|
|
||||||
<el-input v-model="fromUpDate.factorB" disabled></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</el-from>
|
|
||||||
<template #footer>
|
|
||||||
<div class="dialog-footer">
|
|
||||||
<el-button @click="dialogOpen = false">取消</el-button>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</el-dialog>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -101,8 +55,10 @@ import {powerCurveQuery,powerImport,powerExport} from "/@/api/backend/powerCurve
|
|||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from 'element-plus'
|
||||||
import { encrypt_aes, generateRandomNumber } from '/@/utils/crypto'
|
import { encrypt_aes, generateRandomNumber } from '/@/utils/crypto'
|
||||||
import type { TableColumnCtx } from 'element-plus'
|
import type { TableColumnCtx } from 'element-plus'
|
||||||
|
import { dataMethods } from './utils'
|
||||||
|
|
||||||
/*interface User {
|
|
||||||
|
interface User {
|
||||||
id:string,
|
id:string,
|
||||||
turbineId:string,
|
turbineId:string,
|
||||||
name:string,
|
name:string,
|
||||||
@ -110,7 +66,9 @@ import type { TableColumnCtx } from 'element-plus'
|
|||||||
speedMin:string,
|
speedMin:string,
|
||||||
speedMax:string,
|
speedMax:string,
|
||||||
factorK:string,
|
factorK:string,
|
||||||
factorB:string
|
factorB:string,
|
||||||
|
NameIndex:string,
|
||||||
|
count:number
|
||||||
}
|
}
|
||||||
|
|
||||||
interface SpanMethodProps {
|
interface SpanMethodProps {
|
||||||
@ -119,27 +77,55 @@ interface SpanMethodProps {
|
|||||||
rowIndex: number
|
rowIndex: number
|
||||||
columnIndex: number
|
columnIndex: number
|
||||||
}
|
}
|
||||||
const objectSpanMethod = ({
|
|
||||||
row,
|
const objectSpanMethod = ({row, column, rowIndex, columnIndex,}: SpanMethodProps) => {
|
||||||
column,
|
|
||||||
rowIndex,
|
|
||||||
columnIndex,
|
|
||||||
}: SpanMethodProps) => {
|
|
||||||
if (columnIndex === 0) {
|
if (columnIndex === 0) {
|
||||||
if (rowIndex % 2 === 0) {
|
if (rowIndex % 7 === 0) {
|
||||||
return {
|
return {
|
||||||
rowspan: 2,
|
rowspan: 7,
|
||||||
colspan: 1,
|
colspan: 1,
|
||||||
}
|
};
|
||||||
} else {
|
} else {
|
||||||
return {
|
return {
|
||||||
rowspan: 0,
|
rowspan: 0,
|
||||||
colspan: 0,
|
colspan: 0,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*if (columnIndex === 0) {
|
||||||
|
if (rowIndex % row.count === 0) {
|
||||||
|
return {
|
||||||
|
rowspan: row.count,
|
||||||
|
colspan: 1,
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
return {
|
||||||
|
rowspan: 0,
|
||||||
|
colspan: 0,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}*/
|
}*/
|
||||||
|
}
|
||||||
const tableData=ref([])
|
const tableData=ref([])
|
||||||
|
let obj = {}
|
||||||
|
const formatData = (list) => {
|
||||||
|
debugger
|
||||||
|
list.forEach(item => {
|
||||||
|
let count = list.filter(listItem => listItem.name === item.name).length
|
||||||
|
if (obj[item.name] ) {
|
||||||
|
obj[item.name]++
|
||||||
|
|
||||||
|
} else {
|
||||||
|
obj[item.name] = 1
|
||||||
|
}
|
||||||
|
item.NameIndex = obj[item.name]
|
||||||
|
|
||||||
|
item.count = count
|
||||||
|
})
|
||||||
|
tableData.value = list
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
const formQuery = reactive({
|
const formQuery = reactive({
|
||||||
pageSize: 20,
|
pageSize: 20,
|
||||||
@ -152,6 +138,7 @@ const currentPage = ref(1)
|
|||||||
const currentPageSize = ref(20)
|
const currentPageSize = ref(20)
|
||||||
const handleSizeChange = (val: number) => {
|
const handleSizeChange = (val: number) => {
|
||||||
formQuery.pageSize = val
|
formQuery.pageSize = val
|
||||||
|
//formQuery.pageNum = 1
|
||||||
getTableData(formQuery)
|
getTableData(formQuery)
|
||||||
}
|
}
|
||||||
const handleCurrentChange = (val: number) => {
|
const handleCurrentChange = (val: number) => {
|
||||||
@ -163,7 +150,7 @@ const getTableData = (formQuery) => {
|
|||||||
powerCurveQuery(formQuery).then((res: any) => {
|
powerCurveQuery(formQuery).then((res: any) => {
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
pageTotal.value = res.data.total
|
pageTotal.value = res.data.total
|
||||||
tableData.value = (res.data.rows || []).map((item: { speedMin?: number | string; speedMax?: number | string }) => {
|
tableData.value = res.data.rows.map((item: { speedMin?: number | string; speedMax?: number | string }) => {
|
||||||
const speedMin = item.speedMin ?? '';
|
const speedMin = item.speedMin ?? '';
|
||||||
const speedMax = item.speedMax ?? '';
|
const speedMax = item.speedMax ?? '';
|
||||||
if(speedMax==''){
|
if(speedMax==''){
|
||||||
@ -179,6 +166,7 @@ const getTableData = (formQuery) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
// formatData(tableData.value)
|
||||||
} else {
|
} else {
|
||||||
ElMessage.error(res.msg)
|
ElMessage.error(res.msg)
|
||||||
}
|
}
|
||||||
@ -256,6 +244,7 @@ const Export = () => {
|
|||||||
document.body.removeChild(a)
|
document.body.removeChild(a)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getTableData(formQuery)
|
getTableData(formQuery)
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user