From c6a3aba4629a74257a1ed74927ee10cd3d133502 Mon Sep 17 00:00:00 2001 From: limengnan <420004014@qq.com> Date: Wed, 5 Aug 2026 15:52:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=B4=E7=95=8C=E6=95=B0=E6=8D=AE=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../business/database/criticalData/index.vue | 85 +++++++++++-------- .../views/business/database/device/index.vue | 4 +- .../business/database/material/index.vue | 6 +- 3 files changed, 56 insertions(+), 39 deletions(-) diff --git a/business-css/frontend/src/views/business/database/criticalData/index.vue b/business-css/frontend/src/views/business/database/criticalData/index.vue index 394aea4..f5c4c51 100644 --- a/business-css/frontend/src/views/business/database/criticalData/index.vue +++ b/business-css/frontend/src/views/business/database/criticalData/index.vue @@ -177,6 +177,22 @@ const validator3 = (rule: any, value: any, callback: any) => { callback(); } } + +const validator4 = (rule: any, value: any, callback: any) => { + if (!value || value === '') { + callback(new Error('对应Keff值不能为空')); + return; + } + if (!/^\d+(\.\d+)?$/.test(value)) { + callback(new Error('请输入有效的数字或小数')); + } else if (parseFloat(value) <= 0) { + callback(new Error('必须大于 0')); + }else if (parseFloat(value) > 1) { + callback(new Error('必须小于等于 1')); + } else { + callback(); + } +} const rulesSize = ref({ uConcentration: [ { @@ -196,39 +212,40 @@ const rulesSize = ref({ trigger: 'blur' } ], - ePu238: [ - { - validator: validator3, - trigger: 'blur' - } - ], - ePu239: [ - { - validator: validator3, - trigger: 'blur' - } - ], - ePu240: [ - { - validator: validator3, - trigger: 'blur' - } - ], - ePu241: [ - { - validator: validator3, - trigger: 'blur' - } - ], - ePu242: [ - { - validator: validator3, - trigger: 'blur' - } - ], + // ePu238: [ + // { + // validator: validator3, + // trigger: 'blur' + // } + // ], + // ePu239: [ + // { + // validator: validator3, + // trigger: 'blur' + // } + // ], + // ePu240: [ + // { + // validator: validator3, + // trigger: 'blur' + // } + // ], + // ePu241: [ + // { + // validator: validator3, + // trigger: 'blur' + // } + // ], + // ePu242: [ + // { + // validator: validator3, + // trigger: 'blur' + // } + // ], keffValue: [ { - validator: validator2, + validator: validator4, + required: true, trigger: 'blur' } ], @@ -276,10 +293,10 @@ function confirmClick(formEl: any) { size: JSON.stringify(info.value.size), } addCriticalData(params).then((res:any) => { - if(res.code == '0'){ + if(res == true){ ElMessage({ type: "success", - message: '修改成功', + message: '新增成功', }); gettableData(); dialogVisible.value = false; @@ -292,7 +309,7 @@ function confirmClick(formEl: any) { size: JSON.stringify(info.value.size), } updateCriticalData(params).then((res:any) => { - if(res.code == '0'){ + if(res == true){ ElMessage({ type: "success", message: '修改成功', diff --git a/business-css/frontend/src/views/business/database/device/index.vue b/business-css/frontend/src/views/business/database/device/index.vue index b5d9932..0785fc3 100644 --- a/business-css/frontend/src/views/business/database/device/index.vue +++ b/business-css/frontend/src/views/business/database/device/index.vue @@ -157,7 +157,7 @@ function confirmClick(formEl: any) { size: JSON.stringify( info.value.size) } addDevices(params).then((res:any) => { - if(res.code == '0'){ + if(res == true){ ElMessage({ type: "success", message: '新增成功', @@ -174,7 +174,7 @@ function confirmClick(formEl: any) { size: JSON.stringify( info.value.size) } updateDevices(params).then((res:any) => { - if(res.code == '0'){ + if(res == true){ ElMessage({ type: "success", message: '修改成功', diff --git a/business-css/frontend/src/views/business/database/material/index.vue b/business-css/frontend/src/views/business/database/material/index.vue index a945204..05795e6 100644 --- a/business-css/frontend/src/views/business/database/material/index.vue +++ b/business-css/frontend/src/views/business/database/material/index.vue @@ -135,10 +135,10 @@ function confirmClick(formEl: any) { customAttrs: JSON.stringify( customAttrsData.value) } addMaterials(params).then((res:any) => { - if(res.code == '0'){ + if(res == true){ ElMessage({ type: "success", - message: '修改成功', + message: '新增成功', }); gettableData(); dialogVisible.value = false; @@ -151,7 +151,7 @@ function confirmClick(formEl: any) { customAttrs: JSON.stringify( customAttrsData.value) } updateMaterials(params).then((res:any) => { - if(res.code == '0'){ + if(res == true){ ElMessage({ type: "success", message: '修改成功',