This commit is contained in:
sjl
2025-10-23 09:48:47 +08:00
parent a1f241bbfe
commit 5f4b647bed

View File

@@ -356,7 +356,6 @@ const sendParameter = () => {
// 打开弹窗,可能是新增,也可能是编辑 // 打开弹窗,可能是新增,也可能是编辑
const open = async (sign: string, data: Monitor.ResPqMon, device: Device.ResPqDev, table: any[], options: any) => { const open = async (sign: string, data: Monitor.ResPqMon, device: Device.ResPqDev, table: any[], options: any) => {
selectOptions.value = options selectOptions.value = options
titleType.value = sign titleType.value = sign
dialogVisible.value = true dialogVisible.value = true
@@ -378,7 +377,6 @@ const open = async (sign: string, data: Monitor.ResPqMon, device: Device.ResPqDe
name: id.toString() name: id.toString()
} }
}).filter(item => !usedNums.has(item.id)) // 过滤掉已被使用的线路号 }).filter(item => !usedNums.has(item.id)) // 过滤掉已被使用的线路号
if (sign == 'edit') { if (sign == 'edit') {
formContent.value = { ...data } formContent.value = { ...data }
originalNum.value = data.num // 记录原始线路号 originalNum.value = data.num // 记录原始线路号
@@ -397,18 +395,18 @@ const open = async (sign: string, data: Monitor.ResPqMon, device: Device.ResPqDe
ctSecondary.value = secondary ctSecondary.value = secondary
} }
} else { } else {
// 重置表单
dialogFormRef.value?.resetFields() dialogFormRef.value?.resetFields()
// 清空PT和CT的临时变量 // 清空PT和CT的临时变量
ptPrimary.value = '' ptPrimary.value = ''
ptSecondary.value = '' ptSecondary.value = ''
ctPrimary.value = '' ctPrimary.value = ''
ctSecondary.value = '' ctSecondary.value = ''
// 重置表单内容但保留devId // 重置表单内容但保留devId
const devId = formContent.value.devId const devId = formContent.value.devId
resetFormContent() resetFormContent()
formContent.value.devId = devId formContent.value.devId = devId
originalNum.value = null originalNum.value = null
// 设置默认选中第一个线路号 // 设置默认选中第一个线路号
if (lineNum.value.length > 0) { if (lineNum.value.length > 0) {