@lovrabet/rabetbase-cli 2.3.16-beta.7 → 2.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -10
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/filter.js +1 -1
- package/lib/commands/data/getOne.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/data/shared.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init/index.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/kb/create.js +1 -1
- package/lib/commands/kb/delete.js +1 -1
- package/lib/commands/kb/detail.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/kb/list.js +1 -1
- package/lib/commands/kb/shared.js +1 -1
- package/lib/commands/kb/update.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/rename.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/react/create.d.ts +2 -0
- package/lib/commands/page/react/create.js +1 -0
- package/lib/commands/page/react/detail.d.ts +2 -0
- package/lib/commands/page/react/detail.js +1 -0
- package/lib/commands/page/react/list.d.ts +2 -0
- package/lib/commands/page/react/list.js +1 -0
- package/lib/commands/page/react/publish.d.ts +2 -0
- package/lib/commands/page/react/publish.js +1 -0
- package/lib/commands/page/react/shared.d.ts +78 -0
- package/lib/commands/page/react/shared.js +1 -0
- package/lib/commands/page/react/syntax.d.ts +18 -0
- package/lib/commands/page/react/syntax.js +1 -0
- package/lib/commands/page/react/template.d.ts +8 -0
- package/lib/commands/page/react/template.js +1 -0
- package/lib/commands/page/react/update.d.ts +2 -0
- package/lib/commands/page/react/update.js +1 -0
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/restore.js +1 -1
- package/lib/commands/page/shared.d.ts +1 -0
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/standard-page-status.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/permit/index.js +1 -1
- package/lib/commands/permit/page-get.js +1 -1
- package/lib/commands/permit/page-set.js +1 -1
- package/lib/commands/permit/role-apis-set.js +1 -1
- package/lib/commands/permit/role-menus-set.js +1 -1
- package/lib/commands/permit/role-menus.js +1 -1
- package/lib/commands/permit/shared.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/non-interactive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/create.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/task/index.js +1 -1
- package/lib/commands/task/status.js +1 -1
- package/lib/commands/tenant/index.js +1 -1
- package/lib/commands/tenant/members-list.js +1 -1
- package/lib/commands/tenant/shared.js +1 -1
- package/lib/commands/user-account/dingding-sandbox-bind.d.ts +2 -0
- package/lib/commands/user-account/dingding-sandbox-bind.js +1 -0
- package/lib/commands/user-account/index.d.ts +2 -0
- package/lib/commands/user-account/index.js +1 -0
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.d.ts +117 -0
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.d.ts +3 -0
- package/lib/postinstall.js +1 -0
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/skills/builtin-skill.d.ts +37 -0
- package/lib/skills/builtin-skill.js +1 -0
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.d.ts +4 -2
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/copy-directory.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/rules-cdn.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +9 -3
- package/scripts/postinstall.mjs +24 -0
- package/skills/rabetbase/SKILL.md +493 -0
- package/skills/rabetbase/guides/backend-function.md +835 -0
- package/skills/rabetbase/guides/best-practices.md +137 -0
- package/skills/rabetbase/guides/bff-creation-workflow.md +148 -0
- package/skills/rabetbase/guides/conflict-detection.md +119 -0
- package/skills/rabetbase/guides/data-api-guidelines.md +414 -0
- package/skills/rabetbase/guides/database-connection-workflow.md +169 -0
- package/skills/rabetbase/guides/frontend-development.md +179 -0
- package/skills/rabetbase/guides/legacy-application-blueprint-workflow.md +495 -0
- package/skills/rabetbase/guides/menu-anomaly-manual-cleanup.md +137 -0
- package/skills/rabetbase/guides/page-development-workflow.md +187 -0
- package/skills/rabetbase/guides/react-custom-page-workflow.md +184 -0
- package/skills/rabetbase/guides/role-permit-workflow.md +127 -0
- package/skills/rabetbase/guides/sql-creation-workflow.md +173 -0
- package/skills/rabetbase/guides/sql-mybatis.md +126 -0
- package/skills/rabetbase/guides/troubleshooting.md +67 -0
- package/skills/rabetbase/guides/typescript-sdk.md +227 -0
- package/skills/rabetbase/knowledge/page-schema/LrSmartCreate.md +367 -0
- package/skills/rabetbase/knowledge/page-schema/LrSmartDetail.md +153 -0
- package/skills/rabetbase/knowledge/page-schema/LrSmartEcharts.md +291 -0
- package/skills/rabetbase/knowledge/page-schema/LrSmartFilter.md +478 -0
- package/skills/rabetbase/knowledge/page-schema/LrSmartJsx.md +119 -0
- package/skills/rabetbase/knowledge/page-schema/LrSmartStatistic.md +223 -0
- package/skills/rabetbase/knowledge/page-schema/LrSmartTable.md +632 -0
- package/skills/rabetbase/knowledge/page-schema/YtPage.md +172 -0
- package/skills/rabetbase/knowledge/page-schema/dataset-relations.md +126 -0
- package/skills/rabetbase/knowledge/page-schema/external-resources-usage.md +232 -0
- package/skills/rabetbase/knowledge/page-schema/field-components.md +312 -0
- package/skills/rabetbase/knowledge/page-schema/syntax-reference.md +278 -0
- package/skills/rabetbase/knowledge/react-page/components.md +225 -0
- package/skills/rabetbase/knowledge/react-page/generation-standards.md +385 -0
- package/skills/rabetbase/references/rabetbase-api-list.md +58 -0
- package/skills/rabetbase/references/rabetbase-api-pull.md +82 -0
- package/skills/rabetbase/references/rabetbase-app-config.md +95 -0
- package/skills/rabetbase/references/rabetbase-app-list.md +79 -0
- package/skills/rabetbase/references/rabetbase-app-members-list.md +64 -0
- package/skills/rabetbase/references/rabetbase-auth-login.md +53 -0
- package/skills/rabetbase/references/rabetbase-auth-logout.md +29 -0
- package/skills/rabetbase/references/rabetbase-bff-create.md +59 -0
- package/skills/rabetbase/references/rabetbase-bff-delete.md +42 -0
- package/skills/rabetbase/references/rabetbase-bff-detail.md +38 -0
- package/skills/rabetbase/references/rabetbase-bff-list.md +61 -0
- package/skills/rabetbase/references/rabetbase-bff-pull.md +42 -0
- package/skills/rabetbase/references/rabetbase-bff-push.md +65 -0
- package/skills/rabetbase/references/rabetbase-bff-save.md +63 -0
- package/skills/rabetbase/references/rabetbase-bff-status.md +37 -0
- package/skills/rabetbase/references/rabetbase-cli-skill-install.md +42 -0
- package/skills/rabetbase/references/rabetbase-codegen-sdk.md +35 -0
- package/skills/rabetbase/references/rabetbase-codegen-sql.md +33 -0
- package/skills/rabetbase/references/rabetbase-config.md +296 -0
- package/skills/rabetbase/references/rabetbase-dataset-business-group-update.md +84 -0
- package/skills/rabetbase/references/rabetbase-dataset-delete.md +54 -0
- package/skills/rabetbase/references/rabetbase-dataset-detail.md +106 -0
- package/skills/rabetbase/references/rabetbase-dataset-extend-update.md +70 -0
- package/skills/rabetbase/references/rabetbase-dataset-field-update.md +117 -0
- package/skills/rabetbase/references/rabetbase-dataset-generate.md +206 -0
- package/skills/rabetbase/references/rabetbase-dataset-list.md +42 -0
- package/skills/rabetbase/references/rabetbase-dataset-operations.md +34 -0
- package/skills/rabetbase/references/rabetbase-dataset-relation-audit.md +63 -0
- package/skills/rabetbase/references/rabetbase-dataset-relation-mutations.md +141 -0
- package/skills/rabetbase/references/rabetbase-dataset-relations.md +71 -0
- package/skills/rabetbase/references/rabetbase-dataset-rename.md +107 -0
- package/skills/rabetbase/references/rabetbase-dataset-restore.md +54 -0
- package/skills/rabetbase/references/rabetbase-db-analyze.md +135 -0
- package/skills/rabetbase/references/rabetbase-db-create.md +54 -0
- package/skills/rabetbase/references/rabetbase-db-delete.md +26 -0
- package/skills/rabetbase/references/rabetbase-db-detail.md +27 -0
- package/skills/rabetbase/references/rabetbase-db-diff.md +57 -0
- package/skills/rabetbase/references/rabetbase-db-list.md +37 -0
- package/skills/rabetbase/references/rabetbase-db-tables.md +25 -0
- package/skills/rabetbase/references/rabetbase-db-test.md +29 -0
- package/skills/rabetbase/references/rabetbase-db-update.md +29 -0
- package/skills/rabetbase/references/rabetbase-doctor.md +62 -0
- package/skills/rabetbase/references/rabetbase-file.md +35 -0
- package/skills/rabetbase/references/rabetbase-init.md +70 -0
- package/skills/rabetbase/references/rabetbase-issue-report.md +132 -0
- package/skills/rabetbase/references/rabetbase-kb.md +62 -0
- package/skills/rabetbase/references/rabetbase-menu-asset-update.md +135 -0
- package/skills/rabetbase/references/rabetbase-menu-delete.md +54 -0
- package/skills/rabetbase/references/rabetbase-menu-external-link-create.md +63 -0
- package/skills/rabetbase/references/rabetbase-menu-external-link-update.md +74 -0
- package/skills/rabetbase/references/rabetbase-menu-group-create.md +33 -0
- package/skills/rabetbase/references/rabetbase-menu-group-update.md +38 -0
- package/skills/rabetbase/references/rabetbase-menu-list.md +144 -0
- package/skills/rabetbase/references/rabetbase-menu-move.md +54 -0
- package/skills/rabetbase/references/rabetbase-menu-regroup-start.md +45 -0
- package/skills/rabetbase/references/rabetbase-menu-rename.md +48 -0
- package/skills/rabetbase/references/rabetbase-menu-sync.md +60 -0
- package/skills/rabetbase/references/rabetbase-notification-config-list.md +80 -0
- package/skills/rabetbase/references/rabetbase-ocr.md +86 -0
- package/skills/rabetbase/references/rabetbase-page-generate-start.md +32 -0
- package/skills/rabetbase/references/rabetbase-page-generate-status.md +32 -0
- package/skills/rabetbase/references/rabetbase-page-pull.md +47 -0
- package/skills/rabetbase/references/rabetbase-page-push.md +45 -0
- package/skills/rabetbase/references/rabetbase-page-react-create.md +29 -0
- package/skills/rabetbase/references/rabetbase-page-react-detail.md +26 -0
- package/skills/rabetbase/references/rabetbase-page-react-list.md +23 -0
- package/skills/rabetbase/references/rabetbase-page-react-publish.md +23 -0
- package/skills/rabetbase/references/rabetbase-page-react-update.md +24 -0
- package/skills/rabetbase/references/rabetbase-page-relation-binding.md +72 -0
- package/skills/rabetbase/references/rabetbase-page-restore.md +45 -0
- package/skills/rabetbase/references/rabetbase-page-sync.md +36 -0
- package/skills/rabetbase/references/rabetbase-permit-page-set.md +69 -0
- package/skills/rabetbase/references/rabetbase-permit-role-apis-set.md +53 -0
- package/skills/rabetbase/references/rabetbase-permit-role-menus-set.md +57 -0
- package/skills/rabetbase/references/rabetbase-project-create.md +46 -0
- package/skills/rabetbase/references/rabetbase-project-upgrade.md +57 -0
- package/skills/rabetbase/references/rabetbase-role-list.md +68 -0
- package/skills/rabetbase/references/rabetbase-role-user-add.md +54 -0
- package/skills/rabetbase/references/rabetbase-role-user-resolve.md +27 -0
- package/skills/rabetbase/references/rabetbase-run.md +53 -0
- package/skills/rabetbase/references/rabetbase-schema.md +22 -0
- package/skills/rabetbase/references/rabetbase-sql-create.md +41 -0
- package/skills/rabetbase/references/rabetbase-sql-delete.md +37 -0
- package/skills/rabetbase/references/rabetbase-sql-detail.md +32 -0
- package/skills/rabetbase/references/rabetbase-sql-exec.md +34 -0
- package/skills/rabetbase/references/rabetbase-sql-list.md +54 -0
- package/skills/rabetbase/references/rabetbase-sql-pull.md +54 -0
- package/skills/rabetbase/references/rabetbase-sql-push.md +46 -0
- package/skills/rabetbase/references/rabetbase-sql-status.md +39 -0
- package/skills/rabetbase/references/rabetbase-sql-validate.md +73 -0
- package/skills/rabetbase/references/rabetbase-standard-page-status.md +31 -0
- package/skills/rabetbase/references/rabetbase-task-status.md +40 -0
- package/skills/rabetbase/references/rabetbase-tenant-members-list.md +69 -0
- package/skills/rabetbase/references/rabetbase-update.md +56 -0
- package/skills/rabetbase/references/rabetbase-user-account.md +45 -0
- package/skills/rabetbase/references/rabetbase-workspace.md +60 -0
- package/skills/rabetbase.manifest.json +137 -0
|
@@ -0,0 +1,478 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: LrSmartFilter
|
|
3
|
+
description: LrSmartFilter 筛选器组件完整配置
|
|
4
|
+
tags: [filter, page-schema, where, initialValue]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# LrSmartFilter
|
|
8
|
+
|
|
9
|
+
筛选器组件,用于配置查询条件。
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## 禁止事项
|
|
14
|
+
|
|
15
|
+
| 禁止 | 替代方案/说明 |
|
|
16
|
+
|------|---------------|
|
|
17
|
+
| `meta.handleProps` | 纯 JSON props |
|
|
18
|
+
| 字段改名/类型/字典 | 需在数据集管理中操作 |
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Props 属性
|
|
23
|
+
|
|
24
|
+
| 属性 | 类型 | 说明 |
|
|
25
|
+
|------|------|------|
|
|
26
|
+
| _doVersion | string | 数据集版本标识,必须保留原值(如 `"V2"`),不可删除或修改 |
|
|
27
|
+
| items | Item[] | 筛选项配置 |
|
|
28
|
+
| events | Event[] | 事件配置(onSearch 等) |
|
|
29
|
+
|
|
30
|
+
> 运行时约束:`LrSmartFilter` 不消费 `layoutMode` / `cols`,PageSchema 中不要生成这两个字段。
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## Item 筛选项属性
|
|
35
|
+
|
|
36
|
+
V2 页面生成时已为数据集所有字段全量生成 items,通过 `isShown` 控制显示。用户"添加筛选项" = 将已有 item 的 `isShown` 设为 `true`;仅当字段在 items 中完全不存在时才需插入新对象。
|
|
37
|
+
|
|
38
|
+
### INSERT element 最小结构
|
|
39
|
+
|
|
40
|
+
arrayName = `filterItems`,字段必须存在于数据集(先 dataset_detail_tool 确认)。工具层自动为选择类组件补 `options: []` 骨架。
|
|
41
|
+
|
|
42
|
+
输入类:
|
|
43
|
+
|
|
44
|
+
```json
|
|
45
|
+
{"componentName": "YtInput", "label": "<fieldLabel>", "name": "<fieldName>", "isShown": true}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
选择类(静态枚举):
|
|
49
|
+
|
|
50
|
+
```json
|
|
51
|
+
{"componentName": "YtSingleSelect", "label": "<fieldLabel>", "name": "<fieldName>", "isShown": true, "options": [{"label": "<显示文本>", "value": "<枚举值>"}]}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
选择类(动态选项):需同时在 Page 层配置 dataSource,参见下方「筛选项 options 数据配置 § 方式 2」。
|
|
55
|
+
|
|
56
|
+
| 属性 | 渲染 | 参与提交 | 用途 |
|
|
57
|
+
|------|:----:|:-------:|------|
|
|
58
|
+
| `isShown: false` | ❌ | ❌ | 完全不渲染,等同于不存在 |
|
|
59
|
+
| `hidden: true` | ❌ | ❌ | Filter 中会被跳过,不参与 where |
|
|
60
|
+
|
|
61
|
+
| 属性 | 类型 | 说明 |
|
|
62
|
+
|------|------|------|
|
|
63
|
+
| componentName | string | 组件类型 |
|
|
64
|
+
| label | string | 标签 |
|
|
65
|
+
| name | string | 字段名,支持 `relation.field` |
|
|
66
|
+
| placeholder | string | 占位符 |
|
|
67
|
+
| initialValue | any | 默认值(与 Ant Design 5 Form.Item initialValue 一致),同时作为首次 API 请求 where 条件的数据源 |
|
|
68
|
+
| options | array | 选项列表(Select/Cascader) |
|
|
69
|
+
| showSearch | boolean | 可搜索(Select) |
|
|
70
|
+
| filterOption | boolean | 本地过滤(远程搜索时设 false) |
|
|
71
|
+
| events | object | 禁止默认生成;当前运行时不消费字段级 `events` |
|
|
72
|
+
|
|
73
|
+
### 组件类型
|
|
74
|
+
|
|
75
|
+
筛选项可用的 `componentName`、字段组件选型规则、数据格式与动态选项约束,统一参考 `field-components.md`。本文档仅补充 Filter 场景特有的 options 数据配置、关联字段引用和与 Table 的联动方式。
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## 筛选项 options 数据配置
|
|
80
|
+
|
|
81
|
+
`YtSingleSelect`、`YtMultiSelect`、`YtCascader` 必须配置 options 数据来源,否则下拉列表为空。
|
|
82
|
+
|
|
83
|
+
### 方式 1:静态选项(枚举值已知)
|
|
84
|
+
|
|
85
|
+
直接在筛选项配置中提供 options 数组。
|
|
86
|
+
|
|
87
|
+
```json
|
|
88
|
+
{
|
|
89
|
+
"componentName": "YtSingleSelect",
|
|
90
|
+
"label": "客户状态",
|
|
91
|
+
"name": "status",
|
|
92
|
+
"options": [{"label": "活跃", "value": 1}, {"label": "流失", "value": 0}]
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### 方式 2:动态选项(关联表数据)
|
|
97
|
+
|
|
98
|
+
- **机制**:options 数据来自关联表,需两步配置:Page 层请求 To 表 options 数据 → 筛选项绑定 state。state key 必须与 dataSource id 一致
|
|
99
|
+
- **参数**:
|
|
100
|
+
|
|
101
|
+
| Placeholder | Value Source | Description |
|
|
102
|
+
|-------------|--------------|-------------|
|
|
103
|
+
| `dataset_<FromDatasetCode>_<FromRelationField>_options` | `dataset_` prefix + From 表字段所属 datasetCode + From 表关联字段名 + `_options` suffix | dataSource id, must match state key |
|
|
104
|
+
| `<appCode>` | Application code | From current app config |
|
|
105
|
+
| `<ToDatasetCode>` | To 表 datasetCode | From dataset relations |
|
|
106
|
+
| `<ToValueField>` | To 表被关联字段 | Usually `id` or `code` |
|
|
107
|
+
| `<ToLabelField>` | To 表展示字段 | Usually `name` / `title` / location field |
|
|
108
|
+
|
|
109
|
+
> 自关联父子关系中,`FromDatasetCode` 与 `ToDatasetCode` 可以相同;state key 仍按 `dataset_<FromDatasetCode>_<FromRelationField>_options` 命名,URI 仍使用 To 侧 options 数据源。
|
|
110
|
+
|
|
111
|
+
- **示例**:
|
|
112
|
+
|
|
113
|
+
步骤 1:Page 层配置 getSelectOptions 请求
|
|
114
|
+
|
|
115
|
+
```json
|
|
116
|
+
{
|
|
117
|
+
"dataSource": {
|
|
118
|
+
"list": [{
|
|
119
|
+
"id": "dataset_<FromDatasetCode>_<FromRelationField>_options",
|
|
120
|
+
"type": "fetch",
|
|
121
|
+
"isInit": true,
|
|
122
|
+
"source": "dataset",
|
|
123
|
+
"options": {
|
|
124
|
+
"uri": "/api/<appCode>/<ToDatasetCode>/getSelectOptions",
|
|
125
|
+
"params": {"code": "<ToValueField>", "label": "<ToLabelField>"}
|
|
126
|
+
}
|
|
127
|
+
}]
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
步骤 2:筛选项通过 JSExpression 绑定 state
|
|
133
|
+
|
|
134
|
+
```json
|
|
135
|
+
{
|
|
136
|
+
"componentName": "YtSingleSelect",
|
|
137
|
+
"label": "<filterLabel>",
|
|
138
|
+
"name": "<FromRelationField>",
|
|
139
|
+
"options": {
|
|
140
|
+
"type": "JSExpression",
|
|
141
|
+
"value": "this.state.dataset_<FromDatasetCode>_<FromRelationField>_options"
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
> `getSelectOptions` 禁止使用 `optionsRequest`。即使字段级请求技术上能访问完整接口,也会把筛选项耦合到具体域名或部署环境;Agent 必须使用 Page 层 `dataSource.list` 的相对 URI,并通过 `this.state.dataset_<FromDatasetCode>_<FromRelationField>_options` 绑定。`optionsRequest` 仅用于三方链接、外部接口或外部静态资源 options。
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
## initialValue 与 where 条件初始化
|
|
151
|
+
|
|
152
|
+
### 机制
|
|
153
|
+
|
|
154
|
+
where 条件配置分两个生命周期阶段。
|
|
155
|
+
|
|
156
|
+
| 阶段 | 配置属性 | 作用 |
|
|
157
|
+
|------|---------|------|
|
|
158
|
+
| 初始化 | `initialValue` | 页面首次加载时的默认筛选条件,写入 filter state → where |
|
|
159
|
+
| 交互 | 用户选择/输入筛选项 | onValuesChange / onSearch 更新 filter state → where |
|
|
160
|
+
|
|
161
|
+
`initialValue` 是首次 where 条件的唯一数据源。组件初始化时会将默认筛选值合并为 `initialValues`,再写入 `context.state[filterKey]`,确保首次 datasource.load() 的 JSExpression 求值能读到 where 条件。不配置 initialValue 的筛选项不参与首次 where。
|
|
162
|
+
|
|
163
|
+
维护说明:
|
|
164
|
+
|
|
165
|
+
- `LrSmartFilter` 会将 `items[].initialValue/defaultValue` 合并到顶层 `initialValues` 后进入运行时筛选逻辑。
|
|
166
|
+
- 顶层 `initialValues` 优先级高于 `items[].initialValue/defaultValue`。
|
|
167
|
+
- `initialValues` 与 `defaultValue` 不应同时生成;常规默认筛选条件优先使用 `items[].initialValue`。
|
|
168
|
+
- 常规新增/更新筛选默认值时,优先维护对应 `items[].initialValue`;只有批量初始化或已有 schema 已使用顶层 `initialValues` 时,才维护顶层 `initialValues`。
|
|
169
|
+
|
|
170
|
+
### 参数
|
|
171
|
+
|
|
172
|
+
| Source | Target | Description |
|
|
173
|
+
|--------|--------|-------------|
|
|
174
|
+
| `items[].initialValue` | `context.state[filterKey].where.$and` | Auto-converted on component initialization |
|
|
175
|
+
| YtSingleSelect initialValue | `{ fieldName: { $eq: value } }` | Single select → $eq |
|
|
176
|
+
| YtMultiSelect initialValue | `{ fieldName: { $in: [...] } }` | Multi-select array → $in |
|
|
177
|
+
| YtRangeDatePicker initialValue | `{ fieldName: { $between: [start, end] } }` | Date range → `$between` |
|
|
178
|
+
| YtUserSelect initialValue | `{ fieldName: { $in: ["value1", "value2", ...] } }` | User selector → `$in`,值必须是数组 |
|
|
179
|
+
|
|
180
|
+
> **YtUserSelect 查询规范**:业务字段存储可为数组,系统字段存储可为字符串;但在 `LrSmartFilter` 中,`YtUserSelect` 查询值必须是数组,如 `["80"]`,运行时只对数组值生成 `$in`。
|
|
181
|
+
|
|
182
|
+
### 示例
|
|
183
|
+
|
|
184
|
+
```json
|
|
185
|
+
{
|
|
186
|
+
"componentName": "YtSingleSelect",
|
|
187
|
+
"label": "客户状态",
|
|
188
|
+
"name": "status",
|
|
189
|
+
"initialValue": 1,
|
|
190
|
+
"options": [{"label": "活跃", "value": 1}, {"label": "流失", "value": 0}]
|
|
191
|
+
}
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
> 首次加载时 API 请求 where 包含 `{ "status": { "$eq": 1 } }`。
|
|
195
|
+
|
|
196
|
+
---
|
|
197
|
+
|
|
198
|
+
## events 与上下文
|
|
199
|
+
|
|
200
|
+
- 宿主级事件、按钮 `optType + options` 协议:统一参考 `syntax-reference.md`
|
|
201
|
+
- Filter 场景只生成宿主级 `onSearch`,用于触发表格或其他消费 filter 接口的数据源刷新。
|
|
202
|
+
- Filter 没有 `fieldReactions`。当前运行时不消费筛选项字段级 `events.onChange` / `events.onMount`,也没有字段级 context 联动方法。Agent 不应生成筛选项显隐、选项更新和值联动类字段级 events。
|
|
203
|
+
- `LrSmartFilter` 不生成筛选项之间的实时动态联动。筛选项展示由静态 `items`、`hidden`、`isShown` 决定;筛选值变化后的数据刷新只通过宿主级 `onSearch` 完成。
|
|
204
|
+
|
|
205
|
+
---
|
|
206
|
+
|
|
207
|
+
## 关联字段引用
|
|
208
|
+
|
|
209
|
+
在 `name` 中使用点号路径访问关联表字段(底层通过 filter 接口的 where 条件实现):
|
|
210
|
+
|
|
211
|
+
```json
|
|
212
|
+
{"name": "customer_level.level_name"}
|
|
213
|
+
{"name": "employee.employee_name"}
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
**限制**:仅支持一级关联(不支持 `a.b.c`)
|
|
217
|
+
|
|
218
|
+
---
|
|
219
|
+
|
|
220
|
+
## filter 接口协议
|
|
221
|
+
|
|
222
|
+
Filter 数据源请求遵循 filter 接口协议,LrSmartFilter 写入的 `ytfilter_xxx_filter` state 作为 `where` 参与请求体构建。完整协议见下。
|
|
223
|
+
|
|
224
|
+
### 请求体结构
|
|
225
|
+
|
|
226
|
+
> 以下为 filter 接口的完整请求体结构(供理解协议用)。各参数由不同组件属性控制,Agent 不直接构造此请求体。
|
|
227
|
+
|
|
228
|
+
```json
|
|
229
|
+
{
|
|
230
|
+
"select": ["field1", "relation.field2"],
|
|
231
|
+
"where": { "$and": [{ "field": { "$eq": value } }] },
|
|
232
|
+
"orderBy": [{ "fieldName": "asc"|"desc" }],
|
|
233
|
+
"currentPage": 1,
|
|
234
|
+
"pageSize": 10
|
|
235
|
+
}
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
### where 筛选条件
|
|
239
|
+
|
|
240
|
+
**格式**:`where: { "$and": [...] }` 或 `where: { "$or": [...] }`,支持嵌套组合。字段支持主表字段或 `relation.field`。
|
|
241
|
+
|
|
242
|
+
**操作符列表**:
|
|
243
|
+
|
|
244
|
+
| 操作符 | 适用场景 | 示例(CRM 客户信息) |
|
|
245
|
+
|--------|----------|----------------------|
|
|
246
|
+
| `$eq` | 枚举、状态、精确匹配 | `{ status: { $eq: 1 } }` |
|
|
247
|
+
| `$ne` | 排除某个值 | `{ status: { $ne: 0 } }` |
|
|
248
|
+
| `$gte` | 数值/日期下界(含) | `{ create_time: { $gte: "2024-01-01" } }` |
|
|
249
|
+
| `$lte` | 数值/日期上界(含) | `{ create_time: { $lte: "2024-12-31" } }` |
|
|
250
|
+
| `$gt` | 数值/日期下界(不含) | `{ create_time: { $gt: "2024-01-01" } }` |
|
|
251
|
+
| `$lt` | 数值/日期上界(不含) | `{ create_time: { $lt: "2024-12-31" } }` |
|
|
252
|
+
| `$contain` | 文本模糊搜索 | `{ customer_name: { $contain: "阿里" } }` |
|
|
253
|
+
| `$startWith` | 前缀匹配 | `{ customer_name: { $startWith: "阿里" } }` |
|
|
254
|
+
| `$endWith` | 后缀匹配 | `{ customer_name: { $endWith: "集团" } }` |
|
|
255
|
+
| `$in` | 多选枚举、批量 ID | `{ source: { $in: ["官网", "推荐"] } }` |
|
|
256
|
+
|
|
257
|
+
**逻辑操作符**:
|
|
258
|
+
|
|
259
|
+
```json
|
|
260
|
+
// $and:多条件同时满足
|
|
261
|
+
{ "$and": [{ "status": { "$eq": 1 } }, { "source": { "$eq": "官网" } }] }
|
|
262
|
+
|
|
263
|
+
// $or:满足其中之一
|
|
264
|
+
{ "$or": [{ "status": { "$eq": 1 } }, { "status": { "$eq": 2 } }] }
|
|
265
|
+
|
|
266
|
+
// 嵌套:$and 内嵌 $or
|
|
267
|
+
{ "$and": [{ "status": { "$eq": 1 } }, { "$or": [{ "source": { "$eq": "官网" } }, { "source": { "$eq": "推荐" } }] }] }
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
**LrSmartFilter 贡献**:用户选择筛选项后,LrSmartFilter 写入 `ytfilter_xxx_filter` state,格式 `{ where: { $and: [...] } }`。
|
|
271
|
+
|
|
272
|
+
### 数据源 params → filter 请求体映射(系统内部机制,Agent 不可直接修改)
|
|
273
|
+
|
|
274
|
+
> 以下为系统内部同步机制说明。Agent 禁止直接修改 datasource params,只能通过组件属性间接控制(见"数据源唯一性原则")。
|
|
275
|
+
|
|
276
|
+
| DataSource param | Source state | Filter field | Description |
|
|
277
|
+
|-----------------|--------------|--------------|-------------|
|
|
278
|
+
| filter | `ytfilter_xxx_filter` | where | Filter conditions from LrSmartFilter |
|
|
279
|
+
| sort | `yttable_xxx_sort` | orderBy | Sort config, format: `{ orderBy: [{ dataIndex: "ASC"\|"DESC" }] }` |
|
|
280
|
+
| select | Static array (aggregated from column dataIndex) | select | Return fields, main table or `relation.field` format |
|
|
281
|
+
| currentPage | `yttable_xxx_currentPage` | currentPage | Page number |
|
|
282
|
+
| pageSize | `yttable_xxx_pageSize` | pageSize | Items per page |
|
|
283
|
+
|
|
284
|
+
### 数据源唯一性原则
|
|
285
|
+
|
|
286
|
+
**机制**:filter 请求体的三个核心参数(select、where、orderBy)各有唯一数据源。Agent 只修改组件属性,不直接修改 datasource 配置,同步由系统自动完成。
|
|
287
|
+
|
|
288
|
+
| Parameter | Unique source | Sync method | Agent modification target |
|
|
289
|
+
|-----------|--------------|-------------|--------------------------|
|
|
290
|
+
| select | `LrSmartTable.columns[].isFetched` | Static sync: auto-rebuild `params.select` during schema merge | `columns[].isFetched` |
|
|
291
|
+
| where | `LrSmartFilter.items[].initialValue` | Dynamic sync: write to state on component init → `params.filter` | `items[].initialValue` |
|
|
292
|
+
| orderBy | `LrSmartTable.columns[].defaultSortOrder` | Dynamic sync: write to state on component init → `params.sort` | `columns[].defaultSortOrder` |
|
|
293
|
+
|
|
294
|
+
> 详见 `LrSmartTable.md` 的"数据源唯一性与自动同步"(select)和"orderBy 排序"(orderBy)章节。
|
|
295
|
+
|
|
296
|
+
### willFetch 合并逻辑(系统自动生成,Agent 禁止修改)
|
|
297
|
+
|
|
298
|
+
`({ filter, sort, ...rest }) => ({ ...rest, ...filter, ...sort })`。即 `rest`(select、currentPage、pageSize)+ `filter`(where)+ `sort`(orderBy)→ 最终请求体。
|
|
299
|
+
|
|
300
|
+
> 默认筛选条件请使用 `items[].initialValue`,默认排序请使用 `columns[].defaultSortOrder`,不可通过修改 willFetch 实现。
|
|
301
|
+
|
|
302
|
+
---
|
|
303
|
+
|
|
304
|
+
## Filter 联动 Table
|
|
305
|
+
|
|
306
|
+
Filter 搜索后触发 Table 刷新:
|
|
307
|
+
|
|
308
|
+
```json
|
|
309
|
+
{
|
|
310
|
+
"componentName": "LrSmartFilter",
|
|
311
|
+
"props": {
|
|
312
|
+
"events": [{
|
|
313
|
+
"name": "onSearch",
|
|
314
|
+
"optType": "flowAction",
|
|
315
|
+
"flowList": [{
|
|
316
|
+
"optType": "request",
|
|
317
|
+
"options": {
|
|
318
|
+
"_bindDataSource": "<datasetId>_filter",
|
|
319
|
+
"_autoBindDataSourceParams": true
|
|
320
|
+
}
|
|
321
|
+
}]
|
|
322
|
+
}]
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
Table 绑定数据源:
|
|
328
|
+
|
|
329
|
+
```json
|
|
330
|
+
{
|
|
331
|
+
"componentName": "LrSmartTable",
|
|
332
|
+
"props": {
|
|
333
|
+
"dataSource": {"type": "JSExpression", "value": "state['<datasetId>_filter']"}
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
```
|
|
337
|
+
|
|
338
|
+
---
|
|
339
|
+
|
|
340
|
+
## 定制快捷过滤按钮
|
|
341
|
+
|
|
342
|
+
> 此模式属于交互阶段(用户点击按钮后动态修改 where 条件)。初始化阶段的默认筛选条件必须使用 `items[].initialValue`,不可通过 setState 实现。
|
|
343
|
+
|
|
344
|
+
### 机制
|
|
345
|
+
|
|
346
|
+
快捷过滤按钮不直接改 Table,而是改写 Filter 对应 state 中的 `where.$and`,再触发 filter 数据源 `load()`。这样按钮与普通筛选共用同一套查询协议,改法稳定,且不需要改组件/引擎。
|
|
347
|
+
|
|
348
|
+
### 参数
|
|
349
|
+
|
|
350
|
+
| Parameter | Value source | Description |
|
|
351
|
+
|-----------|--------------|-------------|
|
|
352
|
+
| `filterStateKey` | `ytfilter_` + `meta.datasetId` + `_filter` | Filter state key |
|
|
353
|
+
| `dataSourceId` | `id` in `dataSource.list` filter request item | Used for `dataSourceMap[dataSourceId].load()` |
|
|
354
|
+
| `currentUserId` | `window.__GLOBAL__.userInfo.userId` | Current logged-in user, see syntax-reference.md § 6 |
|
|
355
|
+
| `fieldName` | Business field | e.g., `creator_id`, `assignee_id` |
|
|
356
|
+
| `excludeFields` | Current button field + mutually exclusive fields | Used to generate `baseConditions` |
|
|
357
|
+
| `buttonLabel` | Business label | e.g., "My created requirements", "My assigned requirements" |
|
|
358
|
+
| `conditionValue` | Determined by field storage structure | YtUserSelect fields uniformly use `$in` |
|
|
359
|
+
|
|
360
|
+
字段取值规则:
|
|
361
|
+
|
|
362
|
+
- YtUserSelect 筛选字段(无论业务字段还是系统字段):`{ [fieldName]: { $in: [currentUserId] } }`
|
|
363
|
+
|
|
364
|
+
### 示例
|
|
365
|
+
|
|
366
|
+
LrSmartJsx 的 `render` 这里应写 `source`,不写编译后的 `value`。知识库中按多行 React 源码理解。
|
|
367
|
+
|
|
368
|
+
1. 从 `filterStateKey` 取出当前 `where.$and`
|
|
369
|
+
2. 用 `excludeFields` 过滤出 `baseConditions`
|
|
370
|
+
3. 判断当前按钮是否已激活
|
|
371
|
+
4. 未激活时追加当前按钮条件,已激活时回退到 `baseConditions`
|
|
372
|
+
5. `setState` 后调用 `dataSourceMap[dataSourceId].load()`
|
|
373
|
+
|
|
374
|
+
```jsx
|
|
375
|
+
import React from 'react';
|
|
376
|
+
import { Button } from 'antd';
|
|
377
|
+
|
|
378
|
+
function render(props) {
|
|
379
|
+
const _context = props.env;
|
|
380
|
+
const filterStateKey = '<filterStateKey>';
|
|
381
|
+
const dataSourceId = '<dataSourceId>';
|
|
382
|
+
const fieldName = '<fieldName>';
|
|
383
|
+
const buttonLabel = '<buttonLabel>';
|
|
384
|
+
const currentUserId = window.__GLOBAL__?.userInfo?.userId;
|
|
385
|
+
const conditionValue = <conditionValue>;
|
|
386
|
+
const whereAndConditions = _context.state?.[filterStateKey]?.where?.$and || [];
|
|
387
|
+
const baseConditions = whereAndConditions.filter((conditionItem) => <excludePredicate>);
|
|
388
|
+
const isActive = whereAndConditions.some((conditionItem) => <activePredicate>);
|
|
389
|
+
|
|
390
|
+
const handleClick = () => {
|
|
391
|
+
if (!currentUserId) return;
|
|
392
|
+
const stateUpdate = {};
|
|
393
|
+
stateUpdate[filterStateKey] = {
|
|
394
|
+
where: {
|
|
395
|
+
$and: isActive ? baseConditions : baseConditions.concat([{ [fieldName]: conditionValue }])
|
|
396
|
+
}
|
|
397
|
+
};
|
|
398
|
+
_context.setState(stateUpdate);
|
|
399
|
+
setTimeout(() => {
|
|
400
|
+
_context.dataSourceMap?.[dataSourceId]?.load();
|
|
401
|
+
}, 0);
|
|
402
|
+
};
|
|
403
|
+
|
|
404
|
+
return (
|
|
405
|
+
<Button type={isActive ? 'primary' : 'default'} onClick={handleClick}>
|
|
406
|
+
{buttonLabel}
|
|
407
|
+
</Button>
|
|
408
|
+
);
|
|
409
|
+
}
|
|
410
|
+
```
|
|
411
|
+
|
|
412
|
+
替换点:
|
|
413
|
+
|
|
414
|
+
| 占位 | 含义 |
|
|
415
|
+
|------|------|
|
|
416
|
+
| `filterStateKey` | Filter 对应的 state key |
|
|
417
|
+
| `dataSourceId` | filter 数据源 id |
|
|
418
|
+
| `fieldName` | 当前按钮控制的字段 |
|
|
419
|
+
| `buttonLabel` | 按钮文案 |
|
|
420
|
+
| `conditionValue` | 按“字段取值规则”替换 |
|
|
421
|
+
| `excludePredicate` | 排除 `excludeFields` |
|
|
422
|
+
| `activePredicate` | 判断“当前按钮条件已存在” |
|
|
423
|
+
|
|
424
|
+
落盘说明:真正写入配置时,把这段源码放进 `render.source`,并保持 `source` 字符串 + `\n` 换行转义。`source` 组件拿到的是 `props`,页面上下文在 `props.env`。
|
|
425
|
+
|
|
426
|
+
改法:
|
|
427
|
+
|
|
428
|
+
- 换 `filterStateKey`
|
|
429
|
+
- 换 `dataSourceId`
|
|
430
|
+
- 换 `fieldName`
|
|
431
|
+
- 换 `excludeFields`
|
|
432
|
+
- 换 `buttonLabel`
|
|
433
|
+
- 换 `conditionValue` / `activePredicate`
|
|
434
|
+
|
|
435
|
+
---
|
|
436
|
+
|
|
437
|
+
## 常见场景示例
|
|
438
|
+
|
|
439
|
+
### 条件显隐
|
|
440
|
+
|
|
441
|
+
`LrSmartFilter` 目前不支持筛选项之间的实时字段联动。`hidden` / `isShown` 只作为静态渲染控制:`hidden: true` 或 `isShown: false` 的筛选项不会渲染,也不会参与 where 条件。
|
|
442
|
+
|
|
443
|
+
Agent 规则:
|
|
444
|
+
|
|
445
|
+
- 不为 `LrSmartFilter.items[]` 生成字段级 `events.onChange` / `events.onMount`。
|
|
446
|
+
- 不生成 `fieldReactions`,该能力只用于 Form。
|
|
447
|
+
- 需要搜索时生成宿主级 `events.onSearch`,让 filter state 刷新后触发表格数据源请求。
|
|
448
|
+
|
|
449
|
+
---
|
|
450
|
+
|
|
451
|
+
## 常见问题
|
|
452
|
+
|
|
453
|
+
| 问题 | 原因 | 解决方案 |
|
|
454
|
+
|------|------|----------|
|
|
455
|
+
| 筛选项不显示 | `hidden: true` 或 `isShown: false` | 设置静态 `isShown: true`,不要生成字段级联动 |
|
|
456
|
+
| 选项列表为空 | options 未配置 | 配置静态 options,或按标准方案配置 Page 层 getSelectOptions + state 绑定 |
|
|
457
|
+
| 联动不生效 | 字段级 events 未被消费 | 不生成 Filter 字段级联动 schema |
|
|
458
|
+
| 远程搜索不生效 | filterOption 未禁用 | 设置 `filterOption: false` |
|
|
459
|
+
| 默认值不生效 | initialValue 未配置 | 在对应 item 上配置 `initialValue` |
|
|
460
|
+
|
|
461
|
+
---
|
|
462
|
+
|
|
463
|
+
## 完整示例
|
|
464
|
+
|
|
465
|
+
```json
|
|
466
|
+
{
|
|
467
|
+
"componentName": "LrSmartFilter",
|
|
468
|
+
"props": {
|
|
469
|
+
"_doVersion": "V2",
|
|
470
|
+
"items": [
|
|
471
|
+
{"componentName": "YtInput", "label": "客户名称", "name": "customer_name", "placeholder": "请输入"},
|
|
472
|
+
{"componentName": "YtSingleSelect", "label": "客户状态", "name": "status", "initialValue": 1, "options": [{"label": "活跃", "value": 1}, {"label": "流失", "value": 0}]},
|
|
473
|
+
{"componentName": "YtRangeDatePicker", "label": "创建时间", "name": "create_time_range"}
|
|
474
|
+
],
|
|
475
|
+
"events": [{"name": "onSearch", "optType": "flowAction", "flowList": [{"optType": "request", "options": {"_bindDataSource": "<datasetId>_filter", "_autoBindDataSourceParams": true}}]}]
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
```
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: LrSmartJsx
|
|
3
|
+
description: LrSmartJsx 自定义 JSX 组件完整配置
|
|
4
|
+
tags: [jsx, custom-component, page-schema]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# LrSmartJsx
|
|
8
|
+
|
|
9
|
+
自定义 JSX 组件。只在标准组件无法满足时使用。
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## 禁止事项
|
|
14
|
+
|
|
15
|
+
| 禁止 | 替代方案/说明 |
|
|
16
|
+
|------|---------------|
|
|
17
|
+
| 直接修改页面 state 对象 | 使用 `props.env.setState()` 方法 |
|
|
18
|
+
| 在标准组件能满足需求时使用 | 优先使用 LrSmartTable、LrSmartFilter 等标准组件 |
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## 机制
|
|
23
|
+
|
|
24
|
+
`render` 只写 `source`,不写编译后的 `value`。`source` 按 React 组件源码编写,固定使用 `function render(props)`;页面上下文从 `props.env` 读取。Agent 只维护 `source`。
|
|
25
|
+
|
|
26
|
+
推荐固定写法:
|
|
27
|
+
|
|
28
|
+
```jsx
|
|
29
|
+
function render(props) {
|
|
30
|
+
const env = props.env;
|
|
31
|
+
// 业务逻辑
|
|
32
|
+
return <div />;
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
实际写入页面 Schema JSON 配置时,`source` 仍然是字符串,使用 `\n` 表示换行。
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## 参数
|
|
41
|
+
|
|
42
|
+
### 配置参数
|
|
43
|
+
|
|
44
|
+
| 参数 | 必须 | 说明 |
|
|
45
|
+
|------|------|------|
|
|
46
|
+
| `props.render.type` | 是 | 固定为 `JSFunction` |
|
|
47
|
+
| `props.render.source` | 是 | JSX 源码 |
|
|
48
|
+
|
|
49
|
+
### source 可用参数
|
|
50
|
+
|
|
51
|
+
| 参数 | 说明 |
|
|
52
|
+
|------|------|
|
|
53
|
+
| `props.env.state` | 页面状态对象(只读) |
|
|
54
|
+
| `props.env.setState(state)` | 更新页面状态(浅合并) |
|
|
55
|
+
| `props.env.dataSourceMap` | 数据源映射表 |
|
|
56
|
+
| `props.env.dataSourceMap[id].load()` | 手动刷新数据源 |
|
|
57
|
+
| `props.env.reloadDataSource()` | 重新加载所有数据源 |
|
|
58
|
+
| `props.env.appHelper.yt.smartPageHistory` | 页面跳转 |
|
|
59
|
+
| `props.sdkClient` | SDK 客户端实例 |
|
|
60
|
+
|
|
61
|
+
### 可用 import
|
|
62
|
+
|
|
63
|
+
| import 来源 | 说明 |
|
|
64
|
+
|------------|------|
|
|
65
|
+
| `'react'` | React |
|
|
66
|
+
| `'antd'` | Ant Design |
|
|
67
|
+
| `'@ant-design/icons'` | 图标 |
|
|
68
|
+
| `'dayjs'` | 日期处理 |
|
|
69
|
+
| `'lodash'` | 工具函数 |
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## 示例
|
|
74
|
+
|
|
75
|
+
机制:
|
|
76
|
+
|
|
77
|
+
1. 通过 `props.env` 读取页面上下文
|
|
78
|
+
2. 通过 `setState` 修改绑定在数据源参数上的 state
|
|
79
|
+
3. 需要立即刷新时调用 `dataSourceMap[id].load()`
|
|
80
|
+
|
|
81
|
+
```jsx
|
|
82
|
+
import React from 'react';
|
|
83
|
+
import { Button } from 'antd';
|
|
84
|
+
|
|
85
|
+
function render(props) {
|
|
86
|
+
const env = props.env;
|
|
87
|
+
const stateKey = '<stateKey>';
|
|
88
|
+
const dataSourceId = '<dataSourceId>';
|
|
89
|
+
|
|
90
|
+
const handleClick = () => {
|
|
91
|
+
env.setState({ [stateKey]: <value> });
|
|
92
|
+
setTimeout(() => {
|
|
93
|
+
env.dataSourceMap?.[dataSourceId]?.load();
|
|
94
|
+
}, 0);
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
return <Button onClick={handleClick}>按钮文本</Button>;
|
|
98
|
+
}
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
替换点:
|
|
102
|
+
|
|
103
|
+
| 占位 | 含义 |
|
|
104
|
+
|------|------|
|
|
105
|
+
| `stateKey` | 要写入的页面 state key |
|
|
106
|
+
| `dataSourceId` | 需要刷新的数据源 id |
|
|
107
|
+
| `value` | 写入 state 的值 |
|
|
108
|
+
|
|
109
|
+
落盘说明:真正写入配置时,把这段源码放进 `render.source`,并保持 `source` 字符串 + `\n` 换行转义。
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
## 注意事项
|
|
114
|
+
|
|
115
|
+
| 要点 | 说明 |
|
|
116
|
+
|------|------|
|
|
117
|
+
| 只需提供 `source` | `value` 由系统自动生成 |
|
|
118
|
+
| source 中访问上下文 | 使用 `props.env`;不要手写编译后的函数参数 |
|
|
119
|
+
| `setState` 触发刷新的前提 | 数据源 params 必须绑定 `this.state.xxx` |
|