import { ServerBoolean } from '@/common/types'; /** * 表单项类型 * inputs: 单行输入 * multiInputs: 多行输入 * numberInputs: 数字输入 * selects: 单选 * multiSelects: 多选 * dates: 日期 * dateBetweens: 日期区间 * locations: 位置 * videos: 图片、视频 * mobiles: 手机号 */ export type FormilyType = | 'inputs' | 'multiInputs' | 'numberInputs' | 'selects' | 'multiSelects' | 'dates' | 'dateBetweens' | 'locations' | 'videos' | 'mobiles'; export type FormilyConfig = Record; export type FormilyTypeSource = Record; /** * 自定义表单单选、多选项数据类型 */ export interface FormilyOptionData { id: string; name: string; } /** * 自定义表单数据 */ export interface FormilyData { id: string; name: string; type: FormilyType; /** * 是否是内部字段,隐患管理使用 */ internal?: boolean; // 单选、多选选项数据 options?: FormilyOptionData[]; // 是否必填 后端使用 0 | 1 required: T; value?: any; } export type ClientFormilyData = FormilyData; export type ServerFormilyData = FormilyData;