@origen-ui/admin-cli 2.0.2 → 3.0.4
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 +25 -12
- 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 +21 -18
- package/templates/current/clean/.agents/skills/admin-component-usage/SKILL.md +27 -0
- package/templates/current/clean/.agents/skills/admin-component-usage/references/component-directory.md +232 -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 +42 -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 +27 -0
- package/templates/current/clean/.claude/skills/admin-component-usage/references/component-directory.md +232 -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 +42 -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 +30 -0
- package/templates/current/clean/.codebuddy/skills/admin-component-usage/references/component-directory.md +232 -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 +42 -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 +27 -0
- package/templates/current/clean/.cursor/skills/admin-component-usage/references/component-directory.md +232 -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 +42 -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 +28 -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 +27 -0
- package/templates/current/clean/.qoder/skills/admin-component-usage/references/component-directory.md +232 -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 +42 -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 +27 -0
- package/templates/current/clean/.zcode/skills/admin-component-usage/references/component-directory.md +232 -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 +42 -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 +128 -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 +47 -35
- 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 +315 -30
- package/templates/current/clean/scripts/generate-api.ts +290 -85
- package/templates/current/clean/scripts/lib/admin-component-catalog.mjs +514 -0
- package/templates/current/clean/scripts/lib/admin-skill-inventory.mjs +18 -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 +97 -62
- 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 +86 -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 +100 -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 +58 -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 +27 -0
- package/templates/current/examples/.agents/skills/admin-component-usage/references/component-directory.md +232 -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 +42 -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 +27 -0
- package/templates/current/examples/.claude/skills/admin-component-usage/references/component-directory.md +232 -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 +42 -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 +30 -0
- package/templates/current/examples/.codebuddy/skills/admin-component-usage/references/component-directory.md +232 -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 +42 -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 +27 -0
- package/templates/current/examples/.cursor/skills/admin-component-usage/references/component-directory.md +232 -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 +42 -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 +28 -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 +27 -0
- package/templates/current/examples/.qoder/skills/admin-component-usage/references/component-directory.md +232 -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 +42 -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 +27 -0
- package/templates/current/examples/.zcode/skills/admin-component-usage/references/component-directory.md +232 -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 +42 -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 +128 -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 +47 -35
- 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 +315 -30
- package/templates/current/examples/scripts/generate-api.ts +290 -85
- package/templates/current/examples/scripts/lib/admin-component-catalog.mjs +514 -0
- package/templates/current/examples/scripts/lib/admin-skill-inventory.mjs +18 -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 +97 -62
- 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 +86 -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 +100 -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 +58 -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/clean/tsconfig.node.json +0 -9
- 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/examples/tsconfig.node.json +0 -9
- /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
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
import type { OrigenUiMessages } from 'origen-ui'
|
|
2
|
-
import type { OrigenUiLanguageRuntime } from 'origen-ui/language'
|
|
3
|
-
import type { App, Plugin } from 'vue'
|
|
4
|
-
import { createOrigenUiLanguageRuntime } from 'origen-ui/language'
|
|
5
|
-
import { beforeEach, describe, expect, it, vi } from 'vitest'
|
|
6
|
-
|
|
7
|
-
import { createAdminUi } from './createAdminUi'
|
|
8
|
-
|
|
9
|
-
const dependencies = vi.hoisted(() => ({
|
|
10
|
-
createOgDialog: vi.fn<(options?: unknown) => Plugin>(),
|
|
11
|
-
createOgForm: vi.fn<(options?: unknown) => Plugin>(),
|
|
12
|
-
createOgSearch: vi.fn<(options?: unknown) => Plugin>(),
|
|
13
|
-
createOgTable: vi.fn<(options?: unknown) => Plugin>(),
|
|
14
|
-
createOgTabs: vi.fn<(options?: unknown) => Plugin>(),
|
|
15
|
-
permission: vi.fn(() => true),
|
|
16
|
-
}))
|
|
17
|
-
|
|
18
|
-
vi.mock('@origen-ui/dialog/runtime', async (importOriginal) => ({
|
|
19
|
-
...(await importOriginal<typeof import('@origen-ui/dialog/runtime')>()),
|
|
20
|
-
createOgDialog: dependencies.createOgDialog,
|
|
21
|
-
OG_DIALOG_LOCALE_ZH_CN: {},
|
|
22
|
-
OG_DIALOG_LOCALE_EN_US: {},
|
|
23
|
-
OG_DIALOG_LOCALE_ZH_TW: {},
|
|
24
|
-
}))
|
|
25
|
-
vi.mock('@origen-ui/form/runtime', async (importOriginal) => ({
|
|
26
|
-
...(await importOriginal<typeof import('@origen-ui/form/runtime')>()),
|
|
27
|
-
createOgForm: dependencies.createOgForm,
|
|
28
|
-
OG_FORM_LOCALE_ZH_CN: {},
|
|
29
|
-
OG_FORM_LOCALE_EN_US: {},
|
|
30
|
-
OG_FORM_LOCALE_ZH_TW: {},
|
|
31
|
-
}))
|
|
32
|
-
vi.mock('@origen-ui/search/runtime', async (importOriginal) => ({
|
|
33
|
-
...(await importOriginal<typeof import('@origen-ui/search/runtime')>()),
|
|
34
|
-
createOgSearch: dependencies.createOgSearch,
|
|
35
|
-
OG_SEARCH_LOCALE_ZH_CN: {},
|
|
36
|
-
OG_SEARCH_LOCALE_EN_US: {},
|
|
37
|
-
OG_SEARCH_LOCALE_ZH_TW: {},
|
|
38
|
-
}))
|
|
39
|
-
vi.mock('@origen-ui/table/runtime', async (importOriginal) => ({
|
|
40
|
-
...(await importOriginal<typeof import('@origen-ui/table/runtime')>()),
|
|
41
|
-
createOgTable: dependencies.createOgTable,
|
|
42
|
-
OG_TABLE_LOCALE_ZH_CN: {},
|
|
43
|
-
OG_TABLE_LOCALE_EN_US: {},
|
|
44
|
-
OG_TABLE_LOCALE_ZH_TW: {},
|
|
45
|
-
}))
|
|
46
|
-
vi.mock('@origen-ui/tabs/runtime', async (importOriginal) => ({
|
|
47
|
-
...(await importOriginal<typeof import('@origen-ui/tabs/runtime')>()),
|
|
48
|
-
createOgTabs: dependencies.createOgTabs,
|
|
49
|
-
OG_TABS_LOCALE_ZH_CN: {},
|
|
50
|
-
OG_TABS_LOCALE_EN_US: {},
|
|
51
|
-
OG_TABS_LOCALE_ZH_TW: {},
|
|
52
|
-
}))
|
|
53
|
-
vi.mock('./permission', () => ({ permission: { can: dependencies.permission } }))
|
|
54
|
-
|
|
55
|
-
function createPlugin(): Plugin {
|
|
56
|
-
return { install: vi.fn() }
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
beforeEach(() => {
|
|
60
|
-
dependencies.createOgDialog.mockReset()
|
|
61
|
-
dependencies.createOgForm.mockReset()
|
|
62
|
-
dependencies.createOgSearch.mockReset()
|
|
63
|
-
dependencies.createOgTable.mockReset()
|
|
64
|
-
dependencies.createOgTabs.mockReset()
|
|
65
|
-
dependencies.createOgDialog.mockImplementation(() => createPlugin())
|
|
66
|
-
dependencies.createOgForm.mockImplementation(() => createPlugin())
|
|
67
|
-
dependencies.createOgSearch.mockImplementation(() => createPlugin())
|
|
68
|
-
dependencies.createOgTable.mockImplementation(() => createPlugin())
|
|
69
|
-
dependencies.createOgTabs.mockImplementation(() => createPlugin())
|
|
70
|
-
})
|
|
71
|
-
|
|
72
|
-
describe('createAdminUi', () => {
|
|
73
|
-
it('installs the configured dialog, form, search, table, and tabs runtimes', () => {
|
|
74
|
-
const plugin = createAdminUi()
|
|
75
|
-
const app = { use: vi.fn() } as unknown as App
|
|
76
|
-
|
|
77
|
-
plugin.install?.(app)
|
|
78
|
-
|
|
79
|
-
expect(dependencies.createOgDialog).toHaveBeenCalledOnce()
|
|
80
|
-
expect(dependencies.createOgForm).toHaveBeenCalledWith(
|
|
81
|
-
expect.objectContaining({
|
|
82
|
-
permissions: { has: dependencies.permission },
|
|
83
|
-
size: 'default',
|
|
84
|
-
}),
|
|
85
|
-
)
|
|
86
|
-
expect(dependencies.createOgSearch).toHaveBeenCalledWith(
|
|
87
|
-
expect.objectContaining({
|
|
88
|
-
permissions: { has: dependencies.permission },
|
|
89
|
-
size: 'default',
|
|
90
|
-
}),
|
|
91
|
-
)
|
|
92
|
-
expect(dependencies.createOgTable).toHaveBeenCalledWith(
|
|
93
|
-
expect.objectContaining({
|
|
94
|
-
config: expect.objectContaining({
|
|
95
|
-
permissions: { has: dependencies.permission },
|
|
96
|
-
}),
|
|
97
|
-
}),
|
|
98
|
-
)
|
|
99
|
-
expect(dependencies.createOgTabs).toHaveBeenCalledOnce()
|
|
100
|
-
expect(app.use).toHaveBeenCalledWith(dependencies.createOgDialog.mock.results[0]?.value)
|
|
101
|
-
expect(app.use).toHaveBeenCalledWith(dependencies.createOgForm.mock.results[0]?.value)
|
|
102
|
-
expect(app.use).toHaveBeenCalledWith(dependencies.createOgSearch.mock.results[0]?.value)
|
|
103
|
-
expect(app.use).toHaveBeenCalledWith(dependencies.createOgTable.mock.results[0]?.value)
|
|
104
|
-
expect(app.use).toHaveBeenCalledWith(dependencies.createOgTabs.mock.results[0]?.value)
|
|
105
|
-
})
|
|
106
|
-
|
|
107
|
-
it('never installs a static full locale bundle that could shadow language switches', () => {
|
|
108
|
-
const language = createOrigenUiLanguageRuntime<
|
|
109
|
-
Record<string, unknown>,
|
|
110
|
-
unknown,
|
|
111
|
-
OrigenUiMessages
|
|
112
|
-
>()
|
|
113
|
-
createAdminUi(language)
|
|
114
|
-
|
|
115
|
-
const dialogOptions = dependencies.createOgDialog.mock.calls[0]?.[0] as {
|
|
116
|
-
locale?: unknown
|
|
117
|
-
localeSource?: { value?: { confirmText?: string } }
|
|
118
|
-
}
|
|
119
|
-
expect(dialogOptions.locale).toBeUndefined()
|
|
120
|
-
expect(dialogOptions.localeSource).toBeDefined()
|
|
121
|
-
})
|
|
122
|
-
|
|
123
|
-
it('lets component copy follow the language runtime after a switch', async () => {
|
|
124
|
-
const language: OrigenUiLanguageRuntime<
|
|
125
|
-
Record<string, unknown>,
|
|
126
|
-
unknown,
|
|
127
|
-
OrigenUiMessages
|
|
128
|
-
> = createOrigenUiLanguageRuntime({
|
|
129
|
-
initial: 'zh-CN',
|
|
130
|
-
loaders: {
|
|
131
|
-
'zh-CN': async () => {
|
|
132
|
-
const [{ default: messages }, { elementPlus, origenUi }] = await Promise.all([
|
|
133
|
-
import('../locales/zh-CN.json'),
|
|
134
|
-
import('../locales/zh-CN.runtime'),
|
|
135
|
-
])
|
|
136
|
-
return { locale: 'zh-CN', messages, elementPlus, origenUi }
|
|
137
|
-
},
|
|
138
|
-
'en-US': async () => {
|
|
139
|
-
const [{ default: messages }, { elementPlus, origenUi }] = await Promise.all([
|
|
140
|
-
import('../locales/en-US.json'),
|
|
141
|
-
import('../locales/en-US.runtime'),
|
|
142
|
-
])
|
|
143
|
-
return { locale: 'en-US', messages, elementPlus, origenUi }
|
|
144
|
-
},
|
|
145
|
-
},
|
|
146
|
-
})
|
|
147
|
-
await language.ready
|
|
148
|
-
|
|
149
|
-
createAdminUi(language)
|
|
150
|
-
|
|
151
|
-
const dialogOptions = dependencies.createOgDialog.mock.calls[0]?.[0] as {
|
|
152
|
-
localeSource?: { value?: { confirmText?: string } }
|
|
153
|
-
}
|
|
154
|
-
const tableOptions = dependencies.createOgTable.mock.calls[0]?.[0] as {
|
|
155
|
-
localeSource?: { value?: { refresh?: string } }
|
|
156
|
-
}
|
|
157
|
-
expect(dialogOptions.localeSource?.value?.confirmText).toBe('确定')
|
|
158
|
-
expect(tableOptions.localeSource?.value?.refresh).toBe('刷新')
|
|
159
|
-
expect(language.current.value).toBe('zh-CN')
|
|
160
|
-
|
|
161
|
-
await language.setLocale('en-US')
|
|
162
|
-
|
|
163
|
-
expect(dialogOptions.localeSource?.value?.confirmText).toBe('Confirm')
|
|
164
|
-
expect(tableOptions.localeSource?.value?.refresh).toBe('Refresh')
|
|
165
|
-
})
|
|
166
|
-
})
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import type { OrigenUiMessages } from 'origen-ui'
|
|
2
|
-
import type { OrigenUiLanguageRuntime } from 'origen-ui/language'
|
|
3
|
-
import type { App, Plugin } from 'vue'
|
|
4
|
-
import { createOgDialog } from '@origen-ui/dialog/runtime'
|
|
5
|
-
import { createOgForm } from '@origen-ui/form/runtime'
|
|
6
|
-
import { createOgSearch } from '@origen-ui/search/runtime'
|
|
7
|
-
import { createOgTable } from '@origen-ui/table/runtime'
|
|
8
|
-
import { createOgTabs } from '@origen-ui/tabs/runtime'
|
|
9
|
-
import { computed } from 'vue'
|
|
10
|
-
import { permission } from './permission'
|
|
11
|
-
import { appRuntimeConfig } from './runtimeConfig'
|
|
12
|
-
|
|
13
|
-
/** Installs only the UI runtimes used by the Admin application. */
|
|
14
|
-
export function createAdminUi(
|
|
15
|
-
language?: OrigenUiLanguageRuntime<Record<string, unknown>, unknown, OrigenUiMessages>,
|
|
16
|
-
): Plugin {
|
|
17
|
-
const origenUi = appRuntimeConfig.origenUi
|
|
18
|
-
const locale = language?.origenUi
|
|
19
|
-
// Component copy follows the reactive language runtime; static configuration
|
|
20
|
-
// may only carry explicit overrides, never a full locale bundle, or the
|
|
21
|
-
// bundle would shadow every later language switch.
|
|
22
|
-
const dialog = createOgDialog({
|
|
23
|
-
...origenUi.dialog,
|
|
24
|
-
...(locale ? { localeSource: computed(() => locale.value?.dialog) } : {}),
|
|
25
|
-
} as Parameters<typeof createOgDialog>[0])
|
|
26
|
-
const form = createOgForm({
|
|
27
|
-
...origenUi.form,
|
|
28
|
-
...(locale ? { localeSource: computed(() => locale.value?.form) } : {}),
|
|
29
|
-
permissions: origenUi.form.permissions ?? { has: permission.can },
|
|
30
|
-
size: origenUi.form.size ?? origenUi.size,
|
|
31
|
-
} as Parameters<typeof createOgForm>[0])
|
|
32
|
-
const table = createOgTable({
|
|
33
|
-
...origenUi.table,
|
|
34
|
-
config: {
|
|
35
|
-
...origenUi.table.config,
|
|
36
|
-
permissions: {
|
|
37
|
-
has: permission.can,
|
|
38
|
-
...origenUi.table.config?.permissions,
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
...(locale ? { localeSource: computed(() => locale.value?.table) } : {}),
|
|
42
|
-
} as Parameters<typeof createOgTable>[0])
|
|
43
|
-
const search = createOgSearch({
|
|
44
|
-
...origenUi.search,
|
|
45
|
-
...(locale ? { localeSource: computed(() => locale.value?.search) } : {}),
|
|
46
|
-
permissions: origenUi.search.permissions ?? { has: permission.can },
|
|
47
|
-
size: origenUi.search.size ?? origenUi.size,
|
|
48
|
-
} as Parameters<typeof createOgSearch>[0])
|
|
49
|
-
const tabs = createOgTabs({
|
|
50
|
-
...origenUi.tabs,
|
|
51
|
-
...(locale ? { localeSource: computed(() => locale.value?.tabs) } : {}),
|
|
52
|
-
} as Parameters<typeof createOgTabs>[0])
|
|
53
|
-
|
|
54
|
-
return {
|
|
55
|
-
install(app: App): void {
|
|
56
|
-
app.use(dialog)
|
|
57
|
-
app.use(form)
|
|
58
|
-
app.use(search)
|
|
59
|
-
app.use(table)
|
|
60
|
-
app.use(tabs)
|
|
61
|
-
},
|
|
62
|
-
}
|
|
63
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
// @vitest-environment jsdom
|
|
2
|
-
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
|
|
3
|
-
|
|
4
|
-
async function loadEmbeddedModule(): Promise<typeof import('./embedded')> {
|
|
5
|
-
vi.resetModules()
|
|
6
|
-
return await import('./embedded')
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
describe('embedded token bridge', () => {
|
|
10
|
-
beforeEach(() => {
|
|
11
|
-
vi.stubEnv('VITE_EMBEDDED', 'true')
|
|
12
|
-
;(window as { __MICRO_APP_ENVIRONMENT__?: boolean }).__MICRO_APP_ENVIRONMENT__ = true
|
|
13
|
-
localStorage.clear()
|
|
14
|
-
})
|
|
15
|
-
|
|
16
|
-
afterEach(() => {
|
|
17
|
-
vi.unstubAllEnvs()
|
|
18
|
-
vi.resetModules()
|
|
19
|
-
localStorage.clear()
|
|
20
|
-
delete (window as { __MICRO_APP_ENVIRONMENT__?: boolean }).__MICRO_APP_ENVIRONMENT__
|
|
21
|
-
delete (window as { microApp?: unknown }).microApp
|
|
22
|
-
})
|
|
23
|
-
|
|
24
|
-
it('keeps host tokens in memory and exposes read-only storage', async () => {
|
|
25
|
-
const mod = await loadEmbeddedModule()
|
|
26
|
-
const storage = mod.embeddedTokenStorage
|
|
27
|
-
storage.setItem('token', 'attacker-token')
|
|
28
|
-
expect(storage.getItem('token')).toBeNull()
|
|
29
|
-
mod.startEmbeddedBridge()
|
|
30
|
-
expect(localStorage.length).toBe(0)
|
|
31
|
-
})
|
|
32
|
-
|
|
33
|
-
it('updates the in-memory token from host data without writing localStorage', async () => {
|
|
34
|
-
const mod = await loadEmbeddedModule()
|
|
35
|
-
;(window as { microApp?: unknown }).microApp = { getData: () => ({ token: 'host-token' }) }
|
|
36
|
-
mod.startEmbeddedBridge()
|
|
37
|
-
expect(mod.embeddedTokenStorage.getItem('og-admin-access-token')).toBe('host-token')
|
|
38
|
-
expect(localStorage.length).toBe(0)
|
|
39
|
-
})
|
|
40
|
-
})
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
import type { BackendMenuNode } from './menuTypes'
|
|
2
|
-
// @vitest-environment jsdom
|
|
3
|
-
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
|
|
4
|
-
|
|
5
|
-
// embedded.ts 在模块加载时做嵌入探测(env 意图 + 运行时环境),
|
|
6
|
-
// 每个用例重置模块注册表并在 import 前布置好探测条件。
|
|
7
|
-
async function loadEmbeddedModule(): Promise<typeof import('./embedded')> {
|
|
8
|
-
vi.resetModules()
|
|
9
|
-
return await import('./embedded')
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
// fetchMenus 实际返回扁平列表(父子靠 parentPath 关联),夹具同构;
|
|
13
|
-
// order 升序排序:system(1) 应排在 dashboard(2) 之前
|
|
14
|
-
const menuNodes: BackendMenuNode[] = [
|
|
15
|
-
{ code: 'dashboard', path: '/dashboard', title: '工作台', icon: 'Odometer', order: 2 },
|
|
16
|
-
{ code: 'system', path: '/system', title: '系统管理', order: 1 },
|
|
17
|
-
{ code: 'users', path: 'users', title: '用户管理', parentPath: '/system', order: 1 },
|
|
18
|
-
{ code: 'audit', path: 'audit', title: '审计日志', parentPath: '/system', menu: false },
|
|
19
|
-
{ code: 'profile', path: 'profile', title: '个人页' },
|
|
20
|
-
{ code: 'secret', path: '/secret', title: '隐藏页', hidden: true },
|
|
21
|
-
]
|
|
22
|
-
|
|
23
|
-
beforeEach(() => {
|
|
24
|
-
vi.stubEnv('VITE_EMBEDDED', 'true')
|
|
25
|
-
})
|
|
26
|
-
|
|
27
|
-
afterEach(() => {
|
|
28
|
-
vi.unstubAllEnvs()
|
|
29
|
-
vi.resetModules()
|
|
30
|
-
document.documentElement.classList.remove('dark')
|
|
31
|
-
delete (window as { __MICRO_APP_ENVIRONMENT__?: boolean }).__MICRO_APP_ENVIRONMENT__
|
|
32
|
-
delete (window as { __POWERED_BY_WUJIE__?: boolean }).__POWERED_BY_WUJIE__
|
|
33
|
-
delete (window as { microApp?: unknown }).microApp
|
|
34
|
-
delete (window as { $wujie?: unknown }).$wujie
|
|
35
|
-
})
|
|
36
|
-
|
|
37
|
-
describe('reportMenusToHost', () => {
|
|
38
|
-
it('运行时未探测到主壳环境时回退独立模式,上报 no-op', async () => {
|
|
39
|
-
const mod = await loadEmbeddedModule()
|
|
40
|
-
expect(mod.embeddedMode).toBe(false)
|
|
41
|
-
const dispatch = vi.fn()
|
|
42
|
-
;(window as { microApp?: unknown }).microApp = { dispatch }
|
|
43
|
-
mod.reportMenusToHost(menuNodes)
|
|
44
|
-
expect(dispatch).not.toHaveBeenCalled()
|
|
45
|
-
})
|
|
46
|
-
|
|
47
|
-
it('micro-app 通道:过滤隐藏/非菜单节点,parentPath 链解析为绝对路由并重建两层', async () => {
|
|
48
|
-
;(window as { __MICRO_APP_ENVIRONMENT__?: boolean }).__MICRO_APP_ENVIRONMENT__ = true
|
|
49
|
-
const mod = await loadEmbeddedModule()
|
|
50
|
-
expect(mod.embeddedMode).toBe(true)
|
|
51
|
-
|
|
52
|
-
const dispatch = vi.fn()
|
|
53
|
-
;(window as { microApp?: unknown }).microApp = { dispatch }
|
|
54
|
-
mod.reportMenusToHost(menuNodes)
|
|
55
|
-
|
|
56
|
-
expect(dispatch).toHaveBeenCalledTimes(1)
|
|
57
|
-
expect(dispatch).toHaveBeenCalledWith({
|
|
58
|
-
event: 'sub-app-menu',
|
|
59
|
-
payload: {
|
|
60
|
-
menus: [
|
|
61
|
-
{
|
|
62
|
-
id: 'system',
|
|
63
|
-
title: '系统管理',
|
|
64
|
-
microRoute: '/system',
|
|
65
|
-
children: [{ id: 'users', title: '用户管理', microRoute: '/system/users' }],
|
|
66
|
-
},
|
|
67
|
-
{ id: 'dashboard', title: '工作台', microRoute: '/dashboard', icon: 'Odometer' },
|
|
68
|
-
{ id: 'profile', title: '个人页', microRoute: '/profile' },
|
|
69
|
-
],
|
|
70
|
-
},
|
|
71
|
-
})
|
|
72
|
-
})
|
|
73
|
-
|
|
74
|
-
it('applyHostTheme:light/dark 切换 html.dark;非法值忽略', async () => {
|
|
75
|
-
;(window as { __MICRO_APP_ENVIRONMENT__?: boolean }).__MICRO_APP_ENVIRONMENT__ = true
|
|
76
|
-
const mod = await loadEmbeddedModule()
|
|
77
|
-
|
|
78
|
-
mod.applyHostTheme({ theme: 'dark' })
|
|
79
|
-
expect(document.documentElement.classList.contains('dark')).toBe(true)
|
|
80
|
-
mod.applyHostTheme({ theme: 'light' })
|
|
81
|
-
expect(document.documentElement.classList.contains('dark')).toBe(false)
|
|
82
|
-
mod.applyHostTheme({ theme: 'blue' })
|
|
83
|
-
mod.applyHostTheme({})
|
|
84
|
-
expect(document.documentElement.classList.contains('dark')).toBe(false)
|
|
85
|
-
})
|
|
86
|
-
|
|
87
|
-
it('reportMenusToHost:父节点相对 path 也能解析绝对子路由并挂载子项', async () => {
|
|
88
|
-
;(window as { __MICRO_APP_ENVIRONMENT__?: boolean }).__MICRO_APP_ENVIRONMENT__ = true
|
|
89
|
-
const dispatch = vi.fn()
|
|
90
|
-
;(window as { microApp?: unknown }).microApp = { dispatch }
|
|
91
|
-
const mod = await loadEmbeddedModule()
|
|
92
|
-
|
|
93
|
-
mod.reportMenusToHost([
|
|
94
|
-
{ code: 'system', path: 'system', title: '系统管理' },
|
|
95
|
-
{ code: 'users', path: 'users', title: '用户管理', parentPath: '/system' },
|
|
96
|
-
])
|
|
97
|
-
|
|
98
|
-
expect(dispatch).toHaveBeenCalledWith({
|
|
99
|
-
event: 'sub-app-menu',
|
|
100
|
-
payload: {
|
|
101
|
-
menus: [
|
|
102
|
-
{
|
|
103
|
-
id: 'system',
|
|
104
|
-
title: '系统管理',
|
|
105
|
-
microRoute: '/system',
|
|
106
|
-
children: [{ id: 'users', title: '用户管理', microRoute: '/system/users' }],
|
|
107
|
-
},
|
|
108
|
-
],
|
|
109
|
-
},
|
|
110
|
-
})
|
|
111
|
-
})
|
|
112
|
-
|
|
113
|
-
it('wujie 通道:$emit 消息为 { event, payload } 包裹,与主壳 onBusEvent 解析同构', async () => {
|
|
114
|
-
;(window as { __POWERED_BY_WUJIE__?: boolean }).__POWERED_BY_WUJIE__ = true
|
|
115
|
-
const mod = await loadEmbeddedModule()
|
|
116
|
-
expect(mod.embeddedMode).toBe(true)
|
|
117
|
-
|
|
118
|
-
const $emit = vi.fn()
|
|
119
|
-
;(window as { $wujie?: unknown }).$wujie = { bus: { $emit, $on: vi.fn(), $off: vi.fn() } }
|
|
120
|
-
|
|
121
|
-
mod.reportMenusToHost([{ code: 'home', path: 'home', title: '首页' }])
|
|
122
|
-
expect($emit).toHaveBeenCalledWith('sub-app-menu', {
|
|
123
|
-
event: 'sub-app-menu',
|
|
124
|
-
payload: { menus: [{ id: 'home', title: '首页', microRoute: '/home' }] },
|
|
125
|
-
})
|
|
126
|
-
|
|
127
|
-
// 401 通知同走统一出口
|
|
128
|
-
;($emit as ReturnType<typeof vi.fn>).mockClear()
|
|
129
|
-
mod.notifyHostUnauthorized()
|
|
130
|
-
expect($emit).toHaveBeenCalledWith('sub-app-error', {
|
|
131
|
-
event: 'sub-app-error',
|
|
132
|
-
payload: { code: 'unauthorized' },
|
|
133
|
-
})
|
|
134
|
-
})
|
|
135
|
-
})
|
|
@@ -1,255 +0,0 @@
|
|
|
1
|
-
import type { BackendMenuNode } from './menuTypes'
|
|
2
|
-
|
|
3
|
-
// 微前端嵌入模式(architecture.md M4 §5):
|
|
4
|
-
// VITE_EMBEDDED=true 表达嵌入意图;运行时必须探测到主壳注入的环境,
|
|
5
|
-
// 否则回退独立模式并告警——防止误配置导致应用在无主壳时丢失自身外壳。
|
|
6
|
-
// 双框架桥:wujie(props 一次性 + bus 事件)与 micro-app(data 通道)。
|
|
7
|
-
|
|
8
|
-
const wantsEmbedded = import.meta.env.VITE_EMBEDDED === 'true'
|
|
9
|
-
|
|
10
|
-
/** Embedded token storage is intentionally volatile and read-only to consumers. */
|
|
11
|
-
let embeddedAccessToken: string | null = null
|
|
12
|
-
export const embeddedTokenStorage = {
|
|
13
|
-
getItem: (_key: string): string | null => embeddedAccessToken,
|
|
14
|
-
setItem: (_key: string, _value: string): void => undefined,
|
|
15
|
-
removeItem: (_key: string): void => {
|
|
16
|
-
embeddedAccessToken = null
|
|
17
|
-
},
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export type HostFramework = 'wujie' | 'micro-app'
|
|
21
|
-
|
|
22
|
-
interface WujieChildApi {
|
|
23
|
-
props?: Record<string, unknown>
|
|
24
|
-
bus?: {
|
|
25
|
-
$emit: (event: string, ...args: unknown[]) => void
|
|
26
|
-
$on: (event: string, callback: (...args: unknown[]) => void) => void
|
|
27
|
-
$off: (event: string, callback: (...args: unknown[]) => void) => void
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
interface MicroAppChildApi {
|
|
32
|
-
getData?: () => Record<string, unknown>
|
|
33
|
-
addDataListener?: (
|
|
34
|
-
callback: (data: Record<string, unknown>) => void,
|
|
35
|
-
autoTrigger?: boolean,
|
|
36
|
-
) => void
|
|
37
|
-
dispatch?: (data: Record<string, unknown>) => void
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
declare global {
|
|
41
|
-
interface Window {
|
|
42
|
-
__POWERED_BY_WUJIE__?: boolean
|
|
43
|
-
__MICRO_APP_ENVIRONMENT__?: boolean
|
|
44
|
-
__MICRO_APP_NAME__?: string
|
|
45
|
-
$wujie?: WujieChildApi
|
|
46
|
-
microApp?: MicroAppChildApi
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
function detectHostFramework(): HostFramework | null {
|
|
51
|
-
if (typeof window === 'undefined') return null
|
|
52
|
-
if (window.__POWERED_BY_WUJIE__) return 'wujie'
|
|
53
|
-
if (window.__MICRO_APP_ENVIRONMENT__ === true || window.__MICRO_APP_NAME__ !== undefined) {
|
|
54
|
-
return 'micro-app'
|
|
55
|
-
}
|
|
56
|
-
return null
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
const detected = detectHostFramework()
|
|
60
|
-
export const hostFramework: HostFramework | null = wantsEmbedded ? detected : null
|
|
61
|
-
export const embeddedMode = hostFramework !== null
|
|
62
|
-
|
|
63
|
-
if (wantsEmbedded && detected === null) {
|
|
64
|
-
console.warn('[admin] VITE_EMBEDDED=true 但未检测到主壳注入环境,已回退独立模式')
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
function wujieProps(): Record<string, unknown> {
|
|
68
|
-
return window.$wujie?.props ?? {}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
function microAppData(): Record<string, unknown> {
|
|
72
|
-
return window.microApp?.getData?.() ?? {}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
/** 主壳注入数据快照(wujie 走 props,micro-app 走 data 缓存) */
|
|
76
|
-
export function readHostInjection(): Record<string, unknown> {
|
|
77
|
-
if (!embeddedMode) return {}
|
|
78
|
-
return hostFramework === 'wujie' ? wujieProps() : microAppData()
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
function applyToken(data: Record<string, unknown> | undefined): void {
|
|
82
|
-
const token = data?.token
|
|
83
|
-
if (typeof token === 'string' && token !== '') embeddedAccessToken = token
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* 主壳明暗主题跟随(architecture.md §4.1):与 admin 暗色 token 的
|
|
88
|
-
* :root.dark 约定一致;非法值忽略。嵌入模式下本桥持有 dark class
|
|
89
|
-
* 的所有权(独立模式仍由 admin 自身主题 store 负责,见 App.vue)。
|
|
90
|
-
*/
|
|
91
|
-
export function applyHostTheme(data: Record<string, unknown> | undefined): void {
|
|
92
|
-
const theme = data?.theme
|
|
93
|
-
if (theme !== 'light' && theme !== 'dark') return
|
|
94
|
-
if (typeof document === 'undefined') return
|
|
95
|
-
document.documentElement.classList.toggle('dark', theme === 'dark')
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* 嵌入模式桥接:token 由主壳唯一持有并推送,本应用只写存储
|
|
100
|
-
* (TokenManager 每次请求先读存储);刷新被冻结,401 时通知主壳。
|
|
101
|
-
* 主题由主壳下发:注入时应用一次,micro-app 通道持续监听变更
|
|
102
|
-
* (wujie 的 props 一次性注入,仅支持挂载时初始主题)。
|
|
103
|
-
*/
|
|
104
|
-
export function startEmbeddedBridge(): void {
|
|
105
|
-
if (!embeddedMode) return
|
|
106
|
-
applyToken(readHostInjection())
|
|
107
|
-
applyHostTheme(readHostInjection())
|
|
108
|
-
if (hostFramework === 'micro-app') {
|
|
109
|
-
window.microApp?.addDataListener?.(applyToken, false)
|
|
110
|
-
window.microApp?.addDataListener?.(applyHostTheme, false)
|
|
111
|
-
}
|
|
112
|
-
// wujie 的 props 在 mount 时注入;admin 为单实例嵌入,无会话中途轮换需求
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
/** 嵌入模式通知主壳:认证失效(主壳决定重新登录/刷新) */
|
|
116
|
-
export function notifyHostUnauthorized(): void {
|
|
117
|
-
if (!embeddedMode) return
|
|
118
|
-
dispatchToHost('sub-app-error', { code: 'unauthorized' })
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
/** 子应用→主壳菜单上报单项(主壳契约 SubAppMenuItem 的同构最小集) */
|
|
122
|
-
interface HostMenuItemReport {
|
|
123
|
-
id: string
|
|
124
|
-
title: string
|
|
125
|
-
microRoute: string
|
|
126
|
-
icon?: string
|
|
127
|
-
children?: HostMenuItemReport[]
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
/** 子应用→主壳上报事件(与主壳 SubToHostMessage 白名单同构) */
|
|
131
|
-
type HostBridgeEvent = 'sub-app-error' | 'sub-app-menu'
|
|
132
|
-
|
|
133
|
-
/** 事件统一出口:wujie 走 bus $emit,micro-app 走 dispatch(契约消息结构一致) */
|
|
134
|
-
function dispatchToHost(event: HostBridgeEvent, payload: unknown): void {
|
|
135
|
-
const appId = readHostInjection().appId
|
|
136
|
-
const message = { event, ...(typeof appId === 'string' ? { appId } : {}), payload }
|
|
137
|
-
if (hostFramework === 'wujie') {
|
|
138
|
-
window.$wujie?.bus?.$emit(event, message)
|
|
139
|
-
return
|
|
140
|
-
}
|
|
141
|
-
window.microApp?.dispatch?.(message)
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
// 与 router/dynamicRoutes.ts 的 fullPath 同语义:绝对 path 直用;相对 path
|
|
145
|
-
// 拼接父链前缀,无父链时补 "/" 根前缀。主壳契约要求 microRoute 以 / 开头。
|
|
146
|
-
function resolveMicroRoute(prefix: string, path: string): string {
|
|
147
|
-
const trimmed = path.trim()
|
|
148
|
-
if (trimmed.startsWith('/')) return trimmed
|
|
149
|
-
if (prefix === '') return `/${trimmed}`
|
|
150
|
-
return `${prefix.replace(/\/$/, '')}/${trimmed}`
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
// BackendMenuNode → 上报契约。fetchMenus 返回扁平列表(父子靠 parentPath
|
|
154
|
-
// 关联,树由路由适配层构建),这里重建两层结构(契约上限):
|
|
155
|
-
// 1. 按 parentPath 链解析每个节点的绝对 microRoute(dynamicRoutes.fullPath 同语义);
|
|
156
|
-
// 2. 父节点本身是顶层(目录)时子项挂为其 children,更深的层级拍平到顶层。
|
|
157
|
-
// 隐藏/非菜单节点过滤;保持后端给定顺序,权限过滤已由菜单装载链完成。
|
|
158
|
-
function toMenuReport(nodes: readonly BackendMenuNode[]): HostMenuItemReport[] {
|
|
159
|
-
// order 升序(缺省排后,稳定排序保持原有相对顺序),与 admin 自身菜单一致
|
|
160
|
-
const usable = nodes
|
|
161
|
-
.filter((node) => node.menu !== false && node.hidden !== true)
|
|
162
|
-
.sort((a, b) => (a.order ?? Number.POSITIVE_INFINITY) - (b.order ?? Number.POSITIVE_INFINITY))
|
|
163
|
-
|
|
164
|
-
const byPath = new Map<string, BackendMenuNode[]>()
|
|
165
|
-
for (const node of usable) {
|
|
166
|
-
const path = node.path.trim()
|
|
167
|
-
byPath.set(path, [...(byPath.get(path) ?? []), node])
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
const fullPathMemo = new Map<BackendMenuNode, string>()
|
|
171
|
-
function fullPathOf(node: BackendMenuNode, seen: Set<string>): string | undefined {
|
|
172
|
-
const cached = fullPathMemo.get(node)
|
|
173
|
-
if (cached !== undefined) return cached
|
|
174
|
-
if (seen.has(node.code)) return undefined
|
|
175
|
-
seen.add(node.code)
|
|
176
|
-
const path = node.path.trim()
|
|
177
|
-
if (path === '') return undefined
|
|
178
|
-
let resolved: string
|
|
179
|
-
if (path.startsWith('/')) {
|
|
180
|
-
resolved = path
|
|
181
|
-
} else {
|
|
182
|
-
const parentPath = node.parentPath?.trim()
|
|
183
|
-
const rawCandidates = parentPath ? (byPath.get(parentPath) ?? []) : []
|
|
184
|
-
const canonicalCandidates = parentPath
|
|
185
|
-
? usable.filter((candidate) => fullPathOf(candidate, new Set(seen)) === parentPath)
|
|
186
|
-
: []
|
|
187
|
-
const candidates = [...new Set([...rawCandidates, ...canonicalCandidates])].filter(
|
|
188
|
-
(candidate) => candidate !== node,
|
|
189
|
-
)
|
|
190
|
-
const parent = candidates.length === 1 ? candidates[0] : undefined
|
|
191
|
-
const parentFullPath = parent ? fullPathOf(parent, seen) : undefined
|
|
192
|
-
resolved = parentFullPath === undefined ? `/${path}` : resolveMicroRoute(parentFullPath, path)
|
|
193
|
-
}
|
|
194
|
-
fullPathMemo.set(node, resolved)
|
|
195
|
-
return resolved
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
const itemsByNode = new Map<BackendMenuNode, HostMenuItemReport>()
|
|
199
|
-
for (const node of usable) {
|
|
200
|
-
const microRoute = fullPathOf(node, new Set())
|
|
201
|
-
if (microRoute === undefined) continue
|
|
202
|
-
itemsByNode.set(node, {
|
|
203
|
-
id: node.code,
|
|
204
|
-
title: node.title,
|
|
205
|
-
microRoute,
|
|
206
|
-
...(node.icon !== undefined ? { icon: node.icon } : {}),
|
|
207
|
-
})
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
function parentOf(node: BackendMenuNode): BackendMenuNode | undefined {
|
|
211
|
-
const parentPath = node.parentPath?.trim()
|
|
212
|
-
if (!parentPath) return undefined
|
|
213
|
-
const rawCandidates = byPath.get(parentPath) ?? []
|
|
214
|
-
const canonicalCandidates = usable.filter(
|
|
215
|
-
(candidate) => fullPathMemo.get(candidate) === parentPath,
|
|
216
|
-
)
|
|
217
|
-
const candidates = [...new Set([...rawCandidates, ...canonicalCandidates])].filter(
|
|
218
|
-
(candidate) => candidate !== node,
|
|
219
|
-
)
|
|
220
|
-
return candidates.length === 1 ? candidates[0] : undefined
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
// 父节点自身无可用父级(即目录层)时,子项挂为其 children;
|
|
224
|
-
// 更深的层级拍平到顶层,满足契约两层上限。
|
|
225
|
-
const tops: HostMenuItemReport[] = []
|
|
226
|
-
for (const node of usable) {
|
|
227
|
-
const item = itemsByNode.get(node)
|
|
228
|
-
if (!item) continue
|
|
229
|
-
const parent = parentOf(node)
|
|
230
|
-
const parentItem = parent !== undefined ? itemsByNode.get(parent) : undefined
|
|
231
|
-
const parentIsTopLevel =
|
|
232
|
-
parentItem !== undefined && (parent === undefined || parentOf(parent) === undefined)
|
|
233
|
-
if (parentItem !== undefined && parentIsTopLevel) {
|
|
234
|
-
if (parentItem.children === undefined) parentItem.children = []
|
|
235
|
-
parentItem.children.push(item)
|
|
236
|
-
} else {
|
|
237
|
-
tops.push(item)
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
return tops
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
/**
|
|
244
|
-
* 嵌入模式向主壳上报权限过滤后的菜单树(sub-app-menu 事件,
|
|
245
|
-
* architecture.md §3 过渡聚合源):主壳据此在侧栏渲染应用分组导航。
|
|
246
|
-
* 上报失败只告警,不影响本应用启动与运行;独立模式 no-op。
|
|
247
|
-
*/
|
|
248
|
-
export function reportMenusToHost(nodes: readonly BackendMenuNode[]): void {
|
|
249
|
-
if (!embeddedMode) return
|
|
250
|
-
try {
|
|
251
|
-
dispatchToHost('sub-app-menu', { menus: toMenuReport(nodes) })
|
|
252
|
-
} catch (cause) {
|
|
253
|
-
console.warn('[admin] menu report to host failed (non-blocking)', cause)
|
|
254
|
-
}
|
|
255
|
-
}
|