UNPKG

@wufengteam/inputs

Version:

平台提供的右侧属性编辑器,需要在主工程中注册

76 lines (75 loc) 1.53 kB
import type { Rule } from 'antd/lib/form'; /** * 字段信息 */ export type FieldInfo = { /** * 字段唯一ID */ id: string; /** * 字段编码(用户自定义,可变的) */ fieldName: string; /** * 字段名称 */ label: string; /** * 字段所属组件唯一标识 */ compName: string; }; /** * 计算方式 * sum 求和 * average 平均值 * maximum 最大值 * minimum 最小值 */ export type CalculationMethod = 'sum' | 'average' | 'maximum' | 'minimum' | 'filledCount' | 'alreadyFilledCount' | 'notFilledCount'; /** * 字段计算规则 */ export type DataStatisticsRule = { /** * 统计字段信息 */ statisticalFieldInfo?: FieldInfo; /** * 统计方法 */ calculationMethod?: CalculationMethod; /** * 填充到当前表单字段信息 */ currentFormFieldInfo?: FieldInfo; }; /** * 内部计算规则,用来展示使用 */ export type InnerDataStatisticsRules = { /** * 统计字段Id */ statisticalField?: string; /** * 统计方法 */ calculationMethod?: string; /** * 填充到当前表单字段Id */ currentFormField?: string; }; export interface DataStatisticsRulesProps { name: string; label: string; rules?: Rule[]; } export interface InnerDataStatisticsRulesProps { value?: DataStatisticsRule[]; onChange?: (data: DataStatisticsRule[]) => void; DSLCore?: any; selectedComp?: any; }