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

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

@@ -135,7 +135,7 @@ onMounted(() => {})
const open = async (row: any) => {
dialogVisible.value = true
dialogTitle.value = row.name + '日趋势图'
dialogText.value = `监测点名称:${row.lineName}_越限时间:${row.time}_指标名称:${row.name}`
dialogText.value = `监测点名称:${row.lineName} 越限时间:${row.time} 指标名称:${row.name}`
nextTick(() => {
initData(row)
})

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)

View File

@@ -266,7 +266,6 @@ self.onmessage = function (e) {
} else if (boxoList.systemType == 'ZL') {
titles =
(boxoList.engineeringName == undefined ? '' : ' 项目名称:' + boxoList.engineeringName) +
' 监测点名称:' +
boxoList.equipmentName +
' 发生时刻:' +
@@ -279,7 +278,6 @@ self.onmessage = function (e) {
} else if (boxoList.systemType == 'YPT') {
titles =
(boxoList.engineeringName == undefined ? '' : ' 项目名称:' + boxoList.engineeringName) +
' 监测点名称:' +
boxoList.lineName +
' 发生时刻:' +
@@ -291,15 +289,15 @@ self.onmessage = function (e) {
's'
} else {
titles =
'变电站名称:' +
' 变电站名称:' +
boxoList.subName +
' 监测点名称:' +
' 监测点名称:' +
boxoList.lineName +
' 发生时刻:' +
' 发生时刻:' +
boxoList.startTime +
' 暂降(骤升)幅值:' +
' 暂降(骤升)幅值:' +
(boxoList.featureAmplitude * 100).toFixed(2) +
'% 持续时间:' +
'% 持续时间:' +
boxoList.duration +
's'
}

View File

@@ -127,13 +127,13 @@ self.addEventListener('message', function (e) {
titles =
'变电站名称:' +
boxoList.powerStationName +
' 监测点名称:' +
' 监测点名称:' +
boxoList.measurementPointName +
' 发生时刻:' +
' 发生时刻:' +
boxoList.startTime +
' 暂降(骤升)幅值:' +
' 暂降(骤升)幅值:' +
(boxoList.featureAmplitude * 100).toFixed(2) +
'% 持续时间:' +
'% 持续时间:' +
boxoList.duration +
's'
} else if (boxoList.systemType == 'ZL') {
@@ -141,11 +141,11 @@ self.addEventListener('message', function (e) {
(boxoList.engineeringName == undefined ? '' : ' 项目名称:' + boxoList.engineeringName) +
' 监测点名称:' +
boxoList.equipmentName +
' 发生时刻:' +
' 发生时刻:' +
boxoList.startTime +
' 暂降(骤升)幅值:' +
' 暂降(骤升)幅值:' +
boxoList.evtParamVVaDepth +
'% 持续时间:' +
'% 持续时间:' +
boxoList.evtParamTm +
's'
} else if (boxoList.systemType == 'YPT') {

View File

@@ -304,7 +304,7 @@ export const getMenu = () => {
}
handlerMenu(res.data)
handleAdminRoute(res.data)
if (route.params.to) {
if (route?.params?.to) {
const lastRoute = JSON.parse(route.params.to as string)
if (lastRoute.path != adminBaseRoutePath) {
let query = !isEmpty(lastRoute.query) ? lastRoute.query : {}

View File

@@ -410,10 +410,15 @@ function dragEnd(row: any) {
}
// 保存
const onSubmit = () => {
layout.value = layout.value.filter(item => {
return item.y <= 6 && item.x <= 12
})
if (layout.value.length == 0) {
return ElMessage.warning('页面设计不能为空!')
}
let repeat = findDuplicateNames(layout.value) || []
console.log('🚀 ~ onSubmit ~ layout.value:', layout.value)
if (repeat.length > 0) {
return ElMessage.warning(repeat.join('、') + ' 组件重复,请删除重复组件!')
}