@origen-ui/admin-cli 2.0.1 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +50 -11
- 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 +28 -17
- package/templates/current/clean/.agents/skills/admin-component-usage/SKILL.md +28 -0
- package/templates/current/clean/.agents/skills/admin-component-usage/references/component-directory.md +270 -0
- package/templates/current/clean/.agents/skills/build-admin-feature/SKILL.md +20 -0
- package/templates/current/clean/.agents/skills/build-admin-feature/references/component-selection.md +38 -0
- package/templates/current/{examples/.codex → clean/.agents}/skills/use-og-form/SKILL.md +1 -1
- package/templates/current/{examples/.codex → clean/.agents}/skills/use-og-form-table/SKILL.md +4 -3
- package/templates/current/clean/{.codex → .agents}/skills/use-og-search/SKILL.md +3 -3
- package/templates/current/clean/.agents/skills/use-og-table/SKILL.md +22 -0
- package/templates/current/{examples/.codex → clean/.agents}/skills/use-og-upload/SKILL.md +6 -5
- package/templates/current/clean/.api-client-e2e.config.ts +13 -0
- package/templates/current/clean/.claude/rules/01-feature-architecture.md +10 -0
- package/templates/current/clean/.claude/rules/02-vue-typescript.md +10 -0
- package/templates/current/clean/.claude/rules/03-component-policy.md +31 -0
- package/templates/current/clean/.claude/rules/04-api-auth-router.md +10 -0
- package/templates/current/clean/.claude/rules/05-style.md +10 -0
- package/templates/current/clean/.claude/rules/06-quality.md +10 -0
- package/templates/current/clean/.claude/skills/admin-component-usage/SKILL.md +28 -0
- package/templates/current/clean/.claude/skills/admin-component-usage/references/component-directory.md +270 -0
- package/templates/current/clean/.claude/skills/build-admin-feature/SKILL.md +20 -0
- package/templates/current/clean/.claude/skills/build-admin-feature/references/component-selection.md +38 -0
- package/templates/current/clean/{.codex → .claude}/skills/use-og-form/SKILL.md +1 -1
- package/templates/current/clean/{.codex → .claude}/skills/use-og-form-table/SKILL.md +4 -3
- package/templates/current/{examples/.codex → clean/.claude}/skills/use-og-search/SKILL.md +3 -3
- package/templates/current/clean/.claude/skills/use-og-table/SKILL.md +22 -0
- package/templates/current/clean/{.codex → .claude}/skills/use-og-upload/SKILL.md +6 -5
- package/templates/current/clean/.codebuddy/rules/01-feature-architecture.md +2 -2
- package/templates/current/clean/.codebuddy/rules/03-component-policy.md +4 -1
- package/templates/current/clean/.codebuddy/skills/admin-component-usage/SKILL.md +31 -0
- package/templates/current/clean/.codebuddy/skills/admin-component-usage/references/component-directory.md +270 -0
- package/templates/current/clean/.codebuddy/skills/build-admin-feature/SKILL.md +11 -5
- package/templates/current/clean/.codebuddy/skills/build-admin-feature/references/component-selection.md +38 -0
- package/templates/current/clean/.codebuddy/skills/use-og-form/SKILL.md +1 -1
- package/templates/current/clean/.codebuddy/skills/use-og-form-table/SKILL.md +4 -3
- package/templates/current/clean/.codebuddy/skills/use-og-search/SKILL.md +3 -3
- package/templates/current/clean/.codebuddy/skills/use-og-table/SKILL.md +16 -10
- package/templates/current/clean/.codebuddy/skills/use-og-upload/SKILL.md +6 -5
- package/templates/current/clean/.codex/AGENTS.md +55 -8
- package/templates/current/clean/.codex/rules/01-feature-architecture.md +2 -2
- package/templates/current/clean/.codex/rules/03-component-policy.md +4 -1
- package/templates/current/clean/.cursor/rules/.generated +5 -0
- package/templates/current/clean/.cursor/rules/01-feature-architecture.mdc +2 -2
- package/templates/current/clean/.cursor/rules/03-component-policy.mdc +4 -1
- package/templates/current/clean/.cursor/skills/admin-component-usage/SKILL.md +28 -0
- package/templates/current/clean/.cursor/skills/admin-component-usage/references/component-directory.md +270 -0
- package/templates/current/clean/.cursor/skills/build-admin-feature/SKILL.md +11 -5
- package/templates/current/clean/.cursor/skills/build-admin-feature/references/component-selection.md +38 -0
- package/templates/current/clean/.cursor/skills/use-og-form/SKILL.md +1 -1
- package/templates/current/clean/.cursor/skills/use-og-form-table/SKILL.md +4 -3
- package/templates/current/clean/.cursor/skills/use-og-search/SKILL.md +3 -3
- package/templates/current/clean/.cursor/skills/use-og-table/SKILL.md +16 -10
- package/templates/current/clean/.cursor/skills/use-og-upload/SKILL.md +6 -5
- package/templates/current/clean/{.env.example → .env.dev} +3 -2
- package/templates/current/clean/.env.mock +4 -0
- package/templates/current/clean/.env.production +5 -0
- package/templates/current/clean/.env.test +4 -0
- package/templates/current/clean/.node-version +1 -0
- package/templates/current/clean/.prettierignore +17 -0
- package/templates/current/clean/.prettierrc +8 -0
- package/templates/current/clean/.qoder/rules/01-feature-architecture.md +3 -4
- package/templates/current/clean/.qoder/rules/02-vue-typescript.md +1 -2
- package/templates/current/clean/.qoder/rules/03-component-policy.md +5 -3
- package/templates/current/clean/.qoder/rules/04-api-auth-router.md +1 -2
- package/templates/current/clean/.qoder/rules/05-style.md +1 -2
- package/templates/current/clean/.qoder/rules/06-quality.md +1 -2
- package/templates/current/clean/.qoder/skills/admin-component-usage/SKILL.md +28 -0
- package/templates/current/clean/.qoder/skills/admin-component-usage/references/component-directory.md +270 -0
- package/templates/current/clean/.qoder/skills/build-admin-feature/SKILL.md +11 -5
- package/templates/current/clean/.qoder/skills/build-admin-feature/references/component-selection.md +38 -0
- package/templates/current/clean/.qoder/skills/use-og-form/SKILL.md +1 -1
- package/templates/current/clean/.qoder/skills/use-og-form-table/SKILL.md +4 -3
- package/templates/current/clean/.qoder/skills/use-og-search/SKILL.md +3 -3
- package/templates/current/clean/.qoder/skills/use-og-table/SKILL.md +16 -10
- package/templates/current/clean/.qoder/skills/use-og-upload/SKILL.md +6 -5
- package/templates/current/clean/.zcode/skills/admin-component-usage/SKILL.md +28 -0
- package/templates/current/clean/.zcode/skills/admin-component-usage/references/component-directory.md +270 -0
- package/templates/current/clean/.zcode/skills/build-admin-feature/SKILL.md +20 -0
- package/templates/current/clean/.zcode/skills/build-admin-feature/references/component-selection.md +38 -0
- package/templates/current/clean/.zcode/skills/style-og-origen-ui/SKILL.md +11 -0
- package/templates/current/clean/.zcode/skills/use-og-dialog/SKILL.md +12 -0
- package/templates/current/clean/.zcode/skills/use-og-editor/SKILL.md +25 -0
- package/templates/current/clean/.zcode/skills/use-og-form/SKILL.md +12 -0
- package/templates/current/clean/.zcode/skills/use-og-form-table/SKILL.md +26 -0
- package/templates/current/clean/.zcode/skills/use-og-http/SKILL.md +13 -0
- package/templates/current/clean/.zcode/skills/use-og-router-tabs/SKILL.md +11 -0
- package/templates/current/clean/.zcode/skills/use-og-search/SKILL.md +14 -0
- package/templates/current/clean/.zcode/skills/use-og-table/SKILL.md +22 -0
- package/templates/current/clean/.zcode/skills/use-og-upload/SKILL.md +26 -0
- package/templates/current/clean/AGENTS.md +55 -9
- package/templates/current/clean/CHANGELOG.md +129 -0
- package/templates/current/clean/CLAUDE.md +3 -0
- package/templates/current/clean/README.md +58 -87
- 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 +51 -39
- 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 +34 -0
- 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 +316 -18
- package/templates/current/clean/scripts/generate-api.ts +290 -85
- package/templates/current/clean/scripts/lib/admin-component-catalog.mjs +515 -0
- package/templates/current/clean/scripts/lib/repository-root.mjs +9 -0
- package/templates/current/clean/scripts/mock-api.ts +1356 -0
- package/templates/current/clean/scripts/remove-examples.mjs +10 -35
- package/templates/current/clean/src/App.vue +9 -18
- package/templates/current/clean/src/api/generated/data-contracts.ts +23 -265
- package/templates/current/clean/src/api/generated/http-client.ts +351 -180
- package/templates/current/clean/src/api/generated/index.ts +22 -0
- package/templates/current/clean/src/api/generated/services/auth.ts +123 -0
- package/templates/current/clean/src/api/generated/services/common/files.ts +111 -0
- package/templates/current/clean/src/api/generated/services/monitor/cache.ts +164 -0
- package/templates/current/clean/src/api/generated/services/monitor/job.ts +195 -0
- package/templates/current/clean/src/api/generated/services/monitor/jobLog.ts +126 -0
- package/templates/current/clean/src/api/generated/services/monitor/logininfor.ts +126 -0
- package/templates/current/clean/src/api/generated/services/monitor/online.ts +66 -0
- package/templates/current/clean/src/api/generated/services/monitor/operlog.ts +106 -0
- package/templates/current/clean/src/api/generated/services/monitor/server.ts +41 -0
- package/templates/current/clean/src/api/generated/services/system/configs.ts +190 -0
- package/templates/current/clean/src/api/generated/services/system/departments.ts +173 -0
- package/templates/current/clean/src/api/generated/services/system/dictionaries/data.ts +169 -0
- package/templates/current/clean/src/api/generated/services/system/dictionaries/types.ts +187 -0
- package/templates/current/clean/src/api/generated/services/system/index.ts +158 -0
- package/templates/current/clean/src/api/generated/services/system/menus.ts +193 -0
- package/templates/current/clean/src/api/generated/services/system/notices.ts +221 -0
- package/templates/current/clean/src/api/generated/services/system/posts.ts +168 -0
- package/templates/current/clean/src/api/generated/services/system/roles.ts +354 -0
- package/templates/current/clean/src/api/generated/services/system/users.ts +425 -0
- package/templates/current/clean/src/api/generated/services/tool/code-generator.ts +304 -0
- package/templates/current/clean/src/api/generated/types/auth.types.ts +132 -0
- package/templates/current/clean/src/api/generated/types/common/files.types.ts +57 -0
- package/templates/current/clean/src/api/generated/types/common.ts +174 -0
- package/templates/current/clean/src/api/generated/types/enum-dict.ts +94 -0
- package/templates/current/clean/src/api/generated/types/enums.ts +155 -0
- package/templates/current/clean/src/api/generated/types/monitor/cache.types.ts +149 -0
- package/templates/current/clean/src/api/generated/types/monitor/job.types.ts +207 -0
- package/templates/current/clean/src/api/generated/types/monitor/jobLog.types.ts +134 -0
- package/templates/current/clean/src/api/generated/types/monitor/logininfor.types.ts +135 -0
- package/templates/current/clean/src/api/generated/types/monitor/online.types.ts +80 -0
- package/templates/current/clean/src/api/generated/types/monitor/operlog.types.ts +126 -0
- package/templates/current/clean/src/api/generated/types/monitor/server.types.ts +205 -0
- package/templates/current/clean/src/api/generated/types/system/configs.types.ts +200 -0
- package/templates/current/clean/src/api/generated/types/system/departments.types.ts +145 -0
- package/templates/current/clean/src/api/generated/types/system/dictionaries/data.types.ts +210 -0
- package/templates/current/clean/src/api/generated/types/system/dictionaries/types.types.ts +221 -0
- package/templates/current/clean/src/api/generated/types/system/index.types.ts +19 -0
- package/templates/current/clean/src/api/generated/types/system/menus.types.ts +234 -0
- package/templates/current/clean/src/api/generated/types/system/notices.types.ts +270 -0
- package/templates/current/clean/src/api/generated/types/system/posts.types.ts +198 -0
- package/templates/current/clean/src/api/generated/types/system/roles.types.ts +410 -0
- package/templates/current/clean/src/api/generated/types/system/users.types.ts +413 -0
- package/templates/current/clean/src/api/generated/types/tool/code-generator.types.ts +388 -0
- package/templates/current/clean/src/api/index.ts +44 -39
- package/templates/current/clean/src/app/__tests__/api-generated.types.ts +24 -0
- package/templates/current/clean/src/app/api.ts +6 -0
- package/templates/current/clean/src/app/authorization/permission.ts +9 -0
- package/templates/current/{examples/src/app → clean/src/app/config}/runtimeConfig.ts +44 -12
- package/templates/current/clean/src/app/errors/errorMessage.ts +80 -0
- package/templates/current/clean/src/app/http/client.ts +141 -0
- package/templates/current/clean/src/app/http/http-adapter.ts +71 -0
- package/templates/current/{examples/src/app → clean/src/app/i18n}/adminLocale.ts +25 -19
- package/templates/current/clean/src/app/{localeFormat.ts → i18n/localeFormat.ts} +29 -6
- package/templates/current/clean/src/app/i18n/origenUiLocale.ts +15 -0
- package/templates/current/clean/src/app/menu/menu.ts +175 -0
- package/templates/current/clean/src/app/menu/menuTypes.ts +20 -0
- package/templates/current/clean/src/{features → app}/security/devtoolsProtection.ts +8 -7
- package/templates/current/clean/src/app/ui/createAdminUi.ts +31 -0
- package/templates/current/clean/src/app/ui/iconCatalog.ts +71 -0
- package/templates/current/clean/src/assets/icons/appearance.svg +1 -0
- package/templates/current/clean/src/assets/icons/arrow-right.svg +1 -0
- package/templates/current/clean/src/assets/icons/check.svg +1 -0
- package/templates/current/clean/src/assets/icons/circle-check.svg +1 -0
- package/templates/current/clean/src/assets/icons/default.svg +4 -0
- package/templates/current/clean/src/assets/icons/directory/setting.svg +1 -0
- package/templates/current/clean/src/assets/icons/expand.svg +1 -0
- package/templates/current/clean/src/assets/icons/fold.svg +1 -0
- package/templates/current/clean/src/assets/icons/key.svg +1 -0
- package/templates/current/clean/src/assets/icons/lock.svg +1 -0
- package/templates/current/clean/src/assets/icons/monitor.svg +1 -0
- package/templates/current/clean/src/assets/icons/moon.svg +11 -0
- package/templates/current/clean/src/assets/icons/page/department.svg +1 -0
- package/templates/current/clean/src/assets/icons/page/dictionary.svg +1 -0
- package/templates/current/clean/src/assets/icons/page/menus.svg +1 -0
- package/templates/current/clean/src/assets/icons/page/user.svg +1 -0
- package/templates/current/clean/src/assets/icons/page/users.svg +1 -0
- package/templates/current/clean/src/assets/icons/plus.svg +1 -0
- package/templates/current/clean/src/assets/icons/profile.svg +1 -0
- package/templates/current/clean/src/assets/icons/refresh.svg +1 -0
- package/templates/current/clean/src/assets/icons/roles.svg +1 -0
- package/templates/current/clean/src/assets/icons/search.svg +1 -0
- package/templates/current/clean/src/assets/icons/sunny.svg +1 -0
- package/templates/current/clean/src/assets/icons/system.svg +1 -0
- package/templates/current/clean/src/assets/icons/theme-auto.svg +14 -0
- package/templates/current/clean/src/assets/icons/tune.svg +13 -0
- package/templates/current/clean/src/{features/shell/components → components}/RouteProgress.vue +2 -2
- package/templates/current/{examples/src/features/system/access → clean/src}/composables/useAuthorizationRefresh.ts +6 -1
- package/templates/current/clean/src/composables/useSystemTableSearchVisibility.ts +33 -0
- package/templates/current/clean/src/{features/appearance/composables → composables}/useTheme.ts +1 -1
- package/templates/current/clean/src/env.d.ts +6 -19
- package/templates/current/clean/src/layouts/AdminLayout.vue +7 -9
- package/templates/current/clean/src/{features/shell/components → layouts}/AdminWatermark.vue +2 -2
- package/templates/current/clean/src/layouts/BreadcrumbBar.vue +9 -1
- package/templates/current/clean/src/layouts/SideMenu.vue +7 -15
- package/templates/current/clean/src/{features/appearance/components → layouts}/ThemePanel.vue +39 -11
- package/templates/current/clean/src/layouts/TopBar.vue +60 -28
- package/templates/current/clean/src/layouts/WorkspaceTabs.vue +10 -1
- package/templates/current/clean/src/layouts/topBarMenuSearch.ts +25 -4
- package/templates/current/clean/src/locales/en-US.json +227 -219
- package/templates/current/clean/src/locales/index.ts +72 -32
- package/templates/current/clean/src/locales/messages-types.ts +15 -10
- package/templates/current/clean/src/locales/vue-i18n.d.ts +1 -1
- package/templates/current/clean/src/locales/zh-CN.json +226 -218
- package/templates/current/clean/src/locales/zh-TW.json +222 -214
- package/templates/current/clean/src/main.ts +59 -30
- package/templates/current/clean/src/router/bootstrap.ts +69 -24
- package/templates/current/clean/src/router/dynamic/componentLoader.ts +150 -0
- package/templates/current/clean/src/router/{dynamicMenuRefresh.ts → dynamic/dynamicMenuRefresh.ts} +6 -2
- package/templates/current/clean/src/router/dynamic/dynamicRoutes.ts +247 -0
- package/templates/current/clean/src/router/navigation/guards.ts +12 -0
- package/templates/current/clean/src/router/navigation/paths.ts +28 -0
- package/templates/current/clean/src/router/navigation/staticRoutes.ts +109 -0
- package/templates/current/clean/src/router/{queryEncryption.ts → query/queryEncryption.ts} +29 -12
- package/templates/current/clean/src/router/query/routeQuery.ts +29 -0
- package/templates/current/clean/src/router/{useRouteQueryDefaults.ts → query/useRouteQueryDefaults.ts} +9 -8
- package/templates/current/clean/src/router/query/useRouteQueryDefaults.types.ts +28 -0
- package/templates/current/clean/src/router/{runtimeErrorRecovery.ts → recovery/runtimeErrorRecovery.ts} +21 -3
- package/templates/current/clean/src/{features/auth/store → store}/auth.ts +96 -61
- package/templates/current/clean/src/store/dictionaries.ts +86 -0
- package/templates/current/clean/src/{features/shell/store → store}/sidebar.ts +9 -2
- package/templates/current/{examples/src/features/appearance → clean/src}/store/theme.ts +8 -4
- package/templates/current/clean/src/styles/layout.css +51 -0
- package/templates/current/clean/src/templates/og-form.ts +7 -2
- package/templates/current/clean/src/templates/og-table.ts +88 -20
- package/templates/current/clean/src/templates/router.ts +11 -2
- package/templates/current/clean/src/utils/color-mix.ts +6 -2
- package/templates/current/clean/src/utils/download.ts +11 -0
- package/templates/current/clean/src/utils/permissions.ts +1 -1
- package/templates/current/clean/src/utils/retryableDialog.ts +46 -0
- package/templates/current/clean/src/{features → views}/errors/pages/Forbidden.vue +6 -2
- package/templates/current/clean/src/views/errors/pages/MethodNotAllowed.vue +34 -0
- package/templates/current/clean/src/{features → views}/errors/pages/NotFound.vue +6 -2
- package/templates/current/clean/src/{features → views}/errors/pages/ServerError.vue +6 -2
- package/templates/current/clean/src/{features/auth/pages/Login.vue → views/login/pages/index.vue} +101 -11
- 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 +56 -10
- package/templates/current/clean/tests/unit/router/routeQuery.spec.ts +19 -0
- package/templates/current/clean/{src → tests/unit}/router/runtimeErrorRecovery.spec.ts +11 -6
- package/templates/current/{examples/src → clean/tests/unit}/router/useRouteQueryDefaults.spec.ts +46 -12
- package/templates/current/clean/tests/unit/scripts/mock-api.spec.ts +440 -0
- package/templates/current/clean/{scripts → tests/unit/scripts}/vite-build-policy.spec.ts +35 -6
- package/templates/current/clean/{src/features/auth → tests/unit}/store/auth.spec.ts +68 -15
- package/templates/current/clean/tests/unit/store/dictionaries.spec.ts +106 -0
- package/templates/current/{examples/src → clean/tests/unit}/templates/templates.spec.ts +60 -16
- package/templates/current/clean/{src/utils/__tests__ → tests/unit/utils}/color-mix.spec.ts +1 -1
- package/templates/current/clean/tests/unit/utils/retryableDialog.spec.ts +61 -0
- package/templates/current/{examples/src/features/errors/pages → clean/tests/unit/views/errors}/error-pages.spec.ts +11 -7
- package/templates/current/clean/tests/unit/views/feature-composables.spec.ts +233 -0
- package/templates/current/clean/tests/unit/views/system/access/admin-repository.spec.ts +353 -0
- package/templates/current/clean/tests/unit/views/system/access/rbac.spec.ts +329 -0
- package/templates/current/clean/tests/unit/views/system/dept/departments.spec.ts +104 -0
- package/templates/current/clean/tests/unit/views/system/dict/dictionaries.spec.ts +234 -0
- package/templates/current/clean/tests/unit/views/system/menu/menuDraft.spec.ts +77 -0
- package/templates/current/clean/tests/unit/views/system/menu/useMenuManagement.spec.ts +339 -0
- package/templates/current/clean/tests/unit/views/system/user/searchControl.spec.ts +128 -0
- package/templates/current/clean/tsconfig.json +4 -19
- package/templates/current/clean/vite.build-policy.ts +97 -22
- package/templates/current/clean/vite.config.ts +50 -7
- package/templates/current/examples/.agents/skills/admin-component-usage/SKILL.md +28 -0
- package/templates/current/examples/.agents/skills/admin-component-usage/references/component-directory.md +270 -0
- package/templates/current/examples/.agents/skills/build-admin-feature/SKILL.md +20 -0
- package/templates/current/examples/.agents/skills/build-admin-feature/references/component-selection.md +38 -0
- package/templates/current/examples/.agents/skills/style-og-origen-ui/SKILL.md +11 -0
- package/templates/current/examples/.agents/skills/use-og-dialog/SKILL.md +12 -0
- package/templates/current/examples/.agents/skills/use-og-editor/SKILL.md +25 -0
- package/templates/current/examples/.agents/skills/use-og-form/SKILL.md +12 -0
- package/templates/current/examples/.agents/skills/use-og-form-table/SKILL.md +26 -0
- package/templates/current/examples/.agents/skills/use-og-http/SKILL.md +13 -0
- package/templates/current/examples/.agents/skills/use-og-router-tabs/SKILL.md +11 -0
- package/templates/current/examples/.agents/skills/use-og-search/SKILL.md +14 -0
- package/templates/current/examples/.agents/skills/use-og-table/SKILL.md +22 -0
- package/templates/current/examples/.agents/skills/use-og-upload/SKILL.md +26 -0
- package/templates/current/examples/.api-client-e2e.config.ts +13 -0
- package/templates/current/examples/.claude/rules/01-feature-architecture.md +10 -0
- package/templates/current/examples/.claude/rules/02-vue-typescript.md +10 -0
- package/templates/current/examples/.claude/rules/03-component-policy.md +31 -0
- package/templates/current/examples/.claude/rules/04-api-auth-router.md +10 -0
- package/templates/current/examples/.claude/rules/05-style.md +10 -0
- package/templates/current/examples/.claude/rules/06-quality.md +10 -0
- package/templates/current/examples/.claude/skills/admin-component-usage/SKILL.md +28 -0
- package/templates/current/examples/.claude/skills/admin-component-usage/references/component-directory.md +270 -0
- package/templates/current/examples/.claude/skills/build-admin-feature/SKILL.md +20 -0
- package/templates/current/examples/.claude/skills/build-admin-feature/references/component-selection.md +38 -0
- package/templates/current/examples/.claude/skills/style-og-origen-ui/SKILL.md +11 -0
- package/templates/current/examples/.claude/skills/use-og-dialog/SKILL.md +12 -0
- package/templates/current/examples/.claude/skills/use-og-editor/SKILL.md +25 -0
- package/templates/current/examples/.claude/skills/use-og-form/SKILL.md +12 -0
- package/templates/current/examples/.claude/skills/use-og-form-table/SKILL.md +26 -0
- package/templates/current/examples/.claude/skills/use-og-http/SKILL.md +13 -0
- package/templates/current/examples/.claude/skills/use-og-router-tabs/SKILL.md +11 -0
- package/templates/current/examples/.claude/skills/use-og-search/SKILL.md +14 -0
- package/templates/current/examples/.claude/skills/use-og-table/SKILL.md +22 -0
- package/templates/current/examples/.claude/skills/use-og-upload/SKILL.md +26 -0
- package/templates/current/examples/.codebuddy/rules/01-feature-architecture.md +2 -2
- package/templates/current/examples/.codebuddy/rules/03-component-policy.md +4 -1
- package/templates/current/examples/.codebuddy/skills/admin-component-usage/SKILL.md +31 -0
- package/templates/current/examples/.codebuddy/skills/admin-component-usage/references/component-directory.md +270 -0
- package/templates/current/examples/.codebuddy/skills/build-admin-feature/SKILL.md +11 -5
- package/templates/current/examples/.codebuddy/skills/build-admin-feature/references/component-selection.md +38 -0
- package/templates/current/examples/.codebuddy/skills/use-og-form/SKILL.md +1 -1
- package/templates/current/examples/.codebuddy/skills/use-og-form-table/SKILL.md +4 -3
- package/templates/current/examples/.codebuddy/skills/use-og-search/SKILL.md +3 -3
- package/templates/current/examples/.codebuddy/skills/use-og-table/SKILL.md +16 -10
- package/templates/current/examples/.codebuddy/skills/use-og-upload/SKILL.md +6 -5
- package/templates/current/examples/.codex/AGENTS.md +55 -8
- package/templates/current/examples/.codex/rules/01-feature-architecture.md +2 -2
- package/templates/current/examples/.codex/rules/03-component-policy.md +4 -1
- package/templates/current/examples/.cursor/rules/.generated +5 -0
- package/templates/current/examples/.cursor/rules/01-feature-architecture.mdc +2 -2
- package/templates/current/examples/.cursor/rules/03-component-policy.mdc +4 -1
- package/templates/current/examples/.cursor/skills/admin-component-usage/SKILL.md +28 -0
- package/templates/current/examples/.cursor/skills/admin-component-usage/references/component-directory.md +270 -0
- package/templates/current/examples/.cursor/skills/build-admin-feature/SKILL.md +11 -5
- package/templates/current/examples/.cursor/skills/build-admin-feature/references/component-selection.md +38 -0
- package/templates/current/examples/.cursor/skills/use-og-form/SKILL.md +1 -1
- package/templates/current/examples/.cursor/skills/use-og-form-table/SKILL.md +4 -3
- package/templates/current/examples/.cursor/skills/use-og-search/SKILL.md +3 -3
- package/templates/current/examples/.cursor/skills/use-og-table/SKILL.md +16 -10
- package/templates/current/examples/.cursor/skills/use-og-upload/SKILL.md +6 -5
- package/templates/current/examples/{.env.example → .env.dev} +3 -2
- package/templates/current/examples/.env.mock +4 -0
- package/templates/current/examples/.env.production +5 -0
- package/templates/current/examples/.env.test +4 -0
- package/templates/current/examples/.node-version +1 -0
- package/templates/current/examples/.prettierignore +17 -0
- package/templates/current/examples/.prettierrc +8 -0
- package/templates/current/examples/.qoder/rules/01-feature-architecture.md +3 -4
- package/templates/current/examples/.qoder/rules/02-vue-typescript.md +1 -2
- package/templates/current/examples/.qoder/rules/03-component-policy.md +5 -3
- package/templates/current/examples/.qoder/rules/04-api-auth-router.md +1 -2
- package/templates/current/examples/.qoder/rules/05-style.md +1 -2
- package/templates/current/examples/.qoder/rules/06-quality.md +1 -2
- package/templates/current/examples/.qoder/skills/admin-component-usage/SKILL.md +28 -0
- package/templates/current/examples/.qoder/skills/admin-component-usage/references/component-directory.md +270 -0
- package/templates/current/examples/.qoder/skills/build-admin-feature/SKILL.md +11 -5
- package/templates/current/examples/.qoder/skills/build-admin-feature/references/component-selection.md +38 -0
- package/templates/current/examples/.qoder/skills/use-og-form/SKILL.md +1 -1
- package/templates/current/examples/.qoder/skills/use-og-form-table/SKILL.md +4 -3
- package/templates/current/examples/.qoder/skills/use-og-search/SKILL.md +3 -3
- package/templates/current/examples/.qoder/skills/use-og-table/SKILL.md +16 -10
- package/templates/current/examples/.qoder/skills/use-og-upload/SKILL.md +6 -5
- package/templates/current/examples/.zcode/skills/admin-component-usage/SKILL.md +28 -0
- package/templates/current/examples/.zcode/skills/admin-component-usage/references/component-directory.md +270 -0
- package/templates/current/examples/.zcode/skills/build-admin-feature/SKILL.md +20 -0
- package/templates/current/examples/.zcode/skills/build-admin-feature/references/component-selection.md +38 -0
- package/templates/current/examples/.zcode/skills/style-og-origen-ui/SKILL.md +11 -0
- package/templates/current/examples/.zcode/skills/use-og-dialog/SKILL.md +12 -0
- package/templates/current/examples/.zcode/skills/use-og-editor/SKILL.md +25 -0
- package/templates/current/examples/.zcode/skills/use-og-form/SKILL.md +12 -0
- package/templates/current/examples/.zcode/skills/use-og-form-table/SKILL.md +26 -0
- package/templates/current/examples/.zcode/skills/use-og-http/SKILL.md +13 -0
- package/templates/current/examples/.zcode/skills/use-og-router-tabs/SKILL.md +11 -0
- package/templates/current/examples/.zcode/skills/use-og-search/SKILL.md +14 -0
- package/templates/current/examples/.zcode/skills/use-og-table/SKILL.md +22 -0
- package/templates/current/examples/.zcode/skills/use-og-upload/SKILL.md +26 -0
- package/templates/current/examples/AGENTS.md +55 -9
- package/templates/current/examples/CHANGELOG.md +129 -0
- package/templates/current/examples/CLAUDE.md +3 -0
- package/templates/current/examples/README.md +58 -87
- 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 +51 -39
- 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 +34 -0
- 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 +316 -18
- package/templates/current/examples/scripts/generate-api.ts +290 -85
- package/templates/current/examples/scripts/lib/admin-component-catalog.mjs +515 -0
- package/templates/current/examples/scripts/lib/repository-root.mjs +9 -0
- package/templates/current/examples/scripts/mock-api.ts +1356 -0
- package/templates/current/examples/scripts/remove-examples.mjs +10 -35
- package/templates/current/examples/src/App.vue +9 -18
- package/templates/current/examples/src/api/generated/data-contracts.ts +23 -265
- package/templates/current/examples/src/api/generated/http-client.ts +351 -180
- package/templates/current/examples/src/api/generated/index.ts +22 -0
- package/templates/current/examples/src/api/generated/services/auth.ts +123 -0
- package/templates/current/examples/src/api/generated/services/common/files.ts +111 -0
- package/templates/current/examples/src/api/generated/services/monitor/cache.ts +164 -0
- package/templates/current/examples/src/api/generated/services/monitor/job.ts +195 -0
- package/templates/current/examples/src/api/generated/services/monitor/jobLog.ts +126 -0
- package/templates/current/examples/src/api/generated/services/monitor/logininfor.ts +126 -0
- package/templates/current/examples/src/api/generated/services/monitor/online.ts +66 -0
- package/templates/current/examples/src/api/generated/services/monitor/operlog.ts +106 -0
- package/templates/current/examples/src/api/generated/services/monitor/server.ts +41 -0
- package/templates/current/examples/src/api/generated/services/system/configs.ts +190 -0
- package/templates/current/examples/src/api/generated/services/system/departments.ts +173 -0
- package/templates/current/examples/src/api/generated/services/system/dictionaries/data.ts +169 -0
- package/templates/current/examples/src/api/generated/services/system/dictionaries/types.ts +187 -0
- package/templates/current/examples/src/api/generated/services/system/index.ts +158 -0
- package/templates/current/examples/src/api/generated/services/system/menus.ts +193 -0
- package/templates/current/examples/src/api/generated/services/system/notices.ts +221 -0
- package/templates/current/examples/src/api/generated/services/system/posts.ts +168 -0
- package/templates/current/examples/src/api/generated/services/system/roles.ts +354 -0
- package/templates/current/examples/src/api/generated/services/system/users.ts +425 -0
- package/templates/current/examples/src/api/generated/services/tool/code-generator.ts +304 -0
- package/templates/current/examples/src/api/generated/types/auth.types.ts +132 -0
- package/templates/current/examples/src/api/generated/types/common/files.types.ts +57 -0
- package/templates/current/examples/src/api/generated/types/common.ts +174 -0
- package/templates/current/examples/src/api/generated/types/enum-dict.ts +94 -0
- package/templates/current/examples/src/api/generated/types/enums.ts +155 -0
- package/templates/current/examples/src/api/generated/types/monitor/cache.types.ts +149 -0
- package/templates/current/examples/src/api/generated/types/monitor/job.types.ts +207 -0
- package/templates/current/examples/src/api/generated/types/monitor/jobLog.types.ts +134 -0
- package/templates/current/examples/src/api/generated/types/monitor/logininfor.types.ts +135 -0
- package/templates/current/examples/src/api/generated/types/monitor/online.types.ts +80 -0
- package/templates/current/examples/src/api/generated/types/monitor/operlog.types.ts +126 -0
- package/templates/current/examples/src/api/generated/types/monitor/server.types.ts +205 -0
- package/templates/current/examples/src/api/generated/types/system/configs.types.ts +200 -0
- package/templates/current/examples/src/api/generated/types/system/departments.types.ts +145 -0
- package/templates/current/examples/src/api/generated/types/system/dictionaries/data.types.ts +210 -0
- package/templates/current/examples/src/api/generated/types/system/dictionaries/types.types.ts +221 -0
- package/templates/current/examples/src/api/generated/types/system/index.types.ts +19 -0
- package/templates/current/examples/src/api/generated/types/system/menus.types.ts +234 -0
- package/templates/current/examples/src/api/generated/types/system/notices.types.ts +270 -0
- package/templates/current/examples/src/api/generated/types/system/posts.types.ts +198 -0
- package/templates/current/examples/src/api/generated/types/system/roles.types.ts +410 -0
- package/templates/current/examples/src/api/generated/types/system/users.types.ts +413 -0
- package/templates/current/examples/src/api/generated/types/tool/code-generator.types.ts +388 -0
- package/templates/current/examples/src/api/index.ts +44 -39
- package/templates/current/examples/src/app/__tests__/api-generated.types.ts +24 -0
- package/templates/current/examples/src/app/api.ts +6 -0
- package/templates/current/examples/src/app/authorization/permission.ts +9 -0
- package/templates/current/{clean/src/app → examples/src/app/config}/runtimeConfig.ts +44 -12
- package/templates/current/examples/src/app/errors/errorMessage.ts +80 -0
- package/templates/current/examples/src/app/http/client.ts +141 -0
- package/templates/current/examples/src/app/http/http-adapter.ts +71 -0
- package/templates/current/{clean/src/app → examples/src/app/i18n}/adminLocale.ts +25 -19
- package/templates/current/examples/src/app/{localeFormat.ts → i18n/localeFormat.ts} +29 -6
- package/templates/current/examples/src/app/i18n/origenUiLocale.ts +15 -0
- package/templates/current/examples/src/app/menu/menu.ts +175 -0
- package/templates/current/examples/src/app/menu/menuTypes.ts +20 -0
- package/templates/current/examples/src/{features → app}/security/devtoolsProtection.ts +8 -7
- package/templates/current/examples/src/app/ui/createAdminUi.ts +31 -0
- package/templates/current/examples/src/app/ui/iconCatalog.ts +71 -0
- package/templates/current/examples/src/assets/icons/appearance.svg +1 -0
- package/templates/current/examples/src/assets/icons/arrow-right.svg +1 -0
- package/templates/current/examples/src/assets/icons/check.svg +1 -0
- package/templates/current/examples/src/assets/icons/circle-check.svg +1 -0
- package/templates/current/examples/src/assets/icons/default.svg +4 -0
- package/templates/current/examples/src/assets/icons/directory/setting.svg +1 -0
- package/templates/current/examples/src/assets/icons/expand.svg +1 -0
- package/templates/current/examples/src/assets/icons/fold.svg +1 -0
- package/templates/current/examples/src/assets/icons/key.svg +1 -0
- package/templates/current/examples/src/assets/icons/lock.svg +1 -0
- package/templates/current/examples/src/assets/icons/monitor.svg +1 -0
- package/templates/current/examples/src/assets/icons/moon.svg +11 -0
- package/templates/current/examples/src/assets/icons/page/department.svg +1 -0
- package/templates/current/examples/src/assets/icons/page/dictionary.svg +1 -0
- package/templates/current/examples/src/assets/icons/page/menus.svg +1 -0
- package/templates/current/examples/src/assets/icons/page/user.svg +1 -0
- package/templates/current/examples/src/assets/icons/page/users.svg +1 -0
- package/templates/current/examples/src/assets/icons/plus.svg +1 -0
- package/templates/current/examples/src/assets/icons/profile.svg +1 -0
- package/templates/current/examples/src/assets/icons/refresh.svg +1 -0
- package/templates/current/examples/src/assets/icons/roles.svg +1 -0
- package/templates/current/examples/src/assets/icons/search.svg +1 -0
- package/templates/current/examples/src/assets/icons/sunny.svg +1 -0
- package/templates/current/examples/src/assets/icons/system.svg +1 -0
- package/templates/current/examples/src/assets/icons/theme-auto.svg +14 -0
- package/templates/current/examples/src/assets/icons/tune.svg +13 -0
- package/templates/current/examples/src/{features/shell/components → components}/RouteProgress.vue +2 -2
- package/templates/current/{clean/src/features/system/access → examples/src}/composables/useAuthorizationRefresh.ts +6 -1
- package/templates/current/examples/src/composables/useSystemTableSearchVisibility.ts +33 -0
- package/templates/current/examples/src/{features/appearance/composables → composables}/useTheme.ts +1 -1
- package/templates/current/examples/src/env.d.ts +6 -19
- package/templates/current/examples/src/layouts/AdminLayout.vue +7 -9
- package/templates/current/examples/src/{features/shell/components → layouts}/AdminWatermark.vue +2 -2
- package/templates/current/examples/src/layouts/BreadcrumbBar.vue +9 -1
- package/templates/current/examples/src/layouts/SideMenu.vue +7 -15
- package/templates/current/examples/src/{features/appearance/components → layouts}/ThemePanel.vue +39 -11
- package/templates/current/examples/src/layouts/TopBar.vue +60 -28
- package/templates/current/examples/src/layouts/WorkspaceTabs.vue +10 -1
- package/templates/current/examples/src/layouts/topBarMenuSearch.ts +25 -4
- package/templates/current/examples/src/locales/en-US.json +227 -219
- package/templates/current/examples/src/locales/index.ts +72 -32
- package/templates/current/examples/src/locales/messages-types.ts +15 -10
- package/templates/current/examples/src/locales/vue-i18n.d.ts +1 -1
- package/templates/current/examples/src/locales/zh-CN.json +226 -218
- package/templates/current/examples/src/locales/zh-TW.json +222 -214
- package/templates/current/examples/src/main.ts +50 -40
- package/templates/current/examples/src/router/bootstrap.ts +69 -24
- package/templates/current/examples/src/router/dynamic/componentLoader.ts +150 -0
- package/templates/current/examples/src/router/{dynamicMenuRefresh.ts → dynamic/dynamicMenuRefresh.ts} +6 -2
- package/templates/current/examples/src/router/dynamic/dynamicRoutes.ts +247 -0
- package/templates/current/examples/src/router/navigation/guards.ts +12 -0
- package/templates/current/examples/src/router/navigation/paths.ts +28 -0
- package/templates/current/examples/src/router/navigation/staticRoutes.ts +109 -0
- package/templates/current/examples/src/router/{queryEncryption.ts → query/queryEncryption.ts} +29 -12
- package/templates/current/examples/src/router/query/routeQuery.ts +29 -0
- package/templates/current/examples/src/router/{useRouteQueryDefaults.ts → query/useRouteQueryDefaults.ts} +9 -8
- package/templates/current/examples/src/router/query/useRouteQueryDefaults.types.ts +28 -0
- package/templates/current/examples/src/router/{runtimeErrorRecovery.ts → recovery/runtimeErrorRecovery.ts} +21 -3
- package/templates/current/examples/src/{features/auth/store → store}/auth.ts +96 -61
- package/templates/current/examples/src/store/dictionaries.ts +86 -0
- package/templates/current/examples/src/{features/shell/store → store}/sidebar.ts +9 -2
- package/templates/current/{clean/src/features/appearance → examples/src}/store/theme.ts +8 -4
- package/templates/current/examples/src/styles/layout.css +51 -0
- package/templates/current/examples/src/templates/og-form.ts +7 -2
- package/templates/current/examples/src/templates/og-table.ts +88 -20
- package/templates/current/examples/src/templates/router.ts +11 -2
- package/templates/current/examples/src/utils/color-mix.ts +6 -2
- package/templates/current/examples/src/utils/download.ts +11 -0
- package/templates/current/examples/src/utils/permissions.ts +1 -1
- package/templates/current/examples/src/utils/retryableDialog.ts +46 -0
- package/templates/current/{clean/scripts/clean-overlay/src/features → examples/src/views}/errors/pages/Forbidden.vue +6 -2
- package/templates/current/examples/src/views/errors/pages/MethodNotAllowed.vue +34 -0
- package/templates/current/examples/{scripts/clean-overlay/src/features → src/views}/errors/pages/NotFound.vue +6 -2
- package/templates/current/examples/{scripts/clean-overlay/src/features → src/views}/errors/pages/ServerError.vue +6 -2
- package/templates/current/examples/src/{features/auth/pages/Login.vue → views/login/pages/index.vue} +101 -11
- 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 +56 -10
- package/templates/current/examples/tests/unit/router/routeQuery.spec.ts +19 -0
- package/templates/current/examples/{src → tests/unit}/router/runtimeErrorRecovery.spec.ts +11 -6
- package/templates/current/{clean/src → examples/tests/unit}/router/useRouteQueryDefaults.spec.ts +46 -12
- package/templates/current/examples/tests/unit/scripts/mock-api.spec.ts +440 -0
- package/templates/current/examples/{scripts → tests/unit/scripts}/vite-build-policy.spec.ts +35 -6
- package/templates/current/examples/{src/features/auth → tests/unit}/store/auth.spec.ts +68 -15
- package/templates/current/examples/tests/unit/store/dictionaries.spec.ts +106 -0
- package/templates/current/{clean/src → examples/tests/unit}/templates/templates.spec.ts +60 -16
- package/templates/current/examples/{src/utils/__tests__ → tests/unit/utils}/color-mix.spec.ts +1 -1
- package/templates/current/examples/tests/unit/utils/retryableDialog.spec.ts +61 -0
- package/templates/current/examples/{scripts/clean-overlay/src/features/errors/pages → tests/unit/views/errors}/error-pages.spec.ts +12 -9
- package/templates/current/examples/tests/unit/views/feature-composables.spec.ts +233 -0
- package/templates/current/examples/tests/unit/views/system/access/admin-repository.spec.ts +353 -0
- package/templates/current/examples/tests/unit/views/system/access/rbac.spec.ts +329 -0
- package/templates/current/examples/tests/unit/views/system/dept/departments.spec.ts +104 -0
- package/templates/current/examples/tests/unit/views/system/dict/dictionaries.spec.ts +234 -0
- package/templates/current/examples/tests/unit/views/system/menu/menuDraft.spec.ts +77 -0
- package/templates/current/examples/tests/unit/views/system/menu/useMenuManagement.spec.ts +339 -0
- package/templates/current/examples/tests/unit/views/system/user/searchControl.spec.ts +128 -0
- package/templates/current/examples/tsconfig.json +4 -19
- package/templates/current/examples/vite.build-policy.ts +97 -22
- package/templates/current/examples/vite.config.ts +50 -7
- package/templates/current/clean/.codebuddy/AGENTS.md +0 -18
- package/templates/current/clean/.codex/skills/build-admin-feature/SKILL.md +0 -14
- package/templates/current/clean/.codex/skills/build-admin-feature/references/component-selection.md +0 -25
- package/templates/current/clean/.codex/skills/use-og-table/SKILL.md +0 -16
- package/templates/current/clean/.cursor/AGENTS.md +0 -18
- package/templates/current/clean/.env.production.example +0 -31
- package/templates/current/clean/.qoder/AGENTS.md +0 -15
- package/templates/current/clean/e2e/admin-shell.spec.ts +0 -156
- package/templates/current/clean/e2e/demo-shell.spec.ts +0 -372
- package/templates/current/clean/playwright.demo.config.ts +0 -25
- package/templates/current/clean/scripts/clean-overlay/src/features/errors/pages/NotFound.vue +0 -31
- package/templates/current/clean/scripts/clean-overlay/src/features/errors/pages/ServerError.vue +0 -31
- package/templates/current/clean/scripts/clean-overlay/src/features/errors/pages/error-pages.spec.ts +0 -41
- package/templates/current/clean/scripts/clean-overlay/src/main.ts +0 -100
- package/templates/current/clean/scripts/clean-overlay/src/router/componentCache.ts +0 -12
- package/templates/current/clean/scripts/clean-overlay/src/router/componentRegistry.ts +0 -14
- package/templates/current/clean/scripts/clean-overlay/src/router/dynamicRoutes.spec.ts +0 -77
- package/templates/current/clean/scripts/clean-overlay/src/router/paths.ts +0 -21
- package/templates/current/clean/scripts/clean-overlay/src/router/staticRoutes.ts +0 -63
- package/templates/current/clean/scripts/demo-api.ts +0 -873
- package/templates/current/clean/src/api/client.spec.ts +0 -66
- package/templates/current/clean/src/api/client.ts +0 -152
- package/templates/current/clean/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/345/206/205/345/256/271/346/226/207/347/253/240.ts +0 -144
- package/templates/current/clean/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/345/256/241/350/256/241.ts +0 -50
- package/templates/current/clean/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/346/226/207/344/273/266/344/270/212/344/274/240.ts +0 -63
- package/templates/current/clean/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/347/224/250/346/210/267.ts +0 -169
- package/templates/current/clean/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/350/217/234/345/215/225.ts +0 -180
- package/templates/current/clean/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/350/247/222/350/211/262.ts +0 -167
- package/templates/current/clean/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/350/256/242/345/215/225/350/215/211/347/250/277.ts +0 -168
- package/templates/current/clean/src/api/generated//350/256/244/350/257/201.ts +0 -95
- package/templates/current/clean/src/api/http-adapter.ts +0 -83
- package/templates/current/clean/src/app/createAdminUi.spec.ts +0 -166
- package/templates/current/clean/src/app/createAdminUi.ts +0 -63
- package/templates/current/clean/src/app/embedded-token.spec.ts +0 -40
- package/templates/current/clean/src/app/embedded.spec.ts +0 -135
- package/templates/current/clean/src/app/embedded.ts +0 -255
- package/templates/current/clean/src/app/errorMessage.ts +0 -53
- package/templates/current/clean/src/app/menu-host.spec.ts +0 -77
- package/templates/current/clean/src/app/menu.spec.ts +0 -320
- package/templates/current/clean/src/app/menu.ts +0 -308
- package/templates/current/clean/src/app/menuTypes.ts +0 -18
- package/templates/current/clean/src/app/origenUiLocale.ts +0 -10
- package/templates/current/clean/src/app/permission.ts +0 -9
- package/templates/current/clean/src/demo-api.spec.ts +0 -478
- package/templates/current/clean/src/features/errors/pages/error-pages.spec.ts +0 -41
- package/templates/current/clean/src/features/system/access/api/admin-repository.spec.ts +0 -14
- package/templates/current/clean/src/features/system/access/api/admin-repository.ts +0 -298
- package/templates/current/clean/src/features/system/access/api/rbac.spec.ts +0 -72
- package/templates/current/clean/src/features/system/access/api/rbac.ts +0 -292
- package/templates/current/clean/src/features/system/access/composables/useAuthorizationPolling.spec.ts +0 -134
- package/templates/current/clean/src/features/system/access/composables/useAuthorizationPolling.ts +0 -96
- package/templates/current/clean/src/features/workspace/pages/Profile.vue +0 -185
- package/templates/current/clean/src/router/componentCache.ts +0 -12
- package/templates/current/clean/src/router/componentRegistry.ts +0 -14
- package/templates/current/clean/src/router/dynamicMenuRefresh.spec.ts +0 -101
- package/templates/current/clean/src/router/dynamicRoutes.spec.ts +0 -77
- package/templates/current/clean/src/router/dynamicRoutes.ts +0 -177
- package/templates/current/clean/src/router/guards.ts +0 -5
- package/templates/current/clean/src/router/paths.spec.ts +0 -50
- package/templates/current/clean/src/router/paths.ts +0 -21
- package/templates/current/clean/src/router/routeQuery.spec.ts +0 -11
- package/templates/current/clean/src/router/routeQuery.ts +0 -3
- package/templates/current/clean/src/router/staticRoutes.ts +0 -63
- package/templates/current/clean/src/router/useRouteQueryDefaults.types.ts +0 -20
- package/templates/current/examples/.codebuddy/AGENTS.md +0 -18
- package/templates/current/examples/.codex/skills/build-admin-feature/SKILL.md +0 -14
- package/templates/current/examples/.codex/skills/build-admin-feature/references/component-selection.md +0 -25
- package/templates/current/examples/.codex/skills/use-og-table/SKILL.md +0 -16
- package/templates/current/examples/.cursor/AGENTS.md +0 -18
- package/templates/current/examples/.env.production.example +0 -31
- package/templates/current/examples/.qoder/AGENTS.md +0 -15
- package/templates/current/examples/e2e/admin-shell.spec.ts +0 -156
- package/templates/current/examples/e2e/demo-shell.spec.ts +0 -372
- package/templates/current/examples/playwright.demo.config.ts +0 -25
- package/templates/current/examples/scripts/clean-overlay/src/features/errors/pages/Forbidden.vue +0 -31
- package/templates/current/examples/scripts/clean-overlay/src/main.ts +0 -100
- package/templates/current/examples/scripts/clean-overlay/src/router/componentCache.ts +0 -12
- package/templates/current/examples/scripts/clean-overlay/src/router/componentRegistry.ts +0 -14
- package/templates/current/examples/scripts/clean-overlay/src/router/dynamicRoutes.spec.ts +0 -77
- package/templates/current/examples/scripts/clean-overlay/src/router/paths.ts +0 -21
- package/templates/current/examples/scripts/clean-overlay/src/router/staticRoutes.ts +0 -63
- package/templates/current/examples/scripts/demo-api.ts +0 -873
- package/templates/current/examples/src/api/client.spec.ts +0 -66
- package/templates/current/examples/src/api/client.ts +0 -152
- package/templates/current/examples/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/345/206/205/345/256/271/346/226/207/347/253/240.ts +0 -144
- package/templates/current/examples/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/345/256/241/350/256/241.ts +0 -50
- package/templates/current/examples/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/346/226/207/344/273/266/344/270/212/344/274/240.ts +0 -63
- package/templates/current/examples/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/347/224/250/346/210/267.ts +0 -169
- package/templates/current/examples/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/350/217/234/345/215/225.ts +0 -180
- package/templates/current/examples/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/350/247/222/350/211/262.ts +0 -167
- package/templates/current/examples/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/350/256/242/345/215/225/350/215/211/347/250/277.ts +0 -168
- package/templates/current/examples/src/api/generated//350/256/244/350/257/201.ts +0 -95
- package/templates/current/examples/src/api/http-adapter.ts +0 -83
- package/templates/current/examples/src/app/createAdminUi.spec.ts +0 -166
- package/templates/current/examples/src/app/createAdminUi.ts +0 -63
- package/templates/current/examples/src/app/embedded-token.spec.ts +0 -40
- package/templates/current/examples/src/app/embedded.spec.ts +0 -135
- package/templates/current/examples/src/app/embedded.ts +0 -255
- package/templates/current/examples/src/app/errorMessage.ts +0 -53
- package/templates/current/examples/src/app/menu-host.spec.ts +0 -77
- package/templates/current/examples/src/app/menu.spec.ts +0 -320
- package/templates/current/examples/src/app/menu.ts +0 -308
- package/templates/current/examples/src/app/menuTypes.ts +0 -18
- package/templates/current/examples/src/app/origenUiLocale.ts +0 -10
- package/templates/current/examples/src/app/permission.ts +0 -9
- package/templates/current/examples/src/demo-api.spec.ts +0 -478
- package/templates/current/examples/src/features/errors/pages/Forbidden.vue +0 -31
- package/templates/current/examples/src/features/errors/pages/NotFound.vue +0 -31
- package/templates/current/examples/src/features/errors/pages/ServerError.vue +0 -31
- package/templates/current/examples/src/features/feature-composables.spec.ts +0 -245
- package/templates/current/examples/src/features/system/access/api/admin-repository.spec.ts +0 -14
- package/templates/current/examples/src/features/system/access/api/admin-repository.ts +0 -298
- package/templates/current/examples/src/features/system/access/api/rbac.spec.ts +0 -72
- package/templates/current/examples/src/features/system/access/api/rbac.ts +0 -292
- package/templates/current/examples/src/features/system/access/composables/useAuthorizationPolling.spec.ts +0 -134
- package/templates/current/examples/src/features/system/access/composables/useAuthorizationPolling.ts +0 -96
- package/templates/current/examples/src/features/system/audit/composables/useAuditManagement.ts +0 -122
- package/templates/current/examples/src/features/system/audit/pages/AuditList.vue +0 -20
- package/templates/current/examples/src/features/system/menus/components/MenuEditorForm.vue +0 -279
- package/templates/current/examples/src/features/system/menus/composables/useMenuManagement.ts +0 -435
- package/templates/current/examples/src/features/system/menus/menuDraft.spec.ts +0 -204
- package/templates/current/examples/src/features/system/menus/menuDraft.ts +0 -116
- package/templates/current/examples/src/features/system/menus/menuTreePrecheck.spec.ts +0 -268
- package/templates/current/examples/src/features/system/menus/menuTreePrecheck.ts +0 -317
- package/templates/current/examples/src/features/system/menus/pages/MenuList.vue +0 -51
- package/templates/current/examples/src/features/system/roles/components/RoleEditorForm.vue +0 -116
- package/templates/current/examples/src/features/system/roles/composables/useRoleManagement.ts +0 -194
- package/templates/current/examples/src/features/system/roles/pages/RoleList.vue +0 -47
- package/templates/current/examples/src/features/system/users/components/UserEditorForm.vue +0 -104
- package/templates/current/examples/src/features/system/users/composables/useUserManagement.ts +0 -228
- package/templates/current/examples/src/features/system/users/pages/UserList.vue +0 -51
- package/templates/current/examples/src/features/workspace/pages/Dashboard.spec.ts +0 -41
- package/templates/current/examples/src/features/workspace/pages/Dashboard.vue +0 -325
- package/templates/current/examples/src/features/workspace/pages/Profile.vue +0 -185
- package/templates/current/examples/src/router/componentCache.ts +0 -18
- package/templates/current/examples/src/router/componentRegistry.ts +0 -66
- package/templates/current/examples/src/router/dynamicMenuRefresh.spec.ts +0 -101
- package/templates/current/examples/src/router/dynamicRoutes.spec.ts +0 -144
- package/templates/current/examples/src/router/dynamicRoutes.ts +0 -177
- package/templates/current/examples/src/router/guards.ts +0 -5
- package/templates/current/examples/src/router/paths.spec.ts +0 -50
- package/templates/current/examples/src/router/paths.ts +0 -21
- package/templates/current/examples/src/router/routeQuery.spec.ts +0 -11
- package/templates/current/examples/src/router/routeQuery.ts +0 -3
- package/templates/current/examples/src/router/staticRoutes.ts +0 -63
- package/templates/current/examples/src/router/useRouteQueryDefaults.types.ts +0 -20
- /package/templates/current/clean/{.codex → .agents}/skills/style-og-origen-ui/SKILL.md +0 -0
- /package/templates/current/clean/{.codex → .agents}/skills/style-og-origen-ui/agents/openai.yaml +0 -0
- /package/templates/current/clean/{.codex → .agents}/skills/use-og-dialog/SKILL.md +0 -0
- /package/templates/current/clean/{.codex → .agents}/skills/use-og-dialog/agents/openai.yaml +0 -0
- /package/templates/current/clean/{.codex → .agents}/skills/use-og-editor/SKILL.md +0 -0
- /package/templates/current/clean/{.codex → .agents}/skills/use-og-http/SKILL.md +0 -0
- /package/templates/current/clean/{.codex → .agents}/skills/use-og-http/agents/openai.yaml +0 -0
- /package/templates/current/clean/{.codex → .agents}/skills/use-og-router-tabs/SKILL.md +0 -0
- /package/templates/current/{examples/.codex → clean/.claude}/skills/style-og-origen-ui/SKILL.md +0 -0
- /package/templates/current/{examples/.codex → clean/.claude}/skills/use-og-dialog/SKILL.md +0 -0
- /package/templates/current/{examples/.codex → clean/.claude}/skills/use-og-editor/SKILL.md +0 -0
- /package/templates/current/{examples/.codex → clean/.claude}/skills/use-og-http/SKILL.md +0 -0
- /package/templates/current/{examples/.codex → clean/.claude}/skills/use-og-router-tabs/SKILL.md +0 -0
- /package/templates/current/clean/src/{features/security/components → components}/DevtoolsProtectionOverlay.vue +0 -0
- /package/templates/current/clean/src/{features/shell/composables → composables}/useRouteProgress.ts +0 -0
- /package/templates/current/clean/src/{features/workspace → views/fallback}/pages/Empty.vue +0 -0
- /package/templates/current/examples/{.codex → .agents}/skills/style-og-origen-ui/agents/openai.yaml +0 -0
- /package/templates/current/examples/{.codex → .agents}/skills/use-og-dialog/agents/openai.yaml +0 -0
- /package/templates/current/examples/{.codex → .agents}/skills/use-og-http/agents/openai.yaml +0 -0
- /package/templates/current/examples/src/{features/security/components → components}/DevtoolsProtectionOverlay.vue +0 -0
- /package/templates/current/examples/src/{features/shell/composables → composables}/useRouteProgress.ts +0 -0
- /package/templates/current/examples/src/{features/workspace → views/fallback}/pages/Empty.vue +0 -0
|
@@ -1,372 +0,0 @@
|
|
|
1
|
-
import type { APIRequestContext } from '@playwright/test'
|
|
2
|
-
import { expect, test } from '@playwright/test'
|
|
3
|
-
|
|
4
|
-
test.setTimeout(120_000)
|
|
5
|
-
|
|
6
|
-
interface Envelope<T> {
|
|
7
|
-
code: number
|
|
8
|
-
message: string
|
|
9
|
-
data: T
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
interface DemoLogin {
|
|
13
|
-
accessToken: string
|
|
14
|
-
permissions: string[]
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
interface DemoRecord {
|
|
18
|
-
id: string
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
interface DemoRole extends DemoRecord {
|
|
22
|
-
permissions: string[]
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
interface DemoSummary {
|
|
26
|
-
userCount: number
|
|
27
|
-
roleCount: number
|
|
28
|
-
menuCount: number
|
|
29
|
-
auditCount: number
|
|
30
|
-
revision: number
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
async function demoRequest<T>(
|
|
34
|
-
request: APIRequestContext,
|
|
35
|
-
method: 'GET' | 'POST',
|
|
36
|
-
path: string,
|
|
37
|
-
token?: string,
|
|
38
|
-
data?: unknown,
|
|
39
|
-
): Promise<T> {
|
|
40
|
-
const response = await request.fetch(path, {
|
|
41
|
-
method,
|
|
42
|
-
data,
|
|
43
|
-
headers: token ? { Authorization: `Bearer ${token}` } : undefined,
|
|
44
|
-
})
|
|
45
|
-
expect(response.status()).toBe(200)
|
|
46
|
-
|
|
47
|
-
const body = (await response.json()) as Envelope<T>
|
|
48
|
-
expect(body.code).toBe(0)
|
|
49
|
-
return body.data
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
test('admin demo logs in, registers remote routes, and persists mutations for this session', async ({
|
|
53
|
-
page,
|
|
54
|
-
request,
|
|
55
|
-
}) => {
|
|
56
|
-
const login = await demoRequest<DemoLogin>(request, 'POST', '/api/auth/login', undefined, {
|
|
57
|
-
username: 'admin',
|
|
58
|
-
password: 'admin123',
|
|
59
|
-
})
|
|
60
|
-
expect(login.permissions).toContain('system:user:write')
|
|
61
|
-
|
|
62
|
-
await page.goto('/login')
|
|
63
|
-
const loginInputs = page.locator('.login-page input')
|
|
64
|
-
await loginInputs.nth(0).fill('admin')
|
|
65
|
-
await loginInputs.nth(1).fill('admin123')
|
|
66
|
-
await Promise.all([
|
|
67
|
-
page.waitForURL('**/dashboard'),
|
|
68
|
-
page.locator('button.login-card__submit').click(),
|
|
69
|
-
])
|
|
70
|
-
|
|
71
|
-
await expect(page.locator('.admin-shell')).toBeVisible({ timeout: 15_000 })
|
|
72
|
-
await page.setViewportSize({ width: 1920, height: 1080 })
|
|
73
|
-
await expect(page.locator('.dashboard-page')).toBeVisible()
|
|
74
|
-
const languageMenuItem = (name: string) => page.getByRole('menuitem', { name, exact: true })
|
|
75
|
-
const menuSearch = page.locator('.top-bar__search input')
|
|
76
|
-
await page.getByRole('button', { name: '简体中文', exact: true }).click()
|
|
77
|
-
await expect(languageMenuItem('English')).toBeVisible()
|
|
78
|
-
await languageMenuItem('English').click()
|
|
79
|
-
await expect(page.locator('.top-bar__search .el-select__placeholder')).toHaveText('Search menu')
|
|
80
|
-
await expect(page.locator('html')).toHaveAttribute('lang', 'en-US')
|
|
81
|
-
await expect(menuSearch).toBeEnabled()
|
|
82
|
-
await expect(languageMenuItem('繁體中文')).toBeHidden()
|
|
83
|
-
await page.getByRole('button', { name: 'English', exact: true }).click()
|
|
84
|
-
await expect(languageMenuItem('繁體中文')).toBeVisible()
|
|
85
|
-
await languageMenuItem('繁體中文').click()
|
|
86
|
-
await expect(page.locator('.top-bar__search .el-select__placeholder')).toHaveText('搜尋選單')
|
|
87
|
-
await expect(page.locator('html')).toHaveAttribute('lang', 'zh-TW')
|
|
88
|
-
await expect(menuSearch).toBeEnabled()
|
|
89
|
-
await expect(languageMenuItem('简体中文')).toBeHidden()
|
|
90
|
-
await page.getByRole('button', { name: '繁體中文', exact: true }).click()
|
|
91
|
-
await expect(languageMenuItem('简体中文')).toBeVisible()
|
|
92
|
-
await languageMenuItem('简体中文').click()
|
|
93
|
-
await expect(page.locator('.top-bar__search .el-select__placeholder')).toHaveText('搜索菜单')
|
|
94
|
-
await expect(menuSearch).toBeEnabled()
|
|
95
|
-
await expect(page.getByRole('button', { name: '消息' })).toHaveCount(0)
|
|
96
|
-
const documentNavigations: string[] = []
|
|
97
|
-
const runtimeWarnings: string[] = []
|
|
98
|
-
page.on('request', (request) => {
|
|
99
|
-
if (request.isNavigationRequest() && request.frame() === page.mainFrame())
|
|
100
|
-
documentNavigations.push(request.url())
|
|
101
|
-
})
|
|
102
|
-
page.on('console', (message) => {
|
|
103
|
-
if (message.type() === 'warning' || message.type() === 'error')
|
|
104
|
-
runtimeWarnings.push(message.text())
|
|
105
|
-
})
|
|
106
|
-
await menuSearch.fill('Users')
|
|
107
|
-
const usersSearchOption = page.getByRole('option', { name: 'System / Users', exact: true })
|
|
108
|
-
await expect(usersSearchOption).toBeVisible()
|
|
109
|
-
await usersSearchOption.click()
|
|
110
|
-
await expect(page).toHaveURL(/\/system\/users$/, { timeout: 15_000 })
|
|
111
|
-
await menuSearch.fill('Dashboard')
|
|
112
|
-
const dashboardSearchOption = page.getByRole('option', { name: 'Dashboard', exact: true })
|
|
113
|
-
await expect(dashboardSearchOption).toBeVisible()
|
|
114
|
-
await dashboardSearchOption.click()
|
|
115
|
-
await expect(page).toHaveURL(/\/dashboard$/)
|
|
116
|
-
await page.getByText('System', { exact: true }).click()
|
|
117
|
-
await expect(page.getByRole('menuitem', { name: 'Users', exact: true })).toBeVisible()
|
|
118
|
-
await page.getByRole('menuitem', { name: 'Users', exact: true }).click()
|
|
119
|
-
await expect(page).toHaveURL(/\/system\/users$/)
|
|
120
|
-
await expect(page.locator('.table-page')).toBeVisible()
|
|
121
|
-
await expect(page.locator('.page-header')).toHaveCount(0)
|
|
122
|
-
const breadcrumbBox = await page.locator('.breadcrumb-bar').boundingBox()
|
|
123
|
-
const tableBox = await page.locator('.table-page > .og-table').boundingBox()
|
|
124
|
-
const routeViewBox = await page.locator('.admin-shell__route-view').boundingBox()
|
|
125
|
-
expect(breadcrumbBox).not.toBeNull()
|
|
126
|
-
expect(tableBox).not.toBeNull()
|
|
127
|
-
expect(routeViewBox).not.toBeNull()
|
|
128
|
-
expect(breadcrumbBox!.y + breadcrumbBox!.height).toBeLessThanOrEqual(tableBox!.y)
|
|
129
|
-
expect(tableBox!.height).toBeGreaterThan(routeViewBox!.height * 0.8)
|
|
130
|
-
await expect(page.locator('.top-bar__badge')).toHaveCount(0)
|
|
131
|
-
await expect(page.locator('.og-search')).toHaveAttribute('data-og-search-columns', '4')
|
|
132
|
-
const searchGridBox = await page.locator('.og-search__grid').boundingBox()
|
|
133
|
-
const searchFieldBox = await page.locator('[data-og-search-field="keyword"]').boundingBox()
|
|
134
|
-
expect(searchGridBox).not.toBeNull()
|
|
135
|
-
expect(searchFieldBox).not.toBeNull()
|
|
136
|
-
expect(searchFieldBox!.width).toBeLessThan(searchGridBox!.width * 0.3)
|
|
137
|
-
await expect(
|
|
138
|
-
page.locator('#main-content').getByText('Demo Administrator', { exact: true }),
|
|
139
|
-
).toBeVisible()
|
|
140
|
-
|
|
141
|
-
await menuSearch.fill('Menus')
|
|
142
|
-
const menusSearchOption = page.getByRole('option', { name: 'System / Menus', exact: true })
|
|
143
|
-
await expect(menusSearchOption).toBeVisible()
|
|
144
|
-
await menusSearchOption.click()
|
|
145
|
-
await expect(page).toHaveURL(/\/system\/menus$/)
|
|
146
|
-
const updatedHeader = page
|
|
147
|
-
.locator('.el-table__header th.el-table__cell.is-sortable')
|
|
148
|
-
.filter({ hasText: '最近更新' })
|
|
149
|
-
const updatedHeaderContent = updatedHeader.locator('.og-table__header-content')
|
|
150
|
-
const updatedCaret = updatedHeader.locator('.caret-wrapper')
|
|
151
|
-
await expect(updatedHeaderContent).toBeVisible()
|
|
152
|
-
await expect(updatedCaret).toBeVisible()
|
|
153
|
-
const [updatedContentBox, updatedCaretBox] = await Promise.all([
|
|
154
|
-
updatedHeaderContent.boundingBox(),
|
|
155
|
-
updatedCaret.boundingBox(),
|
|
156
|
-
])
|
|
157
|
-
expect(updatedContentBox).not.toBeNull()
|
|
158
|
-
expect(updatedCaretBox).not.toBeNull()
|
|
159
|
-
expect(updatedCaretBox!.y).toBeLessThan(updatedContentBox!.y + updatedContentBox!.height)
|
|
160
|
-
expect(updatedCaretBox!.y + updatedCaretBox!.height).toBeGreaterThan(updatedContentBox!.y)
|
|
161
|
-
const ascendingSortRequest = page.waitForRequest((request) => {
|
|
162
|
-
const url = new URL(request.url())
|
|
163
|
-
return (
|
|
164
|
-
request.method() === 'GET' &&
|
|
165
|
-
url.pathname.endsWith('/api/system/menus') &&
|
|
166
|
-
url.searchParams.get('sortBy') === 'updatedAt' &&
|
|
167
|
-
url.searchParams.get('sortOrder') === 'ascending'
|
|
168
|
-
)
|
|
169
|
-
})
|
|
170
|
-
await updatedHeader.click()
|
|
171
|
-
await ascendingSortRequest
|
|
172
|
-
const systemMenuRow = page.locator('.el-table__body tr').filter({ hasText: 'System' }).first()
|
|
173
|
-
const systemExpand = systemMenuRow.locator('.el-table__expand-icon')
|
|
174
|
-
await expect(systemExpand).toBeVisible()
|
|
175
|
-
await systemExpand.click()
|
|
176
|
-
await expect(page.locator('.el-table__body tr').filter({ hasText: 'Users' })).toBeHidden()
|
|
177
|
-
await systemExpand.click()
|
|
178
|
-
await expect(page.locator('.el-table__body tr').filter({ hasText: 'Users' })).toBeVisible()
|
|
179
|
-
expect(documentNavigations).toHaveLength(0)
|
|
180
|
-
expect(runtimeWarnings).not.toEqual(
|
|
181
|
-
expect.arrayContaining([
|
|
182
|
-
expect.stringContaining('injection "Symbol(og-table)" not found'),
|
|
183
|
-
expect.stringContaining('Failed to resolve directive: loading'),
|
|
184
|
-
]),
|
|
185
|
-
)
|
|
186
|
-
|
|
187
|
-
const tabs = page.locator('.workspace-tabs [role="tab"]')
|
|
188
|
-
expect(await tabs.count()).toBeGreaterThanOrEqual(2)
|
|
189
|
-
await expect(page.locator('.workspace-tabs .og-tabs__bar')).toHaveCSS('display', 'flex')
|
|
190
|
-
const tabTops = await tabs.evaluateAll((elements) =>
|
|
191
|
-
elements.map((element) => Math.round(element.getBoundingClientRect().top)),
|
|
192
|
-
)
|
|
193
|
-
expect(new Set(tabTops).size).toBe(1)
|
|
194
|
-
|
|
195
|
-
const keywordField = page.locator('[data-og-search-field="keyword"]')
|
|
196
|
-
const keywordLabel = keywordField.locator('.el-form-item__label')
|
|
197
|
-
const keywordInput = keywordField.locator('input')
|
|
198
|
-
const labelBox = await keywordLabel.boundingBox()
|
|
199
|
-
const inputBox = await keywordInput.boundingBox()
|
|
200
|
-
expect(labelBox).not.toBeNull()
|
|
201
|
-
expect(inputBox).not.toBeNull()
|
|
202
|
-
expect(labelBox!.x + labelBox!.width).toBeLessThanOrEqual(inputBox!.x)
|
|
203
|
-
|
|
204
|
-
await page.setViewportSize({ width: 600, height: 900 })
|
|
205
|
-
await expect(page.locator('.workspace-tabs .og-tabs__bar')).toHaveCSS('display', 'flex')
|
|
206
|
-
const narrowTabTops = await tabs.evaluateAll((elements) =>
|
|
207
|
-
elements.map((element) => Math.round(element.getBoundingClientRect().top)),
|
|
208
|
-
)
|
|
209
|
-
expect(new Set(narrowTabTops).size).toBe(1)
|
|
210
|
-
const rowActions = page.locator('.og-table-row-actions').first()
|
|
211
|
-
await expect(rowActions.locator('.og-table-row-actions__action')).toHaveCount(1)
|
|
212
|
-
await expect(rowActions.locator('.og-table-row-actions__more')).toBeVisible()
|
|
213
|
-
await expect(
|
|
214
|
-
page.locator('.table-page > .og-table--bordered.og-table--no-pagination .og-table__body'),
|
|
215
|
-
).toHaveCSS('margin-bottom', '10px')
|
|
216
|
-
await rowActions.locator('.og-table-row-actions__action').click()
|
|
217
|
-
const mobileDialog = page.locator('.el-dialog.dialog__surface')
|
|
218
|
-
await expect(mobileDialog).toBeVisible()
|
|
219
|
-
for (const width of [600, 375]) {
|
|
220
|
-
await page.setViewportSize({ width, height: 900 })
|
|
221
|
-
const dialogBox = await mobileDialog.boundingBox()
|
|
222
|
-
expect(dialogBox).not.toBeNull()
|
|
223
|
-
expect(dialogBox!.x).toBeGreaterThanOrEqual(0)
|
|
224
|
-
expect(dialogBox!.x + dialogBox!.width).toBeLessThanOrEqual(width)
|
|
225
|
-
expect(
|
|
226
|
-
await page.evaluate(() => document.documentElement.scrollWidth <= window.innerWidth),
|
|
227
|
-
).toBe(true)
|
|
228
|
-
}
|
|
229
|
-
await page.keyboard.press('Escape')
|
|
230
|
-
await expect(mobileDialog).toBeHidden()
|
|
231
|
-
|
|
232
|
-
async function assertEditorFormDoesNotOverflow(
|
|
233
|
-
menu: string,
|
|
234
|
-
createButton: string,
|
|
235
|
-
): Promise<void> {
|
|
236
|
-
await page.goto(`/system/${menu.toLowerCase()}`)
|
|
237
|
-
await expect(page).toHaveURL(new RegExp(`/system/${menu.toLowerCase()}$`))
|
|
238
|
-
await page.getByRole('button', { name: createButton, exact: true }).click()
|
|
239
|
-
|
|
240
|
-
const dialog = page.getByRole('dialog').filter({ hasText: createButton })
|
|
241
|
-
const body = dialog.locator('.el-dialog__body')
|
|
242
|
-
await expect(dialog).toBeVisible({ timeout: 15_000 })
|
|
243
|
-
await expect(dialog.locator('.og-form-container')).toBeVisible()
|
|
244
|
-
await expect(body).toBeVisible()
|
|
245
|
-
expect(await body.evaluate((element) => element.scrollWidth <= element.clientWidth)).toBe(true)
|
|
246
|
-
|
|
247
|
-
const label = dialog.locator('.el-form-item__label').first()
|
|
248
|
-
await expect(label).toHaveCSS('align-items', 'center')
|
|
249
|
-
const labelMetrics = await label.evaluate((element) => {
|
|
250
|
-
const style = getComputedStyle(element)
|
|
251
|
-
return {
|
|
252
|
-
height: element.getBoundingClientRect().height,
|
|
253
|
-
lineHeight: Number.parseFloat(style.lineHeight),
|
|
254
|
-
}
|
|
255
|
-
})
|
|
256
|
-
expect(labelMetrics.lineHeight).toBeLessThan(labelMetrics.height)
|
|
257
|
-
|
|
258
|
-
await page.keyboard.press('Escape')
|
|
259
|
-
await expect(dialog).toBeHidden()
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
for (const viewport of [
|
|
263
|
-
{ width: 1280, height: 900 },
|
|
264
|
-
{ width: 375, height: 900 },
|
|
265
|
-
]) {
|
|
266
|
-
await page.setViewportSize(viewport)
|
|
267
|
-
await assertEditorFormDoesNotOverflow('Users', '新增成员')
|
|
268
|
-
await assertEditorFormDoesNotOverflow('Roles', '新增角色')
|
|
269
|
-
await assertEditorFormDoesNotOverflow('Menus', '新增菜单')
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
await page.setViewportSize({ width: 1280, height: 900 })
|
|
273
|
-
await page.goto('/system/roles')
|
|
274
|
-
await expect(page).toHaveURL(/\/system\/roles$/)
|
|
275
|
-
await page.getByRole('button', { name: '新增角色', exact: true }).click()
|
|
276
|
-
const roleDialog = page.getByRole('dialog').filter({ hasText: '新增角色' })
|
|
277
|
-
await expect(roleDialog).toBeVisible()
|
|
278
|
-
|
|
279
|
-
const suffix = `${Date.now()}`
|
|
280
|
-
const roleField = (label: string) =>
|
|
281
|
-
roleDialog.locator('.el-form-item').filter({ hasText: label })
|
|
282
|
-
await roleField('角色名称').locator('input').fill(`Demo smoke role ${suffix}`)
|
|
283
|
-
await roleField('角色标识').locator('input').fill(`demo_smoke_${suffix}`)
|
|
284
|
-
await roleField('角色说明').locator('textarea').fill('Created by the local demo Playwright smoke test.')
|
|
285
|
-
|
|
286
|
-
const permissionsField = roleField('权限范围')
|
|
287
|
-
await permissionsField.locator('.el-select').click()
|
|
288
|
-
const rolePermissionGroup = page.getByRole('treeitem', { name: '角色管理' })
|
|
289
|
-
await rolePermissionGroup.locator('.el-tree-node__expand-icon').click()
|
|
290
|
-
const roleWritePermission = page.getByRole('treeitem', { name: '新增和编辑角色' })
|
|
291
|
-
await expect(roleWritePermission).toBeVisible()
|
|
292
|
-
await roleWritePermission.locator('.el-tree-node__content').click()
|
|
293
|
-
await expect(permissionsField).toContainText('新增和编辑角色')
|
|
294
|
-
await page.keyboard.press('Escape')
|
|
295
|
-
|
|
296
|
-
const roleCreation = page.waitForResponse((response) => {
|
|
297
|
-
const request = response.request()
|
|
298
|
-
return (
|
|
299
|
-
request.method() === 'POST' &&
|
|
300
|
-
new URL(response.url()).pathname === '/api/system/roles'
|
|
301
|
-
)
|
|
302
|
-
})
|
|
303
|
-
await roleDialog.getByRole('button', { name: '确定', exact: true }).click()
|
|
304
|
-
const roleResponse = await roleCreation
|
|
305
|
-
expect(roleResponse.ok()).toBe(true)
|
|
306
|
-
const role = ((await roleResponse.json()) as Envelope<DemoRole>).data
|
|
307
|
-
expect(role.id).toMatch(/^role-/)
|
|
308
|
-
expect(role.permissions).toEqual(['system:role:write'])
|
|
309
|
-
expect(roleResponse.request().postDataJSON()).toMatchObject({
|
|
310
|
-
permissions: ['system:role:write'],
|
|
311
|
-
})
|
|
312
|
-
await expect(roleDialog).toBeHidden()
|
|
313
|
-
|
|
314
|
-
expect(runtimeWarnings).not.toEqual(
|
|
315
|
-
expect.arrayContaining([
|
|
316
|
-
expect.stringContaining('Invalid prop: type check failed for prop "value"'),
|
|
317
|
-
]),
|
|
318
|
-
)
|
|
319
|
-
|
|
320
|
-
await page.setViewportSize({ width: 600, height: 900 })
|
|
321
|
-
|
|
322
|
-
const user = await demoRequest<DemoRecord>(
|
|
323
|
-
request,
|
|
324
|
-
'POST',
|
|
325
|
-
'/api/system/users',
|
|
326
|
-
login.accessToken,
|
|
327
|
-
{
|
|
328
|
-
name: `Demo smoke user ${suffix}`,
|
|
329
|
-
email: `demo-smoke-${suffix}@example.test`,
|
|
330
|
-
department: 'Platform',
|
|
331
|
-
roleIds: [role.id],
|
|
332
|
-
status: 'active',
|
|
333
|
-
},
|
|
334
|
-
)
|
|
335
|
-
expect(user.id).toMatch(/^user-/)
|
|
336
|
-
|
|
337
|
-
const menu = await demoRequest<DemoRecord>(
|
|
338
|
-
request,
|
|
339
|
-
'POST',
|
|
340
|
-
'/api/system/menus',
|
|
341
|
-
login.accessToken,
|
|
342
|
-
{
|
|
343
|
-
parentId: 'menu-system',
|
|
344
|
-
kind: 'page',
|
|
345
|
-
code: `demo-smoke-${suffix}`,
|
|
346
|
-
title: `Demo smoke menu ${suffix}`,
|
|
347
|
-
path: `demo-smoke-${suffix}`,
|
|
348
|
-
componentKey: 'audit-list',
|
|
349
|
-
icon: 'audit',
|
|
350
|
-
order: 90,
|
|
351
|
-
status: 'active',
|
|
352
|
-
visible: true,
|
|
353
|
-
cache: false,
|
|
354
|
-
tabHidden: true,
|
|
355
|
-
},
|
|
356
|
-
)
|
|
357
|
-
expect(menu.id).toMatch(/^menu-/)
|
|
358
|
-
|
|
359
|
-
const summary = await demoRequest<DemoSummary>(
|
|
360
|
-
request,
|
|
361
|
-
'GET',
|
|
362
|
-
'/api/system/rbac/summary',
|
|
363
|
-
login.accessToken,
|
|
364
|
-
)
|
|
365
|
-
expect(summary).toMatchObject({
|
|
366
|
-
userCount: 3,
|
|
367
|
-
roleCount: 3,
|
|
368
|
-
menuCount: 7,
|
|
369
|
-
auditCount: 3,
|
|
370
|
-
revision: 4,
|
|
371
|
-
})
|
|
372
|
-
})
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { existsSync } from 'node:fs'
|
|
2
|
-
import { defineConfig, devices } from '@playwright/test'
|
|
3
|
-
|
|
4
|
-
const localChromePath = 'C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe'
|
|
5
|
-
const launchOptions = existsSync(localChromePath) ? { executablePath: localChromePath } : {}
|
|
6
|
-
|
|
7
|
-
export default defineConfig({
|
|
8
|
-
testDir: './e2e',
|
|
9
|
-
testMatch: 'demo-shell.spec.ts',
|
|
10
|
-
fullyParallel: false,
|
|
11
|
-
workers: 1,
|
|
12
|
-
reporter: [['list'], ['html', { open: 'never' }]],
|
|
13
|
-
use: {
|
|
14
|
-
baseURL: 'http://127.0.0.1:4176',
|
|
15
|
-
screenshot: 'only-on-failure',
|
|
16
|
-
trace: 'on-first-retry',
|
|
17
|
-
},
|
|
18
|
-
projects: [{ name: 'demo-chromium', use: { ...devices['Desktop Chrome'], launchOptions } }],
|
|
19
|
-
webServer: {
|
|
20
|
-
command: 'pnpm exec vite --mode demo --force --host 127.0.0.1 --port 4176 --strictPort',
|
|
21
|
-
url: 'http://127.0.0.1:4176',
|
|
22
|
-
reuseExistingServer: false,
|
|
23
|
-
timeout: 120_000,
|
|
24
|
-
},
|
|
25
|
-
})
|
package/templates/current/examples/scripts/clean-overlay/src/features/errors/pages/Forbidden.vue
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { ElButton, ElResult } from 'element-plus'
|
|
3
|
-
import { useI18n } from 'vue-i18n'
|
|
4
|
-
import { useRouter } from 'vue-router'
|
|
5
|
-
import { HOME_ROUTE } from '../../../router/paths'
|
|
6
|
-
|
|
7
|
-
defineOptions({ name: 'ForbiddenPage' })
|
|
8
|
-
|
|
9
|
-
const router = useRouter()
|
|
10
|
-
const { t } = useI18n()
|
|
11
|
-
</script>
|
|
12
|
-
|
|
13
|
-
<template>
|
|
14
|
-
<main class="error-page">
|
|
15
|
-
<ElResult icon="warning" :title="t('errors.forbidden.code')" :sub-title="t('errors.forbidden.message')">
|
|
16
|
-
<template #extra>
|
|
17
|
-
<ElButton type="primary" @click="router.push(HOME_ROUTE)">
|
|
18
|
-
{{ t('errors.forbidden.backHome') }}
|
|
19
|
-
</ElButton>
|
|
20
|
-
</template>
|
|
21
|
-
</ElResult>
|
|
22
|
-
</main>
|
|
23
|
-
</template>
|
|
24
|
-
|
|
25
|
-
<style scoped>
|
|
26
|
-
.error-page {
|
|
27
|
-
display: grid;
|
|
28
|
-
min-height: 100vh;
|
|
29
|
-
place-items: center;
|
|
30
|
-
}
|
|
31
|
-
</style>
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import { createApp } from 'vue'
|
|
2
|
-
import App from './App.vue'
|
|
3
|
-
import { translateAdminError } from './app/errorMessage'
|
|
4
|
-
import { permission } from './app/permission'
|
|
5
|
-
import { useAuthStore } from './features/auth/store/auth'
|
|
6
|
-
import { devtoolsProtection } from './features/security/devtoolsProtection'
|
|
7
|
-
import { translateAdminMessage } from './locales'
|
|
8
|
-
import { replaceDynamicMenusWithAccessibleFallback } from './router/dynamicMenuRefresh'
|
|
9
|
-
import { createRuntimeErrorRecovery, createStaleAssetRecovery } from './router/runtimeErrorRecovery'
|
|
10
|
-
import { pinia } from './store'
|
|
11
|
-
import 'element-plus/theme-chalk/src/tabs.scss'
|
|
12
|
-
import 'origen-ui/tabs.css'
|
|
13
|
-
import '@origen-ui/router/style.css'
|
|
14
|
-
import './styles/index.css'
|
|
15
|
-
import './styles/layout.css'
|
|
16
|
-
import './styles/shell.css'
|
|
17
|
-
|
|
18
|
-
async function notifyRuntimeError(message: string): Promise<void> {
|
|
19
|
-
const { ElMessage } = await import('element-plus/es/components/message/index.mjs')
|
|
20
|
-
ElMessage.error(message)
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
async function bootstrap(): Promise<void> {
|
|
24
|
-
devtoolsProtection.start()
|
|
25
|
-
const { createAdminI18n, createAdminTitleResolver } = await import('./locales')
|
|
26
|
-
const { i18n, language } = createAdminI18n()
|
|
27
|
-
const { initializeRouting } = await import('./router/bootstrap')
|
|
28
|
-
const queryCodecs =
|
|
29
|
-
import.meta.env.VITE_ROUTE_QUERY_ENCRYPTION === 'true'
|
|
30
|
-
? (await import('./router/queryEncryption')).createRouteQueryEncryption({
|
|
31
|
-
enabled: true,
|
|
32
|
-
key: import.meta.env.VITE_ROUTE_QUERY_KEY,
|
|
33
|
-
})
|
|
34
|
-
: undefined
|
|
35
|
-
const routing = initializeRouting(queryCodecs, {
|
|
36
|
-
resolveTitle: createAdminTitleResolver(i18n),
|
|
37
|
-
titleRevision: language.current,
|
|
38
|
-
})
|
|
39
|
-
const app = createApp(App)
|
|
40
|
-
app.use(pinia)
|
|
41
|
-
app.use(permission)
|
|
42
|
-
const recoverRuntimeError = createRuntimeErrorRecovery(routing.router)
|
|
43
|
-
const staleAssetRecovery = createStaleAssetRecovery({
|
|
44
|
-
router: routing.router,
|
|
45
|
-
window,
|
|
46
|
-
recoverRuntimeError,
|
|
47
|
-
})
|
|
48
|
-
app.use(i18n)
|
|
49
|
-
language.install(app)
|
|
50
|
-
const { createAdminUi } = await import('./app/createAdminUi')
|
|
51
|
-
app.use(createAdminUi(language))
|
|
52
|
-
// 唯一的 errorHandler 装配点:运行期错误统一走提示 + 陈旧资源/运行时恢复。
|
|
53
|
-
app.config.errorHandler = (error: unknown) => {
|
|
54
|
-
console.error('[admin] runtime error', error)
|
|
55
|
-
const message = translateAdminError(error, {
|
|
56
|
-
fallbackKey: 'common.errors.unknownPageError',
|
|
57
|
-
fallback: '页面发生未知错误',
|
|
58
|
-
})
|
|
59
|
-
void notifyRuntimeError(message)
|
|
60
|
-
if (!staleAssetRecovery.handle(error)) recoverRuntimeError()
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
const auth = useAuthStore(pinia)
|
|
64
|
-
const session = await auth.fetchSession()
|
|
65
|
-
app.use(routing)
|
|
66
|
-
// 路由就绪是硬性等待;布局仅在登录态下并行预热。catch-tap 保证路由先失败
|
|
67
|
-
// 时预热 rejection 不会变成 unhandled——两个失败最终都按启动失败上报。
|
|
68
|
-
const layoutPreload = session ? import('./layouts/AdminLayout.vue') : undefined
|
|
69
|
-
layoutPreload?.catch(() => {})
|
|
70
|
-
await Promise.all([language.ready, routing.ready()])
|
|
71
|
-
await layoutPreload
|
|
72
|
-
const { authorizationRefreshKey } =
|
|
73
|
-
await import('./features/system/access/composables/useAuthorizationRefresh')
|
|
74
|
-
app.provide(authorizationRefreshKey, async () => {
|
|
75
|
-
await auth.refreshAuthorization()
|
|
76
|
-
await replaceDynamicMenusWithAccessibleFallback(routing)
|
|
77
|
-
})
|
|
78
|
-
app.mount('#app')
|
|
79
|
-
staleAssetRecovery.clear()
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
void bootstrap().catch((error: unknown) => {
|
|
83
|
-
console.error('[admin] startup failed', error)
|
|
84
|
-
const message = translateAdminError(error, {
|
|
85
|
-
fallbackKey: 'common.errors.startupFailed',
|
|
86
|
-
fallback: '应用启动失败',
|
|
87
|
-
})
|
|
88
|
-
const root = document.querySelector('#app')
|
|
89
|
-
if (root) {
|
|
90
|
-
const panel = document.createElement('main')
|
|
91
|
-
panel.style.padding = '32px'
|
|
92
|
-
panel.style.fontFamily = 'system-ui, sans-serif'
|
|
93
|
-
const heading = document.createElement('h1')
|
|
94
|
-
heading.textContent = `${'@origen-ui/admin'} ${translateAdminMessage('common.errors.startupFailed', { fallback: '启动失败' })}`
|
|
95
|
-
const detail = document.createElement('p')
|
|
96
|
-
detail.textContent = message
|
|
97
|
-
panel.append(heading, detail)
|
|
98
|
-
root.replaceChildren(panel)
|
|
99
|
-
}
|
|
100
|
-
})
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* componentKey → 页面组件 name 映射,用于生成 KeepAlive 缓存名单。
|
|
3
|
-
*
|
|
4
|
-
* KeepAlive 的 `:include` 匹配的是页面组件渲染后的 name(SFC `defineOptions({ name })`),
|
|
5
|
-
* 因此这里的值必须与各页面组件的 defineOptions name 完全一致,否则缓存失效。
|
|
6
|
-
* 修改组件 name 时必须同步更新此表,并保持 dynamicRoutes.spec.ts 断言一致。
|
|
7
|
-
*/
|
|
8
|
-
export const componentCacheNames: Readonly<Record<string, string>> = {
|
|
9
|
-
workspace: 'EmptyPage',
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export const fallbackComponentKey = 'workspace'
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { Component } from 'vue'
|
|
2
|
-
import { RouterViewHost } from '@origen-ui/router'
|
|
3
|
-
|
|
4
|
-
export { componentCacheNames, fallbackComponentKey } from './componentCache'
|
|
5
|
-
|
|
6
|
-
type ComponentLoader = () => Promise<Component>
|
|
7
|
-
|
|
8
|
-
export const componentRegistry: Map<string, ComponentLoader> = new Map([
|
|
9
|
-
[
|
|
10
|
-
'workspace',
|
|
11
|
-
() => import('../features/workspace/pages/Empty.vue').then((module) => module.default),
|
|
12
|
-
],
|
|
13
|
-
['outlet', () => Promise.resolve(RouterViewHost)],
|
|
14
|
-
])
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from 'vitest'
|
|
2
|
-
import { componentCacheNames } from './componentCache'
|
|
3
|
-
import { componentRegistry } from './componentRegistry'
|
|
4
|
-
import { routeTransformer } from './dynamicRoutes'
|
|
5
|
-
import { staticRoutes } from './staticRoutes'
|
|
6
|
-
|
|
7
|
-
describe('clean dynamic component registry', () => {
|
|
8
|
-
it('contains only the workspace shell and nested outlet', () => {
|
|
9
|
-
expect([...componentRegistry.keys()]).toEqual(['workspace', 'outlet'])
|
|
10
|
-
})
|
|
11
|
-
|
|
12
|
-
it('uses the empty workspace for an unspecified leaf component', () => {
|
|
13
|
-
const [route] = routeTransformer([
|
|
14
|
-
{ code: 'workspace', path: '/workspace', title: 'Workspace' },
|
|
15
|
-
])
|
|
16
|
-
|
|
17
|
-
expect(route?.componentKey).toBe('workspace')
|
|
18
|
-
expect(componentRegistry.has('workspace')).toBe(true)
|
|
19
|
-
})
|
|
20
|
-
|
|
21
|
-
it('rejects flat parentPath entries whose parent route does not exist', () => {
|
|
22
|
-
expect(() =>
|
|
23
|
-
routeTransformer([
|
|
24
|
-
{ code: 'orphan', path: 'orphan', parentPath: '/missing', title: 'Orphan' },
|
|
25
|
-
]),
|
|
26
|
-
).toThrow('Unresolved dynamic route parent path: /missing')
|
|
27
|
-
})
|
|
28
|
-
|
|
29
|
-
it('rejects duplicate route codes with an explicit error', () => {
|
|
30
|
-
expect(() =>
|
|
31
|
-
routeTransformer([
|
|
32
|
-
{ code: 'dup', path: '/first', title: 'First' },
|
|
33
|
-
{ code: 'dup', path: '/second', title: 'Second' },
|
|
34
|
-
]),
|
|
35
|
-
).toThrow('Duplicate dynamic route code: dup')
|
|
36
|
-
})
|
|
37
|
-
})
|
|
38
|
-
|
|
39
|
-
describe('clean keep-alive cache names', () => {
|
|
40
|
-
it('maps the workspace componentKey to the EmptyPage component name', () => {
|
|
41
|
-
expect(componentCacheNames).toEqual({ workspace: 'EmptyPage' })
|
|
42
|
-
})
|
|
43
|
-
|
|
44
|
-
it('generates cache.name from the component name mapping for cached dynamic routes', () => {
|
|
45
|
-
const [workspace] = routeTransformer([
|
|
46
|
-
{
|
|
47
|
-
code: 'workspace',
|
|
48
|
-
path: '/workspace',
|
|
49
|
-
title: 'Workspace',
|
|
50
|
-
componentKey: 'workspace',
|
|
51
|
-
cache: true,
|
|
52
|
-
},
|
|
53
|
-
])
|
|
54
|
-
|
|
55
|
-
expect(workspace?.meta?.cache).toEqual({ enabled: true, name: 'EmptyPage' })
|
|
56
|
-
})
|
|
57
|
-
|
|
58
|
-
it('omits cache meta when the source disables caching', () => {
|
|
59
|
-
const [workspace] = routeTransformer([
|
|
60
|
-
{
|
|
61
|
-
code: 'workspace',
|
|
62
|
-
path: '/workspace',
|
|
63
|
-
title: 'Workspace',
|
|
64
|
-
componentKey: 'workspace',
|
|
65
|
-
cache: false,
|
|
66
|
-
},
|
|
67
|
-
])
|
|
68
|
-
|
|
69
|
-
expect(workspace?.meta?.cache).toBeUndefined()
|
|
70
|
-
})
|
|
71
|
-
|
|
72
|
-
it('keeps the static /profile route cache name in sync with the ProfilePage component', () => {
|
|
73
|
-
const profile = staticRoutes.find((route) => route.name === 'profile')
|
|
74
|
-
|
|
75
|
-
expect(profile?.meta?.adapter?.cache).toEqual({ enabled: true, name: 'ProfilePage' })
|
|
76
|
-
})
|
|
77
|
-
})
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { RouteMenuItem } from '@origen-ui/router'
|
|
2
|
-
import type { RouteLocationRaw } from 'vue-router'
|
|
3
|
-
|
|
4
|
-
/** 授权后的默认首页路由;与 staticRoutes 根路由 redirect 由 paths.spec 钉住一致。 */
|
|
5
|
-
export const HOME_ROUTE = '/workspace'
|
|
6
|
-
|
|
7
|
-
/** staticRoutes 中 404 兜底页的路由名。 */
|
|
8
|
-
export const NOT_FOUND_ROUTE_NAME = '404'
|
|
9
|
-
|
|
10
|
-
/** 深度优先取菜单树中首个可导航入口;isReachable 用于剔除重定向到已裁撤路由的目录项。 */
|
|
11
|
-
export function firstMenuTarget(
|
|
12
|
-
items: readonly RouteMenuItem[],
|
|
13
|
-
isReachable: (to: RouteLocationRaw) => boolean = () => true,
|
|
14
|
-
): RouteLocationRaw | undefined {
|
|
15
|
-
for (const item of items) {
|
|
16
|
-
if (item.to && isReachable(item.to)) return item.to
|
|
17
|
-
const child = firstMenuTarget(item.children, isReachable)
|
|
18
|
-
if (child) return child
|
|
19
|
-
}
|
|
20
|
-
return undefined
|
|
21
|
-
}
|