getComponentConfig.js 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. import * as iconData from 'data-room-ui/assets/symbols/bigScreenIcon/iconfont.json'
  2. const iconNames = iconData.glyphs.map(item => item.name).sort((a, b) => a.localeCompare(b))
  3. export default function getComponentConfig (type) {
  4. // const _type = _.upperFirst(type)
  5. // const className = `com.gccloud.starter.lowcode.page.bigscreen.components.${_type}Chart`
  6. switch (type) {
  7. case 'marquee':
  8. return {
  9. name: '跑马灯',
  10. title: '跑马灯',
  11. icon: iconNames[16],
  12. className:
  13. 'com.gccloud.dataroom.core.module.chart.components.ScreenTextChart',
  14. w: 150,
  15. h: 100,
  16. x: 0,
  17. y: 0,
  18. type
  19. }
  20. case 'texts':
  21. return {
  22. name: '文本',
  23. title: '文本',
  24. icon: iconNames[0],
  25. className:
  26. 'com.gccloud.dataroom.core.module.chart.components.ScreenTextChart',
  27. w: 150,
  28. h: 30,
  29. x: 0,
  30. y: 0,
  31. type
  32. }
  33. case 'linkChart':
  34. return {
  35. name: '超链接',
  36. title: '超链接',
  37. icon: iconNames[15],
  38. className:
  39. 'com.gccloud.dataroom.core.module.chart.components.ScreenLinkChart',
  40. w: 150,
  41. h: 30,
  42. x: 0,
  43. y: 0,
  44. type
  45. }
  46. case 'horizontalLine':
  47. return {
  48. name: '水平线',
  49. title: '水平线',
  50. icon: iconNames[10],
  51. component: null,
  52. className:
  53. 'com.gccloud.dataroom.core.module.chart.components.ScreenBorderChart',
  54. w: 300,
  55. h: 40,
  56. x: 0,
  57. y: 0,
  58. type
  59. }
  60. case 'verticalLine':
  61. return {
  62. name: '垂直线',
  63. title: '垂直线',
  64. icon: iconNames[11],
  65. component: null,
  66. className:
  67. 'com.gccloud.dataroom.core.module.chart.components.ScreenBorderChart',
  68. w: 40,
  69. h: 300,
  70. x: 0,
  71. y: 0,
  72. type
  73. }
  74. case 'picture':
  75. return {
  76. name: '图片',
  77. title: '图片',
  78. icon: iconNames[1],
  79. className:
  80. 'com.gccloud.dataroom.core.module.chart.components.ScreenPictureChart',
  81. w: 280,
  82. h: 200,
  83. x: 0,
  84. y: 0,
  85. type
  86. }
  87. case 'screenScrollBoard':
  88. return {
  89. name: '轮播表',
  90. title: '轮播表',
  91. icon: iconNames[2],
  92. className:
  93. 'com.gccloud.dataroom.core.module.chart.components.ScreenScrollBoardChart',
  94. w: 600,
  95. h: 400,
  96. x: 0,
  97. y: 0,
  98. type
  99. }
  100. case 'screenScrollRanking':
  101. return {
  102. name: '排名表',
  103. title: '排名表',
  104. icon: iconNames[3],
  105. className:
  106. 'com.gccloud.dataroom.core.module.chart.components.ScreenScrollRankingChart',
  107. w: 600,
  108. h: 400,
  109. x: 0,
  110. y: 0,
  111. type
  112. }
  113. case 'tables':
  114. return {
  115. name: '表格',
  116. title: '表格',
  117. icon: iconNames[4],
  118. className:
  119. 'com.gccloud.dataroom.core.module.chart.components.ScreenTablesChart',
  120. w: 600,
  121. h: 400,
  122. x: 0,
  123. y: 0,
  124. type
  125. }
  126. case 'currentTime':
  127. return {
  128. name: '当前时间',
  129. title: '当前时间',
  130. icon: iconNames[6],
  131. className:
  132. 'com.gccloud.dataroom.core.module.chart.components.ScreenCurrentTimeChart',
  133. w: 380,
  134. h: 130,
  135. x: 0,
  136. y: 0,
  137. type
  138. }
  139. case 'timeCountDown':
  140. return {
  141. name: '倒计时',
  142. title: '倒计时',
  143. icon: iconNames[7],
  144. className:
  145. 'com.gccloud.dataroom.core.module.chart.components.ScreenTimeCountDownChart',
  146. w: 500,
  147. h: 130,
  148. x: 0,
  149. y: 0,
  150. type
  151. }
  152. case 'iframeChart':
  153. return {
  154. name: '外链',
  155. title: '外链',
  156. icon: iconNames[8],
  157. className:
  158. 'com.gccloud.dataroom.core.module.chart.components.ScreenIframeChart',
  159. w: 600,
  160. h: 400,
  161. x: 0,
  162. y: 0,
  163. type
  164. }
  165. case 'digitalFlop':
  166. return {
  167. name: '翻牌器',
  168. title: '翻牌器',
  169. icon: null,
  170. img: require('data-room-ui/BasicComponents/DigitalFlop/images/fanpaiqi.png'),
  171. className:
  172. 'com.gccloud.dataroom.core.module.chart.components.ScreenDigitalFlopChart',
  173. w: 800,
  174. h: 150,
  175. x: 0,
  176. y: 0,
  177. type
  178. }
  179. case 'video':
  180. return {
  181. name: '播放器',
  182. title: '播放器',
  183. icon: iconNames[12],
  184. className:
  185. 'com.gccloud.dataroom.core.module.chart.components.ScreenVideoChart',
  186. w: 600,
  187. h: 400,
  188. x: 0,
  189. y: 0,
  190. type
  191. }
  192. case 'input':
  193. return {
  194. name: '输入框',
  195. title: '输入框',
  196. icon: iconNames[13],
  197. className: 'com.gccloud.dataroom.core.module.chart.components.ScreenInputChart',
  198. w: 180,
  199. h: 40,
  200. x: 0,
  201. y: 0,
  202. type
  203. }
  204. case 'button':
  205. return {
  206. name: '按钮',
  207. title: '按钮',
  208. icon: iconNames[14],
  209. className: 'com.gccloud.dataroom.core.module.chart.components.ScreenButtonChart',
  210. w: 80,
  211. h: 40,
  212. x: 0,
  213. y: 0,
  214. type
  215. }
  216. default:
  217. return {}
  218. }
  219. }