import React from "react"; import XBaseDisplay, { XBaseDisplayProps } from "../base/XBaseDisplay"; export interface XFileBrowserProps extends XBaseDisplayProps { /** * 服务器保存地址 */ saveUrl?: string; /** * 服务器上传地址 */ uploadUrl?: string; /** * 服务器下载地址 */ downloadUrl?: string; /** * 服务器移动地址 */ moveUrl?: string; /** * 服务器删除地址 */ deleteUrl?: string; /** * 服务器预览地址 */ previewUrl?: string; /** * 字段定义 */ fields?: { idField?: string; parentidField?: string; nameField?: string; pathField?: string; createUserField?: string; updateTimeField?: string; sizeField?: string; lockField?: string; orderField?: string; typeField?: string; }; /** * 编辑文件夹事件 */ editFoldEvent?: (file?: {}) => void; /** * 编辑文件事件 */ editFileEvent?: (file?: {}, isDocument?: boolean) => void; /** * 编辑文件权限事件 */ editShareEvent?: (file: {}) => void; /** * 删除文件事件 */ deleteFileEvent?: (files: []) => void; /** * 打开文件夹事件 */ openFileEvent?: (file: {}) => Promise; /** * 移动文件事件 */ moveFileEvent?: (ids: [], targetId: string) => void; /** * 下载文件事件 */ downloadFilesEvent?: (fileids: []) => boolean; /** * 下载文件事件 */ thumbnailGeneratorEvent?: (file: any) => string; /** * 文件地址集 */ folderChain?: any[]; /** * 可选择 */ selectable?: boolean; /** * 可拖拽 */ draggable?: boolean; /** * 可删除 */ droppable?: boolean; /** * 只读 */ readOnly?: boolean; /** * 是否存在右键菜单 */ hasFileContextMenu?: boolean; /** * 右上角扩展按钮 */ extraButtons: undefined; } /** * 文件浏览组件是将数据层次模型按照文件浏览器的方式进行展示,适合于系统中文档资料的交互显示方式。 * @name 文件浏览组件 * @groupName */ export default class XFileBrowser extends XBaseDisplay { static ComponentName: string; static ItemType: { 文件: string; 文件夹: string; }; static defaultProps: { fields: { idField: string; parentidField: string; }; selectable: boolean; draggable: boolean; droppable: boolean; readOnly: boolean; hasFileContextMenu: boolean; folderChain: { id: string; _id: string; name: string; isDir: boolean; }[]; styleType: string; hasBox: boolean; showBorder: any; overflow: string; boxStyle: {}; width: string; height: string; visible: boolean; grid: number[]; gridSpan: number[]; parent: string; pureRender: boolean; dataSourceUrl: string; filterData: {}; mustHasFilter: boolean; }; storageFileViewActionId: string; selectedFiles: any; constructor(props: any); componentDidMount(): Promise; formatData(data: any): any[]; getFileActions(): any; getDisableDefaultFileActions(): any[]; folderChainHandler: (data: any, callback: any) => void; folderChainRemove: (id: any, callback: any) => void; /** * 设置显示路径 * @param folderChain */ SetFolderChain(folderChain: []): void; /** * 重置文件路径 */ ResetFolderChain(): void; handleFileAction: (data: any) => Promise; Refresh(filter?: object, isnew?: boolean): Promise; thumbnailGenerator(file: any): string; downloadItems(ids: any): Promise; RequestDownloadFile(url: any, params: any, isShowError?: boolean): Promise; deleteItems(ids: any): Promise; moveItems(ids: any, targetId: any): Promise; uploader: any; fileBrowser: any; renderDisplay(): React.JSX.Element; }