hookehuyr

过滤掉标识为ignore的字段

<!--
* @Date: 2022-08-30 14:32:11
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-12-08 14:39:54
* @LastEditTime: 2022-12-08 14:57:16
* @FilePath: /data-table/src/components/AreaPickerField/index.vue
* @Description: 省市区选择控件
-->
......@@ -9,6 +9,7 @@
<div class="area-picker-field">
<div class="label">{{ item.component_props.label }}<span v-if="item.component_props.required">&nbsp;*</span></div>
<van-field
name="ignore"
v-model="fieldValue"
is-link
readonly
......@@ -19,6 +20,7 @@
:border="true"
/>
<van-field
name="ignore"
v-model="address"
:placeholder="item.component_props.placeholder"
@blur="onBlur"
......@@ -98,7 +100,6 @@ const validAreaPicker = () => {
} else {
show_empty.value = false;
}
console.warn(show_empty.value);
return !show_empty.value;
};
......
<!--
* @Date: 2022-08-29 14:31:20
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-12-08 14:37:28
* @LastEditTime: 2022-12-08 14:52:48
* @FilePath: /data-table/src/components/DesField/index.vue
* @Description: 描述文本控件
-->
......@@ -10,7 +10,7 @@
<div class="label">{{ item.component_props.label }}</div>
<van-field
v-model="item.component_props.desc"
:name="item.name"
name="ignore"
:readonly="true"
:border="false"
/>
......
<!--
* @Date: 2022-07-18 10:22:22
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-12-08 14:21:21
* @LastEditTime: 2022-12-08 14:57:55
* @FilePath: /data-table/src/views/index.vue
* @Description: 首页
-->
......@@ -401,8 +401,10 @@ const validOther = () => {
};
const onSubmit = async (values) => {
// 过滤掉标识为ignore的字段数据
let { ignore, ...rest_data } = values;
// 合并自定义字段到提交表单字段
postData.value = _.assign(postData.value, values);
postData.value = _.assign(postData.value, rest_data);
// 检查非表单输入项
if (validOther().status) {
// 通过验证
......