diff --git a/common/js/common/common.js b/common/js/common/common.js index 2f620483..0b37d69f 100644 --- a/common/js/common/common.js +++ b/common/js/common/common.js @@ -775,6 +775,7 @@ export const get_format_checks = (data, form_value, is_format = false, type = '' } return { is_error, error_text } }; + // 复选框和复选下拉框的校验逻辑 export const checkbox_range_handle = (data, form_value) => { const { min_num = '', max_num = '' } = data; diff --git a/pages/form-input/components/form-input/address.vue b/pages/form-input/components/form-input/address.vue index 05451017..86b50821 100644 --- a/pages/form-input/components/form-input/address.vue +++ b/pages/form-input/components/form-input/address.vue @@ -157,7 +157,7 @@ this.$emit('dataAddressChange', { value: e.detail.value, id: this.propDataId }); }, input_value_blur(e) { - // 重新编辑一下历史数据 + // 重新编辑一下历史数据 this.setData({ detailed_value: e.detail.value, }); diff --git a/pages/form-input/components/form-input/date-group.vue b/pages/form-input/components/form-input/date-group.vue index 4d08fab4..65a23360 100644 --- a/pages/form-input/components/form-input/date-group.vue +++ b/pages/form-input/components/form-input/date-group.vue @@ -137,7 +137,7 @@ // 校验数据 this.$emit('dataCheck', { is_error, error_text, value: new_time_data, id: this.propDataId }); // 发送数据 - this.$emit('dataChange', { value: new_time_data, id: this.propDataId }); + // this.$emit('dataChange', { value: new_time_data, id: this.propDataId }); }, date_handle(time0, time1) { if (isEmpty(time0) || isEmpty(time1)) { @@ -185,7 +185,7 @@ // 校验数据 this.$emit('dataCheck', { is_error, error_text, value: date, id: this.propDataId }); - this.$emit('dataChange', { value: date, id: this.propDataId }); + // this.$emit('dataChange', { value: date, id: this.propDataId }); }, mask_click() { this.z_index_change(''); diff --git a/pages/form-input/components/form-input/date.vue b/pages/form-input/components/form-input/date.vue index c3595dc4..6842b5b8 100644 --- a/pages/form-input/components/form-input/date.vue +++ b/pages/form-input/components/form-input/date.vue @@ -111,7 +111,7 @@ // 校验数据 this.$emit('dataCheck', { is_error, error_text, value: date, id: this.propDataId }); - this.$emit('dataChange', { value: date, id: this.propDataId }); + // this.$emit('dataChange', { value: date, id: this.propDataId }); }, mask_click() { this.z_index_change(''); diff --git a/pages/form-input/components/form-input/subform.vue b/pages/form-input/components/form-input/subform.vue index 51ad2bad..40b0e40f 100644 --- a/pages/form-input/components/form-input/subform.vue +++ b/pages/form-input/components/form-input/subform.vue @@ -298,10 +298,12 @@ const err_list = line_error[0].com_data; // 如果当前行有错误 if (err_list && err_list.common_config && err_list.common_config.is_error == '1') { + const key_type = ['select-multi', 'checkbox', 'radio-btns', 'select', 'address', 'date', 'upload-img', 'upload-video', 'upload-attachments', 'date-group']; + const name = key_type.includes(line_error[0].key) || ['select-multi', 'checkbox', 'radio-btns', 'select'].includes(err_list.type) ? '选择' : '填写'; if (err_list.common_config.error_text == '此项为必填项') { - return `请填写「${err_list.title}」`; + return `请${name}「${err_list.title}」`; } else { - return `请正确填写「${err_list.title}」`; + return `请正确${name}「${err_list.title}」`; } } } else { diff --git a/pages/form-input/components/form-input/upload.vue b/pages/form-input/components/form-input/upload.vue index a10cf0f1..0cf4acc2 100644 --- a/pages/form-input/components/form-input/upload.vue +++ b/pages/form-input/components/form-input/upload.vue @@ -80,7 +80,8 @@ this.setData({ form_value: list, }); - this.$emit('dataChange', { value: list, id: this.propDataId }); + const { is_error = '0', error_text = '' } = get_format_checks(com_data, list); + this.$emit('dataCheck', { is_error, error_text, value: list, id: this.propDataId }); } }, };