修改测试bug

This commit is contained in:
guanj
2026-02-04 09:35:24 +08:00
parent dd0dab7643
commit 3fdb41c468
21 changed files with 308 additions and 156 deletions

View File

@@ -21,7 +21,8 @@
isGroup
></Table>
<!-- 指标日趋势图 -->
<DailyTrendChart v-if="dialogTrendChart" ref="dailyTrendChartRef" @close="dialogTrendChart = false" />
<HarmonicRatio ref="harmonicRatioRef" v-if="dialogFlag" @close="onHarmonicRatioClose" :showIndex="false" />
<!-- <DailyTrendChart v-if="dialogTrendChart" ref="dailyTrendChartRef" @close="dialogTrendChart = false" /> -->
</div>
</template>
<script setup lang="ts">
@@ -31,9 +32,10 @@ import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import MyEchart from '@/components/echarts/MyEchart.vue'
import { getTimeOfTheMonth } from '@/utils/formatTime'
import { ElMessage, ElMessageBox } from 'element-plus'
import DailyTrendChart from '@/components/cockpit/exceedanceLevel/components/dailyTrendChart.vue'
import { getTime } from '@/utils/formatTime'
import HarmonicRatio from '@/components/cockpit/overLimitStatistics/components/harmonicRatio.vue'
const prop = defineProps({
w: { type: [String, Number] },
h: { type: [String, Number] },
@@ -47,7 +49,7 @@ const prop = defineProps({
const TableHeaderRef = ref()
const headerHeight = ref(57)
const harmonicRatioRef: any = ref(null)
const dialogTrendChart = ref(false)
const selectChange = (showSelect: any, height: any, datePickerValue?: any) => {
@@ -118,7 +120,7 @@ const tableStore: any = new TableStore({
field: 'extent',
minWidth: '70',
formatter: (row: any) => {
return Math.floor(row.cellValue * 100) / 100
return Math.floor(row.cellValue * 100) / 100
}
},
{
@@ -143,23 +145,14 @@ const tableStore: any = new TableStore({
},
loadCallback: () => {
// 定义 x 轴标签顺序
const xAxisLabels = ['长时闪变', '谐波电压', '谐波电流', '电压偏差', '三相不平衡']
// 根据指标名称顺序提取对应的 extent 数据
const chartData = xAxisLabels.map(label => {
// 在表格数据中查找对应指标名称的数据项
const item = tableStore.table.data.find((row: any) => row.name === label)
// 如果找到对应项,则返回 extent 值,否则返回 0并保留两位小数
const extentValue = item ? item.extent || 0 : 0
return Math.round(extentValue * 100) / 100
})
echartList.value = {
title: {
text: '指标越限严重度'
},
xAxis: {
data: xAxisLabels
data: tableStore.table.data.map((item: any) => item.name)
},
yAxis: {
@@ -175,7 +168,7 @@ const tableStore: any = new TableStore({
{
type: 'bar',
name: '越限占比',
data: chartData,
data: tableStore.table.data.map((item: any) => Math.floor(item.extent * 100) / 100),
barMaxWidth: 30
}
]
@@ -188,15 +181,32 @@ const tableRef = ref()
provide('tableRef', tableRef)
provide('tableStore', tableStore)
const codeMap = [
{ key: '闪变', code: 'flickerOvertime' },
{ key: '电压偏差', code: 'voltageDevOvertime' },
{ key: '三相', code: 'ubalanceOvertime' },
{ key: '谐波电压', code: 'uharm' },
{ key: '谐波电流', code: 'iharm' },
];
// 点击行
const cellClickEvent = ({ row, column }: any) => {
dialogTrendChart.value = true
if (column.field == 'maxValue' && row.lineId) {
nextTick(() => {
dailyTrendChartRef.value.open(row)
if (column.field == 'maxValue' ) {
if(row.lineId==null){
ElMessage.info('暂无越限监测点!')
}else{
nextTick(() => {
// dailyTrendChartRef.value.open(row)
dialogFlag.value = true
nextTick(() => {
const code = codeMap.find(item => row.name.includes(item.key))?.code || '';
harmonicRatioRef.value.openDialog(row,code,column.title.replace(/次/g, ""))
})
})
}
}
}
@@ -218,6 +228,14 @@ const setTime = () => {
console.warn('获取时间失败time 不是一个有效数组')
}
}
const dialogFlag=ref(false)
// 谐波弹窗关闭时的回调
const onHarmonicRatioClose = () => {
dialogFlag.value = false
// 重新打开指标越限详情弹窗
}
onMounted(() => {
tableStore.index()