fix(web): 优化文件上传适配
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
const information = {
|
||||
debug: false,
|
||||
debug: true,
|
||||
// baseUrl: '',
|
||||
baseUrl: 'http://127.0.0.1:20080',
|
||||
title: '可信供给中心',
|
||||
@@ -170,6 +170,13 @@ export const userStateMapping = [
|
||||
mappingItem('禁用', 'DISABLED', 'bg-danger'),
|
||||
]
|
||||
|
||||
export const confirmationStateMapping = [
|
||||
mappingItem('草稿', 'DRAFT', 'bg-primary'),
|
||||
mappingItem('审查中', 'CHECKING', 'bg-warning'),
|
||||
mappingItem('通过', 'NORMAL', 'bg-success'),
|
||||
mappingItem('驳回', 'REJECT', 'bg-danger'),
|
||||
]
|
||||
|
||||
function api(method, url) {
|
||||
return {
|
||||
method: method,
|
||||
@@ -211,7 +218,47 @@ export const formInputClearable = {
|
||||
clearValueOnEmpty: true,
|
||||
}
|
||||
|
||||
export function formInputFileStatic(field, label) {
|
||||
const formInputFileStaticColumns = [
|
||||
{
|
||||
name: 'filename',
|
||||
label: '文件名',
|
||||
},
|
||||
{
|
||||
type: 'operation',
|
||||
label: '操作',
|
||||
width: 140,
|
||||
buttons: [
|
||||
{
|
||||
type: 'action',
|
||||
label: '预览',
|
||||
level: 'link',
|
||||
icon: 'fas fa-eye'
|
||||
},
|
||||
{
|
||||
type: 'action',
|
||||
label: '下载',
|
||||
level: 'link',
|
||||
icon: 'fa fa-download'
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
export function formInputSingleFileStatic(field, label) {
|
||||
return {
|
||||
visibleOn: '${detail}',
|
||||
type: 'control',
|
||||
label: label,
|
||||
required: true,
|
||||
body: {
|
||||
type: 'table',
|
||||
source: `\${${field}|asArray}`,
|
||||
columns: formInputFileStaticColumns,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export function formInputMultiFileStatic(field, label) {
|
||||
return {
|
||||
visibleOn: '${detail}',
|
||||
type: 'input-table',
|
||||
@@ -219,30 +266,6 @@ export function formInputFileStatic(field, label) {
|
||||
name: field,
|
||||
required: true,
|
||||
resizable: false,
|
||||
columns: [
|
||||
{
|
||||
name: 'filename',
|
||||
label: '文件名',
|
||||
},
|
||||
{
|
||||
type: 'operation',
|
||||
label: '操作',
|
||||
width: 140,
|
||||
buttons: [
|
||||
{
|
||||
type: 'action',
|
||||
label: '预览',
|
||||
level: 'link',
|
||||
icon: 'fas fa-eye'
|
||||
},
|
||||
{
|
||||
type: 'action',
|
||||
label: '下载',
|
||||
level: 'link',
|
||||
icon: 'fa fa-download'
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
columns: formInputFileStaticColumns,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user