hookehuyr

过滤掉标识为ignore的字段

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