diff --git a/components-diy/diy-form.vue b/components-diy/diy-form.vue index 0ad6e55..7e0caa7 100644 --- a/components-diy/diy-form.vue +++ b/components-diy/diy-form.vue @@ -283,12 +283,15 @@ export default { return; } + // 获得保单数据 + const submitFormData = this.getFormData(); + // 提交到后端 this.$api.sendRequest({ url: '/form/api/form/create', data: { form_id: this.value.form_id || 0, - form_data: JSON.stringify(this.getFormData()), + form_data: typeof submitFormData === 'string' ? submitFormData : JSON.stringify(submitFormData), component_id: this.value.id || '', form_name: this.value.form_name || '默认表单' }, diff --git a/components/ns-newform/ns-newform.vue b/components/ns-newform/ns-newform.vue index a5a1202..7b65142 100644 --- a/components/ns-newform/ns-newform.vue +++ b/components/ns-newform/ns-newform.vue @@ -517,11 +517,11 @@ export default { // 标签与输入框间距 nameStyle() { if (this.mode === 'vertical') { - return this.$util.objToStyle({}); + return {}; } - return this.$util.objToStyle({ + return { 'margin-right': `${this.config.labelGap}rpx` - }); + }; }, // 输入框样式(全局,未指定 item 时使用) inputStyle() { diff --git a/pages_tool/form/form.vue b/pages_tool/form/form.vue index eadac21..ed304fe 100644 --- a/pages_tool/form/form.vue +++ b/pages_tool/form/form.vue @@ -85,7 +85,7 @@ url: '/form/api/form/create', data: { form_id: this.id, - form_data: JSON.stringify(this.$refs.form.formData) + form_data: typeof this.$refs.form.formData === 'string' ? this.$refs.form.formData : JSON.stringify(this.$refs.form.formData) }, success: res => { if (res.code == 0) { diff --git a/pages_tool/form/formdata.vue b/pages_tool/form/formdata.vue index 7504ae9..e53a3ae 100644 --- a/pages_tool/form/formdata.vue +++ b/pages_tool/form/formdata.vue @@ -158,7 +158,7 @@ export default { url: '/form/api/form/create', data: { form_id: this.id, - form_data: JSON.stringify(formData), + form_data: typeof formData === 'string' ? formData : JSON.stringify(formData), uniacid: this.uniacid }, success: res => {