@origen-ui/admin-cli 2.0.2 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -9
- package/bin/contract-sync.mjs +112 -0
- package/bin/lib/errors.mjs +8 -0
- package/bin/lib/fs-json.mjs +18 -0
- package/bin/lib/hash.mjs +9 -0
- package/bin/og-admin.mjs +165 -35
- package/bin/sync-project.mjs +717 -0
- package/package.json +20 -17
- package/templates/current/clean/.agents/skills/admin-component-usage/SKILL.md +28 -0
- package/templates/current/clean/.agents/skills/admin-component-usage/references/component-directory.md +270 -0
- package/templates/current/clean/.agents/skills/build-admin-feature/SKILL.md +20 -0
- package/templates/current/clean/.agents/skills/build-admin-feature/references/component-selection.md +38 -0
- package/templates/current/{examples/.codex → clean/.agents}/skills/use-og-form/SKILL.md +1 -1
- package/templates/current/{examples/.codex → clean/.agents}/skills/use-og-form-table/SKILL.md +4 -3
- package/templates/current/clean/{.codex → .agents}/skills/use-og-search/SKILL.md +3 -3
- package/templates/current/clean/.agents/skills/use-og-table/SKILL.md +22 -0
- package/templates/current/{examples/.codex → clean/.agents}/skills/use-og-upload/SKILL.md +6 -5
- package/templates/current/clean/.api-client-e2e.config.ts +13 -0
- package/templates/current/clean/.claude/rules/01-feature-architecture.md +10 -0
- package/templates/current/clean/.claude/rules/02-vue-typescript.md +10 -0
- package/templates/current/clean/.claude/rules/03-component-policy.md +31 -0
- package/templates/current/clean/.claude/rules/04-api-auth-router.md +10 -0
- package/templates/current/clean/.claude/rules/05-style.md +10 -0
- package/templates/current/clean/.claude/rules/06-quality.md +10 -0
- package/templates/current/clean/.claude/skills/admin-component-usage/SKILL.md +28 -0
- package/templates/current/clean/.claude/skills/admin-component-usage/references/component-directory.md +270 -0
- package/templates/current/clean/.claude/skills/build-admin-feature/SKILL.md +20 -0
- package/templates/current/clean/.claude/skills/build-admin-feature/references/component-selection.md +38 -0
- package/templates/current/clean/{.codex → .claude}/skills/use-og-form/SKILL.md +1 -1
- package/templates/current/clean/{.codex → .claude}/skills/use-og-form-table/SKILL.md +4 -3
- package/templates/current/{examples/.codex → clean/.claude}/skills/use-og-search/SKILL.md +3 -3
- package/templates/current/clean/.claude/skills/use-og-table/SKILL.md +22 -0
- package/templates/current/clean/{.codex → .claude}/skills/use-og-upload/SKILL.md +6 -5
- package/templates/current/clean/.codebuddy/rules/01-feature-architecture.md +2 -2
- package/templates/current/clean/.codebuddy/rules/03-component-policy.md +4 -1
- package/templates/current/clean/.codebuddy/skills/admin-component-usage/SKILL.md +31 -0
- package/templates/current/clean/.codebuddy/skills/admin-component-usage/references/component-directory.md +270 -0
- package/templates/current/clean/.codebuddy/skills/build-admin-feature/SKILL.md +11 -5
- package/templates/current/clean/.codebuddy/skills/build-admin-feature/references/component-selection.md +38 -0
- package/templates/current/clean/.codebuddy/skills/use-og-form/SKILL.md +1 -1
- package/templates/current/clean/.codebuddy/skills/use-og-form-table/SKILL.md +4 -3
- package/templates/current/clean/.codebuddy/skills/use-og-search/SKILL.md +3 -3
- package/templates/current/clean/.codebuddy/skills/use-og-table/SKILL.md +16 -10
- package/templates/current/clean/.codebuddy/skills/use-og-upload/SKILL.md +6 -5
- package/templates/current/clean/.codex/AGENTS.md +55 -8
- package/templates/current/clean/.codex/rules/01-feature-architecture.md +2 -2
- package/templates/current/clean/.codex/rules/03-component-policy.md +4 -1
- package/templates/current/clean/.cursor/rules/.generated +5 -0
- package/templates/current/clean/.cursor/rules/01-feature-architecture.mdc +2 -2
- package/templates/current/clean/.cursor/rules/03-component-policy.mdc +4 -1
- package/templates/current/clean/.cursor/skills/admin-component-usage/SKILL.md +28 -0
- package/templates/current/clean/.cursor/skills/admin-component-usage/references/component-directory.md +270 -0
- package/templates/current/clean/.cursor/skills/build-admin-feature/SKILL.md +11 -5
- package/templates/current/clean/.cursor/skills/build-admin-feature/references/component-selection.md +38 -0
- package/templates/current/clean/.cursor/skills/use-og-form/SKILL.md +1 -1
- package/templates/current/clean/.cursor/skills/use-og-form-table/SKILL.md +4 -3
- package/templates/current/clean/.cursor/skills/use-og-search/SKILL.md +3 -3
- package/templates/current/clean/.cursor/skills/use-og-table/SKILL.md +16 -10
- package/templates/current/clean/.cursor/skills/use-og-upload/SKILL.md +6 -5
- package/templates/current/clean/{.env.example → .env.dev} +3 -2
- package/templates/current/clean/.env.mock +4 -0
- package/templates/current/clean/.env.production +5 -0
- package/templates/current/clean/.env.test +4 -0
- package/templates/current/clean/.prettierignore +17 -0
- package/templates/current/clean/.prettierrc +8 -0
- package/templates/current/clean/.qoder/rules/01-feature-architecture.md +3 -4
- package/templates/current/clean/.qoder/rules/02-vue-typescript.md +1 -2
- package/templates/current/clean/.qoder/rules/03-component-policy.md +5 -3
- package/templates/current/clean/.qoder/rules/04-api-auth-router.md +1 -2
- package/templates/current/clean/.qoder/rules/05-style.md +1 -2
- package/templates/current/clean/.qoder/rules/06-quality.md +1 -2
- package/templates/current/clean/.qoder/skills/admin-component-usage/SKILL.md +28 -0
- package/templates/current/clean/.qoder/skills/admin-component-usage/references/component-directory.md +270 -0
- package/templates/current/clean/.qoder/skills/build-admin-feature/SKILL.md +11 -5
- package/templates/current/clean/.qoder/skills/build-admin-feature/references/component-selection.md +38 -0
- package/templates/current/clean/.qoder/skills/use-og-form/SKILL.md +1 -1
- package/templates/current/clean/.qoder/skills/use-og-form-table/SKILL.md +4 -3
- package/templates/current/clean/.qoder/skills/use-og-search/SKILL.md +3 -3
- package/templates/current/clean/.qoder/skills/use-og-table/SKILL.md +16 -10
- package/templates/current/clean/.qoder/skills/use-og-upload/SKILL.md +6 -5
- package/templates/current/clean/.zcode/skills/admin-component-usage/SKILL.md +28 -0
- package/templates/current/clean/.zcode/skills/admin-component-usage/references/component-directory.md +270 -0
- package/templates/current/clean/.zcode/skills/build-admin-feature/SKILL.md +20 -0
- package/templates/current/clean/.zcode/skills/build-admin-feature/references/component-selection.md +38 -0
- package/templates/current/clean/.zcode/skills/style-og-origen-ui/SKILL.md +11 -0
- package/templates/current/clean/.zcode/skills/use-og-dialog/SKILL.md +12 -0
- package/templates/current/clean/.zcode/skills/use-og-editor/SKILL.md +25 -0
- package/templates/current/clean/.zcode/skills/use-og-form/SKILL.md +12 -0
- package/templates/current/clean/.zcode/skills/use-og-form-table/SKILL.md +26 -0
- package/templates/current/clean/.zcode/skills/use-og-http/SKILL.md +13 -0
- package/templates/current/clean/.zcode/skills/use-og-router-tabs/SKILL.md +11 -0
- package/templates/current/clean/.zcode/skills/use-og-search/SKILL.md +14 -0
- package/templates/current/clean/.zcode/skills/use-og-table/SKILL.md +22 -0
- package/templates/current/clean/.zcode/skills/use-og-upload/SKILL.md +26 -0
- package/templates/current/clean/AGENTS.md +55 -9
- package/templates/current/clean/CHANGELOG.md +107 -0
- package/templates/current/clean/CLAUDE.md +3 -0
- package/templates/current/clean/README.md +58 -88
- package/templates/current/clean/component-catalog.json +766 -348
- package/templates/current/clean/component-catalog.v2.json +2040 -0
- package/templates/current/clean/docs/components/dialog.md +405 -0
- package/templates/current/clean/docs/components/editor-viewer.md +87 -0
- package/templates/current/clean/docs/components/editor.md +275 -0
- package/templates/current/clean/docs/components/form-table.md +222 -0
- package/templates/current/clean/docs/components/form.md +750 -0
- package/templates/current/clean/docs/components/index.md +44 -0
- package/templates/current/clean/docs/components/router.md +452 -0
- package/templates/current/clean/docs/components/search.md +1205 -0
- package/templates/current/clean/docs/components/svg-icon.md +124 -0
- package/templates/current/clean/docs/components/table-local.md +176 -0
- package/templates/current/clean/docs/components/table-with-search.md +207 -0
- package/templates/current/clean/docs/components/table.md +813 -0
- package/templates/current/clean/docs/components/tabs.md +440 -0
- package/templates/current/clean/docs/components/upload.md +349 -0
- package/templates/current/clean/eslint.config.js +89 -0
- package/templates/current/clean/index.html +1 -1
- package/templates/current/clean/openapi.json +10048 -999
- package/templates/current/clean/package.json +45 -33
- package/templates/current/clean/playwright.config.ts +20 -6
- package/templates/current/clean/playwright.mock.config.ts +42 -0
- package/templates/current/clean/pnpm-workspace.yaml +19 -3
- package/templates/current/clean/recipes/remote-crud-dialog-form.vue +15 -13
- package/templates/current/clean/scaffold.lock.json +164 -4
- package/templates/current/clean/scripts/api-codegen.config.ts +35 -0
- package/templates/current/clean/scripts/api-codegen.ts +2015 -0
- package/templates/current/clean/scripts/api-templates/http-client.ejs +359 -0
- package/templates/current/clean/scripts/check-admin-scaffold.mjs +311 -17
- package/templates/current/clean/scripts/generate-api.ts +290 -85
- package/templates/current/clean/scripts/lib/admin-component-catalog.mjs +515 -0
- package/templates/current/clean/scripts/lib/repository-root.mjs +9 -0
- package/templates/current/clean/scripts/mock-api.ts +1356 -0
- package/templates/current/clean/scripts/remove-examples.mjs +9 -34
- package/templates/current/clean/src/App.vue +9 -18
- package/templates/current/clean/src/api/generated/data-contracts.ts +23 -265
- package/templates/current/clean/src/api/generated/http-client.ts +351 -180
- package/templates/current/clean/src/api/generated/index.ts +22 -0
- package/templates/current/clean/src/api/generated/services/auth.ts +123 -0
- package/templates/current/clean/src/api/generated/services/common/files.ts +111 -0
- package/templates/current/clean/src/api/generated/services/monitor/cache.ts +164 -0
- package/templates/current/clean/src/api/generated/services/monitor/job.ts +195 -0
- package/templates/current/clean/src/api/generated/services/monitor/jobLog.ts +126 -0
- package/templates/current/clean/src/api/generated/services/monitor/logininfor.ts +126 -0
- package/templates/current/clean/src/api/generated/services/monitor/online.ts +66 -0
- package/templates/current/clean/src/api/generated/services/monitor/operlog.ts +106 -0
- package/templates/current/clean/src/api/generated/services/monitor/server.ts +41 -0
- package/templates/current/clean/src/api/generated/services/system/configs.ts +190 -0
- package/templates/current/clean/src/api/generated/services/system/departments.ts +173 -0
- package/templates/current/clean/src/api/generated/services/system/dictionaries/data.ts +169 -0
- package/templates/current/clean/src/api/generated/services/system/dictionaries/types.ts +187 -0
- package/templates/current/clean/src/api/generated/services/system/index.ts +158 -0
- package/templates/current/clean/src/api/generated/services/system/menus.ts +193 -0
- package/templates/current/clean/src/api/generated/services/system/notices.ts +221 -0
- package/templates/current/clean/src/api/generated/services/system/posts.ts +168 -0
- package/templates/current/clean/src/api/generated/services/system/roles.ts +354 -0
- package/templates/current/clean/src/api/generated/services/system/users.ts +425 -0
- package/templates/current/clean/src/api/generated/services/tool/code-generator.ts +304 -0
- package/templates/current/clean/src/api/generated/types/auth.types.ts +132 -0
- package/templates/current/clean/src/api/generated/types/common/files.types.ts +57 -0
- package/templates/current/clean/src/api/generated/types/common.ts +174 -0
- package/templates/current/clean/src/api/generated/types/enum-dict.ts +94 -0
- package/templates/current/clean/src/api/generated/types/enums.ts +155 -0
- package/templates/current/clean/src/api/generated/types/monitor/cache.types.ts +149 -0
- package/templates/current/clean/src/api/generated/types/monitor/job.types.ts +207 -0
- package/templates/current/clean/src/api/generated/types/monitor/jobLog.types.ts +134 -0
- package/templates/current/clean/src/api/generated/types/monitor/logininfor.types.ts +135 -0
- package/templates/current/clean/src/api/generated/types/monitor/online.types.ts +80 -0
- package/templates/current/clean/src/api/generated/types/monitor/operlog.types.ts +126 -0
- package/templates/current/clean/src/api/generated/types/monitor/server.types.ts +205 -0
- package/templates/current/clean/src/api/generated/types/system/configs.types.ts +200 -0
- package/templates/current/clean/src/api/generated/types/system/departments.types.ts +145 -0
- package/templates/current/clean/src/api/generated/types/system/dictionaries/data.types.ts +210 -0
- package/templates/current/clean/src/api/generated/types/system/dictionaries/types.types.ts +221 -0
- package/templates/current/clean/src/api/generated/types/system/index.types.ts +19 -0
- package/templates/current/clean/src/api/generated/types/system/menus.types.ts +234 -0
- package/templates/current/clean/src/api/generated/types/system/notices.types.ts +270 -0
- package/templates/current/clean/src/api/generated/types/system/posts.types.ts +198 -0
- package/templates/current/clean/src/api/generated/types/system/roles.types.ts +410 -0
- package/templates/current/clean/src/api/generated/types/system/users.types.ts +413 -0
- package/templates/current/clean/src/api/generated/types/tool/code-generator.types.ts +388 -0
- package/templates/current/clean/src/api/index.ts +44 -39
- package/templates/current/clean/src/app/__tests__/api-generated.types.ts +24 -0
- package/templates/current/clean/src/app/api.ts +6 -0
- package/templates/current/clean/src/app/authorization/permission.ts +9 -0
- package/templates/current/{examples/src/app → clean/src/app/config}/runtimeConfig.ts +44 -12
- package/templates/current/clean/src/app/errors/errorMessage.ts +80 -0
- package/templates/current/clean/src/app/http/client.ts +141 -0
- package/templates/current/clean/src/app/http/http-adapter.ts +71 -0
- package/templates/current/{examples/src/app → clean/src/app/i18n}/adminLocale.ts +25 -19
- package/templates/current/clean/src/app/{localeFormat.ts → i18n/localeFormat.ts} +29 -6
- package/templates/current/clean/src/app/i18n/origenUiLocale.ts +15 -0
- package/templates/current/clean/src/app/menu/menu.ts +175 -0
- package/templates/current/clean/src/app/menu/menuTypes.ts +20 -0
- package/templates/current/clean/src/{features → app}/security/devtoolsProtection.ts +8 -7
- package/templates/current/clean/src/app/ui/createAdminUi.ts +31 -0
- package/templates/current/clean/src/app/ui/iconCatalog.ts +71 -0
- package/templates/current/clean/src/assets/icons/appearance.svg +1 -0
- package/templates/current/clean/src/assets/icons/arrow-right.svg +1 -0
- package/templates/current/clean/src/assets/icons/check.svg +1 -0
- package/templates/current/clean/src/assets/icons/circle-check.svg +1 -0
- package/templates/current/clean/src/assets/icons/default.svg +4 -0
- package/templates/current/clean/src/assets/icons/directory/setting.svg +1 -0
- package/templates/current/clean/src/assets/icons/expand.svg +1 -0
- package/templates/current/clean/src/assets/icons/fold.svg +1 -0
- package/templates/current/clean/src/assets/icons/key.svg +1 -0
- package/templates/current/clean/src/assets/icons/lock.svg +1 -0
- package/templates/current/clean/src/assets/icons/monitor.svg +1 -0
- package/templates/current/clean/src/assets/icons/moon.svg +11 -0
- package/templates/current/clean/src/assets/icons/page/department.svg +1 -0
- package/templates/current/clean/src/assets/icons/page/dictionary.svg +1 -0
- package/templates/current/clean/src/assets/icons/page/menus.svg +1 -0
- package/templates/current/clean/src/assets/icons/page/user.svg +1 -0
- package/templates/current/clean/src/assets/icons/page/users.svg +1 -0
- package/templates/current/clean/src/assets/icons/plus.svg +1 -0
- package/templates/current/clean/src/assets/icons/profile.svg +1 -0
- package/templates/current/clean/src/assets/icons/refresh.svg +1 -0
- package/templates/current/clean/src/assets/icons/roles.svg +1 -0
- package/templates/current/clean/src/assets/icons/search.svg +1 -0
- package/templates/current/clean/src/assets/icons/sunny.svg +1 -0
- package/templates/current/clean/src/assets/icons/system.svg +1 -0
- package/templates/current/clean/src/assets/icons/theme-auto.svg +14 -0
- package/templates/current/clean/src/assets/icons/tune.svg +13 -0
- package/templates/current/clean/src/{features/shell/components → components}/RouteProgress.vue +2 -2
- package/templates/current/{examples/src/features/system/access → clean/src}/composables/useAuthorizationRefresh.ts +6 -1
- package/templates/current/clean/src/composables/useSystemTableSearchVisibility.ts +33 -0
- package/templates/current/clean/src/{features/appearance/composables → composables}/useTheme.ts +1 -1
- package/templates/current/clean/src/env.d.ts +6 -19
- package/templates/current/clean/src/layouts/AdminLayout.vue +7 -9
- package/templates/current/clean/src/{features/shell/components → layouts}/AdminWatermark.vue +2 -2
- package/templates/current/clean/src/layouts/BreadcrumbBar.vue +9 -1
- package/templates/current/clean/src/layouts/SideMenu.vue +7 -15
- package/templates/current/clean/src/{features/appearance/components → layouts}/ThemePanel.vue +39 -11
- package/templates/current/clean/src/layouts/TopBar.vue +60 -28
- package/templates/current/clean/src/layouts/WorkspaceTabs.vue +10 -1
- package/templates/current/clean/src/layouts/topBarMenuSearch.ts +25 -4
- package/templates/current/clean/src/locales/en-US.json +227 -219
- package/templates/current/clean/src/locales/index.ts +72 -32
- package/templates/current/clean/src/locales/messages-types.ts +15 -10
- package/templates/current/clean/src/locales/vue-i18n.d.ts +1 -1
- package/templates/current/clean/src/locales/zh-CN.json +226 -218
- package/templates/current/clean/src/locales/zh-TW.json +222 -214
- package/templates/current/clean/src/main.ts +59 -30
- package/templates/current/clean/src/router/bootstrap.ts +69 -24
- package/templates/current/clean/src/router/dynamic/componentLoader.ts +150 -0
- package/templates/current/clean/src/router/{dynamicMenuRefresh.ts → dynamic/dynamicMenuRefresh.ts} +6 -2
- package/templates/current/clean/src/router/dynamic/dynamicRoutes.ts +247 -0
- package/templates/current/clean/src/router/navigation/guards.ts +12 -0
- package/templates/current/clean/src/router/navigation/paths.ts +28 -0
- package/templates/current/clean/src/router/navigation/staticRoutes.ts +109 -0
- package/templates/current/clean/src/router/{queryEncryption.ts → query/queryEncryption.ts} +29 -12
- package/templates/current/clean/src/router/query/routeQuery.ts +29 -0
- package/templates/current/clean/src/router/{useRouteQueryDefaults.ts → query/useRouteQueryDefaults.ts} +9 -8
- package/templates/current/clean/src/router/query/useRouteQueryDefaults.types.ts +28 -0
- package/templates/current/clean/src/router/{runtimeErrorRecovery.ts → recovery/runtimeErrorRecovery.ts} +21 -3
- package/templates/current/clean/src/{features/auth/store → store}/auth.ts +96 -61
- package/templates/current/clean/src/store/dictionaries.ts +86 -0
- package/templates/current/clean/src/{features/shell/store → store}/sidebar.ts +9 -2
- package/templates/current/{examples/src/features/appearance → clean/src}/store/theme.ts +8 -4
- package/templates/current/clean/src/styles/layout.css +51 -0
- package/templates/current/clean/src/templates/og-form.ts +7 -2
- package/templates/current/clean/src/templates/og-table.ts +88 -20
- package/templates/current/clean/src/templates/router.ts +11 -2
- package/templates/current/clean/src/utils/color-mix.ts +6 -2
- package/templates/current/clean/src/utils/download.ts +11 -0
- package/templates/current/clean/src/utils/permissions.ts +1 -1
- package/templates/current/clean/src/utils/retryableDialog.ts +46 -0
- package/templates/current/clean/src/{features → views}/errors/pages/Forbidden.vue +6 -2
- package/templates/current/clean/src/views/errors/pages/MethodNotAllowed.vue +34 -0
- package/templates/current/clean/src/{features → views}/errors/pages/NotFound.vue +6 -2
- package/templates/current/clean/src/{features → views}/errors/pages/ServerError.vue +6 -2
- package/templates/current/clean/src/{features/auth/pages/Login.vue → views/login/pages/index.vue} +99 -10
- package/templates/current/clean/src/views/system/access/services/admin-repository.ts +489 -0
- package/templates/current/clean/src/views/system/access/services/rbac.ts +317 -0
- package/templates/current/clean/src/views/system/dept/components/DepartmentEditorForm.vue +87 -0
- package/templates/current/clean/src/views/system/dept/composables/useDepartmentManagement.ts +314 -0
- package/templates/current/clean/src/views/system/dept/pages/index.vue +44 -0
- package/templates/current/clean/src/views/system/dept/services/departments.ts +168 -0
- package/templates/current/clean/src/views/system/dict/components/DictionaryDataEditorForm.vue +98 -0
- package/templates/current/clean/src/views/system/dict/components/DictionaryDataPreview.vue +233 -0
- package/templates/current/clean/src/views/system/dict/components/DictionaryTypeEditorForm.vue +66 -0
- package/templates/current/clean/src/views/system/dict/composables/useDictionaryDataManagement.ts +406 -0
- package/templates/current/clean/src/views/system/dict/composables/useDictionaryTypeManagement.ts +329 -0
- package/templates/current/clean/src/views/system/dict/data/pages/index.vue +134 -0
- package/templates/current/clean/src/views/system/dict/pages/index.vue +113 -0
- package/templates/current/clean/src/views/system/dict/services/dictionaries.ts +239 -0
- package/templates/current/clean/src/views/system/menu/components/MenuEditorForm.vue +252 -0
- package/templates/current/clean/src/views/system/menu/composables/useMenuManagement.ts +357 -0
- package/templates/current/clean/src/views/system/menu/menuDraft.ts +45 -0
- package/templates/current/clean/src/views/system/menu/pages/ExternalLink.vue +37 -0
- package/templates/current/clean/src/views/system/menu/pages/index.vue +75 -0
- package/templates/current/clean/src/views/system/post/components/PostEditorForm.vue +69 -0
- package/templates/current/clean/src/views/system/post/composables/usePostManagement.ts +245 -0
- package/templates/current/clean/src/views/system/post/pages/index.vue +92 -0
- package/templates/current/clean/src/views/system/post/services/posts.ts +100 -0
- package/templates/current/clean/src/views/system/role/auth-users/pages/index.vue +100 -0
- package/templates/current/clean/src/views/system/role/components/RoleDataScopeForm.vue +167 -0
- package/templates/current/clean/src/views/system/role/components/RoleEditorForm.vue +165 -0
- package/templates/current/clean/src/views/system/role/components/RoleUserSelectForm.vue +129 -0
- package/templates/current/clean/src/views/system/role/composables/useRoleManagement.ts +422 -0
- package/templates/current/clean/src/views/system/role/composables/useRoleUserManagement.ts +233 -0
- package/templates/current/clean/src/views/system/role/pages/index.vue +110 -0
- package/templates/current/clean/src/views/system/role/services/roleAccess.ts +162 -0
- package/templates/current/clean/src/views/system/user/auth-roles/pages/index.vue +209 -0
- package/templates/current/clean/src/views/system/user/components/UserDetailsForm.vue +108 -0
- package/templates/current/clean/src/views/system/user/components/UserEditorForm.vue +207 -0
- package/templates/current/clean/src/views/system/user/components/UserImportDialog.vue +80 -0
- package/templates/current/clean/src/views/system/user/components/UserResetPasswordForm.vue +56 -0
- package/templates/current/clean/src/views/system/user/composables/useUserManagement.ts +502 -0
- package/templates/current/clean/src/views/system/user/pages/index.vue +459 -0
- package/templates/current/clean/tests/e2e/admin-access-business.spec.ts +33 -0
- package/templates/current/clean/tests/e2e/admin-shell.spec.ts +50 -0
- package/templates/current/clean/tests/e2e/fixtures/adminMockBackend.ts +95 -0
- package/templates/current/clean/tests/e2e/fixtures/labelGeometry.ts +52 -0
- package/templates/current/clean/tests/e2e/mock-api-generation.spec.ts +27 -0
- package/templates/current/clean/tests/e2e/mock-business.spec.ts +555 -0
- package/templates/current/clean/tests/e2e/mock-menu-retry-form-label.spec.ts +100 -0
- package/templates/current/clean/tests/e2e/mock-shell.spec.ts +25 -0
- package/templates/current/clean/tests/e2e/mock-tree-selection-layout.spec.ts +113 -0
- package/templates/current/clean/tests/unit/api/api-codegen.spec.ts +893 -0
- package/templates/current/clean/tests/unit/api/client.spec.ts +145 -0
- package/templates/current/clean/tests/unit/api/generated-http-client.spec.ts +290 -0
- package/templates/current/{examples/src → clean/tests/unit}/api/http-adapter.spec.ts +3 -3
- package/templates/current/clean/tests/unit/api/system-apis.spec.ts +118 -0
- package/templates/current/clean/tests/unit/app/createAdminUi.spec.ts +79 -0
- package/templates/current/clean/{src → tests/unit}/app/errorMessage.spec.ts +1 -1
- package/templates/current/clean/tests/unit/app/iconCatalog.spec.ts +12 -0
- package/templates/current/clean/tests/unit/app/menu.spec.ts +215 -0
- package/templates/current/{examples/src → clean/tests/unit}/app/origenUiLocale.spec.ts +1 -1
- package/templates/current/{examples/src → clean/tests/unit}/app/permission.spec.ts +4 -5
- package/templates/current/clean/tests/unit/app/runtimeConfig.spec.ts +36 -0
- package/templates/current/{examples/src/features → clean/tests/unit/app}/security/devtoolsProtection.spec.ts +17 -7
- package/templates/current/{examples/src/features/shell → clean/tests/unit}/composables/useRouteProgress.spec.ts +1 -1
- package/templates/current/{examples/src/features/shell/components → clean/tests/unit/layouts}/AdminWatermark.spec.ts +5 -7
- package/templates/current/{examples/src → clean/tests/unit}/layouts/topBarMenuSearch.spec.ts +25 -8
- package/templates/current/clean/{src → tests/unit}/locales/messages.spec.ts +43 -17
- package/templates/current/clean/tests/unit/router/dynamicMenuRefresh.spec.ts +151 -0
- package/templates/current/clean/tests/unit/router/dynamicRoutes.spec.ts +374 -0
- package/templates/current/clean/tests/unit/router/paths.spec.ts +103 -0
- package/templates/current/clean/{src → tests/unit}/router/queryEncryption.spec.ts +49 -12
- package/templates/current/{examples/src → clean/tests/unit}/router/routeQuery.spec.ts +8 -1
- package/templates/current/clean/{src → tests/unit}/router/runtimeErrorRecovery.spec.ts +11 -6
- package/templates/current/{examples/src → clean/tests/unit}/router/useRouteQueryDefaults.spec.ts +46 -12
- package/templates/current/clean/tests/unit/scripts/mock-api.spec.ts +440 -0
- package/templates/current/clean/{scripts → tests/unit/scripts}/vite-build-policy.spec.ts +35 -6
- package/templates/current/clean/{src/features/auth → tests/unit}/store/auth.spec.ts +68 -15
- package/templates/current/clean/tests/unit/store/dictionaries.spec.ts +106 -0
- package/templates/current/{examples/src → clean/tests/unit}/templates/templates.spec.ts +60 -16
- package/templates/current/clean/{src/utils/__tests__ → tests/unit/utils}/color-mix.spec.ts +1 -1
- package/templates/current/clean/tests/unit/utils/retryableDialog.spec.ts +61 -0
- package/templates/current/{examples/src/features/errors/pages → clean/tests/unit/views/errors}/error-pages.spec.ts +11 -7
- package/templates/current/clean/tests/unit/views/feature-composables.spec.ts +233 -0
- package/templates/current/clean/tests/unit/views/system/access/admin-repository.spec.ts +353 -0
- package/templates/current/clean/tests/unit/views/system/access/rbac.spec.ts +329 -0
- package/templates/current/clean/tests/unit/views/system/dept/departments.spec.ts +104 -0
- package/templates/current/clean/tests/unit/views/system/dict/dictionaries.spec.ts +234 -0
- package/templates/current/clean/tests/unit/views/system/menu/menuDraft.spec.ts +77 -0
- package/templates/current/clean/tests/unit/views/system/menu/useMenuManagement.spec.ts +339 -0
- package/templates/current/clean/tests/unit/views/system/user/searchControl.spec.ts +128 -0
- package/templates/current/clean/tsconfig.json +4 -19
- package/templates/current/clean/vite.build-policy.ts +97 -22
- package/templates/current/clean/vite.config.ts +50 -7
- package/templates/current/examples/.agents/skills/admin-component-usage/SKILL.md +28 -0
- package/templates/current/examples/.agents/skills/admin-component-usage/references/component-directory.md +270 -0
- package/templates/current/examples/.agents/skills/build-admin-feature/SKILL.md +20 -0
- package/templates/current/examples/.agents/skills/build-admin-feature/references/component-selection.md +38 -0
- package/templates/current/examples/.agents/skills/style-og-origen-ui/SKILL.md +11 -0
- package/templates/current/examples/.agents/skills/use-og-dialog/SKILL.md +12 -0
- package/templates/current/examples/.agents/skills/use-og-editor/SKILL.md +25 -0
- package/templates/current/examples/.agents/skills/use-og-form/SKILL.md +12 -0
- package/templates/current/examples/.agents/skills/use-og-form-table/SKILL.md +26 -0
- package/templates/current/examples/.agents/skills/use-og-http/SKILL.md +13 -0
- package/templates/current/examples/.agents/skills/use-og-router-tabs/SKILL.md +11 -0
- package/templates/current/examples/.agents/skills/use-og-search/SKILL.md +14 -0
- package/templates/current/examples/.agents/skills/use-og-table/SKILL.md +22 -0
- package/templates/current/examples/.agents/skills/use-og-upload/SKILL.md +26 -0
- package/templates/current/examples/.api-client-e2e.config.ts +13 -0
- package/templates/current/examples/.claude/rules/01-feature-architecture.md +10 -0
- package/templates/current/examples/.claude/rules/02-vue-typescript.md +10 -0
- package/templates/current/examples/.claude/rules/03-component-policy.md +31 -0
- package/templates/current/examples/.claude/rules/04-api-auth-router.md +10 -0
- package/templates/current/examples/.claude/rules/05-style.md +10 -0
- package/templates/current/examples/.claude/rules/06-quality.md +10 -0
- package/templates/current/examples/.claude/skills/admin-component-usage/SKILL.md +28 -0
- package/templates/current/examples/.claude/skills/admin-component-usage/references/component-directory.md +270 -0
- package/templates/current/examples/.claude/skills/build-admin-feature/SKILL.md +20 -0
- package/templates/current/examples/.claude/skills/build-admin-feature/references/component-selection.md +38 -0
- package/templates/current/examples/.claude/skills/style-og-origen-ui/SKILL.md +11 -0
- package/templates/current/examples/.claude/skills/use-og-dialog/SKILL.md +12 -0
- package/templates/current/examples/.claude/skills/use-og-editor/SKILL.md +25 -0
- package/templates/current/examples/.claude/skills/use-og-form/SKILL.md +12 -0
- package/templates/current/examples/.claude/skills/use-og-form-table/SKILL.md +26 -0
- package/templates/current/examples/.claude/skills/use-og-http/SKILL.md +13 -0
- package/templates/current/examples/.claude/skills/use-og-router-tabs/SKILL.md +11 -0
- package/templates/current/examples/.claude/skills/use-og-search/SKILL.md +14 -0
- package/templates/current/examples/.claude/skills/use-og-table/SKILL.md +22 -0
- package/templates/current/examples/.claude/skills/use-og-upload/SKILL.md +26 -0
- package/templates/current/examples/.codebuddy/rules/01-feature-architecture.md +2 -2
- package/templates/current/examples/.codebuddy/rules/03-component-policy.md +4 -1
- package/templates/current/examples/.codebuddy/skills/admin-component-usage/SKILL.md +31 -0
- package/templates/current/examples/.codebuddy/skills/admin-component-usage/references/component-directory.md +270 -0
- package/templates/current/examples/.codebuddy/skills/build-admin-feature/SKILL.md +11 -5
- package/templates/current/examples/.codebuddy/skills/build-admin-feature/references/component-selection.md +38 -0
- package/templates/current/examples/.codebuddy/skills/use-og-form/SKILL.md +1 -1
- package/templates/current/examples/.codebuddy/skills/use-og-form-table/SKILL.md +4 -3
- package/templates/current/examples/.codebuddy/skills/use-og-search/SKILL.md +3 -3
- package/templates/current/examples/.codebuddy/skills/use-og-table/SKILL.md +16 -10
- package/templates/current/examples/.codebuddy/skills/use-og-upload/SKILL.md +6 -5
- package/templates/current/examples/.codex/AGENTS.md +55 -8
- package/templates/current/examples/.codex/rules/01-feature-architecture.md +2 -2
- package/templates/current/examples/.codex/rules/03-component-policy.md +4 -1
- package/templates/current/examples/.cursor/rules/.generated +5 -0
- package/templates/current/examples/.cursor/rules/01-feature-architecture.mdc +2 -2
- package/templates/current/examples/.cursor/rules/03-component-policy.mdc +4 -1
- package/templates/current/examples/.cursor/skills/admin-component-usage/SKILL.md +28 -0
- package/templates/current/examples/.cursor/skills/admin-component-usage/references/component-directory.md +270 -0
- package/templates/current/examples/.cursor/skills/build-admin-feature/SKILL.md +11 -5
- package/templates/current/examples/.cursor/skills/build-admin-feature/references/component-selection.md +38 -0
- package/templates/current/examples/.cursor/skills/use-og-form/SKILL.md +1 -1
- package/templates/current/examples/.cursor/skills/use-og-form-table/SKILL.md +4 -3
- package/templates/current/examples/.cursor/skills/use-og-search/SKILL.md +3 -3
- package/templates/current/examples/.cursor/skills/use-og-table/SKILL.md +16 -10
- package/templates/current/examples/.cursor/skills/use-og-upload/SKILL.md +6 -5
- package/templates/current/examples/{.env.example → .env.dev} +3 -2
- package/templates/current/examples/.env.mock +4 -0
- package/templates/current/examples/.env.production +5 -0
- package/templates/current/examples/.env.test +4 -0
- package/templates/current/examples/.prettierignore +17 -0
- package/templates/current/examples/.prettierrc +8 -0
- package/templates/current/examples/.qoder/rules/01-feature-architecture.md +3 -4
- package/templates/current/examples/.qoder/rules/02-vue-typescript.md +1 -2
- package/templates/current/examples/.qoder/rules/03-component-policy.md +5 -3
- package/templates/current/examples/.qoder/rules/04-api-auth-router.md +1 -2
- package/templates/current/examples/.qoder/rules/05-style.md +1 -2
- package/templates/current/examples/.qoder/rules/06-quality.md +1 -2
- package/templates/current/examples/.qoder/skills/admin-component-usage/SKILL.md +28 -0
- package/templates/current/examples/.qoder/skills/admin-component-usage/references/component-directory.md +270 -0
- package/templates/current/examples/.qoder/skills/build-admin-feature/SKILL.md +11 -5
- package/templates/current/examples/.qoder/skills/build-admin-feature/references/component-selection.md +38 -0
- package/templates/current/examples/.qoder/skills/use-og-form/SKILL.md +1 -1
- package/templates/current/examples/.qoder/skills/use-og-form-table/SKILL.md +4 -3
- package/templates/current/examples/.qoder/skills/use-og-search/SKILL.md +3 -3
- package/templates/current/examples/.qoder/skills/use-og-table/SKILL.md +16 -10
- package/templates/current/examples/.qoder/skills/use-og-upload/SKILL.md +6 -5
- package/templates/current/examples/.zcode/skills/admin-component-usage/SKILL.md +28 -0
- package/templates/current/examples/.zcode/skills/admin-component-usage/references/component-directory.md +270 -0
- package/templates/current/examples/.zcode/skills/build-admin-feature/SKILL.md +20 -0
- package/templates/current/examples/.zcode/skills/build-admin-feature/references/component-selection.md +38 -0
- package/templates/current/examples/.zcode/skills/style-og-origen-ui/SKILL.md +11 -0
- package/templates/current/examples/.zcode/skills/use-og-dialog/SKILL.md +12 -0
- package/templates/current/examples/.zcode/skills/use-og-editor/SKILL.md +25 -0
- package/templates/current/examples/.zcode/skills/use-og-form/SKILL.md +12 -0
- package/templates/current/examples/.zcode/skills/use-og-form-table/SKILL.md +26 -0
- package/templates/current/examples/.zcode/skills/use-og-http/SKILL.md +13 -0
- package/templates/current/examples/.zcode/skills/use-og-router-tabs/SKILL.md +11 -0
- package/templates/current/examples/.zcode/skills/use-og-search/SKILL.md +14 -0
- package/templates/current/examples/.zcode/skills/use-og-table/SKILL.md +22 -0
- package/templates/current/examples/.zcode/skills/use-og-upload/SKILL.md +26 -0
- package/templates/current/examples/AGENTS.md +55 -9
- package/templates/current/examples/CHANGELOG.md +107 -0
- package/templates/current/examples/CLAUDE.md +3 -0
- package/templates/current/examples/README.md +58 -88
- package/templates/current/examples/component-catalog.json +766 -348
- package/templates/current/examples/component-catalog.v2.json +2040 -0
- package/templates/current/examples/docs/components/dialog.md +405 -0
- package/templates/current/examples/docs/components/editor-viewer.md +87 -0
- package/templates/current/examples/docs/components/editor.md +275 -0
- package/templates/current/examples/docs/components/form-table.md +222 -0
- package/templates/current/examples/docs/components/form.md +750 -0
- package/templates/current/examples/docs/components/index.md +44 -0
- package/templates/current/examples/docs/components/router.md +452 -0
- package/templates/current/examples/docs/components/search.md +1205 -0
- package/templates/current/examples/docs/components/svg-icon.md +124 -0
- package/templates/current/examples/docs/components/table-local.md +176 -0
- package/templates/current/examples/docs/components/table-with-search.md +207 -0
- package/templates/current/examples/docs/components/table.md +813 -0
- package/templates/current/examples/docs/components/tabs.md +440 -0
- package/templates/current/examples/docs/components/upload.md +349 -0
- package/templates/current/examples/eslint.config.js +89 -0
- package/templates/current/examples/index.html +1 -1
- package/templates/current/examples/openapi.json +10048 -999
- package/templates/current/examples/package.json +45 -33
- package/templates/current/examples/playwright.config.ts +20 -6
- package/templates/current/examples/playwright.mock.config.ts +42 -0
- package/templates/current/examples/pnpm-workspace.yaml +19 -3
- package/templates/current/examples/recipes/remote-crud-dialog-form.vue +15 -13
- package/templates/current/examples/scaffold.lock.json +164 -4
- package/templates/current/examples/scripts/api-codegen.config.ts +35 -0
- package/templates/current/examples/scripts/api-codegen.ts +2015 -0
- package/templates/current/examples/scripts/api-templates/http-client.ejs +359 -0
- package/templates/current/examples/scripts/check-admin-scaffold.mjs +311 -17
- package/templates/current/examples/scripts/generate-api.ts +290 -85
- package/templates/current/examples/scripts/lib/admin-component-catalog.mjs +515 -0
- package/templates/current/examples/scripts/lib/repository-root.mjs +9 -0
- package/templates/current/examples/scripts/mock-api.ts +1356 -0
- package/templates/current/examples/scripts/remove-examples.mjs +9 -34
- package/templates/current/examples/src/App.vue +9 -18
- package/templates/current/examples/src/api/generated/data-contracts.ts +23 -265
- package/templates/current/examples/src/api/generated/http-client.ts +351 -180
- package/templates/current/examples/src/api/generated/index.ts +22 -0
- package/templates/current/examples/src/api/generated/services/auth.ts +123 -0
- package/templates/current/examples/src/api/generated/services/common/files.ts +111 -0
- package/templates/current/examples/src/api/generated/services/monitor/cache.ts +164 -0
- package/templates/current/examples/src/api/generated/services/monitor/job.ts +195 -0
- package/templates/current/examples/src/api/generated/services/monitor/jobLog.ts +126 -0
- package/templates/current/examples/src/api/generated/services/monitor/logininfor.ts +126 -0
- package/templates/current/examples/src/api/generated/services/monitor/online.ts +66 -0
- package/templates/current/examples/src/api/generated/services/monitor/operlog.ts +106 -0
- package/templates/current/examples/src/api/generated/services/monitor/server.ts +41 -0
- package/templates/current/examples/src/api/generated/services/system/configs.ts +190 -0
- package/templates/current/examples/src/api/generated/services/system/departments.ts +173 -0
- package/templates/current/examples/src/api/generated/services/system/dictionaries/data.ts +169 -0
- package/templates/current/examples/src/api/generated/services/system/dictionaries/types.ts +187 -0
- package/templates/current/examples/src/api/generated/services/system/index.ts +158 -0
- package/templates/current/examples/src/api/generated/services/system/menus.ts +193 -0
- package/templates/current/examples/src/api/generated/services/system/notices.ts +221 -0
- package/templates/current/examples/src/api/generated/services/system/posts.ts +168 -0
- package/templates/current/examples/src/api/generated/services/system/roles.ts +354 -0
- package/templates/current/examples/src/api/generated/services/system/users.ts +425 -0
- package/templates/current/examples/src/api/generated/services/tool/code-generator.ts +304 -0
- package/templates/current/examples/src/api/generated/types/auth.types.ts +132 -0
- package/templates/current/examples/src/api/generated/types/common/files.types.ts +57 -0
- package/templates/current/examples/src/api/generated/types/common.ts +174 -0
- package/templates/current/examples/src/api/generated/types/enum-dict.ts +94 -0
- package/templates/current/examples/src/api/generated/types/enums.ts +155 -0
- package/templates/current/examples/src/api/generated/types/monitor/cache.types.ts +149 -0
- package/templates/current/examples/src/api/generated/types/monitor/job.types.ts +207 -0
- package/templates/current/examples/src/api/generated/types/monitor/jobLog.types.ts +134 -0
- package/templates/current/examples/src/api/generated/types/monitor/logininfor.types.ts +135 -0
- package/templates/current/examples/src/api/generated/types/monitor/online.types.ts +80 -0
- package/templates/current/examples/src/api/generated/types/monitor/operlog.types.ts +126 -0
- package/templates/current/examples/src/api/generated/types/monitor/server.types.ts +205 -0
- package/templates/current/examples/src/api/generated/types/system/configs.types.ts +200 -0
- package/templates/current/examples/src/api/generated/types/system/departments.types.ts +145 -0
- package/templates/current/examples/src/api/generated/types/system/dictionaries/data.types.ts +210 -0
- package/templates/current/examples/src/api/generated/types/system/dictionaries/types.types.ts +221 -0
- package/templates/current/examples/src/api/generated/types/system/index.types.ts +19 -0
- package/templates/current/examples/src/api/generated/types/system/menus.types.ts +234 -0
- package/templates/current/examples/src/api/generated/types/system/notices.types.ts +270 -0
- package/templates/current/examples/src/api/generated/types/system/posts.types.ts +198 -0
- package/templates/current/examples/src/api/generated/types/system/roles.types.ts +410 -0
- package/templates/current/examples/src/api/generated/types/system/users.types.ts +413 -0
- package/templates/current/examples/src/api/generated/types/tool/code-generator.types.ts +388 -0
- package/templates/current/examples/src/api/index.ts +44 -39
- package/templates/current/examples/src/app/__tests__/api-generated.types.ts +24 -0
- package/templates/current/examples/src/app/api.ts +6 -0
- package/templates/current/examples/src/app/authorization/permission.ts +9 -0
- package/templates/current/{clean/src/app → examples/src/app/config}/runtimeConfig.ts +44 -12
- package/templates/current/examples/src/app/errors/errorMessage.ts +80 -0
- package/templates/current/examples/src/app/http/client.ts +141 -0
- package/templates/current/examples/src/app/http/http-adapter.ts +71 -0
- package/templates/current/{clean/src/app → examples/src/app/i18n}/adminLocale.ts +25 -19
- package/templates/current/examples/src/app/{localeFormat.ts → i18n/localeFormat.ts} +29 -6
- package/templates/current/examples/src/app/i18n/origenUiLocale.ts +15 -0
- package/templates/current/examples/src/app/menu/menu.ts +175 -0
- package/templates/current/examples/src/app/menu/menuTypes.ts +20 -0
- package/templates/current/examples/src/{features → app}/security/devtoolsProtection.ts +8 -7
- package/templates/current/examples/src/app/ui/createAdminUi.ts +31 -0
- package/templates/current/examples/src/app/ui/iconCatalog.ts +71 -0
- package/templates/current/examples/src/assets/icons/appearance.svg +1 -0
- package/templates/current/examples/src/assets/icons/arrow-right.svg +1 -0
- package/templates/current/examples/src/assets/icons/check.svg +1 -0
- package/templates/current/examples/src/assets/icons/circle-check.svg +1 -0
- package/templates/current/examples/src/assets/icons/default.svg +4 -0
- package/templates/current/examples/src/assets/icons/directory/setting.svg +1 -0
- package/templates/current/examples/src/assets/icons/expand.svg +1 -0
- package/templates/current/examples/src/assets/icons/fold.svg +1 -0
- package/templates/current/examples/src/assets/icons/key.svg +1 -0
- package/templates/current/examples/src/assets/icons/lock.svg +1 -0
- package/templates/current/examples/src/assets/icons/monitor.svg +1 -0
- package/templates/current/examples/src/assets/icons/moon.svg +11 -0
- package/templates/current/examples/src/assets/icons/page/department.svg +1 -0
- package/templates/current/examples/src/assets/icons/page/dictionary.svg +1 -0
- package/templates/current/examples/src/assets/icons/page/menus.svg +1 -0
- package/templates/current/examples/src/assets/icons/page/user.svg +1 -0
- package/templates/current/examples/src/assets/icons/page/users.svg +1 -0
- package/templates/current/examples/src/assets/icons/plus.svg +1 -0
- package/templates/current/examples/src/assets/icons/profile.svg +1 -0
- package/templates/current/examples/src/assets/icons/refresh.svg +1 -0
- package/templates/current/examples/src/assets/icons/roles.svg +1 -0
- package/templates/current/examples/src/assets/icons/search.svg +1 -0
- package/templates/current/examples/src/assets/icons/sunny.svg +1 -0
- package/templates/current/examples/src/assets/icons/system.svg +1 -0
- package/templates/current/examples/src/assets/icons/theme-auto.svg +14 -0
- package/templates/current/examples/src/assets/icons/tune.svg +13 -0
- package/templates/current/examples/src/{features/shell/components → components}/RouteProgress.vue +2 -2
- package/templates/current/{clean/src/features/system/access → examples/src}/composables/useAuthorizationRefresh.ts +6 -1
- package/templates/current/examples/src/composables/useSystemTableSearchVisibility.ts +33 -0
- package/templates/current/examples/src/{features/appearance/composables → composables}/useTheme.ts +1 -1
- package/templates/current/examples/src/env.d.ts +6 -19
- package/templates/current/examples/src/layouts/AdminLayout.vue +7 -9
- package/templates/current/examples/src/{features/shell/components → layouts}/AdminWatermark.vue +2 -2
- package/templates/current/examples/src/layouts/BreadcrumbBar.vue +9 -1
- package/templates/current/examples/src/layouts/SideMenu.vue +7 -15
- package/templates/current/examples/src/{features/appearance/components → layouts}/ThemePanel.vue +39 -11
- package/templates/current/examples/src/layouts/TopBar.vue +60 -28
- package/templates/current/examples/src/layouts/WorkspaceTabs.vue +10 -1
- package/templates/current/examples/src/layouts/topBarMenuSearch.ts +25 -4
- package/templates/current/examples/src/locales/en-US.json +227 -219
- package/templates/current/examples/src/locales/index.ts +72 -32
- package/templates/current/examples/src/locales/messages-types.ts +15 -10
- package/templates/current/examples/src/locales/vue-i18n.d.ts +1 -1
- package/templates/current/examples/src/locales/zh-CN.json +226 -218
- package/templates/current/examples/src/locales/zh-TW.json +222 -214
- package/templates/current/examples/src/main.ts +50 -40
- package/templates/current/examples/src/router/bootstrap.ts +69 -24
- package/templates/current/examples/src/router/dynamic/componentLoader.ts +150 -0
- package/templates/current/examples/src/router/{dynamicMenuRefresh.ts → dynamic/dynamicMenuRefresh.ts} +6 -2
- package/templates/current/examples/src/router/dynamic/dynamicRoutes.ts +247 -0
- package/templates/current/examples/src/router/navigation/guards.ts +12 -0
- package/templates/current/examples/src/router/navigation/paths.ts +28 -0
- package/templates/current/examples/src/router/navigation/staticRoutes.ts +109 -0
- package/templates/current/examples/src/router/{queryEncryption.ts → query/queryEncryption.ts} +29 -12
- package/templates/current/examples/src/router/query/routeQuery.ts +29 -0
- package/templates/current/examples/src/router/{useRouteQueryDefaults.ts → query/useRouteQueryDefaults.ts} +9 -8
- package/templates/current/examples/src/router/query/useRouteQueryDefaults.types.ts +28 -0
- package/templates/current/examples/src/router/{runtimeErrorRecovery.ts → recovery/runtimeErrorRecovery.ts} +21 -3
- package/templates/current/examples/src/{features/auth/store → store}/auth.ts +96 -61
- package/templates/current/examples/src/store/dictionaries.ts +86 -0
- package/templates/current/examples/src/{features/shell/store → store}/sidebar.ts +9 -2
- package/templates/current/{clean/src/features/appearance → examples/src}/store/theme.ts +8 -4
- package/templates/current/examples/src/styles/layout.css +51 -0
- package/templates/current/examples/src/templates/og-form.ts +7 -2
- package/templates/current/examples/src/templates/og-table.ts +88 -20
- package/templates/current/examples/src/templates/router.ts +11 -2
- package/templates/current/examples/src/utils/color-mix.ts +6 -2
- package/templates/current/examples/src/utils/download.ts +11 -0
- package/templates/current/examples/src/utils/permissions.ts +1 -1
- package/templates/current/examples/src/utils/retryableDialog.ts +46 -0
- package/templates/current/{clean/scripts/clean-overlay/src/features → examples/src/views}/errors/pages/Forbidden.vue +6 -2
- package/templates/current/examples/src/views/errors/pages/MethodNotAllowed.vue +34 -0
- package/templates/current/examples/{scripts/clean-overlay/src/features → src/views}/errors/pages/NotFound.vue +6 -2
- package/templates/current/examples/{scripts/clean-overlay/src/features → src/views}/errors/pages/ServerError.vue +6 -2
- package/templates/current/examples/src/{features/auth/pages/Login.vue → views/login/pages/index.vue} +99 -10
- package/templates/current/examples/src/views/system/access/services/admin-repository.ts +489 -0
- package/templates/current/examples/src/views/system/access/services/rbac.ts +317 -0
- package/templates/current/examples/src/views/system/dept/components/DepartmentEditorForm.vue +87 -0
- package/templates/current/examples/src/views/system/dept/composables/useDepartmentManagement.ts +314 -0
- package/templates/current/examples/src/views/system/dept/pages/index.vue +44 -0
- package/templates/current/examples/src/views/system/dept/services/departments.ts +168 -0
- package/templates/current/examples/src/views/system/dict/components/DictionaryDataEditorForm.vue +98 -0
- package/templates/current/examples/src/views/system/dict/components/DictionaryDataPreview.vue +233 -0
- package/templates/current/examples/src/views/system/dict/components/DictionaryTypeEditorForm.vue +66 -0
- package/templates/current/examples/src/views/system/dict/composables/useDictionaryDataManagement.ts +406 -0
- package/templates/current/examples/src/views/system/dict/composables/useDictionaryTypeManagement.ts +329 -0
- package/templates/current/examples/src/views/system/dict/data/pages/index.vue +134 -0
- package/templates/current/examples/src/views/system/dict/pages/index.vue +113 -0
- package/templates/current/examples/src/views/system/dict/services/dictionaries.ts +239 -0
- package/templates/current/examples/src/views/system/menu/components/MenuEditorForm.vue +252 -0
- package/templates/current/examples/src/views/system/menu/composables/useMenuManagement.ts +357 -0
- package/templates/current/examples/src/views/system/menu/menuDraft.ts +45 -0
- package/templates/current/examples/src/views/system/menu/pages/ExternalLink.vue +37 -0
- package/templates/current/examples/src/views/system/menu/pages/index.vue +75 -0
- package/templates/current/examples/src/views/system/post/components/PostEditorForm.vue +69 -0
- package/templates/current/examples/src/views/system/post/composables/usePostManagement.ts +245 -0
- package/templates/current/examples/src/views/system/post/pages/index.vue +92 -0
- package/templates/current/examples/src/views/system/post/services/posts.ts +100 -0
- package/templates/current/examples/src/views/system/role/auth-users/pages/index.vue +100 -0
- package/templates/current/examples/src/views/system/role/components/RoleDataScopeForm.vue +167 -0
- package/templates/current/examples/src/views/system/role/components/RoleEditorForm.vue +165 -0
- package/templates/current/examples/src/views/system/role/components/RoleUserSelectForm.vue +129 -0
- package/templates/current/examples/src/views/system/role/composables/useRoleManagement.ts +422 -0
- package/templates/current/examples/src/views/system/role/composables/useRoleUserManagement.ts +233 -0
- package/templates/current/examples/src/views/system/role/pages/index.vue +110 -0
- package/templates/current/examples/src/views/system/role/services/roleAccess.ts +162 -0
- package/templates/current/examples/src/views/system/user/auth-roles/pages/index.vue +209 -0
- package/templates/current/examples/src/views/system/user/components/UserDetailsForm.vue +108 -0
- package/templates/current/examples/src/views/system/user/components/UserEditorForm.vue +207 -0
- package/templates/current/examples/src/views/system/user/components/UserImportDialog.vue +80 -0
- package/templates/current/examples/src/views/system/user/components/UserResetPasswordForm.vue +56 -0
- package/templates/current/examples/src/views/system/user/composables/useUserManagement.ts +502 -0
- package/templates/current/examples/src/views/system/user/pages/index.vue +459 -0
- package/templates/current/examples/tests/e2e/admin-access-business.spec.ts +33 -0
- package/templates/current/examples/tests/e2e/admin-shell.spec.ts +50 -0
- package/templates/current/examples/tests/e2e/fixtures/adminMockBackend.ts +95 -0
- package/templates/current/examples/tests/e2e/fixtures/labelGeometry.ts +52 -0
- package/templates/current/examples/tests/e2e/mock-api-generation.spec.ts +27 -0
- package/templates/current/examples/tests/e2e/mock-business.spec.ts +555 -0
- package/templates/current/examples/tests/e2e/mock-menu-retry-form-label.spec.ts +100 -0
- package/templates/current/examples/tests/e2e/mock-shell.spec.ts +25 -0
- package/templates/current/examples/tests/e2e/mock-tree-selection-layout.spec.ts +113 -0
- package/templates/current/examples/tests/unit/api/api-codegen.spec.ts +893 -0
- package/templates/current/examples/tests/unit/api/client.spec.ts +145 -0
- package/templates/current/examples/tests/unit/api/generated-http-client.spec.ts +290 -0
- package/templates/current/{clean/src → examples/tests/unit}/api/http-adapter.spec.ts +3 -3
- package/templates/current/examples/tests/unit/api/system-apis.spec.ts +118 -0
- package/templates/current/examples/tests/unit/app/createAdminUi.spec.ts +79 -0
- package/templates/current/examples/{src → tests/unit}/app/errorMessage.spec.ts +1 -1
- package/templates/current/examples/tests/unit/app/iconCatalog.spec.ts +12 -0
- package/templates/current/examples/tests/unit/app/menu.spec.ts +215 -0
- package/templates/current/{clean/src → examples/tests/unit}/app/origenUiLocale.spec.ts +1 -1
- package/templates/current/{clean/src → examples/tests/unit}/app/permission.spec.ts +4 -5
- package/templates/current/examples/tests/unit/app/runtimeConfig.spec.ts +36 -0
- package/templates/current/{clean/src/features → examples/tests/unit/app}/security/devtoolsProtection.spec.ts +17 -7
- package/templates/current/{clean/src/features/shell → examples/tests/unit}/composables/useRouteProgress.spec.ts +1 -1
- package/templates/current/{clean/src/features/shell/components → examples/tests/unit/layouts}/AdminWatermark.spec.ts +5 -7
- package/templates/current/{clean/src → examples/tests/unit}/layouts/topBarMenuSearch.spec.ts +25 -8
- package/templates/current/examples/{src → tests/unit}/locales/messages.spec.ts +43 -17
- package/templates/current/examples/tests/unit/router/dynamicMenuRefresh.spec.ts +151 -0
- package/templates/current/examples/tests/unit/router/dynamicRoutes.spec.ts +374 -0
- package/templates/current/examples/tests/unit/router/paths.spec.ts +103 -0
- package/templates/current/examples/{src → tests/unit}/router/queryEncryption.spec.ts +49 -12
- package/templates/current/{clean/src → examples/tests/unit}/router/routeQuery.spec.ts +8 -1
- package/templates/current/examples/{src → tests/unit}/router/runtimeErrorRecovery.spec.ts +11 -6
- package/templates/current/{clean/src → examples/tests/unit}/router/useRouteQueryDefaults.spec.ts +46 -12
- package/templates/current/examples/tests/unit/scripts/mock-api.spec.ts +440 -0
- package/templates/current/examples/{scripts → tests/unit/scripts}/vite-build-policy.spec.ts +35 -6
- package/templates/current/examples/{src/features/auth → tests/unit}/store/auth.spec.ts +68 -15
- package/templates/current/examples/tests/unit/store/dictionaries.spec.ts +106 -0
- package/templates/current/{clean/src → examples/tests/unit}/templates/templates.spec.ts +60 -16
- package/templates/current/examples/{src/utils/__tests__ → tests/unit/utils}/color-mix.spec.ts +1 -1
- package/templates/current/examples/tests/unit/utils/retryableDialog.spec.ts +61 -0
- package/templates/current/examples/{scripts/clean-overlay/src/features/errors/pages → tests/unit/views/errors}/error-pages.spec.ts +12 -9
- package/templates/current/examples/tests/unit/views/feature-composables.spec.ts +233 -0
- package/templates/current/examples/tests/unit/views/system/access/admin-repository.spec.ts +353 -0
- package/templates/current/examples/tests/unit/views/system/access/rbac.spec.ts +329 -0
- package/templates/current/examples/tests/unit/views/system/dept/departments.spec.ts +104 -0
- package/templates/current/examples/tests/unit/views/system/dict/dictionaries.spec.ts +234 -0
- package/templates/current/examples/tests/unit/views/system/menu/menuDraft.spec.ts +77 -0
- package/templates/current/examples/tests/unit/views/system/menu/useMenuManagement.spec.ts +339 -0
- package/templates/current/examples/tests/unit/views/system/user/searchControl.spec.ts +128 -0
- package/templates/current/examples/tsconfig.json +4 -19
- package/templates/current/examples/vite.build-policy.ts +97 -22
- package/templates/current/examples/vite.config.ts +50 -7
- package/templates/current/clean/.codebuddy/AGENTS.md +0 -18
- package/templates/current/clean/.codex/skills/build-admin-feature/SKILL.md +0 -14
- package/templates/current/clean/.codex/skills/build-admin-feature/references/component-selection.md +0 -25
- package/templates/current/clean/.codex/skills/use-og-table/SKILL.md +0 -16
- package/templates/current/clean/.cursor/AGENTS.md +0 -18
- package/templates/current/clean/.env.production.example +0 -31
- package/templates/current/clean/.qoder/AGENTS.md +0 -15
- package/templates/current/clean/e2e/admin-shell.spec.ts +0 -156
- package/templates/current/clean/e2e/demo-shell.spec.ts +0 -372
- package/templates/current/clean/playwright.demo.config.ts +0 -25
- package/templates/current/clean/scripts/clean-overlay/src/features/errors/pages/NotFound.vue +0 -31
- package/templates/current/clean/scripts/clean-overlay/src/features/errors/pages/ServerError.vue +0 -31
- package/templates/current/clean/scripts/clean-overlay/src/features/errors/pages/error-pages.spec.ts +0 -41
- package/templates/current/clean/scripts/clean-overlay/src/main.ts +0 -100
- package/templates/current/clean/scripts/clean-overlay/src/router/componentCache.ts +0 -12
- package/templates/current/clean/scripts/clean-overlay/src/router/componentRegistry.ts +0 -14
- package/templates/current/clean/scripts/clean-overlay/src/router/dynamicRoutes.spec.ts +0 -77
- package/templates/current/clean/scripts/clean-overlay/src/router/paths.ts +0 -21
- package/templates/current/clean/scripts/clean-overlay/src/router/staticRoutes.ts +0 -63
- package/templates/current/clean/scripts/demo-api.ts +0 -873
- package/templates/current/clean/src/api/client.spec.ts +0 -66
- package/templates/current/clean/src/api/client.ts +0 -152
- package/templates/current/clean/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/345/206/205/345/256/271/346/226/207/347/253/240.ts +0 -144
- package/templates/current/clean/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/345/256/241/350/256/241.ts +0 -50
- package/templates/current/clean/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/346/226/207/344/273/266/344/270/212/344/274/240.ts +0 -63
- package/templates/current/clean/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/347/224/250/346/210/267.ts +0 -169
- package/templates/current/clean/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/350/217/234/345/215/225.ts +0 -180
- package/templates/current/clean/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/350/247/222/350/211/262.ts +0 -167
- package/templates/current/clean/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/350/256/242/345/215/225/350/215/211/347/250/277.ts +0 -168
- package/templates/current/clean/src/api/generated//350/256/244/350/257/201.ts +0 -95
- package/templates/current/clean/src/api/http-adapter.ts +0 -83
- package/templates/current/clean/src/app/createAdminUi.spec.ts +0 -166
- package/templates/current/clean/src/app/createAdminUi.ts +0 -63
- package/templates/current/clean/src/app/embedded-token.spec.ts +0 -40
- package/templates/current/clean/src/app/embedded.spec.ts +0 -135
- package/templates/current/clean/src/app/embedded.ts +0 -255
- package/templates/current/clean/src/app/errorMessage.ts +0 -53
- package/templates/current/clean/src/app/menu-host.spec.ts +0 -77
- package/templates/current/clean/src/app/menu.spec.ts +0 -320
- package/templates/current/clean/src/app/menu.ts +0 -308
- package/templates/current/clean/src/app/menuTypes.ts +0 -18
- package/templates/current/clean/src/app/origenUiLocale.ts +0 -10
- package/templates/current/clean/src/app/permission.ts +0 -9
- package/templates/current/clean/src/demo-api.spec.ts +0 -478
- package/templates/current/clean/src/features/errors/pages/error-pages.spec.ts +0 -41
- package/templates/current/clean/src/features/system/access/api/admin-repository.spec.ts +0 -14
- package/templates/current/clean/src/features/system/access/api/admin-repository.ts +0 -298
- package/templates/current/clean/src/features/system/access/api/rbac.spec.ts +0 -72
- package/templates/current/clean/src/features/system/access/api/rbac.ts +0 -292
- package/templates/current/clean/src/features/system/access/composables/useAuthorizationPolling.spec.ts +0 -134
- package/templates/current/clean/src/features/system/access/composables/useAuthorizationPolling.ts +0 -96
- package/templates/current/clean/src/features/workspace/pages/Profile.vue +0 -185
- package/templates/current/clean/src/router/componentCache.ts +0 -12
- package/templates/current/clean/src/router/componentRegistry.ts +0 -14
- package/templates/current/clean/src/router/dynamicMenuRefresh.spec.ts +0 -101
- package/templates/current/clean/src/router/dynamicRoutes.spec.ts +0 -77
- package/templates/current/clean/src/router/dynamicRoutes.ts +0 -177
- package/templates/current/clean/src/router/guards.ts +0 -5
- package/templates/current/clean/src/router/paths.spec.ts +0 -50
- package/templates/current/clean/src/router/paths.ts +0 -21
- package/templates/current/clean/src/router/routeQuery.ts +0 -6
- package/templates/current/clean/src/router/staticRoutes.ts +0 -63
- package/templates/current/clean/src/router/useRouteQueryDefaults.types.ts +0 -20
- package/templates/current/examples/.codebuddy/AGENTS.md +0 -18
- package/templates/current/examples/.codex/skills/build-admin-feature/SKILL.md +0 -14
- package/templates/current/examples/.codex/skills/build-admin-feature/references/component-selection.md +0 -25
- package/templates/current/examples/.codex/skills/use-og-table/SKILL.md +0 -16
- package/templates/current/examples/.cursor/AGENTS.md +0 -18
- package/templates/current/examples/.env.production.example +0 -31
- package/templates/current/examples/.qoder/AGENTS.md +0 -15
- package/templates/current/examples/e2e/admin-shell.spec.ts +0 -156
- package/templates/current/examples/e2e/demo-shell.spec.ts +0 -372
- package/templates/current/examples/playwright.demo.config.ts +0 -25
- package/templates/current/examples/scripts/clean-overlay/src/features/errors/pages/Forbidden.vue +0 -31
- package/templates/current/examples/scripts/clean-overlay/src/main.ts +0 -100
- package/templates/current/examples/scripts/clean-overlay/src/router/componentCache.ts +0 -12
- package/templates/current/examples/scripts/clean-overlay/src/router/componentRegistry.ts +0 -14
- package/templates/current/examples/scripts/clean-overlay/src/router/dynamicRoutes.spec.ts +0 -77
- package/templates/current/examples/scripts/clean-overlay/src/router/paths.ts +0 -21
- package/templates/current/examples/scripts/clean-overlay/src/router/staticRoutes.ts +0 -63
- package/templates/current/examples/scripts/demo-api.ts +0 -873
- package/templates/current/examples/src/api/client.spec.ts +0 -66
- package/templates/current/examples/src/api/client.ts +0 -152
- package/templates/current/examples/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/345/206/205/345/256/271/346/226/207/347/253/240.ts +0 -144
- package/templates/current/examples/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/345/256/241/350/256/241.ts +0 -50
- package/templates/current/examples/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/346/226/207/344/273/266/344/270/212/344/274/240.ts +0 -63
- package/templates/current/examples/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/347/224/250/346/210/267.ts +0 -169
- package/templates/current/examples/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/350/217/234/345/215/225.ts +0 -180
- package/templates/current/examples/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/350/247/222/350/211/262.ts +0 -167
- package/templates/current/examples/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/350/256/242/345/215/225/350/215/211/347/250/277.ts +0 -168
- package/templates/current/examples/src/api/generated//350/256/244/350/257/201.ts +0 -95
- package/templates/current/examples/src/api/http-adapter.ts +0 -83
- package/templates/current/examples/src/app/createAdminUi.spec.ts +0 -166
- package/templates/current/examples/src/app/createAdminUi.ts +0 -63
- package/templates/current/examples/src/app/embedded-token.spec.ts +0 -40
- package/templates/current/examples/src/app/embedded.spec.ts +0 -135
- package/templates/current/examples/src/app/embedded.ts +0 -255
- package/templates/current/examples/src/app/errorMessage.ts +0 -53
- package/templates/current/examples/src/app/menu-host.spec.ts +0 -77
- package/templates/current/examples/src/app/menu.spec.ts +0 -320
- package/templates/current/examples/src/app/menu.ts +0 -308
- package/templates/current/examples/src/app/menuTypes.ts +0 -18
- package/templates/current/examples/src/app/origenUiLocale.ts +0 -10
- package/templates/current/examples/src/app/permission.ts +0 -9
- package/templates/current/examples/src/demo-api.spec.ts +0 -478
- package/templates/current/examples/src/features/errors/pages/Forbidden.vue +0 -31
- package/templates/current/examples/src/features/errors/pages/NotFound.vue +0 -31
- package/templates/current/examples/src/features/errors/pages/ServerError.vue +0 -31
- package/templates/current/examples/src/features/feature-composables.spec.ts +0 -245
- package/templates/current/examples/src/features/system/access/api/admin-repository.spec.ts +0 -14
- package/templates/current/examples/src/features/system/access/api/admin-repository.ts +0 -298
- package/templates/current/examples/src/features/system/access/api/rbac.spec.ts +0 -72
- package/templates/current/examples/src/features/system/access/api/rbac.ts +0 -292
- package/templates/current/examples/src/features/system/access/composables/useAuthorizationPolling.spec.ts +0 -134
- package/templates/current/examples/src/features/system/access/composables/useAuthorizationPolling.ts +0 -96
- package/templates/current/examples/src/features/system/audit/composables/useAuditManagement.ts +0 -122
- package/templates/current/examples/src/features/system/audit/pages/AuditList.vue +0 -20
- package/templates/current/examples/src/features/system/menus/components/MenuEditorForm.vue +0 -279
- package/templates/current/examples/src/features/system/menus/composables/useMenuManagement.ts +0 -435
- package/templates/current/examples/src/features/system/menus/menuDraft.spec.ts +0 -204
- package/templates/current/examples/src/features/system/menus/menuDraft.ts +0 -116
- package/templates/current/examples/src/features/system/menus/menuTreePrecheck.spec.ts +0 -268
- package/templates/current/examples/src/features/system/menus/menuTreePrecheck.ts +0 -317
- package/templates/current/examples/src/features/system/menus/pages/MenuList.vue +0 -51
- package/templates/current/examples/src/features/system/roles/components/RoleEditorForm.vue +0 -116
- package/templates/current/examples/src/features/system/roles/composables/useRoleManagement.ts +0 -194
- package/templates/current/examples/src/features/system/roles/pages/RoleList.vue +0 -47
- package/templates/current/examples/src/features/system/users/components/UserEditorForm.vue +0 -104
- package/templates/current/examples/src/features/system/users/composables/useUserManagement.ts +0 -228
- package/templates/current/examples/src/features/system/users/pages/UserList.vue +0 -51
- package/templates/current/examples/src/features/workspace/pages/Dashboard.spec.ts +0 -41
- package/templates/current/examples/src/features/workspace/pages/Dashboard.vue +0 -325
- package/templates/current/examples/src/features/workspace/pages/Profile.vue +0 -185
- package/templates/current/examples/src/router/componentCache.ts +0 -18
- package/templates/current/examples/src/router/componentRegistry.ts +0 -66
- package/templates/current/examples/src/router/dynamicMenuRefresh.spec.ts +0 -101
- package/templates/current/examples/src/router/dynamicRoutes.spec.ts +0 -144
- package/templates/current/examples/src/router/dynamicRoutes.ts +0 -177
- package/templates/current/examples/src/router/guards.ts +0 -5
- package/templates/current/examples/src/router/paths.spec.ts +0 -50
- package/templates/current/examples/src/router/paths.ts +0 -21
- package/templates/current/examples/src/router/routeQuery.ts +0 -6
- package/templates/current/examples/src/router/staticRoutes.ts +0 -63
- package/templates/current/examples/src/router/useRouteQueryDefaults.types.ts +0 -20
- /package/templates/current/clean/{.codex → .agents}/skills/style-og-origen-ui/SKILL.md +0 -0
- /package/templates/current/clean/{.codex → .agents}/skills/style-og-origen-ui/agents/openai.yaml +0 -0
- /package/templates/current/clean/{.codex → .agents}/skills/use-og-dialog/SKILL.md +0 -0
- /package/templates/current/clean/{.codex → .agents}/skills/use-og-dialog/agents/openai.yaml +0 -0
- /package/templates/current/clean/{.codex → .agents}/skills/use-og-editor/SKILL.md +0 -0
- /package/templates/current/clean/{.codex → .agents}/skills/use-og-http/SKILL.md +0 -0
- /package/templates/current/clean/{.codex → .agents}/skills/use-og-http/agents/openai.yaml +0 -0
- /package/templates/current/clean/{.codex → .agents}/skills/use-og-router-tabs/SKILL.md +0 -0
- /package/templates/current/{examples/.codex → clean/.claude}/skills/style-og-origen-ui/SKILL.md +0 -0
- /package/templates/current/{examples/.codex → clean/.claude}/skills/use-og-dialog/SKILL.md +0 -0
- /package/templates/current/{examples/.codex → clean/.claude}/skills/use-og-editor/SKILL.md +0 -0
- /package/templates/current/{examples/.codex → clean/.claude}/skills/use-og-http/SKILL.md +0 -0
- /package/templates/current/{examples/.codex → clean/.claude}/skills/use-og-router-tabs/SKILL.md +0 -0
- /package/templates/current/clean/src/{features/security/components → components}/DevtoolsProtectionOverlay.vue +0 -0
- /package/templates/current/clean/src/{features/shell/composables → composables}/useRouteProgress.ts +0 -0
- /package/templates/current/clean/src/{features/workspace → views/fallback}/pages/Empty.vue +0 -0
- /package/templates/current/examples/{.codex → .agents}/skills/style-og-origen-ui/agents/openai.yaml +0 -0
- /package/templates/current/examples/{.codex → .agents}/skills/use-og-dialog/agents/openai.yaml +0 -0
- /package/templates/current/examples/{.codex → .agents}/skills/use-og-http/agents/openai.yaml +0 -0
- /package/templates/current/examples/src/{features/security/components → components}/DevtoolsProtectionOverlay.vue +0 -0
- /package/templates/current/examples/src/{features/shell/composables → composables}/useRouteProgress.ts +0 -0
- /package/templates/current/examples/src/{features/workspace → views/fallback}/pages/Empty.vue +0 -0
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
import type { PageResult } from '@origen-ui/shared'
|
|
2
|
+
import type { OgTableDataSource, OgTableRequestContext, TableColumn } from '@origen-ui/table'
|
|
3
|
+
import type { OgTableWithSearchStandardConfig } from '@origen-ui/table-search'
|
|
4
|
+
import type { PostDraft, PostQuery, PostRecord } from '@/views/system/post/services/posts'
|
|
5
|
+
import { useDialog } from '@origen-ui/dialog'
|
|
6
|
+
import { ElMessage } from 'element-plus'
|
|
7
|
+
import { computed } from 'vue'
|
|
8
|
+
import { useI18n } from 'vue-i18n'
|
|
9
|
+
import { useAuthStore } from '@/store/auth'
|
|
10
|
+
import { downloadBlob } from '@/utils/download'
|
|
11
|
+
import { openRetryableDialog } from '@/utils/retryableDialog'
|
|
12
|
+
import {
|
|
13
|
+
createPost,
|
|
14
|
+
exportPosts,
|
|
15
|
+
getPost,
|
|
16
|
+
listPosts,
|
|
17
|
+
removePosts,
|
|
18
|
+
updatePost,
|
|
19
|
+
} from '@/views/system/post/services/posts'
|
|
20
|
+
|
|
21
|
+
interface UsePostManagementOptions {
|
|
22
|
+
refresh: () => Promise<void>
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function usePostManagement(options: UsePostManagementOptions) {
|
|
26
|
+
const auth = useAuthStore()
|
|
27
|
+
const dialog = useDialog()
|
|
28
|
+
const { t } = useI18n()
|
|
29
|
+
|
|
30
|
+
async function save(
|
|
31
|
+
row: PostRecord | undefined,
|
|
32
|
+
value: Record<string, unknown> | undefined,
|
|
33
|
+
signal: AbortSignal,
|
|
34
|
+
): Promise<boolean> {
|
|
35
|
+
const model = value ?? {}
|
|
36
|
+
const draft: PostDraft = {
|
|
37
|
+
postName: String(model.postName ?? '').trim(),
|
|
38
|
+
postCode: String(model.postCode ?? '').trim(),
|
|
39
|
+
postSort: Number(model.postSort ?? 0),
|
|
40
|
+
status: model.status === '1'
|
|
41
|
+
? '1'
|
|
42
|
+
: '0',
|
|
43
|
+
remark: String(model.remark ?? ''),
|
|
44
|
+
}
|
|
45
|
+
if (!draft.postName || !draft.postCode || !Number.isFinite(draft.postSort)) return false
|
|
46
|
+
if (row) await updatePost(row.postId, draft, signal)
|
|
47
|
+
else await createPost(draft, signal)
|
|
48
|
+
ElMessage.success(t('system.posts.saved'))
|
|
49
|
+
await options.refresh()
|
|
50
|
+
return true
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
async function openEditor(row?: PostRecord): Promise<void> {
|
|
54
|
+
const { default: PostEditorForm } =
|
|
55
|
+
await import('@/views/system/post/components/PostEditorForm.vue')
|
|
56
|
+
const signal = new AbortController().signal
|
|
57
|
+
const record = row
|
|
58
|
+
? await getPost(row.postId, signal)
|
|
59
|
+
: undefined
|
|
60
|
+
openRetryableDialog(
|
|
61
|
+
dialog,
|
|
62
|
+
{
|
|
63
|
+
dialogKey: row
|
|
64
|
+
? `post-editor-${row.postId}`
|
|
65
|
+
: 'post-editor-create',
|
|
66
|
+
title: row
|
|
67
|
+
? t('system.posts.edit')
|
|
68
|
+
: t('system.posts.add'),
|
|
69
|
+
width: 500,
|
|
70
|
+
ogProtectUnsaved: true,
|
|
71
|
+
ogErrorFeedback: true,
|
|
72
|
+
component: PostEditorForm,
|
|
73
|
+
props: {
|
|
74
|
+
initialValue: {
|
|
75
|
+
postCode: record?.postCode ?? row?.postCode ?? '',
|
|
76
|
+
postName: record?.postName ?? row?.postName ?? '',
|
|
77
|
+
postSort: record?.postSort ?? row?.postSort ?? 0,
|
|
78
|
+
status: record?.status ?? row?.status ?? '0',
|
|
79
|
+
remark: record?.remark ?? row?.remark ?? '',
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
onConfirm: (model, context) => save(row, model, context.signal),
|
|
83
|
+
},
|
|
84
|
+
t('common.actions.retry'),
|
|
85
|
+
)
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
async function remove(ids: readonly number[]): Promise<void> {
|
|
89
|
+
await removePosts(ids)
|
|
90
|
+
ElMessage.success(t('system.posts.deleted'))
|
|
91
|
+
await options.refresh()
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
async function exportList(query: PostQuery): Promise<void> {
|
|
95
|
+
const blob = await exportPosts(query)
|
|
96
|
+
downloadBlob(blob, `post_${Date.now()}.xlsx`)
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
const columns = computed<TableColumn<PostRecord>[]>(() => [
|
|
100
|
+
{ type: 'selection', key: 'selection', width: 48 },
|
|
101
|
+
{
|
|
102
|
+
prop: 'postId',
|
|
103
|
+
label: t('system.posts.postId'),
|
|
104
|
+
width: 100,
|
|
105
|
+
align: 'right',
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
prop: 'postCode',
|
|
109
|
+
label: t('system.posts.code'),
|
|
110
|
+
minWidth: 150,
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
prop: 'postName',
|
|
114
|
+
label: t('system.posts.name'),
|
|
115
|
+
minWidth: 150,
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
prop: 'postSort',
|
|
119
|
+
label: t('system.posts.sort'),
|
|
120
|
+
width: 100,
|
|
121
|
+
align: 'right',
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
prop: 'status',
|
|
125
|
+
label: t('system.posts.status'),
|
|
126
|
+
width: 100,
|
|
127
|
+
format: (value) => value === '0'
|
|
128
|
+
? t('common.status.enabled')
|
|
129
|
+
: t('common.status.disabled'),
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
prop: 'createTime',
|
|
133
|
+
label: t('system.posts.createTime'),
|
|
134
|
+
minWidth: 170,
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
type: 'action',
|
|
138
|
+
key: 'actions',
|
|
139
|
+
label: t('common.actions.operations'),
|
|
140
|
+
width: 140,
|
|
141
|
+
fixed: 'right',
|
|
142
|
+
actions: [
|
|
143
|
+
{
|
|
144
|
+
key: 'edit',
|
|
145
|
+
label: t('common.actions.edit'),
|
|
146
|
+
permission: 'system:post:edit',
|
|
147
|
+
onClick: openEditor,
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
key: 'remove',
|
|
151
|
+
label: t('common.actions.delete'),
|
|
152
|
+
permission: 'system:post:remove',
|
|
153
|
+
confirm: t('system.posts.confirmDelete'),
|
|
154
|
+
onClick: (row) => remove([row.postId]),
|
|
155
|
+
},
|
|
156
|
+
],
|
|
157
|
+
},
|
|
158
|
+
])
|
|
159
|
+
|
|
160
|
+
const dataSource: OgTableDataSource<PostRecord, PostQuery> = {
|
|
161
|
+
list: (request, context: OgTableRequestContext): Promise<PageResult<PostRecord>> =>
|
|
162
|
+
listPosts({
|
|
163
|
+
pageNum: request.pageNum,
|
|
164
|
+
pageSize: request.pageSize,
|
|
165
|
+
query: request.query,
|
|
166
|
+
sort: request.sort,
|
|
167
|
+
}, context.signal),
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
const config = computed<OgTableWithSearchStandardConfig<PostRecord, PostQuery>>(() => ({
|
|
171
|
+
search: {
|
|
172
|
+
columns: 3,
|
|
173
|
+
fields: [
|
|
174
|
+
{
|
|
175
|
+
prop: 'postCode',
|
|
176
|
+
label: t('system.posts.code'),
|
|
177
|
+
ogControl: { ogType: 'input' },
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
prop: 'postName',
|
|
181
|
+
label: t('system.posts.name'),
|
|
182
|
+
ogControl: { ogType: 'input' },
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
prop: 'status',
|
|
186
|
+
label: t('system.posts.status'),
|
|
187
|
+
ogControl: { ogType: 'select' },
|
|
188
|
+
options: [
|
|
189
|
+
{
|
|
190
|
+
label: t('common.status.enabled'),
|
|
191
|
+
value: '0',
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
label: t('common.status.disabled'),
|
|
195
|
+
value: '1',
|
|
196
|
+
},
|
|
197
|
+
],
|
|
198
|
+
},
|
|
199
|
+
],
|
|
200
|
+
},
|
|
201
|
+
pagination: {
|
|
202
|
+
pageSize: 10,
|
|
203
|
+
pageSizes: [10, 20, 50],
|
|
204
|
+
},
|
|
205
|
+
selection: { mode: 'multiple' },
|
|
206
|
+
permissions: {
|
|
207
|
+
has: (permission) => auth.hasPermission(permission),
|
|
208
|
+
},
|
|
209
|
+
actions: {
|
|
210
|
+
batch: [
|
|
211
|
+
{
|
|
212
|
+
key: 'edit',
|
|
213
|
+
label: t('common.actions.edit'),
|
|
214
|
+
permission: 'system:post:edit',
|
|
215
|
+
visible: (rows) => rows.length === 1,
|
|
216
|
+
onClick: (rows) => {
|
|
217
|
+
const row = rows[0]
|
|
218
|
+
if (row) return openEditor(row)
|
|
219
|
+
},
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
key: 'remove',
|
|
223
|
+
label: t('common.actions.batchRemove'),
|
|
224
|
+
permission: 'system:post:remove',
|
|
225
|
+
confirm: t('system.posts.confirmBatchDelete'),
|
|
226
|
+
onClick: (rows) => remove(rows.map((row) => row.postId)),
|
|
227
|
+
},
|
|
228
|
+
],
|
|
229
|
+
},
|
|
230
|
+
toolbar: {
|
|
231
|
+
refresh: true,
|
|
232
|
+
density: false,
|
|
233
|
+
columns: true,
|
|
234
|
+
reset: true,
|
|
235
|
+
},
|
|
236
|
+
}))
|
|
237
|
+
|
|
238
|
+
return {
|
|
239
|
+
columns,
|
|
240
|
+
config,
|
|
241
|
+
dataSource,
|
|
242
|
+
exportList,
|
|
243
|
+
openEditor,
|
|
244
|
+
}
|
|
245
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { OgTableWithSearchExpose } from '@origen-ui/table-search'
|
|
3
|
+
import type { PostQuery, PostRecord } from '@/views/system/post/services/posts'
|
|
4
|
+
import { OgTableWithSearch } from '@origen-ui/table-search'
|
|
5
|
+
import { ElButton } from 'element-plus'
|
|
6
|
+
import { useTemplateRef } from 'vue'
|
|
7
|
+
import { adminIconCatalog } from '@/app/ui/iconCatalog'
|
|
8
|
+
import { useSystemTableSearchVisibility } from '@/composables/useSystemTableSearchVisibility'
|
|
9
|
+
import { useAuthStore } from '@/store/auth'
|
|
10
|
+
import { usePostManagement } from '@/views/system/post/composables/usePostManagement'
|
|
11
|
+
|
|
12
|
+
defineOptions({ name: 'PostListPage' })
|
|
13
|
+
|
|
14
|
+
const table = useTemplateRef<OgTableWithSearchExpose<PostRecord, PostQuery>>('table')
|
|
15
|
+
const { columns, config, dataSource, exportList, openEditor } = usePostManagement({
|
|
16
|
+
refresh: async () => {
|
|
17
|
+
await table.value?.refresh()
|
|
18
|
+
},
|
|
19
|
+
})
|
|
20
|
+
const { config: tableConfig, searchVisible } = useSystemTableSearchVisibility(config)
|
|
21
|
+
const auth = useAuthStore()
|
|
22
|
+
const rowKey = (row: PostRecord): number => row.postId
|
|
23
|
+
|
|
24
|
+
function toTooltipTarget(target: unknown): HTMLElement | null {
|
|
25
|
+
if (typeof HTMLElement === 'undefined') return null
|
|
26
|
+
return target instanceof HTMLElement ? target : null
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function queryFromTable(): PostQuery {
|
|
30
|
+
return table.value?.getState().query.query ?? {}
|
|
31
|
+
}
|
|
32
|
+
</script>
|
|
33
|
+
|
|
34
|
+
<template>
|
|
35
|
+
<section
|
|
36
|
+
class="table-page"
|
|
37
|
+
:class="{ 'system-search-hidden': !searchVisible }"
|
|
38
|
+
data-testid="post-list-page"
|
|
39
|
+
>
|
|
40
|
+
<OgTableWithSearch
|
|
41
|
+
ref="table"
|
|
42
|
+
:row-key="rowKey"
|
|
43
|
+
:og-columns="columns"
|
|
44
|
+
:og-data-source="dataSource"
|
|
45
|
+
:og-config="tableConfig"
|
|
46
|
+
>
|
|
47
|
+
<template #beforeActions>
|
|
48
|
+
<ElButton
|
|
49
|
+
v-if="auth.hasPermission('system:post:add')"
|
|
50
|
+
type="primary"
|
|
51
|
+
:icon="adminIconCatalog.plus"
|
|
52
|
+
@click="openEditor()"
|
|
53
|
+
>
|
|
54
|
+
{{ $t('system.posts.add') }}
|
|
55
|
+
</ElButton>
|
|
56
|
+
<ElButton
|
|
57
|
+
v-if="auth.hasPermission('system:post:export')"
|
|
58
|
+
@click="exportList(queryFromTable())"
|
|
59
|
+
>
|
|
60
|
+
{{ $t('common.actions.export') }}
|
|
61
|
+
</ElButton>
|
|
62
|
+
</template>
|
|
63
|
+
<template #actions="scope">
|
|
64
|
+
<span
|
|
65
|
+
v-if="scope.selectedCount || scope.batchJob"
|
|
66
|
+
:ref="(target) => scope.setSelectionTooltipTarget(toTooltipTarget(target))"
|
|
67
|
+
class="admin-table__batch-actions"
|
|
68
|
+
>
|
|
69
|
+
<ElButton
|
|
70
|
+
v-for="action in scope.actions"
|
|
71
|
+
:key="action.key"
|
|
72
|
+
:link="action.presentation?.variant === 'link'"
|
|
73
|
+
:type="action.presentation?.type ?? 'primary'"
|
|
74
|
+
:icon="action.presentation?.icon"
|
|
75
|
+
:title="scope.tooltip(action)"
|
|
76
|
+
:disabled="scope.disabled(action)"
|
|
77
|
+
:loading="scope.loading(action)"
|
|
78
|
+
@click="scope.run(action)"
|
|
79
|
+
>
|
|
80
|
+
{{ action.label }}
|
|
81
|
+
</ElButton>
|
|
82
|
+
</span>
|
|
83
|
+
</template>
|
|
84
|
+
</OgTableWithSearch>
|
|
85
|
+
</section>
|
|
86
|
+
</template>
|
|
87
|
+
|
|
88
|
+
<style scoped>
|
|
89
|
+
.system-search-hidden :deep(.og-search) {
|
|
90
|
+
display: none;
|
|
91
|
+
}
|
|
92
|
+
</style>
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import type { PageResult } from '@origen-ui/shared'
|
|
2
|
+
import type { SysStatusEnum } from '@/api/generated/types/enums'
|
|
3
|
+
import type { PostExportBody, PostListQuery, SysPost } from '@/app/api'
|
|
4
|
+
import { systemPostsApi } from '@/api'
|
|
5
|
+
|
|
6
|
+
export type PostRecord = SysPost & Required<Pick<SysPost, 'postId' | 'postCode' | 'postName' | 'postSort' | 'status'>>
|
|
7
|
+
|
|
8
|
+
export type PostDraft = Pick<SysPost, 'postCode' | 'postName' | 'postSort' | 'status' | 'remark'> & {
|
|
9
|
+
status: SysStatusEnum
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export type PostQuery = Partial<Pick<PostListQuery, 'postCode' | 'postName' | 'status'>>
|
|
13
|
+
|
|
14
|
+
export interface PostListRequest {
|
|
15
|
+
pageNum: number
|
|
16
|
+
pageSize: number
|
|
17
|
+
query: PostQuery
|
|
18
|
+
sort: {
|
|
19
|
+
prop: string | null
|
|
20
|
+
order: 'ascending' | 'descending' | null
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function normalizePost(value: SysPost): PostRecord {
|
|
25
|
+
return {
|
|
26
|
+
...value,
|
|
27
|
+
postId: Number(value.postId),
|
|
28
|
+
postCode: value.postCode,
|
|
29
|
+
postName: value.postName,
|
|
30
|
+
postSort: Number(value.postSort),
|
|
31
|
+
status: value.status ?? '0',
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function toPageResult(
|
|
36
|
+
value: Awaited<ReturnType<typeof systemPostsApi.postList>>,
|
|
37
|
+
request: Pick<PostListRequest, 'pageNum' | 'pageSize'>,
|
|
38
|
+
): PageResult<PostRecord> {
|
|
39
|
+
const page = value as typeof value & PageResult<SysPost>
|
|
40
|
+
const rows = page.list ?? page.rows ?? []
|
|
41
|
+
return {
|
|
42
|
+
list: rows.map(normalizePost),
|
|
43
|
+
total: Number(page.total ?? rows.length),
|
|
44
|
+
pageNum: Number(page.pageNum ?? request.pageNum),
|
|
45
|
+
pageSize: Number(page.pageSize ?? request.pageSize),
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export async function listPosts(
|
|
50
|
+
request: PostListRequest,
|
|
51
|
+
signal?: AbortSignal,
|
|
52
|
+
): Promise<PageResult<PostRecord>> {
|
|
53
|
+
const response = await systemPostsApi.postList(
|
|
54
|
+
{
|
|
55
|
+
...request.query,
|
|
56
|
+
pageNum: request.pageNum,
|
|
57
|
+
pageSize: request.pageSize,
|
|
58
|
+
orderByColumn: request.sort.prop ?? undefined,
|
|
59
|
+
isAsc: request.sort.order === 'descending'
|
|
60
|
+
? 'desc'
|
|
61
|
+
: 'asc',
|
|
62
|
+
},
|
|
63
|
+
{ signal, silent: true },
|
|
64
|
+
)
|
|
65
|
+
return toPageResult(response, request)
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export async function getPost(postId: number, signal?: AbortSignal): Promise<PostRecord> {
|
|
69
|
+
const response = await systemPostsApi.postGetInfo(postId, { signal, silent: true })
|
|
70
|
+
return normalizePost(response)
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export async function createPost(draft: PostDraft, signal?: AbortSignal): Promise<void> {
|
|
74
|
+
await systemPostsApi.postAdd(draft, { signal, silent: true })
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export async function updatePost(
|
|
78
|
+
postId: number,
|
|
79
|
+
draft: PostDraft,
|
|
80
|
+
signal?: AbortSignal,
|
|
81
|
+
): Promise<void> {
|
|
82
|
+
await systemPostsApi.postEdit({ ...draft, postId }, { signal, silent: true })
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export async function removePosts(postIds: readonly number[], signal?: AbortSignal): Promise<void> {
|
|
86
|
+
if (postIds.length === 0) return
|
|
87
|
+
await systemPostsApi.postRemove([...postIds], { signal, silent: true })
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export async function exportPosts(query: PostQuery, signal?: AbortSignal): Promise<Blob> {
|
|
91
|
+
const body: PostExportBody = { ...query }
|
|
92
|
+
return systemPostsApi.postExport(body, { signal, silent: true, format: 'blob' })
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export async function postOptions(signal?: AbortSignal): Promise<SysPost[]> {
|
|
96
|
+
const response = await systemPostsApi.postOptionselect({ signal, silent: true })
|
|
97
|
+
return Array.isArray(response)
|
|
98
|
+
? response
|
|
99
|
+
: []
|
|
100
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { OgTableWithSearchExpose } from '@origen-ui/table-search'
|
|
3
|
+
import type { RoleMemberRecord, RoleUserSearchQuery } from '@/views/system/role/services/roleAccess'
|
|
4
|
+
import { OgTableWithSearch } from '@origen-ui/table-search'
|
|
5
|
+
import { ElButton } from 'element-plus'
|
|
6
|
+
import { computed, useTemplateRef } from 'vue'
|
|
7
|
+
import { useRoute } from 'vue-router'
|
|
8
|
+
import { useAuthStore } from '@/store/auth'
|
|
9
|
+
import { useRoleUserManagement } from '@/views/system/role/composables/useRoleUserManagement'
|
|
10
|
+
|
|
11
|
+
defineOptions({ name: 'RoleAuthUsersPage' })
|
|
12
|
+
|
|
13
|
+
const route = useRoute()
|
|
14
|
+
const auth = useAuthStore()
|
|
15
|
+
const table =
|
|
16
|
+
useTemplateRef<OgTableWithSearchExpose<RoleMemberRecord, RoleUserSearchQuery>>('table')
|
|
17
|
+
const roleId = computed(() => Number(route.params.roleId))
|
|
18
|
+
const roleName = computed(() =>
|
|
19
|
+
typeof route.query.roleName === 'string' ? route.query.roleName : '',
|
|
20
|
+
)
|
|
21
|
+
const rowKey = (row: RoleMemberRecord): number => row.userId
|
|
22
|
+
const { close, columns, config, dataSource, openSelectUsers } = useRoleUserManagement({
|
|
23
|
+
roleId,
|
|
24
|
+
roleName,
|
|
25
|
+
refresh: async () => {
|
|
26
|
+
await table.value?.refresh()
|
|
27
|
+
},
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
function toTooltipTarget(target: unknown): HTMLElement | null {
|
|
31
|
+
if (typeof HTMLElement === 'undefined') return null
|
|
32
|
+
return target instanceof HTMLElement ? target : null
|
|
33
|
+
}
|
|
34
|
+
</script>
|
|
35
|
+
|
|
36
|
+
<template>
|
|
37
|
+
<section class="table-page role-auth-users-page" data-testid="role-auth-users-page">
|
|
38
|
+
<header class="role-auth-users-page__header">
|
|
39
|
+
<h1 class="role-auth-users-page__title">
|
|
40
|
+
{{ roleName || $t('system.roles.assignedUsers') }}
|
|
41
|
+
</h1>
|
|
42
|
+
<ElButton @click="close">
|
|
43
|
+
{{ $t('common.actions.back') }}
|
|
44
|
+
</ElButton>
|
|
45
|
+
</header>
|
|
46
|
+
<OgTableWithSearch
|
|
47
|
+
ref="table"
|
|
48
|
+
:row-key="rowKey"
|
|
49
|
+
:og-columns="columns"
|
|
50
|
+
:og-data-source="dataSource"
|
|
51
|
+
:og-config="config"
|
|
52
|
+
>
|
|
53
|
+
<template #beforeActions>
|
|
54
|
+
<ElButton
|
|
55
|
+
v-if="auth.hasPermission('system:role:add')"
|
|
56
|
+
type="primary"
|
|
57
|
+
@click="openSelectUsers"
|
|
58
|
+
>
|
|
59
|
+
{{ $t('system.roles.selectUsers') }}
|
|
60
|
+
</ElButton>
|
|
61
|
+
</template>
|
|
62
|
+
<template #actions="scope">
|
|
63
|
+
<span
|
|
64
|
+
v-if="scope.selectedCount || scope.batchJob"
|
|
65
|
+
:ref="(target) => scope.setSelectionTooltipTarget(toTooltipTarget(target))"
|
|
66
|
+
class="admin-table__batch-actions"
|
|
67
|
+
>
|
|
68
|
+
<ElButton
|
|
69
|
+
v-for="action in scope.actions"
|
|
70
|
+
:key="action.key"
|
|
71
|
+
:link="action.presentation?.variant === 'link'"
|
|
72
|
+
:type="action.presentation?.type ?? 'primary'"
|
|
73
|
+
:icon="action.presentation?.icon"
|
|
74
|
+
:title="scope.tooltip(action)"
|
|
75
|
+
:disabled="scope.disabled(action)"
|
|
76
|
+
:loading="scope.loading(action)"
|
|
77
|
+
@click="scope.run(action)"
|
|
78
|
+
>
|
|
79
|
+
{{ action.label }}
|
|
80
|
+
</ElButton>
|
|
81
|
+
</span>
|
|
82
|
+
</template>
|
|
83
|
+
</OgTableWithSearch>
|
|
84
|
+
</section>
|
|
85
|
+
</template>
|
|
86
|
+
|
|
87
|
+
<style scoped>
|
|
88
|
+
.role-auth-users-page__header {
|
|
89
|
+
display: flex;
|
|
90
|
+
align-items: center;
|
|
91
|
+
justify-content: space-between;
|
|
92
|
+
gap: 16px;
|
|
93
|
+
margin-bottom: 16px;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.role-auth-users-page__title {
|
|
97
|
+
margin: 0;
|
|
98
|
+
font-size: 18px;
|
|
99
|
+
}
|
|
100
|
+
</style>
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { OgFormExpose, OgFormSchema } from '@origen-ui/form/core'
|
|
3
|
+
import type { FormActionExpose, SelectOption } from '@origen-ui/shared'
|
|
4
|
+
import type { SysRoleDataScopeEnum } from '@/api/generated/types/enums'
|
|
5
|
+
import type { RoleDataScopeRequest, SysRole, TreeSelect } from '@/app/api'
|
|
6
|
+
import { OgForm } from '@origen-ui/form/core'
|
|
7
|
+
import { ElCheckbox, ElFormItem, ElTree } from 'element-plus'
|
|
8
|
+
import { computed, ref, useTemplateRef, watch } from 'vue'
|
|
9
|
+
import { useI18n } from 'vue-i18n'
|
|
10
|
+
|
|
11
|
+
defineOptions({ name: 'RoleDataScopeForm' })
|
|
12
|
+
|
|
13
|
+
const props = defineProps<{
|
|
14
|
+
initialValue: RoleDataScopeFormModel
|
|
15
|
+
departmentTree: TreeSelect[]
|
|
16
|
+
checkedKeys: number[]
|
|
17
|
+
}>()
|
|
18
|
+
|
|
19
|
+
type RoleDataScopeFormModel = Pick<SysRole, 'roleId' | 'roleName' | 'roleKey'> & {
|
|
20
|
+
dataScope: SysRoleDataScopeEnum
|
|
21
|
+
deptCheckStrictly: boolean
|
|
22
|
+
deptIds: number[]
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const { t } = useI18n()
|
|
26
|
+
const model = ref<RoleDataScopeFormModel>({
|
|
27
|
+
...props.initialValue,
|
|
28
|
+
deptIds: [...props.checkedKeys],
|
|
29
|
+
})
|
|
30
|
+
const form = useTemplateRef<OgFormExpose<RoleDataScopeFormModel>>('form')
|
|
31
|
+
const departmentTree = useTemplateRef<InstanceType<typeof ElTree>>('departmentTree')
|
|
32
|
+
const departmentsExpanded = ref(true)
|
|
33
|
+
const allDepartmentIds = computed(() => flattenDepartmentIds(props.departmentTree))
|
|
34
|
+
const dataScopeOptions = computed<SelectOption[]>(() => [
|
|
35
|
+
{ label: t('system.roles.dataScope.all'), value: '1' },
|
|
36
|
+
{ label: t('system.roles.dataScope.custom'), value: '2' },
|
|
37
|
+
{ label: t('system.roles.dataScope.department'), value: '3' },
|
|
38
|
+
{ label: t('system.roles.dataScope.departmentAndBelow'), value: '4' },
|
|
39
|
+
{ label: t('system.roles.dataScope.self'), value: '5' },
|
|
40
|
+
])
|
|
41
|
+
|
|
42
|
+
function flattenDepartmentIds(nodes: readonly TreeSelect[]): number[] {
|
|
43
|
+
return nodes.flatMap((node) => [
|
|
44
|
+
...(node.id === undefined ? [] : [Number(node.id)]),
|
|
45
|
+
...flattenDepartmentIds(node.children ?? []),
|
|
46
|
+
])
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function toggleDepartmentExpand(value: string | number | boolean): void {
|
|
50
|
+
const expanded = value === true
|
|
51
|
+
departmentsExpanded.value = expanded
|
|
52
|
+
for (const id of allDepartmentIds.value) {
|
|
53
|
+
const node = departmentTree.value?.getNode(id)
|
|
54
|
+
if (expanded) node?.expand()
|
|
55
|
+
else node?.collapse()
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function toggleDepartmentSelection(value: string | number | boolean): void {
|
|
60
|
+
departmentTree.value?.setCheckedKeys(value === true ? allDepartmentIds.value : [])
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function checkedDepartmentIds(): number[] {
|
|
64
|
+
const checked = departmentTree.value?.getCheckedKeys() ?? model.value.deptIds
|
|
65
|
+
const halfChecked = departmentTree.value?.getHalfCheckedKeys() ?? []
|
|
66
|
+
return [...new Set([...checked, ...halfChecked].map(Number).filter(Number.isSafeInteger))]
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const schema = computed<OgFormSchema<RoleDataScopeFormModel>>(() => ({
|
|
70
|
+
sections: [
|
|
71
|
+
{
|
|
72
|
+
fields: [
|
|
73
|
+
{
|
|
74
|
+
prop: 'roleName',
|
|
75
|
+
label: t('system.roles.form.name'),
|
|
76
|
+
disabled: true,
|
|
77
|
+
ogControl: { ogType: 'input' },
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
prop: 'roleKey',
|
|
81
|
+
label: t('system.roles.form.code'),
|
|
82
|
+
disabled: true,
|
|
83
|
+
ogControl: { ogType: 'input' },
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
prop: 'dataScope',
|
|
87
|
+
label: t('system.roles.dataScope.label'),
|
|
88
|
+
ogControl: { ogType: 'select' },
|
|
89
|
+
options: dataScopeOptions.value,
|
|
90
|
+
},
|
|
91
|
+
],
|
|
92
|
+
},
|
|
93
|
+
],
|
|
94
|
+
}))
|
|
95
|
+
|
|
96
|
+
watch(
|
|
97
|
+
() => model.value.dataScope,
|
|
98
|
+
(value) => {
|
|
99
|
+
if (value !== '2') departmentTree.value?.setCheckedKeys([])
|
|
100
|
+
},
|
|
101
|
+
)
|
|
102
|
+
|
|
103
|
+
defineExpose<FormActionExpose>({
|
|
104
|
+
validate: async () => (await form.value?.validate()) ?? false,
|
|
105
|
+
getSubmitModel: () => {
|
|
106
|
+
const value = form.value?.getSubmitModel() ?? model.value
|
|
107
|
+
const request: RoleDataScopeRequest = {
|
|
108
|
+
roleId: model.value.roleId as number,
|
|
109
|
+
dataScope: model.value.dataScope,
|
|
110
|
+
deptCheckStrictly: model.value.deptCheckStrictly,
|
|
111
|
+
deptIds: checkedDepartmentIds(),
|
|
112
|
+
}
|
|
113
|
+
return { ...value, ...request }
|
|
114
|
+
},
|
|
115
|
+
isDirty: () => form.value?.isDirty() ?? false,
|
|
116
|
+
markClean: () => form.value?.markClean(),
|
|
117
|
+
})
|
|
118
|
+
</script>
|
|
119
|
+
|
|
120
|
+
<template>
|
|
121
|
+
<!-- @vue-generic {RoleDataScopeFormModel} -->
|
|
122
|
+
<div class="role-data-scope-form">
|
|
123
|
+
<OgForm ref="form" v-model="model" :og-schema="schema" :og-columns="1" label-width="110px" />
|
|
124
|
+
<ElFormItem v-if="model.dataScope === '2'" :label="$t('system.roles.dataScope.departmentTree')">
|
|
125
|
+
<div class="role-data-scope-form__tree-controls">
|
|
126
|
+
<ElCheckbox :model-value="departmentsExpanded" @update:model-value="toggleDepartmentExpand">
|
|
127
|
+
{{ $t('system.roles.expandCollapse') }}
|
|
128
|
+
</ElCheckbox>
|
|
129
|
+
<ElCheckbox @update:model-value="toggleDepartmentSelection">
|
|
130
|
+
{{ $t('system.roles.selectAll') }}
|
|
131
|
+
</ElCheckbox>
|
|
132
|
+
<ElCheckbox v-model="model.deptCheckStrictly">
|
|
133
|
+
{{ $t('system.roles.parentChildLink') }}
|
|
134
|
+
</ElCheckbox>
|
|
135
|
+
</div>
|
|
136
|
+
<ElTree
|
|
137
|
+
ref="departmentTree"
|
|
138
|
+
class="role-data-scope-form__tree"
|
|
139
|
+
:data="props.departmentTree"
|
|
140
|
+
:default-checked-keys="props.checkedKeys"
|
|
141
|
+
:default-expand-all="departmentsExpanded"
|
|
142
|
+
:props="{ label: 'label', children: 'children', disabled: 'disabled' }"
|
|
143
|
+
node-key="id"
|
|
144
|
+
show-checkbox
|
|
145
|
+
:check-strictly="!model.deptCheckStrictly"
|
|
146
|
+
:empty-text="$t('common.feedback.loading')"
|
|
147
|
+
/>
|
|
148
|
+
</ElFormItem>
|
|
149
|
+
</div>
|
|
150
|
+
</template>
|
|
151
|
+
|
|
152
|
+
<style scoped>
|
|
153
|
+
.role-data-scope-form__tree-controls {
|
|
154
|
+
display: flex;
|
|
155
|
+
flex-wrap: wrap;
|
|
156
|
+
gap: 12px;
|
|
157
|
+
margin-bottom: 10px;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.role-data-scope-form__tree {
|
|
161
|
+
max-height: 320px;
|
|
162
|
+
overflow: auto;
|
|
163
|
+
border: 1px solid var(--el-border-color);
|
|
164
|
+
border-radius: var(--el-border-radius-base);
|
|
165
|
+
padding: 8px 12px;
|
|
166
|
+
}
|
|
167
|
+
</style>
|