@lovrabet/rabetbase-cli 2.4.3 → 2.4.4

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 (381) hide show
  1. package/lib/api/api-doc.js +1 -1
  2. package/lib/api/fetch-model-list.js +1 -1
  3. package/lib/api/generate-api-file.js +1 -1
  4. package/lib/auth/auth-server-ui.js +1 -1
  5. package/lib/auth/auth-server.js +1 -1
  6. package/lib/auth/constant.js +1 -1
  7. package/lib/auth/get-cookie.js +1 -1
  8. package/lib/auth/get-session-user.js +1 -1
  9. package/lib/auth/is-session-valid.js +1 -1
  10. package/lib/auth/login-success-html.js +1 -1
  11. package/lib/auth/logout.js +1 -1
  12. package/lib/cli-flags.js +1 -1
  13. package/lib/cli.js +1 -1
  14. package/lib/commands/api/generate.js +1 -1
  15. package/lib/commands/api/index.js +1 -1
  16. package/lib/commands/api/list.js +1 -1
  17. package/lib/commands/api/pull.js +1 -1
  18. package/lib/commands/api/shared.js +1 -1
  19. package/lib/commands/app/index.js +1 -1
  20. package/lib/commands/app/list.js +1 -1
  21. package/lib/commands/app/members-list.js +1 -1
  22. package/lib/commands/app/remote-directory.js +1 -1
  23. package/lib/commands/app/shared.js +1 -1
  24. package/lib/commands/app-config/delete.js +1 -1
  25. package/lib/commands/app-config/get.js +1 -1
  26. package/lib/commands/app-config/index.js +1 -1
  27. package/lib/commands/app-config/list.js +1 -1
  28. package/lib/commands/app-config/set.js +1 -1
  29. package/lib/commands/app-config/shared.js +1 -1
  30. package/lib/commands/auth/index.js +1 -1
  31. package/lib/commands/bff/create.js +1 -1
  32. package/lib/commands/bff/delete.js +1 -1
  33. package/lib/commands/bff/detail.js +1 -1
  34. package/lib/commands/bff/index.js +1 -1
  35. package/lib/commands/bff/list.js +1 -1
  36. package/lib/commands/bff/pull.js +1 -1
  37. package/lib/commands/bff/push.js +1 -1
  38. package/lib/commands/bff/status.js +1 -1
  39. package/lib/commands/cli-skill/index.js +1 -1
  40. package/lib/commands/cli-update.js +1 -1
  41. package/lib/commands/codegen/index.js +1 -1
  42. package/lib/commands/codegen/sdk.js +1 -1
  43. package/lib/commands/codegen/sql.js +1 -1
  44. package/lib/commands/common/app-registry.js +1 -1
  45. package/lib/commands/common/app-selector.js +1 -1
  46. package/lib/commands/common/async-task.js +1 -1
  47. package/lib/commands/common/dry-run.js +1 -1
  48. package/lib/commands/common/flags.js +1 -1
  49. package/lib/commands/common/local-file.js +1 -1
  50. package/lib/commands/common/validate.js +1 -1
  51. package/lib/commands/config/get.js +1 -1
  52. package/lib/commands/config/index.js +1 -1
  53. package/lib/commands/config/list.js +1 -1
  54. package/lib/commands/config/set.js +1 -1
  55. package/lib/commands/config/shared.js +1 -1
  56. package/lib/commands/data/filter.js +1 -1
  57. package/lib/commands/data/getOne.js +1 -1
  58. package/lib/commands/data/index.js +1 -1
  59. package/lib/commands/data/shared.js +1 -1
  60. package/lib/commands/dataset/business-group-update.js +1 -1
  61. package/lib/commands/dataset/capability.js +1 -1
  62. package/lib/commands/dataset/delete.js +1 -1
  63. package/lib/commands/dataset/detail.js +1 -1
  64. package/lib/commands/dataset/extend-update.js +1 -1
  65. package/lib/commands/dataset/field-update.js +1 -1
  66. package/lib/commands/dataset/generate.js +1 -1
  67. package/lib/commands/dataset/index.js +1 -1
  68. package/lib/commands/dataset/list.js +1 -1
  69. package/lib/commands/dataset/operations.js +1 -1
  70. package/lib/commands/dataset/relation-audit.js +1 -1
  71. package/lib/commands/dataset/relation-create.js +1 -1
  72. package/lib/commands/dataset/relation-delete.js +1 -1
  73. package/lib/commands/dataset/relation-shared.js +1 -1
  74. package/lib/commands/dataset/relation-update.js +1 -1
  75. package/lib/commands/dataset/relations.js +1 -1
  76. package/lib/commands/dataset/rename.js +1 -1
  77. package/lib/commands/dataset/restore.js +1 -1
  78. package/lib/commands/db/analysis-batching.js +1 -1
  79. package/lib/commands/db/analyze-batch-plan.js +1 -1
  80. package/lib/commands/db/analyze-cancel.js +1 -1
  81. package/lib/commands/db/analyze-start.js +1 -1
  82. package/lib/commands/db/analyze-status.js +1 -1
  83. package/lib/commands/db/create.js +1 -1
  84. package/lib/commands/db/delete.js +1 -1
  85. package/lib/commands/db/detail.js +1 -1
  86. package/lib/commands/db/diff-refresh-start.d.ts +2 -0
  87. package/lib/commands/db/diff-refresh-start.js +1 -0
  88. package/lib/commands/db/diff-refresh-status.d.ts +2 -0
  89. package/lib/commands/db/diff-refresh-status.js +1 -0
  90. package/lib/commands/db/diff.js +1 -1
  91. package/lib/commands/db/index.js +1 -1
  92. package/lib/commands/db/list.js +1 -1
  93. package/lib/commands/db/shared.js +1 -1
  94. package/lib/commands/db/tables.js +1 -1
  95. package/lib/commands/db/test.js +1 -1
  96. package/lib/commands/db/update.js +1 -1
  97. package/lib/commands/doctor.js +1 -1
  98. package/lib/commands/file/index.js +1 -1
  99. package/lib/commands/init/index.js +1 -1
  100. package/lib/commands/issue/index.js +1 -1
  101. package/lib/commands/issue/nudge.js +1 -1
  102. package/lib/commands/issue/report.js +1 -1
  103. package/lib/commands/issue/shared.js +1 -1
  104. package/lib/commands/kb/create.js +1 -1
  105. package/lib/commands/kb/delete.js +1 -1
  106. package/lib/commands/kb/detail.js +1 -1
  107. package/lib/commands/kb/index.js +1 -1
  108. package/lib/commands/kb/list.js +1 -1
  109. package/lib/commands/kb/shared.js +1 -1
  110. package/lib/commands/kb/update.js +1 -1
  111. package/lib/commands/logs/index.js +1 -1
  112. package/lib/commands/menu/asset-update.js +1 -1
  113. package/lib/commands/menu/delete.js +1 -1
  114. package/lib/commands/menu/external-link-create.js +1 -1
  115. package/lib/commands/menu/external-link-update.js +1 -1
  116. package/lib/commands/menu/group-create.js +1 -1
  117. package/lib/commands/menu/group-update.js +1 -1
  118. package/lib/commands/menu/index.js +1 -1
  119. package/lib/commands/menu/list.js +1 -1
  120. package/lib/commands/menu/move.js +1 -1
  121. package/lib/commands/menu/regroup-start.js +1 -1
  122. package/lib/commands/menu/rename.js +1 -1
  123. package/lib/commands/menu/shared/compare-table.js +1 -1
  124. package/lib/commands/menu/shared/delete-plan.js +1 -1
  125. package/lib/commands/menu/shared/facts.js +1 -1
  126. package/lib/commands/menu/shared/index.js +1 -1
  127. package/lib/commands/menu/shared/inquirer.js +1 -1
  128. package/lib/commands/menu/shared/local-pages.js +1 -1
  129. package/lib/commands/menu/shared/logic.js +1 -1
  130. package/lib/commands/menu/shared/mutations.js +1 -1
  131. package/lib/commands/menu/shared/service.js +1 -1
  132. package/lib/commands/menu/shared/sync-core.js +1 -1
  133. package/lib/commands/menu/shared/update-core.js +1 -1
  134. package/lib/commands/menu/shared/valid-url.js +1 -1
  135. package/lib/commands/menu/sync.js +1 -1
  136. package/lib/commands/notification/config-create.d.ts +2 -0
  137. package/lib/commands/notification/config-create.js +1 -0
  138. package/lib/commands/notification/config-delete.d.ts +2 -0
  139. package/lib/commands/notification/config-delete.js +1 -0
  140. package/lib/commands/notification/config-list.js +1 -1
  141. package/lib/commands/notification/config-update.d.ts +2 -0
  142. package/lib/commands/notification/config-update.js +1 -0
  143. package/lib/commands/notification/index.js +1 -1
  144. package/lib/commands/notification/shared.d.ts +97 -0
  145. package/lib/commands/notification/shared.js +1 -0
  146. package/lib/commands/ocr/index.js +1 -1
  147. package/lib/commands/page/generate-start.js +1 -1
  148. package/lib/commands/page/generate-status.js +1 -1
  149. package/lib/commands/page/index.js +1 -1
  150. package/lib/commands/page/pull.js +1 -1
  151. package/lib/commands/page/push.js +1 -1
  152. package/lib/commands/page/react/create.js +1 -1
  153. package/lib/commands/page/react/detail.js +1 -1
  154. package/lib/commands/page/react/list.js +1 -1
  155. package/lib/commands/page/react/publish.js +1 -1
  156. package/lib/commands/page/react/shared.js +1 -1
  157. package/lib/commands/page/react/syntax.js +1 -1
  158. package/lib/commands/page/react/template.js +1 -1
  159. package/lib/commands/page/react/update.js +1 -1
  160. package/lib/commands/page/relation-audit.js +1 -1
  161. package/lib/commands/page/restore.js +1 -1
  162. package/lib/commands/page/shared.js +1 -1
  163. package/lib/commands/page/standard-page-status.js +1 -1
  164. package/lib/commands/page/sync.js +1 -1
  165. package/lib/commands/permit/index.js +1 -1
  166. package/lib/commands/permit/page-get.js +1 -1
  167. package/lib/commands/permit/page-set.js +1 -1
  168. package/lib/commands/permit/role-apis-set.js +1 -1
  169. package/lib/commands/permit/role-menus-set.js +1 -1
  170. package/lib/commands/permit/role-menus.js +1 -1
  171. package/lib/commands/permit/shared.js +1 -1
  172. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  173. package/lib/commands/project/create/format-elapsed.js +1 -1
  174. package/lib/commands/project/create/main.d.ts +1 -0
  175. package/lib/commands/project/create/main.js +1 -1
  176. package/lib/commands/project/create/materialize-project-template.d.ts +11 -0
  177. package/lib/commands/project/create/materialize-project-template.js +1 -0
  178. package/lib/commands/project/create/project-name.d.ts +2 -0
  179. package/lib/commands/project/create/project-name.js +1 -0
  180. package/lib/commands/project/create/project-template-archive.d.ts +6 -0
  181. package/lib/commands/project/create/project-template-archive.js +1 -0
  182. package/lib/commands/project/create/project-template-path.d.ts +1 -3
  183. package/lib/commands/project/create/project-template-path.js +1 -1
  184. package/lib/commands/project/create/use-copy-project-template.d.ts +2 -1
  185. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  186. package/lib/commands/project/create/use-format-code.js +1 -1
  187. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  188. package/lib/commands/project/index.js +1 -1
  189. package/lib/commands/project/upgrade.js +1 -1
  190. package/lib/commands/registry.js +1 -1
  191. package/lib/commands/role/create.js +1 -1
  192. package/lib/commands/role/delete.js +1 -1
  193. package/lib/commands/role/detail.js +1 -1
  194. package/lib/commands/role/index.js +1 -1
  195. package/lib/commands/role/list.js +1 -1
  196. package/lib/commands/role/shared.js +1 -1
  197. package/lib/commands/role/update.js +1 -1
  198. package/lib/commands/role/user-add.js +1 -1
  199. package/lib/commands/role/user-remove.js +1 -1
  200. package/lib/commands/role/user-resolve.js +1 -1
  201. package/lib/commands/run/index.js +1 -1
  202. package/lib/commands/schema.js +1 -1
  203. package/lib/commands/sql/create.js +1 -1
  204. package/lib/commands/sql/delete.js +1 -1
  205. package/lib/commands/sql/detail.js +1 -1
  206. package/lib/commands/sql/exec.js +1 -1
  207. package/lib/commands/sql/index.js +1 -1
  208. package/lib/commands/sql/list.js +1 -1
  209. package/lib/commands/sql/pull.js +1 -1
  210. package/lib/commands/sql/push.js +1 -1
  211. package/lib/commands/sql/shared.js +1 -1
  212. package/lib/commands/sql/status.js +1 -1
  213. package/lib/commands/sql/validate.js +1 -1
  214. package/lib/commands/task/index.js +1 -1
  215. package/lib/commands/task/status.js +1 -1
  216. package/lib/commands/tenant/index.js +1 -1
  217. package/lib/commands/tenant/members-list.js +1 -1
  218. package/lib/commands/tenant/shared.js +1 -1
  219. package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
  220. package/lib/commands/user-account/index.js +1 -1
  221. package/lib/commands/workspace/add.js +1 -1
  222. package/lib/commands/workspace/index.js +1 -1
  223. package/lib/commands/workspace/remove.js +1 -1
  224. package/lib/config/schema.js +1 -1
  225. package/lib/constant/cdn.d.ts +2 -0
  226. package/lib/constant/cdn.js +1 -1
  227. package/lib/constant/cli.js +1 -1
  228. package/lib/constant/defaults.js +1 -1
  229. package/lib/constant/domain.js +1 -1
  230. package/lib/constant/env.js +1 -1
  231. package/lib/constant/output.js +1 -1
  232. package/lib/constant/paths.js +1 -1
  233. package/lib/constant/risk.js +1 -1
  234. package/lib/context/app-resolver.js +1 -1
  235. package/lib/context/auth-resolver.js +1 -1
  236. package/lib/context/config-loader.js +1 -1
  237. package/lib/context.d.ts +1 -1
  238. package/lib/context.js +1 -1
  239. package/lib/core/alias-resolver.js +1 -1
  240. package/lib/core/api-client.d.ts +29 -2
  241. package/lib/core/api-client.js +1 -1
  242. package/lib/core/bff/config.js +1 -1
  243. package/lib/core/bff/file-system.js +1 -1
  244. package/lib/core/bff/hash.js +1 -1
  245. package/lib/core/bff/lock.js +1 -1
  246. package/lib/core/bff/utils.js +1 -1
  247. package/lib/core/db-resolver.js +1 -1
  248. package/lib/core/page/file-system.js +1 -1
  249. package/lib/core/page/hash.js +1 -1
  250. package/lib/core/page/lock.js +1 -1
  251. package/lib/core/sql-index-auditor.js +1 -1
  252. package/lib/core/sql-sync/config.js +1 -1
  253. package/lib/core/sql-sync/file-system.js +1 -1
  254. package/lib/core/sql-sync/hash.js +1 -1
  255. package/lib/core/sql-sync/lock.js +1 -1
  256. package/lib/core/sql-sync/utils.js +1 -1
  257. package/lib/core/sql-validator.js +1 -1
  258. package/lib/errors.js +1 -1
  259. package/lib/framework/build-all-flags.js +1 -1
  260. package/lib/framework/error-output.js +1 -1
  261. package/lib/framework/explicit-yes.js +1 -1
  262. package/lib/framework/flags.js +1 -1
  263. package/lib/framework/help.js +1 -1
  264. package/lib/framework/index.js +1 -1
  265. package/lib/framework/output.js +1 -1
  266. package/lib/framework/response.js +1 -1
  267. package/lib/framework/runner-alias.js +1 -1
  268. package/lib/framework/runner.js +1 -1
  269. package/lib/framework/schema-export.js +1 -1
  270. package/lib/framework/types.js +1 -1
  271. package/lib/generated/build-info.d.ts +4 -4
  272. package/lib/generated/build-info.js +1 -1
  273. package/lib/help.js +1 -1
  274. package/lib/postinstall.js +1 -1
  275. package/lib/runtime/confirmation.js +1 -1
  276. package/lib/runtime/event.js +1 -1
  277. package/lib/runtime/index.js +1 -1
  278. package/lib/runtime/queue.js +1 -1
  279. package/lib/runtime/resolve.js +1 -1
  280. package/lib/skills/builtin-skill.js +1 -1
  281. package/lib/skills/main.js +1 -1
  282. package/lib/skills/npx-skills-add.js +1 -1
  283. package/lib/skills/skill-presence.js +1 -1
  284. package/lib/telemetry/cli-command-trace.js +1 -1
  285. package/lib/telemetry/cli-help-trace.js +1 -1
  286. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  287. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  288. package/lib/telemetry/send-cli-trace-log.js +1 -1
  289. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  290. package/lib/utils/ai_config.js +1 -1
  291. package/lib/utils/apply-jq-filter.js +1 -1
  292. package/lib/utils/cdn-config.js +1 -1
  293. package/lib/utils/check-sdk-version.js +1 -1
  294. package/lib/utils/cli-version-check.js +1 -1
  295. package/lib/utils/cli-version-policy.d.ts +13 -0
  296. package/lib/utils/cli-version-policy.js +1 -1
  297. package/lib/utils/config.js +1 -1
  298. package/lib/utils/entity-with-id.js +1 -1
  299. package/lib/utils/file-utils.js +1 -1
  300. package/lib/utils/guides-cdn.js +1 -1
  301. package/lib/utils/http-client.js +1 -1
  302. package/lib/utils/is-non-interactive.js +1 -1
  303. package/lib/utils/logger.js +1 -1
  304. package/lib/utils/params.js +1 -1
  305. package/lib/utils/platform.js +1 -1
  306. package/lib/utils/rules-cdn.js +1 -1
  307. package/lib/utils/sleep.js +1 -1
  308. package/lib/utils/template-replacer.js +1 -1
  309. package/lib/utils/update-notice.js +1 -1
  310. package/lib/utils/version.js +1 -1
  311. package/lib/utils/with-active-cookie.js +1 -1
  312. package/lib/utils/write-cli-side-channel.js +1 -1
  313. package/package.json +9 -4
  314. package/skills/rabetbase/SKILL.md +33 -22
  315. package/skills/rabetbase/guides/backend-function.md +5 -3
  316. package/skills/rabetbase/guides/bff-creation-workflow.md +2 -2
  317. package/skills/rabetbase/guides/conflict-detection.md +2 -2
  318. package/skills/rabetbase/guides/database-connection-workflow.md +39 -5
  319. package/skills/rabetbase/guides/react-custom-page-workflow.md +16 -4
  320. package/skills/rabetbase/guides/sql-creation-workflow.md +4 -2
  321. package/skills/rabetbase/guides/sql-mybatis.md +2 -2
  322. package/skills/rabetbase/knowledge/page-schema/YtPage.md +3 -37
  323. package/skills/rabetbase/knowledge/react-page/generation-standards.md +14 -3
  324. package/skills/rabetbase/references/rabetbase-app-config.md +2 -2
  325. package/skills/rabetbase/references/rabetbase-bff-push.md +4 -5
  326. package/skills/rabetbase/references/rabetbase-bff-save.md +3 -3
  327. package/skills/rabetbase/references/rabetbase-config.md +2 -2
  328. package/skills/rabetbase/references/rabetbase-db-analyze.md +2 -2
  329. package/skills/rabetbase/references/rabetbase-db-detail.md +3 -0
  330. package/skills/rabetbase/references/rabetbase-db-diff-refresh.md +53 -0
  331. package/skills/rabetbase/references/rabetbase-db-diff.md +40 -21
  332. package/skills/rabetbase/references/rabetbase-db-list.md +1 -1
  333. package/skills/rabetbase/references/rabetbase-kb.md +5 -3
  334. package/skills/rabetbase/references/rabetbase-menu-asset-update.md +9 -10
  335. package/skills/rabetbase/references/rabetbase-menu-external-link-update.md +1 -3
  336. package/skills/rabetbase/references/rabetbase-menu-regroup-start.md +2 -3
  337. package/skills/rabetbase/references/rabetbase-notification-config-list.md +2 -2
  338. package/skills/rabetbase/references/rabetbase-notification-config-mutations.md +56 -0
  339. package/skills/rabetbase/references/rabetbase-page-react-detail.md +1 -1
  340. package/skills/rabetbase/references/rabetbase-page-react-list.md +1 -1
  341. package/skills/rabetbase/references/rabetbase-page-react-publish.md +2 -2
  342. package/skills/rabetbase/references/rabetbase-project-create.md +3 -0
  343. package/skills/rabetbase/references/rabetbase-run.md +1 -1
  344. package/skills/rabetbase/references/rabetbase-sql-create.md +1 -1
  345. package/skills/rabetbase/references/rabetbase-sql-push.md +3 -4
  346. package/skills/rabetbase/references/rabetbase-user-account.md +0 -1
  347. package/skills/rabetbase.manifest.json +5 -5
  348. package/templates/README.md +14 -2
  349. package/lib/commands/project/create/non-interactive.d.ts +0 -9
  350. package/lib/commands/project/create/non-interactive.js +0 -1
  351. package/lib/utils/copy-directory.d.ts +0 -1
  352. package/lib/utils/copy-directory.js +0 -1
  353. package/skills/rabetbase/knowledge/page-schema/LrSmartEcharts.md +0 -291
  354. package/skills/rabetbase/knowledge/page-schema/LrSmartStatistic.md +0 -223
  355. package/templates/projects/sub-app-react-demo/.prettierrc +0 -1
  356. package/templates/projects/sub-app-react-demo/CHANGELOG.md +0 -67
  357. package/templates/projects/sub-app-react-demo/README.md +0 -246
  358. package/templates/projects/sub-app-react-demo/docs/quick-start.md +0 -245
  359. package/templates/projects/sub-app-react-demo/index.html +0 -27
  360. package/templates/projects/sub-app-react-demo/package.json +0 -34
  361. package/templates/projects/sub-app-react-demo/public/logo.svg +0 -1
  362. package/templates/projects/sub-app-react-demo/public/vite.svg +0 -1
  363. package/templates/projects/sub-app-react-demo/src/api/api.ts +0 -26
  364. package/templates/projects/sub-app-react-demo/src/api/client.ts +0 -32
  365. package/templates/projects/sub-app-react-demo/src/components/demo-page-container/DemoPageContainer.module.css +0 -28
  366. package/templates/projects/sub-app-react-demo/src/components/demo-page-container/DemoPageContainer.tsx +0 -55
  367. package/templates/projects/sub-app-react-demo/src/layouts/MainLayout.tsx +0 -308
  368. package/templates/projects/sub-app-react-demo/src/main.tsx +0 -52
  369. package/templates/projects/sub-app-react-demo/src/pages/dashboard/index.tsx +0 -570
  370. package/templates/projects/sub-app-react-demo/src/pages/data-screen/index.tsx +0 -531
  371. package/templates/projects/sub-app-react-demo/src/pages/index.module.css +0 -500
  372. package/templates/projects/sub-app-react-demo/src/pages/index.tsx +0 -641
  373. package/templates/projects/sub-app-react-demo/src/pages/sdk-demo/index.tsx +0 -536
  374. package/templates/projects/sub-app-react-demo/src/pages/workbench/index.module.css +0 -295
  375. package/templates/projects/sub-app-react-demo/src/pages/workbench/index.tsx +0 -242
  376. package/templates/projects/sub-app-react-demo/src/router/index.tsx +0 -30
  377. package/templates/projects/sub-app-react-demo/src/style.css +0 -108
  378. package/templates/projects/sub-app-react-demo/src/utils/api.ts +0 -12
  379. package/templates/projects/sub-app-react-demo/src/vite-env.d.ts +0 -2
  380. package/templates/projects/sub-app-react-demo/tsconfig.json +0 -26
  381. package/templates/projects/sub-app-react-demo/vite.config.ts +0 -111
