diff --git a/src/views/layout/index.vue b/src/views/layout/index.vue index 3ba41e80..bd84b087 100644 --- a/src/views/layout/index.vue +++ b/src/views/layout/index.vue @@ -208,18 +208,33 @@ const diy_data_transfor_form_data = (clone_form: diy_data_item) => { }; const form_data_transfor_diy_data = (clone_form: diyData) => { let temp_config = clone_form.config; - return { - id: clone_form.id, - model: { - logo: clone_form.logo, - name: clone_form.name, - is_enable: clone_form.is_enable, - describe: clone_form.describe, - }, - header: is_obj(temp_config) ? (temp_config as diyConfig).header : JSON.parse(temp_config as string).header, - footer: is_obj(temp_config) ? (temp_config as diyConfig).footer : JSON.parse(temp_config as string).footer, - diy_data: is_obj(temp_config) ? (temp_config as diyConfig).diy_data : JSON.parse(temp_config as string).diy_data, - }; + try { + return { + id: clone_form.id, + model: { + logo: clone_form.logo, + name: clone_form.name, + is_enable: clone_form.is_enable, + describe: clone_form.describe, + }, + header: is_obj(temp_config) ? (temp_config as diyConfig).header : JSON.parse(temp_config as string).header, + footer: is_obj(temp_config) ? (temp_config as diyConfig).footer : JSON.parse(temp_config as string).footer, + diy_data: is_obj(temp_config) ? (temp_config as diyConfig).diy_data : JSON.parse(temp_config as string).diy_data, + }; + } catch (error) { + return { + id: clone_form.id, + model: { + logo: clone_form.logo, + name: clone_form.name, + is_enable: clone_form.is_enable, + describe: clone_form.describe, + }, + header: form.value.header, + footer: form.value.footer, + diy_data: form.value.diy_data, + }; + } }; // 截取document.location.search字符串内id/后面的所有字段