config.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. import { configMapToList } from '@cip/utils/config-util'
  2. import { DRender } from '@cip/components/helper/d-render'
  3. export const formConfigFieldConfigMap = {
  4. labelPosition: {
  5. type: 'radio',
  6. label: '标签对齐方式',
  7. options: [
  8. { label: '左对齐', value: 'left' },
  9. { label: '右对齐', value: 'right' },
  10. { label: '顶部对齐', value: 'top' }
  11. ],
  12. isButton: true,
  13. defaultValue: 'right'
  14. },
  15. labelWidth: {
  16. type: 'number',
  17. label: '表单标签宽度',
  18. step: 10,
  19. min: 0
  20. },
  21. labelSuffix: {
  22. type: 'switch',
  23. label: '是否添加表单标签后缀',
  24. activeValue: ':',
  25. inactiveValue: ' ',
  26. defaultValue: ':'
  27. },
  28. tableSize: {
  29. type: 'radio',
  30. label: '组件尺寸',
  31. options: ['large', 'default', 'small'],
  32. isButton: true,
  33. defaultValue: 'default'
  34. }
  35. }
  36. export const formConfigFieldConfigList = configMapToList(formConfigFieldConfigMap)
  37. const dRender = new DRender()
  38. export const getComponentConfigure = async (type) => {
  39. const { default: configure } = await dRender.componentDictionary[type]('/configure')()
  40. return configure
  41. }
  42. export const tableConfigFieldConfigList = configMapToList({
  43. width: {
  44. type: 'input',
  45. label: '宽度',
  46. limit: 8
  47. }
  48. // sort: {
  49. // type: 'switch',
  50. // label: '是否排序'
  51. // }
  52. })
  53. export const searchConfigFieldConfigList = configMapToList({
  54. fieldAlias: {
  55. type: 'input',
  56. label: '标题',
  57. limit: 8
  58. },
  59. search: {
  60. type: 'switch',
  61. label: '是否可查询'
  62. }
  63. })