From d72ebfd1d13c620e8c87918417ee68038f415eb2 Mon Sep 17 00:00:00 2001 From: lanyuanxiaoyao Date: Wed, 27 Nov 2024 09:59:06 +0800 Subject: [PATCH] =?UTF-8?q?feat(web):=20=E4=BC=98=E5=8C=96=E9=9D=99?= =?UTF-8?q?=E6=80=81=E6=96=87=E4=BB=B6=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gringotts-frontend/components/constants.js | 36 +++++++++++++++++++ .../permission/dialog-permission.js | 35 +++++++----------- 2 files changed, 49 insertions(+), 22 deletions(-) diff --git a/gringotts-frontend/components/constants.js b/gringotts-frontend/components/constants.js index 26a07a2..cafda85 100644 --- a/gringotts-frontend/components/constants.js +++ b/gringotts-frontend/components/constants.js @@ -210,3 +210,39 @@ export const formInputClearable = { clearable: 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' + } + ] + } + ] + } +} diff --git a/gringotts-frontend/components/permission/dialog-permission.js b/gringotts-frontend/components/permission/dialog-permission.js index 82a5b41..5ff14ae 100644 --- a/gringotts-frontend/components/permission/dialog-permission.js +++ b/gringotts-frontend/components/permission/dialog-permission.js @@ -1,27 +1,15 @@ 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"; -function inputFileFormItemUpdateFieldOptions(target) { - let value = {} - value[target] = '${event.data.value}' - return { - onEvent: { - success: { - actions: [ - // { - // actionType: 'setValue', - // componentId: 'permission_form', - // args: { - // value: value - // } - // } - ] - } - } - } -} - function detailForm() { return { id: 'permission_form', @@ -41,7 +29,7 @@ function detailForm() { label: '数据资源', required: true, multiple: false, - size: 'lg', + size: 'md', valueField: 'id', labelField: 'name', source: apiGet('${base}/data_resource/list'), @@ -53,8 +41,11 @@ function detailForm() { type: 'textarea', label: '确权说明', name: 'description', + ...formInputClearable, }, + formInputFileStatic('evidenceIds'), { + visibleOn: '${!detail}', type: 'input-file', label: '相关材料', name: 'evidenceIds',