前端修改idbug

This commit is contained in:
limengnan 2025-12-24 17:14:19 +08:00
parent 0c64c11b58
commit 88dcd945e6
3 changed files with 38 additions and 27 deletions

View File

@ -87,7 +87,6 @@ const info: any = ref({
height: null,
fissileConcentration: null,
isotopicAbundance: null,
extraFeatures: null,
keffValue: null,
});
@ -100,7 +99,6 @@ function addClick() {
height: null,
fissileConcentration: null,
isotopicAbundance: null,
extraFeatures: null,
keffValue: null,
};
@ -112,26 +110,43 @@ function confirmClick(formEl: any) {
formEl.validate((valid: any) => {
if (valid) {
if (!info.value.projectId) {
if (!info.value.criticalId) {
const params = {
projectId: -1,
...info.value,
customAttrs: JSON.stringify( customAttrsData.value)
}
addCriticalData(params).then((res) => {
gettableData();
dialogVisible.value = false;
});
} else if (info.value.projectId) {
const params = {
projectId: -1,
...info.value,
customAttrs: JSON.stringify( customAttrsData.value)
addCriticalData(params).then((res:any) => {
if(res === true){
gettableData();
dialogVisible.value = false;
}else{
ElMessage({
type: "error",
message: '新增失败',
});
}
});
} else if (info.value.criticalId) {
const params = {
criticalId: info.value.criticalId,
deviceType: info.value.deviceType,
diameter: info.value.diameter,
height: info.value.height,
fissileConcentration: info.value.fissileConcentration,
isotopicAbundance: info.value.isotopicAbundance,
keffValue: info.value.keffValue,
}
updateCriticalData(params).then((res:any) => {
if(res === true){
gettableData();
dialogVisible.value = false;
}else{
ElMessage({
type: "error",
message: '修改失败',
});
}
updateCriticalData(params).then((res) => {
gettableData();
dialogVisible.value = false;
});
} else {
return false;
@ -154,10 +169,6 @@ const rules = ref({
function editClick(row: any) {
title.value = "修改设备";
info.value = JSON.parse(JSON.stringify(row));
if(row.customAttrs != null){
customAttrsData.value = JSON.parse(row.customAttrs);
}
dialogVisible.value = true;
}
@ -170,7 +181,7 @@ function delAloneClick(row: any) {
})
.then(() => {
let params = {
id: row.deviceId,
id: row.criticalId,
};
deleteCriticalData(params).then(() => {
gettableData();
@ -192,7 +203,7 @@ function delClick() {
}).then(() => {
let id = [] as any[];
multipleSelection.value.forEach((item: any) => {
id.push(item.deviceId)
id.push(item.criticalId)
})
let params = {
ids: id,

View File

@ -127,7 +127,7 @@ function confirmClick(formEl: any) {
formEl.validate((valid: any) => {
if (valid) {
if (!info.value.projectId) {
if (!info.value.deviceId) {
const params = {
projectId: -1,
@ -138,7 +138,7 @@ function confirmClick(formEl: any) {
gettableData();
dialogVisible.value = false;
});
} else if (info.value.projectId) {
} else if (info.value.deviceId) {
const params = {
projectId: -1,
...info.value,

View File

@ -117,7 +117,7 @@ function confirmClick(formEl: any) {
formEl.validate((valid: any) => {
if (valid) {
if (!info.value.projectId) {
if (!info.value.materialId) {
const params = {
projectId: -1,
@ -128,7 +128,7 @@ function confirmClick(formEl: any) {
gettableData();
dialogVisible.value = false;
});
} else if (info.value.projectId) {
} else if (info.value.materialId) {
const params = {
projectId: -1,
...info.value,