@origen-ui/admin-cli 2.0.1 → 3.0.1

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 (892) hide show
  1. package/README.md +50 -11
  2. package/bin/contract-sync.mjs +112 -0
  3. package/bin/lib/errors.mjs +8 -0
  4. package/bin/lib/fs-json.mjs +18 -0
  5. package/bin/lib/hash.mjs +9 -0
  6. package/bin/og-admin.mjs +165 -35
  7. package/bin/sync-project.mjs +717 -0
  8. package/package.json +28 -17
  9. package/templates/current/clean/.agents/skills/admin-component-usage/SKILL.md +28 -0
  10. package/templates/current/clean/.agents/skills/admin-component-usage/references/component-directory.md +270 -0
  11. package/templates/current/clean/.agents/skills/build-admin-feature/SKILL.md +20 -0
  12. package/templates/current/clean/.agents/skills/build-admin-feature/references/component-selection.md +38 -0
  13. package/templates/current/{examples/.codex → clean/.agents}/skills/use-og-form/SKILL.md +1 -1
  14. package/templates/current/{examples/.codex → clean/.agents}/skills/use-og-form-table/SKILL.md +4 -3
  15. package/templates/current/clean/{.codex → .agents}/skills/use-og-search/SKILL.md +3 -3
  16. package/templates/current/clean/.agents/skills/use-og-table/SKILL.md +22 -0
  17. package/templates/current/{examples/.codex → clean/.agents}/skills/use-og-upload/SKILL.md +6 -5
  18. package/templates/current/clean/.api-client-e2e.config.ts +13 -0
  19. package/templates/current/clean/.claude/rules/01-feature-architecture.md +10 -0
  20. package/templates/current/clean/.claude/rules/02-vue-typescript.md +10 -0
  21. package/templates/current/clean/.claude/rules/03-component-policy.md +31 -0
  22. package/templates/current/clean/.claude/rules/04-api-auth-router.md +10 -0
  23. package/templates/current/clean/.claude/rules/05-style.md +10 -0
  24. package/templates/current/clean/.claude/rules/06-quality.md +10 -0
  25. package/templates/current/clean/.claude/skills/admin-component-usage/SKILL.md +28 -0
  26. package/templates/current/clean/.claude/skills/admin-component-usage/references/component-directory.md +270 -0
  27. package/templates/current/clean/.claude/skills/build-admin-feature/SKILL.md +20 -0
  28. package/templates/current/clean/.claude/skills/build-admin-feature/references/component-selection.md +38 -0
  29. package/templates/current/clean/{.codex → .claude}/skills/use-og-form/SKILL.md +1 -1
  30. package/templates/current/clean/{.codex → .claude}/skills/use-og-form-table/SKILL.md +4 -3
  31. package/templates/current/{examples/.codex → clean/.claude}/skills/use-og-search/SKILL.md +3 -3
  32. package/templates/current/clean/.claude/skills/use-og-table/SKILL.md +22 -0
  33. package/templates/current/clean/{.codex → .claude}/skills/use-og-upload/SKILL.md +6 -5
  34. package/templates/current/clean/.codebuddy/rules/01-feature-architecture.md +2 -2
  35. package/templates/current/clean/.codebuddy/rules/03-component-policy.md +4 -1
  36. package/templates/current/clean/.codebuddy/skills/admin-component-usage/SKILL.md +31 -0
  37. package/templates/current/clean/.codebuddy/skills/admin-component-usage/references/component-directory.md +270 -0
  38. package/templates/current/clean/.codebuddy/skills/build-admin-feature/SKILL.md +11 -5
  39. package/templates/current/clean/.codebuddy/skills/build-admin-feature/references/component-selection.md +38 -0
  40. package/templates/current/clean/.codebuddy/skills/use-og-form/SKILL.md +1 -1
  41. package/templates/current/clean/.codebuddy/skills/use-og-form-table/SKILL.md +4 -3
  42. package/templates/current/clean/.codebuddy/skills/use-og-search/SKILL.md +3 -3
  43. package/templates/current/clean/.codebuddy/skills/use-og-table/SKILL.md +16 -10
  44. package/templates/current/clean/.codebuddy/skills/use-og-upload/SKILL.md +6 -5
  45. package/templates/current/clean/.codex/AGENTS.md +55 -8
  46. package/templates/current/clean/.codex/rules/01-feature-architecture.md +2 -2
  47. package/templates/current/clean/.codex/rules/03-component-policy.md +4 -1
  48. package/templates/current/clean/.cursor/rules/.generated +5 -0
  49. package/templates/current/clean/.cursor/rules/01-feature-architecture.mdc +2 -2
  50. package/templates/current/clean/.cursor/rules/03-component-policy.mdc +4 -1
  51. package/templates/current/clean/.cursor/skills/admin-component-usage/SKILL.md +28 -0
  52. package/templates/current/clean/.cursor/skills/admin-component-usage/references/component-directory.md +270 -0
  53. package/templates/current/clean/.cursor/skills/build-admin-feature/SKILL.md +11 -5
  54. package/templates/current/clean/.cursor/skills/build-admin-feature/references/component-selection.md +38 -0
  55. package/templates/current/clean/.cursor/skills/use-og-form/SKILL.md +1 -1
  56. package/templates/current/clean/.cursor/skills/use-og-form-table/SKILL.md +4 -3
  57. package/templates/current/clean/.cursor/skills/use-og-search/SKILL.md +3 -3
  58. package/templates/current/clean/.cursor/skills/use-og-table/SKILL.md +16 -10
  59. package/templates/current/clean/.cursor/skills/use-og-upload/SKILL.md +6 -5
  60. package/templates/current/clean/{.env.example → .env.dev} +3 -2
  61. package/templates/current/clean/.env.mock +4 -0
  62. package/templates/current/clean/.env.production +5 -0
  63. package/templates/current/clean/.env.test +4 -0
  64. package/templates/current/clean/.node-version +1 -0
  65. package/templates/current/clean/.prettierignore +17 -0
  66. package/templates/current/clean/.prettierrc +8 -0
  67. package/templates/current/clean/.qoder/rules/01-feature-architecture.md +3 -4
  68. package/templates/current/clean/.qoder/rules/02-vue-typescript.md +1 -2
  69. package/templates/current/clean/.qoder/rules/03-component-policy.md +5 -3
  70. package/templates/current/clean/.qoder/rules/04-api-auth-router.md +1 -2
  71. package/templates/current/clean/.qoder/rules/05-style.md +1 -2
  72. package/templates/current/clean/.qoder/rules/06-quality.md +1 -2
  73. package/templates/current/clean/.qoder/skills/admin-component-usage/SKILL.md +28 -0
  74. package/templates/current/clean/.qoder/skills/admin-component-usage/references/component-directory.md +270 -0
  75. package/templates/current/clean/.qoder/skills/build-admin-feature/SKILL.md +11 -5
  76. package/templates/current/clean/.qoder/skills/build-admin-feature/references/component-selection.md +38 -0
  77. package/templates/current/clean/.qoder/skills/use-og-form/SKILL.md +1 -1
  78. package/templates/current/clean/.qoder/skills/use-og-form-table/SKILL.md +4 -3
  79. package/templates/current/clean/.qoder/skills/use-og-search/SKILL.md +3 -3
  80. package/templates/current/clean/.qoder/skills/use-og-table/SKILL.md +16 -10
  81. package/templates/current/clean/.qoder/skills/use-og-upload/SKILL.md +6 -5
  82. package/templates/current/clean/.zcode/skills/admin-component-usage/SKILL.md +28 -0
  83. package/templates/current/clean/.zcode/skills/admin-component-usage/references/component-directory.md +270 -0
  84. package/templates/current/clean/.zcode/skills/build-admin-feature/SKILL.md +20 -0
  85. package/templates/current/clean/.zcode/skills/build-admin-feature/references/component-selection.md +38 -0
  86. package/templates/current/clean/.zcode/skills/style-og-origen-ui/SKILL.md +11 -0
  87. package/templates/current/clean/.zcode/skills/use-og-dialog/SKILL.md +12 -0
  88. package/templates/current/clean/.zcode/skills/use-og-editor/SKILL.md +25 -0
  89. package/templates/current/clean/.zcode/skills/use-og-form/SKILL.md +12 -0
  90. package/templates/current/clean/.zcode/skills/use-og-form-table/SKILL.md +26 -0
  91. package/templates/current/clean/.zcode/skills/use-og-http/SKILL.md +13 -0
  92. package/templates/current/clean/.zcode/skills/use-og-router-tabs/SKILL.md +11 -0
  93. package/templates/current/clean/.zcode/skills/use-og-search/SKILL.md +14 -0
  94. package/templates/current/clean/.zcode/skills/use-og-table/SKILL.md +22 -0
  95. package/templates/current/clean/.zcode/skills/use-og-upload/SKILL.md +26 -0
  96. package/templates/current/clean/AGENTS.md +55 -9
  97. package/templates/current/clean/CHANGELOG.md +129 -0
  98. package/templates/current/clean/CLAUDE.md +3 -0
  99. package/templates/current/clean/README.md +58 -87
  100. package/templates/current/clean/component-catalog.json +766 -348
  101. package/templates/current/clean/component-catalog.v2.json +2040 -0
  102. package/templates/current/clean/docs/components/dialog.md +405 -0
  103. package/templates/current/clean/docs/components/editor-viewer.md +87 -0
  104. package/templates/current/clean/docs/components/editor.md +275 -0
  105. package/templates/current/clean/docs/components/form-table.md +222 -0
  106. package/templates/current/clean/docs/components/form.md +750 -0
  107. package/templates/current/clean/docs/components/index.md +44 -0
  108. package/templates/current/clean/docs/components/router.md +452 -0
  109. package/templates/current/clean/docs/components/search.md +1205 -0
  110. package/templates/current/clean/docs/components/svg-icon.md +124 -0
  111. package/templates/current/clean/docs/components/table-local.md +176 -0
  112. package/templates/current/clean/docs/components/table-with-search.md +207 -0
  113. package/templates/current/clean/docs/components/table.md +813 -0
  114. package/templates/current/clean/docs/components/tabs.md +440 -0
  115. package/templates/current/clean/docs/components/upload.md +349 -0
  116. package/templates/current/clean/eslint.config.js +89 -0
  117. package/templates/current/clean/index.html +1 -1
  118. package/templates/current/clean/openapi.json +10048 -999
  119. package/templates/current/clean/package.json +51 -39
  120. package/templates/current/clean/playwright.config.ts +20 -6
  121. package/templates/current/clean/playwright.mock.config.ts +42 -0
  122. package/templates/current/clean/pnpm-workspace.yaml +34 -0
  123. package/templates/current/clean/recipes/remote-crud-dialog-form.vue +15 -13
  124. package/templates/current/clean/scaffold.lock.json +164 -4
  125. package/templates/current/clean/scripts/api-codegen.config.ts +35 -0
  126. package/templates/current/clean/scripts/api-codegen.ts +2015 -0
  127. package/templates/current/clean/scripts/api-templates/http-client.ejs +359 -0
  128. package/templates/current/clean/scripts/check-admin-scaffold.mjs +316 -18
  129. package/templates/current/clean/scripts/generate-api.ts +290 -85
  130. package/templates/current/clean/scripts/lib/admin-component-catalog.mjs +515 -0
  131. package/templates/current/clean/scripts/lib/repository-root.mjs +9 -0
  132. package/templates/current/clean/scripts/mock-api.ts +1356 -0
  133. package/templates/current/clean/scripts/remove-examples.mjs +10 -35
  134. package/templates/current/clean/src/App.vue +9 -18
  135. package/templates/current/clean/src/api/generated/data-contracts.ts +23 -265
  136. package/templates/current/clean/src/api/generated/http-client.ts +351 -180
  137. package/templates/current/clean/src/api/generated/index.ts +22 -0
  138. package/templates/current/clean/src/api/generated/services/auth.ts +123 -0
  139. package/templates/current/clean/src/api/generated/services/common/files.ts +111 -0
  140. package/templates/current/clean/src/api/generated/services/monitor/cache.ts +164 -0
  141. package/templates/current/clean/src/api/generated/services/monitor/job.ts +195 -0
  142. package/templates/current/clean/src/api/generated/services/monitor/jobLog.ts +126 -0
  143. package/templates/current/clean/src/api/generated/services/monitor/logininfor.ts +126 -0
  144. package/templates/current/clean/src/api/generated/services/monitor/online.ts +66 -0
  145. package/templates/current/clean/src/api/generated/services/monitor/operlog.ts +106 -0
  146. package/templates/current/clean/src/api/generated/services/monitor/server.ts +41 -0
  147. package/templates/current/clean/src/api/generated/services/system/configs.ts +190 -0
  148. package/templates/current/clean/src/api/generated/services/system/departments.ts +173 -0
  149. package/templates/current/clean/src/api/generated/services/system/dictionaries/data.ts +169 -0
  150. package/templates/current/clean/src/api/generated/services/system/dictionaries/types.ts +187 -0
  151. package/templates/current/clean/src/api/generated/services/system/index.ts +158 -0
  152. package/templates/current/clean/src/api/generated/services/system/menus.ts +193 -0
  153. package/templates/current/clean/src/api/generated/services/system/notices.ts +221 -0
  154. package/templates/current/clean/src/api/generated/services/system/posts.ts +168 -0
  155. package/templates/current/clean/src/api/generated/services/system/roles.ts +354 -0
  156. package/templates/current/clean/src/api/generated/services/system/users.ts +425 -0
  157. package/templates/current/clean/src/api/generated/services/tool/code-generator.ts +304 -0
  158. package/templates/current/clean/src/api/generated/types/auth.types.ts +132 -0
  159. package/templates/current/clean/src/api/generated/types/common/files.types.ts +57 -0
  160. package/templates/current/clean/src/api/generated/types/common.ts +174 -0
  161. package/templates/current/clean/src/api/generated/types/enum-dict.ts +94 -0
  162. package/templates/current/clean/src/api/generated/types/enums.ts +155 -0
  163. package/templates/current/clean/src/api/generated/types/monitor/cache.types.ts +149 -0
  164. package/templates/current/clean/src/api/generated/types/monitor/job.types.ts +207 -0
  165. package/templates/current/clean/src/api/generated/types/monitor/jobLog.types.ts +134 -0
  166. package/templates/current/clean/src/api/generated/types/monitor/logininfor.types.ts +135 -0
  167. package/templates/current/clean/src/api/generated/types/monitor/online.types.ts +80 -0
  168. package/templates/current/clean/src/api/generated/types/monitor/operlog.types.ts +126 -0
  169. package/templates/current/clean/src/api/generated/types/monitor/server.types.ts +205 -0
  170. package/templates/current/clean/src/api/generated/types/system/configs.types.ts +200 -0
  171. package/templates/current/clean/src/api/generated/types/system/departments.types.ts +145 -0
  172. package/templates/current/clean/src/api/generated/types/system/dictionaries/data.types.ts +210 -0
  173. package/templates/current/clean/src/api/generated/types/system/dictionaries/types.types.ts +221 -0
  174. package/templates/current/clean/src/api/generated/types/system/index.types.ts +19 -0
  175. package/templates/current/clean/src/api/generated/types/system/menus.types.ts +234 -0
  176. package/templates/current/clean/src/api/generated/types/system/notices.types.ts +270 -0
  177. package/templates/current/clean/src/api/generated/types/system/posts.types.ts +198 -0
  178. package/templates/current/clean/src/api/generated/types/system/roles.types.ts +410 -0
  179. package/templates/current/clean/src/api/generated/types/system/users.types.ts +413 -0
  180. package/templates/current/clean/src/api/generated/types/tool/code-generator.types.ts +388 -0
  181. package/templates/current/clean/src/api/index.ts +44 -39
  182. package/templates/current/clean/src/app/__tests__/api-generated.types.ts +24 -0
  183. package/templates/current/clean/src/app/api.ts +6 -0
  184. package/templates/current/clean/src/app/authorization/permission.ts +9 -0
  185. package/templates/current/{examples/src/app → clean/src/app/config}/runtimeConfig.ts +44 -12
  186. package/templates/current/clean/src/app/errors/errorMessage.ts +80 -0
  187. package/templates/current/clean/src/app/http/client.ts +141 -0
  188. package/templates/current/clean/src/app/http/http-adapter.ts +71 -0
  189. package/templates/current/{examples/src/app → clean/src/app/i18n}/adminLocale.ts +25 -19
  190. package/templates/current/clean/src/app/{localeFormat.ts → i18n/localeFormat.ts} +29 -6
  191. package/templates/current/clean/src/app/i18n/origenUiLocale.ts +15 -0
  192. package/templates/current/clean/src/app/menu/menu.ts +175 -0
  193. package/templates/current/clean/src/app/menu/menuTypes.ts +20 -0
  194. package/templates/current/clean/src/{features → app}/security/devtoolsProtection.ts +8 -7
  195. package/templates/current/clean/src/app/ui/createAdminUi.ts +31 -0
  196. package/templates/current/clean/src/app/ui/iconCatalog.ts +71 -0
  197. package/templates/current/clean/src/assets/icons/appearance.svg +1 -0
  198. package/templates/current/clean/src/assets/icons/arrow-right.svg +1 -0
  199. package/templates/current/clean/src/assets/icons/check.svg +1 -0
  200. package/templates/current/clean/src/assets/icons/circle-check.svg +1 -0
  201. package/templates/current/clean/src/assets/icons/default.svg +4 -0
  202. package/templates/current/clean/src/assets/icons/directory/setting.svg +1 -0
  203. package/templates/current/clean/src/assets/icons/expand.svg +1 -0
  204. package/templates/current/clean/src/assets/icons/fold.svg +1 -0
  205. package/templates/current/clean/src/assets/icons/key.svg +1 -0
  206. package/templates/current/clean/src/assets/icons/lock.svg +1 -0
  207. package/templates/current/clean/src/assets/icons/monitor.svg +1 -0
  208. package/templates/current/clean/src/assets/icons/moon.svg +11 -0
  209. package/templates/current/clean/src/assets/icons/page/department.svg +1 -0
  210. package/templates/current/clean/src/assets/icons/page/dictionary.svg +1 -0
  211. package/templates/current/clean/src/assets/icons/page/menus.svg +1 -0
  212. package/templates/current/clean/src/assets/icons/page/user.svg +1 -0
  213. package/templates/current/clean/src/assets/icons/page/users.svg +1 -0
  214. package/templates/current/clean/src/assets/icons/plus.svg +1 -0
  215. package/templates/current/clean/src/assets/icons/profile.svg +1 -0
  216. package/templates/current/clean/src/assets/icons/refresh.svg +1 -0
  217. package/templates/current/clean/src/assets/icons/roles.svg +1 -0
  218. package/templates/current/clean/src/assets/icons/search.svg +1 -0
  219. package/templates/current/clean/src/assets/icons/sunny.svg +1 -0
  220. package/templates/current/clean/src/assets/icons/system.svg +1 -0
  221. package/templates/current/clean/src/assets/icons/theme-auto.svg +14 -0
  222. package/templates/current/clean/src/assets/icons/tune.svg +13 -0
  223. package/templates/current/clean/src/{features/shell/components → components}/RouteProgress.vue +2 -2
  224. package/templates/current/{examples/src/features/system/access → clean/src}/composables/useAuthorizationRefresh.ts +6 -1
  225. package/templates/current/clean/src/composables/useSystemTableSearchVisibility.ts +33 -0
  226. package/templates/current/clean/src/{features/appearance/composables → composables}/useTheme.ts +1 -1
  227. package/templates/current/clean/src/env.d.ts +6 -19
  228. package/templates/current/clean/src/layouts/AdminLayout.vue +7 -9
  229. package/templates/current/clean/src/{features/shell/components → layouts}/AdminWatermark.vue +2 -2
  230. package/templates/current/clean/src/layouts/BreadcrumbBar.vue +9 -1
  231. package/templates/current/clean/src/layouts/SideMenu.vue +7 -15
  232. package/templates/current/clean/src/{features/appearance/components → layouts}/ThemePanel.vue +39 -11
  233. package/templates/current/clean/src/layouts/TopBar.vue +60 -28
  234. package/templates/current/clean/src/layouts/WorkspaceTabs.vue +10 -1
  235. package/templates/current/clean/src/layouts/topBarMenuSearch.ts +25 -4
  236. package/templates/current/clean/src/locales/en-US.json +227 -219
  237. package/templates/current/clean/src/locales/index.ts +72 -32
  238. package/templates/current/clean/src/locales/messages-types.ts +15 -10
  239. package/templates/current/clean/src/locales/vue-i18n.d.ts +1 -1
  240. package/templates/current/clean/src/locales/zh-CN.json +226 -218
  241. package/templates/current/clean/src/locales/zh-TW.json +222 -214
  242. package/templates/current/clean/src/main.ts +59 -30
  243. package/templates/current/clean/src/router/bootstrap.ts +69 -24
  244. package/templates/current/clean/src/router/dynamic/componentLoader.ts +150 -0
  245. package/templates/current/clean/src/router/{dynamicMenuRefresh.ts → dynamic/dynamicMenuRefresh.ts} +6 -2
  246. package/templates/current/clean/src/router/dynamic/dynamicRoutes.ts +247 -0
  247. package/templates/current/clean/src/router/navigation/guards.ts +12 -0
  248. package/templates/current/clean/src/router/navigation/paths.ts +28 -0
  249. package/templates/current/clean/src/router/navigation/staticRoutes.ts +109 -0
  250. package/templates/current/clean/src/router/{queryEncryption.ts → query/queryEncryption.ts} +29 -12
  251. package/templates/current/clean/src/router/query/routeQuery.ts +29 -0
  252. package/templates/current/clean/src/router/{useRouteQueryDefaults.ts → query/useRouteQueryDefaults.ts} +9 -8
  253. package/templates/current/clean/src/router/query/useRouteQueryDefaults.types.ts +28 -0
  254. package/templates/current/clean/src/router/{runtimeErrorRecovery.ts → recovery/runtimeErrorRecovery.ts} +21 -3
  255. package/templates/current/clean/src/{features/auth/store → store}/auth.ts +96 -61
  256. package/templates/current/clean/src/store/dictionaries.ts +86 -0
  257. package/templates/current/clean/src/{features/shell/store → store}/sidebar.ts +9 -2
  258. package/templates/current/{examples/src/features/appearance → clean/src}/store/theme.ts +8 -4
  259. package/templates/current/clean/src/styles/layout.css +51 -0
  260. package/templates/current/clean/src/templates/og-form.ts +7 -2
  261. package/templates/current/clean/src/templates/og-table.ts +88 -20
  262. package/templates/current/clean/src/templates/router.ts +11 -2
  263. package/templates/current/clean/src/utils/color-mix.ts +6 -2
  264. package/templates/current/clean/src/utils/download.ts +11 -0
  265. package/templates/current/clean/src/utils/permissions.ts +1 -1
  266. package/templates/current/clean/src/utils/retryableDialog.ts +46 -0
  267. package/templates/current/clean/src/{features → views}/errors/pages/Forbidden.vue +6 -2
  268. package/templates/current/clean/src/views/errors/pages/MethodNotAllowed.vue +34 -0
  269. package/templates/current/clean/src/{features → views}/errors/pages/NotFound.vue +6 -2
  270. package/templates/current/clean/src/{features → views}/errors/pages/ServerError.vue +6 -2
  271. package/templates/current/clean/src/{features/auth/pages/Login.vue → views/login/pages/index.vue} +101 -11
  272. package/templates/current/clean/src/views/system/access/services/admin-repository.ts +489 -0
  273. package/templates/current/clean/src/views/system/access/services/rbac.ts +317 -0
  274. package/templates/current/clean/src/views/system/dept/components/DepartmentEditorForm.vue +87 -0
  275. package/templates/current/clean/src/views/system/dept/composables/useDepartmentManagement.ts +314 -0
  276. package/templates/current/clean/src/views/system/dept/pages/index.vue +44 -0
  277. package/templates/current/clean/src/views/system/dept/services/departments.ts +168 -0
  278. package/templates/current/clean/src/views/system/dict/components/DictionaryDataEditorForm.vue +98 -0
  279. package/templates/current/clean/src/views/system/dict/components/DictionaryDataPreview.vue +233 -0
  280. package/templates/current/clean/src/views/system/dict/components/DictionaryTypeEditorForm.vue +66 -0
  281. package/templates/current/clean/src/views/system/dict/composables/useDictionaryDataManagement.ts +406 -0
  282. package/templates/current/clean/src/views/system/dict/composables/useDictionaryTypeManagement.ts +329 -0
  283. package/templates/current/clean/src/views/system/dict/data/pages/index.vue +134 -0
  284. package/templates/current/clean/src/views/system/dict/pages/index.vue +113 -0
  285. package/templates/current/clean/src/views/system/dict/services/dictionaries.ts +239 -0
  286. package/templates/current/clean/src/views/system/menu/components/MenuEditorForm.vue +252 -0
  287. package/templates/current/clean/src/views/system/menu/composables/useMenuManagement.ts +357 -0
  288. package/templates/current/clean/src/views/system/menu/menuDraft.ts +45 -0
  289. package/templates/current/clean/src/views/system/menu/pages/ExternalLink.vue +37 -0
  290. package/templates/current/clean/src/views/system/menu/pages/index.vue +75 -0
  291. package/templates/current/clean/src/views/system/post/components/PostEditorForm.vue +69 -0
  292. package/templates/current/clean/src/views/system/post/composables/usePostManagement.ts +245 -0
  293. package/templates/current/clean/src/views/system/post/pages/index.vue +92 -0
  294. package/templates/current/clean/src/views/system/post/services/posts.ts +100 -0
  295. package/templates/current/clean/src/views/system/role/auth-users/pages/index.vue +100 -0
  296. package/templates/current/clean/src/views/system/role/components/RoleDataScopeForm.vue +167 -0
  297. package/templates/current/clean/src/views/system/role/components/RoleEditorForm.vue +165 -0
  298. package/templates/current/clean/src/views/system/role/components/RoleUserSelectForm.vue +129 -0
  299. package/templates/current/clean/src/views/system/role/composables/useRoleManagement.ts +422 -0
  300. package/templates/current/clean/src/views/system/role/composables/useRoleUserManagement.ts +233 -0
  301. package/templates/current/clean/src/views/system/role/pages/index.vue +110 -0
  302. package/templates/current/clean/src/views/system/role/services/roleAccess.ts +162 -0
  303. package/templates/current/clean/src/views/system/user/auth-roles/pages/index.vue +209 -0
  304. package/templates/current/clean/src/views/system/user/components/UserDetailsForm.vue +108 -0
  305. package/templates/current/clean/src/views/system/user/components/UserEditorForm.vue +207 -0
  306. package/templates/current/clean/src/views/system/user/components/UserImportDialog.vue +80 -0
  307. package/templates/current/clean/src/views/system/user/components/UserResetPasswordForm.vue +56 -0
  308. package/templates/current/clean/src/views/system/user/composables/useUserManagement.ts +502 -0
  309. package/templates/current/clean/src/views/system/user/pages/index.vue +459 -0
  310. package/templates/current/clean/tests/e2e/admin-access-business.spec.ts +33 -0
  311. package/templates/current/clean/tests/e2e/admin-shell.spec.ts +50 -0
  312. package/templates/current/clean/tests/e2e/fixtures/adminMockBackend.ts +95 -0
  313. package/templates/current/clean/tests/e2e/fixtures/labelGeometry.ts +52 -0
  314. package/templates/current/clean/tests/e2e/mock-api-generation.spec.ts +27 -0
  315. package/templates/current/clean/tests/e2e/mock-business.spec.ts +555 -0
  316. package/templates/current/clean/tests/e2e/mock-menu-retry-form-label.spec.ts +100 -0
  317. package/templates/current/clean/tests/e2e/mock-shell.spec.ts +25 -0
  318. package/templates/current/clean/tests/e2e/mock-tree-selection-layout.spec.ts +113 -0
  319. package/templates/current/clean/tests/unit/api/api-codegen.spec.ts +893 -0
  320. package/templates/current/clean/tests/unit/api/client.spec.ts +145 -0
  321. package/templates/current/clean/tests/unit/api/generated-http-client.spec.ts +290 -0
  322. package/templates/current/{examples/src → clean/tests/unit}/api/http-adapter.spec.ts +3 -3
  323. package/templates/current/clean/tests/unit/api/system-apis.spec.ts +118 -0
  324. package/templates/current/clean/tests/unit/app/createAdminUi.spec.ts +79 -0
  325. package/templates/current/clean/{src → tests/unit}/app/errorMessage.spec.ts +1 -1
  326. package/templates/current/clean/tests/unit/app/iconCatalog.spec.ts +12 -0
  327. package/templates/current/clean/tests/unit/app/menu.spec.ts +215 -0
  328. package/templates/current/{examples/src → clean/tests/unit}/app/origenUiLocale.spec.ts +1 -1
  329. package/templates/current/{examples/src → clean/tests/unit}/app/permission.spec.ts +4 -5
  330. package/templates/current/clean/tests/unit/app/runtimeConfig.spec.ts +36 -0
  331. package/templates/current/{examples/src/features → clean/tests/unit/app}/security/devtoolsProtection.spec.ts +17 -7
  332. package/templates/current/{examples/src/features/shell → clean/tests/unit}/composables/useRouteProgress.spec.ts +1 -1
  333. package/templates/current/{examples/src/features/shell/components → clean/tests/unit/layouts}/AdminWatermark.spec.ts +5 -7
  334. package/templates/current/{examples/src → clean/tests/unit}/layouts/topBarMenuSearch.spec.ts +25 -8
  335. package/templates/current/clean/{src → tests/unit}/locales/messages.spec.ts +43 -17
  336. package/templates/current/clean/tests/unit/router/dynamicMenuRefresh.spec.ts +151 -0
  337. package/templates/current/clean/tests/unit/router/dynamicRoutes.spec.ts +374 -0
  338. package/templates/current/clean/tests/unit/router/paths.spec.ts +103 -0
  339. package/templates/current/clean/{src → tests/unit}/router/queryEncryption.spec.ts +56 -10
  340. package/templates/current/clean/tests/unit/router/routeQuery.spec.ts +19 -0
  341. package/templates/current/clean/{src → tests/unit}/router/runtimeErrorRecovery.spec.ts +11 -6
  342. package/templates/current/{examples/src → clean/tests/unit}/router/useRouteQueryDefaults.spec.ts +46 -12
  343. package/templates/current/clean/tests/unit/scripts/mock-api.spec.ts +440 -0
  344. package/templates/current/clean/{scripts → tests/unit/scripts}/vite-build-policy.spec.ts +35 -6
  345. package/templates/current/clean/{src/features/auth → tests/unit}/store/auth.spec.ts +68 -15
  346. package/templates/current/clean/tests/unit/store/dictionaries.spec.ts +106 -0
  347. package/templates/current/{examples/src → clean/tests/unit}/templates/templates.spec.ts +60 -16
  348. package/templates/current/clean/{src/utils/__tests__ → tests/unit/utils}/color-mix.spec.ts +1 -1
  349. package/templates/current/clean/tests/unit/utils/retryableDialog.spec.ts +61 -0
  350. package/templates/current/{examples/src/features/errors/pages → clean/tests/unit/views/errors}/error-pages.spec.ts +11 -7
  351. package/templates/current/clean/tests/unit/views/feature-composables.spec.ts +233 -0
  352. package/templates/current/clean/tests/unit/views/system/access/admin-repository.spec.ts +353 -0
  353. package/templates/current/clean/tests/unit/views/system/access/rbac.spec.ts +329 -0
  354. package/templates/current/clean/tests/unit/views/system/dept/departments.spec.ts +104 -0
  355. package/templates/current/clean/tests/unit/views/system/dict/dictionaries.spec.ts +234 -0
  356. package/templates/current/clean/tests/unit/views/system/menu/menuDraft.spec.ts +77 -0
  357. package/templates/current/clean/tests/unit/views/system/menu/useMenuManagement.spec.ts +339 -0
  358. package/templates/current/clean/tests/unit/views/system/user/searchControl.spec.ts +128 -0
  359. package/templates/current/clean/tsconfig.json +4 -19
  360. package/templates/current/clean/vite.build-policy.ts +97 -22
  361. package/templates/current/clean/vite.config.ts +50 -7
  362. package/templates/current/examples/.agents/skills/admin-component-usage/SKILL.md +28 -0
  363. package/templates/current/examples/.agents/skills/admin-component-usage/references/component-directory.md +270 -0
  364. package/templates/current/examples/.agents/skills/build-admin-feature/SKILL.md +20 -0
  365. package/templates/current/examples/.agents/skills/build-admin-feature/references/component-selection.md +38 -0
  366. package/templates/current/examples/.agents/skills/style-og-origen-ui/SKILL.md +11 -0
  367. package/templates/current/examples/.agents/skills/use-og-dialog/SKILL.md +12 -0
  368. package/templates/current/examples/.agents/skills/use-og-editor/SKILL.md +25 -0
  369. package/templates/current/examples/.agents/skills/use-og-form/SKILL.md +12 -0
  370. package/templates/current/examples/.agents/skills/use-og-form-table/SKILL.md +26 -0
  371. package/templates/current/examples/.agents/skills/use-og-http/SKILL.md +13 -0
  372. package/templates/current/examples/.agents/skills/use-og-router-tabs/SKILL.md +11 -0
  373. package/templates/current/examples/.agents/skills/use-og-search/SKILL.md +14 -0
  374. package/templates/current/examples/.agents/skills/use-og-table/SKILL.md +22 -0
  375. package/templates/current/examples/.agents/skills/use-og-upload/SKILL.md +26 -0
  376. package/templates/current/examples/.api-client-e2e.config.ts +13 -0
  377. package/templates/current/examples/.claude/rules/01-feature-architecture.md +10 -0
  378. package/templates/current/examples/.claude/rules/02-vue-typescript.md +10 -0
  379. package/templates/current/examples/.claude/rules/03-component-policy.md +31 -0
  380. package/templates/current/examples/.claude/rules/04-api-auth-router.md +10 -0
  381. package/templates/current/examples/.claude/rules/05-style.md +10 -0
  382. package/templates/current/examples/.claude/rules/06-quality.md +10 -0
  383. package/templates/current/examples/.claude/skills/admin-component-usage/SKILL.md +28 -0
  384. package/templates/current/examples/.claude/skills/admin-component-usage/references/component-directory.md +270 -0
  385. package/templates/current/examples/.claude/skills/build-admin-feature/SKILL.md +20 -0
  386. package/templates/current/examples/.claude/skills/build-admin-feature/references/component-selection.md +38 -0
  387. package/templates/current/examples/.claude/skills/style-og-origen-ui/SKILL.md +11 -0
  388. package/templates/current/examples/.claude/skills/use-og-dialog/SKILL.md +12 -0
  389. package/templates/current/examples/.claude/skills/use-og-editor/SKILL.md +25 -0
  390. package/templates/current/examples/.claude/skills/use-og-form/SKILL.md +12 -0
  391. package/templates/current/examples/.claude/skills/use-og-form-table/SKILL.md +26 -0
  392. package/templates/current/examples/.claude/skills/use-og-http/SKILL.md +13 -0
  393. package/templates/current/examples/.claude/skills/use-og-router-tabs/SKILL.md +11 -0
  394. package/templates/current/examples/.claude/skills/use-og-search/SKILL.md +14 -0
  395. package/templates/current/examples/.claude/skills/use-og-table/SKILL.md +22 -0
  396. package/templates/current/examples/.claude/skills/use-og-upload/SKILL.md +26 -0
  397. package/templates/current/examples/.codebuddy/rules/01-feature-architecture.md +2 -2
  398. package/templates/current/examples/.codebuddy/rules/03-component-policy.md +4 -1
  399. package/templates/current/examples/.codebuddy/skills/admin-component-usage/SKILL.md +31 -0
  400. package/templates/current/examples/.codebuddy/skills/admin-component-usage/references/component-directory.md +270 -0
  401. package/templates/current/examples/.codebuddy/skills/build-admin-feature/SKILL.md +11 -5
  402. package/templates/current/examples/.codebuddy/skills/build-admin-feature/references/component-selection.md +38 -0
  403. package/templates/current/examples/.codebuddy/skills/use-og-form/SKILL.md +1 -1
  404. package/templates/current/examples/.codebuddy/skills/use-og-form-table/SKILL.md +4 -3
  405. package/templates/current/examples/.codebuddy/skills/use-og-search/SKILL.md +3 -3
  406. package/templates/current/examples/.codebuddy/skills/use-og-table/SKILL.md +16 -10
  407. package/templates/current/examples/.codebuddy/skills/use-og-upload/SKILL.md +6 -5
  408. package/templates/current/examples/.codex/AGENTS.md +55 -8
  409. package/templates/current/examples/.codex/rules/01-feature-architecture.md +2 -2
  410. package/templates/current/examples/.codex/rules/03-component-policy.md +4 -1
  411. package/templates/current/examples/.cursor/rules/.generated +5 -0
  412. package/templates/current/examples/.cursor/rules/01-feature-architecture.mdc +2 -2
  413. package/templates/current/examples/.cursor/rules/03-component-policy.mdc +4 -1
  414. package/templates/current/examples/.cursor/skills/admin-component-usage/SKILL.md +28 -0
  415. package/templates/current/examples/.cursor/skills/admin-component-usage/references/component-directory.md +270 -0
  416. package/templates/current/examples/.cursor/skills/build-admin-feature/SKILL.md +11 -5
  417. package/templates/current/examples/.cursor/skills/build-admin-feature/references/component-selection.md +38 -0
  418. package/templates/current/examples/.cursor/skills/use-og-form/SKILL.md +1 -1
  419. package/templates/current/examples/.cursor/skills/use-og-form-table/SKILL.md +4 -3
  420. package/templates/current/examples/.cursor/skills/use-og-search/SKILL.md +3 -3
  421. package/templates/current/examples/.cursor/skills/use-og-table/SKILL.md +16 -10
  422. package/templates/current/examples/.cursor/skills/use-og-upload/SKILL.md +6 -5
  423. package/templates/current/examples/{.env.example → .env.dev} +3 -2
  424. package/templates/current/examples/.env.mock +4 -0
  425. package/templates/current/examples/.env.production +5 -0
  426. package/templates/current/examples/.env.test +4 -0
  427. package/templates/current/examples/.node-version +1 -0
  428. package/templates/current/examples/.prettierignore +17 -0
  429. package/templates/current/examples/.prettierrc +8 -0
  430. package/templates/current/examples/.qoder/rules/01-feature-architecture.md +3 -4
  431. package/templates/current/examples/.qoder/rules/02-vue-typescript.md +1 -2
  432. package/templates/current/examples/.qoder/rules/03-component-policy.md +5 -3
  433. package/templates/current/examples/.qoder/rules/04-api-auth-router.md +1 -2
  434. package/templates/current/examples/.qoder/rules/05-style.md +1 -2
  435. package/templates/current/examples/.qoder/rules/06-quality.md +1 -2
  436. package/templates/current/examples/.qoder/skills/admin-component-usage/SKILL.md +28 -0
  437. package/templates/current/examples/.qoder/skills/admin-component-usage/references/component-directory.md +270 -0
  438. package/templates/current/examples/.qoder/skills/build-admin-feature/SKILL.md +11 -5
  439. package/templates/current/examples/.qoder/skills/build-admin-feature/references/component-selection.md +38 -0
  440. package/templates/current/examples/.qoder/skills/use-og-form/SKILL.md +1 -1
  441. package/templates/current/examples/.qoder/skills/use-og-form-table/SKILL.md +4 -3
  442. package/templates/current/examples/.qoder/skills/use-og-search/SKILL.md +3 -3
  443. package/templates/current/examples/.qoder/skills/use-og-table/SKILL.md +16 -10
  444. package/templates/current/examples/.qoder/skills/use-og-upload/SKILL.md +6 -5
  445. package/templates/current/examples/.zcode/skills/admin-component-usage/SKILL.md +28 -0
  446. package/templates/current/examples/.zcode/skills/admin-component-usage/references/component-directory.md +270 -0
  447. package/templates/current/examples/.zcode/skills/build-admin-feature/SKILL.md +20 -0
  448. package/templates/current/examples/.zcode/skills/build-admin-feature/references/component-selection.md +38 -0
  449. package/templates/current/examples/.zcode/skills/style-og-origen-ui/SKILL.md +11 -0
  450. package/templates/current/examples/.zcode/skills/use-og-dialog/SKILL.md +12 -0
  451. package/templates/current/examples/.zcode/skills/use-og-editor/SKILL.md +25 -0
  452. package/templates/current/examples/.zcode/skills/use-og-form/SKILL.md +12 -0
  453. package/templates/current/examples/.zcode/skills/use-og-form-table/SKILL.md +26 -0
  454. package/templates/current/examples/.zcode/skills/use-og-http/SKILL.md +13 -0
  455. package/templates/current/examples/.zcode/skills/use-og-router-tabs/SKILL.md +11 -0
  456. package/templates/current/examples/.zcode/skills/use-og-search/SKILL.md +14 -0
  457. package/templates/current/examples/.zcode/skills/use-og-table/SKILL.md +22 -0
  458. package/templates/current/examples/.zcode/skills/use-og-upload/SKILL.md +26 -0
  459. package/templates/current/examples/AGENTS.md +55 -9
  460. package/templates/current/examples/CHANGELOG.md +129 -0
  461. package/templates/current/examples/CLAUDE.md +3 -0
  462. package/templates/current/examples/README.md +58 -87
  463. package/templates/current/examples/component-catalog.json +766 -348
  464. package/templates/current/examples/component-catalog.v2.json +2040 -0
  465. package/templates/current/examples/docs/components/dialog.md +405 -0
  466. package/templates/current/examples/docs/components/editor-viewer.md +87 -0
  467. package/templates/current/examples/docs/components/editor.md +275 -0
  468. package/templates/current/examples/docs/components/form-table.md +222 -0
  469. package/templates/current/examples/docs/components/form.md +750 -0
  470. package/templates/current/examples/docs/components/index.md +44 -0
  471. package/templates/current/examples/docs/components/router.md +452 -0
  472. package/templates/current/examples/docs/components/search.md +1205 -0
  473. package/templates/current/examples/docs/components/svg-icon.md +124 -0
  474. package/templates/current/examples/docs/components/table-local.md +176 -0
  475. package/templates/current/examples/docs/components/table-with-search.md +207 -0
  476. package/templates/current/examples/docs/components/table.md +813 -0
  477. package/templates/current/examples/docs/components/tabs.md +440 -0
  478. package/templates/current/examples/docs/components/upload.md +349 -0
  479. package/templates/current/examples/eslint.config.js +89 -0
  480. package/templates/current/examples/index.html +1 -1
  481. package/templates/current/examples/openapi.json +10048 -999
  482. package/templates/current/examples/package.json +51 -39
  483. package/templates/current/examples/playwright.config.ts +20 -6
  484. package/templates/current/examples/playwright.mock.config.ts +42 -0
  485. package/templates/current/examples/pnpm-workspace.yaml +34 -0
  486. package/templates/current/examples/recipes/remote-crud-dialog-form.vue +15 -13
  487. package/templates/current/examples/scaffold.lock.json +164 -4
  488. package/templates/current/examples/scripts/api-codegen.config.ts +35 -0
  489. package/templates/current/examples/scripts/api-codegen.ts +2015 -0
  490. package/templates/current/examples/scripts/api-templates/http-client.ejs +359 -0
  491. package/templates/current/examples/scripts/check-admin-scaffold.mjs +316 -18
  492. package/templates/current/examples/scripts/generate-api.ts +290 -85
  493. package/templates/current/examples/scripts/lib/admin-component-catalog.mjs +515 -0
  494. package/templates/current/examples/scripts/lib/repository-root.mjs +9 -0
  495. package/templates/current/examples/scripts/mock-api.ts +1356 -0
  496. package/templates/current/examples/scripts/remove-examples.mjs +10 -35
  497. package/templates/current/examples/src/App.vue +9 -18
  498. package/templates/current/examples/src/api/generated/data-contracts.ts +23 -265
  499. package/templates/current/examples/src/api/generated/http-client.ts +351 -180
  500. package/templates/current/examples/src/api/generated/index.ts +22 -0
  501. package/templates/current/examples/src/api/generated/services/auth.ts +123 -0
  502. package/templates/current/examples/src/api/generated/services/common/files.ts +111 -0
  503. package/templates/current/examples/src/api/generated/services/monitor/cache.ts +164 -0
  504. package/templates/current/examples/src/api/generated/services/monitor/job.ts +195 -0
  505. package/templates/current/examples/src/api/generated/services/monitor/jobLog.ts +126 -0
  506. package/templates/current/examples/src/api/generated/services/monitor/logininfor.ts +126 -0
  507. package/templates/current/examples/src/api/generated/services/monitor/online.ts +66 -0
  508. package/templates/current/examples/src/api/generated/services/monitor/operlog.ts +106 -0
  509. package/templates/current/examples/src/api/generated/services/monitor/server.ts +41 -0
  510. package/templates/current/examples/src/api/generated/services/system/configs.ts +190 -0
  511. package/templates/current/examples/src/api/generated/services/system/departments.ts +173 -0
  512. package/templates/current/examples/src/api/generated/services/system/dictionaries/data.ts +169 -0
  513. package/templates/current/examples/src/api/generated/services/system/dictionaries/types.ts +187 -0
  514. package/templates/current/examples/src/api/generated/services/system/index.ts +158 -0
  515. package/templates/current/examples/src/api/generated/services/system/menus.ts +193 -0
  516. package/templates/current/examples/src/api/generated/services/system/notices.ts +221 -0
  517. package/templates/current/examples/src/api/generated/services/system/posts.ts +168 -0
  518. package/templates/current/examples/src/api/generated/services/system/roles.ts +354 -0
  519. package/templates/current/examples/src/api/generated/services/system/users.ts +425 -0
  520. package/templates/current/examples/src/api/generated/services/tool/code-generator.ts +304 -0
  521. package/templates/current/examples/src/api/generated/types/auth.types.ts +132 -0
  522. package/templates/current/examples/src/api/generated/types/common/files.types.ts +57 -0
  523. package/templates/current/examples/src/api/generated/types/common.ts +174 -0
  524. package/templates/current/examples/src/api/generated/types/enum-dict.ts +94 -0
  525. package/templates/current/examples/src/api/generated/types/enums.ts +155 -0
  526. package/templates/current/examples/src/api/generated/types/monitor/cache.types.ts +149 -0
  527. package/templates/current/examples/src/api/generated/types/monitor/job.types.ts +207 -0
  528. package/templates/current/examples/src/api/generated/types/monitor/jobLog.types.ts +134 -0
  529. package/templates/current/examples/src/api/generated/types/monitor/logininfor.types.ts +135 -0
  530. package/templates/current/examples/src/api/generated/types/monitor/online.types.ts +80 -0
  531. package/templates/current/examples/src/api/generated/types/monitor/operlog.types.ts +126 -0
  532. package/templates/current/examples/src/api/generated/types/monitor/server.types.ts +205 -0
  533. package/templates/current/examples/src/api/generated/types/system/configs.types.ts +200 -0
  534. package/templates/current/examples/src/api/generated/types/system/departments.types.ts +145 -0
  535. package/templates/current/examples/src/api/generated/types/system/dictionaries/data.types.ts +210 -0
  536. package/templates/current/examples/src/api/generated/types/system/dictionaries/types.types.ts +221 -0
  537. package/templates/current/examples/src/api/generated/types/system/index.types.ts +19 -0
  538. package/templates/current/examples/src/api/generated/types/system/menus.types.ts +234 -0
  539. package/templates/current/examples/src/api/generated/types/system/notices.types.ts +270 -0
  540. package/templates/current/examples/src/api/generated/types/system/posts.types.ts +198 -0
  541. package/templates/current/examples/src/api/generated/types/system/roles.types.ts +410 -0
  542. package/templates/current/examples/src/api/generated/types/system/users.types.ts +413 -0
  543. package/templates/current/examples/src/api/generated/types/tool/code-generator.types.ts +388 -0
  544. package/templates/current/examples/src/api/index.ts +44 -39
  545. package/templates/current/examples/src/app/__tests__/api-generated.types.ts +24 -0
  546. package/templates/current/examples/src/app/api.ts +6 -0
  547. package/templates/current/examples/src/app/authorization/permission.ts +9 -0
  548. package/templates/current/{clean/src/app → examples/src/app/config}/runtimeConfig.ts +44 -12
  549. package/templates/current/examples/src/app/errors/errorMessage.ts +80 -0
  550. package/templates/current/examples/src/app/http/client.ts +141 -0
  551. package/templates/current/examples/src/app/http/http-adapter.ts +71 -0
  552. package/templates/current/{clean/src/app → examples/src/app/i18n}/adminLocale.ts +25 -19
  553. package/templates/current/examples/src/app/{localeFormat.ts → i18n/localeFormat.ts} +29 -6
  554. package/templates/current/examples/src/app/i18n/origenUiLocale.ts +15 -0
  555. package/templates/current/examples/src/app/menu/menu.ts +175 -0
  556. package/templates/current/examples/src/app/menu/menuTypes.ts +20 -0
  557. package/templates/current/examples/src/{features → app}/security/devtoolsProtection.ts +8 -7
  558. package/templates/current/examples/src/app/ui/createAdminUi.ts +31 -0
  559. package/templates/current/examples/src/app/ui/iconCatalog.ts +71 -0
  560. package/templates/current/examples/src/assets/icons/appearance.svg +1 -0
  561. package/templates/current/examples/src/assets/icons/arrow-right.svg +1 -0
  562. package/templates/current/examples/src/assets/icons/check.svg +1 -0
  563. package/templates/current/examples/src/assets/icons/circle-check.svg +1 -0
  564. package/templates/current/examples/src/assets/icons/default.svg +4 -0
  565. package/templates/current/examples/src/assets/icons/directory/setting.svg +1 -0
  566. package/templates/current/examples/src/assets/icons/expand.svg +1 -0
  567. package/templates/current/examples/src/assets/icons/fold.svg +1 -0
  568. package/templates/current/examples/src/assets/icons/key.svg +1 -0
  569. package/templates/current/examples/src/assets/icons/lock.svg +1 -0
  570. package/templates/current/examples/src/assets/icons/monitor.svg +1 -0
  571. package/templates/current/examples/src/assets/icons/moon.svg +11 -0
  572. package/templates/current/examples/src/assets/icons/page/department.svg +1 -0
  573. package/templates/current/examples/src/assets/icons/page/dictionary.svg +1 -0
  574. package/templates/current/examples/src/assets/icons/page/menus.svg +1 -0
  575. package/templates/current/examples/src/assets/icons/page/user.svg +1 -0
  576. package/templates/current/examples/src/assets/icons/page/users.svg +1 -0
  577. package/templates/current/examples/src/assets/icons/plus.svg +1 -0
  578. package/templates/current/examples/src/assets/icons/profile.svg +1 -0
  579. package/templates/current/examples/src/assets/icons/refresh.svg +1 -0
  580. package/templates/current/examples/src/assets/icons/roles.svg +1 -0
  581. package/templates/current/examples/src/assets/icons/search.svg +1 -0
  582. package/templates/current/examples/src/assets/icons/sunny.svg +1 -0
  583. package/templates/current/examples/src/assets/icons/system.svg +1 -0
  584. package/templates/current/examples/src/assets/icons/theme-auto.svg +14 -0
  585. package/templates/current/examples/src/assets/icons/tune.svg +13 -0
  586. package/templates/current/examples/src/{features/shell/components → components}/RouteProgress.vue +2 -2
  587. package/templates/current/{clean/src/features/system/access → examples/src}/composables/useAuthorizationRefresh.ts +6 -1
  588. package/templates/current/examples/src/composables/useSystemTableSearchVisibility.ts +33 -0
  589. package/templates/current/examples/src/{features/appearance/composables → composables}/useTheme.ts +1 -1
  590. package/templates/current/examples/src/env.d.ts +6 -19
  591. package/templates/current/examples/src/layouts/AdminLayout.vue +7 -9
  592. package/templates/current/examples/src/{features/shell/components → layouts}/AdminWatermark.vue +2 -2
  593. package/templates/current/examples/src/layouts/BreadcrumbBar.vue +9 -1
  594. package/templates/current/examples/src/layouts/SideMenu.vue +7 -15
  595. package/templates/current/examples/src/{features/appearance/components → layouts}/ThemePanel.vue +39 -11
  596. package/templates/current/examples/src/layouts/TopBar.vue +60 -28
  597. package/templates/current/examples/src/layouts/WorkspaceTabs.vue +10 -1
  598. package/templates/current/examples/src/layouts/topBarMenuSearch.ts +25 -4
  599. package/templates/current/examples/src/locales/en-US.json +227 -219
  600. package/templates/current/examples/src/locales/index.ts +72 -32
  601. package/templates/current/examples/src/locales/messages-types.ts +15 -10
  602. package/templates/current/examples/src/locales/vue-i18n.d.ts +1 -1
  603. package/templates/current/examples/src/locales/zh-CN.json +226 -218
  604. package/templates/current/examples/src/locales/zh-TW.json +222 -214
  605. package/templates/current/examples/src/main.ts +50 -40
  606. package/templates/current/examples/src/router/bootstrap.ts +69 -24
  607. package/templates/current/examples/src/router/dynamic/componentLoader.ts +150 -0
  608. package/templates/current/examples/src/router/{dynamicMenuRefresh.ts → dynamic/dynamicMenuRefresh.ts} +6 -2
  609. package/templates/current/examples/src/router/dynamic/dynamicRoutes.ts +247 -0
  610. package/templates/current/examples/src/router/navigation/guards.ts +12 -0
  611. package/templates/current/examples/src/router/navigation/paths.ts +28 -0
  612. package/templates/current/examples/src/router/navigation/staticRoutes.ts +109 -0
  613. package/templates/current/examples/src/router/{queryEncryption.ts → query/queryEncryption.ts} +29 -12
  614. package/templates/current/examples/src/router/query/routeQuery.ts +29 -0
  615. package/templates/current/examples/src/router/{useRouteQueryDefaults.ts → query/useRouteQueryDefaults.ts} +9 -8
  616. package/templates/current/examples/src/router/query/useRouteQueryDefaults.types.ts +28 -0
  617. package/templates/current/examples/src/router/{runtimeErrorRecovery.ts → recovery/runtimeErrorRecovery.ts} +21 -3
  618. package/templates/current/examples/src/{features/auth/store → store}/auth.ts +96 -61
  619. package/templates/current/examples/src/store/dictionaries.ts +86 -0
  620. package/templates/current/examples/src/{features/shell/store → store}/sidebar.ts +9 -2
  621. package/templates/current/{clean/src/features/appearance → examples/src}/store/theme.ts +8 -4
  622. package/templates/current/examples/src/styles/layout.css +51 -0
  623. package/templates/current/examples/src/templates/og-form.ts +7 -2
  624. package/templates/current/examples/src/templates/og-table.ts +88 -20
  625. package/templates/current/examples/src/templates/router.ts +11 -2
  626. package/templates/current/examples/src/utils/color-mix.ts +6 -2
  627. package/templates/current/examples/src/utils/download.ts +11 -0
  628. package/templates/current/examples/src/utils/permissions.ts +1 -1
  629. package/templates/current/examples/src/utils/retryableDialog.ts +46 -0
  630. package/templates/current/{clean/scripts/clean-overlay/src/features → examples/src/views}/errors/pages/Forbidden.vue +6 -2
  631. package/templates/current/examples/src/views/errors/pages/MethodNotAllowed.vue +34 -0
  632. package/templates/current/examples/{scripts/clean-overlay/src/features → src/views}/errors/pages/NotFound.vue +6 -2
  633. package/templates/current/examples/{scripts/clean-overlay/src/features → src/views}/errors/pages/ServerError.vue +6 -2
  634. package/templates/current/examples/src/{features/auth/pages/Login.vue → views/login/pages/index.vue} +101 -11
  635. package/templates/current/examples/src/views/system/access/services/admin-repository.ts +489 -0
  636. package/templates/current/examples/src/views/system/access/services/rbac.ts +317 -0
  637. package/templates/current/examples/src/views/system/dept/components/DepartmentEditorForm.vue +87 -0
  638. package/templates/current/examples/src/views/system/dept/composables/useDepartmentManagement.ts +314 -0
  639. package/templates/current/examples/src/views/system/dept/pages/index.vue +44 -0
  640. package/templates/current/examples/src/views/system/dept/services/departments.ts +168 -0
  641. package/templates/current/examples/src/views/system/dict/components/DictionaryDataEditorForm.vue +98 -0
  642. package/templates/current/examples/src/views/system/dict/components/DictionaryDataPreview.vue +233 -0
  643. package/templates/current/examples/src/views/system/dict/components/DictionaryTypeEditorForm.vue +66 -0
  644. package/templates/current/examples/src/views/system/dict/composables/useDictionaryDataManagement.ts +406 -0
  645. package/templates/current/examples/src/views/system/dict/composables/useDictionaryTypeManagement.ts +329 -0
  646. package/templates/current/examples/src/views/system/dict/data/pages/index.vue +134 -0
  647. package/templates/current/examples/src/views/system/dict/pages/index.vue +113 -0
  648. package/templates/current/examples/src/views/system/dict/services/dictionaries.ts +239 -0
  649. package/templates/current/examples/src/views/system/menu/components/MenuEditorForm.vue +252 -0
  650. package/templates/current/examples/src/views/system/menu/composables/useMenuManagement.ts +357 -0
  651. package/templates/current/examples/src/views/system/menu/menuDraft.ts +45 -0
  652. package/templates/current/examples/src/views/system/menu/pages/ExternalLink.vue +37 -0
  653. package/templates/current/examples/src/views/system/menu/pages/index.vue +75 -0
  654. package/templates/current/examples/src/views/system/post/components/PostEditorForm.vue +69 -0
  655. package/templates/current/examples/src/views/system/post/composables/usePostManagement.ts +245 -0
  656. package/templates/current/examples/src/views/system/post/pages/index.vue +92 -0
  657. package/templates/current/examples/src/views/system/post/services/posts.ts +100 -0
  658. package/templates/current/examples/src/views/system/role/auth-users/pages/index.vue +100 -0
  659. package/templates/current/examples/src/views/system/role/components/RoleDataScopeForm.vue +167 -0
  660. package/templates/current/examples/src/views/system/role/components/RoleEditorForm.vue +165 -0
  661. package/templates/current/examples/src/views/system/role/components/RoleUserSelectForm.vue +129 -0
  662. package/templates/current/examples/src/views/system/role/composables/useRoleManagement.ts +422 -0
  663. package/templates/current/examples/src/views/system/role/composables/useRoleUserManagement.ts +233 -0
  664. package/templates/current/examples/src/views/system/role/pages/index.vue +110 -0
  665. package/templates/current/examples/src/views/system/role/services/roleAccess.ts +162 -0
  666. package/templates/current/examples/src/views/system/user/auth-roles/pages/index.vue +209 -0
  667. package/templates/current/examples/src/views/system/user/components/UserDetailsForm.vue +108 -0
  668. package/templates/current/examples/src/views/system/user/components/UserEditorForm.vue +207 -0
  669. package/templates/current/examples/src/views/system/user/components/UserImportDialog.vue +80 -0
  670. package/templates/current/examples/src/views/system/user/components/UserResetPasswordForm.vue +56 -0
  671. package/templates/current/examples/src/views/system/user/composables/useUserManagement.ts +502 -0
  672. package/templates/current/examples/src/views/system/user/pages/index.vue +459 -0
  673. package/templates/current/examples/tests/e2e/admin-access-business.spec.ts +33 -0
  674. package/templates/current/examples/tests/e2e/admin-shell.spec.ts +50 -0
  675. package/templates/current/examples/tests/e2e/fixtures/adminMockBackend.ts +95 -0
  676. package/templates/current/examples/tests/e2e/fixtures/labelGeometry.ts +52 -0
  677. package/templates/current/examples/tests/e2e/mock-api-generation.spec.ts +27 -0
  678. package/templates/current/examples/tests/e2e/mock-business.spec.ts +555 -0
  679. package/templates/current/examples/tests/e2e/mock-menu-retry-form-label.spec.ts +100 -0
  680. package/templates/current/examples/tests/e2e/mock-shell.spec.ts +25 -0
  681. package/templates/current/examples/tests/e2e/mock-tree-selection-layout.spec.ts +113 -0
  682. package/templates/current/examples/tests/unit/api/api-codegen.spec.ts +893 -0
  683. package/templates/current/examples/tests/unit/api/client.spec.ts +145 -0
  684. package/templates/current/examples/tests/unit/api/generated-http-client.spec.ts +290 -0
  685. package/templates/current/{clean/src → examples/tests/unit}/api/http-adapter.spec.ts +3 -3
  686. package/templates/current/examples/tests/unit/api/system-apis.spec.ts +118 -0
  687. package/templates/current/examples/tests/unit/app/createAdminUi.spec.ts +79 -0
  688. package/templates/current/examples/{src → tests/unit}/app/errorMessage.spec.ts +1 -1
  689. package/templates/current/examples/tests/unit/app/iconCatalog.spec.ts +12 -0
  690. package/templates/current/examples/tests/unit/app/menu.spec.ts +215 -0
  691. package/templates/current/{clean/src → examples/tests/unit}/app/origenUiLocale.spec.ts +1 -1
  692. package/templates/current/{clean/src → examples/tests/unit}/app/permission.spec.ts +4 -5
  693. package/templates/current/examples/tests/unit/app/runtimeConfig.spec.ts +36 -0
  694. package/templates/current/{clean/src/features → examples/tests/unit/app}/security/devtoolsProtection.spec.ts +17 -7
  695. package/templates/current/{clean/src/features/shell → examples/tests/unit}/composables/useRouteProgress.spec.ts +1 -1
  696. package/templates/current/{clean/src/features/shell/components → examples/tests/unit/layouts}/AdminWatermark.spec.ts +5 -7
  697. package/templates/current/{clean/src → examples/tests/unit}/layouts/topBarMenuSearch.spec.ts +25 -8
  698. package/templates/current/examples/{src → tests/unit}/locales/messages.spec.ts +43 -17
  699. package/templates/current/examples/tests/unit/router/dynamicMenuRefresh.spec.ts +151 -0
  700. package/templates/current/examples/tests/unit/router/dynamicRoutes.spec.ts +374 -0
  701. package/templates/current/examples/tests/unit/router/paths.spec.ts +103 -0
  702. package/templates/current/examples/{src → tests/unit}/router/queryEncryption.spec.ts +56 -10
  703. package/templates/current/examples/tests/unit/router/routeQuery.spec.ts +19 -0
  704. package/templates/current/examples/{src → tests/unit}/router/runtimeErrorRecovery.spec.ts +11 -6
  705. package/templates/current/{clean/src → examples/tests/unit}/router/useRouteQueryDefaults.spec.ts +46 -12
  706. package/templates/current/examples/tests/unit/scripts/mock-api.spec.ts +440 -0
  707. package/templates/current/examples/{scripts → tests/unit/scripts}/vite-build-policy.spec.ts +35 -6
  708. package/templates/current/examples/{src/features/auth → tests/unit}/store/auth.spec.ts +68 -15
  709. package/templates/current/examples/tests/unit/store/dictionaries.spec.ts +106 -0
  710. package/templates/current/{clean/src → examples/tests/unit}/templates/templates.spec.ts +60 -16
  711. package/templates/current/examples/{src/utils/__tests__ → tests/unit/utils}/color-mix.spec.ts +1 -1
  712. package/templates/current/examples/tests/unit/utils/retryableDialog.spec.ts +61 -0
  713. package/templates/current/examples/{scripts/clean-overlay/src/features/errors/pages → tests/unit/views/errors}/error-pages.spec.ts +12 -9
  714. package/templates/current/examples/tests/unit/views/feature-composables.spec.ts +233 -0
  715. package/templates/current/examples/tests/unit/views/system/access/admin-repository.spec.ts +353 -0
  716. package/templates/current/examples/tests/unit/views/system/access/rbac.spec.ts +329 -0
  717. package/templates/current/examples/tests/unit/views/system/dept/departments.spec.ts +104 -0
  718. package/templates/current/examples/tests/unit/views/system/dict/dictionaries.spec.ts +234 -0
  719. package/templates/current/examples/tests/unit/views/system/menu/menuDraft.spec.ts +77 -0
  720. package/templates/current/examples/tests/unit/views/system/menu/useMenuManagement.spec.ts +339 -0
  721. package/templates/current/examples/tests/unit/views/system/user/searchControl.spec.ts +128 -0
  722. package/templates/current/examples/tsconfig.json +4 -19
  723. package/templates/current/examples/vite.build-policy.ts +97 -22
  724. package/templates/current/examples/vite.config.ts +50 -7
  725. package/templates/current/clean/.codebuddy/AGENTS.md +0 -18
  726. package/templates/current/clean/.codex/skills/build-admin-feature/SKILL.md +0 -14
  727. package/templates/current/clean/.codex/skills/build-admin-feature/references/component-selection.md +0 -25
  728. package/templates/current/clean/.codex/skills/use-og-table/SKILL.md +0 -16
  729. package/templates/current/clean/.cursor/AGENTS.md +0 -18
  730. package/templates/current/clean/.env.production.example +0 -31
  731. package/templates/current/clean/.qoder/AGENTS.md +0 -15
  732. package/templates/current/clean/e2e/admin-shell.spec.ts +0 -156
  733. package/templates/current/clean/e2e/demo-shell.spec.ts +0 -372
  734. package/templates/current/clean/playwright.demo.config.ts +0 -25
  735. package/templates/current/clean/scripts/clean-overlay/src/features/errors/pages/NotFound.vue +0 -31
  736. package/templates/current/clean/scripts/clean-overlay/src/features/errors/pages/ServerError.vue +0 -31
  737. package/templates/current/clean/scripts/clean-overlay/src/features/errors/pages/error-pages.spec.ts +0 -41
  738. package/templates/current/clean/scripts/clean-overlay/src/main.ts +0 -100
  739. package/templates/current/clean/scripts/clean-overlay/src/router/componentCache.ts +0 -12
  740. package/templates/current/clean/scripts/clean-overlay/src/router/componentRegistry.ts +0 -14
  741. package/templates/current/clean/scripts/clean-overlay/src/router/dynamicRoutes.spec.ts +0 -77
  742. package/templates/current/clean/scripts/clean-overlay/src/router/paths.ts +0 -21
  743. package/templates/current/clean/scripts/clean-overlay/src/router/staticRoutes.ts +0 -63
  744. package/templates/current/clean/scripts/demo-api.ts +0 -873
  745. package/templates/current/clean/src/api/client.spec.ts +0 -66
  746. package/templates/current/clean/src/api/client.ts +0 -152
  747. package/templates/current/clean/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/345/206/205/345/256/271/346/226/207/347/253/240.ts +0 -144
  748. package/templates/current/clean/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/345/256/241/350/256/241.ts +0 -50
  749. package/templates/current/clean/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/346/226/207/344/273/266/344/270/212/344/274/240.ts +0 -63
  750. package/templates/current/clean/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/347/224/250/346/210/267.ts +0 -169
  751. package/templates/current/clean/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/350/217/234/345/215/225.ts +0 -180
  752. package/templates/current/clean/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/350/247/222/350/211/262.ts +0 -167
  753. package/templates/current/clean/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/350/256/242/345/215/225/350/215/211/347/250/277.ts +0 -168
  754. package/templates/current/clean/src/api/generated//350/256/244/350/257/201.ts +0 -95
  755. package/templates/current/clean/src/api/http-adapter.ts +0 -83
  756. package/templates/current/clean/src/app/createAdminUi.spec.ts +0 -166
  757. package/templates/current/clean/src/app/createAdminUi.ts +0 -63
  758. package/templates/current/clean/src/app/embedded-token.spec.ts +0 -40
  759. package/templates/current/clean/src/app/embedded.spec.ts +0 -135
  760. package/templates/current/clean/src/app/embedded.ts +0 -255
  761. package/templates/current/clean/src/app/errorMessage.ts +0 -53
  762. package/templates/current/clean/src/app/menu-host.spec.ts +0 -77
  763. package/templates/current/clean/src/app/menu.spec.ts +0 -320
  764. package/templates/current/clean/src/app/menu.ts +0 -308
  765. package/templates/current/clean/src/app/menuTypes.ts +0 -18
  766. package/templates/current/clean/src/app/origenUiLocale.ts +0 -10
  767. package/templates/current/clean/src/app/permission.ts +0 -9
  768. package/templates/current/clean/src/demo-api.spec.ts +0 -478
  769. package/templates/current/clean/src/features/errors/pages/error-pages.spec.ts +0 -41
  770. package/templates/current/clean/src/features/system/access/api/admin-repository.spec.ts +0 -14
  771. package/templates/current/clean/src/features/system/access/api/admin-repository.ts +0 -298
  772. package/templates/current/clean/src/features/system/access/api/rbac.spec.ts +0 -72
  773. package/templates/current/clean/src/features/system/access/api/rbac.ts +0 -292
  774. package/templates/current/clean/src/features/system/access/composables/useAuthorizationPolling.spec.ts +0 -134
  775. package/templates/current/clean/src/features/system/access/composables/useAuthorizationPolling.ts +0 -96
  776. package/templates/current/clean/src/features/workspace/pages/Profile.vue +0 -185
  777. package/templates/current/clean/src/router/componentCache.ts +0 -12
  778. package/templates/current/clean/src/router/componentRegistry.ts +0 -14
  779. package/templates/current/clean/src/router/dynamicMenuRefresh.spec.ts +0 -101
  780. package/templates/current/clean/src/router/dynamicRoutes.spec.ts +0 -77
  781. package/templates/current/clean/src/router/dynamicRoutes.ts +0 -177
  782. package/templates/current/clean/src/router/guards.ts +0 -5
  783. package/templates/current/clean/src/router/paths.spec.ts +0 -50
  784. package/templates/current/clean/src/router/paths.ts +0 -21
  785. package/templates/current/clean/src/router/routeQuery.spec.ts +0 -11
  786. package/templates/current/clean/src/router/routeQuery.ts +0 -3
  787. package/templates/current/clean/src/router/staticRoutes.ts +0 -63
  788. package/templates/current/clean/src/router/useRouteQueryDefaults.types.ts +0 -20
  789. package/templates/current/examples/.codebuddy/AGENTS.md +0 -18
  790. package/templates/current/examples/.codex/skills/build-admin-feature/SKILL.md +0 -14
  791. package/templates/current/examples/.codex/skills/build-admin-feature/references/component-selection.md +0 -25
  792. package/templates/current/examples/.codex/skills/use-og-table/SKILL.md +0 -16
  793. package/templates/current/examples/.cursor/AGENTS.md +0 -18
  794. package/templates/current/examples/.env.production.example +0 -31
  795. package/templates/current/examples/.qoder/AGENTS.md +0 -15
  796. package/templates/current/examples/e2e/admin-shell.spec.ts +0 -156
  797. package/templates/current/examples/e2e/demo-shell.spec.ts +0 -372
  798. package/templates/current/examples/playwright.demo.config.ts +0 -25
  799. package/templates/current/examples/scripts/clean-overlay/src/features/errors/pages/Forbidden.vue +0 -31
  800. package/templates/current/examples/scripts/clean-overlay/src/main.ts +0 -100
  801. package/templates/current/examples/scripts/clean-overlay/src/router/componentCache.ts +0 -12
  802. package/templates/current/examples/scripts/clean-overlay/src/router/componentRegistry.ts +0 -14
  803. package/templates/current/examples/scripts/clean-overlay/src/router/dynamicRoutes.spec.ts +0 -77
  804. package/templates/current/examples/scripts/clean-overlay/src/router/paths.ts +0 -21
  805. package/templates/current/examples/scripts/clean-overlay/src/router/staticRoutes.ts +0 -63
  806. package/templates/current/examples/scripts/demo-api.ts +0 -873
  807. package/templates/current/examples/src/api/client.spec.ts +0 -66
  808. package/templates/current/examples/src/api/client.ts +0 -152
  809. package/templates/current/examples/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/345/206/205/345/256/271/346/226/207/347/253/240.ts +0 -144
  810. package/templates/current/examples/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/345/256/241/350/256/241.ts +0 -50
  811. package/templates/current/examples/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/346/226/207/344/273/266/344/270/212/344/274/240.ts +0 -63
  812. package/templates/current/examples/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/347/224/250/346/210/267.ts +0 -169
  813. package/templates/current/examples/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/350/217/234/345/215/225.ts +0 -180
  814. package/templates/current/examples/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/350/247/222/350/211/262.ts +0 -167
  815. package/templates/current/examples/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/350/256/242/345/215/225/350/215/211/347/250/277.ts +0 -168
  816. package/templates/current/examples/src/api/generated//350/256/244/350/257/201.ts +0 -95
  817. package/templates/current/examples/src/api/http-adapter.ts +0 -83
  818. package/templates/current/examples/src/app/createAdminUi.spec.ts +0 -166
  819. package/templates/current/examples/src/app/createAdminUi.ts +0 -63
  820. package/templates/current/examples/src/app/embedded-token.spec.ts +0 -40
  821. package/templates/current/examples/src/app/embedded.spec.ts +0 -135
  822. package/templates/current/examples/src/app/embedded.ts +0 -255
  823. package/templates/current/examples/src/app/errorMessage.ts +0 -53
  824. package/templates/current/examples/src/app/menu-host.spec.ts +0 -77
  825. package/templates/current/examples/src/app/menu.spec.ts +0 -320
  826. package/templates/current/examples/src/app/menu.ts +0 -308
  827. package/templates/current/examples/src/app/menuTypes.ts +0 -18
  828. package/templates/current/examples/src/app/origenUiLocale.ts +0 -10
  829. package/templates/current/examples/src/app/permission.ts +0 -9
  830. package/templates/current/examples/src/demo-api.spec.ts +0 -478
  831. package/templates/current/examples/src/features/errors/pages/Forbidden.vue +0 -31
  832. package/templates/current/examples/src/features/errors/pages/NotFound.vue +0 -31
  833. package/templates/current/examples/src/features/errors/pages/ServerError.vue +0 -31
  834. package/templates/current/examples/src/features/feature-composables.spec.ts +0 -245
  835. package/templates/current/examples/src/features/system/access/api/admin-repository.spec.ts +0 -14
  836. package/templates/current/examples/src/features/system/access/api/admin-repository.ts +0 -298
  837. package/templates/current/examples/src/features/system/access/api/rbac.spec.ts +0 -72
  838. package/templates/current/examples/src/features/system/access/api/rbac.ts +0 -292
  839. package/templates/current/examples/src/features/system/access/composables/useAuthorizationPolling.spec.ts +0 -134
  840. package/templates/current/examples/src/features/system/access/composables/useAuthorizationPolling.ts +0 -96
  841. package/templates/current/examples/src/features/system/audit/composables/useAuditManagement.ts +0 -122
  842. package/templates/current/examples/src/features/system/audit/pages/AuditList.vue +0 -20
  843. package/templates/current/examples/src/features/system/menus/components/MenuEditorForm.vue +0 -279
  844. package/templates/current/examples/src/features/system/menus/composables/useMenuManagement.ts +0 -435
  845. package/templates/current/examples/src/features/system/menus/menuDraft.spec.ts +0 -204
  846. package/templates/current/examples/src/features/system/menus/menuDraft.ts +0 -116
  847. package/templates/current/examples/src/features/system/menus/menuTreePrecheck.spec.ts +0 -268
  848. package/templates/current/examples/src/features/system/menus/menuTreePrecheck.ts +0 -317
  849. package/templates/current/examples/src/features/system/menus/pages/MenuList.vue +0 -51
  850. package/templates/current/examples/src/features/system/roles/components/RoleEditorForm.vue +0 -116
  851. package/templates/current/examples/src/features/system/roles/composables/useRoleManagement.ts +0 -194
  852. package/templates/current/examples/src/features/system/roles/pages/RoleList.vue +0 -47
  853. package/templates/current/examples/src/features/system/users/components/UserEditorForm.vue +0 -104
  854. package/templates/current/examples/src/features/system/users/composables/useUserManagement.ts +0 -228
  855. package/templates/current/examples/src/features/system/users/pages/UserList.vue +0 -51
  856. package/templates/current/examples/src/features/workspace/pages/Dashboard.spec.ts +0 -41
  857. package/templates/current/examples/src/features/workspace/pages/Dashboard.vue +0 -325
  858. package/templates/current/examples/src/features/workspace/pages/Profile.vue +0 -185
  859. package/templates/current/examples/src/router/componentCache.ts +0 -18
  860. package/templates/current/examples/src/router/componentRegistry.ts +0 -66
  861. package/templates/current/examples/src/router/dynamicMenuRefresh.spec.ts +0 -101
  862. package/templates/current/examples/src/router/dynamicRoutes.spec.ts +0 -144
  863. package/templates/current/examples/src/router/dynamicRoutes.ts +0 -177
  864. package/templates/current/examples/src/router/guards.ts +0 -5
  865. package/templates/current/examples/src/router/paths.spec.ts +0 -50
  866. package/templates/current/examples/src/router/paths.ts +0 -21
  867. package/templates/current/examples/src/router/routeQuery.spec.ts +0 -11
  868. package/templates/current/examples/src/router/routeQuery.ts +0 -3
  869. package/templates/current/examples/src/router/staticRoutes.ts +0 -63
  870. package/templates/current/examples/src/router/useRouteQueryDefaults.types.ts +0 -20
  871. /package/templates/current/clean/{.codex → .agents}/skills/style-og-origen-ui/SKILL.md +0 -0
  872. /package/templates/current/clean/{.codex → .agents}/skills/style-og-origen-ui/agents/openai.yaml +0 -0
  873. /package/templates/current/clean/{.codex → .agents}/skills/use-og-dialog/SKILL.md +0 -0
  874. /package/templates/current/clean/{.codex → .agents}/skills/use-og-dialog/agents/openai.yaml +0 -0
  875. /package/templates/current/clean/{.codex → .agents}/skills/use-og-editor/SKILL.md +0 -0
  876. /package/templates/current/clean/{.codex → .agents}/skills/use-og-http/SKILL.md +0 -0
  877. /package/templates/current/clean/{.codex → .agents}/skills/use-og-http/agents/openai.yaml +0 -0
  878. /package/templates/current/clean/{.codex → .agents}/skills/use-og-router-tabs/SKILL.md +0 -0
  879. /package/templates/current/{examples/.codex → clean/.claude}/skills/style-og-origen-ui/SKILL.md +0 -0
  880. /package/templates/current/{examples/.codex → clean/.claude}/skills/use-og-dialog/SKILL.md +0 -0
  881. /package/templates/current/{examples/.codex → clean/.claude}/skills/use-og-editor/SKILL.md +0 -0
  882. /package/templates/current/{examples/.codex → clean/.claude}/skills/use-og-http/SKILL.md +0 -0
  883. /package/templates/current/{examples/.codex → clean/.claude}/skills/use-og-router-tabs/SKILL.md +0 -0
  884. /package/templates/current/clean/src/{features/security/components → components}/DevtoolsProtectionOverlay.vue +0 -0
  885. /package/templates/current/clean/src/{features/shell/composables → composables}/useRouteProgress.ts +0 -0
  886. /package/templates/current/clean/src/{features/workspace → views/fallback}/pages/Empty.vue +0 -0
  887. /package/templates/current/examples/{.codex → .agents}/skills/style-og-origen-ui/agents/openai.yaml +0 -0
  888. /package/templates/current/examples/{.codex → .agents}/skills/use-og-dialog/agents/openai.yaml +0 -0
  889. /package/templates/current/examples/{.codex → .agents}/skills/use-og-http/agents/openai.yaml +0 -0
  890. /package/templates/current/examples/src/{features/security/components → components}/DevtoolsProtectionOverlay.vue +0 -0
  891. /package/templates/current/examples/src/{features/shell/composables → composables}/useRouteProgress.ts +0 -0
  892. /package/templates/current/examples/src/{features/workspace → views/fallback}/pages/Empty.vue +0 -0
