优化表单数据转换逻辑
在form_data_transfor_diy_data方法中,新增了一个临时表单变量new_tem_form,用于在转换过程中保持原始数据的独立性。这样做的目的是避免在尝试更新header、footer和diy_data字段时,对原始表单数据造成意外修改,确保数据转换的准确性和数据的完整性。v1.0.0
parent
5fa51457ee
commit
bae87a5aa2
|
|
@ -237,6 +237,7 @@ const diy_data_transfor_form_data = (clone_form: diy_data_item) => {
|
||||||
};
|
};
|
||||||
const form_data_transfor_diy_data = (clone_form: diyData) => {
|
const form_data_transfor_diy_data = (clone_form: diyData) => {
|
||||||
let temp_config = clone_form.config;
|
let temp_config = clone_form.config;
|
||||||
|
let new_tem_form = cloneDeep(temp_form.value);
|
||||||
try {
|
try {
|
||||||
return {
|
return {
|
||||||
id: clone_form.id,
|
id: clone_form.id,
|
||||||
|
|
@ -259,9 +260,9 @@ const form_data_transfor_diy_data = (clone_form: diyData) => {
|
||||||
is_enable: clone_form.is_enable,
|
is_enable: clone_form.is_enable,
|
||||||
describe: clone_form.describe,
|
describe: clone_form.describe,
|
||||||
},
|
},
|
||||||
header: form.value.header,
|
header: new_tem_form.header,
|
||||||
footer: form.value.footer,
|
footer: new_tem_form.footer,
|
||||||
diy_data: form.value.diy_data,
|
diy_data: new_tem_form.diy_data,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue