|
@@ -151,6 +151,11 @@ export const AddExampleFile = (props: AddExampleFileProps) => {
|
|
const onFinish = async (values: any) => {
|
|
const onFinish = async (values: any) => {
|
|
if (!values.filesUrl.fileList.length) {
|
|
if (!values.filesUrl.fileList.length) {
|
|
message.error('附件文件不能为空!')
|
|
message.error('附件文件不能为空!')
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ if (values.filesUrl.file?.error?.message) {
|
|
|
|
+ message.error(values.filesUrl.file?.error?.message)
|
|
|
|
+ return;
|
|
}
|
|
}
|
|
await addExampleFile({
|
|
await addExampleFile({
|
|
...values,
|
|
...values,
|
|
@@ -164,7 +169,7 @@ export const AddExampleFile = (props: AddExampleFileProps) => {
|
|
const onSubmit = () => {
|
|
const onSubmit = () => {
|
|
from.current?.submit()
|
|
from.current?.submit()
|
|
}
|
|
}
|
|
- const accpets = [".pdf", ".word", ".jpg"]
|
|
|
|
|
|
+ const accpets = [".pdf", ".doc", ".docx", ".jpg"]
|
|
|
|
|
|
const uploadProps: UploadProps = {
|
|
const uploadProps: UploadProps = {
|
|
async customRequest(option) {
|
|
async customRequest(option) {
|
|
@@ -194,7 +199,7 @@ export const AddExampleFile = (props: AddExampleFileProps) => {
|
|
|
|
|
|
return (
|
|
return (
|
|
<Modal
|
|
<Modal
|
|
- width="400px"
|
|
|
|
|
|
+ width="500px"
|
|
title="上传附件"
|
|
title="上传附件"
|
|
visible={true}
|
|
visible={true}
|
|
onOk={onSubmit}
|
|
onOk={onSubmit}
|