openxiangda 1.0.264 → 2.0.0-alpha.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.
- package/README.md +11 -666
- package/bin/run.js +11 -0
- package/dist/browser/AuthoritativeSelector.d.ts +37 -0
- package/dist/browser/AuthoritativeSelector.d.ts.map +1 -0
- package/dist/browser/AuthoritativeSelector.js +357 -0
- package/dist/browser/AuthoritativeSelector.js.map +1 -0
- package/dist/browser/FilePreviewPage.d.ts +2 -0
- package/dist/browser/FilePreviewPage.d.ts.map +1 -0
- package/dist/browser/FilePreviewPage.js +191 -0
- package/dist/browser/FilePreviewPage.js.map +1 -0
- package/dist/browser/Shell.d.ts +6 -0
- package/dist/browser/Shell.d.ts.map +1 -0
- package/dist/browser/Shell.js +198 -0
- package/dist/browser/Shell.js.map +1 -0
- package/dist/browser/appearance.d.ts +12 -0
- package/dist/browser/appearance.d.ts.map +1 -0
- package/dist/browser/appearance.js +100 -0
- package/dist/browser/appearance.js.map +1 -0
- package/dist/browser/application.d.ts +8 -0
- package/dist/browser/application.d.ts.map +1 -0
- package/dist/browser/application.js +42 -0
- package/dist/browser/application.js.map +1 -0
- package/dist/browser/components/platform-fields/AddressField.d.ts +12 -0
- package/dist/browser/components/platform-fields/AddressField.d.ts.map +1 -0
- package/dist/browser/components/platform-fields/AddressField.js +179 -0
- package/dist/browser/components/platform-fields/AddressField.js.map +1 -0
- package/dist/browser/components/platform-fields/AttachmentFileList.d.ts +9 -0
- package/dist/browser/components/platform-fields/AttachmentFileList.d.ts.map +1 -0
- package/dist/browser/components/platform-fields/AttachmentFileList.js +164 -0
- package/dist/browser/components/platform-fields/AttachmentFileList.js.map +1 -0
- package/dist/browser/components/platform-fields/CascadeField.d.ts +13 -0
- package/dist/browser/components/platform-fields/CascadeField.d.ts.map +1 -0
- package/dist/browser/components/platform-fields/CascadeField.js +14 -0
- package/dist/browser/components/platform-fields/CascadeField.js.map +1 -0
- package/dist/browser/components/platform-fields/DateTimeField.d.ts +16 -0
- package/dist/browser/components/platform-fields/DateTimeField.d.ts.map +1 -0
- package/dist/browser/components/platform-fields/DateTimeField.js +51 -0
- package/dist/browser/components/platform-fields/DateTimeField.js.map +1 -0
- package/dist/browser/components/platform-fields/JsonField.d.ts +11 -0
- package/dist/browser/components/platform-fields/JsonField.d.ts.map +1 -0
- package/dist/browser/components/platform-fields/JsonField.js +40 -0
- package/dist/browser/components/platform-fields/JsonField.js.map +1 -0
- package/dist/browser/components/platform-fields/LocationField.d.ts +11 -0
- package/dist/browser/components/platform-fields/LocationField.d.ts.map +1 -0
- package/dist/browser/components/platform-fields/LocationField.js +73 -0
- package/dist/browser/components/platform-fields/LocationField.js.map +1 -0
- package/dist/browser/components/platform-fields/PlatformDirectoryPicker.d.ts +12 -0
- package/dist/browser/components/platform-fields/PlatformDirectoryPicker.d.ts.map +1 -0
- package/dist/browser/components/platform-fields/PlatformDirectoryPicker.js +269 -0
- package/dist/browser/components/platform-fields/PlatformDirectoryPicker.js.map +1 -0
- package/dist/browser/components/platform-fields/ResourceReferenceField.d.ts +12 -0
- package/dist/browser/components/platform-fields/ResourceReferenceField.d.ts.map +1 -0
- package/dist/browser/components/platform-fields/ResourceReferenceField.js +22 -0
- package/dist/browser/components/platform-fields/ResourceReferenceField.js.map +1 -0
- package/dist/browser/components/platform-fields/RichTextField.d.ts +14 -0
- package/dist/browser/components/platform-fields/RichTextField.d.ts.map +1 -0
- package/dist/browser/components/platform-fields/RichTextField.js +214 -0
- package/dist/browser/components/platform-fields/RichTextField.js.map +1 -0
- package/dist/browser/components/platform-fields/SignatureField.d.ts +15 -0
- package/dist/browser/components/platform-fields/SignatureField.d.ts.map +1 -0
- package/dist/browser/components/platform-fields/SignatureField.js +179 -0
- package/dist/browser/components/platform-fields/SignatureField.js.map +1 -0
- package/dist/browser/components/platform-fields/SubtableField.d.ts +18 -0
- package/dist/browser/components/platform-fields/SubtableField.d.ts.map +1 -0
- package/dist/browser/components/platform-fields/SubtableField.js +236 -0
- package/dist/browser/components/platform-fields/SubtableField.js.map +1 -0
- package/dist/browser/components/platform-fields/address-value.d.ts +13 -0
- package/dist/browser/components/platform-fields/address-value.d.ts.map +1 -0
- package/dist/browser/components/platform-fields/address-value.js +70 -0
- package/dist/browser/components/platform-fields/address-value.js.map +1 -0
- package/dist/browser/components/platform-fields/cascade-value.d.ts +6 -0
- package/dist/browser/components/platform-fields/cascade-value.d.ts.map +1 -0
- package/dist/browser/components/platform-fields/cascade-value.js +47 -0
- package/dist/browser/components/platform-fields/cascade-value.js.map +1 -0
- package/dist/browser/components/platform-fields/directory-value.d.ts +7 -0
- package/dist/browser/components/platform-fields/directory-value.d.ts.map +1 -0
- package/dist/browser/components/platform-fields/directory-value.js +35 -0
- package/dist/browser/components/platform-fields/directory-value.js.map +1 -0
- package/dist/browser/components/platform-fields/field-form-codec.d.ts +10 -0
- package/dist/browser/components/platform-fields/field-form-codec.d.ts.map +1 -0
- package/dist/browser/components/platform-fields/field-form-codec.js +82 -0
- package/dist/browser/components/platform-fields/field-form-codec.js.map +1 -0
- package/dist/browser/components/platform-fields/location-value.d.ts +20 -0
- package/dist/browser/components/platform-fields/location-value.d.ts.map +1 -0
- package/dist/browser/components/platform-fields/location-value.js +57 -0
- package/dist/browser/components/platform-fields/location-value.js.map +1 -0
- package/dist/browser/components/platform-fields/resource-query.d.ts +14 -0
- package/dist/browser/components/platform-fields/resource-query.d.ts.map +1 -0
- package/dist/browser/components/platform-fields/resource-query.js +102 -0
- package/dist/browser/components/platform-fields/resource-query.js.map +1 -0
- package/dist/browser/components/platform-fields/rich-text-value.d.ts +12 -0
- package/dist/browser/components/platform-fields/rich-text-value.d.ts.map +1 -0
- package/dist/browser/components/platform-fields/rich-text-value.js +83 -0
- package/dist/browser/components/platform-fields/rich-text-value.js.map +1 -0
- package/dist/browser/components/platform-fields/subtable-value.d.ts +31 -0
- package/dist/browser/components/platform-fields/subtable-value.d.ts.map +1 -0
- package/dist/browser/components/platform-fields/subtable-value.js +120 -0
- package/dist/browser/components/platform-fields/subtable-value.js.map +1 -0
- package/dist/browser/components/resource/GeneratedResourceCrud.d.ts +8 -0
- package/dist/browser/components/resource/GeneratedResourceCrud.d.ts.map +1 -0
- package/dist/browser/components/resource/GeneratedResourceCrud.js +580 -0
- package/dist/browser/components/resource/GeneratedResourceCrud.js.map +1 -0
- package/dist/browser/components/resource/ResourceBatchActions.d.ts +25 -0
- package/dist/browser/components/resource/ResourceBatchActions.d.ts.map +1 -0
- package/dist/browser/components/resource/ResourceBatchActions.js +168 -0
- package/dist/browser/components/resource/ResourceBatchActions.js.map +1 -0
- package/dist/browser/components/resource/StandardResourcePages.d.ts +57 -0
- package/dist/browser/components/resource/StandardResourcePages.d.ts.map +1 -0
- package/dist/browser/components/resource/StandardResourcePages.js +89 -0
- package/dist/browser/components/resource/StandardResourcePages.js.map +1 -0
- package/dist/browser/components/resource/SurfaceFields.d.ts +88 -0
- package/dist/browser/components/resource/SurfaceFields.d.ts.map +1 -0
- package/dist/browser/components/resource/SurfaceFields.js +497 -0
- package/dist/browser/components/resource/SurfaceFields.js.map +1 -0
- package/dist/browser/components/resource/generated-resource-definition.d.ts +19 -0
- package/dist/browser/components/resource/generated-resource-definition.d.ts.map +1 -0
- package/dist/browser/components/resource/generated-resource-definition.js +2 -0
- package/dist/browser/components/resource/generated-resource-definition.js.map +1 -0
- package/dist/browser/components/resource/resource-import.d.ts +15 -0
- package/dist/browser/components/resource/resource-import.d.ts.map +1 -0
- package/dist/browser/components/resource/resource-import.js +197 -0
- package/dist/browser/components/resource/resource-import.js.map +1 -0
- package/dist/browser/data-provider.d.ts +4 -0
- package/dist/browser/data-provider.d.ts.map +1 -0
- package/dist/browser/data-provider.js +45 -0
- package/dist/browser/data-provider.js.map +1 -0
- package/dist/browser/platform-client.d.ts +81 -0
- package/dist/browser/platform-client.d.ts.map +1 -0
- package/dist/browser/platform-client.js +422 -0
- package/dist/browser/platform-client.js.map +1 -0
- package/dist/browser/resource-definitions.d.ts +8 -0
- package/dist/browser/resource-definitions.d.ts.map +1 -0
- package/dist/browser/resource-definitions.js +14 -0
- package/dist/browser/resource-definitions.js.map +1 -0
- package/dist/browser/runtime-meta.d.ts +22 -0
- package/dist/browser/runtime-meta.d.ts.map +1 -0
- package/dist/browser/runtime-meta.js +79 -0
- package/dist/browser/runtime-meta.js.map +1 -0
- package/dist/browser/runtime.d.ts +13 -0
- package/dist/browser/runtime.d.ts.map +1 -0
- package/dist/browser/runtime.js +47 -0
- package/dist/browser/runtime.js.map +1 -0
- package/dist/browser/styles.css +1941 -0
- package/dist/config.d.ts +2 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +2 -0
- package/dist/config.js.map +1 -0
- package/dist/core.d.ts +6 -0
- package/dist/core.d.ts.map +1 -0
- package/dist/core.js +4 -0
- package/dist/core.js.map +1 -0
- package/dist/field-kit.d.ts +22 -0
- package/dist/field-kit.d.ts.map +1 -0
- package/dist/field-kit.js +22 -0
- package/dist/field-kit.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/nest.d.ts +10 -0
- package/dist/nest.d.ts.map +1 -0
- package/dist/nest.js +9 -0
- package/dist/nest.js.map +1 -0
- package/dist/react.d.ts +12 -0
- package/dist/react.d.ts.map +1 -0
- package/dist/react.js +11 -0
- package/dist/react.js.map +1 -0
- package/dist/testing.d.ts +4 -0
- package/dist/testing.d.ts.map +1 -0
- package/dist/testing.js +4 -0
- package/dist/testing.js.map +1 -0
- package/package.json +95 -200
- package/skills/manifest.json +10 -0
- package/skills/openxiangda-v2/SKILL.md +55 -0
- package/skills/openxiangda-v2/references/architecture.md +7 -0
- package/skills/openxiangda-v2/references/backend.md +116 -0
- package/skills/openxiangda-v2/references/data-authz.md +93 -0
- package/skills/openxiangda-v2/references/delivery.md +11 -0
- package/skills/openxiangda-v2/references/discovery.md +15 -0
- package/skills/openxiangda-v2/references/frontend.md +10 -0
- package/skills/openxiangda-v2/references/testing.md +16 -0
- package/skills/openxiangda-v2/references/workflow-notification.md +69 -0
- package/skills/openxiangda-v2/references/workspace.md +21 -0
- package/bin/openxiangda.js +0 -26
- package/lib/app-function-invoke.js +0 -28
- package/lib/application-environments.js +0 -1134
- package/lib/change-baseline.js +0 -1359
- package/lib/cli.js +0 -31084
- package/lib/config.js +0 -450
- package/lib/content-cache.js +0 -97
- package/lib/delivery-v2-cli.js +0 -329
- package/lib/delivery-v2-executor.js +0 -1703
- package/lib/delivery-v2-package.js +0 -1176
- package/lib/dependency-capsule.js +0 -246
- package/lib/design-gates.js +0 -668
- package/lib/design-review.js +0 -220
- package/lib/developer-center.js +0 -160
- package/lib/form-field-contract.js +0 -79
- package/lib/form-schema-loader.js +0 -181
- package/lib/git-remote-identity.js +0 -89
- package/lib/http.js +0 -196
- package/lib/integration-bundle.js +0 -225
- package/lib/js-code-build.js +0 -175
- package/lib/open-api.js +0 -256
- package/lib/policy.js +0 -137
- package/lib/publish-context.js +0 -98
- package/lib/publish-lease-heartbeat.js +0 -182
- package/lib/publish-lease.js +0 -221
- package/lib/release-error-classification.js +0 -41
- package/lib/release-explain.js +0 -75
- package/lib/release-mainline.js +0 -654
- package/lib/release-plan.js +0 -550
- package/lib/release-telemetry.js +0 -182
- package/lib/resource-binding-contract.js +0 -210
- package/lib/role-resolution.js +0 -57
- package/lib/runtime-lineage.js +0 -326
- package/lib/sdd.js +0 -3306
- package/lib/skills.js +0 -453
- package/lib/source-dependencies.js +0 -921
- package/lib/task-status.js +0 -330
- package/lib/utils.js +0 -178
- package/lib/workspace-bootstrap.js +0 -268
- package/lib/workspace-init.js +0 -202
- package/lib/worktree-cleanup.js +0 -631
- package/lib/worktree-owner.js +0 -354
- package/openxiangda-skills/SKILL.md +0 -226
- package/openxiangda-skills/references/architecture-design.md +0 -409
- package/openxiangda-skills/references/architecture-patterns.md +0 -264
- package/openxiangda-skills/references/automation-v3.md +0 -349
- package/openxiangda-skills/references/best-practices.md +0 -272
- package/openxiangda-skills/references/component-guide.md +0 -287
- package/openxiangda-skills/references/connector-resources.md +0 -80
- package/openxiangda-skills/references/data-views.md +0 -360
- package/openxiangda-skills/references/forms/component-registry.md +0 -90
- package/openxiangda-skills/references/forms/form-schema.md +0 -146
- package/openxiangda-skills/references/forms/layout-and-rules.md +0 -24
- package/openxiangda-skills/references/notifications.md +0 -227
- package/openxiangda-skills/references/openxiangda-api.md +0 -971
- package/openxiangda-skills/references/pages/app-shell.md +0 -66
- package/openxiangda-skills/references/pages/page-sdk.md +0 -401
- package/openxiangda-skills/references/pages/publish-flow.md +0 -84
- package/openxiangda-skills/references/pages/workspace-structure.md +0 -41
- package/openxiangda-skills/references/permission-design-patterns.md +0 -313
- package/openxiangda-skills/references/permissions-settings.md +0 -468
- package/openxiangda-skills/references/platform-data-model.md +0 -340
- package/openxiangda-skills/references/resource-manifest-cheatsheet.md +0 -936
- package/openxiangda-skills/references/school-contact-relations.md +0 -224
- package/openxiangda-skills/references/style-system.md +0 -218
- package/openxiangda-skills/references/troubleshooting.md +0 -271
- package/openxiangda-skills/references/workflow-v3.md +0 -441
- package/openxiangda-skills/references/workspace-state.md +0 -115
- package/openxiangda-skills/skills/openxiangda-app/SKILL.md +0 -118
- package/openxiangda-skills/skills/openxiangda-architecture-design/SKILL.md +0 -137
- package/openxiangda-skills/skills/openxiangda-core/SKILL.md +0 -222
- package/openxiangda-skills/skills/openxiangda-form/SKILL.md +0 -184
- package/openxiangda-skills/skills/openxiangda-inspect/SKILL.md +0 -63
- package/openxiangda-skills/skills/openxiangda-open-api/SKILL.md +0 -57
- package/openxiangda-skills/skills/openxiangda-open-api/agents/openai.yaml +0 -4
- package/openxiangda-skills/skills/openxiangda-open-api/references/backend-authentication.md +0 -63
- package/openxiangda-skills/skills/openxiangda-open-api/references/dingtalk-api.openapi.json +0 -15653
- package/openxiangda-skills/skills/openxiangda-page/SKILL.md +0 -154
- package/openxiangda-skills/skills/openxiangda-permission-settings/SKILL.md +0 -209
- package/openxiangda-skills/skills/openxiangda-workflow-automation/SKILL.md +0 -201
- package/packages/sdk/bin/lowcode-workspace.mjs +0 -4
- package/packages/sdk/dist/ProcessPreview-DSUIJi5V.d.mts +0 -1292
- package/packages/sdk/dist/ProcessPreview-DSUIJi5V.d.ts +0 -1292
- package/packages/sdk/dist/build/index.cjs +0 -1
- package/packages/sdk/dist/build/index.d.mts +0 -60
- package/packages/sdk/dist/build/index.d.ts +0 -60
- package/packages/sdk/dist/build/index.mjs +0 -1
- package/packages/sdk/dist/components/index.cjs +0 -148
- package/packages/sdk/dist/components/index.d.mts +0 -970
- package/packages/sdk/dist/components/index.d.ts +0 -970
- package/packages/sdk/dist/components/index.mjs +0 -148
- package/packages/sdk/dist/dataManagementApi-Ro9itwm8.d.ts +0 -142
- package/packages/sdk/dist/dataManagementApi-p_HOhQnA.d.mts +0 -142
- package/packages/sdk/dist/runtime/index.cjs +0 -148
- package/packages/sdk/dist/runtime/index.d.mts +0 -171
- package/packages/sdk/dist/runtime/index.d.ts +0 -171
- package/packages/sdk/dist/runtime/index.mjs +0 -148
- package/packages/sdk/dist/runtime/react.cjs +0 -148
- package/packages/sdk/dist/runtime/react.d.mts +0 -3202
- package/packages/sdk/dist/runtime/react.d.ts +0 -3202
- package/packages/sdk/dist/runtime/react.mjs +0 -148
- package/packages/sdk/dist/styles/antd-theme.cjs +0 -1
- package/packages/sdk/dist/styles/antd-theme.d.mts +0 -6
- package/packages/sdk/dist/styles/antd-theme.d.ts +0 -6
- package/packages/sdk/dist/styles/antd-theme.mjs +0 -1
- package/packages/sdk/dist/styles/tailwind-preset.cjs +0 -1
- package/packages/sdk/dist/styles/tailwind-preset.d.mts +0 -74
- package/packages/sdk/dist/styles/tailwind-preset.d.ts +0 -74
- package/packages/sdk/dist/styles/tailwind-preset.mjs +0 -1
- package/packages/sdk/dist/styles/tokens.css +0 -74
- package/packages/sdk/dist/workflow/index.cjs +0 -3
- package/packages/sdk/dist/workflow/index.d.mts +0 -291
- package/packages/sdk/dist/workflow/index.d.ts +0 -291
- package/packages/sdk/dist/workflow/index.mjs +0 -3
- package/packages/sdk/source/admin-list/AdminList.tsx +0 -1734
- package/packages/sdk/source/admin-list/README.md +0 -12
- package/packages/sdk/source/admin-list/dataSources.ts +0 -345
- package/packages/sdk/source/admin-list/index.ts +0 -42
- package/packages/sdk/source/admin-list/preferences.ts +0 -174
- package/packages/sdk/source/admin-list/types.ts +0 -273
- package/packages/sdk/src/build-source/README.md +0 -9
- package/packages/sdk/src/build-source/bin/lowcode-workspace.mjs +0 -7
- package/packages/sdk/src/build-source/package.json +0 -34
- package/packages/sdk/src/build-source/scripts/build-forms.mjs +0 -1129
- package/packages/sdk/src/build-source/scripts/build-pages.mjs +0 -897
- package/packages/sdk/src/build-source/scripts/build-workspace.mjs +0 -89
- package/packages/sdk/src/build-source/scripts/publish-all.mjs +0 -190
- package/packages/sdk/src/build-source/scripts/publish-oss.mjs +0 -144
- package/packages/sdk/src/build-source/scripts/register-bundle.mjs +0 -1
- package/packages/sdk/src/build-source/scripts/register.mjs +0 -362
- package/packages/sdk/src/build-source/scripts/sync-schema.mjs +0 -381
- package/packages/sdk/src/build-source/scripts/utils/form-api.mjs +0 -1058
- package/packages/sdk/src/build-source/scripts/utils/form-runtime-assets.mjs +0 -57
- package/packages/sdk/src/build-source/scripts/utils/incremental.mjs +0 -348
- package/packages/sdk/src/build-source/scripts/utils/load-config.mjs +0 -331
- package/packages/sdk/src/build-source/scripts/utils/mime-types.mjs +0 -70
- package/packages/sdk/src/build-source/scripts/utils/namespace-css.mjs +0 -77
- package/packages/sdk/src/build-source/scripts/utils/oss-client.mjs +0 -128
- package/packages/sdk/src/build-source/scripts/utils/pages.mjs +0 -150
- package/packages/sdk/src/build-source/scripts/utils/progress.mjs +0 -57
- package/packages/sdk/src/build-source/scripts/utils/publish-oss-patterns.mjs +0 -20
- package/packages/sdk/src/build-source/scripts/utils/register-payload.mjs +0 -90
- package/packages/sdk/src/build-source/scripts/utils/runtime-css-check.mjs +0 -44
- package/packages/sdk/src/build-source/scripts/utils/schema-transform.mjs +0 -142
- package/packages/sdk/src/build-source/scripts/utils/static-assets.mjs +0 -165
- package/packages/sdk/src/build-source/scripts/utils/tailwind-config.mjs +0 -283
- package/packages/sdk/src/build-source/scripts/utils/tailwind-token-warnings.mjs +0 -146
- package/packages/sdk/src/build-source/scripts/utils/workspace-style-entry.mjs +0 -29
- package/packages/sdk/src/build-source/src/cli.mjs +0 -735
- package/policy/openxiangda-policy.json +0 -72
- package/templates/openxiangda-react-spa/.cursor/rules/openxiangda-form.mdc +0 -24
- package/templates/openxiangda-react-spa/.cursor/rules/openxiangda-page.mdc +0 -25
- package/templates/openxiangda-react-spa/.cursor/rules/openxiangda-resources.mdc +0 -32
- package/templates/openxiangda-react-spa/.cursor/rules/openxiangda-workflow-automation.mdc +0 -26
- package/templates/openxiangda-react-spa/.cursor/rules/openxiangda.mdc +0 -68
- package/templates/openxiangda-react-spa/.env.example +0 -4
- package/templates/openxiangda-react-spa/.qoder/rules/openxiangda-form.md +0 -37
- package/templates/openxiangda-react-spa/.qoder/rules/openxiangda-page.md +0 -29
- package/templates/openxiangda-react-spa/.qoder/rules/openxiangda-resources.md +0 -32
- package/templates/openxiangda-react-spa/.qoder/rules/openxiangda-workflow-automation.md +0 -34
- package/templates/openxiangda-react-spa/.qoder/rules/openxiangda.md +0 -66
- package/templates/openxiangda-react-spa/AGENTS.md +0 -192
- package/templates/openxiangda-react-spa/DELIVERY.md +0 -43
- package/templates/openxiangda-react-spa/app-workspace.config.ts +0 -50
- package/templates/openxiangda-react-spa/index.html +0 -12
- package/templates/openxiangda-react-spa/package.json +0 -53
- package/templates/openxiangda-react-spa/postcss.config.cjs +0 -6
- package/templates/openxiangda-react-spa/scripts/build-js-code.mjs +0 -600
- package/templates/openxiangda-react-spa/scripts/deploy.mjs +0 -18
- package/templates/openxiangda-react-spa/scripts/guard-publish.mjs +0 -21
- package/templates/openxiangda-react-spa/src/app/navigation.ts +0 -73
- package/templates/openxiangda-react-spa/src/app/router.tsx +0 -146
- package/templates/openxiangda-react-spa/src/app/starter-content.ts +0 -144
- package/templates/openxiangda-react-spa/src/forms/.gitkeep +0 -1
- package/templates/openxiangda-react-spa/src/layouts/AdminShell.tsx +0 -570
- package/templates/openxiangda-react-spa/src/main.tsx +0 -21
- package/templates/openxiangda-react-spa/src/pages/admin/AdminDashboardPage.tsx +0 -170
- package/templates/openxiangda-react-spa/src/pages/admin/LoginLogPage.tsx +0 -425
- package/templates/openxiangda-react-spa/src/pages/defaults/DataRoutePage.tsx +0 -36
- package/templates/openxiangda-react-spa/src/pages/defaults/FilePreviewRoutePage.tsx +0 -65
- package/templates/openxiangda-react-spa/src/pages/defaults/FormRoutePage.tsx +0 -235
- package/templates/openxiangda-react-spa/src/pages/public/PublicRegisterPage.tsx +0 -15
- package/templates/openxiangda-react-spa/src/pages/states/NotFoundPage.tsx +0 -31
- package/templates/openxiangda-react-spa/src/resources/menus/menus.json +0 -22
- package/templates/openxiangda-react-spa/src/resources/permissions/page-groups/app-admin.json +0 -8
- package/templates/openxiangda-react-spa/src/resources/permissions/page-groups/public-visitor.json +0 -8
- package/templates/openxiangda-react-spa/src/resources/public-access/public-register.json +0 -14
- package/templates/openxiangda-react-spa/src/resources/roles/roles.json +0 -15
- package/templates/openxiangda-react-spa/src/resources/routes/public-register.json +0 -8
- package/templates/openxiangda-react-spa/src/runtime/default-page-overrides.tsx +0 -35
- package/templates/openxiangda-react-spa/src/runtime/default-routes.ts +0 -16
- package/templates/openxiangda-react-spa/src/shared/form-schema.ts +0 -135
- package/templates/openxiangda-react-spa/src/shared/mac-admin.tsx +0 -651
- package/templates/openxiangda-react-spa/src/shared/ui.tsx +0 -22
- package/templates/openxiangda-react-spa/src/styles/index.css +0 -105
- package/templates/openxiangda-react-spa/tailwind.config.cjs +0 -37
- package/templates/openxiangda-react-spa/tsconfig.app.json +0 -36
- package/templates/openxiangda-react-spa/tsconfig.js-code-nodes.json +0 -19
- package/templates/openxiangda-react-spa/tsconfig.json +0 -7
- package/templates/openxiangda-react-spa/tsconfig.node.json +0 -10
- package/templates/openxiangda-react-spa/vite.config.ts +0 -209
- package/templates/sy-lowcode-app-workspace/.cursor/rules/openxiangda-form.mdc +0 -24
- package/templates/sy-lowcode-app-workspace/.cursor/rules/openxiangda-page.mdc +0 -21
- package/templates/sy-lowcode-app-workspace/.cursor/rules/openxiangda-resources.mdc +0 -40
- package/templates/sy-lowcode-app-workspace/.cursor/rules/openxiangda-workflow-automation.mdc +0 -21
- package/templates/sy-lowcode-app-workspace/.cursor/rules/openxiangda.mdc +0 -81
- package/templates/sy-lowcode-app-workspace/.qoder/rules/openxiangda-form.md +0 -38
- package/templates/sy-lowcode-app-workspace/.qoder/rules/openxiangda-page.md +0 -39
- package/templates/sy-lowcode-app-workspace/.qoder/rules/openxiangda-resources.md +0 -59
- package/templates/sy-lowcode-app-workspace/.qoder/rules/openxiangda-workflow-automation.md +0 -46
- package/templates/sy-lowcode-app-workspace/.qoder/rules/openxiangda.md +0 -82
- package/templates/sy-lowcode-app-workspace/AGENTS.md +0 -158
- package/templates/sy-lowcode-app-workspace/DELIVERY.md +0 -43
- package/templates/sy-lowcode-app-workspace/app-workspace.config.ts +0 -51
- package/templates/sy-lowcode-app-workspace/examples/best-practices/README.md +0 -43
- package/templates/sy-lowcode-app-workspace/examples/best-practices/access-governance.md +0 -239
- package/templates/sy-lowcode-app-workspace/examples/best-practices/catalog.json +0 -99
- package/templates/sy-lowcode-app-workspace/examples/best-practices/decision-guide.md +0 -94
- package/templates/sy-lowcode-app-workspace/examples/best-practices/design-style.md +0 -91
- package/templates/sy-lowcode-app-workspace/examples/best-practices/module-structure.md +0 -48
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/domain/role-governance/index.ts +0 -2
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/domain/role-governance/permissions.test.ts +0 -52
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/domain/role-governance/permissions.ts +0 -37
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/domain/role-governance/types.ts +0 -19
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/domain/service-ticket/index.ts +0 -4
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/domain/service-ticket/permissions.test.ts +0 -42
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/domain/service-ticket/permissions.ts +0 -25
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/domain/service-ticket/state-machine.test.ts +0 -63
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/domain/service-ticket/state-machine.ts +0 -73
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/domain/service-ticket/ticket-query.test.ts +0 -34
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/domain/service-ticket/ticket-query.ts +0 -73
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/domain/service-ticket/types.ts +0 -66
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/forms/app-role/page.tsx +0 -1
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/forms/app-role/schema.ts +0 -109
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/forms/customer-profile/page.tsx +0 -1
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/forms/customer-profile/schema.ts +0 -92
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/forms/service-ticket/page.tsx +0 -1
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/forms/service-ticket/schema.ts +0 -153
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/forms/ticket-action-log/page.tsx +0 -1
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/forms/ticket-action-log/schema.ts +0 -65
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/js-code-nodes/daily_ticket_digest/index.ts +0 -44
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/js-code-nodes/sync_roles_to_platform/index.ts +0 -33
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/glass-home-dashboard/App.tsx +0 -8
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/glass-home-dashboard/GlassHomeDashboard.tsx +0 -232
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/glass-home-dashboard/index.tsx +0 -10
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/glass-home-dashboard/page.config.ts +0 -14
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/glass-home-dashboard/styles.css +0 -196
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/interactive-workbench/App.tsx +0 -7
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/interactive-workbench/WorkbenchPage.tsx +0 -36
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/interactive-workbench/components/ConfigPanel.tsx +0 -34
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/interactive-workbench/components/PreviewPanel.tsx +0 -17
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/interactive-workbench/index.tsx +0 -10
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/interactive-workbench/page.config.ts +0 -9
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/interactive-workbench/reducer.ts +0 -29
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/interactive-workbench/styles.css +0 -24
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/mint-analytics-dashboard/App.tsx +0 -8
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/mint-analytics-dashboard/MintAnalyticsDashboard.tsx +0 -279
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/mint-analytics-dashboard/index.tsx +0 -10
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/mint-analytics-dashboard/page.config.ts +0 -14
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/mint-analytics-dashboard/styles.css +0 -163
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/mobile-portal-shell/App.tsx +0 -7
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/mobile-portal-shell/MobilePortalShell.tsx +0 -31
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/mobile-portal-shell/index.tsx +0 -10
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/mobile-portal-shell/modules/MobileHome.tsx +0 -13
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/mobile-portal-shell/page.config.ts +0 -14
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/mobile-portal-shell/routes.ts +0 -13
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/mobile-portal-shell/styles.css +0 -11
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/ops-monitor-dashboard/App.tsx +0 -8
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/ops-monitor-dashboard/OpsMonitorDashboard.tsx +0 -306
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/ops-monitor-dashboard/index.tsx +0 -10
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/ops-monitor-dashboard/page.config.ts +0 -14
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/ops-monitor-dashboard/styles.css +0 -248
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/pc-portal-shell/App.tsx +0 -7
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/pc-portal-shell/PcPortalShell.tsx +0 -35
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/pc-portal-shell/components/PortalMetric.tsx +0 -11
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/pc-portal-shell/index.tsx +0 -10
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/pc-portal-shell/modules/HomeModule.tsx +0 -25
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/pc-portal-shell/modules/TicketsModule.tsx +0 -14
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/pc-portal-shell/page.config.ts +0 -14
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/pc-portal-shell/routes.ts +0 -19
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/pc-portal-shell/styles.css +0 -35
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/service-ticket-ops/App.tsx +0 -7
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/service-ticket-ops/TicketOpsPage.tsx +0 -105
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/service-ticket-ops/components/TicketActionTimeline.tsx +0 -22
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/service-ticket-ops/components/TicketDetailDrawer.tsx +0 -44
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/service-ticket-ops/components/TicketTableActions.tsx +0 -57
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/service-ticket-ops/index.tsx +0 -10
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/service-ticket-ops/page.config.ts +0 -9
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/service-ticket-ops/styles.css +0 -35
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/work-order-list-drawer/App.tsx +0 -8
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/work-order-list-drawer/WorkOrderListDrawerPage.tsx +0 -371
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/work-order-list-drawer/index.tsx +0 -10
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/work-order-list-drawer/page.config.ts +0 -14
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/work-order-list-drawer/styles.css +0 -182
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/resources/automations/daily-ticket-digest/automation.json +0 -25
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/resources/automations/daily-ticket-digest/trigger.json +0 -9
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/resources/notifications/daily-ticket-digest.json +0 -24
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/resources/permissions/form-groups/service-ticket-college.json +0 -21
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/resources/permissions/roles.json +0 -17
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/resources/workflows/expense-approval-workflow.json +0 -48
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/shared/components/ConfirmAction.tsx +0 -22
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/shared/components/QueryState.tsx +0 -37
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/shared/components/StatusTag.tsx +0 -20
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/shared/components/admin-ui-templates/DashboardPrimitives.tsx +0 -832
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/shared/components/admin-ui-templates/chartOptions.ts +0 -140
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/shared/components/admin-ui-templates/sampleData.ts +0 -466
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/shared/components/admin-ui-templates/styles.css +0 -874
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/shared/components/admin-ui-templates/types.ts +0 -150
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/shared/hooks/useTicketOps.ts +0 -96
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/shared/services/role-governance.ts +0 -48
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/shared/services/service-ticket.ts +0 -113
- package/templates/sy-lowcode-app-workspace/examples/forms/customer/page.tsx +0 -1
- package/templates/sy-lowcode-app-workspace/examples/forms/customer/schema.ts +0 -36
- package/templates/sy-lowcode-app-workspace/index.html +0 -12
- package/templates/sy-lowcode-app-workspace/package.json +0 -58
- package/templates/sy-lowcode-app-workspace/postcss.config.cjs +0 -9
- package/templates/sy-lowcode-app-workspace/scripts/build-js-code.mjs +0 -600
- package/templates/sy-lowcode-app-workspace/scripts/guard-publish.mjs +0 -29
- package/templates/sy-lowcode-app-workspace/src/dev/App.tsx +0 -820
- package/templates/sy-lowcode-app-workspace/src/forms/.gitkeep +0 -1
- package/templates/sy-lowcode-app-workspace/src/forms/README.md +0 -52
- package/templates/sy-lowcode-app-workspace/src/index.css +0 -26
- package/templates/sy-lowcode-app-workspace/src/js-code-nodes/.gitkeep +0 -1
- package/templates/sy-lowcode-app-workspace/src/js-code-nodes/types.d.ts +0 -3
- package/templates/sy-lowcode-app-workspace/src/main.tsx +0 -29
- package/templates/sy-lowcode-app-workspace/src/pages/.gitkeep +0 -1
- package/templates/sy-lowcode-app-workspace/src/runtime/builtin-overrides.tsx +0 -8
- package/templates/sy-lowcode-app-workspace/src/shared/form-schema.ts +0 -135
- package/templates/sy-lowcode-app-workspace/src/types/app-workspace.types.ts +0 -88
- package/templates/sy-lowcode-app-workspace/tailwind.config.cjs +0 -31
- package/templates/sy-lowcode-app-workspace/tsconfig.app.json +0 -40
- package/templates/sy-lowcode-app-workspace/tsconfig.examples.json +0 -24
- package/templates/sy-lowcode-app-workspace/tsconfig.js-code-nodes.json +0 -19
- package/templates/sy-lowcode-app-workspace/tsconfig.json +0 -7
- package/templates/sy-lowcode-app-workspace/tsconfig.node.json +0 -10
- package/templates/sy-lowcode-app-workspace/vite.config.ts +0 -85
- package/v2/README.md +0 -35
- package/v2/skills/manifest.json +0 -45
- package/v2/skills/openxiangda-v1-maintenance/SKILL.md +0 -21
- package/v2/skills/openxiangda-v1-maintenance/agents/openai.yaml +0 -4
- package/v2/skills/openxiangda-v2/SKILL.md +0 -38
- package/v2/skills/openxiangda-v2-architecture/SKILL.md +0 -29
- package/v2/skills/openxiangda-v2-architecture/agents/openai.yaml +0 -4
- package/v2/skills/openxiangda-v2-backend/SKILL.md +0 -28
- package/v2/skills/openxiangda-v2-backend/agents/openai.yaml +0 -4
- package/v2/skills/openxiangda-v2-data-authz/SKILL.md +0 -28
- package/v2/skills/openxiangda-v2-data-authz/agents/openai.yaml +0 -4
- package/v2/skills/openxiangda-v2-delivery/SKILL.md +0 -30
- package/v2/skills/openxiangda-v2-delivery/agents/openai.yaml +0 -4
- package/v2/skills/openxiangda-v2-frontend/SKILL.md +0 -21
- package/v2/skills/openxiangda-v2-frontend/agents/openai.yaml +0 -4
- package/v2/skills/openxiangda-v2-workflow-events/SKILL.md +0 -28
- package/v2/skills/openxiangda-v2-workflow-events/agents/openai.yaml +0 -4
- /package/{v2/skills → skills}/openxiangda-v2/agents/openai.yaml +0 -0
|
@@ -1,570 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ChevronDown,
|
|
3
|
-
ChevronLeft,
|
|
4
|
-
ChevronRight,
|
|
5
|
-
LogOut,
|
|
6
|
-
Menu,
|
|
7
|
-
RefreshCw,
|
|
8
|
-
Shield,
|
|
9
|
-
X,
|
|
10
|
-
} from "lucide-react";
|
|
11
|
-
import { createContext, useContext, useEffect, useMemo, useState } from "react";
|
|
12
|
-
import { Link, Outlet, useLocation, useParams } from "react-router-dom";
|
|
13
|
-
import {
|
|
14
|
-
PermissionBoundary,
|
|
15
|
-
useAppMenus,
|
|
16
|
-
useRuntimeAuth,
|
|
17
|
-
useRuntimeBootstrap,
|
|
18
|
-
type PermissionBoundaryFallbackState,
|
|
19
|
-
} from "openxiangda/runtime/react";
|
|
20
|
-
|
|
21
|
-
import {
|
|
22
|
-
buildStarterAdminNavigation,
|
|
23
|
-
filterNavigationByMenuCodes,
|
|
24
|
-
type StarterNavigationGroup,
|
|
25
|
-
} from "@/app/navigation";
|
|
26
|
-
import { starterBrand } from "@/app/starter-content";
|
|
27
|
-
import {
|
|
28
|
-
PrimaryButton,
|
|
29
|
-
SecondaryButton,
|
|
30
|
-
StatePage,
|
|
31
|
-
cn,
|
|
32
|
-
} from "@/shared/ui";
|
|
33
|
-
|
|
34
|
-
type PlatformMenuLike = {
|
|
35
|
-
children?: PlatformMenuLike[];
|
|
36
|
-
code?: string | null;
|
|
37
|
-
formUuid?: string | null;
|
|
38
|
-
isHidden?: boolean | null;
|
|
39
|
-
resourceCode?: string | null;
|
|
40
|
-
routeCode?: string | null;
|
|
41
|
-
type?: string | null;
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
type AdminPageMeta = {
|
|
45
|
-
breadcrumbs?: string[];
|
|
46
|
-
title?: string;
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
type NavigationState = {
|
|
50
|
-
activePath?: string;
|
|
51
|
-
breadcrumbs: string[];
|
|
52
|
-
title: string;
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
const AdminPageMetaContext = createContext<((meta: AdminPageMeta | null) => void) | null>(null);
|
|
56
|
-
const noopSetAdminPageMeta = () => undefined;
|
|
57
|
-
|
|
58
|
-
export function useAdminPageMetaController() {
|
|
59
|
-
return useContext(AdminPageMetaContext) ?? noopSetAdminPageMeta;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export function AdminShell() {
|
|
63
|
-
const { appType = "" } = useParams();
|
|
64
|
-
const location = useLocation();
|
|
65
|
-
const bootstrap = useRuntimeBootstrap();
|
|
66
|
-
const menus = useAppMenus();
|
|
67
|
-
const auth = useRuntimeAuth();
|
|
68
|
-
const [collapsedGroups, setCollapsedGroups] = useState<Record<string, boolean>>({});
|
|
69
|
-
const [mobileOpen, setMobileOpen] = useState(false);
|
|
70
|
-
const [sidebarCollapsed, setSidebarCollapsed] = useState(false);
|
|
71
|
-
const [userMenuOpen, setUserMenuOpen] = useState(false);
|
|
72
|
-
const [loggingOut, setLoggingOut] = useState(false);
|
|
73
|
-
const [pageMeta, setPageMeta] = useState<AdminPageMeta | null>(null);
|
|
74
|
-
|
|
75
|
-
const userName = String(
|
|
76
|
-
bootstrap.data?.user?.name ||
|
|
77
|
-
bootstrap.data?.user?.nickName ||
|
|
78
|
-
bootstrap.data?.user?.id ||
|
|
79
|
-
"当前用户",
|
|
80
|
-
);
|
|
81
|
-
const userAvatar = String(
|
|
82
|
-
bootstrap.data?.user?.avatar ||
|
|
83
|
-
bootstrap.data?.user?.avatarUrl ||
|
|
84
|
-
bootstrap.data?.user?.photoUrl ||
|
|
85
|
-
"",
|
|
86
|
-
);
|
|
87
|
-
const userRole = String(
|
|
88
|
-
bootstrap.data?.user?.roleName ||
|
|
89
|
-
bootstrap.data?.user?.title ||
|
|
90
|
-
bootstrap.data?.user?.position ||
|
|
91
|
-
bootstrap.data?.user?.departmentName ||
|
|
92
|
-
"平台用户",
|
|
93
|
-
);
|
|
94
|
-
|
|
95
|
-
const menuCodes = useMemo(() => collectMenuCodes(menus.data), [menus.data]);
|
|
96
|
-
const groups = useMemo<StarterNavigationGroup[]>(
|
|
97
|
-
() =>
|
|
98
|
-
filterNavigationByMenuCodes(
|
|
99
|
-
buildStarterAdminNavigation({
|
|
100
|
-
appType,
|
|
101
|
-
}),
|
|
102
|
-
menuCodes,
|
|
103
|
-
),
|
|
104
|
-
[appType, menuCodes],
|
|
105
|
-
);
|
|
106
|
-
const navigationState = useMemo(
|
|
107
|
-
() => resolveNavigationState(groups, location.pathname, location.search, appType),
|
|
108
|
-
[appType, groups, location.pathname, location.search],
|
|
109
|
-
);
|
|
110
|
-
const headerTitle = pageMeta?.title || navigationState.title || starterBrand.fallbackName;
|
|
111
|
-
const breadcrumbs =
|
|
112
|
-
pageMeta?.breadcrumbs && pageMeta.breadcrumbs.length > 0
|
|
113
|
-
? pageMeta.breadcrumbs
|
|
114
|
-
: navigationState.breadcrumbs;
|
|
115
|
-
|
|
116
|
-
const handleLogout = async () => {
|
|
117
|
-
setLoggingOut(true);
|
|
118
|
-
await auth.logoutAndRedirect({ replace: true });
|
|
119
|
-
};
|
|
120
|
-
|
|
121
|
-
const sidebar = (compact = false) => (
|
|
122
|
-
<aside className="flex h-full min-h-0 flex-col border-r border-slate-200 bg-white">
|
|
123
|
-
<div className={cn("flex h-[68px] shrink-0 items-center gap-3", compact ? "justify-center px-3" : "px-5")}>
|
|
124
|
-
<Link
|
|
125
|
-
aria-label={starterBrand.name}
|
|
126
|
-
className="grid h-9 w-9 shrink-0 place-items-center text-blue-600"
|
|
127
|
-
to={`/view/${appType}/admin`}
|
|
128
|
-
>
|
|
129
|
-
<OpenXiangdaMark />
|
|
130
|
-
</Link>
|
|
131
|
-
<div className={cn("min-w-0", compact && "hidden")}>
|
|
132
|
-
<Link className="block truncate text-[15px] font-semibold leading-5 text-slate-950" to={`/view/${appType}/admin`}>
|
|
133
|
-
{starterBrand.name}
|
|
134
|
-
</Link>
|
|
135
|
-
<div className="mt-0.5 truncate text-xs leading-4 text-slate-500">{starterBrand.subtitle}</div>
|
|
136
|
-
</div>
|
|
137
|
-
</div>
|
|
138
|
-
|
|
139
|
-
<nav className={cn("ox-scrollbar min-h-0 flex-1 overflow-y-auto py-3", compact ? "px-2" : "space-y-2 px-2.5")}>
|
|
140
|
-
{groups.map(group => {
|
|
141
|
-
const collapsed = collapsedGroups[group.title];
|
|
142
|
-
const groupActive = group.items.some(item => navigationState.activePath === item.path);
|
|
143
|
-
const GroupIcon = group.icon;
|
|
144
|
-
return (
|
|
145
|
-
<section className="min-w-0" key={group.title}>
|
|
146
|
-
<button
|
|
147
|
-
aria-label={group.title}
|
|
148
|
-
aria-expanded={!collapsed}
|
|
149
|
-
className={cn(
|
|
150
|
-
"flex h-9 w-full items-center rounded-xl text-[12px] font-semibold text-slate-700 transition hover:bg-slate-50 hover:text-slate-950",
|
|
151
|
-
compact ? "justify-center px-0" : "justify-between gap-2 px-2.5",
|
|
152
|
-
groupActive && "bg-slate-50 text-slate-950",
|
|
153
|
-
)}
|
|
154
|
-
onClick={() => setCollapsedGroups(prev => ({ ...prev, [group.title]: !collapsed }))}
|
|
155
|
-
type="button"
|
|
156
|
-
>
|
|
157
|
-
<span className={cn("flex min-w-0 items-center gap-2", compact && "justify-center")}>
|
|
158
|
-
<GroupIcon
|
|
159
|
-
className={cn(groupActive ? "text-blue-600" : "text-slate-500")}
|
|
160
|
-
size={15}
|
|
161
|
-
strokeWidth={2}
|
|
162
|
-
/>
|
|
163
|
-
<span className={cn("truncate", compact && "sr-only")}>{group.title}</span>
|
|
164
|
-
</span>
|
|
165
|
-
{compact ? (
|
|
166
|
-
null
|
|
167
|
-
) : (
|
|
168
|
-
<ChevronDown
|
|
169
|
-
className={cn(
|
|
170
|
-
"shrink-0 text-slate-500 transition-transform duration-200 ease-out motion-reduce:transition-none",
|
|
171
|
-
collapsed && "-rotate-90",
|
|
172
|
-
)}
|
|
173
|
-
size={15}
|
|
174
|
-
strokeWidth={2}
|
|
175
|
-
/>
|
|
176
|
-
)}
|
|
177
|
-
</button>
|
|
178
|
-
<div
|
|
179
|
-
className={cn(
|
|
180
|
-
"grid transition-[grid-template-rows,opacity] duration-200 ease-out motion-reduce:transition-none",
|
|
181
|
-
collapsed ? "grid-rows-[0fr] opacity-0" : "grid-rows-[1fr] opacity-100",
|
|
182
|
-
)}
|
|
183
|
-
>
|
|
184
|
-
<div className={cn("min-h-0 overflow-hidden", collapsed && "pointer-events-none")}>
|
|
185
|
-
<div className={cn("mt-1 space-y-0.5", compact && "mt-1")}>
|
|
186
|
-
{group.items.map(item => {
|
|
187
|
-
const active = navigationState.activePath === item.path;
|
|
188
|
-
return (
|
|
189
|
-
<Link
|
|
190
|
-
aria-label={item.name}
|
|
191
|
-
className={cn(
|
|
192
|
-
"group relative flex h-9 items-center rounded-xl text-sm transition",
|
|
193
|
-
compact ? "justify-center px-0" : "gap-2.5 pl-7 pr-3",
|
|
194
|
-
active
|
|
195
|
-
? "bg-[#eef6ff] text-[#1677ff]"
|
|
196
|
-
: "text-slate-600 hover:bg-slate-50 hover:text-slate-900",
|
|
197
|
-
)}
|
|
198
|
-
key={`${group.title}-${item.name}-${item.path}`}
|
|
199
|
-
onClick={() => setMobileOpen(false)}
|
|
200
|
-
to={item.path}
|
|
201
|
-
>
|
|
202
|
-
<span
|
|
203
|
-
className={cn(
|
|
204
|
-
"absolute -left-2.5 top-1 h-7 w-1 rounded-r-full transition",
|
|
205
|
-
active ? "bg-[#1677ff]" : "bg-transparent",
|
|
206
|
-
compact && "-left-2",
|
|
207
|
-
)}
|
|
208
|
-
/>
|
|
209
|
-
<span
|
|
210
|
-
className={cn(
|
|
211
|
-
"grid h-5 w-5 shrink-0 place-items-center transition",
|
|
212
|
-
active ? "text-[#1677ff]" : "text-slate-500 group-hover:text-slate-700",
|
|
213
|
-
)}
|
|
214
|
-
>
|
|
215
|
-
<item.icon size={16} strokeWidth={2} />
|
|
216
|
-
</span>
|
|
217
|
-
<span className={cn("min-w-0 flex-1 truncate font-medium", compact && "sr-only")}>{item.name}</span>
|
|
218
|
-
</Link>
|
|
219
|
-
);
|
|
220
|
-
})}
|
|
221
|
-
</div>
|
|
222
|
-
</div>
|
|
223
|
-
</div>
|
|
224
|
-
</section>
|
|
225
|
-
);
|
|
226
|
-
})}
|
|
227
|
-
</nav>
|
|
228
|
-
<div className="shrink-0 px-3 py-4">
|
|
229
|
-
<button
|
|
230
|
-
className={cn(
|
|
231
|
-
"flex h-10 w-full items-center gap-3 rounded-lg text-sm font-medium text-slate-600 transition hover:bg-slate-50 hover:text-slate-950",
|
|
232
|
-
compact ? "justify-center px-0" : "px-2.5",
|
|
233
|
-
)}
|
|
234
|
-
onClick={() => setSidebarCollapsed(value => !value)}
|
|
235
|
-
type="button"
|
|
236
|
-
>
|
|
237
|
-
<span className="grid h-7 w-7 shrink-0 place-items-center rounded-lg bg-slate-50 text-slate-600 ring-1 ring-slate-200">
|
|
238
|
-
{compact ? <ChevronRight size={17} /> : <ChevronLeft size={17} />}
|
|
239
|
-
</span>
|
|
240
|
-
<span className={cn("truncate", compact && "sr-only")}>{compact ? "展开侧边栏" : "收起侧边栏"}</span>
|
|
241
|
-
</button>
|
|
242
|
-
</div>
|
|
243
|
-
</aside>
|
|
244
|
-
);
|
|
245
|
-
|
|
246
|
-
return (
|
|
247
|
-
<PermissionBoundary
|
|
248
|
-
fallback={state => <AdminPermissionState state={state} />}
|
|
249
|
-
loadingFallback={<AdminLoadingState />}
|
|
250
|
-
menuCode="admin_dashboard"
|
|
251
|
-
path={`/view/${appType}/admin`}
|
|
252
|
-
routeCode="admin.dashboard"
|
|
253
|
-
>
|
|
254
|
-
<div className="min-h-screen overflow-x-hidden bg-[linear-gradient(180deg,#edf4ff_0%,#f8fafc_42%,#f1f5f9_100%)] text-slate-950">
|
|
255
|
-
<div className={cn("fixed inset-y-0 left-0 z-30 hidden lg:block", sidebarCollapsed ? "w-[76px]" : "w-60")}>
|
|
256
|
-
{sidebar(sidebarCollapsed)}
|
|
257
|
-
</div>
|
|
258
|
-
|
|
259
|
-
{mobileOpen ? (
|
|
260
|
-
<div className="fixed inset-0 z-40 lg:hidden">
|
|
261
|
-
<button
|
|
262
|
-
aria-label="关闭导航遮罩"
|
|
263
|
-
className="absolute inset-0 bg-slate-950/35"
|
|
264
|
-
onClick={() => setMobileOpen(false)}
|
|
265
|
-
type="button"
|
|
266
|
-
/>
|
|
267
|
-
<div className="relative h-full w-[min(22rem,88vw)]">
|
|
268
|
-
<button
|
|
269
|
-
aria-label="关闭导航"
|
|
270
|
-
className="absolute right-3 top-3 z-50 grid h-10 w-10 place-items-center rounded-xl bg-slate-100 text-slate-700 shadow-sm ring-1 ring-slate-200"
|
|
271
|
-
onClick={() => setMobileOpen(false)}
|
|
272
|
-
type="button"
|
|
273
|
-
>
|
|
274
|
-
<X size={19} />
|
|
275
|
-
</button>
|
|
276
|
-
{sidebar(false)}
|
|
277
|
-
</div>
|
|
278
|
-
</div>
|
|
279
|
-
) : null}
|
|
280
|
-
|
|
281
|
-
<main className={cn("min-w-0 transition-[padding] duration-200", sidebarCollapsed ? "lg:pl-[76px]" : "lg:pl-60")}>
|
|
282
|
-
<header className="sticky top-0 z-20 border-b border-white/70 bg-white/[0.8] backdrop-blur-xl">
|
|
283
|
-
<div className="flex h-20 min-w-0 items-center justify-between gap-3 px-4 sm:px-6">
|
|
284
|
-
<div className="flex min-w-0 items-center gap-3">
|
|
285
|
-
<button
|
|
286
|
-
aria-label="打开导航"
|
|
287
|
-
className="grid h-10 w-10 shrink-0 place-items-center rounded-xl bg-slate-100 text-slate-700 lg:hidden"
|
|
288
|
-
onClick={() => setMobileOpen(true)}
|
|
289
|
-
type="button"
|
|
290
|
-
>
|
|
291
|
-
<Menu size={20} />
|
|
292
|
-
</button>
|
|
293
|
-
<div className="min-w-0">
|
|
294
|
-
<div className="truncate text-xs font-medium text-slate-500">
|
|
295
|
-
{breadcrumbs.join(" / ")}
|
|
296
|
-
</div>
|
|
297
|
-
<div className="mt-1 truncate text-lg font-semibold text-slate-950">{headerTitle}</div>
|
|
298
|
-
</div>
|
|
299
|
-
</div>
|
|
300
|
-
|
|
301
|
-
<div className="flex shrink-0 items-center">
|
|
302
|
-
<div className="relative">
|
|
303
|
-
<button
|
|
304
|
-
className="flex h-12 items-center gap-3 rounded-2xl px-2 py-1.5 text-left transition hover:bg-white/80"
|
|
305
|
-
onClick={() => setUserMenuOpen(open => !open)}
|
|
306
|
-
type="button"
|
|
307
|
-
>
|
|
308
|
-
<UserAvatar name={userName} src={userAvatar} />
|
|
309
|
-
<span className="hidden min-w-0 sm:block">
|
|
310
|
-
<span className="block max-w-28 truncate text-sm font-semibold leading-5 text-slate-950">{userName}</span>
|
|
311
|
-
<span className="block max-w-28 truncate text-xs leading-4 text-slate-500">{userRole}</span>
|
|
312
|
-
</span>
|
|
313
|
-
<ChevronDown className="text-slate-500" size={16} />
|
|
314
|
-
</button>
|
|
315
|
-
{userMenuOpen ? (
|
|
316
|
-
<div className="absolute right-0 mt-3 w-72 overflow-hidden rounded-2xl border border-slate-200 bg-white p-2 shadow-[0_24px_70px_rgba(15,23,42,0.16)]">
|
|
317
|
-
<div className="flex items-center gap-3 rounded-xl bg-slate-50 p-3">
|
|
318
|
-
<UserAvatar name={userName} src={userAvatar} size="lg" />
|
|
319
|
-
<div className="min-w-0">
|
|
320
|
-
<div className="truncate text-sm font-semibold text-slate-950">{userName}</div>
|
|
321
|
-
<div className="mt-0.5 truncate text-xs text-slate-500">{userRole}</div>
|
|
322
|
-
</div>
|
|
323
|
-
</div>
|
|
324
|
-
<button
|
|
325
|
-
className="mt-2 flex w-full items-center gap-2 rounded-xl px-3 py-2 text-left text-sm text-slate-600 transition hover:bg-slate-50"
|
|
326
|
-
onClick={() => {
|
|
327
|
-
setUserMenuOpen(false);
|
|
328
|
-
void bootstrap.reload();
|
|
329
|
-
}}
|
|
330
|
-
type="button"
|
|
331
|
-
>
|
|
332
|
-
<RefreshCw size={17} />
|
|
333
|
-
刷新数据
|
|
334
|
-
</button>
|
|
335
|
-
<button
|
|
336
|
-
className="flex w-full items-center gap-2 rounded-xl px-3 py-2 text-left text-sm text-rose-600 transition hover:bg-rose-50"
|
|
337
|
-
disabled={loggingOut}
|
|
338
|
-
onClick={() => void handleLogout()}
|
|
339
|
-
type="button"
|
|
340
|
-
>
|
|
341
|
-
<LogOut size={17} />
|
|
342
|
-
{loggingOut ? "正在退出" : "退出登录"}
|
|
343
|
-
</button>
|
|
344
|
-
</div>
|
|
345
|
-
) : null}
|
|
346
|
-
</div>
|
|
347
|
-
</div>
|
|
348
|
-
</div>
|
|
349
|
-
</header>
|
|
350
|
-
|
|
351
|
-
<AdminPageMetaContext.Provider value={setPageMeta}>
|
|
352
|
-
<div className="ox-admin-content mx-auto min-w-0 max-w-[1440px] px-4 py-5 sm:px-6">
|
|
353
|
-
<Outlet />
|
|
354
|
-
</div>
|
|
355
|
-
</AdminPageMetaContext.Provider>
|
|
356
|
-
</main>
|
|
357
|
-
</div>
|
|
358
|
-
</PermissionBoundary>
|
|
359
|
-
);
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
function UserAvatar({
|
|
363
|
-
name,
|
|
364
|
-
size = "md",
|
|
365
|
-
src,
|
|
366
|
-
}: {
|
|
367
|
-
name: string;
|
|
368
|
-
size?: "md" | "lg";
|
|
369
|
-
src?: string;
|
|
370
|
-
}) {
|
|
371
|
-
const className = cn(
|
|
372
|
-
"shrink-0 overflow-hidden rounded-full bg-[linear-gradient(135deg,#2563eb_0%,#38bdf8_100%)] text-white shadow-sm ring-2 ring-white",
|
|
373
|
-
size === "lg" ? "h-11 w-11" : "h-9 w-9",
|
|
374
|
-
);
|
|
375
|
-
|
|
376
|
-
if (src) {
|
|
377
|
-
return (
|
|
378
|
-
<img
|
|
379
|
-
alt=""
|
|
380
|
-
className={cn(className, "object-cover")}
|
|
381
|
-
referrerPolicy="no-referrer"
|
|
382
|
-
src={src}
|
|
383
|
-
/>
|
|
384
|
-
);
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
return (
|
|
388
|
-
<span className={cn(className, "grid place-items-center text-sm font-semibold")}>
|
|
389
|
-
{name.slice(0, 1).toUpperCase()}
|
|
390
|
-
</span>
|
|
391
|
-
);
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
function OpenXiangdaMark() {
|
|
395
|
-
return (
|
|
396
|
-
<svg
|
|
397
|
-
aria-hidden="true"
|
|
398
|
-
className="h-8 w-8"
|
|
399
|
-
fill="none"
|
|
400
|
-
viewBox="0 0 36 36"
|
|
401
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
402
|
-
>
|
|
403
|
-
<path
|
|
404
|
-
d="M18 3.5 32.5 31H26L18 15.7 10 31H3.5L18 3.5Z"
|
|
405
|
-
fill="currentColor"
|
|
406
|
-
/>
|
|
407
|
-
<path d="M18 20.2 23.4 31H12.6L18 20.2Z" fill="white" />
|
|
408
|
-
<path
|
|
409
|
-
d="M18 9.5 8.2 31H3.5L18 3.5l14.5 27.5h-4.7L18 9.5Z"
|
|
410
|
-
fill="currentColor"
|
|
411
|
-
opacity="0.86"
|
|
412
|
-
/>
|
|
413
|
-
</svg>
|
|
414
|
-
);
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
function AdminPermissionState({ state }: { state: PermissionBoundaryFallbackState }) {
|
|
418
|
-
const auth = useRuntimeAuth();
|
|
419
|
-
|
|
420
|
-
useEffect(() => {
|
|
421
|
-
if (state.errorType === "unauthenticated") {
|
|
422
|
-
void auth.redirectToLogin({ replace: true });
|
|
423
|
-
}
|
|
424
|
-
}, [auth, state.errorType]);
|
|
425
|
-
|
|
426
|
-
if (state.errorType === "unauthenticated") {
|
|
427
|
-
return (
|
|
428
|
-
<StatePage
|
|
429
|
-
actions={
|
|
430
|
-
<PrimaryButton onClick={() => void auth.redirectToLogin({ replace: true })}>
|
|
431
|
-
立即登录
|
|
432
|
-
</PrimaryButton>
|
|
433
|
-
}
|
|
434
|
-
description="当前浏览器没有有效登录态,正在为你跳转到登录页。"
|
|
435
|
-
fullScreen
|
|
436
|
-
icon={<LogOut size={24} />}
|
|
437
|
-
status="401"
|
|
438
|
-
title="需要登录"
|
|
439
|
-
/>
|
|
440
|
-
);
|
|
441
|
-
}
|
|
442
|
-
|
|
443
|
-
return (
|
|
444
|
-
<StatePage
|
|
445
|
-
actions={
|
|
446
|
-
<>
|
|
447
|
-
<SecondaryButton onClick={() => window.history.back()}>返回上一页</SecondaryButton>
|
|
448
|
-
<PrimaryButton onClick={() => void auth.redirectToLogin({ replace: true })}>
|
|
449
|
-
切换账号
|
|
450
|
-
</PrimaryButton>
|
|
451
|
-
</>
|
|
452
|
-
}
|
|
453
|
-
description={state.message || "请切换到有权限的账号,或联系管理员开通后台访问权限。"}
|
|
454
|
-
fullScreen
|
|
455
|
-
icon={<Shield size={24} />}
|
|
456
|
-
status="403"
|
|
457
|
-
title="无权访问管理后台"
|
|
458
|
-
/>
|
|
459
|
-
);
|
|
460
|
-
}
|
|
461
|
-
|
|
462
|
-
function AdminLoadingState() {
|
|
463
|
-
return (
|
|
464
|
-
<StatePage
|
|
465
|
-
description="正在读取应用、用户和页面权限信息。"
|
|
466
|
-
fullScreen
|
|
467
|
-
icon={<Shield size={24} />}
|
|
468
|
-
status="LOADING"
|
|
469
|
-
title="正在进入应用"
|
|
470
|
-
/>
|
|
471
|
-
);
|
|
472
|
-
}
|
|
473
|
-
|
|
474
|
-
function collectMenuCodes(items: PlatformMenuLike[]): Set<string> {
|
|
475
|
-
const codes = new Set<string>();
|
|
476
|
-
const visit = (item: PlatformMenuLike) => {
|
|
477
|
-
if (item.isHidden) return;
|
|
478
|
-
for (const value of [item.code, item.resourceCode, item.routeCode]) {
|
|
479
|
-
if (value) codes.add(String(value));
|
|
480
|
-
}
|
|
481
|
-
for (const child of item.children || []) visit(child);
|
|
482
|
-
};
|
|
483
|
-
for (const item of items) visit(item);
|
|
484
|
-
return codes;
|
|
485
|
-
}
|
|
486
|
-
|
|
487
|
-
function isMenuActive(pathname: string, search: string, target: string) {
|
|
488
|
-
const normalize = (value: string) =>
|
|
489
|
-
value
|
|
490
|
-
.replace(/[?#].*$/, "")
|
|
491
|
-
.replace(/\/+$/, "")
|
|
492
|
-
.replace(/\/{2,}/g, "/");
|
|
493
|
-
if (target.includes("?")) return `${pathname}${search}` === target;
|
|
494
|
-
return normalize(pathname) === normalize(target);
|
|
495
|
-
}
|
|
496
|
-
|
|
497
|
-
function resolveNavigationState(
|
|
498
|
-
groups: StarterNavigationGroup[],
|
|
499
|
-
pathname: string,
|
|
500
|
-
search: string,
|
|
501
|
-
appType: string,
|
|
502
|
-
): NavigationState {
|
|
503
|
-
const fallback: NavigationState = {
|
|
504
|
-
breadcrumbs: ["首页"],
|
|
505
|
-
title: starterBrand.fallbackName,
|
|
506
|
-
};
|
|
507
|
-
const entries = groups.flatMap(group => group.items.map(item => ({ group, item })));
|
|
508
|
-
const exact = entries.find(({ item }) => isMenuActive(pathname, search, item.path));
|
|
509
|
-
if (exact) {
|
|
510
|
-
return {
|
|
511
|
-
activePath: exact.item.path,
|
|
512
|
-
breadcrumbs: ["首页", exact.group.title, exact.item.name],
|
|
513
|
-
title: exact.item.name,
|
|
514
|
-
};
|
|
515
|
-
}
|
|
516
|
-
|
|
517
|
-
const route = parseAdminRoute(pathname, appType);
|
|
518
|
-
if (!route) return fallback;
|
|
519
|
-
|
|
520
|
-
const related = findRelatedNavigationEntry(entries, route);
|
|
521
|
-
if (related) {
|
|
522
|
-
const title =
|
|
523
|
-
route.kind === "form-detail" || route.kind === "process-detail"
|
|
524
|
-
? `${related.item.name}详情`
|
|
525
|
-
: related.item.name;
|
|
526
|
-
return {
|
|
527
|
-
activePath: related.item.path,
|
|
528
|
-
breadcrumbs: ["首页", related.group.title, related.item.name],
|
|
529
|
-
title,
|
|
530
|
-
};
|
|
531
|
-
}
|
|
532
|
-
|
|
533
|
-
if (route.kind === "data") {
|
|
534
|
-
return { breadcrumbs: ["首页", "数据管理"], title: "业务数据" };
|
|
535
|
-
}
|
|
536
|
-
if (route.kind === "form-new") {
|
|
537
|
-
return { breadcrumbs: ["首页", "业务办理"], title: "发起申请" };
|
|
538
|
-
}
|
|
539
|
-
if (route.kind === "form-detail") {
|
|
540
|
-
return { breadcrumbs: ["首页", "业务记录"], title: "记录详情" };
|
|
541
|
-
}
|
|
542
|
-
return { breadcrumbs: ["首页", "流程办理"], title: "流程详情" };
|
|
543
|
-
}
|
|
544
|
-
|
|
545
|
-
function parseAdminRoute(pathname: string, appType: string) {
|
|
546
|
-
const escapedAppType = appType.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
547
|
-
const prefix = new RegExp(`^/view/${escapedAppType}/admin/`);
|
|
548
|
-
if (!prefix.test(pathname)) return null;
|
|
549
|
-
const rest = pathname.replace(prefix, "");
|
|
550
|
-
const [kind, formUuid, tail] = rest.split("/");
|
|
551
|
-
if (kind === "data" && formUuid) return { formUuid, kind: "data" as const };
|
|
552
|
-
if (kind === "forms" && formUuid && tail === "new") return { formUuid, kind: "form-new" as const };
|
|
553
|
-
if (kind === "forms" && formUuid) return { formUuid, kind: "form-detail" as const };
|
|
554
|
-
if (kind === "process" && formUuid) return { formUuid, kind: "process-detail" as const };
|
|
555
|
-
return null;
|
|
556
|
-
}
|
|
557
|
-
|
|
558
|
-
function findRelatedNavigationEntry(
|
|
559
|
-
entries: Array<{ group: StarterNavigationGroup; item: StarterNavigationGroup["items"][number] }>,
|
|
560
|
-
route: NonNullable<ReturnType<typeof parseAdminRoute>>,
|
|
561
|
-
) {
|
|
562
|
-
const formPathNeedle = `/forms/${route.formUuid}/new`;
|
|
563
|
-
const dataPathNeedle = `/data/${route.formUuid}`;
|
|
564
|
-
if (route.kind === "data") return entries.find(({ item }) => item.path.includes(dataPathNeedle));
|
|
565
|
-
if (route.kind === "form-new") return entries.find(({ item }) => item.path.includes(formPathNeedle));
|
|
566
|
-
return (
|
|
567
|
-
entries.find(({ item }) => item.path.includes(dataPathNeedle)) ||
|
|
568
|
-
entries.find(({ item }) => item.path.includes(formPathNeedle))
|
|
569
|
-
);
|
|
570
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import ReactDOM from "react-dom/client";
|
|
3
|
-
import { ConfigProvider } from "antd";
|
|
4
|
-
import zhCN from "antd/locale/zh_CN.js";
|
|
5
|
-
import dayjs from "dayjs";
|
|
6
|
-
import "dayjs/locale/zh-cn.js";
|
|
7
|
-
import { RouterProvider } from "react-router-dom";
|
|
8
|
-
|
|
9
|
-
import { router } from "./app/router";
|
|
10
|
-
import "antd-mobile/bundle/style.css";
|
|
11
|
-
import "./styles/index.css";
|
|
12
|
-
|
|
13
|
-
dayjs.locale("zh-cn");
|
|
14
|
-
|
|
15
|
-
ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(
|
|
16
|
-
<React.StrictMode>
|
|
17
|
-
<ConfigProvider locale={zhCN}>
|
|
18
|
-
<RouterProvider router={router} />
|
|
19
|
-
</ConfigProvider>
|
|
20
|
-
</React.StrictMode>,
|
|
21
|
-
);
|