更新文件上传时的逻辑操作

master
于肖磊 2025-10-22 18:21:54 +08:00
parent 766b29901f
commit a311d2fd39
6 changed files with 11 additions and 7 deletions

View File

@ -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;

View File

@ -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,
});

View File

@ -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('');

View File

@ -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('');

View File

@ -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 {

View File

@ -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 });
}
},
};