// 动态表单项目接口
export interface DynamicFormItem {
  key: string
  label: string
  type: 'number' | 'text' | 'textarea' | 'select' | 'date' | 'time' | 'switch' | 'radio' | 'checkbox' | 'slider' | 'custom'
  placeholder?: string
  required?: boolean
  disabled?: boolean
  clearable?: boolean
  rules?: any[]
  defaultValue?: any

  // 质检标准相关
  standard?: string
  standardType?: 'text' | 'number' | 'range' | 'select'
  standardValue?: any
  standardRange?: { min: number; max: number }
  standardOptions?: Array<{ label: string; value: any; disabled?: boolean }>
  showStandard?: boolean

  // 数字输入相关
  min?: number
  max?: number
  precision?: number
  step?: number

  // 文本输入相关
  inputType?: string
  rows?: number

  // 选择器相关
  options?: Array<{
    label: string
    value: any
    disabled?: boolean
  }>
  filterable?: boolean
  multiple?: boolean

  // 日期时间相关
  dateType?: 'date' | 'datetime' | 'daterange' | 'datetimerange'
  format?: string
  valueFormat?: string

  // 开关相关
  activeText?: string
  inactiveText?: string

  // 滑块相关
  showInput?: boolean
  showStops?: boolean
  showTooltip?: boolean

  // 自定义插槽
  slotName?: string

  // 布局相关
  span?: number
  fullWidth?: boolean
}

// 动态表单配置接口
export interface DynamicFormConfig {
  title?: string
  gutter?: number
  columnSpan?: number
  formProp?: string
  items: DynamicFormItem[]
}

// 动态表单事件接口
export interface DynamicFormEvents {
  fieldChange: (key: string, value: any, item: DynamicFormItem) => void
  formChange: (value: Record<string, any>) => void
}

// 动态表单方法接口
export interface DynamicFormMethods {
  getFormData: () => Record<string, any>
  setFormData: (data: Record<string, any>) => void
  resetForm: () => void
  validateForm: () => boolean
}
