foucui 1.0.1 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (371) hide show
  1. package/README.md +8 -8
  2. package/README.publish.md +19 -0
  3. package/dist/components/{QiuAnchor → FouAnchor}/context.d.ts +4 -4
  4. package/dist/components/{QiuBadge → FouBadge}/composables/useTableHostHeight.d.ts +1 -1
  5. package/dist/components/FouBadge/index.d.ts +18 -0
  6. package/dist/components/{QiuBadge → FouBadge}/shared/BadgeTemplateRenderer.vue.d.ts +1 -1
  7. package/dist/components/{QiuBadge → FouBadge}/shared/badgeTemplate.d.ts +1 -1
  8. package/dist/components/{QiuButton → FouButton}/index.vue.d.ts +4 -4
  9. package/dist/components/{QiuCanvasKit/QiuCanvasEditor.vue.d.ts → FouCanvasKit/FouCanvasEditor.vue.d.ts} +4 -2
  10. package/dist/components/{QiuCanvasKit → FouCanvasKit}/components/DataModulesPanel.vue.d.ts +1 -0
  11. package/dist/components/{QiuCanvasKit → FouCanvasKit}/index.d.ts +4 -4
  12. package/dist/components/{QiuCanvasKit → FouCanvasKit}/types.d.ts +1 -1
  13. package/dist/components/{QiuCarousel → FouCarousel}/context.d.ts +4 -4
  14. package/dist/components/{QiuCascader → FouCascader}/types.d.ts +7 -7
  15. package/dist/components/{QiuCheckbox → FouCheckbox}/types.d.ts +1 -1
  16. package/dist/components/{QiuCollapse → FouCollapse}/context.d.ts +2 -2
  17. package/dist/components/{QiuDescriptions → FouDescriptions}/context.d.ts +4 -4
  18. package/dist/components/{QiuDropdown → FouDropdown}/context.d.ts +2 -2
  19. package/dist/components/{QiuForm → FouForm}/types.d.ts +10 -10
  20. package/dist/components/FouLoading/index.d.ts +26 -0
  21. package/dist/components/{QiuLoading → FouLoading}/spinner.vue.d.ts +3 -3
  22. package/dist/components/{QiuLoading → FouLoading}/types.d.ts +2 -2
  23. package/dist/components/{QiuMenu → FouMenu}/context.d.ts +2 -2
  24. package/dist/components/{QiuMenuNav → FouMenuNav}/context.d.ts +2 -2
  25. package/dist/components/{QiuMsg/QiuMsgItem.vue.d.ts → FouMsg/FouMsgItem.vue.d.ts} +3 -3
  26. package/dist/components/FouMsg/index.d.ts +30 -0
  27. package/dist/components/{QiuMsg → FouMsg}/types.d.ts +5 -5
  28. package/dist/components/{QiuMsgBox → FouMsgBox}/index.d.ts +3 -3
  29. package/dist/components/{QiuNotification/QiuNotificationItem.vue.d.ts → FouNotification/FouNotificationItem.vue.d.ts} +3 -3
  30. package/dist/components/FouNotification/index.d.ts +30 -0
  31. package/dist/components/FouNotification/types.d.ts +12 -0
  32. package/dist/components/{QiuRadio → FouRadio}/types.d.ts +1 -1
  33. package/dist/components/FouRow/types.d.ts +4 -0
  34. package/dist/components/{QiuSelect → FouSelect}/index.vue.d.ts +3 -3
  35. package/dist/components/{QiuSelect → FouSelect}/types.d.ts +3 -3
  36. package/dist/components/{QiuStep → FouStep}/index.vue.d.ts +1 -1
  37. package/dist/components/{QiuSteps → FouSteps}/context.d.ts +5 -5
  38. package/dist/components/{QiuTabBar → FouTabBar}/index.vue.d.ts +3 -3
  39. package/dist/components/{QiuTabBar → FouTabBar}/types.d.ts +5 -5
  40. package/dist/components/{QiuTable → FouTable}/export.d.ts +5 -5
  41. package/dist/components/FouTable/index.d.ts +3 -0
  42. package/dist/components/{QiuTable → FouTable}/index.vue.d.ts +60 -60
  43. package/dist/components/FouTable/registry.d.ts +39 -0
  44. package/dist/components/{QiuTable → FouTable}/types.d.ts +60 -60
  45. package/dist/components/{QiuTable → FouTable}/useArea.d.ts +10 -10
  46. package/dist/components/{QiuTable → FouTable}/useColumns.d.ts +5 -5
  47. package/dist/components/FouTable/useEdit.d.ts +36 -0
  48. package/dist/components/{QiuTable → FouTable}/useHistory.d.ts +5 -5
  49. package/dist/components/{QiuTable → FouTable}/useMerge.d.ts +6 -6
  50. package/dist/components/{QiuTable → FouTable}/useScrollSync.d.ts +1 -1
  51. package/dist/components/{QiuTable → FouTable}/utils.d.ts +17 -17
  52. package/dist/components/FouTree/types.d.ts +13 -0
  53. package/dist/components/{QiuUpload → FouUpload}/index.vue.d.ts +17 -17
  54. package/dist/foucui.css +1 -1
  55. package/dist/foucui.js +10749 -10646
  56. package/dist/foucui.umd.cjs +40 -40
  57. package/dist/index.d.ts +43 -43
  58. package/dist/src/bridge/@/config/index.d.ts +1 -1
  59. package/dist/src/bridge/@fou/plugins/shortcuts.d.ts +2 -0
  60. package/package.json +27 -15
  61. package/components/QiuAffix/index.vue +0 -186
  62. package/components/QiuAlert/index.vue +0 -208
  63. package/components/QiuAnchor/context.ts +0 -18
  64. package/components/QiuAnchor/index.vue +0 -180
  65. package/components/QiuAnchorLink/index.vue +0 -67
  66. package/components/QiuApp/index.vue +0 -9
  67. package/components/QiuAutocomplete/index.vue +0 -408
  68. package/components/QiuAvatar/index.vue +0 -140
  69. package/components/QiuBacktop/index.vue +0 -121
  70. package/components/QiuBadge/api/index.ts +0 -389
  71. package/components/QiuBadge/components/BadgeImagePickerDialog.vue +0 -243
  72. package/components/QiuBadge/components/BadgeLibraryManagerDialog.vue +0 -30
  73. package/components/QiuBadge/components/BadgeLibraryPanel.vue +0 -182
  74. package/components/QiuBadge/composables/useTableHostHeight.ts +0 -53
  75. package/components/QiuBadge/index.ts +0 -18
  76. package/components/QiuBadge/shared/BadgeTemplateRenderer.vue +0 -32
  77. package/components/QiuBadge/shared/assetUrl.ts +0 -26
  78. package/components/QiuBadge/shared/badgeTemplate.ts +0 -309
  79. package/components/QiuBadge/utils/chinaAreaData.ts +0 -44
  80. package/components/QiuBadge/utils/hostRegion.ts +0 -22
  81. package/components/QiuBadge/utils/pca-code.json +0 -1
  82. package/components/QiuBadge/utils/pdfFromElement.ts +0 -348
  83. package/components/QiuBadge/views/BadgeLibraryView.vue +0 -32
  84. package/components/QiuBadge/views/BadgeManageView.vue +0 -1364
  85. package/components/QiuBadge/views/BadgeTemplateEditorView.vue +0 -10
  86. package/components/QiuBadge/views/BadgeTemplateListView.vue +0 -229
  87. package/components/QiuBadge/views/DeskLabelTemplateListView.vue +0 -227
  88. package/components/QiuBadge/views/DeskLabelView.vue +0 -683
  89. package/components/QiuBadgeDot/index.vue +0 -87
  90. package/components/QiuButton/index.vue +0 -247
  91. package/components/QiuButtonGroup/index.vue +0 -63
  92. package/components/QiuCanvasKit/QiuCanvasEditor.vue +0 -5503
  93. package/components/QiuCanvasKit/QiuCanvasRenderer.vue +0 -348
  94. package/components/QiuCanvasKit/assetUrl.ts +0 -11
  95. package/components/QiuCanvasKit/components/DataModulesPanel.vue +0 -352
  96. package/components/QiuCanvasKit/export/html.ts +0 -132
  97. package/components/QiuCanvasKit/export/pdf.ts +0 -48
  98. package/components/QiuCanvasKit/export/png.ts +0 -50
  99. package/components/QiuCanvasKit/index.ts +0 -20
  100. package/components/QiuCanvasKit/modules/badgeCompat.ts +0 -84
  101. package/components/QiuCanvasKit/modules/dataRegistry.ts +0 -207
  102. package/components/QiuCanvasKit/modules/merge.ts +0 -71
  103. package/components/QiuCanvasKit/presets/badge.ts +0 -67
  104. package/components/QiuCanvasKit/presets/banner.ts +0 -79
  105. package/components/QiuCanvasKit/types.ts +0 -138
  106. package/components/QiuCard/index.vue +0 -104
  107. package/components/QiuCarousel/context.ts +0 -16
  108. package/components/QiuCarousel/index.vue +0 -343
  109. package/components/QiuCarouselItem/index.vue +0 -47
  110. package/components/QiuCascader/index.vue +0 -879
  111. package/components/QiuCascader/types.ts +0 -48
  112. package/components/QiuCheckbox/QiuCheckboxGroup.vue +0 -78
  113. package/components/QiuCheckbox/index.vue +0 -231
  114. package/components/QiuCheckbox/types.ts +0 -8
  115. package/components/QiuCode/index.vue +0 -64
  116. package/components/QiuCol/col.scss +0 -55
  117. package/components/QiuCol/index.vue +0 -64
  118. package/components/QiuCollapse/context.ts +0 -10
  119. package/components/QiuCollapse/index.vue +0 -70
  120. package/components/QiuCollapseItem/index.vue +0 -167
  121. package/components/QiuColorField/index.vue +0 -296
  122. package/components/QiuColorPicker/README.md +0 -118
  123. package/components/QiuColorPicker/index.vue +0 -60
  124. package/components/QiuColorfulCard/index.vue +0 -101
  125. package/components/QiuCombobox/index.vue +0 -277
  126. package/components/QiuConfigProvider/index.vue +0 -31
  127. package/components/QiuContextMenu/index.vue +0 -209
  128. package/components/QiuDate/index.vue +0 -1134
  129. package/components/QiuDescriptions/context.ts +0 -20
  130. package/components/QiuDescriptions/index.vue +0 -115
  131. package/components/QiuDescriptionsItem/index.vue +0 -103
  132. package/components/QiuDialog/index.vue +0 -828
  133. package/components/QiuDigitalCard/index.vue +0 -159
  134. package/components/QiuDivider/index.vue +0 -185
  135. package/components/QiuDot/index.vue +0 -83
  136. package/components/QiuDrawer/index.vue +0 -350
  137. package/components/QiuDropdown/QiuDropdownItem.vue +0 -74
  138. package/components/QiuDropdown/QiuDropdownMenu.vue +0 -22
  139. package/components/QiuDropdown/context.ts +0 -9
  140. package/components/QiuDropdown/index.vue +0 -189
  141. package/components/QiuEmpty/index.vue +0 -73
  142. package/components/QiuForm/index.vue +0 -172
  143. package/components/QiuForm/types.ts +0 -39
  144. package/components/QiuFormItem/index.vue +0 -276
  145. package/components/QiuFullscreen/index.vue +0 -11
  146. package/components/QiuGrid/index.vue +0 -408
  147. package/components/QiuHoverCard/index.vue +0 -192
  148. package/components/QiuIcon/index.vue +0 -117
  149. package/components/QiuIconPicker/iconify.libraries.ts +0 -182
  150. package/components/QiuIconPicker/icons.catalog.ts +0 -3072
  151. package/components/QiuIconPicker/index.vue +0 -488
  152. package/components/QiuImage/index.vue +0 -177
  153. package/components/QiuInput/index.vue +0 -328
  154. package/components/QiuInputNumber/index.vue +0 -295
  155. package/components/QiuInputOtp/index.vue +0 -190
  156. package/components/QiuKbd/index.vue +0 -57
  157. package/components/QiuLayoutContainer/index.vue +0 -50
  158. package/components/QiuLinkPreview/index.vue +0 -224
  159. package/components/QiuLoading/index.ts +0 -176
  160. package/components/QiuLoading/spinner.vue +0 -820
  161. package/components/QiuLoading/types.ts +0 -44
  162. package/components/QiuMention/index.vue +0 -299
  163. package/components/QiuMenu/QiuMenuRoot.vue +0 -241
  164. package/components/QiuMenu/components/QiuMenuItem.vue +0 -340
  165. package/components/QiuMenu/components/QiuSubMenu.vue +0 -504
  166. package/components/QiuMenu/context.ts +0 -21
  167. package/components/QiuMenu/index.vue +0 -43
  168. package/components/QiuMenuNav/QiuMenuNavItem.vue +0 -100
  169. package/components/QiuMenuNav/QiuMenuNavSub.vue +0 -120
  170. package/components/QiuMenuNav/context.ts +0 -14
  171. package/components/QiuMenuNav/index.vue +0 -148
  172. package/components/QiuMsg/QiuMsgItem.vue +0 -180
  173. package/components/QiuMsg/index.ts +0 -158
  174. package/components/QiuMsg/types.ts +0 -23
  175. package/components/QiuMsgBox/index.ts +0 -147
  176. package/components/QiuNotification/QiuNotificationItem.vue +0 -168
  177. package/components/QiuNotification/index.ts +0 -155
  178. package/components/QiuNotification/types.ts +0 -14
  179. package/components/QiuPage/index.vue +0 -12
  180. package/components/QiuPageHeader/index.vue +0 -115
  181. package/components/QiuPageMain/index.vue +0 -78
  182. package/components/QiuPagination/index.vue +0 -421
  183. package/components/QiuPasswordStrength/index.vue +0 -101
  184. package/components/QiuPopconfirm/index.vue +0 -196
  185. package/components/QiuPopover/index.vue +0 -277
  186. package/components/QiuProgress/index.vue +0 -235
  187. package/components/QiuQrcode/index.vue +0 -302
  188. package/components/QiuQueryForm/components/QiuQueryFormBottomPanel.vue +0 -13
  189. package/components/QiuQueryForm/components/QiuQueryFormLeftPanel.vue +0 -37
  190. package/components/QiuQueryForm/components/QiuQueryFormRightPanel.vue +0 -37
  191. package/components/QiuQueryForm/components/QiuQueryFormTopPanel.vue +0 -13
  192. package/components/QiuQueryForm/index.vue +0 -117
  193. package/components/QiuRadio/QiuRadioGroup.vue +0 -75
  194. package/components/QiuRadio/index.vue +0 -191
  195. package/components/QiuRadio/types.ts +0 -9
  196. package/components/QiuRate/index.vue +0 -184
  197. package/components/QiuRefresh/index.vue +0 -32
  198. package/components/QiuResult/index.vue +0 -103
  199. package/components/QiuRow/index.vue +0 -60
  200. package/components/QiuRow/types.ts +0 -5
  201. package/components/QiuScrollbar/index.vue +0 -107
  202. package/components/QiuSearchBar/index.vue +0 -154
  203. package/components/QiuSegmented/index.vue +0 -120
  204. package/components/QiuSelect/QiuOption.vue +0 -93
  205. package/components/QiuSelect/index.vue +0 -452
  206. package/components/QiuSelect/types.ts +0 -15
  207. package/components/QiuSkeleton/index.vue +0 -78
  208. package/components/QiuSlider/index.vue +0 -266
  209. package/components/QiuSpace/index.vue +0 -95
  210. package/components/QiuSparkline/index.vue +0 -92
  211. package/components/QiuStatistic/index.vue +0 -4
  212. package/components/QiuStatistics/index.vue +0 -123
  213. package/components/QiuStep/index.vue +0 -220
  214. package/components/QiuSteps/context.ts +0 -25
  215. package/components/QiuSteps/index.vue +0 -84
  216. package/components/QiuSwitch/index.vue +0 -145
  217. package/components/QiuTabBar/index.vue +0 -218
  218. package/components/QiuTabBar/types.ts +0 -19
  219. package/components/QiuTabPane/index.vue +0 -82
  220. package/components/QiuTable/columns.ts +0 -16
  221. package/components/QiuTable/export.ts +0 -102
  222. package/components/QiuTable/index.ts +0 -24
  223. package/components/QiuTable/index.vue +0 -3503
  224. package/components/QiuTable/registry.ts +0 -75
  225. package/components/QiuTable/styles/table.scss +0 -1230
  226. package/components/QiuTable/types.ts +0 -413
  227. package/components/QiuTable/useArea.ts +0 -202
  228. package/components/QiuTable/useColumns.ts +0 -325
  229. package/components/QiuTable/useEdit.ts +0 -136
  230. package/components/QiuTable/useExtras.ts +0 -115
  231. package/components/QiuTable/useHistory.ts +0 -77
  232. package/components/QiuTable/useMerge.ts +0 -105
  233. package/components/QiuTable/useResize.ts +0 -86
  234. package/components/QiuTable/useScrollSync.ts +0 -152
  235. package/components/QiuTable/useVirtual.ts +0 -97
  236. package/components/QiuTable/utils.ts +0 -165
  237. package/components/QiuTableColumn/index.vue +0 -101
  238. package/components/QiuTag/index.vue +0 -143
  239. package/components/QiuText/index.vue +0 -99
  240. package/components/QiuTime/index.vue +0 -548
  241. package/components/QiuTimeAgo/index.vue +0 -103
  242. package/components/QiuTimeline/index.vue +0 -54
  243. package/components/QiuTimelineItem/index.vue +0 -140
  244. package/components/QiuTips/index.vue +0 -323
  245. package/components/QiuTooltip/index.vue +0 -237
  246. package/components/QiuTransfer/index.vue +0 -277
  247. package/components/QiuTree/QiuTreeNode.vue +0 -146
  248. package/components/QiuTree/index.vue +0 -143
  249. package/components/QiuTree/types.ts +0 -30
  250. package/components/QiuTreeSelect/index.vue +0 -259
  251. package/components/QiuTrend/index.vue +0 -92
  252. package/components/QiuUpload/index.vue +0 -628
  253. package/components/QiuUploadCrop/index.vue +0 -1267
  254. package/components/QiuWatermark/index.vue +0 -121
  255. package/components/useBodyScrollLock.ts +0 -28
  256. package/dist/components/QiuBadge/index.d.ts +0 -18
  257. package/dist/components/QiuBadge/utils/pca-code.json.d.ts +0 -3
  258. package/dist/components/QiuLoading/index.d.ts +0 -26
  259. package/dist/components/QiuMsg/index.d.ts +0 -30
  260. package/dist/components/QiuNotification/index.d.ts +0 -30
  261. package/dist/components/QiuNotification/types.d.ts +0 -12
  262. package/dist/components/QiuRow/types.d.ts +0 -4
  263. package/dist/components/QiuTable/index.d.ts +0 -3
  264. package/dist/components/QiuTable/registry.d.ts +0 -39
  265. package/dist/components/QiuTable/useEdit.d.ts +0 -36
  266. package/dist/components/QiuTree/types.d.ts +0 -13
  267. package/dist/src/bridge/@qiu/plugins/shortcuts.d.ts +0 -2
  268. package/plugins/qiu.ts +0 -83
  269. package/plugins/shortcuts.ts +0 -69
  270. package/src/bridge/@/api/media.ts +0 -8
  271. package/src/bridge/@/api/notice.ts +0 -5
  272. package/src/bridge/@/config/index.ts +0 -38
  273. package/src/bridge/@/config/media.config.ts +0 -37
  274. package/src/bridge/@/config/security.config.ts +0 -8
  275. package/src/bridge/@/i18n/index.ts +0 -6
  276. package/src/bridge/@/store/modules/bing.ts +0 -9
  277. package/src/bridge/@/store/modules/errorLog.ts +0 -9
  278. package/src/bridge/@/store/modules/media.ts +0 -10
  279. package/src/bridge/@/store/modules/routes.ts +0 -10
  280. package/src/bridge/@/store/modules/settings.ts +0 -9
  281. package/src/bridge/@/store/modules/tabs.ts +0 -9
  282. package/src/bridge/@/store/modules/user.ts +0 -9
  283. package/src/bridge/@/utils/convertToCamelCase.ts +0 -11
  284. package/src/bridge/@/utils/index.ts +0 -9
  285. package/src/bridge/@/utils/pageTitle.ts +0 -4
  286. package/src/bridge/@/utils/routes.ts +0 -14
  287. package/src/bridge/@/utils/validate.ts +0 -17
  288. package/src/bridge/@qiu/plugins/shortcuts.ts +0 -3
  289. package/src/i18n.ts +0 -8
  290. package/src/icons/qiu-logo.svg +0 -1
  291. package/styles/dark.scss +0 -194
  292. package/styles/normalize.css +0 -349
  293. package/styles/plain.scss +0 -423
  294. package/styles/qiu-tokens.scss +0 -40
  295. package/styles/qiu.scss +0 -1149
  296. package/styles/technology.scss +0 -452
  297. package/styles/var.scss +0 -382
  298. package/styles/variables.scss +0 -77
  299. /package/dist/components/{QiuAnchorLink → FouAnchorLink}/index.vue.d.ts +0 -0
  300. /package/dist/components/{QiuBadge → FouBadge}/api/index.d.ts +0 -0
  301. /package/dist/components/{QiuBadge → FouBadge}/components/BadgeImagePickerDialog.vue.d.ts +0 -0
  302. /package/dist/components/{QiuBadge → FouBadge}/components/BadgeLibraryManagerDialog.vue.d.ts +0 -0
  303. /package/dist/components/{QiuBadge → FouBadge}/components/BadgeLibraryPanel.vue.d.ts +0 -0
  304. /package/dist/components/{QiuBadge → FouBadge}/shared/assetUrl.d.ts +0 -0
  305. /package/dist/components/{QiuBadge → FouBadge}/utils/chinaAreaData.d.ts +0 -0
  306. /package/dist/components/{QiuBadge → FouBadge}/utils/hostRegion.d.ts +0 -0
  307. /package/dist/components/{QiuBadge → FouBadge}/utils/pdfFromElement.d.ts +0 -0
  308. /package/dist/components/{QiuBadge → FouBadge}/views/BadgeLibraryView.vue.d.ts +0 -0
  309. /package/dist/components/{QiuBadge → FouBadge}/views/BadgeManageView.vue.d.ts +0 -0
  310. /package/dist/components/{QiuBadge → FouBadge}/views/BadgeTemplateListView.vue.d.ts +0 -0
  311. /package/dist/components/{QiuBadge → FouBadge}/views/DeskLabelTemplateListView.vue.d.ts +0 -0
  312. /package/dist/components/{QiuBadge → FouBadge}/views/DeskLabelView.vue.d.ts +0 -0
  313. /package/dist/components/{QiuCanvasKit/QiuCanvasRenderer.vue.d.ts → FouCanvasKit/FouCanvasRenderer.vue.d.ts} +0 -0
  314. /package/dist/components/{QiuCanvasKit → FouCanvasKit}/assetUrl.d.ts +0 -0
  315. /package/dist/components/{QiuCanvasKit → FouCanvasKit}/export/html.d.ts +0 -0
  316. /package/dist/components/{QiuCanvasKit → FouCanvasKit}/export/pdf.d.ts +0 -0
  317. /package/dist/components/{QiuCanvasKit → FouCanvasKit}/export/png.d.ts +0 -0
  318. /package/dist/components/{QiuCanvasKit → FouCanvasKit}/modules/badgeCompat.d.ts +0 -0
  319. /package/dist/components/{QiuCanvasKit → FouCanvasKit}/modules/dataRegistry.d.ts +0 -0
  320. /package/dist/components/{QiuCanvasKit → FouCanvasKit}/modules/merge.d.ts +0 -0
  321. /package/dist/components/{QiuCanvasKit → FouCanvasKit}/presets/badge.d.ts +0 -0
  322. /package/dist/components/{QiuCanvasKit → FouCanvasKit}/presets/banner.d.ts +0 -0
  323. /package/dist/components/{QiuCarouselItem → FouCarouselItem}/index.vue.d.ts +0 -0
  324. /package/dist/components/{QiuCheckbox/QiuCheckboxGroup.vue.d.ts → FouCheckbox/FouCheckboxGroup.vue.d.ts} +0 -0
  325. /package/dist/components/{QiuCheckbox → FouCheckbox}/index.vue.d.ts +0 -0
  326. /package/dist/components/{QiuCode → FouCode}/index.vue.d.ts +0 -0
  327. /package/dist/components/{QiuCollapseItem → FouCollapseItem}/index.vue.d.ts +0 -0
  328. /package/dist/components/{QiuColorField → FouColorField}/index.vue.d.ts +0 -0
  329. /package/dist/components/{QiuColorPicker → FouColorPicker}/index.vue.d.ts +0 -0
  330. /package/dist/components/{QiuCombobox → FouCombobox}/index.vue.d.ts +0 -0
  331. /package/dist/components/{QiuContextMenu → FouContextMenu}/index.vue.d.ts +0 -0
  332. /package/dist/components/{QiuDescriptionsItem → FouDescriptionsItem}/index.vue.d.ts +0 -0
  333. /package/dist/components/{QiuDigitalCard → FouDigitalCard}/index.vue.d.ts +0 -0
  334. /package/dist/components/{QiuDropdown/QiuDropdownItem.vue.d.ts → FouDropdown/FouDropdownItem.vue.d.ts} +0 -0
  335. /package/dist/components/{QiuDropdown/QiuDropdownMenu.vue.d.ts → FouDropdown/FouDropdownMenu.vue.d.ts} +0 -0
  336. /package/dist/components/{QiuDropdown → FouDropdown}/index.vue.d.ts +0 -0
  337. /package/dist/components/{QiuHoverCard → FouHoverCard}/index.vue.d.ts +0 -0
  338. /package/dist/components/{QiuIcon → FouIcon}/index.vue.d.ts +0 -0
  339. /package/dist/components/{QiuIconPicker → FouIconPicker}/iconify.libraries.d.ts +0 -0
  340. /package/dist/components/{QiuIconPicker → FouIconPicker}/icons.catalog.d.ts +0 -0
  341. /package/dist/components/{QiuInput → FouInput}/index.vue.d.ts +0 -0
  342. /package/dist/components/{QiuInputNumber → FouInputNumber}/index.vue.d.ts +0 -0
  343. /package/dist/components/{QiuInputOtp → FouInputOtp}/index.vue.d.ts +0 -0
  344. /package/dist/components/{QiuKbd → FouKbd}/index.vue.d.ts +0 -0
  345. /package/dist/components/{QiuLayoutContainer → FouLayoutContainer}/index.vue.d.ts +0 -0
  346. /package/dist/components/{QiuLinkPreview → FouLinkPreview}/index.vue.d.ts +0 -0
  347. /package/dist/components/{QiuMention → FouMention}/index.vue.d.ts +0 -0
  348. /package/dist/components/{QiuMenu/QiuMenuRoot.vue.d.ts → FouMenu/FouMenuRoot.vue.d.ts} +0 -0
  349. /package/dist/components/{QiuMenuNav/QiuMenuNavItem.vue.d.ts → FouMenuNav/FouMenuNavItem.vue.d.ts} +0 -0
  350. /package/dist/components/{QiuMenuNav/QiuMenuNavSub.vue.d.ts → FouMenuNav/FouMenuNavSub.vue.d.ts} +0 -0
  351. /package/dist/components/{QiuMenuNav → FouMenuNav}/index.vue.d.ts +0 -0
  352. /package/dist/components/{QiuPageMain → FouPageMain}/index.vue.d.ts +0 -0
  353. /package/dist/components/{QiuPagination → FouPagination}/index.vue.d.ts +0 -0
  354. /package/dist/components/{QiuPasswordStrength → FouPasswordStrength}/index.vue.d.ts +0 -0
  355. /package/dist/components/{QiuQrcode → FouQrcode}/index.vue.d.ts +0 -0
  356. /package/dist/components/{QiuRadio/QiuRadioGroup.vue.d.ts → FouRadio/FouRadioGroup.vue.d.ts} +0 -0
  357. /package/dist/components/{QiuSearchBar → FouSearchBar}/index.vue.d.ts +0 -0
  358. /package/dist/components/{QiuSelect/QiuOption.vue.d.ts → FouSelect/FouOption.vue.d.ts} +0 -0
  359. /package/dist/components/{QiuSparkline → FouSparkline}/index.vue.d.ts +0 -0
  360. /package/dist/components/{QiuSwitch → FouSwitch}/index.vue.d.ts +0 -0
  361. /package/dist/components/{QiuTabPane → FouTabPane}/index.vue.d.ts +0 -0
  362. /package/dist/components/{QiuTable → FouTable}/columns.d.ts +0 -0
  363. /package/dist/components/{QiuTable → FouTable}/useExtras.d.ts +0 -0
  364. /package/dist/components/{QiuTable → FouTable}/useResize.d.ts +0 -0
  365. /package/dist/components/{QiuTable → FouTable}/useVirtual.d.ts +0 -0
  366. /package/dist/components/{QiuTime → FouTime}/index.vue.d.ts +0 -0
  367. /package/dist/components/{QiuTimeAgo → FouTimeAgo}/index.vue.d.ts +0 -0
  368. /package/dist/components/{QiuTimelineItem → FouTimelineItem}/index.vue.d.ts +0 -0
  369. /package/dist/components/{QiuTooltip → FouTooltip}/index.vue.d.ts +0 -0
  370. /package/dist/components/{QiuTrend → FouTrend}/index.vue.d.ts +0 -0
  371. /package/dist/components/{QiuUploadCrop → FouUploadCrop}/index.vue.d.ts +0 -0