@@ -1,531 +0,0 @@
1
- import React, { useState, useEffect } from "react";
2
- import { Card, Row, Col, Statistic, Typography } from "antd";
3
- import {
4
- ArrowUpOutlined,
5
- ArrowDownOutlined,
6
- UserOutlined,
7
- ShoppingOutlined,
8
- DollarOutlined,
9
- TrophyOutlined,
10
- } from "@ant-design/icons";
11
- import ReactECharts from "echarts-for-react";
12
- import DemoPageContainer from "@/components/demo-page-container/DemoPageContainer";
13
-
14
- const { Title } = Typography;
15
-
16
- // Mock 数据
17
- const mockData = {
18
- // 顶部统计卡片
19
- statistics: [
20
- {
21
- title: "总用户数",
22
- value: 125680,
23
- prefix: <UserOutlined />,
24
- suffix: "人",
25
- trend: { value: 12.5, isUp: true },
26
- color: "#1890ff",
27
- },
28
- {
29
- title: "今日订单",
30
- value: 3521,
31
- prefix: <ShoppingOutlined />,
32
- suffix: "单",
33
- trend: { value: 8.3, isUp: true },
34
- color: "#52c41a",
35
- },
36
- {
37
- title: "总销售额",
38
- value: 8965234,
39
- prefix: <DollarOutlined />,
40
- suffix: "元",
41
- trend: { value: 15.6, isUp: true },
42
- color: "#fa8c16",
43
- },
44
- {
45
- title: "活跃度",
46
- value: 89.5,
47
- prefix: <TrophyOutlined />,
48
- suffix: "%",
49
- trend: { value: 3.2, isUp: false },
50
- color: "#eb2f96",
51
- },
52
- ],
53
-
54
- // 销售趋势数据
55
- salesTrend: {
56
- dates: [
57
- "01月",
58
- "02月",
59
- "03月",
60
- "04月",
61
- "05月",
62
- "06月",
63
- "07月",
64
- "08月",
65
- "09月",
66
- "10月",
67
- "11月",
68
- "12月",
69
- ],
70
- values: [
71
- 3200, 4500, 3800, 5200, 6100, 5800, 7200, 6800, 7900, 8500, 9200, 9800,
72
- ],
73
- },
74
-
75
- // 地区分布数据
76
- regionDistribution: [
77
- { name: "华东", value: 35 },
78
- { name: "华南", value: 28 },
79
- { name: "华北", value: 22 },
80
- { name: "西南", value: 10 },
81
- { name: "西北", value: 5 },
82
- ],
83
-
84
- // 产品分类数据
85
- productCategory: {
86
- categories: ["电子产品", "服装", "食品", "家居", "美妆", "其他"],
87
- values: [3200, 2800, 2400, 1800, 1500, 1200],
88
- },
89
-
90
- // 实时订单数据
91
- realtimeOrders: [
92
- { time: "10:00", count: 45 },
93
- { time: "11:00", count: 52 },
94
- { time: "12:00", count: 68 },
95
- { time: "13:00", count: 55 },
96
- { time: "14:00", count: 72 },
97
- { time: "15:00", count: 61 },
98
- { time: "16:00", count: 78 },
99
- { time: "17:00", count: 85 },
100
- ],
101
- };
102
-
103
- const DataScreen: React.FC = () => {
104
- const [currentTime, setCurrentTime] = useState(new Date());
105
-
106
- // 更新时间
107
- useEffect(() => {
108
- const timer = setInterval(() => {
109
- setCurrentTime(new Date());
110
- }, 1000);
111
- return () => clearInterval(timer);
112
- }, []);
113
-
114
- // 销售趋势折线图配置
115
- const salesTrendOption = {
116
- backgroundColor: "transparent",
117
- title: {
118
- text: "销售趋势",
119
- left: "center",
120
- top: 10,
121
- textStyle: {
122
- color: "#fff",
123
- fontSize: 18,
124
- fontWeight: "bold",
125
- },
126
- },
127
- tooltip: {
128
- trigger: "axis",
129
- backgroundColor: "rgba(0, 0, 0, 0.8)",
130
- borderColor: "#1890ff",
131
- textStyle: { color: "#fff" },
132
- },
133
- grid: {
134
- left: "3%",
135
- right: "4%",
136
- bottom: "3%",
137
- top: "15%",
138
- containLabel: true,
139
- },
140
- xAxis: {
141
- type: "category",
142
- data: mockData.salesTrend.dates,
143
- axisLine: { lineStyle: { color: "#4a90e2" } },
144
- axisLabel: { color: "#fff" },
145
- },
146
- yAxis: {
147
- type: "value",
148
- axisLine: { lineStyle: { color: "#4a90e2" } },
149
- axisLabel: { color: "#fff" },
150
- splitLine: { lineStyle: { color: "rgba(74, 144, 226, 0.2)" } },
151
- },
152
- series: [
153
- {
154
- name: "销售额",
155
- type: "line",
156
- data: mockData.salesTrend.values,
157
- smooth: true,
158
- lineStyle: { color: "#1890ff", width: 3 },
159
- itemStyle: { color: "#1890ff" },
160
- areaStyle: {
161
- color: {
162
- type: "linear",
163
- x: 0,
164
- y: 0,
165
- x2: 0,
166
- y2: 1,
167
- colorStops: [
168
- { offset: 0, color: "rgba(24, 144, 255, 0.5)" },
169
- { offset: 1, color: "rgba(24, 144, 255, 0.1)" },
170
- ],
171
- },
172
- },
173
- },
174
- ],
175
- };
176
-
177
- // 地区分布饼图配置
178
- const regionPieOption = {
179
- backgroundColor: "transparent",
180
- title: {
181
- text: "地区分布",
182
- left: "center",
183
- top: 10,
184
- textStyle: {
185
- color: "#fff",
186
- fontSize: 18,
187
- fontWeight: "bold",
188
- },
189
- },
190
- tooltip: {
191
- trigger: "item",
192
- backgroundColor: "rgba(0, 0, 0, 0.8)",
193
- borderColor: "#1890ff",
194
- textStyle: { color: "#fff" },
195
- formatter: "{a} <br/>{b}: {c}% ({d}%)",
196
- },
197
- legend: {
198
- orient: "vertical",
199
- right: 10,
200
- top: "middle",
201
- textStyle: { color: "#fff" },
202
- },
203
- series: [
204
- {
205
- name: "地区分布",
206
- type: "pie",
207
- radius: ["40%", "70%"],
208
- center: ["40%", "60%"],
209
- avoidLabelOverlap: false,
210
- itemStyle: {
211
- borderRadius: 10,
212
- borderColor: "#0a1929",
213
- borderWidth: 2,
214
- },
215
- label: {
216
- show: true,
217
- color: "#fff",
218
- },
219
- emphasis: {
220
- label: {
221
- show: true,
222
- fontSize: 16,
223
- fontWeight: "bold",
224
- },
225
- },
226
- data: mockData.regionDistribution.map((item, index) => ({
227
- value: item.value,
228
- name: item.name,
229
- itemStyle: {
230
- color: ["#1890ff", "#52c41a", "#fa8c16", "#eb2f96", "#722ed1"][
231
- index
232
- ],
233
- },
234
- })),
235
- },
236
- ],
237
- };
238
-
239
- // 产品分类柱状图配置
240
- const productBarOption = {
241
- backgroundColor: "transparent",
242
- title: {
243
- text: "产品分类销售",
244
- left: "center",
245
- top: 10,
246
- textStyle: {
247
- color: "#fff",
248
- fontSize: 18,
249
- fontWeight: "bold",
250
- },
251
- },
252
- tooltip: {
253
- trigger: "axis",
254
- backgroundColor: "rgba(0, 0, 0, 0.8)",
255
- borderColor: "#1890ff",
256
- textStyle: { color: "#fff" },
257
- },
258
- grid: {
259
- left: "3%",
260
- right: "4%",
261
- bottom: "3%",
262
- top: "15%",
263
- containLabel: true,
264
- },
265
- xAxis: {
266
- type: "category",
267
- data: mockData.productCategory.categories,
268
- axisLine: { lineStyle: { color: "#4a90e2" } },
269
- axisLabel: { color: "#fff", rotate: 45 },
270
- },
271
- yAxis: {
272
- type: "value",
273
- axisLine: { lineStyle: { color: "#4a90e2" } },
274
- axisLabel: { color: "#fff" },
275
- splitLine: { lineStyle: { color: "rgba(74, 144, 226, 0.2)" } },
276
- },
277
- series: [
278
- {
279
- name: "销售额",
280
- type: "bar",
281
- data: mockData.productCategory.values,
282
- itemStyle: {
283
- color: {
284
- type: "linear",
285
- x: 0,
286
- y: 0,
287
- x2: 0,
288
- y2: 1,
289
- colorStops: [
290
- { offset: 0, color: "#52c41a" },
291
- { offset: 1, color: "#1890ff" },
292
- ],
293
- },
294
- borderRadius: [4, 4, 0, 0],
295
- },
296
- },
297
- ],
298
- };
299
-
300
- // 实时订单折线图配置
301
- const realtimeOrderOption = {
302
- backgroundColor: "transparent",
303
- title: {
304
- text: "实时订单趋势",
305
- left: "center",
306
- top: 10,
307
- textStyle: {
308
- color: "#fff",
309
- fontSize: 18,
310
- fontWeight: "bold",
311
- },
312
- },
313
- tooltip: {
314
- trigger: "axis",
315
- backgroundColor: "rgba(0, 0, 0, 0.8)",
316
- borderColor: "#1890ff",
317
- textStyle: { color: "#fff" },
318
- },
319
- grid: {
320
- left: "3%",
321
- right: "4%",
322
- bottom: "3%",
323
- top: "15%",
324
- containLabel: true,
325
- },
326
- xAxis: {
327
- type: "category",
328
- data: mockData.realtimeOrders.map((item) => item.time),
329
- axisLine: { lineStyle: { color: "#4a90e2" } },
330
- axisLabel: { color: "#fff" },
331
- },
332
- yAxis: {
333
- type: "value",
334
- axisLine: { lineStyle: { color: "#4a90e2" } },
335
- axisLabel: { color: "#fff" },
336
- splitLine: { lineStyle: { color: "rgba(74, 144, 226, 0.2)" } },
337
- },
338
- series: [
339
- {
340
- name: "订单数",
341
- type: "line",
342
- data: mockData.realtimeOrders.map((item) => item.count),
343
- smooth: true,
344
- lineStyle: { color: "#fa8c16", width: 3 },
345
- itemStyle: { color: "#fa8c16" },
346
- areaStyle: {
347
- color: {
348
- type: "linear",
349
- x: 0,
350
- y: 0,
351
- x2: 0,
352
- y2: 1,
353
- colorStops: [
354
- { offset: 0, color: "rgba(250, 140, 22, 0.5)" },
355
- { offset: 1, color: "rgba(250, 140, 22, 0.1)" },
356
- ],
357
- },
358
- },
359
- },
360
- ],
361
- };
362
-
363
- return (
364
- <DemoPageContainer variant="bleed">
365
- <div
366
- style={{
367
- minHeight: "calc(100vh - 112px)",
368
- background: "linear-gradient(135deg, #0a1929 0%, #1a2332 100%)",
369
- padding: "24px",
370
- color: "#fff",
371
- borderRadius: 0,
372
- }}
373
- >
374
- {/* 顶部标题栏 */}
375
- <div
376
- style={{
377
- display: "flex",
378
- justifyContent: "space-between",
379
- alignItems: "center",
380
- marginBottom: 24,
381
- }}
382
- >
383
- <Title level={2} style={{ color: "#fff", margin: 0 }}>
384
- 数据大屏
385
- </Title>
386
- <div style={{ fontSize: 16, color: "#4a90e2" }}>
387
- {currentTime.toLocaleString("zh-CN", {
388
- year: "numeric",
389
- month: "2-digit",
390
- day: "2-digit",
391
- hour: "2-digit",
392
- minute: "2-digit",
393
- second: "2-digit",
394
- })}
395
- </div>
396
- </div>
397
-
398
- {/* 统计卡片 */}
399
- <Row gutter={[16, 16]} style={{ marginBottom: 24 }}>
400
- {mockData.statistics.map((stat, index) => (
401
- <Col xs={24} sm={12} lg={6} key={index}>
402
- <Card
403
- style={{
404
- background: "rgba(24, 144, 255, 0.1)",
405
- border: "1px solid rgba(24, 144, 255, 0.3)",
406
- borderRadius: 8,
407
- }}
408
- bodyStyle={{ padding: 20 }}
409
- >
410
- <Statistic
411
- title={
412
- <span style={{ color: "#fff", fontSize: 14 }}>
413
- {stat.title}
414
- </span>
415
- }
416
- value={stat.value}
417
- prefix={
418
- <span style={{ color: stat.color, marginRight: 8 }}>
419
- {stat.prefix}
420
- </span>
421
- }
422
- suffix={
423
- <span style={{ color: "#fff", fontSize: 14 }}>
424
- {stat.suffix}
425
- </span>
426
- }
427
- valueStyle={{
428
- color: "#fff",
429
- fontSize: 24,
430
- fontWeight: "bold",
431
- }}
432
- />
433
- <div style={{ marginTop: 8, fontSize: 12, color: "#4a90e2" }}>
434
- {stat.trend.isUp ? (
435
- <ArrowUpOutlined style={{ color: "#52c41a" }} />
436
- ) : (
437
- <ArrowDownOutlined style={{ color: "#ff4d4f" }} />
438
- )}
439
- <span
440
- style={{
441
- color: stat.trend.isUp ? "#52c41a" : "#ff4d4f",
442
- marginLeft: 4,
443
- }}
444
- >
445
- {stat.trend.value}%
446
- </span>
447
- <span style={{ color: "#8c8c8c", marginLeft: 8 }}>
448
- 较上月
449
- </span>
450
- </div>
451
- </Card>
452
- </Col>
453
- ))}
454
- </Row>
455
-
456
- {/* 图表区域 */}
457
- <Row gutter={[16, 16]}>
458
- {/* 销售趋势 */}
459
- <Col xs={24} lg={16}>
460
- <Card
461
- style={{
462
- background: "rgba(0, 0, 0, 0.3)",
463
- border: "1px solid rgba(24, 144, 255, 0.3)",
464
- borderRadius: 8,
465
- }}
466
- bodyStyle={{ padding: 16 }}
467
- >
468
- <ReactECharts
469
- option={salesTrendOption}
470
- style={{ height: "400px", width: "100%" }}
471
- />
472
- </Card>
473
- </Col>
474
-
475
- {/* 地区分布 */}
476
- <Col xs={24} lg={8}>
477
- <Card
478
- style={{
479
- background: "rgba(0, 0, 0, 0.3)",
480
- border: "1px solid rgba(24, 144, 255, 0.3)",
481
- borderRadius: 8,
482
- }}
483
- bodyStyle={{ padding: 16 }}
484
- >
485
- <ReactECharts
486
- option={regionPieOption}
487
- style={{ height: "400px", width: "100%" }}
488
- />
489
- </Card>
490
- </Col>
491
-
492
- {/* 产品分类 */}
493
- <Col xs={24} lg={12}>
494
- <Card
495
- style={{
496
- background: "rgba(0, 0, 0, 0.3)",
497
- border: "1px solid rgba(24, 144, 255, 0.3)",
498
- borderRadius: 8,
499
- }}
500
- bodyStyle={{ padding: 16 }}
501
- >
502
- <ReactECharts
503
- option={productBarOption}
504
- style={{ height: "350px", width: "100%" }}
505
- />
506
- </Card>
507
- </Col>
508
-
509
- {/* 实时订单 */}
510
- <Col xs={24} lg={12}>
511
- <Card
512
- style={{
513
- background: "rgba(0, 0, 0, 0.3)",
514
- border: "1px solid rgba(24, 144, 255, 0.3)",
515
- borderRadius: 8,
516
- }}
517
- bodyStyle={{ padding: 16 }}
518
- >
519
- <ReactECharts
520
- option={realtimeOrderOption}
521
- style={{ height: "350px", width: "100%" }}
522
- />
523
- </Card>
524
- </Col>
525
- </Row>
526
- </div>
527
- </DemoPageContainer>
528
- );
529
- };
530
-
531
- export default DataScreen;