@lovrabet/rabetbase-cli 2.4.3 → 2.4.4-beta.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/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/filter.js +1 -1
- package/lib/commands/data/getOne.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/data/shared.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff-refresh-start.d.ts +2 -0
- package/lib/commands/db/diff-refresh-start.js +1 -0
- package/lib/commands/db/diff-refresh-status.d.ts +2 -0
- package/lib/commands/db/diff-refresh-status.js +1 -0
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init/index.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/kb/create.js +1 -1
- package/lib/commands/kb/delete.js +1 -1
- package/lib/commands/kb/detail.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/kb/list.js +1 -1
- package/lib/commands/kb/shared.js +1 -1
- package/lib/commands/kb/update.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/rename.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/notification/config-create.d.ts +2 -0
- package/lib/commands/notification/config-create.js +1 -0
- package/lib/commands/notification/config-delete.d.ts +2 -0
- package/lib/commands/notification/config-delete.js +1 -0
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/config-update.d.ts +2 -0
- package/lib/commands/notification/config-update.js +1 -0
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.d.ts +97 -0
- package/lib/commands/notification/shared.js +1 -0
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/react/create.js +1 -1
- package/lib/commands/page/react/detail.js +1 -1
- package/lib/commands/page/react/list.js +1 -1
- package/lib/commands/page/react/publish.js +1 -1
- package/lib/commands/page/react/shared.js +1 -1
- package/lib/commands/page/react/syntax.js +1 -1
- package/lib/commands/page/react/template.js +1 -1
- package/lib/commands/page/react/update.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/restore.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/standard-page-status.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/permit/index.js +1 -1
- package/lib/commands/permit/page-get.js +1 -1
- package/lib/commands/permit/page-set.js +1 -1
- package/lib/commands/permit/role-apis-set.js +1 -1
- package/lib/commands/permit/role-menus-set.js +1 -1
- package/lib/commands/permit/role-menus.js +1 -1
- package/lib/commands/permit/shared.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.d.ts +1 -0
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/materialize-project-template.d.ts +11 -0
- package/lib/commands/project/create/materialize-project-template.js +1 -0
- package/lib/commands/project/create/project-name.d.ts +2 -0
- package/lib/commands/project/create/project-name.js +1 -0
- package/lib/commands/project/create/project-template-archive.d.ts +6 -0
- package/lib/commands/project/create/project-template-archive.js +1 -0
- package/lib/commands/project/create/project-template-path.d.ts +1 -3
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.d.ts +2 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/create.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/task/index.js +1 -1
- package/lib/commands/task/status.js +1 -1
- package/lib/commands/tenant/index.js +1 -1
- package/lib/commands/tenant/members-list.js +1 -1
- package/lib/commands/tenant/shared.js +1 -1
- package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.d.ts +2 -0
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.d.ts +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.d.ts +29 -2
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.d.ts +13 -0
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/rules-cdn.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +9 -4
- package/skills/rabetbase/SKILL.md +33 -22
- package/skills/rabetbase/guides/backend-function.md +5 -3
- package/skills/rabetbase/guides/bff-creation-workflow.md +2 -2
- package/skills/rabetbase/guides/conflict-detection.md +2 -2
- package/skills/rabetbase/guides/database-connection-workflow.md +39 -5
- package/skills/rabetbase/guides/react-custom-page-workflow.md +16 -4
- package/skills/rabetbase/guides/sql-creation-workflow.md +4 -2
- package/skills/rabetbase/guides/sql-mybatis.md +2 -2
- package/skills/rabetbase/knowledge/page-schema/YtPage.md +3 -37
- package/skills/rabetbase/knowledge/react-page/generation-standards.md +14 -3
- package/skills/rabetbase/references/rabetbase-app-config.md +2 -2
- package/skills/rabetbase/references/rabetbase-bff-push.md +4 -5
- package/skills/rabetbase/references/rabetbase-bff-save.md +3 -3
- package/skills/rabetbase/references/rabetbase-config.md +2 -2
- package/skills/rabetbase/references/rabetbase-db-analyze.md +2 -2
- package/skills/rabetbase/references/rabetbase-db-detail.md +3 -0
- package/skills/rabetbase/references/rabetbase-db-diff-refresh.md +53 -0
- package/skills/rabetbase/references/rabetbase-db-diff.md +40 -21
- package/skills/rabetbase/references/rabetbase-db-list.md +1 -1
- package/skills/rabetbase/references/rabetbase-kb.md +5 -3
- package/skills/rabetbase/references/rabetbase-menu-asset-update.md +9 -10
- package/skills/rabetbase/references/rabetbase-menu-external-link-update.md +1 -3
- package/skills/rabetbase/references/rabetbase-menu-regroup-start.md +2 -3
- package/skills/rabetbase/references/rabetbase-notification-config-list.md +2 -2
- package/skills/rabetbase/references/rabetbase-notification-config-mutations.md +56 -0
- package/skills/rabetbase/references/rabetbase-page-react-detail.md +1 -1
- package/skills/rabetbase/references/rabetbase-page-react-list.md +1 -1
- package/skills/rabetbase/references/rabetbase-page-react-publish.md +2 -2
- package/skills/rabetbase/references/rabetbase-project-create.md +3 -0
- package/skills/rabetbase/references/rabetbase-run.md +1 -1
- package/skills/rabetbase/references/rabetbase-sql-create.md +1 -1
- package/skills/rabetbase/references/rabetbase-sql-push.md +3 -4
- package/skills/rabetbase/references/rabetbase-user-account.md +0 -1
- package/skills/rabetbase.manifest.json +5 -5
- package/templates/README.md +14 -2
- package/lib/commands/project/create/non-interactive.d.ts +0 -9
- package/lib/commands/project/create/non-interactive.js +0 -1
- package/lib/utils/copy-directory.d.ts +0 -1
- package/lib/utils/copy-directory.js +0 -1
- package/skills/rabetbase/knowledge/page-schema/LrSmartEcharts.md +0 -291
- package/skills/rabetbase/knowledge/page-schema/LrSmartStatistic.md +0 -223
- package/templates/projects/sub-app-react-demo/.prettierrc +0 -1
- package/templates/projects/sub-app-react-demo/CHANGELOG.md +0 -67
- package/templates/projects/sub-app-react-demo/README.md +0 -246
- package/templates/projects/sub-app-react-demo/docs/quick-start.md +0 -245
- package/templates/projects/sub-app-react-demo/index.html +0 -27
- package/templates/projects/sub-app-react-demo/package.json +0 -34
- package/templates/projects/sub-app-react-demo/public/logo.svg +0 -1
- package/templates/projects/sub-app-react-demo/public/vite.svg +0 -1
- package/templates/projects/sub-app-react-demo/src/api/api.ts +0 -26
- package/templates/projects/sub-app-react-demo/src/api/client.ts +0 -32
- package/templates/projects/sub-app-react-demo/src/components/demo-page-container/DemoPageContainer.module.css +0 -28
- package/templates/projects/sub-app-react-demo/src/components/demo-page-container/DemoPageContainer.tsx +0 -55
- package/templates/projects/sub-app-react-demo/src/layouts/MainLayout.tsx +0 -308
- package/templates/projects/sub-app-react-demo/src/main.tsx +0 -52
- package/templates/projects/sub-app-react-demo/src/pages/dashboard/index.tsx +0 -570
- package/templates/projects/sub-app-react-demo/src/pages/data-screen/index.tsx +0 -531
- package/templates/projects/sub-app-react-demo/src/pages/index.module.css +0 -500
- package/templates/projects/sub-app-react-demo/src/pages/index.tsx +0 -641
- package/templates/projects/sub-app-react-demo/src/pages/sdk-demo/index.tsx +0 -536
- package/templates/projects/sub-app-react-demo/src/pages/workbench/index.module.css +0 -295
- package/templates/projects/sub-app-react-demo/src/pages/workbench/index.tsx +0 -242
- package/templates/projects/sub-app-react-demo/src/router/index.tsx +0 -30
- package/templates/projects/sub-app-react-demo/src/style.css +0 -108
- package/templates/projects/sub-app-react-demo/src/utils/api.ts +0 -12
- package/templates/projects/sub-app-react-demo/src/vite-env.d.ts +0 -2
- package/templates/projects/sub-app-react-demo/tsconfig.json +0 -26
- package/templates/projects/sub-app-react-demo/vite.config.ts +0 -111
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
.root {
|
|
2
|
-
width: 100%;
|
|
3
|
-
min-width: 0;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
/* 标准演示页的页面级 gutter 只保留这一层。
|
|
7
|
-
页面自身不要再补外层 padding,避免和容器叠成双层留白。 */
|
|
8
|
-
.standard {
|
|
9
|
-
padding: 16px 16px 24px;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
/* bleed 页面由页面自己决定内部留白,用于数据大屏这类全宽舞台。 */
|
|
13
|
-
.bleed {
|
|
14
|
-
padding: 0;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.inner {
|
|
18
|
-
width: 100%;
|
|
19
|
-
min-width: 0;
|
|
20
|
-
max-width: var(--demo-page-max-width, 100%);
|
|
21
|
-
margin: 0 auto;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
@media (max-width: 768px) {
|
|
25
|
-
.standard {
|
|
26
|
-
padding: 12px;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import type { CSSProperties, ReactNode } from "react";
|
|
2
|
-
import styles from "./DemoPageContainer.module.css";
|
|
3
|
-
|
|
4
|
-
type DemoPageContainerVariant = "standard" | "bleed";
|
|
5
|
-
|
|
6
|
-
interface DemoPageContainerProps {
|
|
7
|
-
children: ReactNode;
|
|
8
|
-
className?: string;
|
|
9
|
-
innerClassName?: string;
|
|
10
|
-
innerStyle?: CSSProperties;
|
|
11
|
-
maxWidth?: number | string;
|
|
12
|
-
style?: CSSProperties;
|
|
13
|
-
variant?: DemoPageContainerVariant;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
function joinClassNames(...classNames: Array<string | undefined>) {
|
|
17
|
-
return classNames.filter(Boolean).join(" ");
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export default function DemoPageContainer({
|
|
21
|
-
children,
|
|
22
|
-
className,
|
|
23
|
-
innerClassName,
|
|
24
|
-
innerStyle,
|
|
25
|
-
maxWidth,
|
|
26
|
-
style,
|
|
27
|
-
variant = "standard",
|
|
28
|
-
}: DemoPageContainerProps) {
|
|
29
|
-
const mergedInnerStyle = {
|
|
30
|
-
...innerStyle,
|
|
31
|
-
} as CSSProperties & Record<string, string>;
|
|
32
|
-
|
|
33
|
-
if (maxWidth !== undefined) {
|
|
34
|
-
mergedInnerStyle["--demo-page-max-width"] =
|
|
35
|
-
typeof maxWidth === "number" ? `${maxWidth}px` : maxWidth;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
return (
|
|
39
|
-
<div
|
|
40
|
-
className={joinClassNames(
|
|
41
|
-
styles.root,
|
|
42
|
-
variant === "bleed" ? styles.bleed : styles.standard,
|
|
43
|
-
className,
|
|
44
|
-
)}
|
|
45
|
-
style={style}
|
|
46
|
-
>
|
|
47
|
-
<div
|
|
48
|
-
className={joinClassNames(styles.inner, innerClassName)}
|
|
49
|
-
style={mergedInnerStyle}
|
|
50
|
-
>
|
|
51
|
-
{children}
|
|
52
|
-
</div>
|
|
53
|
-
</div>
|
|
54
|
-
);
|
|
55
|
-
}
|
|
@@ -1,308 +0,0 @@
|
|
|
1
|
-
import React, { useState } from "react";
|
|
2
|
-
import { isInIcestark } from "@ice/stark-app";
|
|
3
|
-
import { Outlet, useNavigate, useLocation } from "react-router-dom";
|
|
4
|
-
import {
|
|
5
|
-
Layout,
|
|
6
|
-
Menu,
|
|
7
|
-
Button,
|
|
8
|
-
Breadcrumb,
|
|
9
|
-
Avatar,
|
|
10
|
-
Space,
|
|
11
|
-
Dropdown,
|
|
12
|
-
} from "antd";
|
|
13
|
-
import type { MenuProps } from "antd";
|
|
14
|
-
import {
|
|
15
|
-
HomeOutlined,
|
|
16
|
-
DashboardOutlined,
|
|
17
|
-
ApiOutlined,
|
|
18
|
-
MenuFoldOutlined,
|
|
19
|
-
MenuUnfoldOutlined,
|
|
20
|
-
UserOutlined,
|
|
21
|
-
BarChartOutlined,
|
|
22
|
-
FileTextOutlined,
|
|
23
|
-
} from "@ant-design/icons";
|
|
24
|
-
|
|
25
|
-
const { Header, Sider, Content } = Layout;
|
|
26
|
-
|
|
27
|
-
// 路由配置,用于生成面包屑
|
|
28
|
-
const routeConfig = [
|
|
29
|
-
{ path: "/", title: "首页" },
|
|
30
|
-
{ path: "/workbench", title: "工作台" },
|
|
31
|
-
{ path: "/dashboard", title: "数据看板" },
|
|
32
|
-
{ path: "/sdk-demo", title: "SDK 演示" },
|
|
33
|
-
{ path: "/data-screen", title: "数据大屏" },
|
|
34
|
-
];
|
|
35
|
-
|
|
36
|
-
const MainLayout: React.FC = () => {
|
|
37
|
-
const navigate = useNavigate();
|
|
38
|
-
const location = useLocation();
|
|
39
|
-
|
|
40
|
-
// 菜单收起/展开状态
|
|
41
|
-
const [collapsed, setCollapsed] = useState(false);
|
|
42
|
-
// 菜单是否完全隐藏
|
|
43
|
-
const [menuHidden, setMenuHidden] = useState(false);
|
|
44
|
-
|
|
45
|
-
const menuItems: MenuProps["items"] = [
|
|
46
|
-
{
|
|
47
|
-
key: "/",
|
|
48
|
-
icon: <HomeOutlined />,
|
|
49
|
-
label: "首页",
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
key: "/sdk-demo",
|
|
53
|
-
icon: <ApiOutlined />,
|
|
54
|
-
label: "SDK 演示",
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
key: "page-examples",
|
|
58
|
-
icon: <FileTextOutlined />,
|
|
59
|
-
label: "页面案例",
|
|
60
|
-
children: [
|
|
61
|
-
{
|
|
62
|
-
key: "/workbench",
|
|
63
|
-
icon: <DashboardOutlined />,
|
|
64
|
-
label: "工作台",
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
key: "/dashboard",
|
|
68
|
-
icon: <DashboardOutlined />,
|
|
69
|
-
label: "数据看板",
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
key: "/data-screen",
|
|
73
|
-
icon: <BarChartOutlined />,
|
|
74
|
-
label: "数据大屏",
|
|
75
|
-
},
|
|
76
|
-
],
|
|
77
|
-
},
|
|
78
|
-
];
|
|
79
|
-
|
|
80
|
-
const handleMenuClick = ({ key }: { key: string }) => {
|
|
81
|
-
// 如果是外部链接(以 http:// 或 https:// 开头),在新标签页打开
|
|
82
|
-
if (key.startsWith("http://") || key.startsWith("https://")) {
|
|
83
|
-
window.open(key, "_blank", "noopener,noreferrer");
|
|
84
|
-
} else {
|
|
85
|
-
navigate(key);
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
const toggleCollapsed = () => {
|
|
90
|
-
setCollapsed(!collapsed);
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
const toggleMenuHidden = () => {
|
|
94
|
-
setMenuHidden(!menuHidden);
|
|
95
|
-
// 如果隐藏菜单,同时收起菜单
|
|
96
|
-
if (!menuHidden) {
|
|
97
|
-
setCollapsed(true);
|
|
98
|
-
}
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
// 生成面包屑
|
|
102
|
-
const getBreadcrumbItems = () => {
|
|
103
|
-
const items: any[] = [{ title: "首页" }];
|
|
104
|
-
const currentRoute = routeConfig.find((r) => r.path === location.pathname);
|
|
105
|
-
if (currentRoute && currentRoute.path !== "/") {
|
|
106
|
-
items.push({ title: currentRoute.title });
|
|
107
|
-
}
|
|
108
|
-
return items;
|
|
109
|
-
};
|
|
110
|
-
|
|
111
|
-
// 用户菜单
|
|
112
|
-
const userMenuItems: MenuProps["items"] = [
|
|
113
|
-
{
|
|
114
|
-
key: "profile",
|
|
115
|
-
label: "个人中心",
|
|
116
|
-
icon: <UserOutlined />,
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
key: "settings",
|
|
120
|
-
label: "系统设置",
|
|
121
|
-
},
|
|
122
|
-
{
|
|
123
|
-
type: "divider",
|
|
124
|
-
},
|
|
125
|
-
{
|
|
126
|
-
key: "logout",
|
|
127
|
-
label: "退出登录",
|
|
128
|
-
danger: true,
|
|
129
|
-
},
|
|
130
|
-
];
|
|
131
|
-
|
|
132
|
-
// 可选:根据isInIcestark()判断当前运行环境,被嵌入时,不渲染layout布局
|
|
133
|
-
if (isInIcestark()) {
|
|
134
|
-
return <Outlet />;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
return (
|
|
138
|
-
<Layout style={{ minHeight: "100vh", background: "#fff" }}>
|
|
139
|
-
{!menuHidden && (
|
|
140
|
-
<Sider
|
|
141
|
-
trigger={null}
|
|
142
|
-
collapsible
|
|
143
|
-
collapsed={collapsed}
|
|
144
|
-
width={220}
|
|
145
|
-
style={{ background: "#fff" }}
|
|
146
|
-
>
|
|
147
|
-
{/* 系统标题 */}
|
|
148
|
-
<div
|
|
149
|
-
style={{
|
|
150
|
-
height: 64,
|
|
151
|
-
padding: collapsed ? "16px 8px" : "16px 20px",
|
|
152
|
-
display: "flex",
|
|
153
|
-
alignItems: "center",
|
|
154
|
-
justifyContent: collapsed ? "center" : "flex-start",
|
|
155
|
-
background: "#fff",
|
|
156
|
-
borderBottom: "1px solid #f0f0f0",
|
|
157
|
-
}}
|
|
158
|
-
>
|
|
159
|
-
{!collapsed ? (
|
|
160
|
-
<div style={{ display: "flex", alignItems: "center", gap: 12 }}>
|
|
161
|
-
<img
|
|
162
|
-
src="/logo.svg"
|
|
163
|
-
alt="Logo"
|
|
164
|
-
style={{ height: 28, width: 28 }}
|
|
165
|
-
/>
|
|
166
|
-
<span
|
|
167
|
-
style={{
|
|
168
|
-
fontSize: 16,
|
|
169
|
-
fontWeight: 600,
|
|
170
|
-
}}
|
|
171
|
-
>
|
|
172
|
-
Lovrabet System
|
|
173
|
-
</span>
|
|
174
|
-
</div>
|
|
175
|
-
) : (
|
|
176
|
-
<img
|
|
177
|
-
src="/logo.svg"
|
|
178
|
-
alt="Logo"
|
|
179
|
-
style={{ height: 28, width: 28 }}
|
|
180
|
-
/>
|
|
181
|
-
)}
|
|
182
|
-
</div>
|
|
183
|
-
<Menu
|
|
184
|
-
mode="inline"
|
|
185
|
-
selectedKeys={[location.pathname]}
|
|
186
|
-
items={menuItems}
|
|
187
|
-
onClick={handleMenuClick}
|
|
188
|
-
style={{
|
|
189
|
-
height: "calc(100vh - 64px)",
|
|
190
|
-
borderRight: 0,
|
|
191
|
-
}}
|
|
192
|
-
className="custom-menu"
|
|
193
|
-
/>
|
|
194
|
-
</Sider>
|
|
195
|
-
)}
|
|
196
|
-
<Layout style={{ background: "#fff" }}>
|
|
197
|
-
<Header
|
|
198
|
-
style={{
|
|
199
|
-
padding: "0 24px",
|
|
200
|
-
display: "flex",
|
|
201
|
-
alignItems: "center",
|
|
202
|
-
justifyContent: "space-between",
|
|
203
|
-
boxShadow: "0 2px 8px 0 rgba(29,35,41,.05)",
|
|
204
|
-
height: 64,
|
|
205
|
-
background: "#fff",
|
|
206
|
-
borderBottom: "1px solid #f0f0f0",
|
|
207
|
-
}}
|
|
208
|
-
>
|
|
209
|
-
<div style={{ display: "flex", alignItems: "center", gap: 16 }}>
|
|
210
|
-
<Button
|
|
211
|
-
type="text"
|
|
212
|
-
icon={
|
|
213
|
-
menuHidden ? (
|
|
214
|
-
<MenuUnfoldOutlined />
|
|
215
|
-
) : collapsed ? (
|
|
216
|
-
<MenuUnfoldOutlined />
|
|
217
|
-
) : (
|
|
218
|
-
<MenuFoldOutlined />
|
|
219
|
-
)
|
|
220
|
-
}
|
|
221
|
-
onClick={menuHidden ? toggleMenuHidden : toggleCollapsed}
|
|
222
|
-
style={{
|
|
223
|
-
fontSize: 16,
|
|
224
|
-
width: 40,
|
|
225
|
-
height: 40,
|
|
226
|
-
display: "flex",
|
|
227
|
-
alignItems: "center",
|
|
228
|
-
justifyContent: "center",
|
|
229
|
-
}}
|
|
230
|
-
/>
|
|
231
|
-
{menuHidden && (
|
|
232
|
-
<Button
|
|
233
|
-
type="text"
|
|
234
|
-
icon={<MenuUnfoldOutlined />}
|
|
235
|
-
onClick={toggleMenuHidden}
|
|
236
|
-
style={{
|
|
237
|
-
fontSize: 14,
|
|
238
|
-
height: 32,
|
|
239
|
-
}}
|
|
240
|
-
>
|
|
241
|
-
显示菜单
|
|
242
|
-
</Button>
|
|
243
|
-
)}
|
|
244
|
-
{/* 面包屑导航 */}
|
|
245
|
-
<Breadcrumb
|
|
246
|
-
items={getBreadcrumbItems()}
|
|
247
|
-
style={{
|
|
248
|
-
marginLeft: menuHidden ? 0 : 16,
|
|
249
|
-
fontSize: 14,
|
|
250
|
-
}}
|
|
251
|
-
itemRender={(route, params, routes, paths) => {
|
|
252
|
-
const isLast = routes.indexOf(route) === routes.length - 1;
|
|
253
|
-
return (
|
|
254
|
-
<span
|
|
255
|
-
style={{
|
|
256
|
-
color: isLast ? "#262626" : "#595959",
|
|
257
|
-
fontWeight: isLast ? 500 : 400,
|
|
258
|
-
}}
|
|
259
|
-
>
|
|
260
|
-
{route.title}
|
|
261
|
-
</span>
|
|
262
|
-
);
|
|
263
|
-
}}
|
|
264
|
-
/>
|
|
265
|
-
</div>
|
|
266
|
-
<div style={{ display: "flex", alignItems: "center", gap: 16 }}>
|
|
267
|
-
{/* 用户信息 */}
|
|
268
|
-
<Dropdown menu={{ items: userMenuItems }} placement="bottomRight">
|
|
269
|
-
<Space
|
|
270
|
-
style={{
|
|
271
|
-
cursor: "pointer",
|
|
272
|
-
padding: "4px 8px",
|
|
273
|
-
borderRadius: 4,
|
|
274
|
-
transition: "background 0.3s",
|
|
275
|
-
}}
|
|
276
|
-
onMouseEnter={(e) => {
|
|
277
|
-
e.currentTarget.style.background = "rgba(0,0,0,0.06)";
|
|
278
|
-
}}
|
|
279
|
-
onMouseLeave={(e) => {
|
|
280
|
-
e.currentTarget.style.background = "transparent";
|
|
281
|
-
}}
|
|
282
|
-
>
|
|
283
|
-
<Avatar
|
|
284
|
-
size="small"
|
|
285
|
-
icon={<UserOutlined />}
|
|
286
|
-
style={{ background: "#1890ff" }}
|
|
287
|
-
/>
|
|
288
|
-
<span style={{ fontSize: 14 }}>管理员</span>
|
|
289
|
-
</Space>
|
|
290
|
-
</Dropdown>
|
|
291
|
-
</div>
|
|
292
|
-
</Header>
|
|
293
|
-
<Content
|
|
294
|
-
className="subapp-shell-content"
|
|
295
|
-
style={{
|
|
296
|
-
minHeight: 280,
|
|
297
|
-
}}
|
|
298
|
-
>
|
|
299
|
-
<div className="subapp-shell-stage">
|
|
300
|
-
<Outlet />
|
|
301
|
-
</div>
|
|
302
|
-
</Content>
|
|
303
|
-
</Layout>
|
|
304
|
-
</Layout>
|
|
305
|
-
);
|
|
306
|
-
};
|
|
307
|
-
|
|
308
|
-
export default MainLayout;
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { createRoot } from "react-dom/client";
|
|
3
|
-
import { isInIcestark } from "@ice/stark-app";
|
|
4
|
-
import { ConfigProvider } from "antd";
|
|
5
|
-
import zhCN from "antd/locale/zh_CN";
|
|
6
|
-
import App from "./router";
|
|
7
|
-
import "./style.css";
|
|
8
|
-
|
|
9
|
-
// 可选:根据 isInIcestark() 判断当前的运行环境,可同时兼容独立使用和嵌入使用
|
|
10
|
-
if (!isInIcestark()) {
|
|
11
|
-
const container = document.getElementById("root");
|
|
12
|
-
if (container) {
|
|
13
|
-
const root = createRoot(container);
|
|
14
|
-
root.render(
|
|
15
|
-
<ConfigProvider locale={zhCN}>
|
|
16
|
-
<App />
|
|
17
|
-
</ConfigProvider>,
|
|
18
|
-
);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
// 关键:暴露 mount 供主应用加载时调用
|
|
23
|
-
export function mount({
|
|
24
|
-
container,
|
|
25
|
-
customProps,
|
|
26
|
-
}: {
|
|
27
|
-
container: HTMLElement;
|
|
28
|
-
customProps: object;
|
|
29
|
-
}) {
|
|
30
|
-
let root = (container as any)._reactRoot;
|
|
31
|
-
if (!root) {
|
|
32
|
-
root = createRoot(container);
|
|
33
|
-
(container as any)._reactRoot = root;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
root.render(
|
|
37
|
-
<ConfigProvider locale={zhCN}>
|
|
38
|
-
<App {...customProps} />
|
|
39
|
-
</ConfigProvider>,
|
|
40
|
-
);
|
|
41
|
-
return root;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
// 关键:暴露 unmount 供主应用卸载时调用
|
|
45
|
-
export function unmount({ container }: { container: HTMLElement }) {
|
|
46
|
-
// React 18 中不再需要手动卸载,但为了兼容性保留
|
|
47
|
-
const root = (container as any)._reactRoot;
|
|
48
|
-
if (root) {
|
|
49
|
-
root.unmount();
|
|
50
|
-
delete (container as any)._reactRoot;
|
|
51
|
-
}
|
|
52
|
-
}
|