import { ReactNode } from 'react' import { EditTypes } from './meta' export type WrappedNode = any; export type WrapperChild
= (props?: P, engine?: (props: any) => ReactNode) => ReactNode export type WrapperResult
= (props?: P, engine?: (props: any) => WrappedNode) => WrappedNode export interface WrapOptions { excludeNidAndUiType?: boolean manifest?: ComponentManifest } export type Wrapper
= (orig: WrapperChild, options?: WrapOptions) => WrapperResult
/**
* designConfig props的描述 designConfigProps
* type 适配层的可选视图类型(枚举项)
* label 文本 在适配层页面显示的文本
* labelStyle 在适配层页面显示的文本的样式文件
* isRequired 是否必填
* props 根据适配器中MetaTypes配置不同的props
* help 提示信息
* disabled 是否禁用
*/
interface designConfigProps {
type: EditTypes
label: string
labelStyle?: string
isRequired?: boolean
help?: string
props: object
disabled?: boolean
}
export enum FieldTypes {
string = 'string',
number = 'number',
boolean = 'boolean',
object = 'object',
date = 'date',
action = 'action',
child = 'child',
array = 'array'
}
/**
* 设计器适配层(Adapter)Props描述 Props
* name 名称
* type 数据类型
* defaultValue 默认值--可以是数据,也可以是方法
* value 值
* showDesign 是否展示在适配层 当showDesign为true,需要配置designConfig字段
* designConfig 适配层相关配置属性对象
* onChange 当值改变时,触发事件联动的方法,可改变其它配置字段的值
* onChange方法参数详解
* @param props 当前组件所有的props
* @param propsName 当前组件当前字段的propsName
* @param value 当前组件当前字段的值
*/
export interface Props {
name: string
type: FieldTypes
defaultValue?: any
value?: string
showDesign?: boolean
designConfig?: designConfigProps
onChange?: (props: Props[], propsName: string, value: string) => Props[]
}
export enum DatasourceType {
string = 'string',
number = 'number'
}
export interface Datasource {
field: string // 路径
name: string // 名称
type: DatasourceType // 类型
}
export interface Node {
type: string // 控件类型,对应于ComponentManifest中的name
title: string // 标题
field?: string // 绑定字段
children?: Node[] // 子控件列表
}
export enum UITable {
// BillBase = 'BillBase',
// BillEntityBaseList = 'BillEntityBaseList',
// BillEntityBase = 'BillEntityBase',
// BillCommandList = 'BillCommandList',
// BillCommand = 'BillCommand',
// BillTemplateBase = 'BillTemplateBase',
BillTplGroupBase = 'BillTplGroupBase', // 容器组件
// BillToolbar = 'BillToolbar',
// BillToolbarItem = 'BillToolbarItem',
BillItemBase = 'BillItemBase', // 基础组件
// MdfMetaFilter = 'MdfMetaFilter',
// MdfMetaFilterItem = 'MdfMetaFilterItem'
}
export enum UIObject {
Containers = 'containers', // 容器
Controls = 'controls' // 控件
}
export enum ModelProps {
GridModel = 'GridModel',
SimpleModel = 'SimpleModel',
ListModel = 'ListModel',
ReferModel = 'ReferModel',
VM = 'VM'
}
export enum SysProps {
DATA_COLLECTION = 'DATA_COLLECTION', // 设置数据源
DATA_FIELD = 'DATA_FIELD', // 关联字段
ACTION = 'ACTION', // 绑定动作
CHILDREN_FIELD = 'CHILDREN_FIELD'
}
export enum TypeProps {
// BusinessControls = 'businessControls',
// DataContainer = 'dataContainer',
// LayoutContainer = 'layoutContainer',
// OperationBar = 'operationBar',
LayoutContainer = 'layoutContainer',
DataContainer = 'dataContainer',
BasicControls = 'basicControls',
FormControls = 'formControls',
FunctionalControls = 'functionalControls',
BusinessControls = 'businessControls',
InterfaceControls = 'interfaceControls'
}
export enum ExtensionProps {
bIsNull = 'bIsNull',
bMustSelect = 'bMustSelect',
isExport = 'isExport',
bVmExclude = 'bVmExclude',
disabled = 'disabled',
splitLine = 'splitLine',
singleLine = 'singleLine',
required = 'required',
bCheck = 'bCheck',
formula = 'formula',
cStyle = 'cStyle'
}
type transformerType = Array {
manifest: ComponentManifest
render: (props?: P, engine?: (props: any) => WrappedNode) => WrappedNode
}
export { EditTypes }