指标越限程度取值修改

This commit is contained in:
stt
2025-11-17 09:51:31 +08:00
parent f66dd649c7
commit 0f090666e9
5 changed files with 40 additions and 43 deletions

View File

@@ -21,7 +21,7 @@ const prop = defineProps({
timeValue: { type: Object }
})
const pageHeight = ref(mainHeight(332))
const pageHeight = mainHeight(0, 2)
const dialogVisible: any = ref(false)
@@ -36,35 +36,26 @@ const echartList = ref()
const init = () => {
echartList.value = {
title: {
text: dialogText.value,
textStyle: {
fontSize: 14,
rich: {
lineName: {
color: '#333',
fontSize: 14
text: dialogText.value
},
timeLabel: {
color: '#333',
fontSize: 14,
padding: [0, 0, 0, 10]
},
name: {
color: '#333',
fontSize: 14,
padding: [0, 0, 0, 10]
}
}
}
legend: {
itemWidth: 20,
itemHeight: 20,
itemStyle: { opacity: 0 }, //去圆点
right: 70
},
xAxis: {
type: 'category',
data: []
},
yAxis: {
type: 'value',
name: '数值'
type: 'time',
axisLabel: {
formatter: {
day: '{MM}-{dd}',
month: '{MM}',
year: '{yyyy}'
}
}
},
yAxis: [{}, {}],
grid: {
left: '1%',
right: '45px',
@@ -112,12 +103,17 @@ const initData = async (row: any) => {
// 处理每条相位数据
const seriesData = res.data.map((item: any) => {
const values = item.value.split(',').map((v: string) => parseFloat(v) || 0)
const values = xAxisData.map((time: string, index: number) => {
// 将传入的日期与时间拼接成完整的时间字符串
const fullTime = `${row.time} ${time}`
const value = parseFloat(item.value.split(',')[index]) || 0
return [fullTime, value]
})
return {
name: `${item.phasic}`,
type: 'line',
showSymbol: true,
showSymbol: false,
smooth: true,
data: values,
itemStyle: {
@@ -130,18 +126,17 @@ const initData = async (row: any) => {
})
// 更新图表配置
echartList.value.xAxis.data = xAxisData
echartList.value.options.series = seriesData
// 注意:使用时间轴时不需要设置 xAxis.data
}
})
}
onMounted(() => {})
const open = async (row: any) => {
dialogVisible.value = true
dialogTitle.value = row.name + '日趋势图'
dialogText.value = `{lineName|${row.lineName}}{timeLabel|${row.time}}{name|${row.name}日趋势图}`
dialogText.value = `监测点:${row.lineName} 时间:${row.time} 指标:${row.name}`
nextTick(() => {
initData(row)
})

View File

@@ -14,7 +14,7 @@
isGroup
></Table>
<!-- 指标日趋势图 -->
<DailyTrendChart ref="dailyTrendChartRef" />
<DailyTrendChart v-if="dialogTrendChart" ref="dailyTrendChartRef" @close="dialogTrendChart = false" />
</div>
</template>
<script setup lang="ts">
@@ -39,8 +39,7 @@ const prop = defineProps({
const headerHeight = ref(57)
const route = useRoute()
const timeCacheStore = useTimeCacheStore()
const dialogTrendChart = ref(false)
const selectChange = (showSelect: any, height: any, datePickerValue?: any) => {
headerHeight.value = height
@@ -200,8 +199,11 @@ provide('tableStore', tableStore)
// 点击行
const cellClickEvent = ({ row, column }: any) => {
dialogTrendChart.value = true
if (column.field == 'maxValue' && row.lineId) {
nextTick(() => {
dailyTrendChartRef.value.open(row)
})
}
}

View File

@@ -20,7 +20,7 @@
</template>
<div
:style="{
height: `calc((${prop.height} - 57px) / 5) `,
height: `calc(${prop.height} / 5 ) `,
overflow: 'auto'
}"
v-html="getTextForDate(data.day)"

View File

@@ -157,7 +157,7 @@ const countOptions: any = ref([])
const legendDictList: any = ref([])
const initCode = (field: string, title: string) => {
queryByCode('steady_state_power_quality').then(res => {
queryByCode('steady_state_limit_trend').then(res => {
queryCsDictTree(res.data.id).then(item => {
//排序
indexOptions.value = item.data.sort((a: any, b: any) => {

View File

@@ -157,7 +157,7 @@ const countOptions: any = ref([])
const legendDictList: any = ref([])
const initCode = (field: string, title: string) => {
queryByCode('steady_state_power_quality').then(res => {
queryByCode('steady_state_limit_trend').then(res => {
queryCsDictTree(res.data.id).then(item => {
//排序
indexOptions.value = item.data.sort((a: any, b: any) => {