Skip to content

Commit 532263f

Browse files
fix: 修复了项目申报表文件上传错误的bug
1 parent ac93e0f commit 532263f

File tree

2 files changed

+21
-21
lines changed

2 files changed

+21
-21
lines changed

src/pages/workDetail/schema_tiao_zhan_bei.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
"maxLength": 500,
8383
"order": 4
8484
},
85-
"项目申报书": {
85+
"项目申报表": {
8686
"type": "string",
8787
"widget": "customUpload",
8888
"title": "项目申报表",

src/store/formTemplate.ts

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
import { message } from "antd";
1+
import { message } from 'antd'
22

3-
const beforeUpload = (file: { size: number; }) => {
4-
console.log('文件大:');
5-
console.log(file.size);
6-
const isLt2M = file.size / 1024;
3+
const beforeUpload = (file: { size: number }) => {
4+
console.log('文件大:')
5+
console.log(file.size)
6+
const isLt2M = file.size / 1024
77
if (!isLt2M) {
8-
message.error('文件大小超过1kb限制!');
8+
message.error('文件大小超过1kb限制!')
99
}
10-
return isLt2M; // 如果文件大小超过2MB,则返回false阻止上传
11-
};
10+
return isLt2M // 如果文件大小超过2MB,则返回false阻止上传
11+
}
1212

1313
export const tempelate = [
1414
{
1515
type: 'object',
1616
labelWidth: 120,
1717
properties: {
18-
学院:{
18+
学院: {
1919
type: 'string',
2020
props: {},
2121
title: '学院',
@@ -30,12 +30,12 @@ export const tempelate = [
3030
order: 2,
3131
},
3232
项目类别: {
33-
enum: ["自然科学类学术论文", "哲学社会科学类社会调查报告和学术论文", "科技发明制作A类/B类", "红色专项"],
33+
enum: ['自然科学类学术论文', '哲学社会科学类社会调查报告和学术论文', '科技发明制作A类/B类', '红色专项'],
3434
type: 'string',
3535
title: '项目类别',
3636
widget: 'select',
3737
required: true,
38-
enumNames: ["自然科学类学术论文", "哲学社会科学类社会调查报告和学术论文", "科技发明制作A类/B类", "红色专项"],
38+
enumNames: ['自然科学类学术论文', '哲学社会科学类社会调查报告和学术论文', '科技发明制作A类/B类', '红色专项'],
3939
order: 3,
4040
},
4141
项目简介: {
@@ -85,22 +85,22 @@ export const tempelate = [
8585
required: true,
8686
props: {
8787
inputName: '项目PPT',
88-
accept: ['.pdf','.pptx'],
88+
accept: ['.pdf', '.pptx'],
8989
},
9090
order: 8,
9191
},
9292
视频等附件: {
93-
type:'string',
93+
type: 'string',
9494
widget: 'customUpload',
9595
title: '视频等附件(允许上传格式:.zip,.rar)',
96-
requierd:false,
97-
props:{
96+
requierd: false,
97+
props: {
9898
inputName: '视频等附件',
99-
accept: ['.zip','.rar'],
100-
beforeUpload
99+
accept: ['.zip', '.rar'],
100+
beforeUpload,
101101
},
102-
order:9
103-
}
102+
order: 9,
103+
},
104104
},
105105
displayType: 'column',
106106
},
@@ -277,7 +277,7 @@ export const tempelate = [
277277
maxLength: 500,
278278
order: 4,
279279
},
280-
项目申报书: {
280+
项目申报表: {
281281
type: 'string',
282282
widget: 'customUpload',
283283
title: '项目申报表',

0 commit comments

Comments
 (0)