2 Commits

Author SHA1 Message Date
sjl
97d1f08bbe 正式检测闪变 2025-10-13 13:56:37 +08:00
sjl
7d0053eb71 被检设备监测点台账线路号占满不可新增 2025-10-11 14:12:15 +08:00
2 changed files with 36 additions and 3 deletions

View File

@@ -353,6 +353,7 @@ watch(
}
}
break
case 'connect':
switch (newValue.operateCode) {
case 'Contrast_Dev':
@@ -457,6 +458,7 @@ watch(
case 25001:
case 25006:
case 25005:
case 25007:// 添加闪变处理
{
let result: CheckData.ScriptChnItem[] = []
@@ -476,6 +478,18 @@ watch(
}
}
if (newValue.code == 25007) {
// 设置闪变项目为LOADING状态
const flickerResultItem = checkResult.find(item => item.code === 'flicker_data')
if (flickerResultItem) {
flickerResultItem.devices.forEach(device => {
device.chnResult.fill(CheckData.ChnCheckResultEnum.LOADING)
})
}
}
scriptData.forEach(item => {
// 处理当前节点的数据
const temp: CheckData.ScriptChnItem = {
@@ -491,7 +505,14 @@ watch(
if (existingWaveItem) {
temp.devices = [...existingWaveItem.devices] // 保留已设置的devices
}
} else {
} // 特殊处理闪变项目 - 如果是25007消息且当前项目是闪变项目则使用已设置的状态
else if (newValue.code == 25007 && item.code === 'PST') {
const existingFlickerItem = checkResult.find(checkItem => checkItem.scriptType === 'PST')
if (existingFlickerItem) {
temp.devices = [...existingFlickerItem.devices] // 保留已设置的devices
}
}
else {
// 找到message中所有scriptName与当前item.code匹配的项
const matchedDevices = message
.filter((msg: any) => msg.scriptName === item.code)
@@ -505,7 +526,7 @@ watch(
temp.devices.push(...matchedDevices)
// 对于未匹配到的设备,也要添加占位符(特别是录波项目)
if (item.code === 'wave_data') {
if (item.code === 'wave_data' || item.code === 'PST') {
deviceList.forEach(device => {
const isDeviceExist = matchedDevices.some((matchedDevice: any) => matchedDevice.deviceId === device.deviceId)
if (!isDeviceExist) {
@@ -688,7 +709,7 @@ const initCheckResult = (defaultValue: CheckData.ChnCheckResultEnum) => {
let tempChnResult: CheckData.ChnCheckResultEnum[] = []
for (let j = 0; j < checkStore.chnNumList.length; j++) {
// 录波项目初始化为UNKNOWN状态其他项目使用传入的默认值
if (item.code === 'wave_data' && checkTotal > 1) {
if ((item.code === 'wave_data' || item.code === 'PST')&& checkTotal > 1) {
tempChnResult.push(CheckData.ChnCheckResultEnum.UNKNOWN)
} else {
tempChnResult.push(defaultValue)

View File

@@ -162,6 +162,18 @@ const openDialog = (titleType: string, row: Partial<Monitor.ResPqMon> = {}) => {
})
return
}
// 新增时检查线路号是否全部被占用
if (titleType === 'add') {
if(props.DevFormContent.devChns == tableData.value.length){
ElMessageBox.confirm(`线路号已全部被占用,无法新增监测点`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
return
}
}
title_Type.value = titleType
monitorPopup.value?.open(titleType, row, props.DevFormContent, tableData.value, props.selectOptions)
}