config.js 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. const title = '测试组件A'
  2. // 右侧配置项
  3. const setting = [
  4. {
  5. label: '维度',
  6. // 设置组件类型, select / input / colorPicker
  7. type: 'select',
  8. // 字段
  9. field: 'xField',
  10. optionField: 'xField', // 对应options中的字段
  11. // 是否多选
  12. multiple: false,
  13. // 绑定的值
  14. value: '',
  15. // tab页。 data: 数据, custom: 自定义
  16. tabName: 'data'
  17. },
  18. {
  19. label: '指标',
  20. // 设置组件类型
  21. type: 'select',
  22. // 字段
  23. field: 'yField',
  24. // 对应options中的字段
  25. optionField: 'yField',
  26. // 是否多选
  27. multiple: false,
  28. value: '',
  29. tabName: 'data'
  30. },
  31. {
  32. label: '用户名',
  33. // 设置组件类型, select / input / colorPicker
  34. type: 'input',
  35. // 字段
  36. field: 'customize_username',
  37. optionField: 'customize.username', // 对应options中的字段
  38. // 是否多选
  39. multiple: false,
  40. // 绑定的值
  41. value: '',
  42. // tab页。 data: 数据, custom: 自定义
  43. tabName: 'custom'
  44. },
  45. {
  46. label: '手机号',
  47. // 设置组件类型, select / input / colorPicker
  48. type: 'input',
  49. // 字段
  50. field: 'customize_phone',
  51. optionField: 'customize.phone', // 对应options中的字段
  52. // 是否多选
  53. multiple: false,
  54. // 绑定的值
  55. value: '',
  56. // tab页。 data: 数据, custom: 自定义
  57. tabName: 'custom'
  58. }
  59. ]
  60. // 模拟数据
  61. const data = [
  62. { stage: '简历筛选', number: 253, company: 'A公司' },
  63. { stage: '初试人数', number: 151, company: 'A公司' },
  64. { stage: '复试人数', number: 113, company: 'B公司' }
  65. ]
  66. const option = {
  67. // 数据
  68. data: data,
  69. // 数据的字段相关属性
  70. xField: '',
  71. yField: '',
  72. seriesField: '',
  73. // 自定义组件其他属性
  74. customize: {
  75. username: '张三11123123',
  76. phone: '12312qweqweqwe3'
  77. }
  78. }
  79. export default {
  80. title,
  81. option,
  82. setting
  83. }