props.ts 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. import type { CSSProperties, PropType } from 'vue';
  2. import { FormSchema } from './types/form';
  3. import type { GridProps, GridItemProps } from 'naive-ui/lib/grid';
  4. import type { ButtonProps } from 'naive-ui/lib/button';
  5. import { propTypes } from '@/utils/propTypes';
  6. export const basicProps = {
  7. // 标签宽度 固定宽度
  8. labelWidth: {
  9. type: [Number, String] as PropType<number | string>,
  10. default: 80,
  11. },
  12. // 表单配置规则
  13. schemas: {
  14. type: [Array] as PropType<FormSchema[]>,
  15. default: () => [],
  16. },
  17. //布局方式
  18. layout: {
  19. type: String,
  20. default: 'inline',
  21. },
  22. //是否展示为行内表单
  23. inline: {
  24. type: Boolean,
  25. default: false,
  26. },
  27. //大小
  28. size: {
  29. type: String,
  30. default: 'medium',
  31. },
  32. //标签位置
  33. labelPlacement: {
  34. type: String,
  35. default: 'left',
  36. },
  37. //组件是否width 100%
  38. isFull: {
  39. type: Boolean,
  40. default: true,
  41. },
  42. //是否显示操作按钮(查询/重置)
  43. showActionButtonGroup: propTypes.bool.def(true),
  44. // 显示重置按钮
  45. showResetButton: propTypes.bool.def(true),
  46. //重置按钮配置
  47. resetButtonOptions: Object as PropType<Partial<ButtonProps>>,
  48. // 显示确认按钮
  49. showSubmitButton: propTypes.bool.def(true),
  50. // 确认按钮配置
  51. submitButtonOptions: Object as PropType<Partial<ButtonProps>>,
  52. //展开收起按钮
  53. showAdvancedButton: propTypes.bool.def(true),
  54. // 确认按钮文字
  55. submitButtonText: {
  56. type: String,
  57. default: '查询',
  58. },
  59. //重置按钮文字
  60. resetButtonText: {
  61. type: String,
  62. default: '重置',
  63. },
  64. //grid 配置
  65. gridProps: Object as PropType<GridProps>,
  66. //gi配置
  67. giProps: Object as PropType<GridItemProps>,
  68. //grid 样式
  69. baseGridStyle: {
  70. type: Object as PropType<CSSProperties>,
  71. },
  72. //是否折叠
  73. collapsed: {
  74. type: Boolean,
  75. default: false,
  76. },
  77. //默认展示的行数
  78. collapsedRows: {
  79. type: Number,
  80. default: 1,
  81. },
  82. };