@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,632 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: LrSmartTable
|
|
3
|
+
description: LrSmartTable 数据表格组件完整配置
|
|
4
|
+
tags: [table, page-schema, select, orderBy, isFetched, defaultSortOrder, sortable]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# LrSmartTable
|
|
8
|
+
|
|
9
|
+
数据表格组件,用于展示列表数据。
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## 禁止事项
|
|
14
|
+
|
|
15
|
+
| 禁止 | 替代方案/说明 |
|
|
16
|
+
|------|---------------|
|
|
17
|
+
| `meta.handleProps` | 纯 JSON props |
|
|
18
|
+
| `hidden` 字段 | `isShown` |
|
|
19
|
+
| `customProps.tableFormat` | `column.format` |
|
|
20
|
+
| 按钮 `onClick` | `optType + options.jsFunction` |
|
|
21
|
+
| 字段改名/类型/字典 | 需在数据集管理中操作 |
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Props 属性
|
|
26
|
+
|
|
27
|
+
平台自定义属性与 Ant Design 5 Table 原生属性并存;原生 TableProps 统一放到 `otherTableProps`。
|
|
28
|
+
|
|
29
|
+
| 属性 | 类型 | 说明 |
|
|
30
|
+
|------|------|------|
|
|
31
|
+
| _doVersion | string | 数据集版本标识,必须保留原值(如 `"V2"`),不可删除或修改 |
|
|
32
|
+
| columns | Column[] | 列配置 |
|
|
33
|
+
| operateButtonsEnable | boolean | 操作列显示 |
|
|
34
|
+
| operateButtons | Button[] | 操作列按钮 |
|
|
35
|
+
| toolbar.enable | boolean | 工具栏显示 |
|
|
36
|
+
| toolbar.globalButtons | Button[] | 全局按钮 |
|
|
37
|
+
| toolbar.selectedButtons | Button[] | 批量操作功能被 exportButtons 取代,先不配置 |
|
|
38
|
+
| toolbar.exportButtons | BatchButton[] | 批量操作 |
|
|
39
|
+
| rowSelection.enable | boolean | 行选择 |
|
|
40
|
+
| pagination.enable | boolean | 分页 |
|
|
41
|
+
| pagination.currentPageKey | string | 系统管理的当前页 state key;标准页面更新时保留 |
|
|
42
|
+
| pagination.pageSizeKey | string | 系统管理的每页条数 state key;标准页面更新时保留 |
|
|
43
|
+
| pagination.totalKey | string | 系统管理的总数 state key;标准页面更新时保留 |
|
|
44
|
+
| columnSetting.enable | boolean | 列设置 |
|
|
45
|
+
| columnSetting.storageKey | string | 列设置缓存 key |
|
|
46
|
+
| otherTableProps | Record<string, any> | 其他 Ant Design 5 Table 的原生属性 |
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## Column 列属性
|
|
51
|
+
|
|
52
|
+
V2 页面生成时已为数据集所有字段全量生成 columns,通过 `isShown` 控制显示。用户"添加列" = 将已有 column 的 `isShown` 设为 `true`;仅当字段在 columns 中完全不存在时才需插入新对象。
|
|
53
|
+
|
|
54
|
+
`isShown` 控制列是否渲染,`isFetched` 控制字段是否参与 API 请求,两者独立。具体组合见下方 isShown + isFetched 组合表。
|
|
55
|
+
|
|
56
|
+
列属性兼容 Ant Design 5 TableColumnProps,并补充平台扩展字段。
|
|
57
|
+
|
|
58
|
+
| 属性 | 类型 | 说明 |
|
|
59
|
+
|------|------|------|
|
|
60
|
+
| title | string | 列标题 |
|
|
61
|
+
| dataIndex | string | 字段路径,支持 `relation.field` |
|
|
62
|
+
| doType | string | 字段数据类型,来自 dataset_detail_tool,用于二次更新时参考 |
|
|
63
|
+
| align | string | 对齐方式 |
|
|
64
|
+
| format | string | 格式化类型 |
|
|
65
|
+
| formatOptions | object | 格式化配置 |
|
|
66
|
+
| isShown | boolean | 是否显示该列 |
|
|
67
|
+
| isFetched | boolean | 是否从 API 请求该字段数据 |
|
|
68
|
+
| width | number | 列宽 |
|
|
69
|
+
| fixed | string | 列是否固定,可选 `'start'`、`'end'` |
|
|
70
|
+
| tooltip | string | 列标题旁的提示信息(Ant Design 5 Table 原生属性) |
|
|
71
|
+
| sortable | boolean | 可排序,点击表头更新 sort state → filter 请求 orderBy |
|
|
72
|
+
| defaultSortOrder | string | 初始排序方向(`ascend`/`descend`),列的扁平属性,初始化时写入 sort state → orderBy |
|
|
73
|
+
| ellipsis | boolean | Ant Design 5 Table 列级省略(td 宽度截断),与 `formatOptions.ellipsis` 无关,两者独立生效 |
|
|
74
|
+
| render | JSFunction | 自定义渲染 |
|
|
75
|
+
| ... | ... | 其余 TableColumnProps |
|
|
76
|
+
|
|
77
|
+
### sortable + defaultSortOrder 组合
|
|
78
|
+
|
|
79
|
+
两者独立控制不同生命周期,可自由组合:
|
|
80
|
+
|
|
81
|
+
| 组合 | 效果 |
|
|
82
|
+
|------|------|
|
|
83
|
+
| `sortable: true` + 无 `defaultSortOrder` | 用户可交互排序,首次加载无默认排序 |
|
|
84
|
+
| `defaultSortOrder: "descend"` + 无 `sortable` | 首次加载有默认排序,用户不可交互切换 |
|
|
85
|
+
| `sortable: true` + `defaultSortOrder: "descend"` | 首次加载有默认排序,且用户可交互切换(最常用) |
|
|
86
|
+
|
|
87
|
+
### isShown + isFetched 组合
|
|
88
|
+
|
|
89
|
+
通过组合 `isShown` 和 `isFetched`,可以精确控制字段的显示和请求行为:
|
|
90
|
+
|
|
91
|
+
| 组合 | 说明 | 典型场景 |
|
|
92
|
+
|------|------|---------|
|
|
93
|
+
| `isShown: true, isFetched: true` | 显示且请求 | 普通业务字段 |
|
|
94
|
+
| `isShown: false, isFetched: true` | 不显示但请求 | render 派生字段的数据源(如 `customer_id` 不显示,但被其他列 render 引用) |
|
|
95
|
+
| `isShown: false, isFetched: false` | 不显示不请求 | 完全隐藏的字段 |
|
|
96
|
+
| `isShown: true, isFetched: false` | ❌ 无效组合 | 显示但无数据,不应使用 |
|
|
97
|
+
|
|
98
|
+
**派生字段模式**:当 render 函数需要引用其他字段时,被引用字段必须设置 `isFetched: true`(确保数据被请求),可设置 `isShown: false`(不单独显示列)。
|
|
99
|
+
|
|
100
|
+
**主键字段约束**:`pkField: true` 的列(通常是 `id`)隐藏时必须保留 `isFetched: true`,行操作按钮(编辑、详情、删除)依赖主键值。正确做法:`isShown: false, isFetched: true`。
|
|
101
|
+
|
|
102
|
+
```json
|
|
103
|
+
// 示例:「客户信息」列通过 render 拼接 customer_name 和 customer_id
|
|
104
|
+
[
|
|
105
|
+
{"title": "客户ID", "dataIndex": "customer_id", "isShown": false, "isFetched": true},
|
|
106
|
+
{
|
|
107
|
+
"title": "客户信息", "dataIndex": "customer_name", "isShown": true, "isFetched": true,
|
|
108
|
+
"render": {"type": "JSFunction", "value": "(value, record) => `${record.customer_name}(${record.customer_id})`"}
|
|
109
|
+
}
|
|
110
|
+
]
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### format 类型
|
|
114
|
+
|
|
115
|
+
| format | formatOptions | 效果 |
|
|
116
|
+
|--------|---------------|------|
|
|
117
|
+
| text | `{ellipsis: boolean}` | 纯文本(`formatOptions.ellipsis` 是渲染层省略,不替代列级 `ellipsis`) |
|
|
118
|
+
| link | 基于 Ant Design 5 Typography.Link 的属性 | 可点击链接跳转 |
|
|
119
|
+
| user | - | 系统账户字段,通过平台用户表渲染头像+姓名(仅限 systemRetain 标记字段) |
|
|
120
|
+
| enum | `{options: [{label, value}]}` | 枚举样式(value→label 映射) |
|
|
121
|
+
| tag | `{options: [{label, value}], colorMapping: {"<value>": "<color>"}}` | 标签样式(options 做 value→label 映射,colorMapping 做颜色映射) |
|
|
122
|
+
| datetime | `{format: "<dayjs格式>"}` | 日期/日期时间(如 `YYYY-MM-DD`、`YYYY-MM-DD HH:mm:ss`) |
|
|
123
|
+
| number | `{precision: 2, prefix: "¥"}` | 数字 |
|
|
124
|
+
| progress | 基于 Ant Design 5 Progress 的属性 | 进度条展示 |
|
|
125
|
+
| percent | `{precision: 1, showSymbol: true}` | 百分比 |
|
|
126
|
+
| address | - | 地址级联展示 |
|
|
127
|
+
| upload | `{showPreview: true}` | 上传附件 |
|
|
128
|
+
| image | 基于 Ant Design 5 Image 的属性 | 图片 |
|
|
129
|
+
| file | - | 在线文件 |
|
|
130
|
+
|
|
131
|
+
**tag vs enum 选型**:字段名包含 status/state/level/grade → `tag`;有 options 但非状态类 → `enum`。用户要求颜色展示时,无论是否说"枚举",统一使用 `tag`(唯一支持 colorMapping 的 format)。
|
|
132
|
+
|
|
133
|
+
**tag/enum 共性**:`formatOptions.options` 用于 value → label 映射。静态枚举字段直接使用数据集字段的枚举定义;关联关系字段使用 Page 层 `getSelectOptions` 数据源并绑定 `this.state.<dataSourceId>`。tag 额外通过 `colorMapping` 指定颜色(key 必须与 options value 一致)。
|
|
134
|
+
|
|
135
|
+
```json
|
|
136
|
+
// tag 示例
|
|
137
|
+
{"format": "tag", "formatOptions": {"options": [{"label": "进行中", "value": "in_progress"}], "colorMapping": {"in_progress": "#1890ff"}}}
|
|
138
|
+
// enum 示例
|
|
139
|
+
{"format": "enum", "formatOptions": {"options": [{"label": "高", "value": "high"}, {"label": "低", "value": "low"}]}}
|
|
140
|
+
// datetime 示例
|
|
141
|
+
{"format": "datetime", "formatOptions": {"format": "YYYY-MM-DD"}}
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### 关联关系 options 显示映射
|
|
145
|
+
|
|
146
|
+
表格列展示关联字段的 label 时,普通 `enum` / `tag` 格式化只消费 `formatOptions.options`,不消费 `optionsRequest`。平台数据集 / 关联关系 options 必须走 Page 层 `dataSource.list` 的 `getSelectOptions`,再由列格式化绑定 state。
|
|
147
|
+
|
|
148
|
+
#### From / To 规则
|
|
149
|
+
|
|
150
|
+
| 规则 | 说明 |
|
|
151
|
+
|------|------|
|
|
152
|
+
| `dataSource.id = dataset_<FromDatasetCode>_<FromRelationField>_options` | `FromDatasetCode` 为 From 表字段所属数据集的 code |
|
|
153
|
+
| `dataSource.isInit = true` | 页面加载时自动请求 options |
|
|
154
|
+
| `dataSource.source = "dataset"` | 标识平台数据集请求 |
|
|
155
|
+
| `uri = /api/<appCode>/<ToDatasetCode>/getSelectOptions` | URI 使用 To 表 datasetCode |
|
|
156
|
+
| `params.code = <ToValueField>` | To 表被关联字段,通常是 `id` |
|
|
157
|
+
| `params.label = <ToLabelField>` | To 表展示字段,如 `name` / `title` / location 字段 |
|
|
158
|
+
| `formatOptions.options` | 绑定 `this.state.dataset_<FromDatasetCode>_<FromRelationField>_options` |
|
|
159
|
+
|
|
160
|
+
> 自关联父子关系中,`FromDatasetCode` 与 `ToDatasetCode` 可以相同;state key 仍按 `dataset_<FromDatasetCode>_<FromRelationField>_options` 命名,URI 仍使用 To 侧 options 数据源。
|
|
161
|
+
|
|
162
|
+
```json
|
|
163
|
+
// Page.dataSource.list
|
|
164
|
+
{
|
|
165
|
+
"type": "fetch",
|
|
166
|
+
"id": "dataset_<FromDatasetCode>_<FromRelationField>_options",
|
|
167
|
+
"isInit": true,
|
|
168
|
+
"source": "dataset",
|
|
169
|
+
"options": {
|
|
170
|
+
"method": "POST",
|
|
171
|
+
"uri": "/api/<appCode>/<ToDatasetCode>/getSelectOptions",
|
|
172
|
+
"params": {
|
|
173
|
+
"code": "<ToValueField>",
|
|
174
|
+
"label": "<ToLabelField>"
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
// table column
|
|
180
|
+
{
|
|
181
|
+
"title": "<columnTitle>",
|
|
182
|
+
"dataIndex": "<FromRelationField>",
|
|
183
|
+
"format": "enum",
|
|
184
|
+
"formatOptions": {
|
|
185
|
+
"ellipsis": true,
|
|
186
|
+
"options": {
|
|
187
|
+
"type": "JSExpression",
|
|
188
|
+
"value": "this.state.dataset_<FromDatasetCode>_<FromRelationField>_options"
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
> hard rule:`getSelectOptions` 禁止使用 `optionsRequest`。即使字段级请求技术上能访问完整接口,也会把列配置耦合到具体域名或部署环境;Agent 必须使用 Page 层 `dataSource.list` 的相对 URI,并通过 `formatOptions.options` 绑定 state。`optionsRequest` 只适用于通过字段组件自动加载外部 options 的场景,普通表格 `enum` / `tag` formatter 不会自动发起 `optionsRequest`。
|
|
195
|
+
|
|
196
|
+
### filter 数据源与表格贡献
|
|
197
|
+
|
|
198
|
+
表格列表数据来自 filter 数据源,请求体遵循 filter 接口协议。**filter 接口完整协议**(请求体结构、where 操作符、逻辑符、willFetch 合并逻辑等)见 `LrSmartFilter.md`。
|
|
199
|
+
|
|
200
|
+
**表格对 filter 的贡献**:
|
|
201
|
+
|
|
202
|
+
| 表格来源 | 对应 filter 字段 | 说明 |
|
|
203
|
+
|----------|------------------|------|
|
|
204
|
+
| sort | orderBy | 点击表头排序时更新 `yttable_xxx_sort` → orderBy |
|
|
205
|
+
| 列 dataIndex(isFetched: true) | select | 聚合为 select 数组 |
|
|
206
|
+
| pagination | currentPage、pageSize | 分页参数 |
|
|
207
|
+
|
|
208
|
+
表格消费 filter 数据源返回结果进行渲染。
|
|
209
|
+
|
|
210
|
+
---
|
|
211
|
+
|
|
212
|
+
### 分页状态管理
|
|
213
|
+
|
|
214
|
+
`LrSmartTable` 的分页状态放在页面级 state 中管理,`pagination.currentPageKey`、`pagination.pageSizeKey`、`pagination.totalKey` 用于隔离同一页面中不同表格的分页状态,避免多个表格共用 `currentPage`、`pageSize`、`total` 这类固定 key 后互相影响。
|
|
215
|
+
|
|
216
|
+
这三个 key 属于系统管理字段,不是业务配置。标准页面中由生成器或修复工具写入;Agent 更新标准页面时应保留已有 key,不主动配置、不主动改名。
|
|
217
|
+
|
|
218
|
+
Agent 规则:
|
|
219
|
+
|
|
220
|
+
- 常规标准页面更新:保留已有分页 key,只维护业务相关的分页开关、数据源、列和按钮。
|
|
221
|
+
- 新增带分页的 `LrSmartTable`:由生成器生成表格独立的分页 key,Agent 不手写固定公共 key。
|
|
222
|
+
- 历史 schema 缺失分页 key:作为修复场景补齐,不把它当成普通配置流程。
|
|
223
|
+
|
|
224
|
+
---
|
|
225
|
+
|
|
226
|
+
### 数据源唯一性与自动同步
|
|
227
|
+
|
|
228
|
+
filter 请求体的三个核心参数各有唯一数据源。Agent 只修改组件属性,不直接修改 datasource 配置:
|
|
229
|
+
|
|
230
|
+
| 参数 | 唯一数据源 | 同步方式 |
|
|
231
|
+
|------|-----------|---------|
|
|
232
|
+
| select | `columns[].isFetched` | 静态同步:schema 合并时自动重建 |
|
|
233
|
+
| where | `LrSmartFilter.items[].initialValue` | 动态同步:组件初始化时写入 state |
|
|
234
|
+
| orderBy | `columns[].defaultSortOrder` | 动态同步:组件初始化时写入 state |
|
|
235
|
+
|
|
236
|
+
**select 同步细节**:
|
|
237
|
+
|
|
238
|
+
**机制**:`tableColumns[].isFetched` 是 select 的唯一数据源。`datasource.params.select` 和 `paramsArr[select].value` 是派生数据,由系统自动从 `isFetched === true` 的列聚合生成。Agent 只需修改 `props.columns[].isFetched`,无需手动修改 datasource。
|
|
239
|
+
|
|
240
|
+
**参数**:
|
|
241
|
+
|
|
242
|
+
| Source | Target (auto-sync) | Description |
|
|
243
|
+
|--------|-------------------|-------------|
|
|
244
|
+
| `dataIndex` collection where `columns[].isFetched: true` | `{datasetId}_filter` → `params.select` | filter query fields |
|
|
245
|
+
| Same as above | `{datasetId}_filter` → `paramsArr[name=select].value` | filter params array |
|
|
246
|
+
| Same as above | `{datasetId}_excelExport` → `params.select` | export query fields |
|
|
247
|
+
|
|
248
|
+
大文本字段(`doType` 为 TEXT/LONGTEXT/MEDIUMTEXT/TINYTEXT)首次生成时默认 `isFetched: false`,避免列表查询大字段。用户可通过 Agent 更新或手动配置修改,但不推荐。
|
|
249
|
+
|
|
250
|
+
**示例**:修改 `description` 列为不查询
|
|
251
|
+
|
|
252
|
+
```json
|
|
253
|
+
{
|
|
254
|
+
"props": {
|
|
255
|
+
"columns": [
|
|
256
|
+
{"dataIndex": "customer_name", "isFetched": true},
|
|
257
|
+
{"dataIndex": "description", "isFetched": false}
|
|
258
|
+
]
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
系统自动同步后的 datasource(无需手动修改):
|
|
264
|
+
|
|
265
|
+
```json
|
|
266
|
+
{
|
|
267
|
+
"id": "1002663_filter",
|
|
268
|
+
"options": {
|
|
269
|
+
"params": {"select": ["customer_name"]},
|
|
270
|
+
"paramsArr": [{"name": "select", "value": ["customer_name"]}]
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
---
|
|
276
|
+
|
|
277
|
+
### orderBy 排序(sort → orderBy)
|
|
278
|
+
|
|
279
|
+
**机制**:排序配置分两个生命周期阶段。
|
|
280
|
+
|
|
281
|
+
| 阶段 | 配置属性 | 作用 |
|
|
282
|
+
|------|---------|------|
|
|
283
|
+
| 初始化 | `defaultSortOrder` | 页面首次加载时的默认排序方向,写入 sort state → orderBy |
|
|
284
|
+
| 交互 | `sortable: true` | 用户点击表头切换正序/倒序,覆盖 sort state → orderBy |
|
|
285
|
+
|
|
286
|
+
组件初始化后会从 columns 中提取有 `defaultSortOrder` 的列,写入 `context.state[sortKey]`,用于后续 datasource.load() 读取 orderBy。用户点击表头后,sort state 被覆盖为新的排序。
|
|
287
|
+
|
|
288
|
+
**参数**:
|
|
289
|
+
|
|
290
|
+
| Source | Target | Description |
|
|
291
|
+
|--------|--------|-------------|
|
|
292
|
+
| `columns[].defaultSortOrder` | `context.state[sortKey].orderBy` | Auto-converted on initialization |
|
|
293
|
+
| `"ascend"` | `"ASC"` | Ant Design 5 value → API value |
|
|
294
|
+
| `"descend"` | `"DESC"` | Ant Design 5 value → API value |
|
|
295
|
+
|
|
296
|
+
`defaultSortOrder` 必须是列的扁平属性,不可嵌套在 `extendProps` 中。
|
|
297
|
+
|
|
298
|
+
**示例**:
|
|
299
|
+
|
|
300
|
+
```json
|
|
301
|
+
{
|
|
302
|
+
"dataIndex": "updated_at",
|
|
303
|
+
"title": "更新时间",
|
|
304
|
+
"format": "datetime",
|
|
305
|
+
"sortable": true,
|
|
306
|
+
"defaultSortOrder": "descend"
|
|
307
|
+
}
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
> 首次加载时 API 请求 orderBy 包含 `[{ "updated_at": "DESC" }]`。
|
|
311
|
+
|
|
312
|
+
**❌ 错误**:`defaultSortOrder` 嵌套在 `extendProps` 中,Ant Design 5 Table 无法识别。
|
|
313
|
+
|
|
314
|
+
```json
|
|
315
|
+
{ "sortable": true, "extendProps": { "defaultSortOrder": "ascend" } }
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
`<fieldName>` 从 dataset_detail_tool 获取(如 `isModifyDate=true` 列对应更新时间字段)。
|
|
319
|
+
|
|
320
|
+
---
|
|
321
|
+
|
|
322
|
+
## 按钮配置
|
|
323
|
+
|
|
324
|
+
表格按钮遵循平台通用按钮协议:`optType + options`。
|
|
325
|
+
|
|
326
|
+
- 通用顶层按钮 `optType`、`flowAction.flowList` 子动作类型、平台扩展字段:见 `syntax-reference.md`
|
|
327
|
+
- 本文档仅补充 LrSmartTable 的按钮挂载位置、行操作上下文和表格场景示例
|
|
328
|
+
|
|
329
|
+
---
|
|
330
|
+
|
|
331
|
+
## operateButtons 行操作按钮
|
|
332
|
+
|
|
333
|
+
基于 Ant Design 5 的 ```ButtonProps```,ButtonProps 属性加到下列表格后
|
|
334
|
+
|
|
335
|
+
### 按钮属性
|
|
336
|
+
|
|
337
|
+
| 属性 | 类型 | 说明 |
|
|
338
|
+
|------|------|------|
|
|
339
|
+
| title | string | 按钮文本(必填) |
|
|
340
|
+
| optType | string | 按钮功能类型(必填) |
|
|
341
|
+
| options | object | 按钮配置项(必填) |
|
|
342
|
+
| type | string | 按钮样式:`default` / `primary` / `text` / `link` / `dashed` |
|
|
343
|
+
| size | string | 按钮尺寸:`large` / `medium` / `small` |
|
|
344
|
+
| danger | boolean | 危险按钮样式(红色) |
|
|
345
|
+
| icon | string | 按钮图标 |
|
|
346
|
+
| disabled | boolean | 禁用状态 |
|
|
347
|
+
| hidden | boolean | 隐藏状态 |
|
|
348
|
+
|
|
349
|
+
### operateButtons 的 optType 类型
|
|
350
|
+
|
|
351
|
+
行操作按钮沿用平台通用按钮协议:
|
|
352
|
+
|
|
353
|
+
- 顶层按钮常用 `optType`:`jsAction`、`flowAction`
|
|
354
|
+
- `request`、`submit`、`reset`、`message` 等属于 `flowAction.flowList` 子动作
|
|
355
|
+
- 具体枚举和字段说明见 `syntax-reference.md`
|
|
356
|
+
|
|
357
|
+
### options 配置项
|
|
358
|
+
|
|
359
|
+
表格场景中最常用的 `options` 字段:
|
|
360
|
+
|
|
361
|
+
| 字段 | 说明 |
|
|
362
|
+
|------|------|
|
|
363
|
+
| jsFunction | 跳转详情/编辑、执行表格场景 JS 逻辑 |
|
|
364
|
+
| flowList | 串联请求、提示消息等流程动作 |
|
|
365
|
+
| _bindDataSource | 表格相关数据源 ID(常见于删除、批量操作) |
|
|
366
|
+
| _bindDataSourceParams | 基于行数据或选中数据生成请求参数 |
|
|
367
|
+
| confirmConfig | 删除、批量操作等场景的确认弹窗配置 |
|
|
368
|
+
|
|
369
|
+
### 行操作按钮示例
|
|
370
|
+
|
|
371
|
+
```json
|
|
372
|
+
{
|
|
373
|
+
"title": "编辑", // Ant Design 5 Button 属性
|
|
374
|
+
"type": "link", // Ant Design 5 Button 属性
|
|
375
|
+
"size": "medium", // Ant Design 5 Button 属性
|
|
376
|
+
"optType": "jsAction", // 自定义属性
|
|
377
|
+
"options": { // 自定义属性
|
|
378
|
+
"jsFunction": {
|
|
379
|
+
"type": "JSFunction",
|
|
380
|
+
"value": "(config) => config._context?.appHelper?.yt?.smartPageHistory?.push({ pageTagName: 'UPDATE', datasetId: '<datasetId>', dataid: config.extraParams?.rowKey })"
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
```
|
|
385
|
+
|
|
386
|
+
### 注意事项
|
|
387
|
+
|
|
388
|
+
- `extraParams` 会自动注入 `{rowKey, row}`,行按钮可通过 `config.extraParams` 访问当前行数据
|
|
389
|
+
- `type` 建议使用 `"link"`,保持操作列视觉一致性
|
|
390
|
+
- 删除等危险操作建议设置 `danger: true`
|
|
391
|
+
|
|
392
|
+
---
|
|
393
|
+
|
|
394
|
+
## globalButtons 全局按钮
|
|
395
|
+
|
|
396
|
+
工具栏全局按钮,属性与 operateButtons 一致(同 Button 协议),区别:全局按钮无行上下文(无 `extraParams.rowKey/row`)。
|
|
397
|
+
|
|
398
|
+
arrayName = `tableGlobalButtons`,不受数据集约束,直接 INSERT。
|
|
399
|
+
|
|
400
|
+
```json
|
|
401
|
+
{"title": "新建", "type": "primary", "optType": "jsAction", "options": {"jsFunction": {"type": "JSFunction", "value": "(config) => config._context?.appHelper?.yt?.smartPageHistory?.push({ pageTagName: 'CREATE', datasetId: '<datasetId>' })"}}}
|
|
402
|
+
```
|
|
403
|
+
|
|
404
|
+
---
|
|
405
|
+
|
|
406
|
+
## exportButtons 批量操作
|
|
407
|
+
|
|
408
|
+
| 属性 | 类型 | 说明 |
|
|
409
|
+
|------|------|------|
|
|
410
|
+
| mainButton | BatchConfig | 主按钮 |
|
|
411
|
+
| buttons | BatchConfig[] | 下拉按钮组 |
|
|
412
|
+
| buttonsDisabled | boolean / JSExpression | 下拉按钮组是否禁用 |
|
|
413
|
+
| loading | boolean / JSExpression | 批量操作请求中的加载态 |
|
|
414
|
+
|
|
415
|
+
### 按钮属性
|
|
416
|
+
|
|
417
|
+
- `mainButton`:主按钮,属性与 `operateButtons` 基本一致;可直接承载默认批量动作,也可作为批量操作入口,常见用途是批量编辑入口
|
|
418
|
+
- `buttons`:下拉按钮组,在 `operateButtons` 基础上增加 `actionType`
|
|
419
|
+
- `actionType`:常见值为 `export` / `delete`
|
|
420
|
+
- `buttonsDisabled`:常与 `rowSelection.isDisabled` 或页面状态联动,支持 `JSExpression`
|
|
421
|
+
- `loading`:常绑定批量导出等动作数据源的 loading state,支持 `JSExpression`
|
|
422
|
+
|
|
423
|
+
### 运行机制
|
|
424
|
+
|
|
425
|
+
- 使用批量操作前,必须开启 `rowSelection.enable`
|
|
426
|
+
- `mainButton` 可直接承载默认批量动作,也可作为批量操作入口;`buttons` 定义下拉批量动作
|
|
427
|
+
- `actionType` 用于标识动作语义,常见为 `export` / `delete`
|
|
428
|
+
- 选中项相关动作依赖表格选中态;导出类通常绑定 `<datasetId>_excelExport`,删除类通常绑定 `<datasetId>_delete`
|
|
429
|
+
- 生成器默认先提供“导出选中 / 导出全部”能力,真实页面可继续扩展为“批量编辑 / 删除选中 / 删除全部”等批量动作容器
|
|
430
|
+
- 删除类动作通常需要 `confirmConfig`,成功后通常需要刷新表格数据源
|
|
431
|
+
|
|
432
|
+
### 当前实现中的常见参数约定
|
|
433
|
+
|
|
434
|
+
- 行按钮场景:`config.extraParams` 常见为 `{ rowKey, row }`
|
|
435
|
+
- `selectedRowKeys`:表格选中主键列表,当前实现中常用于批量编辑入口或按钮禁用判断
|
|
436
|
+
- `selectKeys`:导出接口常用的选中主键参数,当前实现中通常由 `_autoBindDataSourceParams: true` 自动传递
|
|
437
|
+
- `extraParams.selectId`:当前批量删除选中项实现中常用的 ID 集合
|
|
438
|
+
- `extraParams.allIds`:当前批量删除全部实现中常用的 ID 集合
|
|
439
|
+
- 批量导出场景:选中导出通常配合 `_autoBindDataSourceParams: true`,全量导出通常直接请求导出数据源
|
|
440
|
+
|
|
441
|
+
### 批量操作示例
|
|
442
|
+
|
|
443
|
+
```json
|
|
444
|
+
{
|
|
445
|
+
"mainButton": {
|
|
446
|
+
"title": "批量操作",
|
|
447
|
+
"optType": "jsAction",
|
|
448
|
+
"options": {
|
|
449
|
+
"jsFunction": {
|
|
450
|
+
"type": "JSFunction",
|
|
451
|
+
"value": "(config) => config._context?.appHelper?.yt?.smartPageHistory?.push({ pageTagName: 'UPDATE', datasetId: <datasetId>, dataid: config._context?.state['yttable_215eiu2svrr_selectedRowKeys'], type: 'batch' })"
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
},
|
|
455
|
+
"buttons": [
|
|
456
|
+
{
|
|
457
|
+
"title": "导出选中项",
|
|
458
|
+
"actionType": "export",
|
|
459
|
+
"optType": "flowAction",
|
|
460
|
+
"options": {
|
|
461
|
+
"flowList": [{
|
|
462
|
+
"optType": "request",
|
|
463
|
+
"options": {
|
|
464
|
+
"_bindDataSource": "<datasetId>_excelExport",
|
|
465
|
+
"_autoBindDataSourceParams": true
|
|
466
|
+
}
|
|
467
|
+
}]
|
|
468
|
+
}
|
|
469
|
+
},
|
|
470
|
+
{
|
|
471
|
+
"title": "导出全部",
|
|
472
|
+
"actionType": "export",
|
|
473
|
+
"optType": "flowAction",
|
|
474
|
+
"options": {
|
|
475
|
+
"flowList": [{
|
|
476
|
+
"optType": "request",
|
|
477
|
+
"options": {
|
|
478
|
+
"_bindDataSource": "<datasetId>_excelExport"
|
|
479
|
+
}
|
|
480
|
+
}]
|
|
481
|
+
}
|
|
482
|
+
},
|
|
483
|
+
{
|
|
484
|
+
"title": "删除选中项",
|
|
485
|
+
"actionType": "delete",
|
|
486
|
+
"danger": true,
|
|
487
|
+
"optType": "flowAction",
|
|
488
|
+
"options": {
|
|
489
|
+
"flowList": [
|
|
490
|
+
{
|
|
491
|
+
"optType": "request",
|
|
492
|
+
"options": {
|
|
493
|
+
"_bindDataSource": "<datasetId>_delete",
|
|
494
|
+
"_bindDataSourceParams": {
|
|
495
|
+
"type": "JSFunction",
|
|
496
|
+
"value": "(extraParams) => ({ id: extraParams.selectId })"
|
|
497
|
+
},
|
|
498
|
+
"confirmConfig": {"enable": true, "title": "确认删除选中项?"}
|
|
499
|
+
}
|
|
500
|
+
},
|
|
501
|
+
{
|
|
502
|
+
"optType": "jsAction",
|
|
503
|
+
"options": {
|
|
504
|
+
"jsFunction": {
|
|
505
|
+
"type": "JSFunction",
|
|
506
|
+
"value": "(config) => config._context.reloadDataSource()"
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
]
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
]
|
|
514
|
+
}
|
|
515
|
+
```
|
|
516
|
+
|
|
517
|
+
## context 方法
|
|
518
|
+
|
|
519
|
+
context 对象在 **JSFunction** 中通过 `config._context` 访问,用于状态管理和数据刷新。
|
|
520
|
+
|
|
521
|
+
### API 列表
|
|
522
|
+
|
|
523
|
+
| 方法 | 说明 |
|
|
524
|
+
|------|------|
|
|
525
|
+
| `_context.reloadDataSource()` | 重新加载数据源(刷新表格) |
|
|
526
|
+
| `_context.setState(state)` | 设置状态(浅合并) |
|
|
527
|
+
| `_context.state` | 读取当前状态 |
|
|
528
|
+
|
|
529
|
+
常见用途:
|
|
530
|
+
|
|
531
|
+
- 删除、更新后调用 `_context.reloadDataSource()` 刷新表格
|
|
532
|
+
- 使用 `_context.state` / `_context.setState()` 读写表格相关状态
|
|
533
|
+
|
|
534
|
+
### 权限控制
|
|
535
|
+
|
|
536
|
+
表格权限由运行时内置逻辑过滤按钮。当前标准方案读取 `_context.appHelper.yt.pointPermitMap`,Agent 不生成权限字段。完整规则见 `external-resources-usage.md`。
|
|
537
|
+
|
|
538
|
+
### 消息提示
|
|
539
|
+
|
|
540
|
+
`message` 属于 `flowAction.flowList` 子动作,完整协议参考 `syntax-reference.md`;表格场景通常用于请求完成后的提示消息。
|
|
541
|
+
|
|
542
|
+
---
|
|
543
|
+
|
|
544
|
+
## 关联字段引用
|
|
545
|
+
|
|
546
|
+
在 `dataIndex` 中使用点号路径访问关联表字段(底层通过 filter 接口的 select 实现):
|
|
547
|
+
|
|
548
|
+
```json
|
|
549
|
+
{"title": "客户等级", "dataIndex": "customer_level.level_name"}
|
|
550
|
+
{"title": "负责人", "dataIndex": "employee.employee_name"}
|
|
551
|
+
```
|
|
552
|
+
|
|
553
|
+
**限制**:
|
|
554
|
+
|
|
555
|
+
- 仅支持一级关联(不支持 `a.b.c`)
|
|
556
|
+
- 关联关系必须在数据集 `relations` 中定义
|
|
557
|
+
|
|
558
|
+
---
|
|
559
|
+
|
|
560
|
+
## 派生字段(自定义渲染)
|
|
561
|
+
|
|
562
|
+
通过 `render` JSFunction 拼接多个字段,实现自定义列显示。派生列不来自数据集,arrayName = `tableColumns`,直接 INSERT,不受数据集约束。
|
|
563
|
+
|
|
564
|
+
> 运行时约束:派生列不来自数据集字段。通过 schema update 插入派生列时,仍需遵守本节最小结构和 `isFetched` 规则。
|
|
565
|
+
|
|
566
|
+
### INSERT element 最小结构(派生列)
|
|
567
|
+
|
|
568
|
+
| 字段 | 必填 | 说明 |
|
|
569
|
+
|------|:----:|------|
|
|
570
|
+
| title | ✅ | 列标题 |
|
|
571
|
+
| dataIndex | ✅ | 虚拟标识(如 `custom_info`),不对应数据集字段 |
|
|
572
|
+
| isShown | ✅ | `true` |
|
|
573
|
+
| isFetched | ✅ | `false`(无真实字段可查询) |
|
|
574
|
+
| render | ✅ | JSFunction,通过 `record` 访问其他已 fetch 的字段 |
|
|
575
|
+
|
|
576
|
+
```json
|
|
577
|
+
{"title": "客户信息", "dataIndex": "custom_info", "isShown": true, "isFetched": false, "render": {"type": "JSFunction", "value": "(value, record) => `${record.customer_name}(${record.customer_id})`"}}
|
|
578
|
+
```
|
|
579
|
+
|
|
580
|
+
> 被 render 引用的字段(如 `customer_id`)必须 `isFetched: true`,参见 isShown + isFetched 组合表。
|
|
581
|
+
|
|
582
|
+
```json
|
|
583
|
+
{
|
|
584
|
+
"title": "客户信息",
|
|
585
|
+
"dataIndex": "customer_name",
|
|
586
|
+
"render": {
|
|
587
|
+
"type": "JSFunction",
|
|
588
|
+
"value": "(value, record, index) => `${record.customer_name}(${record.customer_id})`"
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
```
|
|
592
|
+
|
|
593
|
+
**参数**:`value`(当前值), `record`(行数据), `index`(行索引)
|
|
594
|
+
|
|
595
|
+
### 敏感字段脱敏
|
|
596
|
+
|
|
597
|
+
对于手机号、身份证号、银行卡号等敏感字段,通过 `render` JSFunction 实现前端脱敏显示。
|
|
598
|
+
|
|
599
|
+
**脱敏规则**:手机号中间4位星号(138****5678)、身份证号中间10位星号、银行卡号中间星号、邮箱@前保留3位。
|
|
600
|
+
|
|
601
|
+
**实现方式**:使用 `render` + `replace` 正则替换或 `substring` 截取拼接。
|
|
602
|
+
|
|
603
|
+
```json
|
|
604
|
+
// 手机号脱敏示例
|
|
605
|
+
{
|
|
606
|
+
"dataIndex": "phone",
|
|
607
|
+
"render": {
|
|
608
|
+
"type": "JSFunction",
|
|
609
|
+
"value": "(value) => value ? value.replace(/^(\\d{3})\\d{4}(\\d{4})$/, '$1****$2') : '-'"
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
```
|
|
613
|
+
|
|
614
|
+
**注意**:脱敏仅影响前端显示,不影响数据源和导出。后续 BFF 成熟后将下沉到 filter 接口。脱敏字段仍需 `isFetched: true`。
|
|
615
|
+
|
|
616
|
+
---
|
|
617
|
+
|
|
618
|
+
## 权限配置
|
|
619
|
+
|
|
620
|
+
当前标准页面由运行时过滤按钮权限。Agent 只需要维护表格按钮本身;按钮是否展示由运行时权限过滤决定。
|
|
621
|
+
|
|
622
|
+
| 按钮位置 | 当前权限动作 |
|
|
623
|
+
|----------|--------------|
|
|
624
|
+
| `toolbar.globalButtons` | `create` |
|
|
625
|
+
| `toolbar.exportButtons.buttons[].actionType` | `export` / `delete` 等显式动作 |
|
|
626
|
+
| `operateButtons[0]` | `update` |
|
|
627
|
+
| `operateButtons[1]` | `detail` |
|
|
628
|
+
| `operateButtons[2]` | `delete` |
|
|
629
|
+
|
|
630
|
+
hard rule:当前运行时按数组下标为 `operateButtons` 匹配权限动作,顺序必须严格保持 `[update, detail, delete]`。Agent 不应调换顺序、不应插入额外行操作按钮、不应省略中间按钮位置;第 4 个及之后的行操作按钮不会进入当前权限过滤。
|
|
631
|
+
|
|
632
|
+
Agent 不生成任何权限字段。
|