@@ -0,0 +1,124 @@
1
+ ---
2
+ title: SvgIcon
3
+ description: 本地 SVG 精灵图标组件。
4
+ ---
5
+
6
+ # SvgIcon
7
+
8
+ ## 基础用法
9
+
10
+ `@origen-ui/icons` 使用内置 Vite 插件扫描本地 SVG,并提供与 Element Plus 协作的图标组件。
11
+
12
+ <div id="icon-local-svg"></div>
13
+ ### 本地 SVG 图标
14
+
15
+ 图标可独立设置尺寸和颜色,也可用于 ElIcon 与 ElButton。
16
+
17
+ ## 典型用法
18
+
19
+ ## 安装
20
+
21
+ ```bash
22
+ pnpm add @origen-ui/icons
23
+ ```
24
+
25
+ 在 Vite 配置中注册插件。默认扫描 `src/assets/icons`,例如 `system/user.svg` 对应 `system-user`:
26
+
27
+ ```ts
28
+ import { createSvgIconsPlugin } from '@origen-ui/icons/vite'
29
+
30
+ export default defineConfig({
31
+ plugins: [vue(), createSvgIconsPlugin()],
32
+ })
33
+ ```
34
+
35
+ 非默认目录使用 `iconDirs`(单个目录或目录数组);`root` 只影响未提供
36
+ `iconDirs` 时的默认目录。插件在构建时拒绝脚本、事件属性和外部 SVG 引用,并在 HTML
37
+ `body` 注入精灵,开发时文件变更会更新该精灵。多个目录生成同名图标会使构建失败。
38
+
39
+ ```vue
40
+ <script setup lang="ts">
41
+ import { createSvgIcon, SvgIcon } from '@origen-ui/icons'
42
+
43
+ const UserIcon = createSvgIcon('system-user')
44
+ </script>
45
+
46
+ <template>
47
+ <SvgIcon name="system-user" size="20" color="var(--el-color-primary)" />
48
+ <ElIcon><SvgIcon name="system-user" /></ElIcon>
49
+ <ElButton :icon="UserIcon">个人资料</ElButton>
50
+ </template>
51
+ ```
52
+
53
+ ## API
54
+
55
+ | 属性 | 类型 | 默认值 | 说明 |
56
+ | ------- | ------------------ | ------ | ---------------------------------------------------- |
57
+ | `name` | `string` | - | 必填。SVG 的目录相对名称。 |
58
+ | `size` | `number \| string` | `1em` | 宽高;数字转换为像素。 |
59
+ | `color` | `string` | - | 设置 `currentColor`。原 SVG 的多色内容保持不变。 |
60
+ | `label` | `string` | - | 提供时输出可访问图像语义;未提供时图标为装饰性内容。 |
61
+
62
+ `createSvgIcon(name)` 返回已绑定名称的 Vue 组件,适用于 Element Plus 的 `icon` 属性。
63
+
64
+ ## 公开 API 行为
65
+
66
+ | 导出 | 用途 |
67
+ | --------------- | ---------------------------------------------- |
68
+ | `SvgIcon` | 按名称渲染本地 SVG 精灵图标。 |
69
+ | `createSvgIcon` | 创建已绑定图标名称的 Vue 组件。 |
70
+ | `SvgIconProps` | 图标名称、尺寸、颜色和可访问标签的公开 Props。 |
71
+
72
+ 根入口导出 `SvgIcon`、`createSvgIcon` 和 `SvgIconProps`。`name` 必须是 Vite 插件根据本地文件生成的合法精灵名称;非法名称不会生成 `<use>` 引用,组件保留空的 SVG 容器,便于页面保持尺寸但不会渲染未知图形。数字 `size` 转换为像素字符串,字符串原样作为宽高。
73
+
74
+ `label` 会提供图像语义并生成 `<title>`;透传的 `aria-label` 也会提供图像语义,但不会生成
75
+ `<title>`。两者都未提供时组件设置 `aria-hidden="true"`。颜色只影响使用 `currentColor`
76
+ 的路径,多色 SVG 的固定填色不会被覆盖;其余 SVG attrs 可透传到根 `<svg>`。
77
+
78
+ ## 高级能力
79
+
80
+ ## Vite 插件 API
81
+
82
+ 从 `@origen-ui/icons/vite` 导入下表入口,供 Vite 配置或 Node 构建流程使用。
83
+
84
+ | 导出 | 签名或字段 | 行为 |
85
+ | ----------------------- | ------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------- |
86
+ | `createSvgIconsPlugin` | `(options?: SvgIconsPluginOptions) => Plugin` | 扫描目录并向 HTML 注入 SVG 精灵;开发时监听新增、修改和删除并更新精灵。 |
87
+ | `SvgIconsPluginOptions` | `root?: string`、`iconDirs?: string \| string[]` | 未提供 `iconDirs` 时扫描 `root/src/assets/icons`;`root` 默认是当前工作目录。显式目录相对于当前工作目录解析。 |
88
+ | `buildSprite` | `(iconDirs: readonly string[]) => string` | 同步读取目录下的 SVG,返回包含符号的完整 SVG 字符串;拒绝不安全 SVG、非法图标名称和重复符号。由调用方插入返回值,不安装监听器。 |
89
+
90
+ ## 相关组合示例
91
+
92
+ 在工作区导航或工具栏中组合图标时,查看[工作区与路由示例](../../.agents/skills/admin-component-usage/references/component-directory.md)。
93
+
94
+ <!-- component-contract:start -->
95
+
96
+ ## 公共契约
97
+
98
+ > 由组件目录生成;每条记录对应可公开导入的组件及其消费者 API 摘要。
99
+
100
+ ### Imports
101
+
102
+ - `svg-icon`: `import { SvgIcon } from '@origen-ui/icons'`
103
+
104
+ ### Props
105
+
106
+ - `svg-icon`: `name`, `size`, `color`, `label`
107
+
108
+ ### Events
109
+
110
+ - `svg-icon`: 无
111
+
112
+ ### Slots
113
+
114
+ - `svg-icon`: 无
115
+
116
+ ### Exposes
117
+
118
+ - `svg-icon`: 无
119
+
120
+ ### Types
121
+
122
+ - `svg-icon`:属性类型:`SvgIconProps`;公开方法类型:无
123
+
124
+ <!-- component-contract:end -->
@@ -0,0 +1,176 @@
1
+ ---
2
+ title: OgTableLocal
3
+ description: 使用受控内存数据的可编辑表格组件。
4
+ ---
5
+
6
+ # OgTableLocal
7
+
8
+ ## 基础用法
9
+
10
+ 公共 CSS 入口、暗色主题和稳定覆盖边界见[样式与主题](../../.codex/rules/05-style.md)。
11
+
12
+ `OgTableLocal` 复用 OgTable 的列、选择、编辑、展开、工具栏和状态能力,但数据由父组件通过 `v-model` 持有,不要求 `dataSource`。它适合表单明细、草稿编辑和小规模客户端数据。
13
+
14
+ ```vue
15
+ <script setup lang="ts">
16
+ import { ref } from 'vue'
17
+ import { OgTableLocal, type TableColumn } from '@origen-ui/table'
18
+
19
+ type Line = { id: string; sku: string; quantity: number }
20
+ const rows = ref<Line[]>([])
21
+ const columns: TableColumn<Line>[] = [
22
+ { prop: 'sku', label: 'SKU' },
23
+ {
24
+ prop: 'quantity',
25
+ label: '数量',
26
+ sortable: true,
27
+ editable: {
28
+ validate: (value) => (value >= 1 ? undefined : '数量必须大于等于 1'),
29
+ },
30
+ },
31
+ ]
32
+ </script>
33
+
34
+ <template>
35
+ <OgTableLocal v-model="rows" row-key="id" :og-columns="columns" />
36
+ </template>
37
+ ```
38
+
39
+ ## 典型用法
40
+
41
+ <div id="table-local-draft"></div>
42
+ ### 受控草稿表格
43
+
44
+ 选择行、读取 Expose 结果、编辑单元格或增删草稿;事件日志和模型快照会同步变化,筛选只影响当前显示结果。
45
+
46
+ ## 高级能力
47
+
48
+ ## 与 OgTable 的差异
49
+
50
+ `OgTableLocal` 的渲染、查询、选择、展开和大多数工具栏能力由内部 [OgTable](./table.md#完整-api-参考) 承担,但数据来源和编辑提交边界不同:
51
+
52
+ | 类别 | 保留或新增 | 不透传或覆写 | 源码依据 |
53
+ | ---------- | ------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ------------------------------------------------ |
54
+ | 数据 | 实例身份在组件内部生成;保留 `rowKey`、`ogColumns`、`ogConfig`、`ogQueryDefaults`。 | 用必填 `modelValue` 和 `update:modelValue` 替代 `ogDataSource`;内部列表请求基于当前数组生成。 | `OgTableLocal.vue` 的 `dataSource` 与 `emitRows` |
55
+ | 本地变更 | 使用 `ogLocal`、`ogReadonly`,并发出 `rowAdd`、`rowRemove`、`cellChange`。 | 不公开远程 mutation adapter;编辑会直接替换对应行并更新受控模型。 | `TableLocalMutationController`、`updateRow` |
56
+ | 配置 | 透传 `ogConfig`,但保留其编辑配置。 | 强制 `editing.warnOnUnsaved: false`,避免本地受控模型被远程事务提示阻断。 | `ogConfig` computed |
57
+ | 事件与插槽 | 转发 OgTable 的加载、选择、搜索和错误事件,以及 `search`、`empty`、`error`、工具栏、`editor`、`expand` 插槽。 | `cell-change` 由本地模型更新后再发出;删除动作作为内部 action 列,不接受远程 action adapter。 | 模板 `@...` 与 slots |
58
+ | 实例 | 保留刷新、重置、选择、展开、状态、滚动和列宽方法,并新增 `addRow`、`removeRow`。 | 不暴露远程提交/丢弃事务方法。 | `defineExpose` |
59
+
60
+ 父组件的完整 Props、事件和状态说明只在 [OgTable API](./table.md#完整-api-参考) 定义;本页仅定义上表的本地差异。
61
+
62
+ ## API
63
+
64
+ ### Attributes
65
+
66
+ | 属性 | 类型 | 默认值 | 说明 |
67
+ | --------------------------- | ------------------------------------------------------------------------------ | ------- | ------------------------------------------------------------------------------------- |
68
+ | `rowKey` | `TableRowKey<T>` | - | 必填。行主键字段名或返回主键的函数。 |
69
+ | `modelValue` | `readonly T[]` | - | 必填。父组件持有的内存行数据。 |
70
+ | `ogColumns` | `TableColumn<T>[]` | - | 必填。列定义,规则与 `OgTable` 相同。 |
71
+ | `ogConfig` | `OgTableConfig<T, TQuery>` | - | 可选。共享的表格显示、选择、编辑、工具栏等配置。 |
72
+ | `ogTableEvents` | `OgTableSurfaceEvents<T>` | - | 可选。官方表面事件回调;冲突事件和回调语义见 OgTable 文档。 |
73
+ | `ogTableSlots` | `OgTableSurfaceSlots<T>` | - | 可选。TableV2 插槽透传入口;支持项和替换限制见 OgTable 文档。 |
74
+ | `ogQueryDefaults` | `Partial<TQuery>` | - | 可选。响应式外部查询基线,规则与 `OgTable` 相同。 |
75
+ | `selectionTooltip` | `string \| ((context: OgTableSelectionTooltipContext) => string)` | - | Customizes the selected-count tooltip; the `actions` slot must register a DOM anchor. |
76
+ | `ogLocal` | `OgTableLocalOptions<T, TQuery>` | - | 本地数据策略,见下表。 |
77
+ | `ogReadonly` | `boolean` | `false` | 禁用本地新增、删除与单元格编辑。 |
78
+ | `ogRenderDisabledGridCells` | `boolean` | `false` | 内部组合钩子:网格模式下保持禁用编辑器可见;业务通常无需设置。 |
79
+ | `ogOnVisibleColumnsChange` | `(columns: readonly TableColumn<T>[], meta?: OgTablePresentationMeta) => void` | - | 内部组合钩子:向组合组件提供最终可见列及可选的分页/树表 presentation metadata。 |
80
+ | Element Plus props | 当前表面的 `ElTable` 或 `TableV2` props | - | 官方普通属性直接放在组件顶层;标准/虚拟表面按 `ogConfig.virtual.enabled` 分别定型。 |
81
+
82
+ ### local
83
+
84
+ | 属性 | 类型 | 说明 |
85
+ | ------------------------ | ------------------------------------------ | ------------------------------------------------------------------------------------------------ |
86
+ | `createRow` | `() => T \| Promise<T>` | 新增时创建一行数据。 |
87
+ | `addable` / `removable` | `boolean` | 控制新增、删除命令是否可用。 |
88
+ | `removeConfirm` | `false \| string \| OgTableConfirmOptions` | 删除动作确认文案;默认确认,设为 `false` 可关闭。 |
89
+ | `editable.editor` | `'text' \| 'number'` | 选择内置编辑器;未配置时按原值或草稿值推断。初始值为 `undefined` 的数字字段请显式使用 `number`。 |
90
+ | `editable.emptyBehavior` | `'restore' \| 'allow'` | 清空编辑值时的策略;数字编辑器默认 `restore`,其他字段默认 `allow`。 |
91
+ | `minRows` / `maxRows` | `number` | 限制可保留的最少和最多行数。 |
92
+ | `filter` | `(rows, query) => readonly T[]` | 按当前查询过滤内存行。 |
93
+
94
+ `OgTableLocalOptions<T, TQuery>` 通过 `ogLocal` 传入,是本地模式唯一的策略对象;它不接收远程 `ogDataSource`。`OgTableLocalProps` 还包括继承自 `OgTableProps` 的展示、选择、编辑、工具栏和状态配置,实际差异是 `modelValue` 由父组件持有且 `ogLocal.filter` 在内存行上执行。
95
+
96
+ 本地模型同步由组件内部维护,公开接口只使用 `v-model`;`modelRevision` 属性、`update:modelRevision` 事件和业务侧主动 `+1` 通道均已移除。组件会按内容区分自身回显与外部替换:迟到的旧回显会静默忽略并保留草稿;内容不同的新外部模型会被接收,并可能清除旧草稿。内容比较使用行 key 和行自己的可枚举字符串字段进行浅比较,字段值按 `Object.is` 判断;缺少字段与显式 `undefined` 视为相同,原型继承字段、不可枚举属性和 Symbol 键不参与比较。相同内容会被视为没有变化,不保证重新校验或重算;如果服务端上下文已经变化,旧校验结果或选项缓存可能仍与新业务上下文并存,此时可显式调用已有的 `refresh()` 或 `reset()`。如果一次真实刷新返回的内容恰好与历史发射内容相同,组件无法区分它与迟到旧回包,也会忽略它。旧的 `operationError('modelSync')` 和 `model-conflict` 诊断不再提供。多个请求或业务来源可能同时写入同一行集时,应用必须自行串行化更新,避免旧响应覆盖新内容。
97
+
98
+ ### 迁移说明
99
+
100
+ 移除 `ogTableId` 和 `modelRevision`,删除 `v-model:model-revision`,保留 `rowKey` 与 `v-model`。组件实例身份会自动生成,不替代行主键。默认筛选记忆不迁移旧 `ogTableId` 生成的存储键;普通更新和 KeepAlive 暂存/恢复时默认键不变,但组件完全卸载后即使在相同模板位置重建,也会得到新键,旧状态不会自动恢复。如需跨卸载重建稳定或共享状态,请在 `ogConfig.state.filterMemory.key` 显式设置应用自己的业务 key。如果多个 Vue root app(例如微前端)共用浏览器存储源,给 app 设置不同的 `app.config.idPrefix` 只能降低默认键碰撞概率;要可靠隔离,仍须为每张表显式设置不同的筛选记忆 key。
101
+
102
+ 父组件是唯一的数据所有者:替换整个 `v-model` 数组后,组件刷新内存查询而不会再发出一轮相同的 `update:modelValue`。筛选隐藏只影响当前显示结果,不代表行已从 `v-model` 删除;真正删除只能通过删除操作列并触发 `rowRemove`。数字字段清空时,空值只留在编辑草稿中,不会写入模型、触发 `cellChange` 或重新执行本地筛选,编辑行会继续显示。失焦或回车结束编辑时才执行列校验:空值或非法值恢复编辑前的原值并提示,合法值写回模型并重新应用 `ogLocal.filter`。编辑期间合法值即使暂时不满足筛选条件,当前行仍保持可见。编辑数量不会自动改变当前行顺序;只有再次点击排序,或执行搜索、筛选、翻页、刷新和父组件整体替换后,才按当前排序重新计算。允许业务保存空值的字段请显式设置 `editable.emptyBehavior: 'allow'`;初始值为 `undefined` 的数字字段请设置 `editable.editor: 'number'`。输入过程只替换内存中的当前页,不会为每个字符启动完整查询;过滤、排序或分页导致当前页越界时才执行一次分页校正刷新。编辑 `rowKey` 后,活动编辑器会映射到新 key,并继续合并到同一编辑事务;如果新 key 与其他行冲突,编辑会恢复并提示。单元格编辑不会进入远程表的待提交事务;内置删除动作默认要求确认,可用 `ogLocal.removeConfirm: false` 关闭,或传入结构化确认配置。`rowKey` 必须在模型内唯一,重复 key 是无效输入,组件不会承诺自动去重或诊断提示。
103
+
104
+ ## Element Plus 表面透传
105
+
106
+ Element Plus 普通属性直接放在组件顶层,类型按当前 `ElTable` / `TableV2` 表面筛选。`ogTableEvents.standard` / `ogTableEvents.virtual` 转发官方事件回调;`ogTableSlots.virtual` 转发 TableV2 的 `row`、`cell`、`header`、`header-cell`、`footer`、`overlay` 插槽,且要求启用虚拟模式。插槽替换语义与限制见 [OgTable Element Plus 表面透传](./table.md#element-plus-表面透传);官方属性、事件和插槽详情参考 Element Plus 官方文档。
107
+
108
+ ## 事件
109
+
110
+ | 事件 | 载荷 | 说明 |
111
+ | ------------------- | ---------------------- | -------------------------- |
112
+ | `update:modelValue` | `T[]` | 数据行变更后同步到父组件。 |
113
+ | `rowAdd` | `T` | 成功新增一行后触发。 |
114
+ | `rowRemove` | `T` | 成功移除一行后触发。 |
115
+ | `cellChange` | `{ row, prop, value }` | 单元格编辑写回后触发。 |
116
+
117
+ ## 插槽
118
+
119
+ | 插槽 | 作用域参数 | 说明 |
120
+ | -------------------------------- | ----------------------------------------- | -------------------------------------------------------------------------------------- |
121
+ | `editor` | `{ row, column, value, index, setValue }` | 自定义可编辑单元格。 |
122
+ | `expand` | `{ row, index }` | 自定义展开内容。 |
123
+ | `beforeActions` | - | 左侧操作区、批量动作前的内容。 |
124
+ | `actions` | `OgTableActionsSlotProps<T>` | 绘制自定义批量按钮;执行、加载、选择和任务状态见 [OgTable 插槽 API](./table.md#插槽)。 |
125
+ | `afterActions` | - | 左侧操作区、批量动作后的内容。 |
126
+ | `overflowActions` | `OgTableActionsSlotProps<T>` | 空间不足时折叠到悬停菜单的自定义内容。 |
127
+ | `beforeToolbar` / `afterToolbar` | - | 在右侧工具栏前后插入内容。 |
128
+
129
+ ## Expose API
130
+
131
+ | 方法 | 返回值 | 说明 |
132
+ | ---------------------------------------------------------- | --------------- | --------------------------------------------------------------------------------------- |
133
+ | `refresh()` / `reset()` | `Promise<void>` | 重新加载本地查询;`reset()` 重置查询和表格视图状态,不回滚已经写入 `v-model` 的行数据。 |
134
+ | `addRow()` / `removeRow(row)` | `Promise<void>` | 新增或删除一行。 |
135
+ | `getSelectedRows()` / `clearSelection()` | `T[]` / `void` | 读取或清空选择。 |
136
+ | `toggleRowSelection(row, selected?)` | `void` | 切换行选择。 |
137
+ | `toggleRowExpansion(row, expanded?)` / `getExpandedRows()` | `void` / `T[]` | 控制或读取展开行。 |
138
+ | `resetColumnWidths()` / `scrollTo(options)` | `void` | 重置列宽或滚动至位置。 |
139
+
140
+ 根入口额外导出 `createOgTableLocalEventForwarders` 和 `OG_TABLE_FORWARDABLE_SLOT_NAMES`,用于封装本地表格事件/插槽透传;locale、筛选记忆和脱敏工具与 `OgTable` 共用,见 [OgTable 公共导出索引](./table.md#公共导出索引)。
141
+
142
+ <!-- component-contract:start -->
143
+
144
+ ## 公共契约
145
+
146
+ > 由组件目录生成;每条记录对应可公开导入的组件及其消费者 API 摘要。
147
+
148
+ ### Imports
149
+
150
+ - `table-local`: `import { OgTableLocal } from '@origen-ui/table'`
151
+
152
+ ### Props
153
+
154
+ - `table-local`: `modelValue`, `rowKey`, `ogColumns`, `ogConfig`, `ogLocal`, `ogReadonly`, `ogTableEvents`, `ogTableSlots`, `ogRenderDisabledGridCells`, `ogQueryDefaults`, `ogOnVisibleColumnsChange`, `selectionTooltip`
155
+
156
+ ### Events
157
+
158
+ - `table-local`: `update:modelValue`, `loadSuccess`, `loadError`, `operationError`, `pluginError`, `selectionChange`, `selectionScopeChange`, `batchJobChange`, `transactionConflict`, `sortChange`, `search`, `searchOptionsError`, `cellChange`, `filterOptionsError`, `rowAdd`, `rowRemove`
159
+
160
+ ### Slots
161
+
162
+ - `table-local`: `search`, `empty`, `error`, `expand`, `editor`, `beforeActions`, `actions`, `afterActions`, `overflowActions`, `beforeToolbar`, `afterToolbar`, `beforeTable`, `tableEmpty`, `tableAppend`
163
+
164
+ ### Exposes
165
+
166
+ - `table-local`: `getElTable`, `addRow`, `removeRow`, `refresh`, `reset`, `getSelectedRows`, `clearSelection`, `toggleRowSelection`, `toggleRowExpansion`, `getExpandedRows`, `resetColumnWidths`, `scrollTo`, `getState`, `applyState`
167
+
168
+ ### Types
169
+
170
+ - `table-local`:属性类型:`OgTableLocalProps`;公开方法类型:无
171
+
172
+ <!-- component-contract:end -->
173
+
174
+ ## 相关组合示例
175
+
176
+ 需要远程数据源、请求生命周期或跨组件搜索时,查看 [OgTable](./table.md) 和 [OgTableWithSearch](./table-with-search.md)。
@@ -0,0 +1,207 @@
1
+ ---
2
+ title: OgTableWithSearch
3
+ description: 将 OgSearch 接入 OgTable 查询协议的组合组件。
4
+ ---
5
+
6
+ # OgTableWithSearch
7
+
8
+ ## 基础用法
9
+
10
+ `OgTableWithSearch` 是 `@origen-ui/table-search` 提供的组合组件。它默认启用 OgSearch 的关键字搜索;如果提供 `ogConfig.search.fields`,会在关键字搜索之外追加结构化字段,并把搜索提交接入 OgTable 的查询流程。字段 `ogControl.ogType` 选择对应 Element Plus 控件;原生属性、`ogEvents`、`ogSlots` 统一放入 `ogControl` 并进行静态校验。省略整个 `ogControl` 默认 input,显式对象必须提供 ogType;`ogFormItem` / `ogFormItemSlots` 保留字段层并配置外层 `ElFormItem`。官方属性详情参考 Element Plus 文档。其余表格能力、事件和实例方法与 `OgTable` 保持一致。
11
+
12
+ 表格实例标识由组件内部生成和管理,无需传入 ID。`rowKey` 是行身份:仅远程纯展示且没有行级能力时可以省略;启用选择、展开/树、编辑与事务、单行刷新、行操作或虚拟渲染等依赖行身份的能力时,必须提供稳定且唯一的 `rowKey`。例如纯展示可以省略 `row-key`:`<OgTableWithSearch :og-columns="columns" :og-data-source="dataSource" />`。本地行表和 `OgFormTable` 仍要求 `rowKey`。持久化 key 的稳定作用域与旧状态不自动迁移规则见 [OgTable 实例身份与持久化范围](./table.md#实例身份与持久化范围)。
13
+
14
+ ```vue
15
+ <script setup lang="ts">
16
+ import { OgTableWithSearch } from '@origen-ui/table-search'
17
+ </script>
18
+
19
+ <template>
20
+ <OgTableWithSearch
21
+ row-key="id"
22
+ :og-columns="columns"
23
+ :og-data-source="dataSource"
24
+ :og-config="{ search: { fields } }"
25
+ />
26
+ </template>
27
+ ```
28
+
29
+ ## 典型用法
30
+
31
+ <div id="table-search-composition"></div>
32
+ ### 搜索表格组合
33
+
34
+ 提交关键字和状态条件,观察请求参数;可模拟下一次请求失败并在 error 插槽中重试。
35
+
36
+ ## 高级能力
37
+
38
+ ## 布局与样式
39
+
40
+ 组合组件的布局与样式入口遵循 [样式与主题](../../.codex/rules/05-style.md)。左侧主操作使用 `beforeActions`、`actions`、`afterActions` 或 `overflowActions`;`beforeToolbar` 与 `afterToolbar` 位于右侧工具栏两边。表格的可用宽度、滚动容器和列宽限制仍应由业务页面按 [OgTable API](./table.md#布局与响应式) 配置。内部 `.og-*` 类和局部 CSS 变量不构成公共 API。
41
+
42
+ 下面的示例演示 `actions` 插槽在独立的左侧操作区追加主操作按钮:
43
+
44
+ 模板可直接使用组合组件:
45
+
46
+ ```vue
47
+ <OgTableWithSearch
48
+ row-key="id"
49
+ :og-columns="columns"
50
+ :og-data-source="dataSource"
51
+ :og-config="config"
52
+ >
53
+ <template #actions>
54
+ <ElButton type="primary">新增成员</ElButton>
55
+ </template>
56
+ </OgTableWithSearch>
57
+ ```
58
+
59
+ `actions` 插槽与右侧工具栏保持同一行;右侧工具栏仍渲染 OgTable 自带的密度、刷新等动作。
60
+
61
+ ## API
62
+
63
+ ### 组合层差异表
64
+
65
+ 父组件的完整 API 只在 [OgTable API](./table.md#完整-api-参考) 和 [OgSearch API](./search.md#完整-api-参考) 定义。组合层的实际边界如下:
66
+
67
+ ### 表格表面透传属性
68
+
69
+ 以下属性继承 OgTable 的表面透传能力。Element Plus 官方属性、事件和插槽签名参考官方文档;TableV2 插槽的具体边界和替换行为见 [OgTable 表面透传说明](./table.md#element-plus-表面透传)。
70
+
71
+ | 属性 | 类型 | 说明 |
72
+ | ------------------ | ----------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- |
73
+ | Element Plus props | 当前表面的 `ElTable` 或 `TableV2` props | 官方普通属性直接放在组件根层;按 `ogConfig.virtual.enabled` 分别定型。 |
74
+ | `ogTableEvents` | `OgTableSurfaceEvents<T>` | 按当前表面转发官方事件回调;冲突事件由 OgTable 协调。 |
75
+ | `ogTableSlots` | `OgTableSurfaceSlots<T>` | 转发 TableV2 插槽;需启用虚拟模式。 |
76
+ | `selectionTooltip` | `string \| ((context: OgTableSelectionTooltipContext) => string)` | Customizes the selected-count tooltip; register its anchor with `setSelectionTooltipTarget` in `actions`. |
77
+
78
+ | 类别 | 保留或新增 | 不透传或覆写 | 源码依据 |
79
+ | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | ------------------------------------------------- |
80
+ | Props | `rowKey` 按行级能力条件必填;必填 `ogColumns`、`ogDataSource`;可传 `ogConfig`、`ogQueryDefaults`、`ogReadonly`、`ogTableEvents`、`ogTableSlots` 和 `ogSearch`。 | 官方普通表格属性直接放在组件根层;业务属性与内部搜索配置各自保留明确命名空间。 | `defineProps`、`v-bind` |
81
+ | 查询 | 默认提供关键字搜索;`config.search.fields` 追加结构化字段,`getSearchInstance()` 返回按当前挂载实例动态解析的 OgSearch facade。 | 不重新导出 OgSearch 的组件实例或单独 `v-model`;查询以 OgTable 的 search bridge 为唯一入口。 | `OgTableSearchAdapter`、`createTableSearchExpose` |
82
+ | 事件 | 全量转发 `OgTableEmits`。 | 没有组合层新增事件。 | `createOgTableEventForwarders` |
83
+ | 插槽 | `search-` 动态插槽交给 OgSearch;其余插槽交给 OgTable,包括左侧操作区、`beforeToolbar`、`afterToolbar`、`editor`、`error`、`empty`、`expand`。 | 没有第二套命名空间;非 `search-` 名称不会进入 OgSearch。 | `partitionTableSlots()` 与两段 `v-for` |
84
+ | Expose | 保留 OgTable 的 Expose,并新增 `getSearchInstance()`。 | 该方法可能在内部搜索尚未挂载时返回 `undefined`,调用方需按 OgSearch 的实例契约处理。 | `createTableSearchExpose` |
85
+
86
+ `ogReadonly` 继续使用 OgTable 的只读业务语义。Element Plus 表格普通属性直接放在组件根层;`ogTableEvents` / `ogTableSlots` 是内部表面事件与 TableV2 插槽入口,详情参考 Element Plus 官方文档和 [OgTable 透传边界](./table.md#element-plus-表面透传)。内部 OgSearch 的受限展示属性和回调分别放在 `ogSearch.props` 与 `ogSearch.events`。同名属性不会跨目标传递,例如表格的 `size` 放根层,搜索控件尺寸使用 `ogSearch.props.size`。
87
+
88
+ ### 组合层搜索属性与事件
89
+
90
+ `OgTableWithSearchProps` 继承 OgTable 的业务属性、事件和其他属性;`ogConfig` 使用 `OgTableWithSearchConfig<T, TQuery>`,保留 OgTable 的标准/虚拟表面约束,并将 `ogConfig.search.fields` 收窄为 OgSearch 控件类型。字段的自定义属性、默认值和校验行为见 [OgSearch 字段配置](./search.md#field-字段配置)。
91
+
92
+ `ogSearch.props` 只接受以下组合层可控的 OgSearch 展示属性;查询模型、字段配置、权限、loading 和 disabled 由 OgTable 查询桥接管理:
93
+
94
+ | 属性 | 类型 | 说明 |
95
+ | ---------------------------------------------------------- | --------------------------------- | ----------------------------------- |
96
+ | `inline` / `labelPosition` / `labelSuffix` / `showMessage` | 对应 Element Plus `ElForm` 属性 | 内部搜索表单的布局和校验展示属性。 |
97
+ | `size` | `'large' \| 'default' \| 'small'` | 搜索控件尺寸。 |
98
+ | `statusIcon` | `boolean` | 是否显示表单校验状态图标。 |
99
+ | `inlineMessage` | `boolean` | 是否以内联方式展示字段校验错误。 |
100
+ | `ogSubmitOnEnter` | `boolean` | 是否在字段输入时按 Enter 提交搜索。 |
101
+ | `ogReset` | `OgSearchResetOptions` | 内部搜索重置策略。 |
102
+ | `ogShowReset` | `boolean` | 是否显示重置按钮。 |
103
+ | `ogShowToggle` | `boolean` | 是否显示展开/收起操作。 |
104
+ | `ogLabelPlacement` | `'form' \| 'control'` | 字段标签放置位置。 |
105
+ | `ogControlLabelWidth` | `SearchLabelWidth` | 控件旁标签的默认宽度。 |
106
+ | `ogControlLabelStyle` | `SearchLabelStyle` | 控件旁标签的默认内联样式。 |
107
+
108
+ `ogSearch.events` 提供组合组件消费的搜索回调。搜索和重置仍先更新 OgTable 查询桥接,再调用对应回调;选项错误仍上报给 OgTable,随后通知外部回调。`validate` 原样转发内部 `ElForm` 的字段校验事件,参数类型为 `OgSearchFormValidateArgs`;一次表单校验可能按字段多次触发。
109
+
110
+ | 回调 | 参数 | 说明 |
111
+ | -------------- | ------------------------------------------------------------------------- | -------------------------------- |
112
+ | `search` | `OgSearchSubmitPayload<TQuery>` | 搜索提交完成桥接后调用。 |
113
+ | `reset` | `OgSearchSubmitPayload<TQuery>` | 搜索重置完成桥接后调用。 |
114
+ | `validate` | `OgSearchFormValidateArgs` | 转发内部 `ElForm` 字段校验事件。 |
115
+ | `fieldChange` | `{ prop: keyof TQuery & string, value: unknown, model: Partial<TQuery> }` | 任一查询字段变化时调用。 |
116
+ | `optionsError` | `{ prop: string, error: unknown }` | 异步字段选项加载失败时调用。 |
117
+
118
+ ## 组合组件公开契约
119
+
120
+ ### 组合层属性与搜索透传类型:`OgTableWithSearchProps`、`OgTableWithSearchSearchProps`、`OgTableWithSearchSearchEvents`
121
+
122
+ | 根入口导出 | 用途 |
123
+ | --------------------------------- | ------------------------------------------------- |
124
+ | `OgTableWithSearchStandardConfig` | Standard `ElTable` surface configuration. |
125
+ | `OgTableWithSearchVirtualConfig` | Virtual `ElTableV2` surface configuration. |
126
+ | `OgTableWithSearch` | 组合标准搜索与 OgTable 的组件。 |
127
+ | `OgTableWithSearchConfig` | 搜索字段按控件类型静态校验的组合配置。 |
128
+ | `OgTableWithSearchProps` | 组合组件 Props 类型。 |
129
+ | `OgTableWithSearchSearchProps` | 转发给内部 OgSearch 的展示属性类型。 |
130
+ | `OgTableWithSearchSearchEvents` | 转发给内部 OgSearch 的事件回调类型。 |
131
+ | `OgTableWithSearchSearchGroup` | 组合组件内部搜索区的属性分组。 |
132
+ | `OgTableWithSearchRuntimeProps` | 组合组件 SFC 的运行时属性类型。 |
133
+ | `OgTableWithSearchExpose` | 对外表格方法和 `getSearchInstance()` 的实例契约。 |
134
+ | `OgTableWithSearchSlots` | 表格操作区及 `search-*` 字段插槽的作用域契约。 |
135
+ | `OgTableWithSearchSearchGroup` | 组合组件内部搜索区的属性分组。 |
136
+ | `OgTableWithSearchRuntimeProps` | 组合组件 SFC 的运行时属性类型。 |
137
+
138
+ 根入口 `@origen-ui/table-search` 导出上表列出的组件和类型。Expose 类型表示组合组件对外提供的 OgTable 方法集合;Slots 类型包含 `beforeActions`、`actions`、`afterActions`、`overflowActions`、`beforeToolbar`、`afterToolbar` 以及 `search-*` 动态插槽的作用域。组合组件没有额外的隐藏 Props:表格参数遵循 OgTable,关键字搜索默认启用,结构化字段遵循 OgSearch 的 `config.search.fields`。
139
+
140
+ ```ts
141
+ import type {
142
+ OgTableWithSearchConfig,
143
+ OgTableWithSearchStandardConfig,
144
+ OgTableWithSearchVirtualConfig,
145
+ OgTableWithSearchExpose,
146
+ OgTableWithSearchProps,
147
+ OgTableWithSearchSearchEvents,
148
+ OgTableWithSearchSearchProps,
149
+ OgTableWithSearchSlots,
150
+ } from '@origen-ui/table-search'
151
+ import { OgTableWithSearch } from '@origen-ui/table-search'
152
+ ```
153
+
154
+ 当需要精确的继承 API 时,分别查阅 [OgTable 公共导出索引](./table.md#公共导出索引) 和 [OgSearch 公开导出](./search.md#公开导出);本页只记录组合层新增的接线规则。
155
+
156
+ 组件会透传 `OgTable` 的事件、`empty`、`error`、`expand`、`editor`、`beforeActions`、`actions`、`afterActions`、`overflowActions`、`beforeToolbar`、`afterToolbar` 插槽,以及全部 `OgTableExpose` 方法。以 `search-` 开头的动态插槽将传递给内部 OgSearch;其余插槽传递给 OgTable。操作插槽的作用域和受保护执行语义见 [OgTable API 插槽说明](./table.md#插槽)。
157
+
158
+ `reset()` 由 OgTable 重置草稿、已应用查询和分页,并触发新的读取;它不是只清空视觉控件。通过 `getSearchInstance()` 可取得内部 OgSearch 的公开实例,用于 `submit`、`reset`、`setFieldValue`、`refreshOptions` 等真实搜索操作。`OgSearch.submit()` 会合并并发调用:一次提交仍在进行时再次调用 `submit()` 返回同一个 Promise,不会发出第二个请求,因此"连续快速提交"只会产生一个请求。组合 Demo 会显示草稿提交后的请求载荷,并让适配器监听 `AbortSignal`:表格重载发生重叠时旧请求被真实中止(`signal.aborted === true`),只有最后一次有效请求更新表格。声明 `permission` 的搜索字段无权时不会渲染,也不会进入已应用请求。
159
+
160
+ 搜索字段的自定义控件插槽使用 `search-{prop}`,对应的标签插槽使用 `search-label-{prop}`;快速搜索标签使用 `search-keyword-label`。标签插槽会透传 `label`、`placement`,字段标签还会透传 `field`,因此可以配合 OgSearch 的 `ogLabelPlacement="control"` 实现统一的字段级标签内容。
161
+
162
+ ## 搜索实例代理与属性边界
163
+
164
+ `getSearchInstance()` 返回稳定的实时代理。每个方法都会访问当前已挂载的 `OgSearch`;组合组件
165
+ 卸载后,之前取得的 `submit()` 会安全地返回 `undefined`。嵌套的 `ogSearch.props` 接受规范的
166
+ camelCase 运行时属性和 DOM 展示属性(`class`、`style`、`id`、`role`、`title`、`aria-*`、
167
+ `data-*`)。桥接层拥有的状态、`model`、监听器、未知键和 kebab-case 嵌套键都会被丢弃。
168
+
169
+ <!-- component-contract:start -->
170
+
171
+ ## 公共契约
172
+
173
+ > 由组件目录生成;每条记录对应可公开导入的组件及其消费者 API 摘要。
174
+
175
+ ### Imports
176
+
177
+ - `table-with-search`: `import { OgTableWithSearch } from '@origen-ui/table-search'`
178
+
179
+ ### Props
180
+
181
+ - `table-with-search`: `rowKey`, `ogColumns`, `ogDataSource`, `ogConfig`, `ogQueryDefaults`, `ogSearch`, `selectionTooltip`
182
+
183
+ ### Events
184
+
185
+ - `table-with-search`: 无
186
+
187
+ ### Slots
188
+
189
+ - `table-with-search`: `search-*`, `beforeActions`, `actions`, `afterActions`, `overflowActions`, `beforeToolbar`, `editor`, `empty`, `error`, `expand`, `afterToolbar`, `beforeTable`, `tableEmpty`, `tableAppend`, `search`
190
+
191
+ ### Exposes
192
+
193
+ - `table-with-search`: `getElTable`, `getSearchInstance`, `refresh`, `reset`, `refreshRow`, `clearFilterMemory`, `getSelectedRows`, `getChanges`, `hasChanges`, `discardChanges`, `commitChanges`, `clearSelection`, `toggleRowSelection`, `toggleRowExpansion`, `getExpandedRows`, `resetColumnWidths`, `scrollTo`, `getState`, `applyState`
194
+
195
+ ### Types
196
+
197
+ - `table-with-search`:属性类型:由公开 Vue 组件推断,未单独导出属性类型;公开方法类型:无
198
+
199
+ <!-- component-contract:end -->
200
+
201
+ ## 相关组合示例
202
+
203
+ 需要单独维护搜索表单时,查看 [OgSearch](./search.md);页面级请求和布局组合见[数据与查询场景](../../.agents/skills/admin-component-usage/references/component-directory.md)。
204
+
205
+ ## 注册搜索控件
206
+
207
+ 字段可使用 `ogConfig.search.fields[].ogControl.ogType: "custom:名称"`。通过 `createSearchRendererRegistry<Query>()` 创建注册表,并传入 `ogSearch: { props: { ogRendererRegistry: registry } }`。注册表由调用方持有,标准查询桥接仍负责模型、权限、加载与提交;未知类型明确报错。