Commit a9144f5c by yancanhua

feat: 上传组件修改

1 parent 36081662
......@@ -29,7 +29,6 @@ const rules = ref({});
//加载中
const pageLoading = ref(false);
watch(() => props.leafNodes, (nodes) => {
pageLoading.value = true;
columnsList.value = (nodes || []).map((item: any) => ({ ...item, value: getValueText(item), }));
......@@ -125,8 +124,17 @@ async function validate(): Promise<CustomizeFormValidateResult> {
let message = '';
columnsList.value.forEach((item: any) => {
if (item.required == 1 && !item.value) {
let title = '请选择';
const inputList = ['text_input', 'textarea_input', 'number_input'];
const dropdownList = ['image_upload', 'video_upload'];
if (inputList.includes(item.interactionType)) {
title = '请输入';
}
if (dropdownList.includes(item.interactionType)) {
title = '请上传';
}
success = false;
message = message ? message : item.nodeName;
message = message ? message : title + item.nodeName;
}
});
return {
......
......@@ -63,8 +63,13 @@ function setupdate() {
valueKey: item || '',
};
});
props.item.value = JSON.stringify(valueList || []);
emit("update", JSON.stringify(valueList || []));
if (valueList.length) {
props.item.value = JSON.stringify(valueList || []);
emit("update", JSON.stringify(valueList || []));
} else {
props.item.value = '';
emit("update", '');
}
}
</script>
......
......@@ -71,8 +71,13 @@ function handleDelete(item: string) {
}
function updateData() {
props.item.value = JSON.stringify(pickerValue.value);
emit("update", JSON.stringify(pickerValue.value));
if (pickerValue.value.length) {
props.item.value = JSON.stringify(pickerValue.value);
emit("update", JSON.stringify(pickerValue.value));
} else {
props.item.value = '';
emit("update", '');
}
}
</script>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!