表单优化

master
gongfuxiang 2025-09-26 18:34:50 +08:00
parent bb3fd4737c
commit f94b72ee59
5 changed files with 25 additions and 16 deletions

View File

@ -209,11 +209,12 @@
"setting" : {
"urlCheck" : false
},
"dynamicLib": {//
"editorLib": {
"provider": "swan-editor"
}
}
"dynamicLib" : {
//
"editorLib" : {
"provider" : "swan-editor"
}
}
},
"mp-toutiao" : {
"usingComponents" : true,

View File

@ -43,7 +43,7 @@
<uni-th align="left">{{items.name}}</uni-th>
</block>
</uni-tr>
<block v-for="(items, index) in item.value">
<block v-for="(items, indexs) in item.value" :key="indexs">
<uni-tr v-if="(items || null) != null">
<block v-for="(itemss, indexss) in items" :key="indexss">
<uni-th align="left">

View File

@ -51,7 +51,7 @@
</view>
<!-- 手机 -->
<view v-else-if="item.key == 'phone'">
<component-phone :propValue="item.com_data" :propKey="propKey" :propDataFormId="propDataFormId" :propDataId="item.id" :propMobile="mobile" :propStyle="component_style" :propDirection="flex_direction" @dataCheck="data_check" @dataChange="data_change" @dataCodeCheck="data_code_check" @dataCodeChage="data_code_change" @zIndexChange="z_index_change"></component-phone>
<component-phone :propValue="item.com_data" :propKey="propKey" :propFormInputId="propFormInputId" :propDataId="item.id" :propMobile="mobile" :propStyle="component_style" :propDirection="flex_direction" @dataCheck="data_check" @dataChange="data_change" @dataCodeCheck="data_code_check" @dataCodeChage="data_code_change" @zIndexChange="z_index_change"></component-phone>
</view>
<!-- 密码 -->
<view v-else-if="item.key == 'pwd'" :style="item.com_data.common_style">
@ -83,7 +83,7 @@
</view>
<!-- 上传视频或图片 -->
<view v-else-if="['upload-img', 'upload-video'].includes(item.key)" :class="flex_direction == 'row' ? 'padding-vertical-sm' : ''">
<component-upload :propValue="item.com_data" :propType="item.key == 'upload-img' ? 'img' : ( item.key == 'upload-video' ? 'video' : 'file')" :propKey="propKey" :propDataFormId="propDataFormId" :propDataId="item.id" :propMobile="mobile" :propStyle="component_style" :propDirection="flex_direction" @dataChange="data_change"></component-upload>
<component-upload :propValue="item.com_data" :propType="item.key == 'upload-img' ? 'img' : ( item.key == 'upload-video' ? 'video' : 'file')" :propKey="propKey" :propFormInputId="propFormInputId" :propDataId="item.id" :propMobile="mobile" :propStyle="component_style" :propDirection="flex_direction" @dataChange="data_change"></component-upload>
</view>
<!-- 定位 -->
<view v-else-if="item.key == 'position'">
@ -106,7 +106,7 @@
:propTitleStyle="title_style"
:propHelpIconStyle="help_icon_style"
:propFieldLabelStyle="field_label_style"
:propDataFormId="propDataFormId"
:propFormInputId="propFormInputId"
@helpIconEvent="subform_help_icon_event"
@subformDataChange="subform_data_change"
@zIndexChange="z_index_change"
@ -115,7 +115,7 @@
<!-- #ifdef H5 || MP-WEIXIN || MP-QQ -->
<!-- 上传文件 -->
<view v-else-if="item.key == 'upload-attachments'">
<component-upload :propValue="item.com_data" propType="file" :propKey="propKey" :propDataFormId="propDataFormId" :propDataId="item.id" :propMobile="mobile" :propStyle="component_style" :propDirection="flex_direction" @dataChange="data_change"></component-upload>
<component-upload :propValue="item.com_data" propType="file" :propKey="propKey" :propFormInputId="propFormInputId" :propDataId="item.id" :propMobile="mobile" :propStyle="component_style" :propDirection="flex_direction" @dataChange="data_change"></component-upload>
</view>
<!-- #endif -->
<!-- #ifdef APP-PLUS || H5 || MP-WEIXIN -->
@ -197,7 +197,8 @@ export default {
type: Object,
default: () => {},
},
propDataFormId: {
// id
propFormInputId: {
type: [String, Number],
default: '',
},

View File

@ -10,7 +10,7 @@
<view v-if="is_show_heading_title == '1'" class="head-title flex-row bg-white" :style="heading_title_style + (overall_config.type_value == 'default' ? '' : ('width:' + overall_config.custom_width * 2 + 'rpx;'))">{{ form_name }}</view>
<view class="data-list bg-white" :style="overall_config.type_value == 'default' ? '' : ('width:' + overall_config.custom_width * 2 + 'rpx;height:' + overall_config.custom_height * 2 + 'rpx')">
<!-- form表单子组件显示 -->
<form-input-base ref="componentForm" :propKey="propKey" :propConfig="propValue.config" :propDataFormId="propDataFormId" @onSubmitEvent="submit_event" />
<form-input-base ref="componentForm" :propKey="propKey" :propConfig="propValue.config" :propFormInputId="propFormInputId" @onSubmitEvent="submit_event" />
</view>
</view>
<!-- #endif -->
@ -29,7 +29,7 @@
<view v-if="is_show_heading_title == '1'" class="head-title flex-row bg-white" :style="heading_title_style + (overall_config.type_value == 'default' ? '' : ('width:' + overall_config.custom_width * 2 + 'rpx;'))">{{ form_name }}</view>
<view class="data-list bg-white" :style="overall_config.type_value == 'default' ? '' : ('width:' + overall_config.custom_width * 2 + 'rpx;height:' + overall_config.custom_height * 2 + 'rpx')">
<!-- form表单子组件显示 -->
<form-input-base ref="componentForm" :propKey="propKey" :propConfig="propValue.config" :propDataFormId="propDataFormId" @onSubmitEvent="submit_event" />
<form-input-base ref="componentForm" :propKey="propKey" :propConfig="propValue.config" :propFormInputId="propFormInputId" @onSubmitEvent="submit_event" />
</view>
</view>
</scroll-view>
@ -70,7 +70,13 @@ export default {
type: Object,
default: () => ({}),
},
propDataFormId: {
// id
propFormInputId: {
type: [String, Number],
default: '',
},
// id
propFormInputDataId: {
type: [String, Number],
default: '',
},
@ -166,7 +172,8 @@ export default {
app.globalData.showToast(message);
} else {
const params = {
forminput_id: this.propDataFormId,
forminput_id: this.propFormInputId,
id: this.propFormInputDataId,
...submit_data
}
this.setData({

View File

@ -2,7 +2,7 @@
<view :class="theme_view">
<block v-if="(data || null) != null && (data.config || null) != null">
<!-- diy模块 -->
<component-form-input :propValue="data" :propDataFormId="data.id" :propKey="random_value" @onLocationBack="user_back_choice_location" propSuccessJumpUrl="/pages/form-input-data/form-input-data" :propIsDebug="(params.is_debug || 0) == 1">
<component-form-input :propValue="data" :propFormInputId="data.id" :propFormInputDataId="data.forminput_data_id || ''" :propKey="random_value" @onLocationBack="user_back_choice_location" propSuccessJumpUrl="/pages/form-input-data/form-input-data" :propIsDebug="(params.is_debug || 0) == 1">
<!-- 底部内容 -->
<template slot="diy-bottom-content">
<!-- 结尾 -->