SimpleSelectFormItem.ts 841 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import type { SelectProps } from "ant-design-vue";
  2. import type { VNode } from 'vue';
  3. export interface IDynamicFormItemSelectOption {
  4. text: string,
  5. value: string|number,
  6. badgeState?: 'success'|'error'|'default'|'processing'|'warning',
  7. badgeColor?: string,
  8. raw?: unknown;
  9. }
  10. export interface IDynamicFormItemAdditionalOptions {
  11. options: IDynamicFormItemSelectOption[],
  12. }
  13. export interface SimpleSelectFormItemProps {
  14. /**
  15. * 是否禁用
  16. */
  17. disabled: boolean;
  18. /**
  19. * 选项数据
  20. */
  21. options: IDynamicFormItemSelectOption[];
  22. /**
  23. * 选择值
  24. */
  25. value: unknown;
  26. /**
  27. * a-select 其他自定义参数
  28. */
  29. customProps: SelectProps;
  30. /**
  31. * 是否自定义渲染option插槽
  32. */
  33. renderOption?: RenderOption;
  34. }
  35. export type RenderOption = (data: {
  36. value: unknown,
  37. label: string,
  38. }) => VNode;