feat(web): 优化静态文件展示
This commit is contained in:
@@ -210,3 +210,39 @@ export const formInputClearable = {
|
|||||||
clearable: true,
|
clearable: true,
|
||||||
clearValueOnEmpty: true,
|
clearValueOnEmpty: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function formInputFileStatic(field) {
|
||||||
|
return {
|
||||||
|
visibleOn: '${detail}',
|
||||||
|
type: 'input-table',
|
||||||
|
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'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,27 +1,15 @@
|
|||||||
import './dialog-permission.css'
|
import './dialog-permission.css'
|
||||||
import {apiGet, apiPost, horizontalFormOptions, inputFileFormItemCommonOptions, size100MB} from "../constants.js";
|
import {
|
||||||
|
apiGet,
|
||||||
|
apiPost,
|
||||||
|
formInputClearable,
|
||||||
|
formInputFileStatic,
|
||||||
|
horizontalFormOptions,
|
||||||
|
inputFileFormItemCommonOptions,
|
||||||
|
size100MB
|
||||||
|
} from "../constants.js";
|
||||||
import {resourceList} from "../../pages/index/tab-data.js";
|
import {resourceList} from "../../pages/index/tab-data.js";
|
||||||
|
|
||||||
function inputFileFormItemUpdateFieldOptions(target) {
|
|
||||||
let value = {}
|
|
||||||
value[target] = '${event.data.value}'
|
|
||||||
return {
|
|
||||||
onEvent: {
|
|
||||||
success: {
|
|
||||||
actions: [
|
|
||||||
// {
|
|
||||||
// actionType: 'setValue',
|
|
||||||
// componentId: 'permission_form',
|
|
||||||
// args: {
|
|
||||||
// value: value
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function detailForm() {
|
function detailForm() {
|
||||||
return {
|
return {
|
||||||
id: 'permission_form',
|
id: 'permission_form',
|
||||||
@@ -41,7 +29,7 @@ function detailForm() {
|
|||||||
label: '数据资源',
|
label: '数据资源',
|
||||||
required: true,
|
required: true,
|
||||||
multiple: false,
|
multiple: false,
|
||||||
size: 'lg',
|
size: 'md',
|
||||||
valueField: 'id',
|
valueField: 'id',
|
||||||
labelField: 'name',
|
labelField: 'name',
|
||||||
source: apiGet('${base}/data_resource/list'),
|
source: apiGet('${base}/data_resource/list'),
|
||||||
@@ -53,8 +41,11 @@ function detailForm() {
|
|||||||
type: 'textarea',
|
type: 'textarea',
|
||||||
label: '确权说明',
|
label: '确权说明',
|
||||||
name: 'description',
|
name: 'description',
|
||||||
|
...formInputClearable,
|
||||||
},
|
},
|
||||||
|
formInputFileStatic('evidenceIds'),
|
||||||
{
|
{
|
||||||
|
visibleOn: '${!detail}',
|
||||||
type: 'input-file',
|
type: 'input-file',
|
||||||
label: '相关材料',
|
label: '相关材料',
|
||||||
name: 'evidenceIds',
|
name: 'evidenceIds',
|
||||||
|
|||||||
Reference in New Issue
Block a user