import React from 'react'; import type { FunctionType, IObject, PartialAll } from './interface'; import { themeVars } from './theme'; export declare const cssVar: { gap: string; componentColor: string; borderColorSplit: string; border: string; primaryColor: string; textColor: string; linkColor: string; formLabelWidth: string; borderRadius: string; backgroundColor: string; color: string; baseHeight: string; }; type PlatformType = 'pc' | 'app' | 'global'; interface IGlobalConfig { /** * @description 服务端环境 * @default java */ environment: 'java' | 'net'; /** * @description 组件的前缀 * @default NG */ componentPrefix: string; /** * @description 帮助名称列的后缀 * @default _EXName */ helpNameSuffix: string; /** * @description 平台api接口地址 */ apiUrl: { /** * @description app自定义表单UI元数据接口 */ appCustomFormUrl: [string, string]; /** * @description apc自定义表单UI元数据接口 */ pcCustomFormUrl: string; /** * @description 多模式下系统表单UI元数据接口, 最后一个是app系统表单的接口地址 */ individualUIContentByMenu: [string, string, string]; /** * @description 二开脚本地址接口:[pc, app] */ userDefScript: [string, string]; /** * @description 灵动菜单数据接口 */ floatMenu: string; /** * @description 多语言接口 */ languageInfo: string; /** * @description 加载业务注册的报表Tabs接口 */ reportTabs: string; /** * @description 登录信息接口 */ appInfo: string; /** * @description 打印接口的根路径 */ printRoot: string; /** * @description 附件接口的根路径 */ appAttachmentRoot: string; }; default: { tableConfig: { /** * @description 自定义批量操作工具栏信息区域, false 时不显示(在checkbox选择模式下有效) * @default true */ tableAlertRender: boolean; /** * @description header的高级菜单, 列隐藏或显示功能 * @default true */ headerMenu: boolean; /** * @description 表头默认是否开启浮窗提示 * @default true */ headerTooltip: boolean; /** * @description 单元格默认是否开启浮窗提示 * @default false */ tooltip: boolean | Function | 'render' | { overflow: boolean; type?: Function | 'render' | boolean; }; /** * @description 是否开启表头列排序 * @default false */ columnSort: boolean; /** * @description 默认开启编辑列右键菜单,bodyContextMenu未设置时有效 * @default true */ useDefaultRightMenu: boolean; /** * @description 多语言 */ local: { noData?: string; addRow?: string; }; } & typeof themeVars.custom.table; formConfig: typeof themeVars.custom.form; helpConfig: typeof themeVars.custom.help; /** * @description 金额数值精度 * @default {} */ precision: { prc?: number; amt?: number; qty?: number; rate?: number; amount?: number; }; /** * @description 中文长度 * @default 1 */ chnLen: number; }; iconScriptUrl: string; disableDva: boolean; themeOptions: Array<{ id: string; text: string; rtBgColor: string; }>; /** * 加密相关参数 */ cryptoDefaultParams: { keyStr: string; mode: any; encodePadding: any; decodePadding: any; }; /** * @description sm4密钥 */ sm4Key: string; /** * @description 接口适配器,用于组件适配第三方接口 */ serviceAdapter: { /** * @description 通用帮助接口 */ commonHelp: { /** * 获取通用帮助基本信息 */ getHelpInfo?(params: { helpId: string; }): Promise<{ valueField: string; labelField: string; userCodeField?: string; helpTitle: string; columns: IObject[]; showTree: boolean; showList: boolean; }>; /** * 获取通用帮助列表数据 */ getHelpList?(params: { pageIndex: number; inputKey: string; pageSize: number; clientSqlFilter?: string; helpId: string; }): Promise<{ record: IObject[]; total: number; }>; /** * 获取通用帮助常用列表 */ getCommonList?(params: { pageIndex: number; inputKey: string; pageSize: number; clientSqlFilter?: string; helpId: string; }): Promise<{ record: IObject[]; total: number; }>; /** * 获取通用帮助树数据 */ getTreeList?(params: { node: 'root'; clientSqlFilter?: string; helpId: string; }): Promise; /** * 添加常用数据 */ addCommonData?(params: { helpId: string; keyValue: string; }): Promise; /** * 移除常用数据 */ deleteCommonData?(params: { helpId: string; keyValue: string; }): Promise; /** * 获取已选择的数据 */ getSelectedData?(params: { helpId: string; codes: string; }): Promise; }; /** * @description 内嵌查询接口 */ queryPanel: { /** * 获取查询控件信息 */ getQueryPanelInfo?(parmas: { pageId: string; }): Promise<{ fields: IObject[]; values: IObject; isChecked: boolean; }>; /** * 保存查询记忆 */ setQueryPanelData?(parmas: { pageId: string; rememberString: string; isChecked: 1 | 0; }): Promise; /** * 获取查询控件设置信息 */ getQuerySettingInfo?(parmas: { pageId: string; }): Promise; /** * 保存设置信息 */ saveQuerySettingInfo?(parmas: { pageId: string; data: IObject; }): Promise; /** * 重置查询设置 */ resetQuerySettingInfo?(params: { pageId: string; }): Promise; }; }; } export type CryptoParamsType = Partial; declare function getGlobalConfig(): IGlobalConfig; /** * 获取帮助的名称列 * @param name 帮助编码列 * @returns */ declare function getHelpNameField(name: string): string; type ConfigParam = PartialAll | ((config: T) => T); declare function setGlobalConfig(config?: ConfigParam): void; export declare function updateGlobalDefaultConfig(currentTheme: any): void; type ServiceAdapterType = keyof IGlobalConfig['serviceAdapter']; export declare function hasServiceAdapter(key: T, funcName: keyof K[T]): boolean; export declare function execServiceAdapter[S] extends (...args: infer P) => any ? P : never>(key: T, funcName: S, params: P[0]): any; export interface IRegisterComponentOptions { /** * 是否帮助组件 */ isHelp?: boolean; /** * 是否多选帮助 */ multiple?: boolean; defaultProps?: IObject | FunctionType; } /** * 注册外部组件 * @param Components * @param options */ declare function registerCpts(Components: Record>, options?: IRegisterComponentOptions & { platform?: PlatformType; }): void; declare function getRegisterCpt(type?: string, platform?: PlatformType, candidate?: string): any; declare function getRegisterCptWithProps(type?: string, platform?: PlatformType, candidate?: string): any[]; export { getRegisterCpt, registerCpts, getHelpNameField, getGlobalConfig, setGlobalConfig, getRegisterCptWithProps };