@@ -1,348 +0,0 @@
1
- <script setup lang="ts">
2
- /**
3
- * 画布渲染器(预览 / 套打 / Banner;支持 link 热区)
4
- * @author qiuye
5
- * @email yjk150@qq.com
6
- * @date 2026-08-16
7
- */
8
- import { computed } from 'vue'
9
- import type {
10
- CanvasKitDoc,
11
- CanvasKitElement,
12
- CanvasKitShapeElement,
13
- CanvasKitTextElement,
14
- MergeContext,
15
- } from './types'
16
- import { mergeTemplateText, sortCanvasElements } from './modules/merge'
17
- import { resolveAssetUrl } from './assetUrl'
18
-
19
- defineOptions({ name: 'QiuCanvasRenderer' })
20
-
21
- const CSS_MM_TO_PX = 96 / 25.4
22
-
23
- const props = withDefaults(
24
- defineProps<{
25
- doc: CanvasKitDoc | null
26
- mergeData?: MergeContext | Record<string, string>
27
- screenScale?: number
28
- enableLinks?: boolean
29
- }>(),
30
- { screenScale: 1, mergeData: () => ({}), enableLinks: true }
31
- )
32
-
33
- const sorted = computed(() => {
34
- if (!props.doc?.elements?.length) return []
35
- return sortCanvasElements(props.doc.elements)
36
- })
37
-
38
- const canvasStyle = computed(() => {
39
- const d = props.doc
40
- if (!d?.canvas) return {}
41
- const showBorder = d.canvas.showBorder !== false && d.mode !== 'banner'
42
- const borderColor = d.canvas.borderColor || '#334155'
43
- const bw = Number(d.canvas.borderWidthMm)
44
- const borderWidthMm = Number.isFinite(bw) && bw > 0 ? bw : 0.35
45
- const usePx = d.canvas.unit === 'px' || (d.mode === 'banner' && !!d.canvas.widthPx)
46
- const style: Record<string, string> = {
47
- width: usePx
48
- ? `${d.canvas.widthPx ?? Math.round(d.canvas.widthMm * CSS_MM_TO_PX)}px`
49
- : `${d.canvas.widthMm}mm`,
50
- height: usePx
51
- ? `${d.canvas.heightPx ?? Math.round(d.canvas.heightMm * CSS_MM_TO_PX)}px`
52
- : `${d.canvas.heightMm}mm`,
53
- position: 'relative',
54
- boxSizing: 'border-box',
55
- overflow: 'hidden',
56
- backgroundColor: d.canvas.background || 'transparent',
57
- border: showBorder ? `${borderWidthMm}mm solid ${borderColor}` : '0 solid transparent',
58
- }
59
- return style
60
- })
61
-
62
- const backgroundImageUrl = computed(() => {
63
- const src = props.doc?.canvas?.backgroundImage
64
- return src ? resolveAssetUrl(src) : ''
65
- })
66
-
67
- const wrapStyle = computed(() => ({
68
- transform: `scale(${props.screenScale})`,
69
- transformOrigin: 'top left',
70
- }))
71
-
72
- const layoutClipStyle = computed(() => {
73
- const d = props.doc?.canvas
74
- if (!d) return {}
75
- const usePx = d.unit === 'px' || (props.doc?.mode === 'banner' && !!d.widthPx)
76
- const w = usePx
77
- ? (d.widthPx ?? d.widthMm * CSS_MM_TO_PX) * props.screenScale
78
- : d.widthMm * CSS_MM_TO_PX * props.screenScale
79
- const h = usePx
80
- ? (d.heightPx ?? d.heightMm * CSS_MM_TO_PX) * props.screenScale
81
- : d.heightMm * CSS_MM_TO_PX * props.screenScale
82
- return {
83
- width: `${w}px`,
84
- height: `${h}px`,
85
- overflow: 'hidden',
86
- lineHeight: 0,
87
- display: 'inline-block',
88
- verticalAlign: 'top',
89
- }
90
- })
91
-
92
- function textMerged(el: CanvasKitTextElement) {
93
- return mergeTemplateText(el.text, props.mergeData || {})
94
- }
95
-
96
- function linkHref(el: CanvasKitElement) {
97
- if (!el.link?.href) return ''
98
- return mergeTemplateText(el.link.href, props.mergeData || {})
99
- }
100
-
101
- function flexForAlign(align?: string) {
102
- switch (align) {
103
- case 'center':
104
- return { justifyContent: 'center', alignItems: 'center', textAlign: 'center' as const }
105
- case 'top-center':
106
- return { justifyContent: 'center', alignItems: 'flex-start', textAlign: 'center' as const }
107
- case 'bottom-center':
108
- return { justifyContent: 'center', alignItems: 'flex-end', textAlign: 'center' as const }
109
- case 'middle-left':
110
- return { justifyContent: 'flex-start', alignItems: 'center', textAlign: 'left' as const }
111
- case 'middle-right':
112
- return { justifyContent: 'flex-end', alignItems: 'center', textAlign: 'right' as const }
113
- default:
114
- return { justifyContent: 'flex-start', alignItems: 'flex-start', textAlign: 'left' as const }
115
- }
116
- }
117
-
118
- function elBase(el: CanvasKitElement) {
119
- const transforms: string[] = []
120
- if (el.rotation) transforms.push(`rotate(${el.rotation}deg)`)
121
- if (el.flipX) transforms.push('scaleX(-1)')
122
- if (el.flipY) transforms.push('scaleY(-1)')
123
- return {
124
- position: 'absolute' as const,
125
- left: `${el.xMm}mm`,
126
- top: `${el.yMm}mm`,
127
- width: `${el.wMm}mm`,
128
- height: `${el.hMm}mm`,
129
- zIndex: el.zIndex ?? 1,
130
- transform: transforms.join(' ') || undefined,
131
- transformOrigin: 'center center',
132
- pointerEvents: props.enableLinks && el.link?.href ? ('auto' as const) : ('none' as const),
133
- textDecoration: 'none' as const,
134
- color: undefined as string | undefined,
135
- }
136
- }
137
-
138
- function textElStyle(el: CanvasKitTextElement) {
139
- const flex = flexForAlign(el.align)
140
- const vertical = el.textDirection === 'vertical'
141
- const base = elBase(el)
142
- return {
143
- ...base,
144
- display: 'flex',
145
- ...flex,
146
- fontSize: `${el.fontSize}pt`,
147
- fontFamily: el.fontFamily,
148
- color: el.color,
149
- lineHeight: 1.25,
150
- whiteSpace: 'pre-wrap' as const,
151
- wordBreak: 'break-word' as const,
152
- overflow: 'hidden',
153
- writingMode: vertical ? ('vertical-rl' as const) : ('horizontal-tb' as const),
154
- textOrientation: vertical ? ('upright' as const) : ('mixed' as const),
155
- }
156
- }
157
-
158
- function imgElStyle(el: CanvasKitElement) {
159
- if (el.type !== 'image' && el.type !== 'seal') return {}
160
- return {
161
- ...elBase(el),
162
- display: 'flex',
163
- justifyContent: 'center',
164
- alignItems: 'center',
165
- padding: '0.5mm',
166
- boxSizing: 'border-box' as const,
167
- }
168
- }
169
-
170
- function shapeElStyle(el: CanvasKitShapeElement) {
171
- return {
172
- ...elBase(el),
173
- boxSizing: 'border-box' as const,
174
- opacity: el.opacity != null ? String(el.opacity) : undefined,
175
- }
176
- }
177
-
178
- function shapeStroke(el: CanvasKitShapeElement) {
179
- return el.showStroke === false ? 'none' : el.strokeColor || '#606266'
180
- }
181
-
182
- function shapeStrokeWidth(el: CanvasKitShapeElement) {
183
- return Math.max(0, Number(el.strokeWidthMm ?? 0.6))
184
- }
185
-
186
- function shapeFill(el: CanvasKitShapeElement) {
187
- return el.background || 'transparent'
188
- }
189
-
190
- function polygonPoints(el: CanvasKitShapeElement) {
191
- const sides = Math.max(3, Math.min(12, Math.round(Number(el.polygonSides ?? 5))))
192
- const pts: string[] = []
193
- for (let i = 0; i < sides; i++) {
194
- const angle = -Math.PI / 2 + (Math.PI * 2 * i) / sides
195
- pts.push(`${50 + Math.cos(angle) * 44},${50 + Math.sin(angle) * 44}`)
196
- }
197
- return pts.join(' ')
198
- }
199
- </script>
200
-
201
- <template>
202
- <div v-if="doc?.canvas" class="qck-layout-clip" :style="layoutClipStyle">
203
- <div class="qck-screen-wrap" :style="wrapStyle">
204
- <div class="qiu-canvas-root qck-print-root" :style="canvasStyle">
205
- <img
206
- v-if="backgroundImageUrl"
207
- class="qiu-canvas-bg"
208
- :src="backgroundImageUrl"
209
- alt=""
210
- crossorigin="anonymous"
211
- />
212
- <div
213
- v-for="region in doc.regions || []"
214
- :key="region.id"
215
- class="qiu-canvas-region"
216
- :style="{
217
- left: `${region.xMm}mm`,
218
- top: `${region.yMm}mm`,
219
- width: `${region.wMm}mm`,
220
- height: `${region.hMm}mm`,
221
- backgroundColor: region.background || 'transparent',
222
- backgroundImage: region.backgroundImage
223
- ? `url(${resolveAssetUrl(region.backgroundImage)})`
224
- : undefined,
225
- backgroundSize: region.backgroundImage ? 'cover' : undefined,
226
- backgroundPosition: region.backgroundImage ? 'center' : undefined,
227
- }"
228
- />
229
- <template v-for="el in sorted" :key="el.id">
230
- <component
231
- :is="enableLinks && linkHref(el) ? 'a' : 'div'"
232
- v-if="el.type === 'text'"
233
- :href="enableLinks && linkHref(el) ? linkHref(el) : undefined"
234
- :target="el.link?.target || '_blank'"
235
- :rel="el.link?.target === '_self' ? undefined : 'noopener noreferrer'"
236
- :style="textElStyle(el)"
237
- >
238
- {{ textMerged(el) }}
239
- </component>
240
- <component
241
- :is="enableLinks && linkHref(el) ? 'a' : 'div'"
242
- v-else-if="el.type === 'image' || el.type === 'seal'"
243
- :href="enableLinks && linkHref(el) ? linkHref(el) : undefined"
244
- :target="el.link?.target || '_blank'"
245
- :rel="el.link?.target === '_self' ? undefined : 'noopener noreferrer'"
246
- :style="imgElStyle(el)"
247
- >
248
- <img
249
- :src="resolveAssetUrl(el.src)"
250
- alt=""
251
- style="max-width: 100%; max-height: 100%; object-fit: contain"
252
- />
253
- </component>
254
- <component
255
- :is="enableLinks && linkHref(el) ? 'a' : 'div'"
256
- v-else-if="el.type === 'shape'"
257
- :href="enableLinks && linkHref(el) ? linkHref(el) : undefined"
258
- :target="el.link?.target || '_blank'"
259
- :rel="el.link?.target === '_self' ? undefined : 'noopener noreferrer'"
260
- :style="shapeElStyle(el)"
261
- >
262
- <svg class="qiu-canvas-shape-svg" viewBox="0 0 100 100" preserveAspectRatio="none">
263
- <line
264
- v-if="el.shape === 'line'"
265
- x1="4"
266
- y1="50"
267
- x2="96"
268
- y2="50"
269
- :stroke="shapeStroke(el)"
270
- :stroke-width="Math.max(shapeStrokeWidth(el) * 3.2, 1)"
271
- stroke-linecap="round"
272
- />
273
- <rect
274
- v-else-if="el.shape === 'rect'"
275
- x="4"
276
- y="4"
277
- width="92"
278
- height="92"
279
- :fill="shapeFill(el)"
280
- :stroke="shapeStroke(el)"
281
- :stroke-width="shapeStrokeWidth(el) * 3.2"
282
- />
283
- <ellipse
284
- v-else-if="el.shape === 'circle'"
285
- cx="50"
286
- cy="50"
287
- rx="46"
288
- ry="46"
289
- :fill="shapeFill(el)"
290
- :stroke="shapeStroke(el)"
291
- :stroke-width="shapeStrokeWidth(el) * 3.2"
292
- />
293
- <polygon
294
- v-else-if="el.shape === 'triangle'"
295
- points="50,4 96,96 4,96"
296
- :fill="shapeFill(el)"
297
- :stroke="shapeStroke(el)"
298
- :stroke-width="shapeStrokeWidth(el) * 3.2"
299
- stroke-linejoin="round"
300
- />
301
- <polygon
302
- v-else
303
- :points="polygonPoints(el)"
304
- :fill="shapeFill(el)"
305
- :stroke="shapeStroke(el)"
306
- :stroke-width="shapeStrokeWidth(el) * 3.2"
307
- stroke-linejoin="round"
308
- />
309
- </svg>
310
- </component>
311
- </template>
312
- </div>
313
- </div>
314
- </div>
315
- </template>
316
-
317
- <style scoped>
318
- .qck-layout-clip {
319
- box-sizing: border-box;
320
- }
321
- .qck-screen-wrap {
322
- display: inline-block;
323
- }
324
- .qiu-canvas-root {
325
- border: 1px solid #dcdfe6;
326
- }
327
- .qiu-canvas-bg {
328
- position: absolute;
329
- inset: 0;
330
- width: 100%;
331
- height: 100%;
332
- object-fit: cover;
333
- pointer-events: none;
334
- user-select: none;
335
- z-index: 0;
336
- }
337
- .qiu-canvas-region {
338
- position: absolute;
339
- box-sizing: border-box;
340
- pointer-events: none;
341
- z-index: 0;
342
- }
343
- .qiu-canvas-shape-svg {
344
- width: 100%;
345
- height: 100%;
346
- display: block;
347
- }
348
- </style>
@@ -1,11 +0,0 @@
1
- /**
2
- * 资源 URL 解析(画布预览)
3
- * @author qiuye
4
- * @email yjk150@qq.com
5
- * @date 2026-08-16
6
- */
7
- export function resolveAssetUrl(src: string): string {
8
- if (!src) return ''
9
- if (/^(https?:|data:|blob:|\/\/)/i.test(src)) return src
10
- return src
11
- }
@@ -1,352 +0,0 @@
1
- <script setup lang="ts">
2
- /**
3
- * 数据模块配置面板:启用/增删字段、插入 {{module.key}}、预览样例
4
- * @author qiuye
5
- * @email yjk150@qq.com
6
- * @date 2026-08-16
7
- */
8
- import { computed, ref, watch } from 'vue'
9
- import type { DataModuleDef } from '../types'
10
- import {
11
- createCustomModule,
12
- listInsertableFields,
13
- resolveDataModules,
14
- sampleContextFromModules,
15
- } from '../modules/dataRegistry'
16
-
17
- defineOptions({ name: 'QiuCanvasDataModulesPanel' })
18
-
19
- const props = defineProps<{
20
- modelValue: DataModuleDef[]
21
- extraModules?: DataModuleDef[]
22
- }>()
23
-
24
- const emit = defineEmits<{
25
- 'update:modelValue': [DataModuleDef[]]
26
- insert: [token: string, meta: { moduleId: string; key: string; label: string }]
27
- 'preview-context': [ctx: Record<string, Record<string, string> | string>]
28
- }>()
29
-
30
- const activeId = ref('')
31
- const previewJson = ref('')
32
- const showLabel = ref(true)
33
-
34
- const modules = computed({
35
- get: () => resolveDataModules(props.extraModules, props.modelValue),
36
- set: (v) => emit('update:modelValue', v),
37
- })
38
-
39
- watch(
40
- modules,
41
- (list) => {
42
- if (!activeId.value && list[0]) activeId.value = list[0].id
43
- if (activeId.value && !list.find((m) => m.id === activeId.value)) {
44
- activeId.value = list[0]?.id || ''
45
- }
46
- },
47
- { immediate: true, deep: true }
48
- )
49
-
50
- const active = computed(() => modules.value.find((m) => m.id === activeId.value) || null)
51
-
52
- const fieldRows = computed(() => listInsertableFields(modules.value))
53
-
54
- function patchModules(next: DataModuleDef[]) {
55
- emit('update:modelValue', next)
56
- }
57
-
58
- function toggleEnabled(m: DataModuleDef, enabled: boolean) {
59
- const base = props.modelValue?.length ? [...props.modelValue] : resolveDataModules(props.extraModules)
60
- const idx = base.findIndex((x) => x.id === m.id)
61
- if (idx >= 0) {
62
- base[idx] = { ...base[idx], enabled }
63
- } else {
64
- base.push({ ...m, enabled })
65
- }
66
- patchModules(base)
67
- }
68
-
69
- function addModule() {
70
- const m = createCustomModule('自定义模块')
71
- const base = props.modelValue?.length ? [...props.modelValue] : resolveDataModules(props.extraModules)
72
- base.push(m)
73
- patchModules(base)
74
- activeId.value = m.id
75
- }
76
-
77
- function removeModule(m: DataModuleDef) {
78
- if (m.builtin) return
79
- const base = (props.modelValue || []).filter((x) => x.id !== m.id)
80
- patchModules(base)
81
- }
82
-
83
- function addField() {
84
- if (!active.value) return
85
- const base = props.modelValue?.length ? [...props.modelValue] : resolveDataModules(props.extraModules)
86
- let idx = base.findIndex((x) => x.id === active.value!.id)
87
- if (idx < 0) {
88
- base.push({ ...active.value })
89
- idx = base.length - 1
90
- }
91
- const key = `field_${Date.now().toString(36).slice(-4)}`
92
- base[idx] = {
93
- ...base[idx],
94
- fields: [...base[idx].fields, { key, label: '新字段', type: 'string' }],
95
- sample: { ...(base[idx].sample || {}), [key]: '样例' },
96
- }
97
- patchModules(base)
98
- }
99
-
100
- function updateField(i: number, patch: Partial<{ key: string; label: string }>) {
101
- if (!active.value) return
102
- const base = props.modelValue?.length ? [...props.modelValue] : resolveDataModules(props.extraModules)
103
- let idx = base.findIndex((x) => x.id === active.value!.id)
104
- if (idx < 0) {
105
- base.push({ ...active.value })
106
- idx = base.length - 1
107
- }
108
- const fields = base[idx].fields.map((f, j) => (j === i ? { ...f, ...patch } : f))
109
- base[idx] = { ...base[idx], fields }
110
- patchModules(base)
111
- }
112
-
113
- function updateSample(key: string, val: string) {
114
- if (!active.value) return
115
- const base = props.modelValue?.length ? [...props.modelValue] : resolveDataModules(props.extraModules)
116
- let idx = base.findIndex((x) => x.id === active.value!.id)
117
- if (idx < 0) {
118
- base.push({ ...active.value })
119
- idx = base.length - 1
120
- }
121
- base[idx] = {
122
- ...base[idx],
123
- sample: { ...(base[idx].sample || {}), [key]: val },
124
- }
125
- patchModules(base)
126
- }
127
-
128
- function insertField(row: { moduleId: string; key: string; label: string; token: string }) {
129
- const token = showLabel.value ? `${row.label}:${row.token}` : row.token
130
- emit('insert', token, { moduleId: row.moduleId, key: row.key, label: row.label })
131
- }
132
-
133
- function applyPreview() {
134
- let ctx = sampleContextFromModules(modules.value)
135
- if (previewJson.value.trim()) {
136
- try {
137
- const parsed = JSON.parse(previewJson.value)
138
- ctx = { ...ctx, ...parsed }
139
- } catch {
140
- /* ignore */
141
- }
142
- }
143
- emit('preview-context', ctx)
144
- }
145
-
146
- function renameActive(label: string) {
147
- if (!active.value) return
148
- const base = props.modelValue?.length ? [...props.modelValue] : resolveDataModules(props.extraModules)
149
- let idx = base.findIndex((x) => x.id === active.value!.id)
150
- if (idx < 0) {
151
- base.push({ ...active.value, label })
152
- } else {
153
- base[idx] = { ...base[idx], label }
154
- }
155
- patchModules(base)
156
- }
157
- </script>
158
-
159
- <template>
160
- <div class="qck-data-modules">
161
- <div class="qck-dm-head">
162
- <span class="qck-dm-title">数据模块</span>
163
- <qiu-button size="small" type="primary" plain @click="addModule">添加模块</qiu-button>
164
- </div>
165
- <div class="qck-dm-list">
166
- <button
167
- v-for="m in modules"
168
- :key="m.id"
169
- type="button"
170
- class="qck-dm-chip"
171
- :class="{ active: m.id === activeId, off: m.enabled === false }"
172
- @click="activeId = m.id"
173
- >
174
- <qiu-switch
175
- :model-value="m.enabled !== false"
176
- size="small"
177
- @click.stop
178
- @update:model-value="(v: boolean) => toggleEnabled(m, v)"
179
- />
180
- <span>{{ m.label }}</span>
181
- </button>
182
- </div>
183
-
184
- <template v-if="active">
185
- <div class="qck-dm-row">
186
- <span class="label">模块名</span>
187
- <qiu-input
188
- :model-value="active.label"
189
- size="small"
190
- :disabled="!!active.builtin"
191
- @update:model-value="renameActive"
192
- />
193
- <qiu-button
194
- v-if="!active.builtin"
195
- size="small"
196
- type="danger"
197
- link
198
- @click="removeModule(active)"
199
- >
200
- 删除
201
- </qiu-button>
202
- </div>
203
- <div class="qck-dm-fields">
204
- <div class="qck-dm-field-head">
205
- <span>字段</span>
206
- <qiu-button size="small" @click="addField">增字段</qiu-button>
207
- </div>
208
- <div v-for="(f, i) in active.fields" :key="`${active.id}-${i}-${f.key}`" class="qck-dm-field">
209
- <qiu-input
210
- :model-value="f.key"
211
- size="small"
212
- placeholder="key"
213
- @update:model-value="(v: string) => updateField(i, { key: v })"
214
- />
215
- <qiu-input
216
- :model-value="f.label"
217
- size="small"
218
- placeholder="标签"
219
- @update:model-value="(v: string) => updateField(i, { label: v })"
220
- />
221
- <qiu-input
222
- :model-value="active.sample?.[f.key] || ''"
223
- size="small"
224
- placeholder="样例"
225
- @update:model-value="(v: string) => updateSample(f.key, v)"
226
- />
227
- <qiu-button
228
- size="small"
229
- type="primary"
230
- link
231
- @click="
232
- insertField({
233
- moduleId: active.id,
234
- key: f.key,
235
- label: f.label,
236
- token: `{{${active.id}.${f.key}}}`,
237
- })
238
- "
239
- >
240
- 插入
241
- </qiu-button>
242
- </div>
243
- </div>
244
- </template>
245
-
246
- <div class="qck-dm-insert">
247
- <div class="qck-dm-row">
248
- <span class="label">插入带标签</span>
249
- <qiu-switch v-model="showLabel" size="small" />
250
- </div>
251
- <div class="qck-dm-quick">
252
- <qiu-button
253
- v-for="row in fieldRows.slice(0, 12)"
254
- :key="row.token"
255
- size="small"
256
- @click="insertField(row)"
257
- >
258
- {{ row.moduleLabel }}.{{ row.label }}
259
- </qiu-button>
260
- </div>
261
- </div>
262
-
263
- <div class="qck-dm-preview">
264
- <div class="qck-dm-field-head">
265
- <span>预览数据(JSON)</span>
266
- <qiu-button size="small" type="primary" @click="applyPreview">应用到画布</qiu-button>
267
- </div>
268
- <qiu-input
269
- v-model="previewJson"
270
- type="textarea"
271
- :rows="4"
272
- placeholder='{"student":{"name":"李四"},"classroom":{"name":"教室A"}}'
273
- />
274
- </div>
275
- </div>
276
- </template>
277
-
278
- <style scoped>
279
- .qck-data-modules {
280
- display: flex;
281
- flex-direction: column;
282
- gap: 10px;
283
- font-size: 12px;
284
- }
285
- .qck-dm-head {
286
- display: flex;
287
- align-items: center;
288
- justify-content: space-between;
289
- }
290
- .qck-dm-title {
291
- font-weight: 600;
292
- color: #0f172a;
293
- }
294
- .qck-dm-list {
295
- display: flex;
296
- flex-wrap: wrap;
297
- gap: 6px;
298
- }
299
- .qck-dm-chip {
300
- display: inline-flex;
301
- align-items: center;
302
- gap: 6px;
303
- border: 1px solid #e2e8f0;
304
- background: #fff;
305
- border-radius: 6px;
306
- padding: 4px 8px;
307
- cursor: pointer;
308
- }
309
- .qck-dm-chip.active {
310
- border-color: #0d9488;
311
- background: #f0fdfa;
312
- }
313
- .qck-dm-chip.off {
314
- opacity: 0.55;
315
- }
316
- .qck-dm-row {
317
- display: flex;
318
- align-items: center;
319
- gap: 8px;
320
- }
321
- .qck-dm-row .label {
322
- color: #64748b;
323
- min-width: 64px;
324
- }
325
- .qck-dm-fields {
326
- display: flex;
327
- flex-direction: column;
328
- gap: 6px;
329
- }
330
- .qck-dm-field-head {
331
- display: flex;
332
- justify-content: space-between;
333
- align-items: center;
334
- color: #475569;
335
- }
336
- .qck-dm-field {
337
- display: grid;
338
- grid-template-columns: 1fr 1fr 1fr auto;
339
- gap: 4px;
340
- align-items: center;
341
- }
342
- .qck-dm-quick {
343
- display: flex;
344
- flex-wrap: wrap;
345
- gap: 4px;
346
- }
347
- .qck-dm-preview {
348
- display: flex;
349
- flex-direction: column;
350
- gap: 6px;
351
- }
352
- </style>