diff --git a/dolphinscheduler-ui/src/views/resource/file/upload/index.tsx b/dolphinscheduler-ui/src/views/resource/file/upload/index.tsx index 035b5a715a..b2aee1fabe 100644 --- a/dolphinscheduler-ui/src/views/resource/file/upload/index.tsx +++ b/dolphinscheduler-ui/src/views/resource/file/upload/index.tsx @@ -44,16 +44,24 @@ export default defineComponent({ const customRequest = ({ file }: any) => { state.uploadForm.name = file.name state.uploadForm.file = file.file + state.uploadFormNameRef.validate({ + trigger: 'input' + }) } const handleFile = () => { handleUploadFile(ctx.emit, hideModal, resetForm) } + const removeFile = () => { + state.uploadForm.name = '' + } + return { hideModal, customRequest, handleFile, + removeFile, ...toRefs(state) } }, @@ -70,7 +78,11 @@ export default defineComponent({ confirmLoading={this.saving} > - + {t('resource.file.upload_files')} diff --git a/dolphinscheduler-ui/src/views/resource/file/upload/use-form.ts b/dolphinscheduler-ui/src/views/resource/file/upload/use-form.ts index 58ec7dbe2b..6dff47db32 100644 --- a/dolphinscheduler-ui/src/views/resource/file/upload/use-form.ts +++ b/dolphinscheduler-ui/src/views/resource/file/upload/use-form.ts @@ -36,6 +36,7 @@ export function useForm() { const state = reactive({ uploadFormRef: ref(), + uploadFormNameRef: ref(), uploadForm: defaultValue(), saving: false, rules: {