修改驾驶舱组件重复绑定问题

This commit is contained in:
guanj
2026-01-08 10:08:51 +08:00
parent 545e3836d1
commit 3db01fe32d
6 changed files with 28 additions and 40 deletions

View File

@@ -6,7 +6,7 @@
:showReset="false"
@selectChange="selectChange"
datePicker
:timeKeyList="prop.timeKey"
:timeKeyList="prop.timeKey"
v-if="fullscreen"
></TableHeader>
<my-echart
@@ -39,7 +39,7 @@ const prop = defineProps({
h: { type: [String, Number] },
width: { type: [String, Number] },
height: { type: [String, Number] },
timeKey: { type: Array as () => string[] },
timeKey: { type: Array as () => string[] },
timeValue: { type: Object },
interval: { type: Number }
})
@@ -117,40 +117,24 @@ const tableStore: any = new TableStore({
title: '越限程度(%)',
field: 'extent',
minWidth: '70',
render: 'customTemplate',
customTemplate: (row: any) => {
// 保留两个小数
const extentValue =
row.extent !== null && row.extent !== undefined && row.extent !== ''
? Math.floor(row.extent * 100) / 100
: '/'
return `<span>${extentValue}</span>`
formatter: (row: any) => {
return Math.floor(row.cellValue * 100) / 100
}
},
{
title: '越限时间',
field: 'time',
minWidth: '60',
render: 'customTemplate',
customTemplate: (row: any) => {
if (row.time !== null && row.time !== undefined && row.time !== '') {
return `<span>${row.time}</span>`
} else {
return `<span>/</span>`
}
formatter: (row: any) => {
return row.cellValue || '/'
}
},
{
title: '越限最高监测点',
field: 'lineName',
minWidth: '90',
render: 'customTemplate',
customTemplate: (row: any) => {
if (row.lineName !== null && row.lineName !== undefined && row.lineName !== '') {
return `<span>${row.lineName}</span>`
} else {
return `<span>/</span>`
}
formatter: (row: any) => {
return row.cellValue || '/'
}
}
],
@@ -208,6 +192,7 @@ provide('tableStore', tableStore)
// 点击行
const cellClickEvent = ({ row, column }: any) => {
dialogTrendChart.value = true
if (column.field == 'maxValue' && row.lineId) {
nextTick(() => {
dailyTrendChartRef.value.open(row)