config.js 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. import { WidgetType, FieldType } from './commons/enums'
  2. /**
  3. * 自定义组件配置
  4. */
  5. export default [
  6. {
  7. defaultValue: '', // 如果是多选则存储的为JSON数组
  8. description: '单行文本测试',
  9. fieldType: FieldType.INTEGER,
  10. name: 'inputType',
  11. regExp: '/^\\d+$/',
  12. required: true,
  13. title: '单行文本',
  14. config: {
  15. maxLength: 180,
  16. }
  17. },
  18. {
  19. defaultValue: '',
  20. description: '多行文本测试',
  21. fieldType: FieldType.STRING,
  22. name: 'areaType',
  23. required: true,
  24. title: '多行文本',
  25. config: {
  26. type: WidgetType.TEXT_AREA,
  27. maxLength: 180
  28. }
  29. },
  30. {
  31. defaultValue: '',
  32. description: '下拉选择测试',
  33. fieldType: FieldType.STRING,
  34. name: 'selectType',
  35. required: true,
  36. title: '下拉选择',
  37. config: {
  38. type: WidgetType.SELECT,
  39. option: [{ value: 'test1', text: '测试1' }, { value: 'test2', text: '测试2' }]
  40. }
  41. },
  42. {
  43. defaultValue: '[]',
  44. description: '多选下拉选择测试',
  45. fieldType: FieldType.STRING,
  46. name: 'multiSelectType',
  47. required: true,
  48. title: '多选下拉选择',
  49. config: {
  50. type: WidgetType.MULTI_SELECT,
  51. option: [{ value: 'test1', text: '测试1' }, { value: 'test2', text: '测试2' }]
  52. }
  53. },
  54. {
  55. defaultValue: '[]',
  56. description: '复选框测试',
  57. fieldType: FieldType.STRING,
  58. name: 'checkboxType',
  59. required: true,
  60. title: '复选框',
  61. config: {
  62. type: WidgetType.CHECKBOX,
  63. option: [{ value: 'test1', text: '测试1' }, { value: 'test2', text: '测试2' }]
  64. }
  65. },
  66. {
  67. defaultValue: '',
  68. description: '日期选择测试',
  69. fieldType: FieldType.STRING,
  70. name: 'dateType',
  71. required: true,
  72. title: '日期选择',
  73. config: {
  74. type: WidgetType.DATE,
  75. content: 'YYYY-MM-DD HH:mm:ss'
  76. }
  77. }
  78. ]