index.ts 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  1. import type { Component } from 'vue';
  2. import { markRaw } from 'vue';
  3. import head from './pages/head.vue';
  4. const headRef = shallowRef(head);
  5. import headEdit from './edit/head-edit.vue';
  6. const headEditRef = shallowRef(headEdit);
  7. import headData from './pages/headData.vue';
  8. const headDataRef = shallowRef(headData);
  9. import headDataEdit from './edit/headData-edit.vue';
  10. const headDataEditRef = shallowRef(headDataEdit);
  11. import textTitle from './pages/textTitle.vue';
  12. const textTitleRef = shallowRef(textTitle);
  13. import textTitleEdit from './edit/textTitle-edit.vue';
  14. const textTitleEditRef = shallowRef(textTitleEdit);
  15. import navigation from './pages/navigation.vue';
  16. const navigationRef = shallowRef(navigation);
  17. import navigationEdit from './edit/navigation-edit.vue';
  18. const navigationEditRef = shallowRef(navigationEdit);
  19. import imageCube from './pages/imageCube.vue';
  20. const imageCubeRef = shallowRef(imageCube);
  21. import imageCubeEdit from './edit/imageCube-edit.vue';
  22. const imageCubeEditRef = shallowRef(imageCubeEdit);
  23. import activity from './pages/activity.vue';
  24. const activityRef = shallowRef(activity);
  25. import activityEdit from './edit/activity-edit.vue';
  26. const activityEditRef = shallowRef(activityEdit);
  27. import carousel from './pages/carousel.vue';
  28. const carouselRef = shallowRef(carousel);
  29. import carouselEdit from './edit/carousel-edit.vue';
  30. const carouselEditRef = shallowRef(carouselEdit);
  31. import article from './pages/article.vue';
  32. const articleRef = shallowRef(article);
  33. import articleEdit from './edit/article-edit.vue';
  34. const articleEditRef = shallowRef(articleEdit);
  35. import brand from './pages/brand.vue';
  36. const brandRef = shallowRef(brand);
  37. import brandEdit from './edit/brand-edit.vue';
  38. const brandEditRef = shallowRef(brandEdit);
  39. import advert from './pages/advert.vue';
  40. const advertRef = shallowRef(advert);
  41. import advertEdit from './edit/advert-edit.vue';
  42. const advertEditRef = shallowRef(advertEdit);
  43. import floor from './pages/floor.vue';
  44. const floorRef = shallowRef(floor);
  45. import floorEdit from './edit/floor-edit.vue';
  46. const floorEditRef = shallowRef(floorEdit);
  47. import goods from './pages/goods.vue';
  48. const goodsRef = shallowRef(goods);
  49. import goodsEdit from './edit/goods-edit.vue';
  50. const goodsEditRef = shallowRef(goodsEdit);
  51. import goodsList from './pages/goodsList.vue';
  52. const goodsListRef = shallowRef(goodsList);
  53. import goodsListEdit from './edit/goodsList-edit.vue';
  54. const goodsListEditRef = shallowRef(goodsListEdit);
  55. import discover from './pages/discover.vue';
  56. const discoverRef = shallowRef(discover);
  57. import discoverEdit from './edit/discover-edit.vue';
  58. const discoverEditRef = shallowRef(discoverEdit);
  59. import hot from './pages/hot.vue';
  60. const hotRef = shallowRef(hot);
  61. import hotEdit from './edit/hot-edit.vue';
  62. const hotEditRef = shallowRef(hotEdit);
  63. import editordiy from './pages/editordiy.vue';
  64. const editordiyRef = shallowRef(editordiy);
  65. import editordiyEdit from './edit/editordiy-edit.vue';
  66. const editordiyEditRef = shallowRef(editordiyEdit);
  67. import blank from './pages/blank.vue';
  68. const blankRef = shallowRef(blank);
  69. import blankEdit from './edit/blank-edit.vue';
  70. const blankEditRef = shallowRef(blankEdit);
  71. import border from './pages/border.vue';
  72. const borderRef = shallowRef(border);
  73. import borderEdit from './edit/border-edit.vue';
  74. const borderEditRef = shallowRef(borderEdit);
  75. // 组件列表配置
  76. export const componentImportConfigs: any = [
  77. // {
  78. // name: '头部组件',
  79. // icon: 'iconfont iconfuwenbenpc',
  80. // id: 1,
  81. // enabled: true,
  82. // components: markRaw(headRef.value),
  83. // edit: markRaw(headEditRef.value),
  84. // fid: 1
  85. // },
  86. // {
  87. // name: '站点头部',
  88. // icon: 'iconfont iconfuwenbenpc',
  89. // id: 18,
  90. // enabled: true,
  91. // components: markRaw(headDataRef.value),
  92. // edit: markRaw(headDataEditRef.value),
  93. // fid: 1
  94. // },
  95. {
  96. name: '文本标题',
  97. icon: 'iconfont iconbiaotipc',
  98. id: 2,
  99. enabled: true,
  100. components: markRaw(textTitleRef.value),
  101. edit: markRaw(textTitleEditRef.value),
  102. fid: 1
  103. },
  104. {
  105. name: '图文导航',
  106. icon: 'iconfont icontuwendaohangpc',
  107. id: 3,
  108. enabled: true,
  109. components: markRaw(navigationRef.value),
  110. edit: markRaw(navigationEditRef.value),
  111. fid: 1
  112. },
  113. {
  114. name: '图片魔方',
  115. icon: 'iconfont iconmofangpc',
  116. id: 4,
  117. enabled: true,
  118. components: markRaw(imageCubeRef.value),
  119. edit: markRaw(imageCubeEditRef.value),
  120. fid: 1
  121. },
  122. {
  123. name: '活动魔方',
  124. icon: 'iconfont iconmofangpc',
  125. enabled: true,
  126. id: 5,
  127. components: markRaw(activityRef.value),
  128. edit: markRaw(activityEditRef.value),
  129. fid: 1
  130. },
  131. {
  132. name: '轮播图',
  133. icon: 'iconfont icona-tupianzhanbopc302',
  134. enabled: true,
  135. id: 6,
  136. components: markRaw(carouselRef.value),
  137. edit: markRaw(carouselEditRef.value),
  138. fid: 1
  139. },
  140. {
  141. name: '文章咨询',
  142. icon: 'iconfont icongonggaopc',
  143. enabled: true,
  144. id: 7,
  145. components: markRaw(articleRef.value),
  146. edit: markRaw(articleEditRef.value),
  147. fid: 1
  148. },
  149. {
  150. name: '品牌组件',
  151. icon: 'iconfont iconmiaoshashangpin',
  152. enabled: true,
  153. id: 8,
  154. components: markRaw(brandRef.value),
  155. edit: markRaw(brandEditRef.value),
  156. fid: 1
  157. },
  158. {
  159. name: '图文广告',
  160. icon: 'iconfont icontupiandaohangpc',
  161. enabled: true,
  162. id: 9,
  163. components: markRaw(advertRef.value),
  164. edit: markRaw(advertEditRef.value),
  165. fid: 1
  166. },
  167. {
  168. name: '楼层组件',
  169. icon: 'iconfont iconshangpinliebiaopc',
  170. enabled: true,
  171. id: 10,
  172. components: markRaw(floorRef.value),
  173. edit: markRaw(floorEditRef.value),
  174. fid: 1
  175. },
  176. {
  177. name: '商品组件',
  178. icon: 'iconfont icona-shangpintuijianpc30',
  179. enabled: true,
  180. id: 11,
  181. components: markRaw(goodsRef.value),
  182. edit: markRaw(goodsEditRef.value),
  183. fid: 1
  184. },
  185. {
  186. name: '多商品组',
  187. icon: 'iconfont iconduoshangpinzupc',
  188. enabled: true,
  189. id: 12,
  190. components: markRaw(goodsListRef.value),
  191. edit: markRaw(goodsListEditRef.value),
  192. fid: 1
  193. },
  194. {
  195. name: '发现组件',
  196. icon: 'iconfont iconjifenshangpinpc',
  197. enabled: true,
  198. id: 13,
  199. components: markRaw(discoverRef.value),
  200. edit: markRaw(discoverEditRef.value),
  201. fid: 1
  202. },
  203. {
  204. name: '热区',
  205. icon: 'iconfont iconrequpc',
  206. enabled: true,
  207. id: 14,
  208. components: markRaw(hotRef.value),
  209. edit: markRaw(hotEditRef.value),
  210. fid: 1
  211. },
  212. {
  213. name: '富文本',
  214. icon: 'iconfont iconfuwenbenpc',
  215. enabled: true,
  216. id: 15,
  217. components: markRaw(editordiyRef.value),
  218. edit: markRaw(editordiyEditRef.value),
  219. fid: 1
  220. },
  221. {
  222. name: '辅助空白',
  223. icon: 'iconfont iconfuzhukongbaipc',
  224. enabled: true,
  225. id: 16,
  226. components: markRaw(blankRef.value),
  227. edit: markRaw(blankEditRef.value),
  228. fid: 1
  229. },
  230. {
  231. name: '辅助线',
  232. icon: 'iconfont iconfuzhuxianpc',
  233. enabled: true,
  234. id: 17,
  235. components: markRaw(borderRef.value),
  236. edit: markRaw(borderEditRef.value),
  237. fid: 1
  238. }
  239. ];
  240. /**
  241. * 获取组件分组配置
  242. * @param components 组件列表
  243. * @returns 分组后的组件配置
  244. */
  245. export function getComponentGroups(): any[] {
  246. return [
  247. {
  248. name: '基础组件',
  249. list: componentImportConfigs,
  250. id: 1
  251. }
  252. // 后续可扩展多个分组,如:营销组件、商品组件等
  253. ];
  254. }