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

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

View File

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

View File

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

View File

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

View File

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

View File

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