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