feat(web): 增加数据资源更新接口
This commit is contained in:
@@ -21,6 +21,10 @@ function detailForm() {
|
||||
left: 2,
|
||||
},
|
||||
body: [
|
||||
{
|
||||
type: 'hidden',
|
||||
name: 'id',
|
||||
},
|
||||
{
|
||||
type: 'input-text',
|
||||
name: 'name',
|
||||
@@ -94,9 +98,14 @@ function detailForm() {
|
||||
{
|
||||
visibleOn: "${!static}",
|
||||
type: 'input-file',
|
||||
name: 'fileId',
|
||||
label: '数据文件',
|
||||
description: '只适合小于1GB的资源文件使用,大文件请使用其他资源类型',
|
||||
name: 'filename',
|
||||
required: true,
|
||||
...inputFileFormItemCommonOptions('.zip', size1GB),
|
||||
autoFill: {
|
||||
fileId: '${value|default:undefined}'
|
||||
}
|
||||
},
|
||||
]
|
||||
},
|
||||
@@ -150,8 +159,12 @@ function detailForm() {
|
||||
visibleOn: "${!static}",
|
||||
type: 'input-file',
|
||||
label: 'core-site.xml',
|
||||
name: 'coreSiteFileId',
|
||||
name: 'coreSiteFilename',
|
||||
required: true,
|
||||
...inputFileFormItemCommonOptions('.xml'),
|
||||
autoFill: {
|
||||
coreSiteFileId: '${value|default:undefined}'
|
||||
}
|
||||
},
|
||||
{
|
||||
visibleOn: "${static}",
|
||||
@@ -163,8 +176,12 @@ function detailForm() {
|
||||
visibleOn: "${!static}",
|
||||
type: 'input-file',
|
||||
label: 'hdfs-site.xml',
|
||||
name: 'hdfsSiteFileId',
|
||||
name: 'hdfsSiteFilename',
|
||||
required: true,
|
||||
...inputFileFormItemCommonOptions('.xml'),
|
||||
autoFill: {
|
||||
hdfsSiteFileId: '${value|default:undefined}'
|
||||
}
|
||||
},
|
||||
]
|
||||
},
|
||||
@@ -229,7 +246,14 @@ function detailForm() {
|
||||
]
|
||||
},
|
||||
{
|
||||
visibleOn: "${formatType === 'JSON'}",
|
||||
visibleOn: "${formatType === 'JSON' && static}",
|
||||
type: 'editor',
|
||||
name: 'jsonSchemaText',
|
||||
label: 'JSON格式',
|
||||
language: 'json',
|
||||
},
|
||||
{
|
||||
visibleOn: "${formatType === 'JSON' && !static}",
|
||||
type: 'json-schema-editor',
|
||||
name: 'jsonSchema',
|
||||
label: 'JSON格式',
|
||||
@@ -239,7 +263,14 @@ function detailForm() {
|
||||
mini: true,
|
||||
},
|
||||
{
|
||||
visibleOn: "${formatType === 'JSON_LINE'}",
|
||||
visibleOn: "${formatType === 'JSON_LINE' && static}",
|
||||
type: 'editor',
|
||||
name: 'jsonLineSchemaText',
|
||||
label: 'JSON格式',
|
||||
language: 'json',
|
||||
},
|
||||
{
|
||||
visibleOn: "${formatType === 'JSON_LINE' && !static}",
|
||||
type: 'json-schema-editor',
|
||||
name: 'jsonLineSchema',
|
||||
label: 'JSON格式',
|
||||
@@ -249,7 +280,14 @@ function detailForm() {
|
||||
mini: true,
|
||||
},
|
||||
{
|
||||
visibleOn: "${formatType === 'CSV'}",
|
||||
visibleOn: "${formatType === 'CSV' && static}",
|
||||
type: 'editor',
|
||||
name: 'csvSchemaText',
|
||||
label: 'JSON格式',
|
||||
language: 'json',
|
||||
},
|
||||
{
|
||||
visibleOn: "${formatType === 'CSV' && !static}",
|
||||
type: 'json-schema-editor',
|
||||
name: 'csvSchema',
|
||||
label: 'CSV格式',
|
||||
@@ -273,9 +311,12 @@ function detailForm() {
|
||||
visibleOn: "${!static}",
|
||||
type: 'input-file',
|
||||
label: '资源示例',
|
||||
name: 'exampleFilename',
|
||||
description: '可以上传用于作为格式示范的样例数据',
|
||||
name: 'exampleFileId',
|
||||
...inputFileFormItemCommonOptions(undefined, size500MB),
|
||||
autoFill: {
|
||||
exampleFileId: '${value|default:undefined}'
|
||||
},
|
||||
},
|
||||
]
|
||||
}
|
||||
@@ -326,4 +367,31 @@ export function resourceDetailDialog() {
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export function resourceEditeDialog() {
|
||||
return {
|
||||
actionType: 'dialog',
|
||||
dialog: {
|
||||
title: '账号详情',
|
||||
size: 'md',
|
||||
actions: [
|
||||
{
|
||||
type: 'reset',
|
||||
label: '重置',
|
||||
},
|
||||
{
|
||||
type: 'submit',
|
||||
label: '确定',
|
||||
level: 'primary',
|
||||
}
|
||||
],
|
||||
body: {
|
||||
...detailForm(),
|
||||
debug: true,
|
||||
api: apiPost('${base}/data_resource/update'),
|
||||
initApi: apiGet('${base}/data_resource/detail/${id}'),
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user