From 6bb08cc7574109ea0c590e18cd372ed1e33df7ca Mon Sep 17 00:00:00 2001 From: konbai <1527468660@qq.com> Date: Wed, 19 Jul 2023 23:51:04 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E7=A7=BB=E9=99=A4=E6=B5=81=E7=A8=8B?= =?UTF-8?q?=E8=A1=A8=E5=8D=95=20formConfig=20=E5=B1=9E=E6=80=A7=EF=BC=8C?= =?UTF-8?q?=E8=A1=A8=E5=8D=95=E9=85=8D=E7=BD=AE=E4=BF=A1=E6=81=AF=E9=83=BD?= =?UTF-8?q?=E6=94=BE=E4=B8=80=E8=B5=B7=E4=BE=BF=E4=BA=8E=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/workflow/form/index.vue | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/src/views/workflow/form/index.vue b/src/views/workflow/form/index.vue index a98918d..b5eb6f8 100644 --- a/src/views/workflow/form/index.vue +++ b/src/views/workflow/form/index.vue @@ -68,7 +68,7 @@ - + @@ -159,10 +159,6 @@ const data = reactive>({ const { queryParams, form, rules } = toRefs>(data); -const formJson = reactive({"widgetList": [], "formConfig":{}}); -const formData = reactive({}) - - /** 查询岗位列表 */ const getList = async () => { loading.value = true; @@ -211,10 +207,7 @@ const handleUpdate = (row?: FormVO) => { const formId = row?.formId || ids.value[0]; const res = await getForm(formId); form.value = res.data; - vfDesignerRef.value.setFormJson({ - "formConfig": JSON.parse(form.value.formConfig), - "widgetList": JSON.parse(form.value.content) - }); + vfDesignerRef.value.setFormJson(form.value.content); }) } /** 查看表单操作 */ @@ -222,8 +215,7 @@ const handleDetail = (row: FormVO) => { render.visible = true; render.title = '查看表单详情'; nextTick(async () => { - formJson.formConfig = eval("(" + row.formConfig + ")"); - formJson.widgetList = eval("(" + row.content + ")"); + vfRenderRef.value.setFormJson(row.content || {formConfig: {}, widgetList: []}); }); } @@ -244,10 +236,8 @@ const handleExport = () => { } const submitForm = () => { - let formJson = vfDesignerRef.value.getFormJson(); - console.log("formJson => ", formJson) - form.value.formConfig = JSON.stringify(formJson.formConfig); - form.value.content = JSON.stringify(formJson.widgetList); + const formJson = vfDesignerRef.value.getFormJson(); + form.value.content = JSON.stringify(formJson); nextTick(async () => { form.value.formId ? await updateForm(form.value) : await addForm(form.value); proxy?.$modal.msgSuccess("操作成功");