修改禅道bug

This commit is contained in:
GGJ
2024-09-30 11:08:35 +08:00
parent 83af279826
commit 5befa69299
13 changed files with 70 additions and 55 deletions

View File

@@ -1,9 +1,10 @@
<template>
<div>
<div >
<TableHeader :showSearch="false">
<!-- 历史趋势数据 -->
<div>
<TableHeader :showSearch="false" @selectChange="selectChange">
<template v-slot:select>
<!-- <el-form :model="searchForm" class="history_select" id="history_select"> -->
<!-- <el-form :model="searchForm" class="history_select" id="history_select"> -->
<el-form-item>
<DatePicker ref="datePickerRef"></DatePicker>
</el-form-item>
@@ -25,15 +26,15 @@
</el-select>
</el-form-item>
</div>
<!-- </el-form> -->
</template>
<template #operation>
<el-button type="primary" icon="el-icon-Search" @click="init()">查询</el-button>
</template>
<!-- </el-form> -->
</template>
<template #operation>
<el-button type="primary" icon="el-icon-Search" @click="init()">查询</el-button>
</template>
</TableHeader>
</div>
<div class="history_chart" v-loading="loading">
<div class="history_chart" :style="pageHeight" v-loading="loading">
<MyEchart ref="historyChart" :options="echartsData" />
</div>
</div>
@@ -68,7 +69,7 @@ const voltageLevelList = dictData.getBasicData('Dev_Voltage')
const volConTypeList = dictData.getBasicData('Dev_Connect')
//值类型
const pageHeight = mainHeight(20)
const pageHeight = ref(mainHeight(290))
const loading = ref(true)
const searchForm = ref({})
const typeOptions = [
@@ -231,27 +232,27 @@ const init = async () => {
// }
}
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
},
formatter: function (params: any) {
var res = params[0].name + '<br/>'
for (var i = 0, l = params.length; i < l; i++) {
params[i].unit =
echartsData.value.options.yAxis[
echartsData.value.options.series[params[i].seriesIndex].yAxisIndex
]?.name
res +=
params[i].seriesName +
' ' +
`<div style="width:16px;height:16px;float:left;background:${params[i].color};border-radius:50%;margin:0 5px;margin:0 15px"></div>` +
`<div style='float:right;min-width:120px;padding-left:20px;'>${params[i].value} ${params[i].unit}</div><br/>`
}
return res
}
},
// tooltip: {
// trigger: 'axis',
// // axisPointer: {
// // type: 'shadow'
// // },
// // formatter: function (params: any) {
// // var res = params[0].name + '<br/>'
// // for (var i = 0, l = params.length; i < l; i++) {
// // params[i].unit =
// // echartsData.value.options.yAxis[
// // echartsData.value.options.series[params[i].seriesIndex].yAxisIndex
// // ]?.name
// // res +=
// // params[i].seriesName +
// // ' ' +
// // `<div style="width:16px;height:16px;float:left;background:${params[i].color};border-radius:50%;margin:0 5px;margin:0 15px"></div>` +
// // `<div style='float:right;min-width:120px;padding-left:20px;'>${params[i].value} ${params[i].unit}</div><br/>`
// // }
// // return res
// // }
// },
legend: {
//legend使用iconfont图标
data: [],
@@ -433,6 +434,15 @@ const init = async () => {
}
}
}
const selectChange = (flag: boolean) => {
console.log("🚀 ~ selectChange ~ flag:", flag)
if (flag) {
pageHeight.value = mainHeight(345)
} else {
pageHeight.value = mainHeight(290)
}
}
//导出
const historyChart = ref()
// const chart: any = ref(null)
@@ -685,7 +695,7 @@ defineExpose({ getTrendRequest })
.history_chart {
width: 100%;
height: calc(100vh - 400px) !important;
// flex: 1;
margin-top: 10px;
}