@oj-module/cli 0.2.64 → 0.2.67
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/bin/.oj-version +1 -0
- package/bin/oj +4 -0
- package/devkit/README.md +18 -4
- package/devkit/SKILL.md +35 -3
- package/devkit/framework-dev.md +22 -11
- package/devkit/manual.md +161 -68
- package/devkit/menu-rules.md +4 -1
- package/devkit/publish-walkthrough.md +110 -37
- package/devkit/wecom-internal-app.md +7 -2
- package/devkit/wecom-multi-corp-links.md +163 -0
- package/package.json +3 -2
- package/shell-dist/assets/ahooks.2l850ymmh0.js +18 -0
- package/shell-dist/assets/antd-es-locale-zh_CN.1gjjsvxbf0.js +1 -0
- package/shell-dist/assets/antd-img-crop.196rkty480.js +99 -0
- package/shell-dist/assets/antd-locale-en_US.561tozx860.js +1 -0
- package/shell-dist/assets/antd-locale-zh_CN.1cmpmgzh70.js +1 -0
- package/shell-dist/assets/antd.uw1coq15l0.js +348 -0
- package/shell-dist/assets/clsx.jotilrt2e0.js +1 -0
- package/shell-dist/assets/contract-errors.2o17vz9u50.js +1 -0
- package/shell-dist/assets/contract.3h327o3mj0.js +57 -0
- package/shell-dist/assets/cssinjs.atgmhan7m0.js +3 -0
- package/shell-dist/assets/dayjs-plugin-advancedFormat.3vsyd2eis0.js +1 -0
- package/shell-dist/assets/dayjs-plugin-customParseFormat.13xhghv1d0.js +1 -0
- package/shell-dist/assets/dayjs-plugin-isoWeek.1fn1tw82p0.js +1 -0
- package/shell-dist/assets/dayjs-plugin-localeData.2rwbjp9nk0.js +1 -0
- package/shell-dist/assets/dayjs-plugin-quarterOfYear.2oqo1lcx80.js +1 -0
- package/shell-dist/assets/dayjs-plugin-relativeTime.2pqs3et4y0.js +1 -0
- package/shell-dist/assets/dayjs-plugin-weekOfYear.gvn9iph080.js +1 -0
- package/shell-dist/assets/dayjs-plugin-weekYear.2u78l3ex10.js +1 -0
- package/shell-dist/assets/dayjs-plugin-weekday.2d56a4tml0.js +1 -0
- package/shell-dist/assets/dayjs.pa60l6wjo0.js +1 -0
- package/shell-dist/assets/dnd-kit-core.1xyreig6r0.js +5 -0
- package/shell-dist/assets/dnd-kit-sortable.s94qciuft0.js +1 -0
- package/shell-dist/assets/dnd-kit-utilities.1umw4xphb0.js +1 -0
- package/shell-dist/assets/i18next.33zqofapj0.js +1 -0
- package/shell-dist/assets/icons-es-components-Context.365qmflwg0.js +1 -0
- package/shell-dist/assets/icons.159wjwals0.js +57 -0
- package/shell-dist/assets/{index-xZhmujjM.js → index.6alqyx6ae0.js} +21 -1
- package/shell-dist/assets/jsx-dev-runtime.3uibuc82f0.js +14 -0
- package/shell-dist/assets/jsx-runtime.h40xu4o5b0.js +14 -0
- package/shell-dist/assets/keepalive-for-react.xenu5vam70.js +1 -0
- package/shell-dist/assets/kit.37kr8ui390.js +1 -0
- package/shell-dist/assets/ky.1cgch7gu60.js +6 -0
- package/shell-dist/assets/motion-react.pjsxytvjs0.js +12 -0
- package/shell-dist/assets/motion.21tciqutg0.js +4 -0
- package/shell-dist/assets/nprogress.2nz76n9ny0.js +7 -0
- package/shell-dist/assets/ojm-dayjs-locale-zh-cn.3vr3beiyp0.js +9 -0
- package/shell-dist/assets/pinyin-pro.3v0mnxczn0.js +1 -0
- package/shell-dist/assets/pro-components.2kyot1vcl0.js +83 -0
- package/shell-dist/assets/react-countup.2x8idnr8y0.js +10 -0
- package/shell-dist/assets/react-dom-client.ick0v05ob0.js +43 -0
- package/shell-dist/assets/react-dom.2so9uxg3f0.js +22 -0
- package/shell-dist/assets/react-error-boundary.2dncdfj3b0.js +1 -0
- package/shell-dist/assets/react-i18next.auhvjhqv00.js +1 -0
- package/shell-dist/assets/react-jss.1ei6dr9e00.js +29 -0
- package/shell-dist/assets/react-query.3rln45ow00.js +1 -0
- package/shell-dist/assets/react-router-dom.3c6zld8h40.js +44 -0
- package/shell-dist/assets/react-router.2h9rebcv50.js +56 -0
- package/shell-dist/assets/react.1ew63mwts0.js +14 -0
- package/shell-dist/assets/runtime.2dgstpjsu0.js +21702 -0
- package/shell-dist/assets/simplebar-react.2g739uvai0.js +1 -0
- package/shell-dist/assets/spin-delay.yjeyj6iwp0.js +9 -0
- package/shell-dist/assets/tailwind-merge.125ehiqjw0.js +1 -0
- package/shell-dist/assets/use-sync-external-store-shim.1nz1pi9bb0.js +22 -0
- package/shell-dist/assets/zustand-middleware.1xaxjueme0.js +6 -0
- package/shell-dist/assets/zustand-react-shallow.pybayv1hx0.js +1 -0
- package/shell-dist/assets/zustand-react.9fsl9brxy0.js +1 -0
- package/shell-dist/assets/zustand-shallow.6cz0yyv9x0.js +1 -0
- package/shell-dist/assets/zustand-vanilla-shallow.3424monv50.js +1 -0
- package/shell-dist/assets/zustand-vanilla.1mo3ka3g30.js +1 -0
- package/shell-dist/assets/zustand.3gjgzlnqo0.js +1 -0
- package/shell-dist/index.html +67 -118
- package/shell-dist/versions.json +3 -3
- package/src/__tests__/publish-keygen.test.ts +157 -0
- package/src/__tests__/templates-migration-schema-parity.test.ts +540 -0
- package/src/__tests__/templates-schema-columns.test.ts +15 -2
- package/src/__tests__/templates-tenant-scope.test.ts +6 -2
- package/src/bundle.ts +8 -3
- package/src/cli.ts +17 -5
- package/src/dev.ts +15 -10
- package/src/esm-exports.ts +152 -70
- package/src/install.ts +11 -4
- package/src/keygen.ts +54 -0
- package/src/lifecycle/__tests__/bundle.test.ts +21 -3
- package/src/lifecycle/__tests__/fixtures/fixture-valid/api/src/demo-solution/manifest.yaml +1 -1
- package/src/lifecycle/__tests__/fixtures/fixture-valid/api/src/demo-solution/migrations/0001__init.sql +2 -2
- package/src/lifecycle/__tests__/fixtures/fixture-valid/api/src/demo-solution/schema.yaml +5 -2
- package/src/lifecycle/__tests__/fixtures/fixture-valid/manifest.yaml +1 -1
- package/src/lifecycle/__tests__/manifest-contract.test.ts +75 -3
- package/src/lifecycle/__tests__/smoke.test.ts +2 -2
- package/src/manifest-contract.ts +91 -8
- package/src/market/bootstrap.ts +26 -2
- package/src/market/command.ts +1 -0
- package/src/market/publish.ts +5 -1
- package/src/market/walkthrough.ts +24 -8
- package/src/shared-deps.ts +69 -19
- package/src/site-base.ts +4 -0
- package/src/site.ts +2 -0
- package/src/usage.ts +8 -4
- package/src/vendor.ts +5 -1
- package/templates/config.yaml +4 -2
- package/templates/init.include.yaml +8 -3
- package/templates/openapi.json +460 -1
- package/templates/src/app/api/_platform/_lifecycle/compensate.ts +136 -0
- package/templates/src/app/api/_platform/_lifecycle/installer.ts +71 -22
- package/templates/src/app/api/_platform/_lifecycle/lock.ts +23 -0
- package/templates/src/app/api/_platform/_lifecycle/steps/deploy-web.ts +28 -0
- package/templates/src/app/api/_platform/_lifecycle/steps/preflight.ts +46 -0
- package/templates/src/app/api/_platform/_lifecycle/steps/reload.ts +100 -36
- package/templates/src/app/api/_platform/_lifecycle/steps/smoke.ts +7 -15
- package/templates/src/app/api/_platform/_lifecycle/text-edit.ts +71 -19
- package/templates/src/app/api/_platform/_lifecycle/types.ts +26 -2
- package/templates/src/app/api/_platform/_lifecycle/uninstall.ts +93 -14
- package/templates/src/app/api/_platform/_shared/service/domain/settings.ts +8 -4
- package/templates/src/app/api/_platform/manifest.yaml +1 -0
- package/templates/src/app/api/_platform/market/api.ts +235 -10
- package/templates/src/app/api/_platform/migrations/0001__baseline.mysql.sql +178 -0
- package/templates/src/app/api/_platform/migrations/0001__baseline.pg.sql +173 -0
- package/templates/src/app/api/_platform/migrations/0001__baseline.sql +188 -0
- package/templates/src/app/api/_platform/migrations/0002__market_release.mysql.sql +17 -0
- package/templates/src/app/api/_platform/migrations/0002__market_release.pg.sql +16 -0
- package/templates/src/app/api/_platform/migrations/0002__market_release.sql +33 -0
- package/templates/src/app/api/_platform/schema.yaml +18 -0
- package/templates/src/app/api/_platform/seed.mysql.sql +10 -0
- package/templates/src/app/api/_platform/seed.pg.sql +10 -0
- package/templates/src/app/api/auth/_shared/wecom/client.ts +24 -4
- package/templates/src/app/api/home/migrations/0001__create_home_tables.mysql.sql +14 -0
- package/templates/src/app/api/home/migrations/0001__create_home_tables.pg.sql +14 -0
- package/templates/src/app/api/home/migrations/0002__tenant.pg.sql +4 -0
- package/templates/src/app/api/home/seed.mysql.sql +71 -0
- package/templates/src/app/api/home/seed.pg.sql +71 -0
- package/templates/src/app/api/notification/_shared/notify.ts +6 -6
- package/templates/src/app/api/notification/migrations/0001__create_notifications.mysql.sql +11 -0
- package/templates/src/app/api/notification/migrations/0001__create_notifications.pg.sql +11 -0
- package/templates/src/app/api/notification/migrations/0002__notifications_user.mysql.sql +8 -0
- package/templates/src/app/api/notification/migrations/0003__notifications_broadcast.mysql.sql +21 -0
- package/templates/src/app/api/notification/migrations/0003__notifications_broadcast.pg.sql +22 -0
- package/templates/src/app/api/notification/migrations/0004__notifications_broadcast_hidden.mysql.sql +10 -0
- package/templates/src/app/api/notification/migrations/0004__notifications_broadcast_hidden.pg.sql +11 -0
- package/templates/src/app/api/notification/migrations/0005__tenant.pg.sql +6 -0
- package/templates/src/app/api/notification/seed.mysql.sql +8 -0
- package/templates/src/app/api/notification/seed.pg.sql +11 -0
- package/templates/src/app/api/publish/_shared/identity.ts +69 -0
- package/templates/src/app/api/publish/api.ts +349 -0
- package/templates/src/app/api/publish/manifest.yaml +8 -0
- package/templates/src/app/api/publish/migrations/0001__publish_credential.mysql.sql +23 -0
- package/templates/src/app/api/publish/migrations/0001__publish_credential.pg.sql +23 -0
- package/templates/src/app/api/publish/migrations/0001__publish_credential.sql +39 -0
- package/templates/src/app/api/publish/schema.yaml +33 -0
- package/templates/src/app/api/system/login-methods/api.ts +2 -1
- package/templates/src/app/web/_platform/__client/api.schemas.ts +15 -0
- package/templates/src/app/web/_platform/__client/index.ts +25 -1
- package/templates/src/app/web/entry.ts +9 -5
- package/templates/src/app/web/home/pages/components/bar-chart.tsx +5 -3
- package/templates/src/app/web/home/pages/components/echarts-setup.ts +30 -0
- package/templates/src/app/web/home/pages/components/line-chart.tsx +5 -3
- package/templates/src/app/web/home/pages/components/pie-chart.tsx +6 -3
- package/templates/src/app/web/home/pages/index.tsx +3 -2
- package/templates/src/app/web/home/routes.ts +8 -2
- package/templates/src/app/web/login/locales/en-US.json +7 -1
- package/templates/src/app/web/login/locales/zh-CN.json +7 -1
- package/templates/src/app/web/login/pages/login.tsx +79 -86
- package/templates/src/app/web/login/routes.ts +54 -1
- package/templates/src/app/web/personal-center/locales/en-US.json +1 -0
- package/templates/src/app/web/personal-center/locales/zh-CN.json +1 -0
- package/templates/src/app/web/personal-center/pages/my-profile/index.tsx +5 -0
- package/templates/src/app/web/system/__client/api.schemas.ts +2 -1
- package/templates/src/app/web/system/locales/en-US.json +1 -8
- package/templates/src/app/web/system/locales/zh-CN.json +1 -8
- package/templates/src/app/web/system/pages/settings/index.tsx +17 -4
- package/templates/src/app/web/system/routes.ts +0 -6
- package/templates/src/oj-market/web/__tests__/CardGrid.test.tsx +33 -0
- package/templates/src/oj-market/web/__tests__/DetailDrawer.test.tsx +69 -0
- package/templates/src/oj-market/web/__tests__/marketClient.fake.ts +7 -1
- package/templates/src/oj-market/web/api/client.ts +3 -0
- package/templates/src/oj-market/web/api/defaultClient.ts +5 -0
- package/templates/src/oj-market/web/components/CardItem.tsx +44 -1
- package/templates/src/oj-market/web/components/DetailDrawer.tsx +17 -1
- package/templates/src/oj-market/web/entry.ts +31 -2
- package/templates/src/oj-market/web/locales/en-US.json +5 -1
- package/templates/src/oj-market/web/locales/zh-CN.json +5 -1
- package/templates/src/oj-market/web/publish/__client/api.schemas.ts +61 -0
- package/templates/src/oj-market/web/publish/__client/index.ts +164 -0
- package/templates/src/oj-market/web/publish/locales/en-US.json +80 -0
- package/templates/src/oj-market/web/publish/locales/zh-CN.json +80 -0
- package/templates/src/oj-market/web/publish/pages/history.tsx +112 -0
- package/templates/src/oj-market/web/publish/pages/index.tsx +196 -0
- package/templates/src/oj-market/web/publish/pages/model.ts +52 -0
- package/templates/src/oj-market/web/publish/pages/token-modal.tsx +82 -0
- package/templates/src/oj-market/web/publish/routes.ts +41 -0
- package/templates/src/oj-market/web/types.ts +30 -0
- package/templates/tests/lifecycle/compensate.spec.ts +207 -0
- package/templates/tests/lifecycle/deploy-smoke.spec.ts +38 -14
- package/templates/tests/lifecycle/installer.spec.ts +28 -9
- package/templates/tests/lifecycle/market-api.spec.ts +164 -12
- package/templates/tests/lifecycle/preflight.spec.ts +68 -0
- package/templates/tests/lifecycle/role-title-translate.spec.ts +2 -32
- package/templates/tests/lifecycle/text-edit.spec.ts +45 -27
- package/templates/tests/lifecycle/uninstall.spec.ts +36 -0
- package/templates/tests/publish-credential.spec.ts +354 -0
- package/templates/tests/publish-identity.spec.ts +44 -0
- package/templates/tests/wecom-client-timeout.spec.ts +33 -3
- package/templates/tests/wecom-landing.spec.ts +63 -1
- package/templates/tsconfig.paths.json +1 -0
- package/templates/web.config.ts +6 -4
- package/vendor/host-versions.json +3 -3
- package/shell-dist/assets/ahooks.js +0 -6909
- package/shell-dist/assets/antd-es-locale-zh_CN.js +0 -257
- package/shell-dist/assets/antd-img-crop.js +0 -1495
- package/shell-dist/assets/antd-locale-en_US.js +0 -374
- package/shell-dist/assets/antd-locale-zh_CN.js +0 -379
- package/shell-dist/assets/antd.js +0 -106874
- package/shell-dist/assets/clsx.js +0 -33
- package/shell-dist/assets/contract-errors.js +0 -30
- package/shell-dist/assets/contract.js +0 -18900
- package/shell-dist/assets/cssinjs.js +0 -2595
- package/shell-dist/assets/dayjs-plugin-advancedFormat.js +0 -98
- package/shell-dist/assets/dayjs-plugin-customParseFormat.js +0 -173
- package/shell-dist/assets/dayjs-plugin-isoWeek.js +0 -77
- package/shell-dist/assets/dayjs-plugin-localeData.js +0 -126
- package/shell-dist/assets/dayjs-plugin-quarterOfYear.js +0 -77
- package/shell-dist/assets/dayjs-plugin-relativeTime.js +0 -92
- package/shell-dist/assets/dayjs-plugin-weekOfYear.js +0 -73
- package/shell-dist/assets/dayjs-plugin-weekYear.js +0 -63
- package/shell-dist/assets/dayjs-plugin-weekday.js +0 -63
- package/shell-dist/assets/dayjs.js +0 -326
- package/shell-dist/assets/dnd-kit-core.js +0 -3601
- package/shell-dist/assets/dnd-kit-sortable.js +0 -717
- package/shell-dist/assets/dnd-kit-utilities.js +0 -340
- package/shell-dist/assets/i18next.js +0 -2321
- package/shell-dist/assets/icons-es-components-Context.js +0 -20
- package/shell-dist/assets/icons.js +0 -34961
- package/shell-dist/assets/jsx-dev-runtime.js +0 -75
- package/shell-dist/assets/jsx-runtime.js +0 -97
- package/shell-dist/assets/keepalive-for-react.js +0 -283
- package/shell-dist/assets/kit.js +0 -151
- package/shell-dist/assets/ky.js +0 -1427
- package/shell-dist/assets/motion-react.js +0 -13589
- package/shell-dist/assets/motion.js +0 -9959
- package/shell-dist/assets/nprogress.js +0 -314
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-BarsOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-CalendarOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-CaretDownFilled.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-CaretDownOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-CaretUpOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-CheckCircleFilled.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-CheckOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-ClockCircleOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-CloseCircleFilled.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-CloseOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-CopyOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-DeleteOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-DoubleLeftOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-DoubleRightOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-DownOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-DownloadOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-EditOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-EllipsisOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-EnterOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-ExclamationCircleFilled.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-EyeInvisibleOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-EyeOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-FileOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-FileTextOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-FilterFilled.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-FolderOpenOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-FolderOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-HolderOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-InfoCircleFilled.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-LeftOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-LoadingOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-MinusOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-MinusSquareOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-PaperClipOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-PictureOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-PlusOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-PlusSquareOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-QuestionCircleOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-ReloadOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-RightOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-RotateLeftOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-RotateRightOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-SearchOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-StarFilled.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-SwapOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-SwapRightOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-UpOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-VerticalAlignTopOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-WarningFilled.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-ZoomInOutlined.js +0 -7
- package/shell-dist/assets/ojm--ant-design-icons-es-icons-ZoomOutOutlined.js +0 -7
- package/shell-dist/assets/ojm-dayjs-locale-zh-cn.js +0 -81
- package/shell-dist/assets/pinyin-pro.js +0 -25175
- package/shell-dist/assets/pro-components.js +0 -44627
- package/shell-dist/assets/react-countup.js +0 -525
- package/shell-dist/assets/react-dom-client.js +0 -12134
- package/shell-dist/assets/react-dom.js +0 -266
- package/shell-dist/assets/react-error-boundary.js +0 -141
- package/shell-dist/assets/react-i18next.js +0 -1773
- package/shell-dist/assets/react-jss.js +0 -4089
- package/shell-dist/assets/react-query.js +0 -3072
- package/shell-dist/assets/react-router-dom.js +0 -9927
- package/shell-dist/assets/react-router.js +0 -14584
- package/shell-dist/assets/react.js +0 -590
- package/shell-dist/assets/runtime.js +0 -28311
- package/shell-dist/assets/simplebar-react.js +0 -1119
- package/shell-dist/assets/spin-delay.js +0 -111
- package/shell-dist/assets/tailwind-merge.js +0 -3364
- package/shell-dist/assets/use-sync-external-store-shim.js +0 -130
- package/shell-dist/assets/zustand-middleware.js +0 -513
- package/shell-dist/assets/zustand-react-shallow.js +0 -27
- package/shell-dist/assets/zustand-react.js +0 -39
- package/shell-dist/assets/zustand-shallow.js +0 -22
- package/shell-dist/assets/zustand-vanilla-shallow.js +0 -71
- package/shell-dist/assets/zustand-vanilla.js +0 -40
- package/shell-dist/assets/zustand.js +0 -32
- package/templates/seed.mysql.sql +0 -6
- package/templates/seed.pg.sql +0 -6
- package/templates/src/app/api/_platform/migrations/0001__create_users.mysql.sql +0 -9
- package/templates/src/app/api/_platform/migrations/0001__create_users.pg.sql +0 -9
- package/templates/src/app/api/_platform/migrations/0001__create_users.sql +0 -7
- package/templates/src/app/api/_platform/migrations/0002__add_users_avatar_base64.mysql.sql +0 -3
- package/templates/src/app/api/_platform/migrations/0002__add_users_avatar_base64.sql +0 -2
- package/templates/src/app/api/_platform/migrations/0003__users_source_display_name.mysql.sql +0 -5
- package/templates/src/app/api/_platform/migrations/0003__users_source_display_name.sql +0 -5
- package/templates/src/app/api/_platform/migrations/0004__sys_rbac.mysql.sql +0 -70
- package/templates/src/app/api/_platform/migrations/0004__sys_rbac.pg.sql +0 -67
- package/templates/src/app/api/_platform/migrations/0004__sys_rbac.sql +0 -67
- package/templates/src/app/api/_platform/migrations/0005__users_must_change.mysql.sql +0 -3
- package/templates/src/app/api/_platform/migrations/0005__users_must_change.sql +0 -2
- package/templates/src/app/api/_platform/migrations/0006__users_is_forbidden.mysql.sql +0 -3
- package/templates/src/app/api/_platform/migrations/0006__users_is_forbidden.sql +0 -3
- package/templates/src/app/api/_platform/migrations/0007__users_email.sql +0 -3
- package/templates/src/app/api/_platform/migrations/0008__sys_refresh_token.mysql.sql +0 -10
- package/templates/src/app/api/_platform/migrations/0008__sys_refresh_token.pg.sql +0 -10
- package/templates/src/app/api/_platform/migrations/0008__sys_refresh_token.sql +0 -11
- package/templates/src/app/api/_platform/migrations/0009__sys_throttle.mysql.sql +0 -12
- package/templates/src/app/api/_platform/migrations/0009__sys_throttle.pg.sql +0 -12
- package/templates/src/app/api/_platform/migrations/0009__sys_throttle.sql +0 -13
- package/templates/src/app/api/_platform/migrations/0010__sys_solution_route.mysql.sql +0 -17
- package/templates/src/app/api/_platform/migrations/0010__sys_solution_route.pg.sql +0 -16
- package/templates/src/app/api/_platform/migrations/0010__sys_solution_route.sql +0 -18
- package/templates/src/app/api/_platform/migrations/0011__sys_setting_group_label.mysql.sql +0 -2
- package/templates/src/app/api/_platform/migrations/0011__sys_setting_group_label.sql +0 -4
- package/templates/src/app/api/_platform/migrations/0012__market_history.mysql.sql +0 -13
- package/templates/src/app/api/_platform/migrations/0012__market_history.pg.sql +0 -12
- package/templates/src/app/api/_platform/migrations/0012__market_history.sql +0 -14
- package/templates/src/app/api/_platform/migrations/0013__users_profile.sql +0 -4
- package/templates/src/app/api/_platform/migrations/0014__reg_source_seq.mysql.sql +0 -9
- package/templates/src/app/api/_platform/migrations/0014__reg_source_seq.pg.sql +0 -7
- package/templates/src/app/api/_platform/migrations/0014__reg_source_seq.sql +0 -8
- package/templates/src/app/api/_platform/migrations/0015__tenant.mysql.sql +0 -12
- package/templates/src/app/api/_platform/migrations/0015__tenant.pg.sql +0 -11
- package/templates/src/app/api/_platform/migrations/0015__tenant.sql +0 -44
- package/templates/src/app/api/_platform/migrations/0016__org.mysql.sql +0 -41
- package/templates/src/app/api/_platform/migrations/0016__org.pg.sql +0 -40
- package/templates/src/app/api/_platform/migrations/0016__org.sql +0 -62
- package/templates/src/app/api/_platform/migrations/0017__users_employee_no.mysql.sql +0 -7
- package/templates/src/app/api/_platform/migrations/0017__users_employee_no.pg.sql +0 -4
- package/templates/src/app/api/_platform/migrations/0017__users_employee_no.sql +0 -8
- package/templates/src/app/api/_platform/migrations/0018__sys_role_title_key.mysql.sql +0 -3
- package/templates/src/app/api/_platform/migrations/0018__sys_role_title_key.pg.sql +0 -3
- package/templates/src/app/api/_platform/migrations/0018__sys_role_title_key.sql +0 -8
- package/templates/src/app/web/system/pages/login-methods/index.tsx +0 -30
- /package/shell-dist/assets/{nprogress-css.js → nprogress-css.1cq2pzkre0.js} +0 -0
- /package/shell-dist/assets/{ojm-antd-es-button.js → ojm-antd-es-button.2uriphio50.js} +0 -0
- /package/shell-dist/assets/{ojm-antd-es-modal.js → ojm-antd-es-modal.bf3tgdh8v0.js} +0 -0
- /package/shell-dist/assets/{ojm-antd-es-slider.js → ojm-antd-es-slider.xyvptuhid0.js} +0 -0
- /package/shell-dist/assets/{ojm-antd-es-upload.js → ojm-antd-es-upload.13gx45e0g0.js} +0 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
name: publish
|
|
2
|
+
desc: 发布凭证与发布身份(业务路由):申请 / 列表 / 撤销 / 一次性兑换。凭证兑换即作废,Ed25519 密钥长期有效;身份只由服务端推导,CLI 不重复实现编码规则。
|
|
3
|
+
version: 0.1.0
|
|
4
|
+
tables:
|
|
5
|
+
# 共享表(B 组):兑换发生在 CLI,无业务租户语义;租户归属走 owner_tenant 列
|
|
6
|
+
- publish_credential
|
|
7
|
+
deps: # 判权(currentAccess)、统一信封(respond)、分页与限速都来自平台内核
|
|
8
|
+
_platform: ^0.1.0
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
-- 0001__publish_credential(mysql 方言):列语义同 0001__publish_credential.sql 头注释。
|
|
2
|
+
-- 差异(沿用 _platform 基线的既有惯例):键列/短文本收窄为 VARCHAR;秒级 epoch 取 BIGINT;
|
|
3
|
+
-- 索引写在 CREATE TABLE 内(mysql 无 CREATE INDEX IF NOT EXISTS)。
|
|
4
|
+
CREATE TABLE IF NOT EXISTS publish_credential (
|
|
5
|
+
id BIGINT AUTO_INCREMENT PRIMARY KEY,
|
|
6
|
+
token_hash VARCHAR(255) NOT NULL,
|
|
7
|
+
token_hint VARCHAR(64) NOT NULL,
|
|
8
|
+
uid BIGINT NOT NULL,
|
|
9
|
+
username VARCHAR(255) NOT NULL,
|
|
10
|
+
display_name TEXT,
|
|
11
|
+
product VARCHAR(255) NOT NULL,
|
|
12
|
+
key_id VARCHAR(255) NOT NULL,
|
|
13
|
+
owner_tenant VARCHAR(255) NOT NULL,
|
|
14
|
+
expires_at BIGINT NOT NULL,
|
|
15
|
+
used BIGINT NOT NULL DEFAULT 0,
|
|
16
|
+
used_at BIGINT,
|
|
17
|
+
revoked BIGINT NOT NULL DEFAULT 0,
|
|
18
|
+
created_at BIGINT NOT NULL,
|
|
19
|
+
created_ip VARCHAR(64),
|
|
20
|
+
UNIQUE KEY uk_publish_credential_token (token_hash),
|
|
21
|
+
KEY idx_publish_credential_owner (owner_tenant, uid, created_at),
|
|
22
|
+
KEY idx_publish_credential_key (key_id)
|
|
23
|
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
-- 0001__publish_credential(postgres 方言):列语义同 0001__publish_credential.sql 头注释。
|
|
2
|
+
-- 差异(沿用 _platform 基线的既有惯例):TEXT 全保留,秒级 epoch 取 BIGINT。
|
|
3
|
+
CREATE TABLE IF NOT EXISTS publish_credential (
|
|
4
|
+
id BIGSERIAL PRIMARY KEY,
|
|
5
|
+
token_hash TEXT NOT NULL,
|
|
6
|
+
token_hint TEXT NOT NULL,
|
|
7
|
+
uid BIGINT NOT NULL,
|
|
8
|
+
username TEXT NOT NULL,
|
|
9
|
+
display_name TEXT,
|
|
10
|
+
product TEXT NOT NULL,
|
|
11
|
+
key_id TEXT NOT NULL,
|
|
12
|
+
owner_tenant TEXT NOT NULL,
|
|
13
|
+
expires_at BIGINT NOT NULL,
|
|
14
|
+
used INTEGER NOT NULL DEFAULT 0,
|
|
15
|
+
used_at BIGINT,
|
|
16
|
+
revoked INTEGER NOT NULL DEFAULT 0,
|
|
17
|
+
created_at BIGINT NOT NULL,
|
|
18
|
+
created_ip TEXT
|
|
19
|
+
);
|
|
20
|
+
CREATE UNIQUE INDEX IF NOT EXISTS uk_publish_credential_token ON publish_credential (token_hash);
|
|
21
|
+
CREATE INDEX IF NOT EXISTS idx_publish_credential_owner
|
|
22
|
+
ON publish_credential (owner_tenant, uid, created_at);
|
|
23
|
+
CREATE INDEX IF NOT EXISTS idx_publish_credential_key ON publish_credential (key_id);
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
-- 0001__publish_credential(sqlite 方言):发布凭证表。
|
|
2
|
+
--
|
|
3
|
+
-- 定性:**共享表**(schema.yaml `tenant: false` + config.yaml `tenant.shared_allow` 双声明)。
|
|
4
|
+
-- 理由:兑换是 CLI 发起的,那一刻没有业务租户上下文;建成租户表会让 sql_guard: deny 给
|
|
5
|
+
-- 按 token_hash 的查询强加 tenant_id 过滤,换个租户头就查不到。租户归属由 owner_tenant
|
|
6
|
+
-- 显式承载(命名同 wecom_login_ticket:共享表出现 tenant_id 会被定性红线判为自相矛盾)。
|
|
7
|
+
--
|
|
8
|
+
-- 语义:
|
|
9
|
+
-- · 一次性兑换令牌:兑换成功后 used=1,再兑即拒;未兑换前可用 revoked 手动作废
|
|
10
|
+
-- · key_id 在**申请时**就算好落库,兑换只回读——CLI 不实现任何编码规则(单一真源)
|
|
11
|
+
-- · 只存 token_hash(sha256),明文只在申请响应里出现一次
|
|
12
|
+
--
|
|
13
|
+
-- 主键用自增 id 而非 token_hash:列表分页与撤销都按行 id 操作(pagedFactory 也按 id 排序),
|
|
14
|
+
-- 用 hash 做主键会让这两件事都得先算 hash 再反查。token_hash 仍唯一。
|
|
15
|
+
CREATE TABLE IF NOT EXISTS publish_credential (
|
|
16
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
17
|
+
token_hash TEXT NOT NULL,
|
|
18
|
+
token_hint TEXT NOT NULL,
|
|
19
|
+
uid INTEGER NOT NULL,
|
|
20
|
+
username TEXT NOT NULL,
|
|
21
|
+
display_name TEXT,
|
|
22
|
+
product TEXT NOT NULL,
|
|
23
|
+
key_id TEXT NOT NULL,
|
|
24
|
+
owner_tenant TEXT NOT NULL,
|
|
25
|
+
expires_at INTEGER NOT NULL,
|
|
26
|
+
used INTEGER NOT NULL DEFAULT 0,
|
|
27
|
+
used_at INTEGER,
|
|
28
|
+
revoked INTEGER NOT NULL DEFAULT 0,
|
|
29
|
+
created_at INTEGER NOT NULL,
|
|
30
|
+
created_ip TEXT
|
|
31
|
+
);
|
|
32
|
+
CREATE UNIQUE INDEX IF NOT EXISTS uk_publish_credential_token ON publish_credential (token_hash);
|
|
33
|
+
|
|
34
|
+
-- 「发布管理」页的主查询:按租户 + 本人 + 时间倒序
|
|
35
|
+
CREATE INDEX IF NOT EXISTS idx_publish_credential_owner
|
|
36
|
+
ON publish_credential (owner_tenant, uid, created_at);
|
|
37
|
+
|
|
38
|
+
-- 撞号检查(同 key_id 是否已属于别人)
|
|
39
|
+
CREATE INDEX IF NOT EXISTS idx_publish_credential_key ON publish_credential (key_id);
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# 声明式表结构(S006 纪律:结构真源是 migrations/0001__publish_credential*,本文件只负责
|
|
2
|
+
# 「列集/主键/租户定性」的运行时元数据,与迁移逐列对齐;templates-migration-schema-parity 双双守着)。
|
|
3
|
+
#
|
|
4
|
+
# 定性(三处一致:这里 / config.yaml `tenant.shared_allow` / 迁移文件头注释):
|
|
5
|
+
# **共享表**(tenant: false)。凭证在 CLI 兑换那一跳被执行,此刻没有业务租户语义——
|
|
6
|
+
# 若建成租户表,sql_guard: deny 会给按 token_hash 的查询强加 tenant_id 过滤,换个租户头即查不到。
|
|
7
|
+
# 租户归属由 `owner_tenant` 列显式承载(语义同 wecom_login_ticket:共享表出现 tenant_id
|
|
8
|
+
# 会被定性红线判为自相矛盾)。
|
|
9
|
+
tables:
|
|
10
|
+
publish_credential:
|
|
11
|
+
tenant: false
|
|
12
|
+
pk: id
|
|
13
|
+
columns:
|
|
14
|
+
id: {type: integer, null: false, autoincrement: true}
|
|
15
|
+
# 只存 sha256(明文):明文只在申请响应里出现一次
|
|
16
|
+
token_hash: {type: text, null: false}
|
|
17
|
+
# 明文前 8 位,仅供「发布管理」页识别是哪一张,不参与任何校验
|
|
18
|
+
token_hint: {type: text, null: false}
|
|
19
|
+
uid: {type: integer, null: false}
|
|
20
|
+
# 申请时快照:改名不影响已签发的凭证与已推导的 key_id
|
|
21
|
+
username: {type: text, null: false}
|
|
22
|
+
display_name: {type: text}
|
|
23
|
+
# 申请时填写的产品名(NAME_RE 校验,落库即定)
|
|
24
|
+
product: {type: text, null: false}
|
|
25
|
+
# 服务端推导并落库的发布身份;兑换时原样下发,CLI 零推导
|
|
26
|
+
key_id: {type: text, null: false}
|
|
27
|
+
owner_tenant: {type: text, null: false}
|
|
28
|
+
expires_at: {type: integer, null: false}
|
|
29
|
+
used: {type: integer, null: false}
|
|
30
|
+
used_at: {type: integer}
|
|
31
|
+
revoked: {type: integer, null: false}
|
|
32
|
+
created_at: {type: integer, null: false}
|
|
33
|
+
created_ip: {type: text}
|
|
@@ -10,9 +10,10 @@ async function get() {
|
|
|
10
10
|
}
|
|
11
11
|
get.response = {
|
|
12
12
|
type: "object",
|
|
13
|
-
required: ["methods"],
|
|
13
|
+
required: ["methods", "site_title"],
|
|
14
14
|
properties: {
|
|
15
15
|
methods: { type: "array", items: { type: "string" } },
|
|
16
|
+
site_title: { type: "string" },
|
|
16
17
|
},
|
|
17
18
|
};
|
|
18
19
|
|
|
@@ -124,6 +124,21 @@ export const schemas = {
|
|
|
124
124
|
data: z.array(z.object({
|
|
125
125
|
|
|
126
126
|
}).catchall(z.unknown())),
|
|
127
|
+
},
|
|
128
|
+
"platformMarketReleasesGet": {
|
|
129
|
+
query: z.object({
|
|
130
|
+
"page": z.number().min(1).optional(),
|
|
131
|
+
"limit": z.number().min(1).max(200).optional()
|
|
132
|
+
}),
|
|
133
|
+
data: z.object({
|
|
134
|
+
"list": z.array(z.object({
|
|
135
|
+
|
|
136
|
+
}).catchall(z.unknown())),
|
|
137
|
+
"total": z.number(),
|
|
138
|
+
"page": z.number(),
|
|
139
|
+
"size": z.number(),
|
|
140
|
+
"syncError": z.string().nullable().optional()
|
|
141
|
+
}),
|
|
127
142
|
},
|
|
128
143
|
"platformOrgDepartmentsGet": {
|
|
129
144
|
query: z.object({
|
|
@@ -36,7 +36,7 @@ export function create_platformClient(ctx: ModuleContext) {
|
|
|
36
36
|
}
|
|
37
37
|
ctx.register.apiPrefix(API_PREFIX);
|
|
38
38
|
bindRequest(ctx.utils.request);
|
|
39
|
-
return { platformContactsGet, platformContactsDetailGet, platformMarketInstallPost, platformMarketInstallCancelPost, platformMarketTaskGet, platformMarketEnablePost, platformMarketMetaGet, platformMarketTrustGet, platformMarketTrustPost, platformMarketTrustKeyPost, platformMarketTrustKeyDelete, platformMarketIndexGet, platformMarketUninstallImpactGet, platformMarketUninstallPost, platformMarketHistoryGet, platformOrgDepartmentsGet, platformOrgIsMemberGet, platformOrgMembersGet, platformOrgPickerGet, platformOrgResolvePost, platformOrgTreeGet, platformOrgUserGet, platformSolutionsRoutesGet, platformSolutionsVerifyPost, platformSolutionsVerifyLastGet };
|
|
39
|
+
return { platformContactsGet, platformContactsDetailGet, platformMarketInstallPost, platformMarketInstallCancelPost, platformMarketTaskGet, platformMarketEnablePost, platformMarketMetaGet, platformMarketTrustGet, platformMarketTrustPost, platformMarketTrustKeyPost, platformMarketTrustKeyDelete, platformMarketIndexGet, platformMarketUninstallImpactGet, platformMarketUninstallPost, platformMarketHistoryGet, platformMarketReleasesGet, platformOrgDepartmentsGet, platformOrgIsMemberGet, platformOrgMembersGet, platformOrgPickerGet, platformOrgResolvePost, platformOrgTreeGet, platformOrgUserGet, platformSolutionsRoutesGet, platformSolutionsVerifyPost, platformSolutionsVerifyLastGet };
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
/**
|
|
@@ -423,6 +423,30 @@ export async function platformMarketHistoryGet(): Promise<PlatformMarketHistoryG
|
|
|
423
423
|
}
|
|
424
424
|
}
|
|
425
425
|
|
|
426
|
+
export type PlatformMarketReleasesGetQuery = z.input<(typeof schemas)["platformMarketReleasesGet"]["query"]>;
|
|
427
|
+
export type PlatformMarketReleasesGetData = z.infer<(typeof schemas)["platformMarketReleasesGet"]["data"]>;
|
|
428
|
+
|
|
429
|
+
export async function platformMarketReleasesGet(query: PlatformMarketReleasesGetQuery): Promise<PlatformMarketReleasesGetData> {
|
|
430
|
+
const client = ensureReq();
|
|
431
|
+
try {
|
|
432
|
+
const env = await client.get(`_platform/market/releases`, { searchParams: query as Record<string, string | number | boolean> }).json<OjEnvelope<PlatformMarketReleasesGetData>>();
|
|
433
|
+
// 2xx + code!==0 也是业务错误(§6.2 通道 a):oj 不会这么发,但契约机制的价值恰是防漂移
|
|
434
|
+
if (typeof env.code === "number" && env.code !== 0)
|
|
435
|
+
throw new ContractApiError(env.code, env.msg ?? "业务错误(信封 code 非 0)");
|
|
436
|
+
const data = env.data as PlatformMarketReleasesGetData;
|
|
437
|
+
if (import.meta.env.DEV) {
|
|
438
|
+
const { schemas } = await import("./api.schemas");
|
|
439
|
+
const r = schemas["platformMarketReleasesGet"].data.safeParse(data);
|
|
440
|
+
if (!r.success)
|
|
441
|
+
throw new ContractApiError(-1, `[契约违例] platformMarketReleasesGet 响应与契约不符:${r.error.issues.map(i => `${i.path.join(".") || "(root)"}: ${i.message}`).join("; ")}`);
|
|
442
|
+
}
|
|
443
|
+
return data;
|
|
444
|
+
}
|
|
445
|
+
catch (e) {
|
|
446
|
+
throw await toApiError(e);
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
|
|
426
450
|
export type PlatformOrgDepartmentsGetQuery = z.input<(typeof schemas)["platformOrgDepartmentsGet"]["query"]>;
|
|
427
451
|
export type PlatformOrgDepartmentsGetData = z.infer<(typeof schemas)["platformOrgDepartmentsGet"]["data"]>;
|
|
428
452
|
|
|
@@ -8,13 +8,16 @@ import { onInit as personalCenterOnInit, routes as personalCenterRoutes } from "
|
|
|
8
8
|
import { onInit as systemOnInit, routes as systemRoutes } from "./system/routes";
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
* 应用模块(多根聚合):一个 entry
|
|
11
|
+
* 应用模块(多根聚合):一个 entry 承载五个业务根,各根独立成一级菜单。
|
|
12
12
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* modules.json
|
|
13
|
+
* 为什么聚合:这五个根(首页/登录/个人中心/通知/系统管理)是脚手架的框架内置页面,
|
|
14
|
+
* 同版本发布、同生命周期、缺一不可,拆成五个模块只会把工程目录、web.config 登记、
|
|
15
|
+
* modules.json 与首屏模块入口请求都放大五倍。聚合后仍是「一目录一模块」,但模块内
|
|
16
16
|
* 按根分目录(`<root>/routes.ts` + `pages/` + `__client/`),页面相对导入不变。
|
|
17
17
|
*
|
|
18
|
+
* 发布管理不在这里:它属于方案市场,随 `src/oj-market/web/publish` 走市场模块
|
|
19
|
+
* (`/publish` 仍是独立一级菜单,URL 与菜单 key 不变)。
|
|
20
|
+
*
|
|
18
21
|
* 结构约定(多根模块):
|
|
19
22
|
* - 顶层路由首段去重 > 1 → runtime 判为多根(`isMultiRoot`),各根按 entry 里的
|
|
20
23
|
* **绝对路径**原样注册,不被 `routePrefix` 改写——URL 与菜单 key 都不变;
|
|
@@ -24,7 +27,8 @@ import { onInit as systemOnInit, routes as systemRoutes } from "./system/routes"
|
|
|
24
27
|
*
|
|
25
28
|
* i18n 用 `i18nNamespaces` 沿用各根**原命名空间**(home / login / personal-center /
|
|
26
29
|
* notification / system),因此 `t("system:menu.users")`、`useTranslation("system")`
|
|
27
|
-
* 与菜单标题 `<ns>:menu.<key>`
|
|
30
|
+
* 与菜单标题 `<ns>:menu.<key>` 全部零改动。发布管理的 `publish` 命名空间随页面
|
|
31
|
+
* 在 oj-market 侧登记。
|
|
28
32
|
*/
|
|
29
33
|
const i18nNamespaces: Record<string, ModuleI18n> = {
|
|
30
34
|
"home": {
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { EChartsOption } from "echarts";
|
|
2
2
|
import { Card } from "antd";
|
|
3
|
-
import
|
|
3
|
+
import ReactEChartsCore from "echarts-for-react/esm/core";
|
|
4
4
|
import { useTranslation } from "react-i18next";
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
import { echarts } from "./echarts-setup";
|
|
7
|
+
|
|
8
|
+
/** 柱状图:按需注册的 `echarts` + `echarts-for-react/esm/core`(见 echarts-setup.ts)。 */
|
|
7
9
|
export default function BarChart() {
|
|
8
10
|
const { t } = useTranslation();
|
|
9
11
|
const categories = [
|
|
@@ -25,7 +27,7 @@ export default function BarChart() {
|
|
|
25
27
|
};
|
|
26
28
|
return (
|
|
27
29
|
<Card title={t("home:views")}>
|
|
28
|
-
<
|
|
30
|
+
<ReactEChartsCore echarts={echarts} opts={{ height: 320, width: "auto" }} option={option} />
|
|
29
31
|
</Card>
|
|
30
32
|
);
|
|
31
33
|
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 按需注册的 echarts 实例(体积治理)。
|
|
3
|
+
*
|
|
4
|
+
* 为什么不用 `import ReactECharts from "echarts-for-react"`:
|
|
5
|
+
* 那条路径会 `import * as echarts from "echarts"`(整包 index),把 **全部图表类型 +
|
|
6
|
+
* 全部组件 + 全部渲染器** 打进模块产物。实测 `app` 模块 entry.js 1,697,666 B 中
|
|
7
|
+
* echarts 918 KB + zrender 221 KB,占 **87%**;而首页只用到折线/柱状/饼图三种。
|
|
8
|
+
*
|
|
9
|
+
* 这里改用 `echarts/core` 按需注册:只留 3 种图表 + 3 个组件 + Canvas 渲染器,
|
|
10
|
+
* 同一份代码实测 1,125 KB → 572 KB(−49%)。
|
|
11
|
+
*
|
|
12
|
+
* 新图表类型/组件时,务必在这里 `use()` 补上——否则运行期渲染为空且**不报错**,
|
|
13
|
+
* 是最常见的 echarts 按需踩坑。
|
|
14
|
+
*/
|
|
15
|
+
import { BarChart, LineChart, PieChart } from "echarts/charts";
|
|
16
|
+
import { GridComponent, LegendComponent, TooltipComponent } from "echarts/components";
|
|
17
|
+
import * as echarts from "echarts/core";
|
|
18
|
+
import { CanvasRenderer } from "echarts/renderers";
|
|
19
|
+
|
|
20
|
+
echarts.use([
|
|
21
|
+
BarChart,
|
|
22
|
+
LineChart,
|
|
23
|
+
PieChart,
|
|
24
|
+
GridComponent,
|
|
25
|
+
LegendComponent,
|
|
26
|
+
TooltipComponent,
|
|
27
|
+
CanvasRenderer,
|
|
28
|
+
]);
|
|
29
|
+
|
|
30
|
+
export { echarts };
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import type { EChartsOption } from "echarts";
|
|
2
2
|
import { Card, Radio } from "antd";
|
|
3
3
|
import dayjs from "dayjs";
|
|
4
|
-
import
|
|
4
|
+
import ReactEChartsCore from "echarts-for-react/esm/core";
|
|
5
5
|
import { useMemo, useState } from "react";
|
|
6
6
|
import { useTranslation } from "react-i18next";
|
|
7
7
|
|
|
8
|
+
import { echarts } from "./echarts-setup";
|
|
9
|
+
|
|
8
10
|
/**
|
|
9
|
-
*
|
|
11
|
+
* 折线图:按需注册的 `echarts` + `echarts-for-react/esm/core`(见 echarts-setup.ts)。
|
|
10
12
|
* 数据为静态演示值——真实业务请走模块契约 + `ojm api` 生成的 client
|
|
11
13
|
* (参考 `demo` 模块的裸 fetch 与教程里 books 模块的契约式接法)。
|
|
12
14
|
*/
|
|
@@ -69,7 +71,7 @@ export default function LineChart() {
|
|
|
69
71
|
</Radio.Group>
|
|
70
72
|
)}
|
|
71
73
|
>
|
|
72
|
-
<
|
|
74
|
+
<ReactEChartsCore echarts={echarts} opts={{ height: 320, width: "auto" }} option={option} />
|
|
73
75
|
</Card>
|
|
74
76
|
);
|
|
75
77
|
}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import type { EChartsOption } from "echarts";
|
|
2
2
|
import { Card, Segmented } from "antd";
|
|
3
|
-
import
|
|
3
|
+
import ReactEChartsCore from "echarts-for-react/esm/core";
|
|
4
4
|
import { useMemo, useState } from "react";
|
|
5
5
|
import { useTranslation } from "react-i18next";
|
|
6
6
|
|
|
7
|
+
import { echarts } from "./echarts-setup";
|
|
8
|
+
|
|
7
9
|
/**
|
|
8
|
-
*
|
|
10
|
+
* 饼图:按需注册的 `echarts` + `echarts-for-react/esm/core` + antd `Segmented` 联动
|
|
11
|
+
* (注册清单见 echarts-setup.ts)。
|
|
9
12
|
* 数据为静态演示值(各渠道 × 品类)。
|
|
10
13
|
*/
|
|
11
14
|
const VALUES: Record<string, number[]> = {
|
|
@@ -59,7 +62,7 @@ export default function PieChart() {
|
|
|
59
62
|
/>
|
|
60
63
|
)}
|
|
61
64
|
>
|
|
62
|
-
<
|
|
65
|
+
<ReactEChartsCore echarts={echarts} opts={{ height: 320, width: "auto" }} option={option} />
|
|
63
66
|
</Card>
|
|
64
67
|
);
|
|
65
68
|
}
|
|
@@ -19,8 +19,9 @@ const wrapperCol: ColProps = {
|
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* 首页:结构对齐 playground home,用自带的统计卡片与三类图表
|
|
22
|
-
*
|
|
23
|
-
*
|
|
22
|
+
* 演示依赖矩阵(react-countup / dayjs / antd / @ant-design/icons / react-i18next
|
|
23
|
+
* 由宿主 importmap 单例提供;echarts 由模块自打包并按需注册,
|
|
24
|
+
* 见 `./components/echarts-setup.ts`)。
|
|
24
25
|
*/
|
|
25
26
|
export default function HomePage() {
|
|
26
27
|
return (
|
|
@@ -14,8 +14,9 @@ const Home = lazy(() => import("./pages/index"));
|
|
|
14
14
|
* 工程缺 `/home` 路由时这些跳转会落到错误边界。
|
|
15
15
|
*
|
|
16
16
|
* 结构对齐 playground-oj/web/src/home;页面用统计卡片 + 折线/柱/饼图
|
|
17
|
-
*
|
|
18
|
-
*
|
|
17
|
+
* 演示依赖矩阵(react-countup / dayjs / antd / @ant-design/icons / react-i18next
|
|
18
|
+
* 由宿主 importmap 提供单例;echarts 属模块自打包的重型依赖,走按需注册,
|
|
19
|
+
* 见 `pages/components/echarts-setup.ts`)。
|
|
19
20
|
* 图表数据为静态演示值——真实业务走模块契约 + `ojm api` 生成的 client。
|
|
20
21
|
*/
|
|
21
22
|
export const routes: AppRouteRecordRaw[] = [
|
|
@@ -34,6 +35,11 @@ export const routes: AppRouteRecordRaw[] = [
|
|
|
34
35
|
handle: {
|
|
35
36
|
title: "home:menu.home",
|
|
36
37
|
icon: createElement(HomeOutlined),
|
|
38
|
+
// 首页是 /home 根的 index 子路由,运行时匹配到的叶子路由 id 为 `/home/`(带尾斜杠),
|
|
39
|
+
// 而菜单项 key 是父级 `/home`,selectedKeys 取叶子 id 导致高亮对不上——
|
|
40
|
+
// 复刻 react-antd-admin 时「首页」菜单项不亮。用 currentActiveMenu 显式声明高亮 /home
|
|
41
|
+
// (框架既定机制:页面指定高亮哪个菜单),对齐 playground / react-antd-admin 的选中态。
|
|
42
|
+
currentActiveMenu: "/home",
|
|
37
43
|
},
|
|
38
44
|
},
|
|
39
45
|
],
|
|
@@ -30,9 +30,15 @@
|
|
|
30
30
|
"sso.action": "Sign in with SSO",
|
|
31
31
|
"wecom": "WeCom",
|
|
32
32
|
"wecom.action": "Sign in with WeCom",
|
|
33
|
+
"wecomPending": "WeCom login will be available in a later stage",
|
|
33
34
|
"wecom.hint": "Enter the enterprise code (corp_id, visible in the WeCom console), or use the dedicated sign-in link from your admin",
|
|
34
35
|
"wecom.agent": "App ID (agentid)",
|
|
35
36
|
"wecom.agentHint": "Leave empty if the corp has a single app; otherwise use the agentid provided by your admin",
|
|
36
|
-
"wecom.exchanging": "Completing WeCom sign-in…"
|
|
37
|
+
"wecom.exchanging": "Completing WeCom sign-in…",
|
|
38
|
+
"wecom.scan.hint": "Open the WeCom app, scan with 「Scan」 and confirm — no username or password needed",
|
|
39
|
+
"wecom.scan.action": "One-tap sign in with WeCom",
|
|
40
|
+
"wecom.otherCorp": "Another enterprise? Sign in with an enterprise code",
|
|
41
|
+
"wecom.otherCorpHide": "Hide enterprise code"
|
|
42
|
+
|
|
37
43
|
}
|
|
38
44
|
}
|
|
@@ -30,9 +30,15 @@
|
|
|
30
30
|
"sso.action": "使用 SSO 登录",
|
|
31
31
|
"wecom": "企业微信",
|
|
32
32
|
"wecom.action": "使用企业微信登录",
|
|
33
|
+
"wecomPending": "企业微信登录将在后续阶段提供",
|
|
33
34
|
"wecom.hint": "填写企业代码(企微后台可见的 corp_id),或直接使用管理员收到的专属登录链接",
|
|
34
35
|
"wecom.agent": "应用 ID(agentid)",
|
|
35
36
|
"wecom.agentHint": "留空使用该企业下唯一应用;多应用部署请填管理员提供的 agentid",
|
|
36
|
-
"wecom.exchanging": "正在完成企业微信登录…"
|
|
37
|
+
"wecom.exchanging": "正在完成企业微信登录…",
|
|
38
|
+
"wecom.scan.hint": "打开企业微信 App,用「扫一扫」扫码确认后自动进入,无需输入账号密码",
|
|
39
|
+
"wecom.scan.action": "使用企业微信一键登录",
|
|
40
|
+
"wecom.otherCorp": "其他企业?使用企业代码登录",
|
|
41
|
+
"wecom.otherCorpHide": "收起企业代码"
|
|
42
|
+
|
|
37
43
|
}
|
|
38
44
|
}
|