@lovrabet/rabetbase-cli 2.2.4 → 2.2.5-beta.2

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.
Files changed (240) hide show
  1. package/README.md +1 -1
  2. package/lib/api/api-doc.js +1 -1
  3. package/lib/api/fetch-model-list.js +1 -1
  4. package/lib/api/generate-api-file.js +1 -1
  5. package/lib/auth/auth-server-ui.js +1 -1
  6. package/lib/auth/auth-server.js +1 -1
  7. package/lib/auth/constant.js +1 -1
  8. package/lib/auth/get-cookie.js +1 -1
  9. package/lib/auth/get-session-user.js +1 -1
  10. package/lib/auth/is-session-valid.js +1 -1
  11. package/lib/auth/login-success-html.js +1 -1
  12. package/lib/auth/logout.js +1 -1
  13. package/lib/cli-flags.js +1 -1
  14. package/lib/cli.js +1 -1
  15. package/lib/commands/api/generate.js +1 -1
  16. package/lib/commands/api/index.js +1 -1
  17. package/lib/commands/api/list.js +1 -1
  18. package/lib/commands/api/pull.js +1 -1
  19. package/lib/commands/api/shared.js +1 -1
  20. package/lib/commands/app/add.js +1 -1
  21. package/lib/commands/app/discover.js +1 -1
  22. package/lib/commands/app/index.js +1 -1
  23. package/lib/commands/app/list.js +1 -1
  24. package/lib/commands/app/remove.js +1 -1
  25. package/lib/commands/app/shared.js +1 -1
  26. package/lib/commands/app/use.js +1 -1
  27. package/lib/commands/app-config/delete.js +1 -0
  28. package/lib/commands/app-config/get.js +1 -0
  29. package/lib/commands/app-config/index.js +1 -0
  30. package/lib/commands/app-config/list.js +1 -0
  31. package/lib/commands/app-config/set.js +1 -0
  32. package/lib/commands/app-config/shared.js +1 -0
  33. package/lib/commands/auth/index.js +1 -1
  34. package/lib/commands/bff/create.js +1 -1
  35. package/lib/commands/bff/delete.js +1 -1
  36. package/lib/commands/bff/detail.js +1 -1
  37. package/lib/commands/bff/index.js +1 -1
  38. package/lib/commands/bff/list.js +1 -1
  39. package/lib/commands/bff/pull.js +1 -1
  40. package/lib/commands/bff/push.js +1 -1
  41. package/lib/commands/bff/status.js +1 -1
  42. package/lib/commands/cli-update.js +1 -1
  43. package/lib/commands/codegen/index.js +1 -1
  44. package/lib/commands/codegen/sdk.js +1 -1
  45. package/lib/commands/codegen/sql.js +1 -1
  46. package/lib/commands/common/app-selector.js +1 -1
  47. package/lib/commands/common/flags.js +1 -1
  48. package/lib/commands/common/validate.js +1 -1
  49. package/lib/commands/config/get.js +1 -1
  50. package/lib/commands/config/index.js +1 -1
  51. package/lib/commands/config/list.js +1 -1
  52. package/lib/commands/config/set.js +1 -1
  53. package/lib/commands/config/shared.js +1 -1
  54. package/lib/commands/data/filter.js +1 -1
  55. package/lib/commands/data/getOne.js +1 -1
  56. package/lib/commands/data/index.js +1 -1
  57. package/lib/commands/data/shared.js +1 -1
  58. package/lib/commands/dataset/business-group-update.js +1 -0
  59. package/lib/commands/dataset/capability.js +1 -1
  60. package/lib/commands/dataset/delete.js +1 -1
  61. package/lib/commands/dataset/detail.js +1 -1
  62. package/lib/commands/dataset/extend-update.js +1 -1
  63. package/lib/commands/dataset/field-update.js +1 -1
  64. package/lib/commands/dataset/index.js +1 -1
  65. package/lib/commands/dataset/list.js +1 -1
  66. package/lib/commands/dataset/operations.js +1 -1
  67. package/lib/commands/dataset/relation-create.js +1 -1
  68. package/lib/commands/dataset/relation-delete.js +1 -1
  69. package/lib/commands/dataset/relation-shared.js +1 -1
  70. package/lib/commands/dataset/relation-update.js +1 -1
  71. package/lib/commands/dataset/relations.js +1 -1
  72. package/lib/commands/dataset/rename.js +1 -1
  73. package/lib/commands/dataset/restore.js +1 -0
  74. package/lib/commands/db/analyze-cancel.js +1 -1
  75. package/lib/commands/db/analyze-start.js +1 -1
  76. package/lib/commands/db/analyze-status.js +1 -1
  77. package/lib/commands/db/create.js +1 -1
  78. package/lib/commands/db/delete.js +1 -1
  79. package/lib/commands/db/detail.js +1 -1
  80. package/lib/commands/db/diff.js +1 -1
  81. package/lib/commands/db/index.js +1 -1
  82. package/lib/commands/db/list.js +1 -1
  83. package/lib/commands/db/shared.js +1 -1
  84. package/lib/commands/db/tables.js +1 -1
  85. package/lib/commands/db/test.js +1 -1
  86. package/lib/commands/db/update.js +1 -1
  87. package/lib/commands/doctor.js +1 -1
  88. package/lib/commands/init/index.js +1 -1
  89. package/lib/commands/issue/index.js +1 -1
  90. package/lib/commands/issue/nudge.js +1 -1
  91. package/lib/commands/issue/report.js +1 -1
  92. package/lib/commands/issue/shared.js +1 -1
  93. package/lib/commands/logs/index.js +1 -1
  94. package/lib/commands/menu/index.js +1 -1
  95. package/lib/commands/menu/list.js +1 -1
  96. package/lib/commands/menu/shared/compare-table.js +1 -1
  97. package/lib/commands/menu/shared/index.js +1 -1
  98. package/lib/commands/menu/shared/inquirer.js +1 -1
  99. package/lib/commands/menu/shared/local-pages.js +1 -1
  100. package/lib/commands/menu/shared/logic.js +1 -1
  101. package/lib/commands/menu/shared/service.js +1 -1
  102. package/lib/commands/menu/shared/sync-core.js +1 -1
  103. package/lib/commands/menu/shared/update-core.js +1 -1
  104. package/lib/commands/menu/shared/valid-url.js +1 -1
  105. package/lib/commands/menu/sync.js +1 -1
  106. package/lib/commands/menu/update.js +1 -1
  107. package/lib/commands/page/generate-start.js +1 -1
  108. package/lib/commands/page/generate-status.js +1 -1
  109. package/lib/commands/page/index.js +1 -1
  110. package/lib/commands/page/pull.js +1 -1
  111. package/lib/commands/page/push.js +1 -1
  112. package/lib/commands/page/relation-audit.js +1 -1
  113. package/lib/commands/page/shared.js +1 -1
  114. package/lib/commands/page/standard-page-status.js +1 -1
  115. package/lib/commands/page/sync.js +1 -1
  116. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  117. package/lib/commands/project/create/format-elapsed.js +1 -1
  118. package/lib/commands/project/create/main.js +1 -1
  119. package/lib/commands/project/create/non-interactive.js +1 -1
  120. package/lib/commands/project/create/project-template-path.js +1 -1
  121. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  122. package/lib/commands/project/create/use-format-code.js +1 -1
  123. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  124. package/lib/commands/project/index.js +1 -1
  125. package/lib/commands/project/init.js +1 -1
  126. package/lib/commands/project/upgrade.js +1 -1
  127. package/lib/commands/registry.js +1 -1
  128. package/lib/commands/run/index.js +1 -1
  129. package/lib/commands/schema.js +1 -1
  130. package/lib/commands/skill/index.js +1 -1
  131. package/lib/commands/sql/create.js +1 -1
  132. package/lib/commands/sql/delete.js +1 -1
  133. package/lib/commands/sql/detail.js +1 -1
  134. package/lib/commands/sql/exec.js +1 -1
  135. package/lib/commands/sql/index.js +1 -1
  136. package/lib/commands/sql/list.js +1 -1
  137. package/lib/commands/sql/pull.js +1 -1
  138. package/lib/commands/sql/push.js +1 -1
  139. package/lib/commands/sql/save.js +1 -1
  140. package/lib/commands/sql/shared.js +1 -1
  141. package/lib/commands/sql/status.js +1 -1
  142. package/lib/commands/sql/validate.js +1 -1
  143. package/lib/commands/workspace/index.js +1 -1
  144. package/lib/config/schema.js +1 -1
  145. package/lib/constant/cdn.js +1 -1
  146. package/lib/constant/cli.js +1 -1
  147. package/lib/constant/defaults.js +1 -1
  148. package/lib/constant/domain.js +1 -1
  149. package/lib/constant/env.js +1 -1
  150. package/lib/constant/output.js +1 -1
  151. package/lib/constant/paths.js +1 -1
  152. package/lib/constant/risk.js +1 -1
  153. package/lib/context/app-resolver.js +1 -1
  154. package/lib/context/auth-resolver.js +1 -1
  155. package/lib/context/config-loader.js +1 -1
  156. package/lib/context.js +1 -1
  157. package/lib/core/alias-resolver.js +1 -1
  158. package/lib/core/api-client.js +1 -1
  159. package/lib/core/bff/config.js +1 -1
  160. package/lib/core/bff/file-system.js +1 -1
  161. package/lib/core/bff/hash.js +1 -1
  162. package/lib/core/bff/lock.js +1 -1
  163. package/lib/core/bff/utils.js +1 -1
  164. package/lib/core/db-resolver.js +1 -1
  165. package/lib/core/page/file-system.js +1 -1
  166. package/lib/core/page/hash.js +1 -1
  167. package/lib/core/page/lock.js +1 -1
  168. package/lib/core/sql-sync/config.js +1 -1
  169. package/lib/core/sql-sync/file-system.js +1 -1
  170. package/lib/core/sql-sync/hash.js +1 -1
  171. package/lib/core/sql-sync/lock.js +1 -1
  172. package/lib/core/sql-sync/utils.js +1 -1
  173. package/lib/core/sql-validator.js +1 -1
  174. package/lib/errors.js +1 -1
  175. package/lib/framework/build-all-flags.js +1 -1
  176. package/lib/framework/flags.js +1 -1
  177. package/lib/framework/help.js +1 -1
  178. package/lib/framework/index.js +1 -1
  179. package/lib/framework/output.js +1 -1
  180. package/lib/framework/response.js +1 -1
  181. package/lib/framework/runner-alias.js +1 -1
  182. package/lib/framework/runner.js +1 -1
  183. package/lib/framework/schema-export.js +1 -1
  184. package/lib/framework/types.js +1 -1
  185. package/lib/generated/build-info.js +1 -1
  186. package/lib/help.js +1 -1
  187. package/lib/skills/main.js +1 -1
  188. package/lib/skills/npx-skills-add.js +1 -1
  189. package/lib/telemetry/cli-command-trace.js +1 -1
  190. package/lib/telemetry/cli-help-trace.js +1 -1
  191. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  192. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  193. package/lib/telemetry/send-cli-trace-log.js +1 -1
  194. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  195. package/lib/utils/ai_config.js +1 -1
  196. package/lib/utils/apply-jq-filter.js +1 -1
  197. package/lib/utils/cdn-config.js +1 -1
  198. package/lib/utils/check-sdk-version.js +1 -1
  199. package/lib/utils/cli-version-check.js +1 -1
  200. package/lib/utils/cli-version-policy.js +1 -1
  201. package/lib/utils/config.js +1 -1
  202. package/lib/utils/copy-directory.js +1 -1
  203. package/lib/utils/entity-with-id.js +1 -1
  204. package/lib/utils/file-utils.js +1 -1
  205. package/lib/utils/guides-cdn.js +1 -1
  206. package/lib/utils/http-client.js +1 -1
  207. package/lib/utils/is-non-interactive.js +1 -1
  208. package/lib/utils/logger.js +1 -1
  209. package/lib/utils/params.js +1 -1
  210. package/lib/utils/platform.js +1 -1
  211. package/lib/utils/rules-cdn.js +1 -1
  212. package/lib/utils/sleep.js +1 -1
  213. package/lib/utils/template-replacer.js +1 -1
  214. package/lib/utils/update-notice.js +1 -1
  215. package/lib/utils/version.js +1 -1
  216. package/lib/utils/with-active-cookie.js +1 -1
  217. package/lib/utils/write-cli-side-channel.js +1 -1
  218. package/package.json +1 -1
  219. package/templates/README.md +15 -25
  220. package/templates/generate-api/api.ts.tpl +2 -2
  221. package/templates/generate-api/client.ts.tpl +2 -2
  222. package/templates/projects/sub-app-react-demo/CHANGELOG.md +15 -1
  223. package/templates/projects/sub-app-react-demo/README.md +159 -231
  224. package/templates/projects/sub-app-react-demo/docs/quick-start.md +145 -426
  225. package/templates/projects/sub-app-react-demo/src/api/api.ts +8 -65
  226. package/templates/projects/sub-app-react-demo/src/api/client.ts +10 -42
  227. package/templates/projects/sub-app-react-demo/src/components/demo-page-container/DemoPageContainer.module.css +28 -0
  228. package/templates/projects/sub-app-react-demo/src/components/demo-page-container/DemoPageContainer.tsx +55 -0
  229. package/templates/projects/sub-app-react-demo/src/layouts/MainLayout.tsx +6 -9
  230. package/templates/projects/sub-app-react-demo/src/main.tsx +10 -6
  231. package/templates/projects/sub-app-react-demo/src/pages/dashboard/index.tsx +3 -5
  232. package/templates/projects/sub-app-react-demo/src/pages/data-screen/index.tsx +153 -148
  233. package/templates/projects/sub-app-react-demo/src/pages/index.module.css +500 -0
  234. package/templates/projects/sub-app-react-demo/src/pages/index.tsx +517 -343
  235. package/templates/projects/sub-app-react-demo/src/pages/sdk-demo/index.tsx +325 -242
  236. package/templates/projects/sub-app-react-demo/src/pages/workbench/index.module.css +8 -6
  237. package/templates/projects/sub-app-react-demo/src/pages/workbench/index.tsx +174 -87
  238. package/templates/projects/sub-app-react-demo/src/style.css +19 -3
  239. package/templates/projects/sub-app-react-demo/src/vite-env.d.ts +1 -1
  240. package/templates/projects/sub-app-react-demo/docs/API_RULE_CHANGE.md +0 -212
