create-bubbles 0.1.22 → 0.1.24
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/dist/index.mjs +5 -0
- package/index.js +1 -1
- package/package.json +25 -24
- package/template-taro-react-oxc/.env.development +1 -1
- package/template-taro-react-oxc/.env.production +1 -1
- package/template-taro-react-oxc/project.config.json +1 -1
- package/template-taro-vue-eslint/project.config.json +2 -2
- package/{template-vp-monorepo-react-nestjs → template-vp-monorepo-react-hono}/.spaces/server//347/231/273/345/275/225/JWT/344/270/216RefreshToken/350/275/256/346/215/242/351/211/264/346/235/203/346/236/266/346/236/204/345/256/236/347/216/260/346/214/207/345/215/227.md +588 -1133
- package/template-vp-monorepo-react-hono/.vite-hooks/commit-msg +2 -0
- package/template-vp-monorepo-react-hono/.vite-hooks/pre-commit +2 -0
- package/template-vp-monorepo-react-hono/.vscode/extensions.json +3 -0
- package/template-vp-monorepo-react-hono/.vscode/settings.json +23 -0
- package/template-vp-monorepo-react-hono/AGENTS.md +16 -0
- package/template-vp-monorepo-react-hono/README.md +54 -0
- package/template-vp-monorepo-react-hono/apps/server/.env.example +13 -0
- package/template-vp-monorepo-react-hono/apps/server/README.md +75 -0
- package/template-vp-monorepo-react-hono/apps/server/drizzle/0000_flaky_madame_masque.sql +18 -0
- package/template-vp-monorepo-react-hono/apps/server/drizzle/meta/0000_snapshot.json +153 -0
- package/template-vp-monorepo-react-hono/apps/server/drizzle/meta/_journal.json +13 -0
- package/template-vp-monorepo-react-hono/apps/server/drizzle.config.ts +19 -0
- package/template-vp-monorepo-react-hono/apps/server/package.json +46 -0
- package/template-vp-monorepo-react-hono/apps/server/src/app.test.ts +57 -0
- package/template-vp-monorepo-react-hono/apps/server/src/app.ts +68 -0
- package/template-vp-monorepo-react-hono/apps/server/src/common/errors/app-error.ts +23 -0
- package/template-vp-monorepo-react-hono/apps/server/src/common/http/response.ts +21 -0
- package/template-vp-monorepo-react-hono/apps/server/src/common/logger.ts +30 -0
- package/template-vp-monorepo-react-hono/apps/server/src/config/env.ts +54 -0
- package/template-vp-monorepo-react-hono/apps/server/src/index.bun.ts +60 -0
- package/template-vp-monorepo-react-hono/apps/server/src/index.ts +73 -0
- package/template-vp-monorepo-react-hono/apps/server/src/infrastructure/database/client.ts +46 -0
- package/template-vp-monorepo-react-hono/apps/server/src/infrastructure/database/schema/index.ts +1 -0
- package/template-vp-monorepo-react-hono/apps/server/src/infrastructure/database/schema/job-runs.ts +42 -0
- package/template-vp-monorepo-react-hono/apps/server/src/infrastructure/queue/connection.ts +6 -0
- package/template-vp-monorepo-react-hono/apps/server/src/infrastructure/redis/client.ts +39 -0
- package/template-vp-monorepo-react-hono/apps/server/src/infrastructure/redis/options.ts +28 -0
- package/template-vp-monorepo-react-hono/apps/server/src/modules/health/health.routes.ts +17 -0
- package/template-vp-monorepo-react-hono/apps/server/src/modules/health/health.service.ts +59 -0
- package/template-vp-monorepo-react-hono/apps/server/src/modules/jobs/jobs.queue.ts +46 -0
- package/template-vp-monorepo-react-hono/apps/server/src/modules/jobs/jobs.repository.ts +101 -0
- package/template-vp-monorepo-react-hono/apps/server/src/modules/jobs/jobs.routes.ts +46 -0
- package/template-vp-monorepo-react-hono/apps/server/src/modules/jobs/jobs.schemas.ts +9 -0
- package/template-vp-monorepo-react-hono/apps/server/src/modules/jobs/jobs.service.ts +57 -0
- package/template-vp-monorepo-react-hono/apps/server/src/modules/jobs/jobs.types.ts +11 -0
- package/template-vp-monorepo-react-hono/apps/server/src/modules/jobs/jobs.worker.ts +108 -0
- package/template-vp-monorepo-react-hono/apps/server/src/runtime/shutdown.ts +38 -0
- package/template-vp-monorepo-react-hono/apps/server/src/worker.ts +48 -0
- package/template-vp-monorepo-react-hono/apps/server/tsconfig.json +15 -0
- package/template-vp-monorepo-react-hono/apps/server/vite.config.ts +15 -0
- package/template-vp-monorepo-react-hono/apps/web/.env +2 -0
- package/template-vp-monorepo-react-hono/apps/web/.env.dev +1 -0
- package/template-vp-monorepo-react-hono/apps/web/.env.prod +1 -0
- package/template-vp-monorepo-react-hono/apps/web/index.html +13 -0
- package/template-vp-monorepo-react-hono/apps/web/package.json +35 -0
- package/template-vp-monorepo-react-hono/apps/web/public/favicon.svg +1 -0
- package/template-vp-monorepo-react-hono/apps/web/public/icons.svg +24 -0
- package/template-vp-monorepo-react-hono/apps/web/src/App.tsx +25 -0
- package/template-vp-monorepo-react-hono/apps/web/src/assets/hero.png +0 -0
- package/template-vp-monorepo-react-hono/apps/web/src/assets/react.svg +1 -0
- package/template-vp-monorepo-react-hono/apps/web/src/assets/vite.svg +1 -0
- package/template-vp-monorepo-react-hono/apps/web/src/components/Loading/PageLoading.tsx +11 -0
- package/template-vp-monorepo-react-hono/apps/web/src/locales/en_US.json +4 -0
- package/template-vp-monorepo-react-hono/apps/web/src/locales/zh_CN.json +4 -0
- package/template-vp-monorepo-react-hono/apps/web/src/main.tsx +5 -0
- package/template-vp-monorepo-react-hono/apps/web/src/pages/home/index.tsx +47 -0
- package/template-vp-monorepo-react-hono/apps/web/src/router/index.tsx +25 -0
- package/template-vp-monorepo-react-hono/apps/web/src/router/modules/.gitkeep +0 -0
- package/template-vp-monorepo-react-hono/apps/web/src/styles/index.css +7 -0
- package/template-vp-monorepo-react-hono/apps/web/src/types/auto-imports.d.ts +58 -0
- package/template-vp-monorepo-react-hono/apps/web/src/utils/env/index.ts +6 -0
- package/template-vp-monorepo-react-hono/apps/web/src/utils/request/core/index.ts +420 -0
- package/template-vp-monorepo-react-hono/apps/web/src/utils/request/core/utils.ts +39 -0
- package/template-vp-monorepo-react-hono/apps/web/src/utils/request/index.ts +61 -0
- package/template-vp-monorepo-react-hono/apps/web/tsconfig.json +18 -0
- package/template-vp-monorepo-react-hono/apps/web/vite.config.ts +45 -0
- package/template-vp-monorepo-react-hono/commitlint.config.js +1 -0
- package/template-vp-monorepo-react-hono/docker-compose.yml +41 -0
- package/template-vp-monorepo-react-hono/mise.toml +4 -0
- package/template-vp-monorepo-react-hono/package.json +37 -0
- package/template-vp-monorepo-react-hono/packages/i18n/core/package.json +20 -0
- package/template-vp-monorepo-react-hono/packages/i18n/core/src/format.ts +9 -0
- package/template-vp-monorepo-react-hono/packages/i18n/core/src/i18n.ts +73 -0
- package/template-vp-monorepo-react-hono/packages/i18n/core/src/index.ts +24 -0
- package/template-vp-monorepo-react-hono/packages/i18n/core/src/storage.ts +47 -0
- package/template-vp-monorepo-react-hono/packages/i18n/core/src/store.ts +48 -0
- package/template-vp-monorepo-react-hono/packages/i18n/core/src/types.ts +36 -0
- package/template-vp-monorepo-react-hono/packages/i18n/core/tsconfig.json +4 -0
- package/template-vp-monorepo-react-hono/packages/i18n/core/vite.config.ts +13 -0
- package/template-vp-monorepo-react-hono/packages/i18n/react/package.json +28 -0
- package/template-vp-monorepo-react-hono/packages/i18n/react/src/index.tsx +26 -0
- package/template-vp-monorepo-react-hono/packages/i18n/react/src/use-store.ts +14 -0
- package/template-vp-monorepo-react-hono/packages/i18n/react/tsconfig.json +9 -0
- package/template-vp-monorepo-react-hono/packages/i18n/react/vite.config.ts +16 -0
- package/template-vp-monorepo-react-hono/packages/i18n/vue/package.json +27 -0
- package/template-vp-monorepo-react-hono/packages/i18n/vue/src/index.ts +52 -0
- package/template-vp-monorepo-react-hono/packages/i18n/vue/src/use-store.ts +19 -0
- package/template-vp-monorepo-react-hono/packages/i18n/vue/tsconfig.json +8 -0
- package/template-vp-monorepo-react-hono/packages/i18n/vue/vite.config.ts +16 -0
- package/template-vp-monorepo-react-hono/pnpm-workspace.yaml +57 -0
- package/template-vp-monorepo-react-hono/scripts/clean.mjs +48 -0
- package/template-vp-monorepo-react-hono/tsconfig.base.json +10 -0
- package/template-vp-monorepo-react-hono/tsconfig.bundler.json +12 -0
- package/template-vp-monorepo-react-hono/tsconfig.json +11 -0
- package/template-vp-monorepo-react-hono/tsconfig.lib.json +10 -0
- package/template-vp-monorepo-react-hono/vite.config.ts +20 -0
- package/template-vp-monorepo-react-nestjs/.spaces/server/todo.md +991 -0
- package/template-vp-monorepo-react-nestjs/.vscode/launch.json +16 -0
- package/template-vp-monorepo-react-nestjs/.vscode/settings.json +21 -17
- package/template-vp-monorepo-react-nestjs/apps/server/.env.development +3 -39
- package/template-vp-monorepo-react-nestjs/apps/server/.swcrc +8 -0
- package/template-vp-monorepo-react-nestjs/apps/server/drizzle.config.ts +8 -3
- package/template-vp-monorepo-react-nestjs/apps/server/nest-cli.json +8 -1
- package/template-vp-monorepo-react-nestjs/apps/server/package.json +11 -6
- package/template-vp-monorepo-react-nestjs/apps/server/src/app.controller.ts +2 -0
- package/template-vp-monorepo-react-nestjs/apps/server/src/app.module.ts +20 -15
- package/template-vp-monorepo-react-nestjs/apps/server/src/common/adapters/fastify.adapter.ts +16 -0
- package/template-vp-monorepo-react-nestjs/apps/server/src/common/constants/auth.ts +2 -0
- package/template-vp-monorepo-react-nestjs/apps/server/src/common/constants/response.ts +0 -4
- package/template-vp-monorepo-react-nestjs/apps/server/src/common/constants/session.constants.ts +28 -0
- package/template-vp-monorepo-react-nestjs/apps/server/src/common/decorators/current-auth.decorator.ts +16 -0
- package/template-vp-monorepo-react-nestjs/apps/server/src/common/decorators/public.decorator.ts +4 -0
- package/template-vp-monorepo-react-nestjs/apps/server/src/common/dto/api-failure.dto.ts +25 -0
- package/template-vp-monorepo-react-nestjs/apps/server/src/common/error/common.error.ts +40 -0
- package/template-vp-monorepo-react-nestjs/apps/server/src/common/exceptions/app.exception.ts +55 -0
- package/template-vp-monorepo-react-nestjs/apps/server/src/common/filters/global-exception.filter.ts +384 -0
- package/template-vp-monorepo-react-nestjs/apps/server/src/common/openapi/response-headers.ts +9 -0
- package/template-vp-monorepo-react-nestjs/apps/server/src/config/index.ts +1 -1
- package/template-vp-monorepo-react-nestjs/apps/server/src/config/session.config.ts +36 -0
- package/template-vp-monorepo-react-nestjs/apps/server/src/database/schema.ts +7 -8
- package/template-vp-monorepo-react-nestjs/apps/server/src/main.ts +29 -8
- package/template-vp-monorepo-react-nestjs/apps/server/src/modules/auth/auth.controller.ts +55 -0
- package/template-vp-monorepo-react-nestjs/apps/server/src/modules/auth/auth.errors.ts +42 -0
- package/template-vp-monorepo-react-nestjs/apps/server/src/modules/auth/auth.module.ts +26 -0
- package/template-vp-monorepo-react-nestjs/apps/server/src/modules/auth/auth.repository.ts +40 -0
- package/template-vp-monorepo-react-nestjs/apps/server/src/modules/auth/auth.service.ts +129 -0
- package/template-vp-monorepo-react-nestjs/apps/server/src/modules/auth/dto/auth-repsponse.dto.ts +31 -0
- package/template-vp-monorepo-react-nestjs/apps/server/src/modules/auth/dto/login.dto.ts +11 -0
- package/template-vp-monorepo-react-nestjs/apps/server/src/modules/auth/dto/register.dto.ts +17 -0
- package/template-vp-monorepo-react-nestjs/apps/server/src/modules/auth/guards/session-auth.guard.ts +50 -0
- package/template-vp-monorepo-react-nestjs/apps/server/src/modules/auth/password.service.ts +24 -0
- package/template-vp-monorepo-react-nestjs/apps/server/src/modules/auth/session/session-store.service.ts +198 -0
- package/template-vp-monorepo-react-nestjs/apps/server/src/modules/auth/session/session-token.service.ts +29 -0
- package/template-vp-monorepo-react-nestjs/apps/server/src/modules/auth/session/session.script.ts +221 -0
- package/template-vp-monorepo-react-nestjs/apps/server/src/modules/auth/session/session.types.ts +24 -0
- package/template-vp-monorepo-react-nestjs/apps/server/src/modules/test/db/db.controller.ts +1 -1
- package/template-vp-monorepo-react-nestjs/apps/server/src/modules/test/db/dto/create-user.dto.ts +3 -5
- package/template-vp-monorepo-react-nestjs/apps/server/src/modules/test/redis/redis.service.ts +1 -1
- package/template-vp-monorepo-react-nestjs/apps/server/src/utils/env-arr.ts +3 -0
- package/template-vp-monorepo-react-nestjs/apps/server/test/error-catalog.spec.ts +30 -0
- package/template-vp-monorepo-react-nestjs/apps/server/tsconfig.build.json +11 -1
- package/template-vp-monorepo-react-nestjs/apps/server/tsconfig.json +12 -20
- package/template-vp-monorepo-react-nestjs/apps/server/vite.config.ts +15 -0
- package/template-vp-monorepo-react-nestjs/apps/web/package.json +1 -0
- package/template-vp-monorepo-react-nestjs/apps/web/tsconfig.json +5 -15
- package/template-vp-monorepo-react-nestjs/apps/web-vue/commitlint.config.js +1 -1
- package/template-vp-monorepo-react-nestjs/apps/web-vue/lefthook.yml +1 -1
- package/template-vp-monorepo-react-nestjs/apps/web-vue/package.json +1 -3
- package/template-vp-monorepo-react-nestjs/apps/web-vue/src/api/index.ts +5 -5
- package/template-vp-monorepo-react-nestjs/apps/web-vue/src/components/Icon/svg-icon.vue +3 -3
- package/template-vp-monorepo-react-nestjs/apps/web-vue/src/hooks/chart/lib.ts +6 -6
- package/template-vp-monorepo-react-nestjs/apps/web-vue/src/hooks/chart/useEcharts.ts +34 -29
- package/template-vp-monorepo-react-nestjs/apps/web-vue/src/i18n/instance.ts +2 -0
- package/template-vp-monorepo-react-nestjs/apps/web-vue/src/layout/default/index.vue +17 -32
- package/template-vp-monorepo-react-nestjs/apps/web-vue/src/locales/en_US.json +4 -1
- package/template-vp-monorepo-react-nestjs/apps/web-vue/src/locales/zh_CN.json +4 -1
- package/template-vp-monorepo-react-nestjs/apps/web-vue/src/router/guard/index.ts +3 -3
- package/template-vp-monorepo-react-nestjs/apps/web-vue/src/router/guard/permissionGuard.ts +7 -7
- package/template-vp-monorepo-react-nestjs/apps/web-vue/src/router/index.ts +7 -7
- package/template-vp-monorepo-react-nestjs/apps/web-vue/src/router/interface.ts +6 -6
- package/template-vp-monorepo-react-nestjs/apps/web-vue/src/store/index.ts +6 -6
- package/template-vp-monorepo-react-nestjs/apps/web-vue/src/store/modules/user.ts +9 -9
- package/template-vp-monorepo-react-nestjs/apps/web-vue/src/styles/index.scss +3 -3
- package/template-vp-monorepo-react-nestjs/apps/web-vue/src/types/antdv-next.d.ts +1 -0
- package/template-vp-monorepo-react-nestjs/apps/web-vue/src/utils/env.ts +1 -1
- package/template-vp-monorepo-react-nestjs/apps/web-vue/src/utils/request/core/index.ts +63 -45
- package/template-vp-monorepo-react-nestjs/apps/web-vue/src/utils/request/core/utils.ts +12 -6
- package/template-vp-monorepo-react-nestjs/apps/web-vue/src/utils/request/index.ts +1 -1
- package/template-vp-monorepo-react-nestjs/apps/web-vue/src/views/example/echart/config.ts +687 -687
- package/template-vp-monorepo-react-nestjs/apps/web-vue/src/views/example/echart/index.vue +7 -7
- package/template-vp-monorepo-react-nestjs/apps/web-vue/src/views/example/tree-chart.vue +2 -7
- package/template-vp-monorepo-react-nestjs/apps/web-vue/src/views/home/index.vue +13 -3
- package/template-vp-monorepo-react-nestjs/apps/web-vue/tsconfig.json +5 -17
- package/template-vp-monorepo-react-nestjs/apps/web-vue/uno.config.ts +5 -5
- package/template-vp-monorepo-react-nestjs/i18n.config.ts +22 -0
- package/template-vp-monorepo-react-nestjs/package.json +12 -1
- package/template-vp-monorepo-react-nestjs/packages/i18n/cli/README.md +113 -0
- package/template-vp-monorepo-react-nestjs/packages/i18n/cli/docs/excel-sync-plan.md +618 -0
- package/template-vp-monorepo-react-nestjs/packages/i18n/cli/package.json +31 -0
- package/template-vp-monorepo-react-nestjs/packages/i18n/cli/src/cli.ts +5 -0
- package/template-vp-monorepo-react-nestjs/packages/i18n/cli/src/command.ts +512 -0
- package/template-vp-monorepo-react-nestjs/packages/i18n/cli/src/config.ts +15 -0
- package/template-vp-monorepo-react-nestjs/packages/i18n/cli/src/files.ts +67 -0
- package/template-vp-monorepo-react-nestjs/packages/i18n/cli/src/index.ts +19 -0
- package/template-vp-monorepo-react-nestjs/packages/i18n/cli/src/load-config.ts +228 -0
- package/template-vp-monorepo-react-nestjs/packages/i18n/cli/src/report.ts +57 -0
- package/template-vp-monorepo-react-nestjs/packages/i18n/cli/src/scanner.test.ts +81 -0
- package/template-vp-monorepo-react-nestjs/packages/i18n/cli/src/scanner.ts +290 -0
- package/template-vp-monorepo-react-nestjs/packages/i18n/cli/src/sync.ts +274 -0
- package/template-vp-monorepo-react-nestjs/packages/i18n/cli/test/command.test.ts +209 -0
- package/template-vp-monorepo-react-nestjs/packages/i18n/cli/test/config.test.ts +19 -0
- package/template-vp-monorepo-react-nestjs/packages/i18n/cli/test/load-config.test.ts +194 -0
- package/template-vp-monorepo-react-nestjs/packages/i18n/cli/test/report.test.ts +63 -0
- package/template-vp-monorepo-react-nestjs/packages/i18n/cli/test/sync.test.ts +203 -0
- package/template-vp-monorepo-react-nestjs/packages/i18n/cli/test/temporary-directory.ts +25 -0
- package/template-vp-monorepo-react-nestjs/packages/i18n/cli/tsconfig.json +9 -0
- package/template-vp-monorepo-react-nestjs/packages/i18n/cli/vite.config.ts +18 -0
- package/template-vp-monorepo-react-nestjs/packages/i18n/core/tsconfig.json +1 -12
- package/template-vp-monorepo-react-nestjs/packages/i18n/react/tsconfig.json +3 -10
- package/template-vp-monorepo-react-nestjs/packages/i18n/vue/tsconfig.json +3 -10
- package/template-vp-monorepo-react-nestjs/packages/shared/package.json +40 -0
- package/template-vp-monorepo-react-nestjs/packages/shared/src/index.ts +13 -0
- package/template-vp-monorepo-react-nestjs/packages/shared/src/types/auth.ts +35 -0
- package/template-vp-monorepo-react-nestjs/packages/shared/src/types/common.ts +11 -0
- package/template-vp-monorepo-react-nestjs/packages/shared/src/types/index.ts +11 -0
- package/template-vp-monorepo-react-nestjs/packages/shared/src/utils/account.ts +5 -0
- package/template-vp-monorepo-react-nestjs/packages/shared/src/utils/index.ts +2 -0
- package/template-vp-monorepo-react-nestjs/packages/shared/src/utils/session-terminal.ts +11 -0
- package/template-vp-monorepo-react-nestjs/packages/shared/tsconfig.json +4 -0
- package/template-vp-monorepo-react-nestjs/packages/shared/vite.config.ts +17 -0
- package/template-vp-monorepo-react-nestjs/pnpm-workspace.yaml +6 -6
- package/template-vp-monorepo-react-nestjs/scripts/clean.mjs +48 -0
- package/template-vp-monorepo-react-nestjs/tsconfig.base.json +10 -0
- package/template-vp-monorepo-react-nestjs/tsconfig.bundler.json +12 -0
- package/template-vp-monorepo-react-nestjs/tsconfig.json +8 -6
- package/template-vp-monorepo-react-nestjs/tsconfig.lib.json +10 -0
- package/template-vp-monorepo-react-nestjs/vite.config.ts +2 -1
- package/template-vp-vue-eslint-vapor/.env +6 -0
- package/template-vp-vue-eslint-vapor/.env.development +2 -0
- package/template-vp-vue-eslint-vapor/.env.production +2 -0
- package/template-vp-vue-eslint-vapor/.vite-hooks/commit-msg +1 -0
- package/template-vp-vue-eslint-vapor/.vite-hooks/pre-commit +1 -0
- package/template-vp-vue-eslint-vapor/.vscode/extensions.json +3 -0
- package/template-vp-vue-eslint-vapor/AGENTS.md +16 -0
- package/template-vp-vue-eslint-vapor/README.md +93 -0
- package/template-vp-vue-eslint-vapor/commitlint.config.js +1 -0
- package/template-vp-vue-eslint-vapor/eslint.config.js +13 -0
- package/template-vp-vue-eslint-vapor/index.html +13 -0
- package/template-vp-vue-eslint-vapor/package.json +64 -0
- package/template-vp-vue-eslint-vapor/pnpm-workspace.yaml +2 -0
- package/template-vp-vue-eslint-vapor/public/vite.svg +1 -0
- package/template-vp-vue-eslint-vapor/src/App.vue +7 -0
- package/template-vp-vue-eslint-vapor/src/api/index.ts +12 -0
- package/template-vp-vue-eslint-vapor/src/assets/icon/home.svg +3 -0
- package/template-vp-vue-eslint-vapor/src/assets/icon/logo.svg +1 -0
- package/template-vp-vue-eslint-vapor/src/assets/image/.gitkeep +0 -0
- package/template-vp-vue-eslint-vapor/src/components/Icon/svg-icon.vue +29 -0
- package/template-vp-vue-eslint-vapor/src/hooks/chart/lib.ts +57 -0
- package/template-vp-vue-eslint-vapor/src/hooks/chart/useEcharts.ts +65 -0
- package/template-vp-vue-eslint-vapor/src/layout/default/header/index.vue +57 -0
- package/template-vp-vue-eslint-vapor/src/layout/default/index.vue +138 -0
- package/template-vp-vue-eslint-vapor/src/main.ts +19 -0
- package/template-vp-vue-eslint-vapor/src/router/guard/index.ts +7 -0
- package/template-vp-vue-eslint-vapor/src/router/guard/permissionGuard.ts +13 -0
- package/template-vp-vue-eslint-vapor/src/router/index.ts +18 -0
- package/template-vp-vue-eslint-vapor/src/router/interface.ts +9 -0
- package/template-vp-vue-eslint-vapor/src/router/modules/index.ts +33 -0
- package/template-vp-vue-eslint-vapor/src/store/index.ts +11 -0
- package/template-vp-vue-eslint-vapor/src/store/modules/user.ts +17 -0
- package/template-vp-vue-eslint-vapor/src/styles/font.scss +0 -0
- package/template-vp-vue-eslint-vapor/src/styles/index.scss +29 -0
- package/template-vp-vue-eslint-vapor/src/styles/variables.scss +3 -0
- package/template-vp-vue-eslint-vapor/src/types/vite-env.d.ts +15 -0
- package/template-vp-vue-eslint-vapor/src/utils/env.ts +11 -0
- package/template-vp-vue-eslint-vapor/src/utils/request/core/index.ts +425 -0
- package/template-vp-vue-eslint-vapor/src/utils/request/core/utils.ts +39 -0
- package/template-vp-vue-eslint-vapor/src/utils/request/index.ts +44 -0
- package/template-vp-vue-eslint-vapor/src/views/example/echart/config.ts +1794 -0
- package/template-vp-vue-eslint-vapor/src/views/example/echart/index.vue +20 -0
- package/template-vp-vue-eslint-vapor/src/views/example/tree-chart.vue +16 -0
- package/template-vp-vue-eslint-vapor/src/views/home/index.vue +16 -0
- package/template-vp-vue-eslint-vapor/src/views/login/index.vue +9 -0
- package/template-vp-vue-eslint-vapor/tsconfig.json +32 -0
- package/template-vp-vue-eslint-vapor/tsconfig.tsbuildinfo +1 -0
- package/template-vp-vue-eslint-vapor/uno.config.ts +17 -0
- package/template-vp-vue-eslint-vapor/vite.config.ts +66 -0
- package/template-vp-monorepo-react-nestjs/apps/server/src/common/constants/decorator.ts +0 -2
- package/template-vp-monorepo-react-nestjs/apps/server/src/common/decorators/bypass.ts +0 -12
- package/template-vp-monorepo-react-nestjs/apps/server/src/common/interceptors/transform.ts +0 -34
- package/template-vp-monorepo-react-nestjs/apps/server/src/common/model/response.ts +0 -23
- package/template-vp-monorepo-react-nestjs/apps/server/src/config/auth.config.ts +0 -64
- package/template-vp-monorepo-react-nestjs/apps/web-vue/pnpm-workspace.yaml +0 -16
- /package/{template-vp-monorepo-react-nestjs/apps/server/src/config/security.config.ts → template-vp-monorepo-react-hono/.agents/auth.config.ts} +0 -0
|
@@ -9,8 +9,9 @@ export default defineConfig({
|
|
|
9
9
|
singleQuote: true,
|
|
10
10
|
},
|
|
11
11
|
lint: {
|
|
12
|
+
plugins: ['unicorn', 'typescript', 'oxc', 'import'],
|
|
12
13
|
jsPlugins: [{ name: 'vite-plus', specifier: 'vite-plus/oxlint-plugin' }],
|
|
13
|
-
rules: { 'vite-plus/prefer-vite-plus-imports': 'error' },
|
|
14
|
+
rules: { 'vite-plus/prefer-vite-plus-imports': 'error', 'import/no-duplicates': 'error' },
|
|
14
15
|
options: { typeAware: true, typeCheck: true },
|
|
15
16
|
},
|
|
16
17
|
run: {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
NO_COLOR=1 commitlint --edit "$1"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
NO_COLOR=1 vp staged
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<!--VITE PLUS START-->
|
|
2
|
+
|
|
3
|
+
# Using Vite+, the Unified Toolchain for the Web
|
|
4
|
+
|
|
5
|
+
This project is using Vite+, a unified toolchain built on top of Vite, Rolldown, Vitest, tsdown, Oxlint, Oxfmt, and Vite Task. Vite+ wraps runtime management, package management, and frontend tooling in a single global CLI called `vp`. Vite+ is distinct from Vite, and it invokes Vite through `vp dev` and `vp build`. Run `vp help` to print a list of commands and `vp <command> --help` for information about a specific command.
|
|
6
|
+
|
|
7
|
+
Docs are local at `node_modules/vite-plus/docs` or online at https://viteplus.dev/guide/.
|
|
8
|
+
|
|
9
|
+
## Review Checklist
|
|
10
|
+
|
|
11
|
+
- [ ] Run `vp install` after pulling remote changes and before getting started.
|
|
12
|
+
- [ ] Run `vp check` and `vp test` to format, lint, type check and test changes.
|
|
13
|
+
- [ ] Check if there are `vite.config.ts` tasks or `package.json` scripts necessary for validation, run via `vp run <script>`.
|
|
14
|
+
- [ ] If setup, runtime, or package-manager behavior looks wrong, run `vp env doctor` and include its output when asking for help.
|
|
15
|
+
|
|
16
|
+
<!--VITE PLUS END-->
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# template-vp-vue-eslint-vapor
|
|
2
|
+
|
|
3
|
+
Vue 3 Vapor 项目模板,基于 Vite+ 统一工具链,集成 Antdv Next UI 组件库、UnoCSS 原子化样式和 ESLint 代码规范。
|
|
4
|
+
|
|
5
|
+
## 技术栈
|
|
6
|
+
|
|
7
|
+
| 分类 | 技术 | 说明 |
|
|
8
|
+
| --------- | -------------------------------------- | ----------------------------------------------- |
|
|
9
|
+
| 构建工具 | Vite+ (`vp`) | 统一工具链,封装 Vite + Rolldown + Oxlint |
|
|
10
|
+
| 框架 | Vue 3.6 RC | Composition API + `<script setup>` + Vapor 模式 |
|
|
11
|
+
| 语言 | TypeScript 6 | 配合 vue-tsc 进行类型检查 |
|
|
12
|
+
| UI 组件库 | Antdv Next | 自动按需导入 |
|
|
13
|
+
| 状态管理 | Pinia | 含持久化插件 |
|
|
14
|
+
| 路由 | Vue Router 5 | |
|
|
15
|
+
| 请求库 | Alova | 基于 Axios 适配器,双调用实例 |
|
|
16
|
+
| 样式方案 | UnoCSS | Wind4 + Attributify 预设 |
|
|
17
|
+
| 代码规范 | ESLint (@antfu/eslint-config) + OxLint | |
|
|
18
|
+
| Git 钩子 | Vite+ hooks + Commitlint | |
|
|
19
|
+
|
|
20
|
+
## 快速开始
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
# 安装依赖
|
|
24
|
+
pnpm install
|
|
25
|
+
|
|
26
|
+
# 启动开发服务器
|
|
27
|
+
pnpm dev
|
|
28
|
+
|
|
29
|
+
# 构建生产包
|
|
30
|
+
pnpm build
|
|
31
|
+
|
|
32
|
+
# 代码检查
|
|
33
|
+
pnpm lint
|
|
34
|
+
|
|
35
|
+
# 代码修复
|
|
36
|
+
pnpm lint:fix
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## 目录结构
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
src/
|
|
43
|
+
├── api/ # API 接口定义
|
|
44
|
+
├── assets/ # 静态资源
|
|
45
|
+
│ ├── icon/ # SVG 图标
|
|
46
|
+
│ └── image/ # 图片资源
|
|
47
|
+
├── components/ # 公共组件
|
|
48
|
+
│ └── Icon/ # SVG 图标组件
|
|
49
|
+
├── hooks/ # 组合式函数
|
|
50
|
+
├── layout/ # 布局组件
|
|
51
|
+
│ └── default/ # 默认布局(侧边栏 + 顶部栏)
|
|
52
|
+
├── router/ # 路由配置
|
|
53
|
+
│ ├── guard/ # 路由守卫
|
|
54
|
+
│ └── modules/ # 路由模块
|
|
55
|
+
├── store/ # Pinia 状态管理
|
|
56
|
+
│ └── modules/ # 业务 Store
|
|
57
|
+
├── styles/ # 全局样式
|
|
58
|
+
├── types/ # 类型声明(自动生成)
|
|
59
|
+
├── utils/ # 工具函数
|
|
60
|
+
│ └── request/ # Alova 请求封装
|
|
61
|
+
├── views/ # 页面视图
|
|
62
|
+
├── App.vue # 根组件
|
|
63
|
+
└── main.ts # 应用入口
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## 环境变量
|
|
67
|
+
|
|
68
|
+
| 文件 | 用途 |
|
|
69
|
+
| ------------------ | ------------ |
|
|
70
|
+
| `.env` | 公共环境变量 |
|
|
71
|
+
| `.env.development` | 开发环境 |
|
|
72
|
+
| `.env.production` | 生产环境 |
|
|
73
|
+
|
|
74
|
+
关键变量:
|
|
75
|
+
|
|
76
|
+
| 变量名 | 说明 |
|
|
77
|
+
| ---------------- | ------------------------ |
|
|
78
|
+
| `VITE_PORT` | 开发服务器端口 |
|
|
79
|
+
| `VITE_API_URL` | 后端 API 地址 |
|
|
80
|
+
| `VITE_API_AFFIX` | API 路由前缀(用于代理) |
|
|
81
|
+
| `VITE_APP_NAME` | 应用名称 |
|
|
82
|
+
|
|
83
|
+
## Vapor 模式
|
|
84
|
+
|
|
85
|
+
模板在 `vite.config.ts` 中通过 `@vitejs/plugin-vue` 开启 `features.vapor`,用于体验 Vue 3.6 的 Vapor 编译模式。
|
|
86
|
+
|
|
87
|
+
当前使用 Vue RC 版本,更适合功能验证和提前适配;对稳定性要求较高的生产项目建议选择稳定版 Vue 模板。
|
|
88
|
+
|
|
89
|
+
## 代码规范
|
|
90
|
+
|
|
91
|
+
- **ESLint**:使用 `@antfu/eslint-config`,单引号、无分号、自动排序 imports
|
|
92
|
+
- **OxLint**:作为 ESLint 的补充,提供更快的 lint 速度
|
|
93
|
+
- **Commitlint**:提交信息需遵循 [Conventional Commits](https://www.conventionalcommits.org/) 规范
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default { extends: ["@commitlint/config-conventional"] };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
+
<title>Vite + Vue + TS</title>
|
|
8
|
+
</head>
|
|
9
|
+
<body>
|
|
10
|
+
<div id="app"></div>
|
|
11
|
+
<script type="module" src="/src/main.ts"></script>
|
|
12
|
+
</body>
|
|
13
|
+
</html>
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "template-vp-vue-eslint-vapor",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"dev": "vp dev --mode development",
|
|
8
|
+
"build": "vue-tsc -b && vp build",
|
|
9
|
+
"preview": "vp preview",
|
|
10
|
+
"lint": "oxlint && eslint",
|
|
11
|
+
"lint:fix": "oxlint && eslint --fix",
|
|
12
|
+
"prepare": "vp config"
|
|
13
|
+
},
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"@alova/adapter-axios": "^2.0.20",
|
|
16
|
+
"@antdv-next/icons": "^1.1.1",
|
|
17
|
+
"alova": "^3.5.3",
|
|
18
|
+
"antdv-next": "^1.4.5",
|
|
19
|
+
"axios": "^1.18.1",
|
|
20
|
+
"dayjs": "^1.11.21",
|
|
21
|
+
"echarts": "^6.1.0",
|
|
22
|
+
"nprogress": "^0.2.0",
|
|
23
|
+
"pinia": "^4.0.2",
|
|
24
|
+
"pinia-plugin-persistedstate": "^4.7.1",
|
|
25
|
+
"radashi": "^12.9.1",
|
|
26
|
+
"vue": "3.6.0-rc.2",
|
|
27
|
+
"vue-router": "^5.2.0"
|
|
28
|
+
},
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"@antdv-next/auto-import-resolver": "^1.1.0",
|
|
31
|
+
"@antfu/eslint-config": "^9.2.0",
|
|
32
|
+
"@commitlint/cli": "^21.2.1",
|
|
33
|
+
"@commitlint/config-conventional": "^21.2.0",
|
|
34
|
+
"@types/node": "^26.1.1",
|
|
35
|
+
"@types/nprogress": "^0.2.3",
|
|
36
|
+
"@unocss/eslint-plugin": "^66.7.5",
|
|
37
|
+
"@unocss/preset-attributify": "^66.7.5",
|
|
38
|
+
"@unocss/preset-wind4": "^66.7.5",
|
|
39
|
+
"@vitejs/plugin-vue": "^6.0.8",
|
|
40
|
+
"@vue/tsconfig": "^0.9.1",
|
|
41
|
+
"eslint": "10.8.0",
|
|
42
|
+
"eslint-plugin-format": "^2.0.1",
|
|
43
|
+
"eslint-plugin-oxlint": "^1.75.0",
|
|
44
|
+
"fast-glob": "^3.3.3",
|
|
45
|
+
"oxlint": "^1.75.0",
|
|
46
|
+
"sass": "^1.102.0",
|
|
47
|
+
"typescript": "^6.0.3",
|
|
48
|
+
"unocss": "66.7.5",
|
|
49
|
+
"unplugin-auto-import": "^21.0.0",
|
|
50
|
+
"unplugin-vue-components": "^32.1.0",
|
|
51
|
+
"vite": "npm:@voidzero-dev/vite-plus-core@0.2.6",
|
|
52
|
+
"vite-plugin-inspect": "^12.0.2",
|
|
53
|
+
"vite-plugin-svg-icons": "^2.0.1",
|
|
54
|
+
"vite-plus": "^0.2.6",
|
|
55
|
+
"vue-tsc": "^3.3.8"
|
|
56
|
+
},
|
|
57
|
+
"devEngines": {
|
|
58
|
+
"packageManager": {
|
|
59
|
+
"name": "pnpm",
|
|
60
|
+
"version": "11.11.0",
|
|
61
|
+
"onFail": "download"
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M8.34912 1.55823C8.72361 1.23724 9.27639 1.23724 9.65088 1.55823L15.5981 6.65588C15.8493 6.87118 15.9784 7.1972 15.9419 7.526L15.0991 15.11C15.0429 15.6164 14.6145 15.9996 14.105 15.9996H3.89502C3.38553 15.9996 2.95714 15.6164 2.90088 15.11L2.05811 7.526C2.02157 7.1972 2.15067 6.87118 2.40186 6.65588L8.34912 1.55823ZM9.00049 9.99963C7.89603 9.99963 7.00066 10.8952 7.00049 11.9996V13.9996C7.00049 14.5519 7.4482 14.9996 8.00049 14.9996H10.0005C10.5526 14.9994 11.0005 14.5518 11.0005 13.9996V11.9996C11.0003 10.8953 10.1048 9.99985 9.00049 9.99963Z" fill="currentColor"/>
|
|
3
|
+
</svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="37.07" height="36" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 198"><path fill="currentColor" d="M204.8 0H256L128 220.8L0 0h97.92L128 51.2L157.44 0h47.36Z"></path><path fill="currentColor" d="m0 0l128 220.8L256 0h-51.2L128 132.48L50.56 0H0Z"></path><path fill="#35495E" d="M50.56 0L128 133.12L204.8 0h-47.36L128 51.2L97.92 0H50.56Z"></path></svg>
|
|
File without changes
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
defineProps<{
|
|
3
|
+
icon: string;
|
|
4
|
+
}>();
|
|
5
|
+
const attrs = useAttrs();
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<template>
|
|
9
|
+
<svg class="svg-icon" aria-hidden="true" v-bind="attrs">
|
|
10
|
+
<use :href="`#icon-${icon}`" />
|
|
11
|
+
</svg>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<style lang="scss" scoped>
|
|
15
|
+
.svg-icon {
|
|
16
|
+
display: flex;
|
|
17
|
+
justify-content: center;
|
|
18
|
+
align-items: center;
|
|
19
|
+
width: 1em;
|
|
20
|
+
height: 1em;
|
|
21
|
+
fill: currentColor;
|
|
22
|
+
overflow: hidden;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.svg-external-icon {
|
|
26
|
+
background-color: currentColor;
|
|
27
|
+
mask-size: cover !important;
|
|
28
|
+
}
|
|
29
|
+
</style>
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BarChart,
|
|
3
|
+
GraphChart,
|
|
4
|
+
LineChart,
|
|
5
|
+
MapChart,
|
|
6
|
+
PictorialBarChart,
|
|
7
|
+
PieChart,
|
|
8
|
+
RadarChart,
|
|
9
|
+
} from "echarts/charts";
|
|
10
|
+
import {
|
|
11
|
+
AriaComponent,
|
|
12
|
+
CalendarComponent,
|
|
13
|
+
DataZoomComponent,
|
|
14
|
+
GraphicComponent,
|
|
15
|
+
GridComponent,
|
|
16
|
+
LegendComponent,
|
|
17
|
+
ParallelComponent,
|
|
18
|
+
PolarComponent,
|
|
19
|
+
RadarComponent,
|
|
20
|
+
TimelineComponent,
|
|
21
|
+
TitleComponent,
|
|
22
|
+
ToolboxComponent,
|
|
23
|
+
TooltipComponent,
|
|
24
|
+
VisualMapComponent,
|
|
25
|
+
} from "echarts/components";
|
|
26
|
+
import * as echarts from "echarts/core";
|
|
27
|
+
// TODO 如果想换成SVG渲染,就导出SVGRenderer,
|
|
28
|
+
// 并且放到 echarts.use 里,注释掉 CanvasRenderer
|
|
29
|
+
import { /* SVGRenderer */ CanvasRenderer } from "echarts/renderers";
|
|
30
|
+
|
|
31
|
+
echarts.use([
|
|
32
|
+
LegendComponent,
|
|
33
|
+
TitleComponent,
|
|
34
|
+
TooltipComponent,
|
|
35
|
+
GridComponent,
|
|
36
|
+
PolarComponent,
|
|
37
|
+
AriaComponent,
|
|
38
|
+
ParallelComponent,
|
|
39
|
+
BarChart,
|
|
40
|
+
LineChart,
|
|
41
|
+
PieChart,
|
|
42
|
+
MapChart,
|
|
43
|
+
RadarChart,
|
|
44
|
+
GraphChart,
|
|
45
|
+
// TODO 因为要兼容Online图表自适应打印,所以改成 CanvasRenderer,可能会模糊
|
|
46
|
+
CanvasRenderer,
|
|
47
|
+
PictorialBarChart,
|
|
48
|
+
RadarComponent,
|
|
49
|
+
ToolboxComponent,
|
|
50
|
+
DataZoomComponent,
|
|
51
|
+
VisualMapComponent,
|
|
52
|
+
TimelineComponent,
|
|
53
|
+
CalendarComponent,
|
|
54
|
+
GraphicComponent,
|
|
55
|
+
]);
|
|
56
|
+
|
|
57
|
+
export default echarts;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { EChartsOption } from "echarts";
|
|
2
|
+
|
|
3
|
+
import type { ShallowRef } from "vue";
|
|
4
|
+
|
|
5
|
+
import { debounce } from "radashi";
|
|
6
|
+
|
|
7
|
+
import echarts from "./lib";
|
|
8
|
+
|
|
9
|
+
type setOptionsType = (options: EChartsOption, clear?: boolean) => void;
|
|
10
|
+
|
|
11
|
+
export function useECharts(
|
|
12
|
+
elRef: Ref<HTMLDivElement> | Readonly<ShallowRef<HTMLDivElement | null>>,
|
|
13
|
+
) {
|
|
14
|
+
let chartInstance: echarts.ECharts | null = null;
|
|
15
|
+
let resizeObserver: ResizeObserver | undefined;
|
|
16
|
+
|
|
17
|
+
const resize = () => {
|
|
18
|
+
chartInstance?.resize();
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const initCharts = () => {
|
|
22
|
+
if (!elRef) return;
|
|
23
|
+
const el = unref(elRef);
|
|
24
|
+
if (!el) return;
|
|
25
|
+
|
|
26
|
+
resizeObserver = new ResizeObserver(
|
|
27
|
+
debounce(
|
|
28
|
+
{
|
|
29
|
+
delay: 100,
|
|
30
|
+
},
|
|
31
|
+
resize,
|
|
32
|
+
),
|
|
33
|
+
);
|
|
34
|
+
resizeObserver.observe(el);
|
|
35
|
+
|
|
36
|
+
chartInstance = echarts.init(el);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
const setOptions: setOptionsType = (options, clear = true) => {
|
|
40
|
+
if (!chartInstance) {
|
|
41
|
+
initCharts();
|
|
42
|
+
if (!chartInstance) return;
|
|
43
|
+
}
|
|
44
|
+
clear && chartInstance?.clear();
|
|
45
|
+
chartInstance?.setOption(options);
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const getInstance: () => echarts.ECharts | null = () => {
|
|
49
|
+
if (!chartInstance) initCharts();
|
|
50
|
+
return chartInstance;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
onUnmounted(() => {
|
|
54
|
+
chartInstance?.dispose();
|
|
55
|
+
resizeObserver?.disconnect();
|
|
56
|
+
resizeObserver = undefined;
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
return {
|
|
60
|
+
setOptions,
|
|
61
|
+
resize,
|
|
62
|
+
echarts,
|
|
63
|
+
getInstance,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { Avatar, Dropdown } from "antdv-next";
|
|
3
|
+
import { defineComponent, h } from "vue";
|
|
4
|
+
|
|
5
|
+
import { useUserStoreWithOut } from "@/store/modules/user";
|
|
6
|
+
|
|
7
|
+
const userStore = useUserStoreWithOut();
|
|
8
|
+
const router = useRouter();
|
|
9
|
+
|
|
10
|
+
function handleMenuClick({ key }: { key: string }) {
|
|
11
|
+
if (key === "logout") {
|
|
12
|
+
userStore.$reset();
|
|
13
|
+
router.push("/login");
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const dropdownItems = [{ key: "logout", label: "退出登录" }];
|
|
18
|
+
|
|
19
|
+
const VdomUserDropdown = defineComponent({
|
|
20
|
+
name: "VdomUserDropdown",
|
|
21
|
+
setup() {
|
|
22
|
+
return () =>
|
|
23
|
+
h(
|
|
24
|
+
Dropdown,
|
|
25
|
+
{
|
|
26
|
+
trigger: ["click"],
|
|
27
|
+
menu: {
|
|
28
|
+
items: dropdownItems,
|
|
29
|
+
},
|
|
30
|
+
onMenuClick: handleMenuClick,
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
default: () =>
|
|
34
|
+
h("div", { class: "flex-center gap-2 cursor-pointer" }, [
|
|
35
|
+
h(
|
|
36
|
+
Avatar,
|
|
37
|
+
{
|
|
38
|
+
size: 32,
|
|
39
|
+
src: userStore.avatar,
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
default: () => userStore.name?.charAt(0).toUpperCase(),
|
|
43
|
+
},
|
|
44
|
+
),
|
|
45
|
+
h("span", { class: "text-sm" }, userStore.name),
|
|
46
|
+
]),
|
|
47
|
+
},
|
|
48
|
+
);
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
</script>
|
|
52
|
+
|
|
53
|
+
<template>
|
|
54
|
+
<div class="flex gap-3 items-center">
|
|
55
|
+
<VdomUserDropdown />
|
|
56
|
+
</div>
|
|
57
|
+
</template>
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { Menu as AntMenu } from "antdv-next";
|
|
3
|
+
import type { MenuProps } from "antdv-next";
|
|
4
|
+
|
|
5
|
+
import type { MenuRouteRecordRawType } from "@/router/interface";
|
|
6
|
+
|
|
7
|
+
import SvgIcon from "@/components/Icon/svg-icon.vue";
|
|
8
|
+
|
|
9
|
+
import { menuRoutes } from "@/router/modules";
|
|
10
|
+
|
|
11
|
+
import Header from "./header/index.vue";
|
|
12
|
+
|
|
13
|
+
const route = useRoute();
|
|
14
|
+
const router = useRouter();
|
|
15
|
+
|
|
16
|
+
const collapsed = ref(false);
|
|
17
|
+
|
|
18
|
+
const VaporCompatibleMenu = defineComponent({
|
|
19
|
+
inheritAttrs: false,
|
|
20
|
+
setup(_, { attrs }) {
|
|
21
|
+
return () => h(AntMenu, attrs);
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
const selectedKeys = computed(() => {
|
|
26
|
+
const matched = route.matched.map((item) => item.name);
|
|
27
|
+
return matched.filter(Boolean) as string[];
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
const openKeys = ref<string[]>([]);
|
|
31
|
+
|
|
32
|
+
watchEffect(() => {
|
|
33
|
+
const matched = route.matched.map((item) => item.name).filter(Boolean) as string[];
|
|
34
|
+
if (matched.length > 1) {
|
|
35
|
+
openKeys.value = [matched[0]];
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
function handleMenuClick({ key }: { key: string }) {
|
|
40
|
+
router.push({ name: key });
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function renderIcon(icon?: string) {
|
|
44
|
+
if (!icon) return null;
|
|
45
|
+
const isSvgIcon = icon.startsWith("svg-");
|
|
46
|
+
if (isSvgIcon) {
|
|
47
|
+
return h(SvgIcon, {
|
|
48
|
+
icon: icon.replace("svg-", ""),
|
|
49
|
+
style: { fontSize: "18px" },
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function getMenuItems(routes: MenuRouteRecordRawType[]): NonNullable<MenuProps["items"]> {
|
|
56
|
+
return routes
|
|
57
|
+
.filter((item) => !item.meta?.hideInMenu)
|
|
58
|
+
.map((item) => {
|
|
59
|
+
const hasChildren = item.children && item.children.length > 0;
|
|
60
|
+
if (hasChildren) {
|
|
61
|
+
return {
|
|
62
|
+
key: item.name as string,
|
|
63
|
+
label: item.meta?.title ?? String(item.name ?? ""),
|
|
64
|
+
icon: renderIcon(item.meta?.icon),
|
|
65
|
+
children: getMenuItems(item.children as MenuRouteRecordRawType[]),
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
return {
|
|
69
|
+
key: item.name as string,
|
|
70
|
+
label: item.meta?.title ?? String(item.name ?? ""),
|
|
71
|
+
icon: renderIcon(item.meta?.icon),
|
|
72
|
+
};
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const menuItems = computed(() => getMenuItems(menuRoutes));
|
|
77
|
+
</script>
|
|
78
|
+
|
|
79
|
+
<template>
|
|
80
|
+
<ALayout class="h-screen">
|
|
81
|
+
<ALayoutSider
|
|
82
|
+
v-model:collapsed="collapsed"
|
|
83
|
+
:trigger="null"
|
|
84
|
+
collapsible
|
|
85
|
+
:width="220"
|
|
86
|
+
class="layout-sider"
|
|
87
|
+
>
|
|
88
|
+
<div class="logo flex-center gap-2 h-[var(--header-height)]">
|
|
89
|
+
<SvgIcon icon="logo" class="text-2xl" />
|
|
90
|
+
<span v-show="!collapsed" class="text-lg text-white font-bold"> Vue Template </span>
|
|
91
|
+
</div>
|
|
92
|
+
<VaporCompatibleMenu
|
|
93
|
+
v-model:open-keys="openKeys"
|
|
94
|
+
:selected-keys="selectedKeys"
|
|
95
|
+
:items="menuItems"
|
|
96
|
+
theme="dark"
|
|
97
|
+
mode="inline"
|
|
98
|
+
@click="handleMenuClick"
|
|
99
|
+
/>
|
|
100
|
+
</ALayoutSider>
|
|
101
|
+
|
|
102
|
+
<ALayout>
|
|
103
|
+
<ALayoutHeader class="layout-header px-4 flex items-center justify-between">
|
|
104
|
+
<div class="flex gap-3 items-center">
|
|
105
|
+
<AButton type="text" class="flex-center" @click="collapsed = !collapsed">
|
|
106
|
+
<SvgIcon :icon="collapsed ? 'menu-unfold' : 'menu-fold'" style="font-size: 18px" />
|
|
107
|
+
</AButton>
|
|
108
|
+
</div>
|
|
109
|
+
<Header />
|
|
110
|
+
</ALayoutHeader>
|
|
111
|
+
|
|
112
|
+
<ALayoutContent class="layout-content p-4 overflow-auto">
|
|
113
|
+
<RouterView />
|
|
114
|
+
</ALayoutContent>
|
|
115
|
+
</ALayout>
|
|
116
|
+
</ALayout>
|
|
117
|
+
</template>
|
|
118
|
+
|
|
119
|
+
<style lang="scss" scoped>
|
|
120
|
+
.layout-sider {
|
|
121
|
+
position: sticky;
|
|
122
|
+
top: 0;
|
|
123
|
+
height: 100vh;
|
|
124
|
+
overflow: auto;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.layout-header {
|
|
128
|
+
height: var(--header-height);
|
|
129
|
+
background: #fff;
|
|
130
|
+
border-bottom: 1px solid #f0f0f0;
|
|
131
|
+
padding: 0;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.layout-content {
|
|
135
|
+
min-height: calc(100vh - var(--header-height));
|
|
136
|
+
background: #f5f5f5;
|
|
137
|
+
}
|
|
138
|
+
</style>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { VaporComponent } from 'vue'
|
|
2
|
+
import { createVaporApp, vaporInteropPlugin } from 'vue'
|
|
3
|
+
|
|
4
|
+
import App from './App.vue'
|
|
5
|
+
import { setupRouter } from './router'
|
|
6
|
+
import { setupStore } from './store'
|
|
7
|
+
|
|
8
|
+
import 'virtual:svg-icons-register'
|
|
9
|
+
|
|
10
|
+
import '@/styles/index.scss'
|
|
11
|
+
import 'virtual:uno.css'
|
|
12
|
+
|
|
13
|
+
// vue-tsc 3.3.8 still types SFC imports as VDOM components in global Vapor mode.
|
|
14
|
+
const app = createVaporApp(App as unknown as VaporComponent)
|
|
15
|
+
app.use(vaporInteropPlugin)
|
|
16
|
+
setupRouter(app)
|
|
17
|
+
setupStore(app)
|
|
18
|
+
|
|
19
|
+
app.mount('#app')
|