@origen-ui/admin-cli 2.0.2 → 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.
- package/README.md +20 -9
- package/bin/contract-sync.mjs +112 -0
- package/bin/lib/errors.mjs +8 -0
- package/bin/lib/fs-json.mjs +18 -0
- package/bin/lib/hash.mjs +9 -0
- package/bin/og-admin.mjs +165 -35
- package/bin/sync-project.mjs +717 -0
- package/package.json +20 -17
- package/templates/current/clean/.agents/skills/admin-component-usage/SKILL.md +28 -0
- package/templates/current/clean/.agents/skills/admin-component-usage/references/component-directory.md +270 -0
- package/templates/current/clean/.agents/skills/build-admin-feature/SKILL.md +20 -0
- package/templates/current/clean/.agents/skills/build-admin-feature/references/component-selection.md +38 -0
- package/templates/current/{examples/.codex → clean/.agents}/skills/use-og-form/SKILL.md +1 -1
- package/templates/current/{examples/.codex → clean/.agents}/skills/use-og-form-table/SKILL.md +4 -3
- package/templates/current/clean/{.codex → .agents}/skills/use-og-search/SKILL.md +3 -3
- package/templates/current/clean/.agents/skills/use-og-table/SKILL.md +22 -0
- package/templates/current/{examples/.codex → clean/.agents}/skills/use-og-upload/SKILL.md +6 -5
- package/templates/current/clean/.api-client-e2e.config.ts +13 -0
- package/templates/current/clean/.claude/rules/01-feature-architecture.md +10 -0
- package/templates/current/clean/.claude/rules/02-vue-typescript.md +10 -0
- package/templates/current/clean/.claude/rules/03-component-policy.md +31 -0
- package/templates/current/clean/.claude/rules/04-api-auth-router.md +10 -0
- package/templates/current/clean/.claude/rules/05-style.md +10 -0
- package/templates/current/clean/.claude/rules/06-quality.md +10 -0
- package/templates/current/clean/.claude/skills/admin-component-usage/SKILL.md +28 -0
- package/templates/current/clean/.claude/skills/admin-component-usage/references/component-directory.md +270 -0
- package/templates/current/clean/.claude/skills/build-admin-feature/SKILL.md +20 -0
- package/templates/current/clean/.claude/skills/build-admin-feature/references/component-selection.md +38 -0
- package/templates/current/clean/{.codex → .claude}/skills/use-og-form/SKILL.md +1 -1
- package/templates/current/clean/{.codex → .claude}/skills/use-og-form-table/SKILL.md +4 -3
- package/templates/current/{examples/.codex → clean/.claude}/skills/use-og-search/SKILL.md +3 -3
- package/templates/current/clean/.claude/skills/use-og-table/SKILL.md +22 -0
- package/templates/current/clean/{.codex → .claude}/skills/use-og-upload/SKILL.md +6 -5
- package/templates/current/clean/.codebuddy/rules/01-feature-architecture.md +2 -2
- package/templates/current/clean/.codebuddy/rules/03-component-policy.md +4 -1
- package/templates/current/clean/.codebuddy/skills/admin-component-usage/SKILL.md +31 -0
- package/templates/current/clean/.codebuddy/skills/admin-component-usage/references/component-directory.md +270 -0
- package/templates/current/clean/.codebuddy/skills/build-admin-feature/SKILL.md +11 -5
- package/templates/current/clean/.codebuddy/skills/build-admin-feature/references/component-selection.md +38 -0
- package/templates/current/clean/.codebuddy/skills/use-og-form/SKILL.md +1 -1
- package/templates/current/clean/.codebuddy/skills/use-og-form-table/SKILL.md +4 -3
- package/templates/current/clean/.codebuddy/skills/use-og-search/SKILL.md +3 -3
- package/templates/current/clean/.codebuddy/skills/use-og-table/SKILL.md +16 -10
- package/templates/current/clean/.codebuddy/skills/use-og-upload/SKILL.md +6 -5
- package/templates/current/clean/.codex/AGENTS.md +55 -8
- package/templates/current/clean/.codex/rules/01-feature-architecture.md +2 -2
- package/templates/current/clean/.codex/rules/03-component-policy.md +4 -1
- package/templates/current/clean/.cursor/rules/.generated +5 -0
- package/templates/current/clean/.cursor/rules/01-feature-architecture.mdc +2 -2
- package/templates/current/clean/.cursor/rules/03-component-policy.mdc +4 -1
- package/templates/current/clean/.cursor/skills/admin-component-usage/SKILL.md +28 -0
- package/templates/current/clean/.cursor/skills/admin-component-usage/references/component-directory.md +270 -0
- package/templates/current/clean/.cursor/skills/build-admin-feature/SKILL.md +11 -5
- package/templates/current/clean/.cursor/skills/build-admin-feature/references/component-selection.md +38 -0
- package/templates/current/clean/.cursor/skills/use-og-form/SKILL.md +1 -1
- package/templates/current/clean/.cursor/skills/use-og-form-table/SKILL.md +4 -3
- package/templates/current/clean/.cursor/skills/use-og-search/SKILL.md +3 -3
- package/templates/current/clean/.cursor/skills/use-og-table/SKILL.md +16 -10
- package/templates/current/clean/.cursor/skills/use-og-upload/SKILL.md +6 -5
- package/templates/current/clean/{.env.example → .env.dev} +3 -2
- package/templates/current/clean/.env.mock +4 -0
- package/templates/current/clean/.env.production +5 -0
- package/templates/current/clean/.env.test +4 -0
- package/templates/current/clean/.prettierignore +17 -0
- package/templates/current/clean/.prettierrc +8 -0
- package/templates/current/clean/.qoder/rules/01-feature-architecture.md +3 -4
- package/templates/current/clean/.qoder/rules/02-vue-typescript.md +1 -2
- package/templates/current/clean/.qoder/rules/03-component-policy.md +5 -3
- package/templates/current/clean/.qoder/rules/04-api-auth-router.md +1 -2
- package/templates/current/clean/.qoder/rules/05-style.md +1 -2
- package/templates/current/clean/.qoder/rules/06-quality.md +1 -2
- package/templates/current/clean/.qoder/skills/admin-component-usage/SKILL.md +28 -0
- package/templates/current/clean/.qoder/skills/admin-component-usage/references/component-directory.md +270 -0
- package/templates/current/clean/.qoder/skills/build-admin-feature/SKILL.md +11 -5
- package/templates/current/clean/.qoder/skills/build-admin-feature/references/component-selection.md +38 -0
- package/templates/current/clean/.qoder/skills/use-og-form/SKILL.md +1 -1
- package/templates/current/clean/.qoder/skills/use-og-form-table/SKILL.md +4 -3
- package/templates/current/clean/.qoder/skills/use-og-search/SKILL.md +3 -3
- package/templates/current/clean/.qoder/skills/use-og-table/SKILL.md +16 -10
- package/templates/current/clean/.qoder/skills/use-og-upload/SKILL.md +6 -5
- package/templates/current/clean/.zcode/skills/admin-component-usage/SKILL.md +28 -0
- package/templates/current/clean/.zcode/skills/admin-component-usage/references/component-directory.md +270 -0
- package/templates/current/clean/.zcode/skills/build-admin-feature/SKILL.md +20 -0
- package/templates/current/clean/.zcode/skills/build-admin-feature/references/component-selection.md +38 -0
- package/templates/current/clean/.zcode/skills/style-og-origen-ui/SKILL.md +11 -0
- package/templates/current/clean/.zcode/skills/use-og-dialog/SKILL.md +12 -0
- package/templates/current/clean/.zcode/skills/use-og-editor/SKILL.md +25 -0
- package/templates/current/clean/.zcode/skills/use-og-form/SKILL.md +12 -0
- package/templates/current/clean/.zcode/skills/use-og-form-table/SKILL.md +26 -0
- package/templates/current/clean/.zcode/skills/use-og-http/SKILL.md +13 -0
- package/templates/current/clean/.zcode/skills/use-og-router-tabs/SKILL.md +11 -0
- package/templates/current/clean/.zcode/skills/use-og-search/SKILL.md +14 -0
- package/templates/current/clean/.zcode/skills/use-og-table/SKILL.md +22 -0
- package/templates/current/clean/.zcode/skills/use-og-upload/SKILL.md +26 -0
- package/templates/current/clean/AGENTS.md +55 -9
- package/templates/current/clean/CHANGELOG.md +107 -0
- package/templates/current/clean/CLAUDE.md +3 -0
- package/templates/current/clean/README.md +58 -88
- package/templates/current/clean/component-catalog.json +766 -348
- package/templates/current/clean/component-catalog.v2.json +2040 -0
- package/templates/current/clean/docs/components/dialog.md +405 -0
- package/templates/current/clean/docs/components/editor-viewer.md +87 -0
- package/templates/current/clean/docs/components/editor.md +275 -0
- package/templates/current/clean/docs/components/form-table.md +222 -0
- package/templates/current/clean/docs/components/form.md +750 -0
- package/templates/current/clean/docs/components/index.md +44 -0
- package/templates/current/clean/docs/components/router.md +452 -0
- package/templates/current/clean/docs/components/search.md +1205 -0
- package/templates/current/clean/docs/components/svg-icon.md +124 -0
- package/templates/current/clean/docs/components/table-local.md +176 -0
- package/templates/current/clean/docs/components/table-with-search.md +207 -0
- package/templates/current/clean/docs/components/table.md +813 -0
- package/templates/current/clean/docs/components/tabs.md +440 -0
- package/templates/current/clean/docs/components/upload.md +349 -0
- package/templates/current/clean/eslint.config.js +89 -0
- package/templates/current/clean/index.html +1 -1
- package/templates/current/clean/openapi.json +10048 -999
- package/templates/current/clean/package.json +45 -33
- package/templates/current/clean/playwright.config.ts +20 -6
- package/templates/current/clean/playwright.mock.config.ts +42 -0
- package/templates/current/clean/pnpm-workspace.yaml +19 -3
- package/templates/current/clean/recipes/remote-crud-dialog-form.vue +15 -13
- package/templates/current/clean/scaffold.lock.json +164 -4
- package/templates/current/clean/scripts/api-codegen.config.ts +35 -0
- package/templates/current/clean/scripts/api-codegen.ts +2015 -0
- package/templates/current/clean/scripts/api-templates/http-client.ejs +359 -0
- package/templates/current/clean/scripts/check-admin-scaffold.mjs +311 -17
- package/templates/current/clean/scripts/generate-api.ts +290 -85
- package/templates/current/clean/scripts/lib/admin-component-catalog.mjs +515 -0
- package/templates/current/clean/scripts/lib/repository-root.mjs +9 -0
- package/templates/current/clean/scripts/mock-api.ts +1356 -0
- package/templates/current/clean/scripts/remove-examples.mjs +9 -34
- package/templates/current/clean/src/App.vue +9 -18
- package/templates/current/clean/src/api/generated/data-contracts.ts +23 -265
- package/templates/current/clean/src/api/generated/http-client.ts +351 -180
- package/templates/current/clean/src/api/generated/index.ts +22 -0
- package/templates/current/clean/src/api/generated/services/auth.ts +123 -0
- package/templates/current/clean/src/api/generated/services/common/files.ts +111 -0
- package/templates/current/clean/src/api/generated/services/monitor/cache.ts +164 -0
- package/templates/current/clean/src/api/generated/services/monitor/job.ts +195 -0
- package/templates/current/clean/src/api/generated/services/monitor/jobLog.ts +126 -0
- package/templates/current/clean/src/api/generated/services/monitor/logininfor.ts +126 -0
- package/templates/current/clean/src/api/generated/services/monitor/online.ts +66 -0
- package/templates/current/clean/src/api/generated/services/monitor/operlog.ts +106 -0
- package/templates/current/clean/src/api/generated/services/monitor/server.ts +41 -0
- package/templates/current/clean/src/api/generated/services/system/configs.ts +190 -0
- package/templates/current/clean/src/api/generated/services/system/departments.ts +173 -0
- package/templates/current/clean/src/api/generated/services/system/dictionaries/data.ts +169 -0
- package/templates/current/clean/src/api/generated/services/system/dictionaries/types.ts +187 -0
- package/templates/current/clean/src/api/generated/services/system/index.ts +158 -0
- package/templates/current/clean/src/api/generated/services/system/menus.ts +193 -0
- package/templates/current/clean/src/api/generated/services/system/notices.ts +221 -0
- package/templates/current/clean/src/api/generated/services/system/posts.ts +168 -0
- package/templates/current/clean/src/api/generated/services/system/roles.ts +354 -0
- package/templates/current/clean/src/api/generated/services/system/users.ts +425 -0
- package/templates/current/clean/src/api/generated/services/tool/code-generator.ts +304 -0
- package/templates/current/clean/src/api/generated/types/auth.types.ts +132 -0
- package/templates/current/clean/src/api/generated/types/common/files.types.ts +57 -0
- package/templates/current/clean/src/api/generated/types/common.ts +174 -0
- package/templates/current/clean/src/api/generated/types/enum-dict.ts +94 -0
- package/templates/current/clean/src/api/generated/types/enums.ts +155 -0
- package/templates/current/clean/src/api/generated/types/monitor/cache.types.ts +149 -0
- package/templates/current/clean/src/api/generated/types/monitor/job.types.ts +207 -0
- package/templates/current/clean/src/api/generated/types/monitor/jobLog.types.ts +134 -0
- package/templates/current/clean/src/api/generated/types/monitor/logininfor.types.ts +135 -0
- package/templates/current/clean/src/api/generated/types/monitor/online.types.ts +80 -0
- package/templates/current/clean/src/api/generated/types/monitor/operlog.types.ts +126 -0
- package/templates/current/clean/src/api/generated/types/monitor/server.types.ts +205 -0
- package/templates/current/clean/src/api/generated/types/system/configs.types.ts +200 -0
- package/templates/current/clean/src/api/generated/types/system/departments.types.ts +145 -0
- package/templates/current/clean/src/api/generated/types/system/dictionaries/data.types.ts +210 -0
- package/templates/current/clean/src/api/generated/types/system/dictionaries/types.types.ts +221 -0
- package/templates/current/clean/src/api/generated/types/system/index.types.ts +19 -0
- package/templates/current/clean/src/api/generated/types/system/menus.types.ts +234 -0
- package/templates/current/clean/src/api/generated/types/system/notices.types.ts +270 -0
- package/templates/current/clean/src/api/generated/types/system/posts.types.ts +198 -0
- package/templates/current/clean/src/api/generated/types/system/roles.types.ts +410 -0
- package/templates/current/clean/src/api/generated/types/system/users.types.ts +413 -0
- package/templates/current/clean/src/api/generated/types/tool/code-generator.types.ts +388 -0
- package/templates/current/clean/src/api/index.ts +44 -39
- package/templates/current/clean/src/app/__tests__/api-generated.types.ts +24 -0
- package/templates/current/clean/src/app/api.ts +6 -0
- package/templates/current/clean/src/app/authorization/permission.ts +9 -0
- package/templates/current/{examples/src/app → clean/src/app/config}/runtimeConfig.ts +44 -12
- package/templates/current/clean/src/app/errors/errorMessage.ts +80 -0
- package/templates/current/clean/src/app/http/client.ts +141 -0
- package/templates/current/clean/src/app/http/http-adapter.ts +71 -0
- package/templates/current/{examples/src/app → clean/src/app/i18n}/adminLocale.ts +25 -19
- package/templates/current/clean/src/app/{localeFormat.ts → i18n/localeFormat.ts} +29 -6
- package/templates/current/clean/src/app/i18n/origenUiLocale.ts +15 -0
- package/templates/current/clean/src/app/menu/menu.ts +175 -0
- package/templates/current/clean/src/app/menu/menuTypes.ts +20 -0
- package/templates/current/clean/src/{features → app}/security/devtoolsProtection.ts +8 -7
- package/templates/current/clean/src/app/ui/createAdminUi.ts +31 -0
- package/templates/current/clean/src/app/ui/iconCatalog.ts +71 -0
- package/templates/current/clean/src/assets/icons/appearance.svg +1 -0
- package/templates/current/clean/src/assets/icons/arrow-right.svg +1 -0
- package/templates/current/clean/src/assets/icons/check.svg +1 -0
- package/templates/current/clean/src/assets/icons/circle-check.svg +1 -0
- package/templates/current/clean/src/assets/icons/default.svg +4 -0
- package/templates/current/clean/src/assets/icons/directory/setting.svg +1 -0
- package/templates/current/clean/src/assets/icons/expand.svg +1 -0
- package/templates/current/clean/src/assets/icons/fold.svg +1 -0
- package/templates/current/clean/src/assets/icons/key.svg +1 -0
- package/templates/current/clean/src/assets/icons/lock.svg +1 -0
- package/templates/current/clean/src/assets/icons/monitor.svg +1 -0
- package/templates/current/clean/src/assets/icons/moon.svg +11 -0
- package/templates/current/clean/src/assets/icons/page/department.svg +1 -0
- package/templates/current/clean/src/assets/icons/page/dictionary.svg +1 -0
- package/templates/current/clean/src/assets/icons/page/menus.svg +1 -0
- package/templates/current/clean/src/assets/icons/page/user.svg +1 -0
- package/templates/current/clean/src/assets/icons/page/users.svg +1 -0
- package/templates/current/clean/src/assets/icons/plus.svg +1 -0
- package/templates/current/clean/src/assets/icons/profile.svg +1 -0
- package/templates/current/clean/src/assets/icons/refresh.svg +1 -0
- package/templates/current/clean/src/assets/icons/roles.svg +1 -0
- package/templates/current/clean/src/assets/icons/search.svg +1 -0
- package/templates/current/clean/src/assets/icons/sunny.svg +1 -0
- package/templates/current/clean/src/assets/icons/system.svg +1 -0
- package/templates/current/clean/src/assets/icons/theme-auto.svg +14 -0
- package/templates/current/clean/src/assets/icons/tune.svg +13 -0
- package/templates/current/clean/src/{features/shell/components → components}/RouteProgress.vue +2 -2
- package/templates/current/{examples/src/features/system/access → clean/src}/composables/useAuthorizationRefresh.ts +6 -1
- package/templates/current/clean/src/composables/useSystemTableSearchVisibility.ts +33 -0
- package/templates/current/clean/src/{features/appearance/composables → composables}/useTheme.ts +1 -1
- package/templates/current/clean/src/env.d.ts +6 -19
- package/templates/current/clean/src/layouts/AdminLayout.vue +7 -9
- package/templates/current/clean/src/{features/shell/components → layouts}/AdminWatermark.vue +2 -2
- package/templates/current/clean/src/layouts/BreadcrumbBar.vue +9 -1
- package/templates/current/clean/src/layouts/SideMenu.vue +7 -15
- package/templates/current/clean/src/{features/appearance/components → layouts}/ThemePanel.vue +39 -11
- package/templates/current/clean/src/layouts/TopBar.vue +60 -28
- package/templates/current/clean/src/layouts/WorkspaceTabs.vue +10 -1
- package/templates/current/clean/src/layouts/topBarMenuSearch.ts +25 -4
- package/templates/current/clean/src/locales/en-US.json +227 -219
- package/templates/current/clean/src/locales/index.ts +72 -32
- package/templates/current/clean/src/locales/messages-types.ts +15 -10
- package/templates/current/clean/src/locales/vue-i18n.d.ts +1 -1
- package/templates/current/clean/src/locales/zh-CN.json +226 -218
- package/templates/current/clean/src/locales/zh-TW.json +222 -214
- package/templates/current/clean/src/main.ts +59 -30
- package/templates/current/clean/src/router/bootstrap.ts +69 -24
- package/templates/current/clean/src/router/dynamic/componentLoader.ts +150 -0
- package/templates/current/clean/src/router/{dynamicMenuRefresh.ts → dynamic/dynamicMenuRefresh.ts} +6 -2
- package/templates/current/clean/src/router/dynamic/dynamicRoutes.ts +247 -0
- package/templates/current/clean/src/router/navigation/guards.ts +12 -0
- package/templates/current/clean/src/router/navigation/paths.ts +28 -0
- package/templates/current/clean/src/router/navigation/staticRoutes.ts +109 -0
- package/templates/current/clean/src/router/{queryEncryption.ts → query/queryEncryption.ts} +29 -12
- package/templates/current/clean/src/router/query/routeQuery.ts +29 -0
- package/templates/current/clean/src/router/{useRouteQueryDefaults.ts → query/useRouteQueryDefaults.ts} +9 -8
- package/templates/current/clean/src/router/query/useRouteQueryDefaults.types.ts +28 -0
- package/templates/current/clean/src/router/{runtimeErrorRecovery.ts → recovery/runtimeErrorRecovery.ts} +21 -3
- package/templates/current/clean/src/{features/auth/store → store}/auth.ts +96 -61
- package/templates/current/clean/src/store/dictionaries.ts +86 -0
- package/templates/current/clean/src/{features/shell/store → store}/sidebar.ts +9 -2
- package/templates/current/{examples/src/features/appearance → clean/src}/store/theme.ts +8 -4
- package/templates/current/clean/src/styles/layout.css +51 -0
- package/templates/current/clean/src/templates/og-form.ts +7 -2
- package/templates/current/clean/src/templates/og-table.ts +88 -20
- package/templates/current/clean/src/templates/router.ts +11 -2
- package/templates/current/clean/src/utils/color-mix.ts +6 -2
- package/templates/current/clean/src/utils/download.ts +11 -0
- package/templates/current/clean/src/utils/permissions.ts +1 -1
- package/templates/current/clean/src/utils/retryableDialog.ts +46 -0
- package/templates/current/clean/src/{features → views}/errors/pages/Forbidden.vue +6 -2
- package/templates/current/clean/src/views/errors/pages/MethodNotAllowed.vue +34 -0
- package/templates/current/clean/src/{features → views}/errors/pages/NotFound.vue +6 -2
- package/templates/current/clean/src/{features → views}/errors/pages/ServerError.vue +6 -2
- package/templates/current/clean/src/{features/auth/pages/Login.vue → views/login/pages/index.vue} +99 -10
- package/templates/current/clean/src/views/system/access/services/admin-repository.ts +489 -0
- package/templates/current/clean/src/views/system/access/services/rbac.ts +317 -0
- package/templates/current/clean/src/views/system/dept/components/DepartmentEditorForm.vue +87 -0
- package/templates/current/clean/src/views/system/dept/composables/useDepartmentManagement.ts +314 -0
- package/templates/current/clean/src/views/system/dept/pages/index.vue +44 -0
- package/templates/current/clean/src/views/system/dept/services/departments.ts +168 -0
- package/templates/current/clean/src/views/system/dict/components/DictionaryDataEditorForm.vue +98 -0
- package/templates/current/clean/src/views/system/dict/components/DictionaryDataPreview.vue +233 -0
- package/templates/current/clean/src/views/system/dict/components/DictionaryTypeEditorForm.vue +66 -0
- package/templates/current/clean/src/views/system/dict/composables/useDictionaryDataManagement.ts +406 -0
- package/templates/current/clean/src/views/system/dict/composables/useDictionaryTypeManagement.ts +329 -0
- package/templates/current/clean/src/views/system/dict/data/pages/index.vue +134 -0
- package/templates/current/clean/src/views/system/dict/pages/index.vue +113 -0
- package/templates/current/clean/src/views/system/dict/services/dictionaries.ts +239 -0
- package/templates/current/clean/src/views/system/menu/components/MenuEditorForm.vue +252 -0
- package/templates/current/clean/src/views/system/menu/composables/useMenuManagement.ts +357 -0
- package/templates/current/clean/src/views/system/menu/menuDraft.ts +45 -0
- package/templates/current/clean/src/views/system/menu/pages/ExternalLink.vue +37 -0
- package/templates/current/clean/src/views/system/menu/pages/index.vue +75 -0
- package/templates/current/clean/src/views/system/post/components/PostEditorForm.vue +69 -0
- package/templates/current/clean/src/views/system/post/composables/usePostManagement.ts +245 -0
- package/templates/current/clean/src/views/system/post/pages/index.vue +92 -0
- package/templates/current/clean/src/views/system/post/services/posts.ts +100 -0
- package/templates/current/clean/src/views/system/role/auth-users/pages/index.vue +100 -0
- package/templates/current/clean/src/views/system/role/components/RoleDataScopeForm.vue +167 -0
- package/templates/current/clean/src/views/system/role/components/RoleEditorForm.vue +165 -0
- package/templates/current/clean/src/views/system/role/components/RoleUserSelectForm.vue +129 -0
- package/templates/current/clean/src/views/system/role/composables/useRoleManagement.ts +422 -0
- package/templates/current/clean/src/views/system/role/composables/useRoleUserManagement.ts +233 -0
- package/templates/current/clean/src/views/system/role/pages/index.vue +110 -0
- package/templates/current/clean/src/views/system/role/services/roleAccess.ts +162 -0
- package/templates/current/clean/src/views/system/user/auth-roles/pages/index.vue +209 -0
- package/templates/current/clean/src/views/system/user/components/UserDetailsForm.vue +108 -0
- package/templates/current/clean/src/views/system/user/components/UserEditorForm.vue +207 -0
- package/templates/current/clean/src/views/system/user/components/UserImportDialog.vue +80 -0
- package/templates/current/clean/src/views/system/user/components/UserResetPasswordForm.vue +56 -0
- package/templates/current/clean/src/views/system/user/composables/useUserManagement.ts +502 -0
- package/templates/current/clean/src/views/system/user/pages/index.vue +459 -0
- package/templates/current/clean/tests/e2e/admin-access-business.spec.ts +33 -0
- package/templates/current/clean/tests/e2e/admin-shell.spec.ts +50 -0
- package/templates/current/clean/tests/e2e/fixtures/adminMockBackend.ts +95 -0
- package/templates/current/clean/tests/e2e/fixtures/labelGeometry.ts +52 -0
- package/templates/current/clean/tests/e2e/mock-api-generation.spec.ts +27 -0
- package/templates/current/clean/tests/e2e/mock-business.spec.ts +555 -0
- package/templates/current/clean/tests/e2e/mock-menu-retry-form-label.spec.ts +100 -0
- package/templates/current/clean/tests/e2e/mock-shell.spec.ts +25 -0
- package/templates/current/clean/tests/e2e/mock-tree-selection-layout.spec.ts +113 -0
- package/templates/current/clean/tests/unit/api/api-codegen.spec.ts +893 -0
- package/templates/current/clean/tests/unit/api/client.spec.ts +145 -0
- package/templates/current/clean/tests/unit/api/generated-http-client.spec.ts +290 -0
- package/templates/current/{examples/src → clean/tests/unit}/api/http-adapter.spec.ts +3 -3
- package/templates/current/clean/tests/unit/api/system-apis.spec.ts +118 -0
- package/templates/current/clean/tests/unit/app/createAdminUi.spec.ts +79 -0
- package/templates/current/clean/{src → tests/unit}/app/errorMessage.spec.ts +1 -1
- package/templates/current/clean/tests/unit/app/iconCatalog.spec.ts +12 -0
- package/templates/current/clean/tests/unit/app/menu.spec.ts +215 -0
- package/templates/current/{examples/src → clean/tests/unit}/app/origenUiLocale.spec.ts +1 -1
- package/templates/current/{examples/src → clean/tests/unit}/app/permission.spec.ts +4 -5
- package/templates/current/clean/tests/unit/app/runtimeConfig.spec.ts +36 -0
- package/templates/current/{examples/src/features → clean/tests/unit/app}/security/devtoolsProtection.spec.ts +17 -7
- package/templates/current/{examples/src/features/shell → clean/tests/unit}/composables/useRouteProgress.spec.ts +1 -1
- package/templates/current/{examples/src/features/shell/components → clean/tests/unit/layouts}/AdminWatermark.spec.ts +5 -7
- package/templates/current/{examples/src → clean/tests/unit}/layouts/topBarMenuSearch.spec.ts +25 -8
- package/templates/current/clean/{src → tests/unit}/locales/messages.spec.ts +43 -17
- package/templates/current/clean/tests/unit/router/dynamicMenuRefresh.spec.ts +151 -0
- package/templates/current/clean/tests/unit/router/dynamicRoutes.spec.ts +374 -0
- package/templates/current/clean/tests/unit/router/paths.spec.ts +103 -0
- package/templates/current/clean/{src → tests/unit}/router/queryEncryption.spec.ts +49 -12
- package/templates/current/{examples/src → clean/tests/unit}/router/routeQuery.spec.ts +8 -1
- package/templates/current/clean/{src → tests/unit}/router/runtimeErrorRecovery.spec.ts +11 -6
- package/templates/current/{examples/src → clean/tests/unit}/router/useRouteQueryDefaults.spec.ts +46 -12
- package/templates/current/clean/tests/unit/scripts/mock-api.spec.ts +440 -0
- package/templates/current/clean/{scripts → tests/unit/scripts}/vite-build-policy.spec.ts +35 -6
- package/templates/current/clean/{src/features/auth → tests/unit}/store/auth.spec.ts +68 -15
- package/templates/current/clean/tests/unit/store/dictionaries.spec.ts +106 -0
- package/templates/current/{examples/src → clean/tests/unit}/templates/templates.spec.ts +60 -16
- package/templates/current/clean/{src/utils/__tests__ → tests/unit/utils}/color-mix.spec.ts +1 -1
- package/templates/current/clean/tests/unit/utils/retryableDialog.spec.ts +61 -0
- package/templates/current/{examples/src/features/errors/pages → clean/tests/unit/views/errors}/error-pages.spec.ts +11 -7
- package/templates/current/clean/tests/unit/views/feature-composables.spec.ts +233 -0
- package/templates/current/clean/tests/unit/views/system/access/admin-repository.spec.ts +353 -0
- package/templates/current/clean/tests/unit/views/system/access/rbac.spec.ts +329 -0
- package/templates/current/clean/tests/unit/views/system/dept/departments.spec.ts +104 -0
- package/templates/current/clean/tests/unit/views/system/dict/dictionaries.spec.ts +234 -0
- package/templates/current/clean/tests/unit/views/system/menu/menuDraft.spec.ts +77 -0
- package/templates/current/clean/tests/unit/views/system/menu/useMenuManagement.spec.ts +339 -0
- package/templates/current/clean/tests/unit/views/system/user/searchControl.spec.ts +128 -0
- package/templates/current/clean/tsconfig.json +4 -19
- package/templates/current/clean/vite.build-policy.ts +97 -22
- package/templates/current/clean/vite.config.ts +50 -7
- package/templates/current/examples/.agents/skills/admin-component-usage/SKILL.md +28 -0
- package/templates/current/examples/.agents/skills/admin-component-usage/references/component-directory.md +270 -0
- package/templates/current/examples/.agents/skills/build-admin-feature/SKILL.md +20 -0
- package/templates/current/examples/.agents/skills/build-admin-feature/references/component-selection.md +38 -0
- package/templates/current/examples/.agents/skills/style-og-origen-ui/SKILL.md +11 -0
- package/templates/current/examples/.agents/skills/use-og-dialog/SKILL.md +12 -0
- package/templates/current/examples/.agents/skills/use-og-editor/SKILL.md +25 -0
- package/templates/current/examples/.agents/skills/use-og-form/SKILL.md +12 -0
- package/templates/current/examples/.agents/skills/use-og-form-table/SKILL.md +26 -0
- package/templates/current/examples/.agents/skills/use-og-http/SKILL.md +13 -0
- package/templates/current/examples/.agents/skills/use-og-router-tabs/SKILL.md +11 -0
- package/templates/current/examples/.agents/skills/use-og-search/SKILL.md +14 -0
- package/templates/current/examples/.agents/skills/use-og-table/SKILL.md +22 -0
- package/templates/current/examples/.agents/skills/use-og-upload/SKILL.md +26 -0
- package/templates/current/examples/.api-client-e2e.config.ts +13 -0
- package/templates/current/examples/.claude/rules/01-feature-architecture.md +10 -0
- package/templates/current/examples/.claude/rules/02-vue-typescript.md +10 -0
- package/templates/current/examples/.claude/rules/03-component-policy.md +31 -0
- package/templates/current/examples/.claude/rules/04-api-auth-router.md +10 -0
- package/templates/current/examples/.claude/rules/05-style.md +10 -0
- package/templates/current/examples/.claude/rules/06-quality.md +10 -0
- package/templates/current/examples/.claude/skills/admin-component-usage/SKILL.md +28 -0
- package/templates/current/examples/.claude/skills/admin-component-usage/references/component-directory.md +270 -0
- package/templates/current/examples/.claude/skills/build-admin-feature/SKILL.md +20 -0
- package/templates/current/examples/.claude/skills/build-admin-feature/references/component-selection.md +38 -0
- package/templates/current/examples/.claude/skills/style-og-origen-ui/SKILL.md +11 -0
- package/templates/current/examples/.claude/skills/use-og-dialog/SKILL.md +12 -0
- package/templates/current/examples/.claude/skills/use-og-editor/SKILL.md +25 -0
- package/templates/current/examples/.claude/skills/use-og-form/SKILL.md +12 -0
- package/templates/current/examples/.claude/skills/use-og-form-table/SKILL.md +26 -0
- package/templates/current/examples/.claude/skills/use-og-http/SKILL.md +13 -0
- package/templates/current/examples/.claude/skills/use-og-router-tabs/SKILL.md +11 -0
- package/templates/current/examples/.claude/skills/use-og-search/SKILL.md +14 -0
- package/templates/current/examples/.claude/skills/use-og-table/SKILL.md +22 -0
- package/templates/current/examples/.claude/skills/use-og-upload/SKILL.md +26 -0
- package/templates/current/examples/.codebuddy/rules/01-feature-architecture.md +2 -2
- package/templates/current/examples/.codebuddy/rules/03-component-policy.md +4 -1
- package/templates/current/examples/.codebuddy/skills/admin-component-usage/SKILL.md +31 -0
- package/templates/current/examples/.codebuddy/skills/admin-component-usage/references/component-directory.md +270 -0
- package/templates/current/examples/.codebuddy/skills/build-admin-feature/SKILL.md +11 -5
- package/templates/current/examples/.codebuddy/skills/build-admin-feature/references/component-selection.md +38 -0
- package/templates/current/examples/.codebuddy/skills/use-og-form/SKILL.md +1 -1
- package/templates/current/examples/.codebuddy/skills/use-og-form-table/SKILL.md +4 -3
- package/templates/current/examples/.codebuddy/skills/use-og-search/SKILL.md +3 -3
- package/templates/current/examples/.codebuddy/skills/use-og-table/SKILL.md +16 -10
- package/templates/current/examples/.codebuddy/skills/use-og-upload/SKILL.md +6 -5
- package/templates/current/examples/.codex/AGENTS.md +55 -8
- package/templates/current/examples/.codex/rules/01-feature-architecture.md +2 -2
- package/templates/current/examples/.codex/rules/03-component-policy.md +4 -1
- package/templates/current/examples/.cursor/rules/.generated +5 -0
- package/templates/current/examples/.cursor/rules/01-feature-architecture.mdc +2 -2
- package/templates/current/examples/.cursor/rules/03-component-policy.mdc +4 -1
- package/templates/current/examples/.cursor/skills/admin-component-usage/SKILL.md +28 -0
- package/templates/current/examples/.cursor/skills/admin-component-usage/references/component-directory.md +270 -0
- package/templates/current/examples/.cursor/skills/build-admin-feature/SKILL.md +11 -5
- package/templates/current/examples/.cursor/skills/build-admin-feature/references/component-selection.md +38 -0
- package/templates/current/examples/.cursor/skills/use-og-form/SKILL.md +1 -1
- package/templates/current/examples/.cursor/skills/use-og-form-table/SKILL.md +4 -3
- package/templates/current/examples/.cursor/skills/use-og-search/SKILL.md +3 -3
- package/templates/current/examples/.cursor/skills/use-og-table/SKILL.md +16 -10
- package/templates/current/examples/.cursor/skills/use-og-upload/SKILL.md +6 -5
- package/templates/current/examples/{.env.example → .env.dev} +3 -2
- package/templates/current/examples/.env.mock +4 -0
- package/templates/current/examples/.env.production +5 -0
- package/templates/current/examples/.env.test +4 -0
- package/templates/current/examples/.prettierignore +17 -0
- package/templates/current/examples/.prettierrc +8 -0
- package/templates/current/examples/.qoder/rules/01-feature-architecture.md +3 -4
- package/templates/current/examples/.qoder/rules/02-vue-typescript.md +1 -2
- package/templates/current/examples/.qoder/rules/03-component-policy.md +5 -3
- package/templates/current/examples/.qoder/rules/04-api-auth-router.md +1 -2
- package/templates/current/examples/.qoder/rules/05-style.md +1 -2
- package/templates/current/examples/.qoder/rules/06-quality.md +1 -2
- package/templates/current/examples/.qoder/skills/admin-component-usage/SKILL.md +28 -0
- package/templates/current/examples/.qoder/skills/admin-component-usage/references/component-directory.md +270 -0
- package/templates/current/examples/.qoder/skills/build-admin-feature/SKILL.md +11 -5
- package/templates/current/examples/.qoder/skills/build-admin-feature/references/component-selection.md +38 -0
- package/templates/current/examples/.qoder/skills/use-og-form/SKILL.md +1 -1
- package/templates/current/examples/.qoder/skills/use-og-form-table/SKILL.md +4 -3
- package/templates/current/examples/.qoder/skills/use-og-search/SKILL.md +3 -3
- package/templates/current/examples/.qoder/skills/use-og-table/SKILL.md +16 -10
- package/templates/current/examples/.qoder/skills/use-og-upload/SKILL.md +6 -5
- package/templates/current/examples/.zcode/skills/admin-component-usage/SKILL.md +28 -0
- package/templates/current/examples/.zcode/skills/admin-component-usage/references/component-directory.md +270 -0
- package/templates/current/examples/.zcode/skills/build-admin-feature/SKILL.md +20 -0
- package/templates/current/examples/.zcode/skills/build-admin-feature/references/component-selection.md +38 -0
- package/templates/current/examples/.zcode/skills/style-og-origen-ui/SKILL.md +11 -0
- package/templates/current/examples/.zcode/skills/use-og-dialog/SKILL.md +12 -0
- package/templates/current/examples/.zcode/skills/use-og-editor/SKILL.md +25 -0
- package/templates/current/examples/.zcode/skills/use-og-form/SKILL.md +12 -0
- package/templates/current/examples/.zcode/skills/use-og-form-table/SKILL.md +26 -0
- package/templates/current/examples/.zcode/skills/use-og-http/SKILL.md +13 -0
- package/templates/current/examples/.zcode/skills/use-og-router-tabs/SKILL.md +11 -0
- package/templates/current/examples/.zcode/skills/use-og-search/SKILL.md +14 -0
- package/templates/current/examples/.zcode/skills/use-og-table/SKILL.md +22 -0
- package/templates/current/examples/.zcode/skills/use-og-upload/SKILL.md +26 -0
- package/templates/current/examples/AGENTS.md +55 -9
- package/templates/current/examples/CHANGELOG.md +107 -0
- package/templates/current/examples/CLAUDE.md +3 -0
- package/templates/current/examples/README.md +58 -88
- package/templates/current/examples/component-catalog.json +766 -348
- package/templates/current/examples/component-catalog.v2.json +2040 -0
- package/templates/current/examples/docs/components/dialog.md +405 -0
- package/templates/current/examples/docs/components/editor-viewer.md +87 -0
- package/templates/current/examples/docs/components/editor.md +275 -0
- package/templates/current/examples/docs/components/form-table.md +222 -0
- package/templates/current/examples/docs/components/form.md +750 -0
- package/templates/current/examples/docs/components/index.md +44 -0
- package/templates/current/examples/docs/components/router.md +452 -0
- package/templates/current/examples/docs/components/search.md +1205 -0
- package/templates/current/examples/docs/components/svg-icon.md +124 -0
- package/templates/current/examples/docs/components/table-local.md +176 -0
- package/templates/current/examples/docs/components/table-with-search.md +207 -0
- package/templates/current/examples/docs/components/table.md +813 -0
- package/templates/current/examples/docs/components/tabs.md +440 -0
- package/templates/current/examples/docs/components/upload.md +349 -0
- package/templates/current/examples/eslint.config.js +89 -0
- package/templates/current/examples/index.html +1 -1
- package/templates/current/examples/openapi.json +10048 -999
- package/templates/current/examples/package.json +45 -33
- package/templates/current/examples/playwright.config.ts +20 -6
- package/templates/current/examples/playwright.mock.config.ts +42 -0
- package/templates/current/examples/pnpm-workspace.yaml +19 -3
- package/templates/current/examples/recipes/remote-crud-dialog-form.vue +15 -13
- package/templates/current/examples/scaffold.lock.json +164 -4
- package/templates/current/examples/scripts/api-codegen.config.ts +35 -0
- package/templates/current/examples/scripts/api-codegen.ts +2015 -0
- package/templates/current/examples/scripts/api-templates/http-client.ejs +359 -0
- package/templates/current/examples/scripts/check-admin-scaffold.mjs +311 -17
- package/templates/current/examples/scripts/generate-api.ts +290 -85
- package/templates/current/examples/scripts/lib/admin-component-catalog.mjs +515 -0
- package/templates/current/examples/scripts/lib/repository-root.mjs +9 -0
- package/templates/current/examples/scripts/mock-api.ts +1356 -0
- package/templates/current/examples/scripts/remove-examples.mjs +9 -34
- package/templates/current/examples/src/App.vue +9 -18
- package/templates/current/examples/src/api/generated/data-contracts.ts +23 -265
- package/templates/current/examples/src/api/generated/http-client.ts +351 -180
- package/templates/current/examples/src/api/generated/index.ts +22 -0
- package/templates/current/examples/src/api/generated/services/auth.ts +123 -0
- package/templates/current/examples/src/api/generated/services/common/files.ts +111 -0
- package/templates/current/examples/src/api/generated/services/monitor/cache.ts +164 -0
- package/templates/current/examples/src/api/generated/services/monitor/job.ts +195 -0
- package/templates/current/examples/src/api/generated/services/monitor/jobLog.ts +126 -0
- package/templates/current/examples/src/api/generated/services/monitor/logininfor.ts +126 -0
- package/templates/current/examples/src/api/generated/services/monitor/online.ts +66 -0
- package/templates/current/examples/src/api/generated/services/monitor/operlog.ts +106 -0
- package/templates/current/examples/src/api/generated/services/monitor/server.ts +41 -0
- package/templates/current/examples/src/api/generated/services/system/configs.ts +190 -0
- package/templates/current/examples/src/api/generated/services/system/departments.ts +173 -0
- package/templates/current/examples/src/api/generated/services/system/dictionaries/data.ts +169 -0
- package/templates/current/examples/src/api/generated/services/system/dictionaries/types.ts +187 -0
- package/templates/current/examples/src/api/generated/services/system/index.ts +158 -0
- package/templates/current/examples/src/api/generated/services/system/menus.ts +193 -0
- package/templates/current/examples/src/api/generated/services/system/notices.ts +221 -0
- package/templates/current/examples/src/api/generated/services/system/posts.ts +168 -0
- package/templates/current/examples/src/api/generated/services/system/roles.ts +354 -0
- package/templates/current/examples/src/api/generated/services/system/users.ts +425 -0
- package/templates/current/examples/src/api/generated/services/tool/code-generator.ts +304 -0
- package/templates/current/examples/src/api/generated/types/auth.types.ts +132 -0
- package/templates/current/examples/src/api/generated/types/common/files.types.ts +57 -0
- package/templates/current/examples/src/api/generated/types/common.ts +174 -0
- package/templates/current/examples/src/api/generated/types/enum-dict.ts +94 -0
- package/templates/current/examples/src/api/generated/types/enums.ts +155 -0
- package/templates/current/examples/src/api/generated/types/monitor/cache.types.ts +149 -0
- package/templates/current/examples/src/api/generated/types/monitor/job.types.ts +207 -0
- package/templates/current/examples/src/api/generated/types/monitor/jobLog.types.ts +134 -0
- package/templates/current/examples/src/api/generated/types/monitor/logininfor.types.ts +135 -0
- package/templates/current/examples/src/api/generated/types/monitor/online.types.ts +80 -0
- package/templates/current/examples/src/api/generated/types/monitor/operlog.types.ts +126 -0
- package/templates/current/examples/src/api/generated/types/monitor/server.types.ts +205 -0
- package/templates/current/examples/src/api/generated/types/system/configs.types.ts +200 -0
- package/templates/current/examples/src/api/generated/types/system/departments.types.ts +145 -0
- package/templates/current/examples/src/api/generated/types/system/dictionaries/data.types.ts +210 -0
- package/templates/current/examples/src/api/generated/types/system/dictionaries/types.types.ts +221 -0
- package/templates/current/examples/src/api/generated/types/system/index.types.ts +19 -0
- package/templates/current/examples/src/api/generated/types/system/menus.types.ts +234 -0
- package/templates/current/examples/src/api/generated/types/system/notices.types.ts +270 -0
- package/templates/current/examples/src/api/generated/types/system/posts.types.ts +198 -0
- package/templates/current/examples/src/api/generated/types/system/roles.types.ts +410 -0
- package/templates/current/examples/src/api/generated/types/system/users.types.ts +413 -0
- package/templates/current/examples/src/api/generated/types/tool/code-generator.types.ts +388 -0
- package/templates/current/examples/src/api/index.ts +44 -39
- package/templates/current/examples/src/app/__tests__/api-generated.types.ts +24 -0
- package/templates/current/examples/src/app/api.ts +6 -0
- package/templates/current/examples/src/app/authorization/permission.ts +9 -0
- package/templates/current/{clean/src/app → examples/src/app/config}/runtimeConfig.ts +44 -12
- package/templates/current/examples/src/app/errors/errorMessage.ts +80 -0
- package/templates/current/examples/src/app/http/client.ts +141 -0
- package/templates/current/examples/src/app/http/http-adapter.ts +71 -0
- package/templates/current/{clean/src/app → examples/src/app/i18n}/adminLocale.ts +25 -19
- package/templates/current/examples/src/app/{localeFormat.ts → i18n/localeFormat.ts} +29 -6
- package/templates/current/examples/src/app/i18n/origenUiLocale.ts +15 -0
- package/templates/current/examples/src/app/menu/menu.ts +175 -0
- package/templates/current/examples/src/app/menu/menuTypes.ts +20 -0
- package/templates/current/examples/src/{features → app}/security/devtoolsProtection.ts +8 -7
- package/templates/current/examples/src/app/ui/createAdminUi.ts +31 -0
- package/templates/current/examples/src/app/ui/iconCatalog.ts +71 -0
- package/templates/current/examples/src/assets/icons/appearance.svg +1 -0
- package/templates/current/examples/src/assets/icons/arrow-right.svg +1 -0
- package/templates/current/examples/src/assets/icons/check.svg +1 -0
- package/templates/current/examples/src/assets/icons/circle-check.svg +1 -0
- package/templates/current/examples/src/assets/icons/default.svg +4 -0
- package/templates/current/examples/src/assets/icons/directory/setting.svg +1 -0
- package/templates/current/examples/src/assets/icons/expand.svg +1 -0
- package/templates/current/examples/src/assets/icons/fold.svg +1 -0
- package/templates/current/examples/src/assets/icons/key.svg +1 -0
- package/templates/current/examples/src/assets/icons/lock.svg +1 -0
- package/templates/current/examples/src/assets/icons/monitor.svg +1 -0
- package/templates/current/examples/src/assets/icons/moon.svg +11 -0
- package/templates/current/examples/src/assets/icons/page/department.svg +1 -0
- package/templates/current/examples/src/assets/icons/page/dictionary.svg +1 -0
- package/templates/current/examples/src/assets/icons/page/menus.svg +1 -0
- package/templates/current/examples/src/assets/icons/page/user.svg +1 -0
- package/templates/current/examples/src/assets/icons/page/users.svg +1 -0
- package/templates/current/examples/src/assets/icons/plus.svg +1 -0
- package/templates/current/examples/src/assets/icons/profile.svg +1 -0
- package/templates/current/examples/src/assets/icons/refresh.svg +1 -0
- package/templates/current/examples/src/assets/icons/roles.svg +1 -0
- package/templates/current/examples/src/assets/icons/search.svg +1 -0
- package/templates/current/examples/src/assets/icons/sunny.svg +1 -0
- package/templates/current/examples/src/assets/icons/system.svg +1 -0
- package/templates/current/examples/src/assets/icons/theme-auto.svg +14 -0
- package/templates/current/examples/src/assets/icons/tune.svg +13 -0
- package/templates/current/examples/src/{features/shell/components → components}/RouteProgress.vue +2 -2
- package/templates/current/{clean/src/features/system/access → examples/src}/composables/useAuthorizationRefresh.ts +6 -1
- package/templates/current/examples/src/composables/useSystemTableSearchVisibility.ts +33 -0
- package/templates/current/examples/src/{features/appearance/composables → composables}/useTheme.ts +1 -1
- package/templates/current/examples/src/env.d.ts +6 -19
- package/templates/current/examples/src/layouts/AdminLayout.vue +7 -9
- package/templates/current/examples/src/{features/shell/components → layouts}/AdminWatermark.vue +2 -2
- package/templates/current/examples/src/layouts/BreadcrumbBar.vue +9 -1
- package/templates/current/examples/src/layouts/SideMenu.vue +7 -15
- package/templates/current/examples/src/{features/appearance/components → layouts}/ThemePanel.vue +39 -11
- package/templates/current/examples/src/layouts/TopBar.vue +60 -28
- package/templates/current/examples/src/layouts/WorkspaceTabs.vue +10 -1
- package/templates/current/examples/src/layouts/topBarMenuSearch.ts +25 -4
- package/templates/current/examples/src/locales/en-US.json +227 -219
- package/templates/current/examples/src/locales/index.ts +72 -32
- package/templates/current/examples/src/locales/messages-types.ts +15 -10
- package/templates/current/examples/src/locales/vue-i18n.d.ts +1 -1
- package/templates/current/examples/src/locales/zh-CN.json +226 -218
- package/templates/current/examples/src/locales/zh-TW.json +222 -214
- package/templates/current/examples/src/main.ts +50 -40
- package/templates/current/examples/src/router/bootstrap.ts +69 -24
- package/templates/current/examples/src/router/dynamic/componentLoader.ts +150 -0
- package/templates/current/examples/src/router/{dynamicMenuRefresh.ts → dynamic/dynamicMenuRefresh.ts} +6 -2
- package/templates/current/examples/src/router/dynamic/dynamicRoutes.ts +247 -0
- package/templates/current/examples/src/router/navigation/guards.ts +12 -0
- package/templates/current/examples/src/router/navigation/paths.ts +28 -0
- package/templates/current/examples/src/router/navigation/staticRoutes.ts +109 -0
- package/templates/current/examples/src/router/{queryEncryption.ts → query/queryEncryption.ts} +29 -12
- package/templates/current/examples/src/router/query/routeQuery.ts +29 -0
- package/templates/current/examples/src/router/{useRouteQueryDefaults.ts → query/useRouteQueryDefaults.ts} +9 -8
- package/templates/current/examples/src/router/query/useRouteQueryDefaults.types.ts +28 -0
- package/templates/current/examples/src/router/{runtimeErrorRecovery.ts → recovery/runtimeErrorRecovery.ts} +21 -3
- package/templates/current/examples/src/{features/auth/store → store}/auth.ts +96 -61
- package/templates/current/examples/src/store/dictionaries.ts +86 -0
- package/templates/current/examples/src/{features/shell/store → store}/sidebar.ts +9 -2
- package/templates/current/{clean/src/features/appearance → examples/src}/store/theme.ts +8 -4
- package/templates/current/examples/src/styles/layout.css +51 -0
- package/templates/current/examples/src/templates/og-form.ts +7 -2
- package/templates/current/examples/src/templates/og-table.ts +88 -20
- package/templates/current/examples/src/templates/router.ts +11 -2
- package/templates/current/examples/src/utils/color-mix.ts +6 -2
- package/templates/current/examples/src/utils/download.ts +11 -0
- package/templates/current/examples/src/utils/permissions.ts +1 -1
- package/templates/current/examples/src/utils/retryableDialog.ts +46 -0
- package/templates/current/{clean/scripts/clean-overlay/src/features → examples/src/views}/errors/pages/Forbidden.vue +6 -2
- package/templates/current/examples/src/views/errors/pages/MethodNotAllowed.vue +34 -0
- package/templates/current/examples/{scripts/clean-overlay/src/features → src/views}/errors/pages/NotFound.vue +6 -2
- package/templates/current/examples/{scripts/clean-overlay/src/features → src/views}/errors/pages/ServerError.vue +6 -2
- package/templates/current/examples/src/{features/auth/pages/Login.vue → views/login/pages/index.vue} +99 -10
- package/templates/current/examples/src/views/system/access/services/admin-repository.ts +489 -0
- package/templates/current/examples/src/views/system/access/services/rbac.ts +317 -0
- package/templates/current/examples/src/views/system/dept/components/DepartmentEditorForm.vue +87 -0
- package/templates/current/examples/src/views/system/dept/composables/useDepartmentManagement.ts +314 -0
- package/templates/current/examples/src/views/system/dept/pages/index.vue +44 -0
- package/templates/current/examples/src/views/system/dept/services/departments.ts +168 -0
- package/templates/current/examples/src/views/system/dict/components/DictionaryDataEditorForm.vue +98 -0
- package/templates/current/examples/src/views/system/dict/components/DictionaryDataPreview.vue +233 -0
- package/templates/current/examples/src/views/system/dict/components/DictionaryTypeEditorForm.vue +66 -0
- package/templates/current/examples/src/views/system/dict/composables/useDictionaryDataManagement.ts +406 -0
- package/templates/current/examples/src/views/system/dict/composables/useDictionaryTypeManagement.ts +329 -0
- package/templates/current/examples/src/views/system/dict/data/pages/index.vue +134 -0
- package/templates/current/examples/src/views/system/dict/pages/index.vue +113 -0
- package/templates/current/examples/src/views/system/dict/services/dictionaries.ts +239 -0
- package/templates/current/examples/src/views/system/menu/components/MenuEditorForm.vue +252 -0
- package/templates/current/examples/src/views/system/menu/composables/useMenuManagement.ts +357 -0
- package/templates/current/examples/src/views/system/menu/menuDraft.ts +45 -0
- package/templates/current/examples/src/views/system/menu/pages/ExternalLink.vue +37 -0
- package/templates/current/examples/src/views/system/menu/pages/index.vue +75 -0
- package/templates/current/examples/src/views/system/post/components/PostEditorForm.vue +69 -0
- package/templates/current/examples/src/views/system/post/composables/usePostManagement.ts +245 -0
- package/templates/current/examples/src/views/system/post/pages/index.vue +92 -0
- package/templates/current/examples/src/views/system/post/services/posts.ts +100 -0
- package/templates/current/examples/src/views/system/role/auth-users/pages/index.vue +100 -0
- package/templates/current/examples/src/views/system/role/components/RoleDataScopeForm.vue +167 -0
- package/templates/current/examples/src/views/system/role/components/RoleEditorForm.vue +165 -0
- package/templates/current/examples/src/views/system/role/components/RoleUserSelectForm.vue +129 -0
- package/templates/current/examples/src/views/system/role/composables/useRoleManagement.ts +422 -0
- package/templates/current/examples/src/views/system/role/composables/useRoleUserManagement.ts +233 -0
- package/templates/current/examples/src/views/system/role/pages/index.vue +110 -0
- package/templates/current/examples/src/views/system/role/services/roleAccess.ts +162 -0
- package/templates/current/examples/src/views/system/user/auth-roles/pages/index.vue +209 -0
- package/templates/current/examples/src/views/system/user/components/UserDetailsForm.vue +108 -0
- package/templates/current/examples/src/views/system/user/components/UserEditorForm.vue +207 -0
- package/templates/current/examples/src/views/system/user/components/UserImportDialog.vue +80 -0
- package/templates/current/examples/src/views/system/user/components/UserResetPasswordForm.vue +56 -0
- package/templates/current/examples/src/views/system/user/composables/useUserManagement.ts +502 -0
- package/templates/current/examples/src/views/system/user/pages/index.vue +459 -0
- package/templates/current/examples/tests/e2e/admin-access-business.spec.ts +33 -0
- package/templates/current/examples/tests/e2e/admin-shell.spec.ts +50 -0
- package/templates/current/examples/tests/e2e/fixtures/adminMockBackend.ts +95 -0
- package/templates/current/examples/tests/e2e/fixtures/labelGeometry.ts +52 -0
- package/templates/current/examples/tests/e2e/mock-api-generation.spec.ts +27 -0
- package/templates/current/examples/tests/e2e/mock-business.spec.ts +555 -0
- package/templates/current/examples/tests/e2e/mock-menu-retry-form-label.spec.ts +100 -0
- package/templates/current/examples/tests/e2e/mock-shell.spec.ts +25 -0
- package/templates/current/examples/tests/e2e/mock-tree-selection-layout.spec.ts +113 -0
- package/templates/current/examples/tests/unit/api/api-codegen.spec.ts +893 -0
- package/templates/current/examples/tests/unit/api/client.spec.ts +145 -0
- package/templates/current/examples/tests/unit/api/generated-http-client.spec.ts +290 -0
- package/templates/current/{clean/src → examples/tests/unit}/api/http-adapter.spec.ts +3 -3
- package/templates/current/examples/tests/unit/api/system-apis.spec.ts +118 -0
- package/templates/current/examples/tests/unit/app/createAdminUi.spec.ts +79 -0
- package/templates/current/examples/{src → tests/unit}/app/errorMessage.spec.ts +1 -1
- package/templates/current/examples/tests/unit/app/iconCatalog.spec.ts +12 -0
- package/templates/current/examples/tests/unit/app/menu.spec.ts +215 -0
- package/templates/current/{clean/src → examples/tests/unit}/app/origenUiLocale.spec.ts +1 -1
- package/templates/current/{clean/src → examples/tests/unit}/app/permission.spec.ts +4 -5
- package/templates/current/examples/tests/unit/app/runtimeConfig.spec.ts +36 -0
- package/templates/current/{clean/src/features → examples/tests/unit/app}/security/devtoolsProtection.spec.ts +17 -7
- package/templates/current/{clean/src/features/shell → examples/tests/unit}/composables/useRouteProgress.spec.ts +1 -1
- package/templates/current/{clean/src/features/shell/components → examples/tests/unit/layouts}/AdminWatermark.spec.ts +5 -7
- package/templates/current/{clean/src → examples/tests/unit}/layouts/topBarMenuSearch.spec.ts +25 -8
- package/templates/current/examples/{src → tests/unit}/locales/messages.spec.ts +43 -17
- package/templates/current/examples/tests/unit/router/dynamicMenuRefresh.spec.ts +151 -0
- package/templates/current/examples/tests/unit/router/dynamicRoutes.spec.ts +374 -0
- package/templates/current/examples/tests/unit/router/paths.spec.ts +103 -0
- package/templates/current/examples/{src → tests/unit}/router/queryEncryption.spec.ts +49 -12
- package/templates/current/{clean/src → examples/tests/unit}/router/routeQuery.spec.ts +8 -1
- package/templates/current/examples/{src → tests/unit}/router/runtimeErrorRecovery.spec.ts +11 -6
- package/templates/current/{clean/src → examples/tests/unit}/router/useRouteQueryDefaults.spec.ts +46 -12
- package/templates/current/examples/tests/unit/scripts/mock-api.spec.ts +440 -0
- package/templates/current/examples/{scripts → tests/unit/scripts}/vite-build-policy.spec.ts +35 -6
- package/templates/current/examples/{src/features/auth → tests/unit}/store/auth.spec.ts +68 -15
- package/templates/current/examples/tests/unit/store/dictionaries.spec.ts +106 -0
- package/templates/current/{clean/src → examples/tests/unit}/templates/templates.spec.ts +60 -16
- package/templates/current/examples/{src/utils/__tests__ → tests/unit/utils}/color-mix.spec.ts +1 -1
- package/templates/current/examples/tests/unit/utils/retryableDialog.spec.ts +61 -0
- package/templates/current/examples/{scripts/clean-overlay/src/features/errors/pages → tests/unit/views/errors}/error-pages.spec.ts +12 -9
- package/templates/current/examples/tests/unit/views/feature-composables.spec.ts +233 -0
- package/templates/current/examples/tests/unit/views/system/access/admin-repository.spec.ts +353 -0
- package/templates/current/examples/tests/unit/views/system/access/rbac.spec.ts +329 -0
- package/templates/current/examples/tests/unit/views/system/dept/departments.spec.ts +104 -0
- package/templates/current/examples/tests/unit/views/system/dict/dictionaries.spec.ts +234 -0
- package/templates/current/examples/tests/unit/views/system/menu/menuDraft.spec.ts +77 -0
- package/templates/current/examples/tests/unit/views/system/menu/useMenuManagement.spec.ts +339 -0
- package/templates/current/examples/tests/unit/views/system/user/searchControl.spec.ts +128 -0
- package/templates/current/examples/tsconfig.json +4 -19
- package/templates/current/examples/vite.build-policy.ts +97 -22
- package/templates/current/examples/vite.config.ts +50 -7
- package/templates/current/clean/.codebuddy/AGENTS.md +0 -18
- package/templates/current/clean/.codex/skills/build-admin-feature/SKILL.md +0 -14
- package/templates/current/clean/.codex/skills/build-admin-feature/references/component-selection.md +0 -25
- package/templates/current/clean/.codex/skills/use-og-table/SKILL.md +0 -16
- package/templates/current/clean/.cursor/AGENTS.md +0 -18
- package/templates/current/clean/.env.production.example +0 -31
- package/templates/current/clean/.qoder/AGENTS.md +0 -15
- package/templates/current/clean/e2e/admin-shell.spec.ts +0 -156
- package/templates/current/clean/e2e/demo-shell.spec.ts +0 -372
- package/templates/current/clean/playwright.demo.config.ts +0 -25
- package/templates/current/clean/scripts/clean-overlay/src/features/errors/pages/NotFound.vue +0 -31
- package/templates/current/clean/scripts/clean-overlay/src/features/errors/pages/ServerError.vue +0 -31
- package/templates/current/clean/scripts/clean-overlay/src/features/errors/pages/error-pages.spec.ts +0 -41
- package/templates/current/clean/scripts/clean-overlay/src/main.ts +0 -100
- package/templates/current/clean/scripts/clean-overlay/src/router/componentCache.ts +0 -12
- package/templates/current/clean/scripts/clean-overlay/src/router/componentRegistry.ts +0 -14
- package/templates/current/clean/scripts/clean-overlay/src/router/dynamicRoutes.spec.ts +0 -77
- package/templates/current/clean/scripts/clean-overlay/src/router/paths.ts +0 -21
- package/templates/current/clean/scripts/clean-overlay/src/router/staticRoutes.ts +0 -63
- package/templates/current/clean/scripts/demo-api.ts +0 -873
- package/templates/current/clean/src/api/client.spec.ts +0 -66
- package/templates/current/clean/src/api/client.ts +0 -152
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- package/templates/current/clean/src/api/generated//350/256/244/350/257/201.ts +0 -95
- package/templates/current/clean/src/api/http-adapter.ts +0 -83
- package/templates/current/clean/src/app/createAdminUi.spec.ts +0 -166
- package/templates/current/clean/src/app/createAdminUi.ts +0 -63
- package/templates/current/clean/src/app/embedded-token.spec.ts +0 -40
- package/templates/current/clean/src/app/embedded.spec.ts +0 -135
- package/templates/current/clean/src/app/embedded.ts +0 -255
- package/templates/current/clean/src/app/errorMessage.ts +0 -53
- package/templates/current/clean/src/app/menu-host.spec.ts +0 -77
- package/templates/current/clean/src/app/menu.spec.ts +0 -320
- package/templates/current/clean/src/app/menu.ts +0 -308
- package/templates/current/clean/src/app/menuTypes.ts +0 -18
- package/templates/current/clean/src/app/origenUiLocale.ts +0 -10
- package/templates/current/clean/src/app/permission.ts +0 -9
- package/templates/current/clean/src/demo-api.spec.ts +0 -478
- package/templates/current/clean/src/features/errors/pages/error-pages.spec.ts +0 -41
- package/templates/current/clean/src/features/system/access/api/admin-repository.spec.ts +0 -14
- package/templates/current/clean/src/features/system/access/api/admin-repository.ts +0 -298
- package/templates/current/clean/src/features/system/access/api/rbac.spec.ts +0 -72
- package/templates/current/clean/src/features/system/access/api/rbac.ts +0 -292
- package/templates/current/clean/src/features/system/access/composables/useAuthorizationPolling.spec.ts +0 -134
- package/templates/current/clean/src/features/system/access/composables/useAuthorizationPolling.ts +0 -96
- package/templates/current/clean/src/features/workspace/pages/Profile.vue +0 -185
- package/templates/current/clean/src/router/componentCache.ts +0 -12
- package/templates/current/clean/src/router/componentRegistry.ts +0 -14
- package/templates/current/clean/src/router/dynamicMenuRefresh.spec.ts +0 -101
- package/templates/current/clean/src/router/dynamicRoutes.spec.ts +0 -77
- package/templates/current/clean/src/router/dynamicRoutes.ts +0 -177
- package/templates/current/clean/src/router/guards.ts +0 -5
- package/templates/current/clean/src/router/paths.spec.ts +0 -50
- package/templates/current/clean/src/router/paths.ts +0 -21
- package/templates/current/clean/src/router/routeQuery.ts +0 -6
- package/templates/current/clean/src/router/staticRoutes.ts +0 -63
- package/templates/current/clean/src/router/useRouteQueryDefaults.types.ts +0 -20
- package/templates/current/examples/.codebuddy/AGENTS.md +0 -18
- package/templates/current/examples/.codex/skills/build-admin-feature/SKILL.md +0 -14
- package/templates/current/examples/.codex/skills/build-admin-feature/references/component-selection.md +0 -25
- package/templates/current/examples/.codex/skills/use-og-table/SKILL.md +0 -16
- package/templates/current/examples/.cursor/AGENTS.md +0 -18
- package/templates/current/examples/.env.production.example +0 -31
- package/templates/current/examples/.qoder/AGENTS.md +0 -15
- package/templates/current/examples/e2e/admin-shell.spec.ts +0 -156
- package/templates/current/examples/e2e/demo-shell.spec.ts +0 -372
- package/templates/current/examples/playwright.demo.config.ts +0 -25
- package/templates/current/examples/scripts/clean-overlay/src/features/errors/pages/Forbidden.vue +0 -31
- package/templates/current/examples/scripts/clean-overlay/src/main.ts +0 -100
- package/templates/current/examples/scripts/clean-overlay/src/router/componentCache.ts +0 -12
- package/templates/current/examples/scripts/clean-overlay/src/router/componentRegistry.ts +0 -14
- package/templates/current/examples/scripts/clean-overlay/src/router/dynamicRoutes.spec.ts +0 -77
- package/templates/current/examples/scripts/clean-overlay/src/router/paths.ts +0 -21
- package/templates/current/examples/scripts/clean-overlay/src/router/staticRoutes.ts +0 -63
- package/templates/current/examples/scripts/demo-api.ts +0 -873
- package/templates/current/examples/src/api/client.spec.ts +0 -66
- package/templates/current/examples/src/api/client.ts +0 -152
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- package/templates/current/examples/src/api/generated//350/256/244/350/257/201.ts +0 -95
- package/templates/current/examples/src/api/http-adapter.ts +0 -83
- package/templates/current/examples/src/app/createAdminUi.spec.ts +0 -166
- package/templates/current/examples/src/app/createAdminUi.ts +0 -63
- package/templates/current/examples/src/app/embedded-token.spec.ts +0 -40
- package/templates/current/examples/src/app/embedded.spec.ts +0 -135
- package/templates/current/examples/src/app/embedded.ts +0 -255
- package/templates/current/examples/src/app/errorMessage.ts +0 -53
- package/templates/current/examples/src/app/menu-host.spec.ts +0 -77
- package/templates/current/examples/src/app/menu.spec.ts +0 -320
- package/templates/current/examples/src/app/menu.ts +0 -308
- package/templates/current/examples/src/app/menuTypes.ts +0 -18
- package/templates/current/examples/src/app/origenUiLocale.ts +0 -10
- package/templates/current/examples/src/app/permission.ts +0 -9
- package/templates/current/examples/src/demo-api.spec.ts +0 -478
- package/templates/current/examples/src/features/errors/pages/Forbidden.vue +0 -31
- package/templates/current/examples/src/features/errors/pages/NotFound.vue +0 -31
- package/templates/current/examples/src/features/errors/pages/ServerError.vue +0 -31
- package/templates/current/examples/src/features/feature-composables.spec.ts +0 -245
- package/templates/current/examples/src/features/system/access/api/admin-repository.spec.ts +0 -14
- package/templates/current/examples/src/features/system/access/api/admin-repository.ts +0 -298
- package/templates/current/examples/src/features/system/access/api/rbac.spec.ts +0 -72
- package/templates/current/examples/src/features/system/access/api/rbac.ts +0 -292
- package/templates/current/examples/src/features/system/access/composables/useAuthorizationPolling.spec.ts +0 -134
- package/templates/current/examples/src/features/system/access/composables/useAuthorizationPolling.ts +0 -96
- package/templates/current/examples/src/features/system/audit/composables/useAuditManagement.ts +0 -122
- package/templates/current/examples/src/features/system/audit/pages/AuditList.vue +0 -20
- package/templates/current/examples/src/features/system/menus/components/MenuEditorForm.vue +0 -279
- package/templates/current/examples/src/features/system/menus/composables/useMenuManagement.ts +0 -435
- package/templates/current/examples/src/features/system/menus/menuDraft.spec.ts +0 -204
- package/templates/current/examples/src/features/system/menus/menuDraft.ts +0 -116
- package/templates/current/examples/src/features/system/menus/menuTreePrecheck.spec.ts +0 -268
- package/templates/current/examples/src/features/system/menus/menuTreePrecheck.ts +0 -317
- package/templates/current/examples/src/features/system/menus/pages/MenuList.vue +0 -51
- package/templates/current/examples/src/features/system/roles/components/RoleEditorForm.vue +0 -116
- package/templates/current/examples/src/features/system/roles/composables/useRoleManagement.ts +0 -194
- package/templates/current/examples/src/features/system/roles/pages/RoleList.vue +0 -47
- package/templates/current/examples/src/features/system/users/components/UserEditorForm.vue +0 -104
- package/templates/current/examples/src/features/system/users/composables/useUserManagement.ts +0 -228
- package/templates/current/examples/src/features/system/users/pages/UserList.vue +0 -51
- package/templates/current/examples/src/features/workspace/pages/Dashboard.spec.ts +0 -41
- package/templates/current/examples/src/features/workspace/pages/Dashboard.vue +0 -325
- package/templates/current/examples/src/features/workspace/pages/Profile.vue +0 -185
- package/templates/current/examples/src/router/componentCache.ts +0 -18
- package/templates/current/examples/src/router/componentRegistry.ts +0 -66
- package/templates/current/examples/src/router/dynamicMenuRefresh.spec.ts +0 -101
- package/templates/current/examples/src/router/dynamicRoutes.spec.ts +0 -144
- package/templates/current/examples/src/router/dynamicRoutes.ts +0 -177
- package/templates/current/examples/src/router/guards.ts +0 -5
- package/templates/current/examples/src/router/paths.spec.ts +0 -50
- package/templates/current/examples/src/router/paths.ts +0 -21
- package/templates/current/examples/src/router/routeQuery.ts +0 -6
- package/templates/current/examples/src/router/staticRoutes.ts +0 -63
- package/templates/current/examples/src/router/useRouteQueryDefaults.types.ts +0 -20
- /package/templates/current/clean/{.codex → .agents}/skills/style-og-origen-ui/SKILL.md +0 -0
- /package/templates/current/clean/{.codex → .agents}/skills/style-og-origen-ui/agents/openai.yaml +0 -0
- /package/templates/current/clean/{.codex → .agents}/skills/use-og-dialog/SKILL.md +0 -0
- /package/templates/current/clean/{.codex → .agents}/skills/use-og-dialog/agents/openai.yaml +0 -0
- /package/templates/current/clean/{.codex → .agents}/skills/use-og-editor/SKILL.md +0 -0
- /package/templates/current/clean/{.codex → .agents}/skills/use-og-http/SKILL.md +0 -0
- /package/templates/current/clean/{.codex → .agents}/skills/use-og-http/agents/openai.yaml +0 -0
- /package/templates/current/clean/{.codex → .agents}/skills/use-og-router-tabs/SKILL.md +0 -0
- /package/templates/current/{examples/.codex → clean/.claude}/skills/style-og-origen-ui/SKILL.md +0 -0
- /package/templates/current/{examples/.codex → clean/.claude}/skills/use-og-dialog/SKILL.md +0 -0
- /package/templates/current/{examples/.codex → clean/.claude}/skills/use-og-editor/SKILL.md +0 -0
- /package/templates/current/{examples/.codex → clean/.claude}/skills/use-og-http/SKILL.md +0 -0
- /package/templates/current/{examples/.codex → clean/.claude}/skills/use-og-router-tabs/SKILL.md +0 -0
- /package/templates/current/clean/src/{features/security/components → components}/DevtoolsProtectionOverlay.vue +0 -0
- /package/templates/current/clean/src/{features/shell/composables → composables}/useRouteProgress.ts +0 -0
- /package/templates/current/clean/src/{features/workspace → views/fallback}/pages/Empty.vue +0 -0
- /package/templates/current/examples/{.codex → .agents}/skills/style-og-origen-ui/agents/openai.yaml +0 -0
- /package/templates/current/examples/{.codex → .agents}/skills/use-og-dialog/agents/openai.yaml +0 -0
- /package/templates/current/examples/{.codex → .agents}/skills/use-og-http/agents/openai.yaml +0 -0
- /package/templates/current/examples/src/{features/security/components → components}/DevtoolsProtectionOverlay.vue +0 -0
- /package/templates/current/examples/src/{features/shell/composables → composables}/useRouteProgress.ts +0 -0
- /package/templates/current/examples/src/{features/workspace → views/fallback}/pages/Empty.vue +0 -0
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
// 把归一化后的后端菜单节点转换为路由适配器记录。
|
|
2
|
+
|
|
3
|
+
import type { RouteSourceNode } from '@origen-ui/router'
|
|
4
|
+
import type { LocationQueryRaw } from 'vue-router'
|
|
5
|
+
import type { BackendMenuNode } from '@/app/menu/menuTypes'
|
|
6
|
+
import { hasComponentKey, pageComponentKey } from '@/router/dynamic/componentLoader'
|
|
7
|
+
|
|
8
|
+
const EXTERNAL_COMPONENT_PREFIX = 'external:'
|
|
9
|
+
// 这两个映射在每次菜单转换时清空重建,供导航守卫补齐 query 默认值与页面按组件反查路由名使用。
|
|
10
|
+
const dynamicQueryDefaults = new Map<string, LocationQueryRaw>()
|
|
11
|
+
const dynamicComponentRoutes = new Map<string, string | null>()
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* 查询页面组件对应的路由名;菜单中该组件映射不唯一(值为 `null`)时返回 `undefined`。
|
|
15
|
+
* @param componentPath - 后端菜单配置的组件路径。
|
|
16
|
+
* @returns 唯一映射的路由名,或 `undefined`。
|
|
17
|
+
*/
|
|
18
|
+
export function dynamicRouteNameForComponent(componentPath: string): string | undefined {
|
|
19
|
+
const key = pageComponentKey(componentPath)
|
|
20
|
+
if (!key) return undefined
|
|
21
|
+
const name = dynamicComponentRoutes.get(key)
|
|
22
|
+
if (typeof name === 'string') return name
|
|
23
|
+
return undefined
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function sanitize(value: string): string {
|
|
27
|
+
return value.replace(/[^\w-]+/g, '-').replace(/^-|-$/g, '') || 'route'
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function routeName(source: BackendMenuNode, used: Set<string>, isExternal: boolean): string {
|
|
31
|
+
let kind = 'page'
|
|
32
|
+
if (source.menuType === 'M') kind = 'directory'
|
|
33
|
+
else if (isExternal) kind = 'external'
|
|
34
|
+
const base = `${kind}-${sanitize(source.routeName ?? source.menuId)}`
|
|
35
|
+
let name = base
|
|
36
|
+
let suffix = 2
|
|
37
|
+
while (used.has(name)) {
|
|
38
|
+
name = `${base}-${suffix}`
|
|
39
|
+
suffix += 1
|
|
40
|
+
}
|
|
41
|
+
used.add(name)
|
|
42
|
+
return name
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function componentKey(source: BackendMenuNode, hasChildren: boolean): string | undefined {
|
|
46
|
+
if (source.externalUrl) return EXTERNAL_COMPONENT_PREFIX + encodeURIComponent(source.externalUrl)
|
|
47
|
+
if (source.menuType === 'M') return 'outlet'
|
|
48
|
+
const component = source.component?.replace(/^\/+|\/+$/g, '')
|
|
49
|
+
if (component === 'Layout' || component === 'ParentView') return 'outlet'
|
|
50
|
+
const pageKey = pageComponentKey(component)
|
|
51
|
+
if (pageKey && hasComponentKey(pageKey)) return pageKey
|
|
52
|
+
// 已配置的父路由若拥有可转换的子页面,仍保留为 outlet 路由而不是丢弃。
|
|
53
|
+
if (hasChildren) return 'outlet'
|
|
54
|
+
return undefined
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function routePath(source: BackendMenuNode, isRoot: boolean, isExternal: boolean): string {
|
|
58
|
+
if (isExternal) return `/_external/${encodeURIComponent(source.menuId)}`
|
|
59
|
+
const path = source.path.trim()
|
|
60
|
+
if (isRoot && !path.startsWith('/')) return `/${path}`
|
|
61
|
+
return path
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function parseQueryValue(value: unknown): string | null | string[] | undefined {
|
|
65
|
+
if (value === null) return null
|
|
66
|
+
if (typeof value === 'string') return value
|
|
67
|
+
if (typeof value === 'number' || typeof value === 'boolean') return String(value)
|
|
68
|
+
if (Array.isArray(value)) {
|
|
69
|
+
const values = value.map((item) => parseQueryValue(item))
|
|
70
|
+
if (values.some((item) => item === undefined || Array.isArray(item))) return undefined
|
|
71
|
+
return values as string[]
|
|
72
|
+
}
|
|
73
|
+
return undefined
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* 解析路由 query 默认值:支持 JSON 对象字符串或 URL 编码的键值对。
|
|
78
|
+
* @param value - 后端菜单节点携带的 `query` 字符串。
|
|
79
|
+
* @returns 归一化后的 `LocationQueryRaw`。
|
|
80
|
+
* @throws 当以 `{` 开头但 JSON 无效、或 JSON 不是对象时,抛出 `TypeError`。
|
|
81
|
+
*/
|
|
82
|
+
export function parseRouteQuery(value: string | undefined): LocationQueryRaw {
|
|
83
|
+
if (!value?.trim()) return {}
|
|
84
|
+
const text = value.trim()
|
|
85
|
+
if (text.startsWith('{')) {
|
|
86
|
+
let parsed: unknown
|
|
87
|
+
try {
|
|
88
|
+
parsed = JSON.parse(text)
|
|
89
|
+
} catch {
|
|
90
|
+
throw new TypeError('Route query must contain valid JSON.')
|
|
91
|
+
}
|
|
92
|
+
if (typeof parsed !== 'object' || parsed === null || Array.isArray(parsed))
|
|
93
|
+
throw new TypeError('Route query JSON must be an object.')
|
|
94
|
+
const query: LocationQueryRaw = {}
|
|
95
|
+
for (const [key, rawValue] of Object.entries(parsed)) {
|
|
96
|
+
const normalized = parseQueryValue(rawValue)
|
|
97
|
+
if (normalized !== undefined) query[key] = normalized
|
|
98
|
+
}
|
|
99
|
+
return query
|
|
100
|
+
}
|
|
101
|
+
const query: LocationQueryRaw = {}
|
|
102
|
+
for (const [key, queryValue] of new URLSearchParams(text)) {
|
|
103
|
+
const current = query[key]
|
|
104
|
+
if (current === undefined) query[key] = queryValue
|
|
105
|
+
else if (Array.isArray(current)) query[key] = [...current, queryValue]
|
|
106
|
+
else query[key] = [current, queryValue]
|
|
107
|
+
}
|
|
108
|
+
return query
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* 返回最近一次菜单转换期间为该路由名收集的 query 默认值。
|
|
113
|
+
* @param name - 路由名;非字符串直接返回 `undefined`。
|
|
114
|
+
* @returns 该路由的默认 query,或 `undefined`。
|
|
115
|
+
*/
|
|
116
|
+
export function dynamicRouteQueryDefaults(name: unknown): LocationQueryRaw | undefined {
|
|
117
|
+
if (typeof name !== 'string') return undefined
|
|
118
|
+
return dynamicQueryDefaults.get(name)
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
function routeMeta(source: BackendMenuNode, key: string | undefined): RouteSourceNode['meta'] {
|
|
122
|
+
return {
|
|
123
|
+
title: source.menuName,
|
|
124
|
+
icon: source.icon,
|
|
125
|
+
permissions: source.permissions,
|
|
126
|
+
menu: { hidden: source.hidden, order: source.orderNum },
|
|
127
|
+
breadcrumb: { label: source.menuName },
|
|
128
|
+
tab: { hidden: source.menuType === 'M' },
|
|
129
|
+
...(source.cache && key?.startsWith('page:')
|
|
130
|
+
? {
|
|
131
|
+
cache: { enabled: true },
|
|
132
|
+
}
|
|
133
|
+
: {}),
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
function assertUniqueMenuIds(nodes: readonly BackendMenuNode[], seen = new Set<string>()): void {
|
|
138
|
+
for (const node of nodes) {
|
|
139
|
+
if (seen.has(node.menuId)) throw new Error(`Duplicate menu id: ${node.menuId}`)
|
|
140
|
+
seen.add(node.menuId)
|
|
141
|
+
assertUniqueMenuIds(node.children ?? [], seen)
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
function normalizeRedirect(
|
|
146
|
+
redirect: string | undefined,
|
|
147
|
+
basePath: string,
|
|
148
|
+
validPaths: ReadonlySet<string>,
|
|
149
|
+
): string | undefined {
|
|
150
|
+
if (!redirect) return undefined
|
|
151
|
+
const [targetPath = '', query] = redirect.split('?')
|
|
152
|
+
let fullTarget = targetPath
|
|
153
|
+
if (!targetPath.startsWith('/')) {
|
|
154
|
+
fullTarget = `${basePath.replace(/\/$/, '')}/${targetPath}`
|
|
155
|
+
}
|
|
156
|
+
if (!validPaths.has(fullTarget)) return undefined
|
|
157
|
+
if (query === undefined) return fullTarget
|
|
158
|
+
return `${fullTarget}?${query}`
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* 把归一化后的后端菜单树转换为经过校验的动态路由记录,并同步重建 query 默认值与组件路由名映射、回填合法 redirect。
|
|
163
|
+
* @param sources - 已归一化的后端菜单节点树。
|
|
164
|
+
* @returns 可交给路由适配器的动态路由记录。
|
|
165
|
+
* @throws 当菜单 id 重复时,由 `assertUniqueMenuIds` 抛出 `Error`。
|
|
166
|
+
*/
|
|
167
|
+
export function routeTransformer(sources: readonly BackendMenuNode[]): readonly RouteSourceNode[] {
|
|
168
|
+
assertUniqueMenuIds(sources)
|
|
169
|
+
dynamicQueryDefaults.clear()
|
|
170
|
+
dynamicComponentRoutes.clear()
|
|
171
|
+
const usedNames = new Set<string>()
|
|
172
|
+
const pendingRedirects: Array<{
|
|
173
|
+
route: RouteSourceNode
|
|
174
|
+
value: string
|
|
175
|
+
basePath: string
|
|
176
|
+
}> = []
|
|
177
|
+
const validPaths = new Set<string>()
|
|
178
|
+
|
|
179
|
+
function transform(
|
|
180
|
+
source: BackendMenuNode,
|
|
181
|
+
isRoot: boolean,
|
|
182
|
+
parentPath = '',
|
|
183
|
+
): RouteSourceNode | undefined {
|
|
184
|
+
if (source.menuType === 'F') return undefined
|
|
185
|
+
const isExternal = Boolean(source.externalUrl)
|
|
186
|
+
const path = routePath(source, isRoot, isExternal)
|
|
187
|
+
let fullPath = path
|
|
188
|
+
if (!path.startsWith('/')) fullPath = `${parentPath.replace(/\/$/, '')}/${path}`
|
|
189
|
+
const children = (source.children ?? [])
|
|
190
|
+
.map((child) => transform(child, false, fullPath))
|
|
191
|
+
.filter((child): child is RouteSourceNode => child !== undefined)
|
|
192
|
+
if (source.menuType === 'M' && children.length === 0 && !isExternal) return undefined
|
|
193
|
+
const key = componentKey(source, children.length > 0)
|
|
194
|
+
if (!key) return undefined
|
|
195
|
+
const name = routeName(source, usedNames, isExternal)
|
|
196
|
+
if (source.menuType === 'C' && key.startsWith('page:')) {
|
|
197
|
+
const previousName = dynamicComponentRoutes.get(key)
|
|
198
|
+
if (previousName === undefined) dynamicComponentRoutes.set(key, name)
|
|
199
|
+
else dynamicComponentRoutes.set(key, null)
|
|
200
|
+
}
|
|
201
|
+
const queryDefaults = parseRouteQuery(source.query)
|
|
202
|
+
if (Object.keys(queryDefaults).length) dynamicQueryDefaults.set(name, queryDefaults)
|
|
203
|
+
let redirectBase = fullPath.slice(0, fullPath.lastIndexOf('/')) || '/'
|
|
204
|
+
if (source.menuType === 'M') redirectBase = fullPath
|
|
205
|
+
const route: RouteSourceNode = {
|
|
206
|
+
name,
|
|
207
|
+
path,
|
|
208
|
+
componentKey: key,
|
|
209
|
+
meta: routeMeta(source, key),
|
|
210
|
+
}
|
|
211
|
+
if (source.redirect) {
|
|
212
|
+
pendingRedirects.push({
|
|
213
|
+
route,
|
|
214
|
+
value: source.redirect,
|
|
215
|
+
basePath: redirectBase,
|
|
216
|
+
})
|
|
217
|
+
}
|
|
218
|
+
if (children.length > 0) route.children = children
|
|
219
|
+
return route
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
const routes = sources
|
|
223
|
+
.map((source) => transform(source, true))
|
|
224
|
+
.filter((node): node is RouteSourceNode => node !== undefined)
|
|
225
|
+
|
|
226
|
+
function collectPaths(nodes: readonly RouteSourceNode[], parentPath = ''): void {
|
|
227
|
+
for (const route of nodes) {
|
|
228
|
+
let fullPath = route.path
|
|
229
|
+
if (!route.path.startsWith('/')) {
|
|
230
|
+
fullPath = `${parentPath.replace(/\/$/, '')}/${route.path}`
|
|
231
|
+
}
|
|
232
|
+
validPaths.add(fullPath)
|
|
233
|
+
collectPaths(route.children ?? [], fullPath)
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
collectPaths(routes)
|
|
237
|
+
|
|
238
|
+
for (const pending of pendingRedirects) {
|
|
239
|
+
const redirect = normalizeRedirect(pending.value, pending.basePath, validPaths)
|
|
240
|
+
if (redirect) pending.route.redirect = redirect
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
return routes
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
// 用于把编码后的外链目标与页面 key 区分开的 `external:` 前缀。
|
|
247
|
+
export const externalRouteComponentPrefix = EXTERNAL_COMPONENT_PREFIX
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// 提供在会话尚不可用时识别公开路由的判定入口。
|
|
2
|
+
|
|
3
|
+
import type { RouteLocationNormalizedLoaded } from 'vue-router'
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* 判断匹配到的路由记录是否显式标记为无需会话即可访问。
|
|
7
|
+
* @param route - 当前规范化路由。
|
|
8
|
+
* @returns 任一匹配记录的 `adapter.public === true` 时返回 `true`。
|
|
9
|
+
*/
|
|
10
|
+
export function isPublicRoute(route: RouteLocationNormalizedLoaded): boolean {
|
|
11
|
+
return route.matched.some((record) => record.meta.adapter?.public === true)
|
|
12
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// 定义共享导航路径常量,并选取首个可达的菜单页面。
|
|
2
|
+
|
|
3
|
+
import type { RouteMenuItem } from '@origen-ui/router'
|
|
4
|
+
import type { RouteLocationRaw } from 'vue-router'
|
|
5
|
+
|
|
6
|
+
// 根路径 `/` 在菜单加载后由导航守卫解析为首个可访问的页面。
|
|
7
|
+
export const HOME_ROUTE = '/'
|
|
8
|
+
|
|
9
|
+
// staticRoutes 中 404 兜底页的路由名。
|
|
10
|
+
export const NOT_FOUND_ROUTE_NAME = '404'
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* 选取首个真实页面作为默认落地页;目录与外链条目不参与,且需通过 `isReachable` 校验。
|
|
14
|
+
* @param items - 当前菜单树。
|
|
15
|
+
* @param isReachable - 可选的目标可达性校验,默认全部视为可达。
|
|
16
|
+
* @returns 首个可达页面跳转目标,或 `undefined`。
|
|
17
|
+
*/
|
|
18
|
+
export function firstMenuTarget(
|
|
19
|
+
items: readonly RouteMenuItem[],
|
|
20
|
+
isReachable: (to: RouteLocationRaw) => boolean = () => true,
|
|
21
|
+
): RouteLocationRaw | undefined {
|
|
22
|
+
for (const item of items) {
|
|
23
|
+
if (item.id.startsWith('page-') && item.to && isReachable(item.to)) return item.to
|
|
24
|
+
const child = firstMenuTarget(item.children, isReachable)
|
|
25
|
+
if (child) return child
|
|
26
|
+
}
|
|
27
|
+
return undefined
|
|
28
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
// 定义在动态菜单加载前即可用的固定公开路由与错误页路由。
|
|
2
|
+
|
|
3
|
+
import type { RouteRecordRaw } from 'vue-router'
|
|
4
|
+
|
|
5
|
+
const Forbidden = () => import('@/views/errors/pages/Forbidden.vue')
|
|
6
|
+
const NotFound = () => import('@/views/errors/pages/NotFound.vue')
|
|
7
|
+
const MethodNotAllowed = () => import('@/views/errors/pages/MethodNotAllowed.vue')
|
|
8
|
+
const ServerError = () => import('@/views/errors/pages/ServerError.vue')
|
|
9
|
+
const Login = () => import('@/views/login/pages/index.vue')
|
|
10
|
+
const Empty = () => import('@/views/fallback/pages/Empty.vue')
|
|
11
|
+
const RoleAuthUser = () => import('@/views/system/role/auth-users/pages/index.vue')
|
|
12
|
+
const UserAuthRole = () => import('@/views/system/user/auth-roles/pages/index.vue')
|
|
13
|
+
// 静态工具路由统一从菜单、面包屑与标签页状态中隐藏,并标记为 public。
|
|
14
|
+
const hiddenPublic = {
|
|
15
|
+
public: true,
|
|
16
|
+
menu: { hidden: true },
|
|
17
|
+
breadcrumb: { hidden: true },
|
|
18
|
+
tab: { hidden: true },
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// 后端菜单加载前必需的静态路由,包含根占位、登录页与 403/404/405/500 错误页。
|
|
22
|
+
export const staticRoutes: RouteRecordRaw[] = [
|
|
23
|
+
{
|
|
24
|
+
path: '/',
|
|
25
|
+
name: 'root',
|
|
26
|
+
component: Empty,
|
|
27
|
+
meta: {
|
|
28
|
+
staticPagePath: '@/views/fallback/pages/Empty.vue',
|
|
29
|
+
adapter: {
|
|
30
|
+
menu: { hidden: true },
|
|
31
|
+
breadcrumb: { hidden: true },
|
|
32
|
+
tab: { hidden: true },
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
path: '/login',
|
|
38
|
+
name: 'login',
|
|
39
|
+
component: Login,
|
|
40
|
+
meta: {
|
|
41
|
+
staticPagePath: '@/views/login/pages/index.vue',
|
|
42
|
+
adapter: { titleKey: 'auth.login', ...hiddenPublic },
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
path: '/system/role-auth/user/:roleId(\\d+)',
|
|
47
|
+
name: 'system-role-auth-users',
|
|
48
|
+
component: RoleAuthUser,
|
|
49
|
+
meta: {
|
|
50
|
+
staticPagePath: '@/views/system/role/auth-users/pages/index.vue',
|
|
51
|
+
adapter: {
|
|
52
|
+
titleKey: 'system.roles.assignedUsers',
|
|
53
|
+
permissions: ['system:role:edit'],
|
|
54
|
+
menu: { hidden: true },
|
|
55
|
+
breadcrumb: { hidden: true },
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
path: '/system/user-auth/role/:userId(\\d+)',
|
|
61
|
+
name: 'system-user-auth-roles',
|
|
62
|
+
component: UserAuthRole,
|
|
63
|
+
meta: {
|
|
64
|
+
staticPagePath: '@/views/system/user/auth-roles/pages/index.vue',
|
|
65
|
+
adapter: {
|
|
66
|
+
titleKey: 'system.users.authorizeRoles',
|
|
67
|
+
permissions: ['system:user:edit'],
|
|
68
|
+
menu: { hidden: true },
|
|
69
|
+
breadcrumb: { hidden: true },
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
path: '/403',
|
|
75
|
+
name: '403',
|
|
76
|
+
component: Forbidden,
|
|
77
|
+
meta: {
|
|
78
|
+
staticPagePath: '@/views/errors/pages/Forbidden.vue',
|
|
79
|
+
adapter: { titleKey: 'errors.forbidden.title', ...hiddenPublic },
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
path: '/404',
|
|
84
|
+
name: '404',
|
|
85
|
+
component: NotFound,
|
|
86
|
+
meta: {
|
|
87
|
+
staticPagePath: '@/views/errors/pages/NotFound.vue',
|
|
88
|
+
adapter: { titleKey: 'errors.notFound.title', ...hiddenPublic },
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
path: '/405',
|
|
93
|
+
name: '405',
|
|
94
|
+
component: MethodNotAllowed,
|
|
95
|
+
meta: {
|
|
96
|
+
staticPagePath: '@/views/errors/pages/MethodNotAllowed.vue',
|
|
97
|
+
adapter: { titleKey: 'errors.methodNotAllowed.title', ...hiddenPublic },
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
path: '/500',
|
|
102
|
+
name: '500',
|
|
103
|
+
component: ServerError,
|
|
104
|
+
meta: {
|
|
105
|
+
staticPagePath: '@/views/errors/pages/ServerError.vue',
|
|
106
|
+
adapter: { titleKey: 'errors.serverError.title', ...hiddenPublic },
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
]
|
package/templates/current/examples/src/router/{queryEncryption.ts → query/queryEncryption.ts}
RENAMED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
// 用 AES-GCM 带认证加密编解码路由 query 载荷。
|
|
2
|
+
|
|
1
3
|
import type { LocationQuery, LocationQueryRaw } from 'vue-router'
|
|
2
4
|
import { gcm } from '@noble/ciphers/aes.js'
|
|
3
5
|
import { randomBytes } from '@noble/ciphers/utils.js'
|
|
@@ -14,11 +16,13 @@ const decoder = new TextDecoder('utf-8', { fatal: true })
|
|
|
14
16
|
type QueryValue = string | null | string[] | (string | null)[]
|
|
15
17
|
type EncodedQuery = Record<string, QueryValue>
|
|
16
18
|
|
|
19
|
+
// 构建期选项,控制是否启用 query 加密及其 AES 密钥。
|
|
17
20
|
export interface RouteQueryEncryptionOptions {
|
|
18
21
|
enabled?: boolean
|
|
19
22
|
key?: string
|
|
20
23
|
}
|
|
21
24
|
|
|
25
|
+
// 加密 query 字符串所用的 Vue Router 编解码器对(parseQuery/stringifyQuery)。
|
|
22
26
|
export interface RouteQueryEncryption {
|
|
23
27
|
parseQuery: (search: string) => LocationQuery
|
|
24
28
|
stringifyQuery: (query: LocationQueryRaw | undefined) => string
|
|
@@ -38,7 +42,9 @@ function fromUrlSafeBase64(value: string): Uint8Array | undefined {
|
|
|
38
42
|
)}`
|
|
39
43
|
const binary = atob(padded)
|
|
40
44
|
const bytes = Uint8Array.from(binary, (character) => character.charCodeAt(0))
|
|
41
|
-
return toUrlSafeBase64(bytes) === value
|
|
45
|
+
return toUrlSafeBase64(bytes) === value
|
|
46
|
+
? bytes
|
|
47
|
+
: undefined
|
|
42
48
|
} catch {
|
|
43
49
|
return undefined
|
|
44
50
|
}
|
|
@@ -52,9 +58,13 @@ function normalizeQuery(query: LocationQueryRaw | undefined): EncodedQuery {
|
|
|
52
58
|
if (Array.isArray(value)) {
|
|
53
59
|
normalized[key] = value
|
|
54
60
|
.filter((item): item is string | null => item !== undefined)
|
|
55
|
-
.map((item) => (item === null
|
|
61
|
+
.map((item) => (item === null
|
|
62
|
+
? null
|
|
63
|
+
: String(item)))
|
|
56
64
|
} else {
|
|
57
|
-
normalized[key] = value === null
|
|
65
|
+
normalized[key] = value === null
|
|
66
|
+
? null
|
|
67
|
+
: String(value)
|
|
58
68
|
}
|
|
59
69
|
}
|
|
60
70
|
return normalized
|
|
@@ -71,15 +81,25 @@ function isEncodedQuery(value: unknown): value is EncodedQuery {
|
|
|
71
81
|
}
|
|
72
82
|
|
|
73
83
|
function readCiphertext(search: string): string | undefined {
|
|
74
|
-
const parameters = new URLSearchParams(search.startsWith('?')
|
|
84
|
+
const parameters = new URLSearchParams(search.startsWith('?')
|
|
85
|
+
? search.slice(1)
|
|
86
|
+
: search)
|
|
75
87
|
const values = parameters.getAll(QUERY_PARAMETER)
|
|
76
|
-
return values.length === 1
|
|
88
|
+
return values.length === 1
|
|
89
|
+
? values[0]
|
|
90
|
+
: undefined
|
|
77
91
|
}
|
|
78
92
|
|
|
79
93
|
function keyFromHex(value: string): Uint8Array {
|
|
80
94
|
return Uint8Array.from(value.match(/../gu)!.map((pair) => Number.parseInt(pair, 16)))
|
|
81
95
|
}
|
|
82
96
|
|
|
97
|
+
/**
|
|
98
|
+
* 创建 AES-GCM query 编解码器;未启用时返回 `undefined` 以保留路由默认 query 处理,启用但密钥非法时抛错。
|
|
99
|
+
* @param options - 构建期选项;`enabled` 为假时直接返回 `undefined`。
|
|
100
|
+
* @returns 包含 `parseQuery`/`stringifyQuery` 的编解码器,或未启用时的 `undefined`。
|
|
101
|
+
* @throws 当启用加密但 `key` 不是 64 位十六进制字符串时,抛出 `Error`。
|
|
102
|
+
*/
|
|
83
103
|
export function createRouteQueryEncryption(
|
|
84
104
|
options: RouteQueryEncryptionOptions = {},
|
|
85
105
|
): RouteQueryEncryption | undefined {
|
|
@@ -108,12 +128,7 @@ export function createRouteQueryEncryption(
|
|
|
108
128
|
if (!value) return {}
|
|
109
129
|
try {
|
|
110
130
|
const [version, nonceValue, ciphertextValue, ...extra] = value.split('.')
|
|
111
|
-
if (
|
|
112
|
-
version !== VERSION ||
|
|
113
|
-
!nonceValue ||
|
|
114
|
-
!ciphertextValue ||
|
|
115
|
-
extra.length > 0
|
|
116
|
-
) {
|
|
131
|
+
if (version !== VERSION || !nonceValue || !ciphertextValue || extra.length > 0) {
|
|
117
132
|
return {}
|
|
118
133
|
}
|
|
119
134
|
const nonce = fromUrlSafeBase64(nonceValue)
|
|
@@ -128,7 +143,9 @@ export function createRouteQueryEncryption(
|
|
|
128
143
|
}
|
|
129
144
|
const plaintext = decoder.decode(gcm(encryptionKey, nonce).decrypt(ciphertextAndTag))
|
|
130
145
|
const query: unknown = JSON.parse(plaintext)
|
|
131
|
-
return isEncodedQuery(query)
|
|
146
|
+
return isEncodedQuery(query)
|
|
147
|
+
? (query as LocationQuery)
|
|
148
|
+
: {}
|
|
132
149
|
} catch {
|
|
133
150
|
return {}
|
|
134
151
|
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// 路由状态筛选值的解析入口:先经 `getRouteQueryString` 规范化 URL query,再按白名单收敛为受支持的状态值。
|
|
2
|
+
|
|
3
|
+
import { getRouteQueryString } from '@origen-ui/router'
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* 把路由查询值解析为受支持的账户状态,仅接受 `active` 或 `suspended`,其余值返回 `undefined`。
|
|
7
|
+
* 用于把 URL query 收敛为页面状态筛选白名单,避免非法值直接进入业务模型。
|
|
8
|
+
* @param value - 未知的路由 query 值;先由 `getRouteQueryString` 规范化。
|
|
9
|
+
* @returns 受支持的账户状态,或 `undefined`。
|
|
10
|
+
*/
|
|
11
|
+
export function routeStatus(value: unknown): 'active' | 'suspended' | undefined {
|
|
12
|
+
const normalized = getRouteQueryString(value)
|
|
13
|
+
return normalized === 'active' || normalized === 'suspended'
|
|
14
|
+
? normalized
|
|
15
|
+
: undefined
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* 把路由查询值解析为后端数字记录状态,仅接受 `0` 或 `1`,其余值返回 `undefined`。
|
|
20
|
+
* 用于把 URL query 收敛为后端状态筛选白名单,避免非法值直接进入业务模型。
|
|
21
|
+
* @param value - 未知的路由 query 值;先由 `getRouteQueryString` 规范化。
|
|
22
|
+
* @returns 字符串形式的数字状态,或 `undefined`。
|
|
23
|
+
*/
|
|
24
|
+
export function routeRecordStatus(value: unknown): '0' | '1' | undefined {
|
|
25
|
+
const normalized = getRouteQueryString(value)
|
|
26
|
+
return normalized === '0' || normalized === '1'
|
|
27
|
+
? normalized
|
|
28
|
+
: undefined
|
|
29
|
+
}
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
+
// 把当前路由查询按白名单解析为类型化的视图初始条件;本文件同时提供解析器类型与取快照的 composable。
|
|
2
|
+
|
|
1
3
|
import { onActivated, onMounted, ref } from 'vue'
|
|
2
4
|
import { useRoute } from 'vue-router'
|
|
3
5
|
|
|
4
6
|
type RouteQueryKey<TQuery extends object> = Extract<keyof TQuery, string>
|
|
5
7
|
|
|
8
|
+
// 把单个不可信的 URL 查询值转换为视图状态中的类型化值;无法解析时返回 `undefined`。
|
|
6
9
|
export type RouteQueryParser<TValue> = (value: unknown) => TValue | undefined
|
|
7
10
|
|
|
11
|
+
// 查询键白名单及对应解析器;键限定为 `TQuery` 中已声明的字符串键,可缺省。
|
|
8
12
|
export type RouteQueryParsers<TQuery extends object> = Partial<{
|
|
9
13
|
[TKey in RouteQueryKey<TQuery>]: RouteQueryParser<Exclude<TQuery[TKey], undefined>>
|
|
10
14
|
}>
|
|
@@ -27,14 +31,11 @@ function resolveRouteDefaults<TQuery extends object>(
|
|
|
27
31
|
}
|
|
28
32
|
|
|
29
33
|
/**
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
* trigger `OgTable`'s `queryDefaults` watcher and wipe the search state.
|
|
36
|
-
* Re-entering the page (fresh navigation, e.g. from the menu) re-snapshots the
|
|
37
|
-
* current URL query so deep links still work.
|
|
34
|
+
* 把白名单内的路由查询值解析为表格初始查询条件,并返回可响应式读取的 `queryDefaults`。
|
|
35
|
+
* 默认值在页面挂载或 KeepAlive 重新激活时取快照,避免缓存标签停用期间其他标签的 `route.query` 变化触发 `OgTable` 的查询默认值监听并清空搜索状态;从菜单重新进入页面仍会按当前 URL 取新快照,使深链生效。
|
|
36
|
+
* @param parsers - 查询键白名单及各自的类型化解析器;未登记或解析为 `undefined` 的键不进入默认值。
|
|
37
|
+
* @returns 包含 `queryDefaults` 响应式引用的对象。
|
|
38
|
+
* @template TQuery - 页面查询模型的类型。
|
|
38
39
|
*/
|
|
39
40
|
export function useRouteQueryDefaults<TQuery extends object>(parsers: RouteQueryParsers<TQuery>) {
|
|
40
41
|
const route = useRoute()
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/** Verify type inference for the route-query defaults composable. */
|
|
2
|
+
|
|
3
|
+
import type { RouteQueryParsers } from '@/router/query/useRouteQueryDefaults'
|
|
4
|
+
import { routeStatus } from '@/router/query/routeQuery'
|
|
5
|
+
import { useRouteQueryDefaults } from '@/router/query/useRouteQueryDefaults'
|
|
6
|
+
|
|
7
|
+
interface Query {
|
|
8
|
+
status?: 'active' | 'suspended'
|
|
9
|
+
team?: string
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const parsers: RouteQueryParsers<Query> = {
|
|
13
|
+
status: routeStatus,
|
|
14
|
+
team: (value) => (typeof value === 'string'
|
|
15
|
+
? value
|
|
16
|
+
: undefined),
|
|
17
|
+
}
|
|
18
|
+
useRouteQueryDefaults(parsers)
|
|
19
|
+
|
|
20
|
+
// @ts-expect-error route mappings must target a declared query field
|
|
21
|
+
useRouteQueryDefaults<Query>({ missing: routeStatus })
|
|
22
|
+
|
|
23
|
+
useRouteQueryDefaults<Query>({
|
|
24
|
+
// @ts-expect-error parser output must match its query field type
|
|
25
|
+
status: (value) => (value === 'pending'
|
|
26
|
+
? 'pending'
|
|
27
|
+
: undefined),
|
|
28
|
+
})
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
// 运行时导航错误与陈旧构建资源的恢复入口:包含错误识别、一次性重载恢复和静态错误页跳转。
|
|
2
|
+
|
|
1
3
|
import type { Router } from 'vue-router'
|
|
2
4
|
|
|
3
5
|
type ErrorRecoveryRouter = Pick<Router, 'currentRoute' | 'push'>
|
|
4
6
|
type StaleAssetRouter = ErrorRecoveryRouter & Pick<Router, 'onError'>
|
|
5
7
|
|
|
8
|
+
// `sessionStorage` 标志:同一次陈旧部署只自动重载一次,再次命中改为走通用运行时错误恢复。
|
|
6
9
|
export const staleAssetRecoveryStorageKey = 'og-admin-stale-asset-recovery'
|
|
7
10
|
|
|
8
11
|
interface StaleAssetRecoveryWindow {
|
|
@@ -32,7 +35,12 @@ function errorMessage(error: unknown): string {
|
|
|
32
35
|
return ''
|
|
33
36
|
}
|
|
34
37
|
|
|
35
|
-
/**
|
|
38
|
+
/**
|
|
39
|
+
* 判定错误是否为 Vite 陈旧构建资源加载失败:缺失的 hash chunk、动态 `import` 模块或 CSS 预加载错误。
|
|
40
|
+
* 用于把部署更新后的静态资源加载失败与一般运行时错误区分开,以便决定是否自动重载。
|
|
41
|
+
* @param error - 任意错误值;非 `Error`/字符串且无字符串 `message` 时视为空消息。
|
|
42
|
+
* @returns 错误文本包含已知资源加载失败片段时返回 `true`。
|
|
43
|
+
*/
|
|
36
44
|
export function isStaleAssetLoadError(error: unknown): boolean {
|
|
37
45
|
const message = errorMessage(error).toLowerCase()
|
|
38
46
|
return [
|
|
@@ -48,7 +56,12 @@ export function isStaleAssetLoadError(error: unknown): boolean {
|
|
|
48
56
|
].some((fragment) => message.includes(fragment))
|
|
49
57
|
}
|
|
50
58
|
|
|
51
|
-
/**
|
|
59
|
+
/**
|
|
60
|
+
* 注册一次性陈旧构建恢复:监听 `vite:preloadError` 与路由 `onError`,首次命中写入会话标志并重载,再次命中转交通用运行时错误恢复。
|
|
61
|
+
* 用于避免同一陈旧部署反复自动重载造成循环;非资源加载错误的路由失败仍交给通用恢复。
|
|
62
|
+
* @param options - 路由实例、浏览器窗口适配对象与通用运行时恢复回调。
|
|
63
|
+
* @returns 包含 `dispose`、`handle` 与 `clear` 的恢复控制器。
|
|
64
|
+
*/
|
|
52
65
|
export function createStaleAssetRecovery(options: StaleAssetRecoveryOptions): {
|
|
53
66
|
dispose: () => void
|
|
54
67
|
handle: (error: unknown) => boolean
|
|
@@ -86,7 +99,12 @@ export function createStaleAssetRecovery(options: StaleAssetRecoveryOptions): {
|
|
|
86
99
|
}
|
|
87
100
|
}
|
|
88
101
|
|
|
89
|
-
/**
|
|
102
|
+
/**
|
|
103
|
+
* 创建单飞的静态 500 路由跳转:并发调用只触发一次 `push`,已在 `/500` 时直接跳过。
|
|
104
|
+
* 用于集中处理未知运行时错误,避免多个失败来源同时重复导航;`push` 被拒绝或抛出时仍复位单飞标志。
|
|
105
|
+
* @param router - 只需提供 `currentRoute` 与 `push` 的路由适配器。
|
|
106
|
+
* @returns 可多次安全调用的恢复函数。
|
|
107
|
+
*/
|
|
90
108
|
export function createRuntimeErrorRecovery(router: ErrorRecoveryRouter): () => void {
|
|
91
109
|
let isRecovering = false
|
|
92
110
|
|