@@ -1,6 +1,6 @@
1
1
  /**
2
- * Generated by Lovrabet CLI
3
- * Created: 2026-01-16T10:07:17.932Z
2
+ * Generated by Rabetbase CLI
3
+ * Created: TEMPLATE
4
4
  *
5
5
  * 这个文件包含了项目的模型配置,并自动注册到 SDK 中
6
6
  * CLI 工具会自动维护这个文件,通常不需要手动修改
@@ -8,76 +8,19 @@
8
8
 
9
9
  import { registerModels, CONFIG_NAMES, type ModelsConfig } from "@lovrabet/sdk";
10
10
 
11
- export const RABETBASE_APP_CODE = "app-c4c89304";
11
+ export const LOVRABET_APP_CODE = "NOT-SET";
12
12
 
13
13
  /**
14
14
  * 项目的模型配置
15
- * 使用数组格式,每个模型包含 datasetCode、tableName、name 和可选的 alias
16
- *
17
- * 访问方式:
18
- * - 标准访问:client.models.dataset_[datasetCode]
19
- * - 别名访问:client.models.[alias](如果配置了 alias)
15
+ * 运行 `rabetbase api pull` 后,CLI 会按当前 AppCode 重新生成这里的模型列表。
20
16
  */
21
- export const RABETBASE_MODELS_CONFIG: ModelsConfig = {
22
- appCode: RABETBASE_APP_CODE,
23
- models: [
24
- {
25
- datasetCode: "3ff202af07164d0a9c5df7ddd8f83c23",
26
- tableName: "dataset_f83c23",
27
- name: "客户访谈记录",
28
- alias: "datasetF83c23",
29
- },
30
- {
31
- datasetCode: "a60f11c17c5344e7a26d5144212cf366",
32
- tableName: "iterations",
33
- name: "迭代信息",
34
- alias: "iterations",
35
- },
36
- {
37
- datasetCode: "d26ed512e878461ca97d287a47606fd3",
38
- tableName: "requirements",
39
- name: "需求",
40
- alias: "requirements",
41
- },
42
- {
43
- datasetCode: "f17f1ee941c1468e87e6a0ca655ce00e",
44
- tableName: "requirement_types",
45
- name: "需求类型",
46
- alias: "requirementTypes",
47
- },
48
- {
49
- datasetCode: "c6e55d6720b84ffcb21698b0a04ccd23",
50
- tableName: "projects",
51
- name: "项目",
52
- alias: "projects",
53
- },
54
- {
55
- datasetCode: "71494bcba13f4ec7858abe90794183ad",
56
- tableName: "project_members",
57
- name: "项目成员",
58
- alias: "projectMembers",
59
- },
60
- ],
17
+ export const LOVRABET_MODELS_CONFIG: ModelsConfig = {
18
+ appCode: LOVRABET_APP_CODE,
19
+ models: [],
61
20
  } as const;
62
21
 
63
22
  /**
64
23
  * 自动注册配置
65
24
  * 配置名称: CONFIG_NAMES.DEFAULT
66
25
  */
67
- registerModels(RABETBASE_MODELS_CONFIG, CONFIG_NAMES.DEFAULT);
68
-
69
- /**
70
- * 如果需要支持多项目或多环境,可以注册额外的配置:
71
- *
72
- * // 开发环境配置
73
- * registerModels({
74
- * appCode: 'app-dev-123',
75
- * models: [...]
76
- * }, 'dev');
77
- *
78
- * // 其他项目配置
79
- * registerModels({
80
- * appCode: 'other-project',
81
- * models: [...]
82
- * }, 'project-b');
83
- */
26
+ registerModels(LOVRABET_MODELS_CONFIG, CONFIG_NAMES.DEFAULT);
@@ -1,18 +1,17 @@
1
1
  /**
2
2
  * Lovrabet SDK 客户端实例
3
- * Generated by Lovrabet CLI
4
- * Created: 2026-01-16T10:07:17.967Z
3
+ * Generated by Rabetbase CLI
4
+ * Created: TEMPLATE
5
5
  *
6
6
  * 这个文件负责创建和导出统一的客户端实例,供整个应用使用
7
7
  * 通过导入 './api' 文件来自动执行配置注册
8
8
  */
9
9
 
10
- import { createClient, CONFIG_NAMES } from "@lovrabet/sdk";
10
+ import { createClient } from "@lovrabet/sdk";
11
11
  import "./api"; // 导入配置文件,执行 registerModels() 注册
12
12
 
13
13
  /**
14
14
  * 主要的客户端实例
15
- * 使用配置名称 'CONFIG_NAMES.DEFAULT' 创建客户端
16
15
  */
17
16
  export const lovrabetClient = createClient();
18
17
 
@@ -22,43 +21,12 @@ export const lovrabetClient = createClient();
22
21
  * // 在组件中使用
23
22
  * import { lovrabetClient } from '@/api/client';
24
23
  *
25
- * // 获取数据列表
26
- * const data = await lovrabetClient.models.datasetF83c23.getList({
27
- * currentPage: 1,
28
- * pageSize: 20
29
- * });
24
+ * // 查看当前可用模型
25
+ * const models = lovrabetClient.getModelList();
30
26
  *
31
- * // 获取单条记录
32
- * const record = await lovrabetClient.models.datasetF83c23.getOne('123');
33
- *
34
- * // 创建新记录
35
- * const newRecord = await lovrabetClient.models.datasetF83c23.create({
36
- * // 记录数据
37
- * });
38
- */
39
-
40
- /**
41
- * 其他创建客户端的方式(根据需要选择):
42
- *
43
- * 1. 使用默认配置(无参数调用):
44
- * export const lovrabetClient = createClient();
45
- *
46
- * 2. 使用其他已注册的配置:
47
- * export const devClient = createClient('dev');
48
- * export const prodClient = createClient('prod');
49
- *
50
- * 3. 直接传入配置对象:
51
- * import { RABETBASE_MODELS_CONFIG } from './api';
52
- * export const lovrabetClient = createClient(RABETBASE_MODELS_CONFIG);
53
- *
54
- * 4. 通过 ClientConfig 指定配置名和其他选项:
55
- * export const lovrabetClient = createClient({
56
- * apiConfigName: 'default',
57
- * token: 'custom-token',
58
- * env: 'daily'
59
- * });
60
- *
61
- * 5. 多项目支持示例:
62
- * export const projectAClient = createClient('project-a');
63
- * export const projectBClient = createClient('project-b');
27
+ * // 运行 `rabetbase api pull` 后,按生成的模型别名调用:
28
+ * // const data = await lovrabetClient.models.requirements.filter({
29
+ * // currentPage: 1,
30
+ * // pageSize: 20
31
+ * // });
64
32
  */
@@ -0,0 +1,28 @@
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
+ }
@@ -0,0 +1,55 @@
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
+ }
@@ -20,7 +20,6 @@ import {
20
20
  UserOutlined,
21
21
  BarChartOutlined,
22
22
  FileTextOutlined,
23
- AuditOutlined,
24
23
  } from "@ant-design/icons";
