1
0

fix(web): 优化文件上传适配

This commit is contained in:
2024-11-27 18:05:15 +08:00
parent f15bcc2f53
commit aba9a1716c
16 changed files with 318 additions and 114 deletions

View File

@@ -3,7 +3,7 @@ import {
apiGet,
apiPost,
formInputClearable,
formInputFileStatic,
formInputSingleFileStatic,
horizontalFormOptions,
inputFileFormItemCommonOptions,
size1GB,
@@ -12,7 +12,6 @@ import {
function detailForm() {
return {
debug: true,
type: 'form',
...horizontalFormOptions(),
horizontal: {
@@ -87,7 +86,7 @@ function detailForm() {
visibleOn: "${resourceType === 'FILE'}",
type: 'fieldSet',
body: [
formInputFileStatic('file', '数据文件'),
formInputSingleFileStatic('file', '数据文件'),
{
visibleOn: "${!detail}",
type: 'input-file',
@@ -96,10 +95,8 @@ function detailForm() {
name: 'file',
multiple: false,
required: true,
joinValues: false,
...inputFileFormItemCommonOptions('.zip', size1GB),
autoFill: {
fileId: '${value}'
}
},
]
},
@@ -143,29 +140,27 @@ function detailForm() {
visibleOn: "${resourceType === 'HDFS'}",
type: 'fieldSet',
body: [
formInputFileStatic('coreSiteFile', 'core-site.xml'),
formInputSingleFileStatic('coreSiteFile', 'core-site.xml'),
{
visibleOn: "${!detail}",
type: 'input-file',
label: 'core-site.xml',
name: 'coreSiteFile',
multiple: false,
required: true,
joinValues: false,
...inputFileFormItemCommonOptions('.xml'),
autoFill: {
coreSiteFileId: '${value}'
}
},
formInputFileStatic('hdfsSiteFile', 'hdfs-site.xml'),
formInputSingleFileStatic('hdfsSiteFile', 'hdfs-site.xml'),
{
visibleOn: "${!detail}",
type: 'input-file',
label: 'hdfs-site.xml',
name: 'hdfsSiteFile',
multiple: false,
required: true,
joinValues: false,
...inputFileFormItemCommonOptions('.xml'),
autoFill: {
hdfsSiteFileId: '${value}'
}
},
]
},
@@ -285,17 +280,16 @@ function detailForm() {
label: 'JSON格式',
language: 'json',
},
formInputFileStatic('exampleFile', '资源示例'),
formInputSingleFileStatic('exampleFile', '资源示例'),
{
visibleOn: "${!detail}",
type: 'input-file',
label: '资源示例',
name: 'exampleFile',
description: '可以上传用于作为格式示范的样例数据',
multiple: false,
joinValues: false,
...inputFileFormItemCommonOptions(undefined, size500MB),
autoFill: {
exampleFileId: '${value}'
}
},
]
}