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;