This commit is contained in:
zhouhuang 2024-12-26 14:54:14 +08:00
commit 23cd34c798
4 changed files with 23 additions and 12 deletions

View File

@ -38,8 +38,8 @@
<div>
<el-space style="margin-top: 10px">
<div style="min-width: 30px">模板</div>
<el-select v-model="template" placeholder="请选择模板" class="templateSelect commonSelect" @change="changeTemplate">
<el-option v-for="v in reportTemplateList" :key="v.value" :label="v.label" :value="v.value">
<el-select v-model="template" placeholder="请选择模板" class="templateSelect commonSelect">
<el-option v-for="v in reportTemplateList" :key="v.value" :label="v.label" :value="v.value" @click="changeTemplate">
<template #default>
<div class="tamplateOption">
<span>{{ v.label }}</span>
@ -227,7 +227,7 @@ const calFunctions = [
]
//
const template = ref('')
const reportTemplateList = ref<{ label: string; value: string; columns: any[]; interval: string }[]>([])
const reportTemplateList = ref<{ label: string; value: string; columns: any[]; interval: string; calFunction: string }[]>([])
const getReportTemplateList = () => {
getReportTemplateListReq({
pageNum: 1,
@ -242,6 +242,7 @@ const getReportTemplateList = () => {
value: item.id,
columns: tem.columns,
interval: tem.interval,
calFunction: tem.calFunction,
}
})
}
@ -276,13 +277,13 @@ const addReportTemplate = () => {
const tem = {
name: value,
interval: interval.value,
calFunction: calFunction.value,
columns: reportTableColumn.value,
}
const data = {
category: '单机报表' as const,
template: JSON.stringify(tem),
}
console.log(data)
addReportTemplateListReq(data).then((res) => {
if (res.success) {
@ -313,9 +314,10 @@ const delReportTemplate = (id: string) => {
}
const changeTemplate = (val: string) => {
const target = reportTemplateList.value.find((item) => item.value === val)
const target = reportTemplateList.value.find((item) => item.value === template.value)
if (target) {
interval.value = target.interval ? target.interval : interval.value
calFunction.value = target.calFunction ? target.calFunction : calFunction.value
reportTableColumn.value = target.columns
}
}

View File

@ -406,7 +406,7 @@ const statAnalysisExport = () => {
madeinfactory: params.split(':')[0],
model: params.split(':')[1],
windSource: windSource[0]['label'],
displayCurve: AvgWindSpeedSwitch ? 0 : 1,
displayCurve: AvgWindSpeedSwitch.value ? 1 : 0,
}
powerCurveExport(requestData).then((res: any) => {
const downloadUrl = window.URL.createObjectURL(res)

View File

@ -684,6 +684,7 @@ const timestampToTime = (timestamp: any) => {
<style scoped lang="scss">
.statAnalysis {
height: 100%;
.contain {
height: calc(100% - 60px);
// display: flex;
@ -796,7 +797,8 @@ const timestampToTime = (timestamp: any) => {
height: 300px;
}
.transferRight {
height: 400px;
height: 380px;
border: 1px solid #e1edf6;
border-radius: 6px;
margin-top: 20px;
@ -812,6 +814,8 @@ const timestampToTime = (timestamp: any) => {
border-radius: 6px 6px 0 0;
}
.transferMain {
overflow: auto;
height: calc(100% - 40px);
padding: 0;
:deep(.el-table__row) {
height: 40px;
@ -839,4 +843,7 @@ const timestampToTime = (timestamp: any) => {
}
}
}
:deep(.el-picker-panel__footer) {
padding: 20px 12px 16px;
}
</style>

View File

@ -48,8 +48,8 @@
<div>
<el-space style="margin: 10px 20px">
<div style="min-width: 30px">模板</div>
<el-select v-model="template" placeholder="请选择模板" class="templateSelect" @change="changeTemplate" clearable>
<el-option v-for="v in reportTemplateList" :key="v.id" :label="v.name" :value="v.id">
<el-select v-model="template" placeholder="请选择模板" class="templateSelect" clearable>
<el-option v-for="v in reportTemplateList" :key="v.id" :label="v.name" :value="v.id" @click="changeTemplate">
<template #default>
<div class="tamplateOption">
<span>{{ v.name }}</span>
@ -69,7 +69,7 @@
style="height: calc(100% - 140px); width: calc(100% - 60px); border: 1px solid rgb(217, 217, 217); margin: 80px 40px"
></div>
</div>
<el-dialog v-model="showMeasure" title="选择测点" width="1200" top="0" :destroy-on-close="true">
<el-dialog v-model="showMeasure" title="选择测点" width="1122" top="0" :destroy-on-close="true">
<div class="measureSlot">
<el-row :gutter="20">
<el-col :span="12">
@ -709,8 +709,8 @@ const delReportTemplate = (id: string) => {
})
}
const changeTemplate = (val: string) => {
const target: any = reportTemplateList.value.find((item) => item.id === val)
const changeTemplate = () => {
const target: any = reportTemplateList.value.find((item) => item.id === template.value)
if (target) {
multipleSelection.value = target.multipleSelection
statAnalysisInterval.value = target.interval
@ -855,9 +855,11 @@ const changeTemplate = (val: string) => {
}
.measureSlot {
display: flex;
.col {
border: 1px solid #e1edf6;
border-radius: 6px;
width: 536px;
.transferHeader {
height: 40px;
display: flex;