import { CSSProperties, MutableRefObject, ReactElement } from 'react'; type BtnStatus = '0' | '1' | '2'; export interface IAttachmentParams { /** * @description 是否java环境 * @default true */ isJava?: boolean; /** * @description 业务类型 */ busTypeCode?: string; /** * @description 模式 * @default NG3 */ mode?: string; /** * @description 产品 */ product?: string; openbymianframe?: '0' | '1'; /** * @description 状态 */ status?: 'add' | 'edit' | 'view'; /** * @description 模式 * @default winform */ oper?: 'web' | 'pb' | 'winfrom' | 'progress'; /** * @description 新增按钮,0,不可用|1,可用|2,隐藏 * @default 1 */ btnAdd?: BtnStatus; /** * @description 编辑按钮,0,不可用|1,可用|2,隐藏 * @default 1 */ btnEdit?: BtnStatus; /** * @description 查看按钮,0,不可用|1,可用|2,隐藏 * @default 1 */ btnView?: BtnStatus; /** * @description 删除按钮,0,不可用|1,可用|2,隐藏 * @default 1 */ btnDelete?: BtnStatus; /** * @description 导入按钮,0,不可用|1,可用|2,隐藏 * @default 0 */ addserverstuts?: BtnStatus; /** * @description 归档按钮,0,不可用|1,可用|2,隐藏 * @default 2 */ archivestuts?: BtnStatus; /** * @description 扫描按钮,0,不可用|1,可用|2,隐藏 * @default 1 */ btnScan?: BtnStatus; /** * @description 下载按钮,0,不可用|1,可用|2,隐藏 * @default 1 */ btnDownload?: BtnStatus; /** * @description 确认按钮,0,不可用|1,可用|2,隐藏 * @default 1 */ btnOk?: BtnStatus; /** * @description 取消按钮,0,不可用|1,可用|2,隐藏 * @default 1 */ btnCancel?: BtnStatus; /** * @description 取消按钮,0,不可用|1,可用|2,隐藏 * @default 2 */ btnWebAdd?: BtnStatus; /** * @description web确认按钮,0,不可用|1,可用|2,隐藏 * @default 2 */ btnWebOk?: BtnStatus; /** * @description chkSign * @default 0 */ chkSign?: '1' | '0'; /** * @description chkCheckIn * @default 0 */ chkCheckIn?: '1' | '0'; /** * @description 文件列表:0,不显示|1,显示 * @default 1 */ showlist?: '1' | '0'; /** * @description 文件类型:image,只能上传图片 */ filetype?: string; /** * @description 文件压缩:0,不压缩|1,压缩 * @default 0 */ zip?: '0' | '1'; /** * @description 文件数量:0,不限制数量 * @default 0 */ filenum?: number; /** * @description guid用于绑定附件窗口句柄,phid用于附件窗口初始化时缓存取数 */ guid?: string; /** * @description 附件表 * @default c_pfc_attachment */ asr_tbl?: string; /** * @description 业务类型 */ bustypecode?: string; /** * @description 业务url */ busurl?: string; /** * @description 业务表 */ tbl?: string; /** * @description 业务主键 */ businessPhId?: string; /** * @description 业务审批标志 */ approved?: string; /** * @description 业务工作流类型 */ bizid?: string; /** * @description 业务主键 */ pkstr?: string; /** * @description 组织 */ orgid?: string; /** * @description 操作员主键 */ fill?: string; /** * @description 操作员名称 */ fillname?: string; /** * @description dbToken */ dbToken?: string; } type PermissionEnum = 0 | 1 | 2; export interface NGLabelAttachmentPermission { /** * @description 新增 * @default 1 */ add?: PermissionEnum; /** * @description 删除 * @default 1 */ delete?: PermissionEnum; /** * @description 预览 * @default 1 */ preview?: PermissionEnum; /** * @description 下载 * @default 1 */ download?: PermissionEnum; } export interface ILabelAttachmentProps { /** * @description 打开附件控件时分配的操作guid * @default - */ asrSessionGuid?: string; /** * @description 上传人编码 * @default 用户登录信息 */ asrFill?: string; /** * @description 上传人名称 * @default 用户登录信息 */ asrFillName?: string; /** * @description 组织phid * @default 用户登录信息 */ orgId?: string; /** * @description 账套号 * @default 用户登录信息 */ uCode?: string; /** * @description 业务表名 * @default - */ asrTable: string; /** * @description 业务单据phId * @default - */ asrCode: string; /** * @description 关联操作的业务附件表名 * @default c_pfc_attachment */ asrAttachTable?: string; /** * @description 业务类型编码 * @default - */ busTypeCode?: string; /** * @description 业务单据url * @default - */ busUrl?: string; /** * @description 审批状态 * @default 0 */ approved?: 0 | 1; /** * @description 按钮权限 * @default { add: 1, delete: 1, preview: 1, download: 1 } */ permission?: NGLabelAttachmentPermission; /** * @description 是否控制下载时不要加水印 0:不控制 1:控制不加水印 * @default 0 */ attachWaterMarkSetDownload?: 0 | 1; /** * @description 是否允许附件下载 0:不控制 1:是 2:否 * @default 0 */ downloadAttachment?: 0 | 1 | 2; /** * @description 控件状态 * @default add */ status?: 'add' | 'edit' | 'view'; /** * @description 最大上传文件数 * @default 10 */ maxCount?: number; /** * @description 获取Api的ref,传入ref时会自动为该ref的current属性赋值API * @default - */ apiRef?: MutableRefObject<{}>; /** * @description 是否显示进度条 * @default false */ isProgress?: boolean; /** * @description 替代默认打开逻辑,自定义打开附件的逻辑 * @default - */ customOpenTab?: (title: string, path: string) => void; /** * @description 可上传的文件类型(格式同Upload组件的accept) * @default - */ accept?: string; } export interface NGTableAttachmentPermission { /** * @description 新增 * @default 1 */ add?: PermissionEnum; /** * @description 共享 * @default 1 */ share?: PermissionEnum; /** * @description 删除 * @default 1 */ delete?: PermissionEnum; /** * @description 编辑 * @default 1 */ edit?: PermissionEnum; /** * @description 查看 * @default 1 */ view?: PermissionEnum; /** * @description 预览 * @default 1 */ preview?: PermissionEnum; /** * @description 下载 * @default 1 */ download?: PermissionEnum; /** * @description 打包下载 * @default 1 */ zipDownload?: PermissionEnum; /** * @description 编辑分类 * @default 1 */ editCategory?: PermissionEnum; } export interface ITableAttachmentApiProps { colAttach?: 0 | 1; /** * @description 打开附件控件时分配的操作guid * @default - */ asrSessionGuid?: string; /** * @description 上传人编码 * @default 用户登录信息 */ asrFill?: string; /** * @description 上传人名称 * @default 用户登录信息 */ asrFillName?: string; /** * @description 组织phid * @default 用户登录信息 */ orgId?: string; /** * @description 账套号 * @default 用户登录信息 */ uCode?: string; /** * @description 审批状态 * @default 0 */ approved?: 0 | 1; /** * @description 业务表名 * @default - */ asrTable: string; /** * @description 业务单据phId * @default - */ asrCode: string; /** * @description 关联操作的业务附件表名 * @default c_pfc_attachment */ asrAttachTable?: string; /** * @description 业务类型编码 * @default - */ busTypeCode?: string; /** * @description 业务单据url * @default - */ busUrl?: string; /** * @description 是否控制下载时不要加水印 0:不控制 1:控制不加水印 * @default 0 */ attachWaterMarkSetDownload?: 0 | 1; /** * @description 控件状态 * @default add */ status?: 'add' | 'edit' | 'view'; /** * @description 按钮权限 * @default { add: 1, delete: 1, edit: 1, view: 1, preview: 1, download: 1, zipDownload: 1 } */ permission?: NGTableAttachmentPermission; /** * @description 替代默认打开逻辑,自定义打开附件的逻辑(编辑,查看,预览通用) * @default - */ customOpenTab?: (title: string, path: string) => void; /** * @description 可上传的文件类型(格式同Upload组件的accept) * @default - */ accept?: string; /** * @description 附件加载完成的回调 * @default - */ onLoad?: (args: any) => void; /** * @description 附件保存成功后的回调 * @default - */ onSave?: (args: any) => void; } export interface ITableAttachmentProps extends ITableAttachmentApiProps { /** * @description 附件列表编辑是否被禁用 * @default - */ disabled?: boolean; /** * @description 按钮权限 * @default { add: 1, delete: 1, edit: 1, view: 1, preview: 1, download: 1, zipDownload: 1 } */ permission?: NGTableAttachmentPermission; /** * @description 是否允许附件下载 0:不控制 1:是 2:否 * @default 0 */ downloadAttachment?: 0 | 1 | 2; /** * @description 区分附件下载方式 0:文件流下载 1:链接下载 * @default 0 */ downloadMethod?: 0 | 1; /** * @description 控件状态 * @default add */ status?: 'add' | 'edit' | 'view'; /** * @description 最大上传文件数 默认或传入0等非正整数即不限制 * @default 0 */ maxCount?: number; /** * @description 组件最外层容器样式 * @default {} */ style?: CSSProperties; /** * @description 分类样式 * @default {} */ categoryStyle?: CSSProperties; /** * @description 表格样式 * @default { minHeight: 180 } */ tableStyle?: CSSProperties; /** * @description 是否受控(通过api打开表格附件时设置该属性可手动控制保存,点击确定时会返回主要参数和保存的方法) * @default true */ control?: boolean; /** * @description 获取Api的ref,传入ref时会自动为该ref的current属性赋值API * @default - */ apiRef?: MutableRefObject; /** * @description 获取附件上传Upload组件的ref * @default - */ uploadRef?: MutableRefObject; } export interface IImageAttachmentShowProps extends ITableAttachmentProps { /** * @description 自定义打开附件列表按钮 * @default null */ button?: string | ReactElement; /** * @description 预览图片宽度 * @default 50 */ imageWidth?: number; /** * @description 预览图片高度 * @default 50 */ imageHeight?: number; /** * @description 预览图片最大展示数量,超过的会显示... * @default 5 */ maxShowCount?: number; /** * @description 关闭模态框时触发的回调 * @default - */ onCloseModal: (api: Object) => void; } export interface ITableAttachmentApi { /** * @description 打开附件控件时分配的操作guid * @default - */ asrSessionGuid?: string; /** * @description 上传人编码 * @default 用户登录信息 */ asrFill?: string; /** * @description 上传人名称 * @default 用户登录信息 */ asrFillName?: string; /** * @description 业务表名 * @default - */ asrTable: string; /** * @description 业务单据phId * @default - */ asrCode: string; /** * @description 关联操作的业务附件表名 * @default c_pfc_attachment */ asrAttachTable?: string; /** * @description 业务类型编码 * @default - */ busTypeCode?: string; /** * @description 组织phid * @default 用户登录信息 */ orgId?: string; /** * @description 业务单据url * @default - */ busUrl?: string; /** * @description 账套号 * @default 用户登录信息 */ uCode?: string; /** * @description 附件信息 * @default - */ tableAttachInfo: Array; /** * @description 工作流附件信息 * @default - */ workFlowAttachInfo: Array; /** * @description 附件列表 * @default - */ attachmentRecordList: Array; /** * @description 附件工作流状态 * @default - */ attachmentAuditStatus: Object; /** * @description 获取附件信息 * @default - */ getTableAttachInfo: Function; /** * @description 编辑/查看附件 * @default - */ handleEditOrView: Function; /** * @description 删除附件 * @default - */ handleDelete: Function; /** * @description 下载附件 * @default - */ handleDownload: Function; /** * @description 打包下载附件 * @default - */ handleZipDownload: Function; /** * @description 预览附件 * @default - */ handlePreview: Function; /** * @description 编辑附件分类 * @default - */ handleEditCategory: Function; /** * @description 改变附件共享类型 * @default - */ handleChangeShareType: Function; /** * @description 保存附件 * @default - */ handleSave: Function; /** * @description 附件合法性校验 * @default - */ handleValid: Function; } export {};