config.js 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. const title = '卡片组件'
  2. // 右侧配置项
  3. const setting = [
  4. {
  5. label: '背景色',
  6. // 设置组件类型, select / input / colorPicker
  7. type: 'colorPicker',
  8. // 字段
  9. field: 'customize_backgroundColor',
  10. optionField: 'customize.backgroundColor', // 对应options中的字段
  11. // 是否多选
  12. multiple: false,
  13. // 绑定的值
  14. value: 'rgba(0,0,0,.15)',
  15. // tab页。 data: 数据, custom: 自定义
  16. tabName: 'custom'
  17. },
  18. {
  19. label: '边框宽度',
  20. // 设置组件类型, select / input / colorPicker
  21. type: 'inputNumber',
  22. // 字段
  23. field: 'customize_border',
  24. optionField: 'customize.border', // 对应options中的字段
  25. // 是否多选
  26. multiple: false,
  27. // 绑定的值
  28. value: 1,
  29. // tab页。 data: 数据, custom: 自定义
  30. tabName: 'custom'
  31. },
  32. {
  33. label: '边框颜色',
  34. // 设置组件类型, select / input / colorPicker
  35. type: 'colorPicker',
  36. // 字段
  37. field: 'customize_borderColor',
  38. optionField: 'customize.borderColor', // 对应options中的字段
  39. // 是否多选
  40. multiple: false,
  41. // 绑定的值
  42. value: 'rgba(0,0,0,.15)',
  43. // tab页。 data: 数据, custom: 自定义
  44. tabName: 'custom'
  45. },
  46. {
  47. label: '边框类型',
  48. // 设置组件类型, select / input / colorPicker
  49. type: 'select',
  50. // 字段
  51. field: 'customize_borderStyle',
  52. optionField: 'customize.borderStyle', // 对应options中的字段
  53. // 是否多选
  54. multiple: false,
  55. options: [
  56. { label: 'solid', value: 'solid' },
  57. { label: 'dashed', value: 'dashed' }
  58. ],
  59. // 绑定的值
  60. value: 'solid',
  61. // tab页。 data: 数据, custom: 自定义
  62. tabName: 'custom'
  63. },
  64. {
  65. label: '标题颜色',
  66. // 设置组件类型, select / input / colorPicker
  67. type: 'colorPicker',
  68. // 字段
  69. field: 'customize_headerColor',
  70. optionField: 'customize.headerColor', // 对应options中的字段
  71. // 是否多选
  72. multiple: false,
  73. // 绑定的值
  74. value: 'white',
  75. // tab页。 data: 数据, custom: 自定义
  76. tabName: 'custom'
  77. },
  78. {
  79. label: '标题左边距',
  80. // 设置组件类型, select / input / colorPicker
  81. type: 'inputNumber',
  82. // 字段
  83. field: 'customize_titlePaddingLeft',
  84. optionField: 'customize.titlePaddingLeft', // 对应options中的字段
  85. // 是否多选
  86. multiple: false,
  87. // 绑定的值
  88. value: 16,
  89. // tab页。 data: 数据, custom: 自定义
  90. tabName: 'custom'
  91. },
  92. {
  93. label: '标题左线宽度',
  94. // 设置组件类型, select / input / colorPicker
  95. type: 'inputNumber',
  96. // 字段
  97. field: 'customize_titleLineWidth',
  98. optionField: 'customize.titleLineWidth', // 对应options中的字段
  99. // 是否多选
  100. multiple: false,
  101. // 绑定的值
  102. value: 3,
  103. // tab页。 data: 数据, custom: 自定义
  104. tabName: 'custom'
  105. },
  106. {
  107. label: '标题线颜色',
  108. // 设置组件类型, select / input / colorPicker
  109. type: 'colorPicker',
  110. // 字段
  111. field: 'customize_titleLineColor',
  112. optionField: 'customize.titleLineColor', // 对应options中的字段
  113. // 是否多选
  114. multiple: false,
  115. // 绑定的值
  116. value: '#007aff',
  117. // tab页。 data: 数据, custom: 自定义
  118. tabName: 'custom'
  119. },
  120. {
  121. label: '标题底边宽度',
  122. // 设置组件类型, select / input / colorPicker
  123. type: 'inputNumber',
  124. // 字段
  125. field: 'customize_titleBottomLineWidth',
  126. optionField: 'customize.titleBottomLineWidth', // 对应options中的字段
  127. // 是否多选
  128. multiple: false,
  129. // 绑定的值
  130. value: 1,
  131. // tab页。 data: 数据, custom: 自定义
  132. tabName: 'custom'
  133. },
  134. {
  135. label: '标题底边颜色',
  136. // 设置组件类型, select / input / colorPicker
  137. type: 'colorPicker',
  138. // 字段
  139. field: 'customize_titleBottomLineColor',
  140. optionField: 'customize.titleBottomLineColor', // 对应options中的字段
  141. // 是否多选
  142. multiple: false,
  143. // 绑定的值
  144. value: '#0f131d',
  145. // tab页。 data: 数据, custom: 自定义
  146. tabName: 'custom'
  147. }
  148. ]
  149. // 模拟数据
  150. const option = {
  151. // 自定义组件其他属性
  152. customize: {
  153. backgroundColor: 'rgba(0,0,0,.15)',
  154. border: 1,
  155. borderColor: 'rgba(0,0,0,.15)',
  156. borderStyle: 'solid',
  157. headerColor: 'white',
  158. titlePaddingLeft: 16,
  159. titleLineWidth: 3,
  160. titleLineColor: '#007aff',
  161. titleBottomLineWidth: 1,
  162. titleBottomLineColor: '#0f131d'
  163. }
  164. }
  165. export default {
  166. title,
  167. setting,
  168. option: {
  169. ...option,
  170. displayOption: {
  171. dataAllocation: {
  172. enable: false
  173. }
  174. }
  175. }
  176. }