From ac359a3ced99ff38f2eeed5a053982980990ccb3 Mon Sep 17 00:00:00 2001 From: fuguobin Date: Fri, 22 Mar 2024 17:36:26 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B5=84=E4=BA=A7=E4=BF=A1=E6=81=AF=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/model/asset/addParams.vue | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/src/views/model/asset/addParams.vue b/src/views/model/asset/addParams.vue index 87081cd..6960ac0 100644 --- a/src/views/model/asset/addParams.vue +++ b/src/views/model/asset/addParams.vue @@ -475,19 +475,28 @@ const paramSubmit = async (formEl) => { if (valid) { const $submitTable = paramsTableRef.value; if ($submitTable) { - const selectParamsList = $submitTable.getCheckboxRecords(); - const selectParamsListArr = selectParamsList.map((item) => ({ - paramCode: item.paramCode, - flagEnabled: item.flagEnabled, - contrlFlag: item.contrlFlag, - })); - formData.paramsForm.assetParamsDtos = selectParamsListArr; if (route.query.id != undefined) { + const selectParamsList = $submitTable.getCheckboxRecords(); + console.log(selectParamsList); + const selectParamsListArr = selectParamsList.map((item) => ({ + id: item.id, + paramCode: item.paramCode, + flagEnabled: item.flagEnabled, + contrlFlag: item.contrlFlag, + })); + formData.paramsForm.assetParamsDtos = selectParamsListArr; updateInfo(formData.paramsForm).then((response) => { proxy.$modal.msgSuccess("修改成功"); open.value = false; }); } else { + const selectParamsList = $submitTable.getCheckboxRecords(); + const selectParamsListArr = selectParamsList.map((item) => ({ + paramCode: item.paramCode, + flagEnabled: item.flagEnabled, + contrlFlag: item.contrlFlag, + })); + formData.paramsForm.assetParamsDtos = selectParamsListArr; addInfo(formData.paramsForm).then((response) => { proxy.$modal.msgSuccess("新增成功"); open.value = false;