UPDATE: 1、重新修改激活逻辑;2、优化
This commit is contained in:
@@ -294,37 +294,62 @@ const save = () => {
|
||||
}
|
||||
}
|
||||
}
|
||||
formContent.value.pt = `${ptPrimaryValue}:${ptSecondaryValue}`
|
||||
// CT 逻辑, CT 分母是否为 ['1', '5']
|
||||
if (!ctFinalValue.includes(ctSecondary.value)) {
|
||||
ctErrorTips = true
|
||||
}
|
||||
if (ptErrorTips && ctErrorTips) {
|
||||
ElMessage.error({ message: '请确认PT和CT无误!' })
|
||||
return
|
||||
await ElMessageBox.confirm('请确认PT和CT无误!', '提示', {
|
||||
confirmButtonText: '继续保存',
|
||||
cancelButtonText: '取消保存'
|
||||
})
|
||||
.then(() => {
|
||||
sendParameter()
|
||||
})
|
||||
.catch(() => {
|
||||
return
|
||||
})
|
||||
} else {
|
||||
if (ptErrorTips) {
|
||||
ElMessage.error({ message: '请确认PT无误!' })
|
||||
return
|
||||
await ElMessageBox.confirm('请确认PT无误!', '提示', {
|
||||
confirmButtonText: '继续保存',
|
||||
cancelButtonText: '取消保存'
|
||||
})
|
||||
.then(() => {
|
||||
sendParameter()
|
||||
})
|
||||
.catch(() => {
|
||||
return
|
||||
})
|
||||
}
|
||||
if (ctErrorTips) {
|
||||
ElMessage.error({ message: '请确认CT无误!' })
|
||||
return
|
||||
await ElMessageBox.confirm('请确认CT无误!', '提示', {
|
||||
confirmButtonText: '确认保存',
|
||||
cancelButtonText: '取消保存'
|
||||
})
|
||||
.then(() => {
|
||||
sendParameter()
|
||||
})
|
||||
.catch(() => {
|
||||
return
|
||||
})
|
||||
}
|
||||
}
|
||||
formContent.value.pt = `${ptPrimaryValue}:${ptSecondaryValue}`
|
||||
if (titleType.value != 'edit') {
|
||||
formContent.value.id = generateUUID().replaceAll('-', '')
|
||||
}
|
||||
emit('get-parameter', formContent.value)
|
||||
//ElMessage.success({ message: `${dialogTitle.value}成功!` })
|
||||
close()
|
||||
}
|
||||
})
|
||||
} catch (err) {
|
||||
console.error('验证过程中出现错误', err)
|
||||
}
|
||||
}
|
||||
|
||||
const sendParameter = () => {
|
||||
if (titleType.value != 'edit') {
|
||||
formContent.value.id = generateUUID().replaceAll('-', '')
|
||||
}
|
||||
emit('get-parameter', formContent.value)
|
||||
//ElMessage.success({ message: `${dialogTitle.value}成功!` })
|
||||
close()
|
||||
}
|
||||
// 打开弹窗,可能是新增,也可能是编辑
|
||||
const open = async (sign: string, data: Monitor.ResPqMon, device: Device.ResPqDev, table: any[], options: any) => {
|
||||
// 重置表单
|
||||
|
||||
Reference in New Issue
Block a user