25
24
 
26
25
  const { Header, Sider, Content } = Layout;
@@ -32,7 +31,6 @@ const routeConfig = [
32
31
  { path: "/dashboard", title: "数据看板" },
33
32
  { path: "/sdk-demo", title: "SDK 演示" },
34
33
  { path: "/data-screen", title: "数据大屏" },
35
- { path: "/ceo-audit", title: "CEO 审计" },
36
34
  ];
37
35
 
38
36
  const MainLayout: React.FC = () => {
@@ -137,7 +135,7 @@ const MainLayout: React.FC = () => {
137
135
  }
138
136
 
139
137
  return (
140
- <Layout style={{ minHeight: "100vh" }}>
138
+ <Layout style={{ minHeight: "100vh", background: "#fff" }}>
141
139
  {!menuHidden && (
142
140
  <Sider
143
141
  trigger={null}
@@ -195,7 +193,7 @@ const MainLayout: React.FC = () => {
195
193
  />
196
194
  </Sider>
197
195
  )}
198
- <Layout>
196
+ <Layout style={{ background: "#fff" }}>
199
197
  <Header
200
198
  style={{
201
199
  padding: "0 24px",
@@ -293,15 +291,14 @@ const MainLayout: React.FC = () => {
293
291
  </div>
294
292
  </Header>
295
293
  <Content
294
+ className="subapp-shell-content"
296
295
  style={{
297
- margin: "16px",
298
- padding: 24,
299
296
  minHeight: 280,
300
- background: "#fff",
301
- borderRadius: 8,
302
297
  }}
303
298
  >
304
- <Outlet />
299
+ <div className="subapp-shell-stage">
300
+ <Outlet />
301
+ </div>
305
302
  </Content>
306
303
  </Layout>
307
304
  </Layout>
@@ -27,13 +27,16 @@ export function mount({
27
27
  container: HTMLElement;
28
28
  customProps: object;
29
29
  }) {
30
- const root = createRoot(container);
30
+ let root = (container as any)._reactRoot;
31
+ if (!root) {
32
+ root = createRoot(container);
33
+ (container as any)._reactRoot = root;
34
+ }
35
+
31
36
  root.render(
32
- <React.StrictMode>
33
- <ConfigProvider locale={zhCN}>
34
- <App {...customProps} />
35
- </ConfigProvider>
36
- </React.StrictMode>,
37
+ <ConfigProvider locale={zhCN}>
38
+ <App {...customProps} />
39
+ </ConfigProvider>,
37
40
  );
38
41
  return root;
39
42
  }
@@ -44,5 +47,6 @@ export function unmount({ container }: { container: HTMLElement }) {
44
47
  const root = (container as any)._reactRoot;
45
48
  if (root) {
46
49
  root.unmount();
50
+ delete (container as any)._reactRoot;
47
51
  }
48
52
  }
@@ -12,7 +12,7 @@ import {
12
12
  } from "antd";
13
13
  import { ArrowUpOutlined, ArrowDownOutlined } from "@ant-design/icons";
14
14
  import ReactECharts from "echarts-for-react";
15
- import Paragraph from "antd/es/skeleton/Paragraph";
15
+ import DemoPageContainer from "@/components/demo-page-container/DemoPageContainer";
16
16
 
17
17
  const { Title } = Typography;
18
18
 
@@ -256,9 +256,7 @@ const Dashboard: React.FC = () => {
256
256
  ];
257
257
 
258
258
  return (
259
- <div
260
- style={{ padding: "16px", backgroundColor: "#fff", minHeight: "100vh" }}
261
- >
259
+ <DemoPageContainer>
262
260
  {/* 顶部提示信息 */}
263
261
  <Alert
264
262
  message="Dashboard 展示页面"
@@ -565,7 +563,7 @@ const Dashboard: React.FC = () => {
565
563
  </div>
566
564
  </Col>
567
565
  </Row>
568
- </div>
566
+ </DemoPageContainer>
569
567
  );
570
568
  };
571
569