@lovrabet/rabetbase-cli 2.5.12 → 2.5.13-beta.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/lib/api/api-doc.js +1 -1
- package/lib/api/api-group.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/api/generate-sdk-config-file.js +1 -1
- package/lib/api/legacy-api-file.js +1 -1
- package/lib/api/model-registry-file.js +1 -1
- package/lib/api/model-registry-scaffold.js +1 -1
- package/lib/api/model-source.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/detail.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/logs.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/delete.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/init.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/dataset/batch-design.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/business-groups.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/cross-relation-create.js +1 -1
- package/lib/commands/dataset/cross-relation-delete.js +1 -1
- package/lib/commands/dataset/cross-relation-list.js +1 -1
- package/lib/commands/dataset/cross-relation-shared.js +1 -1
- package/lib/commands/dataset/cross-relation-update.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/design-context.js +1 -1
- package/lib/commands/dataset/design-start.js +1 -1
- package/lib/commands/dataset/design-status.js +1 -1
- package/lib/commands/dataset/design-sync-retry.js +1 -1
- package/lib/commands/dataset/design-sync-status.js +1 -1
- package/lib/commands/dataset/design-validate.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-restore.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/dataset/user-deleted-field-list.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/cross-db-analysis-shared.js +1 -1
- package/lib/commands/db/cross-db-analyze-latest.js +1 -1
- package/lib/commands/db/cross-db-analyze-start.js +1 -1
- package/lib/commands/db/cross-db-analyze-status.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff-refresh-start.js +1 -1
- package/lib/commands/db/diff-refresh-status.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/table-diff-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/deployment/index.js +1 -1
- package/lib/commands/deployment/sync-all.js +1 -1
- package/lib/commands/deployment/sync-jobs.js +1 -1
- package/lib/commands/deployment/sync-status.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/flow/create.js +1 -1
- package/lib/commands/flow/detail.js +1 -1
- package/lib/commands/flow/index.js +1 -1
- package/lib/commands/flow/list.js +1 -1
- package/lib/commands/flow/page-list.js +1 -1
- package/lib/commands/flow/publish.js +1 -1
- package/lib/commands/flow/runtime-resources-shared.js +1 -1
- package/lib/commands/flow/runtime-role-list.js +1 -1
- package/lib/commands/flow/runtime-role-user-list.js +1 -1
- package/lib/commands/flow/runtime-user-search.js +1 -1
- package/lib/commands/flow/shared.js +1 -1
- package/lib/commands/flow/update.js +1 -1
- package/lib/commands/flow/validate.js +1 -1
- package/lib/commands/instant-api-policy/current.js +1 -1
- package/lib/commands/instant-api-policy/index.js +1 -1
- package/lib/commands/instant-api-policy/init.js +1 -1
- package/lib/commands/instant-api-policy/publish.js +1 -1
- package/lib/commands/instant-api-policy/pull.js +1 -1
- package/lib/commands/instant-api-policy/revision.js +1 -1
- package/lib/commands/instant-api-policy/revisions.js +1 -1
- package/lib/commands/instant-api-policy/rollback.js +1 -1
- package/lib/commands/instant-api-policy/shared.js +1 -1
- package/lib/commands/instant-api-policy/validate.js +1 -1
- package/lib/commands/issue/context.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/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/search.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/path.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/subapp-assets.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/subapp-assets-status.js +1 -1
- package/lib/commands/menu/subapp-assets-update.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/visibility-update.js +1 -1
- package/lib/commands/notification/config-create.js +1 -1
- package/lib/commands/notification/config-delete.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/config-update.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/create.js +1 -1
- package/lib/commands/page/custom/detail.js +1 -1
- package/lib/commands/page/custom/list.js +1 -1
- package/lib/commands/page/custom/publish.js +1 -1
- package/lib/commands/page/custom/shared.js +1 -1
- package/lib/commands/page/custom/syntax.js +1 -1
- package/lib/commands/page/custom/update.js +1 -1
- package/lib/commands/page/data-list-status.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/relation-audit.js +1 -1
- package/lib/commands/page/restore.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/project/api-architecture-upgrade.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/materialize-project-template.js +1 -1
- package/lib/commands/project/create/project-name.js +1 -1
- package/lib/commands/project/create/project-template-archive.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/domain-routing-sync.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/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/rule/get.js +1 -1
- package/lib/commands/rule/index.js +1 -1
- package/lib/commands/rule/list.js +1 -1
- package/lib/commands/rule/set.js +1 -1
- package/lib/commands/rule/shared.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.js +1 -1
- package/lib/commands/user-account/feishu-bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- 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/domain-config.js +1 -1
- package/lib/config/project-domain-routing.js +1 -1
- package/lib/config/region-config.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/region.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/routing-profile.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.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/hook-directory.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/cross-db-analysis.js +1 -1
- package/lib/core/cross-db-relation.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/flow-config.js +1 -1
- package/lib/core/instant-api-policy/config.js +1 -1
- package/lib/core/instant-api-policy/endpoints.js +1 -1
- package/lib/core/kb-management-client.js +1 -1
- package/lib/core/kb-search-client.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/page/lr-smart-jsx.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/supported-flags.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/generated/official-routing.js +1 -1
- package/lib/generated/routing-contract.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- 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/services/dataset-design/checkpoint.js +1 -1
- package/lib/services/dataset-design/commands.js +1 -1
- package/lib/services/dataset-design/contract.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/main.js +1 -1
- 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/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/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/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 +1 -1
- package/skills/rabetbase/SKILL.md +1 -1
- package/skills/rabetbase/guides/custom-page-workflow.md +32 -2
- package/skills/rabetbase/knowledge/custom-page/generation-standards.md +106 -6
- package/skills/rabetbase-dataset-generation/SKILL.md +1 -1
- package/skills/rabetbase-page-generation/SKILL.md +1 -1
- package/skills/rabetbase.manifest.json +3 -3
- package/templates/custom-pages/blank.json +1 -1
- package/templates/custom-pages/dashboard.json +1 -1
|
@@ -158,6 +158,36 @@ page create --page-pattern <BLANK|ONEPAGE|DASHBOARD>
|
|
|
158
158
|
- `page custom-*` 页面与 `project create` 微前端模板是不同运行环境;前者不得因为模板示例使用了包装库,就引入白名单外依赖。
|
|
159
159
|
- 图表查询使用 Dataset、`client.sql.execute({ sqlCode, params })` 或受控 Backend Function,并完整处理加载、空态、失败和重试行为。
|
|
160
160
|
|
|
161
|
+
## 使用 Agent 侧边栏
|
|
162
|
+
|
|
163
|
+
自定义页面可通过页面上下文的 `useAgent()` 唤起应用内置的 Agent 侧边栏:打开、关闭、指定会话、预填输入框和订阅事件。侧边栏由平台常驻挂载,页面无需初始化,也无需判断就绪状态,不得自行创建实例。
|
|
164
|
+
|
|
165
|
+
适合承接的场景是“页面负责收集与确认,Agent 负责执行”:例如页面正在展示某条审批单、工单或客户记录时,把记录 id、关键字段摘要和期望结果预填给 Agent,由它在侧边栏中查询明细、生成文档或推进后续动作,用户可以继续追问和修正;页面只做筛选与勾选时,也可以把选中对象交给 Agent 批量处理。不要把一个完整的多步业务流程压缩成按钮回调,页面只负责提供上下文和触发时机。
|
|
166
|
+
|
|
167
|
+
```jsx
|
|
168
|
+
import { useAgent } from "@/context/app-context";
|
|
169
|
+
|
|
170
|
+
const App = () => {
|
|
171
|
+
const agent = useAgent();
|
|
172
|
+
|
|
173
|
+
return (
|
|
174
|
+
<Button
|
|
175
|
+
onClick={() =>
|
|
176
|
+
agent.call("setSenderInput", {
|
|
177
|
+
text: "请根据当前审批单(id: xxx)核对附件完整性,并给出需要补充的材料清单",
|
|
178
|
+
})
|
|
179
|
+
}
|
|
180
|
+
>
|
|
181
|
+
让 Agent 处理
|
|
182
|
+
</Button>
|
|
183
|
+
);
|
|
184
|
+
};
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
方法、`setSenderInput` 载荷字段、事件名与使用边界统一见 [`generation-standards.md`](../knowledge/custom-page/generation-standards.md) 的“使用 Agent 侧边栏”;只使用其中已登记的调用方式,不传未登记参数。需要用户确认后再执行时省略 `autoSubmit`,只预填并聚焦输入框;同一业务对象建议复用同一 `sessionId`,便于用户下次回到该上下文。
|
|
188
|
+
|
|
189
|
+
调用会改变用户可见的侧边栏并写入输入框,`autoSubmit` 会立即向 Agent 发送消息,只能在用户明确操作后触发;`/chat` 路由下侧边栏不可用。`agent.call` 返回的 Promise 需 `await` 并捕获异常。
|
|
190
|
+
|
|
161
191
|
## 页面开发参考
|
|
162
192
|
|
|
163
193
|
编写页面内容前,先阅读 [`generation-standards.md`](../knowledge/custom-page/generation-standards.md)。
|
|
@@ -183,7 +213,7 @@ src/components/*.jsx
|
|
|
183
213
|
代码遵循以下约束:
|
|
184
214
|
|
|
185
215
|
- 仅导入 [`generation-standards.md`](../knowledge/custom-page/generation-standards.md)“依赖白名单”中的包及其子路径
|
|
186
|
-
- 使用页面上下文时,从 `@/context/app-context` 导入 `useSdkClient`、`useI18n`、`useNavigate`、`useLocation`、`useAppTheme`
|
|
216
|
+
- 使用页面上下文时,从 `@/context/app-context` 导入 `useSdkClient`、`useI18n`、`useNavigate`、`useLocation`、`useAppTheme`、`useAgent`
|
|
187
217
|
- 数据读取或写入前,先确认数据集及 SDK 用法;接口或字段无法从现有事实确认时,不得猜测请求协议
|
|
188
218
|
- 所有用户可见文案通过 `$i18n.t("key")` 获取,并在 `src/locales/index.js` 提供有效翻译
|
|
189
219
|
- 路由跳转使用 `navigate`,读取地址信息使用 `location`;关联页面优先使用 `navigate("/pagecode", { onePage: true })`
|
|
@@ -199,7 +229,7 @@ src/components/*.jsx
|
|
|
199
229
|
1. 先用 `page custom-detail --id <pageId>` 读取最新页面文件,避免覆盖其他尚未发布的修改
|
|
200
230
|
2. 确认提交内容包含全部需要保留的文件,入口、样式、词包和组件之间的导入路径一致
|
|
201
231
|
3. 对照 [`generation-standards.md`](../knowledge/custom-page/generation-standards.md) 检查依赖白名单、国际化、路由、样式和数据契约
|
|
202
|
-
4. 使用组件或内置方法时,分别对照 `components.md` 和 `generation-standards.md`
|
|
232
|
+
4. 使用组件或内置方法时,分别对照 `components.md` 和 `generation-standards.md` 中的“页面上下文内置能力”,确认不存在未登记的属性、方法或返回结构假设;涉及 Agent 侧边栏时,对照本指南“Agent 侧边栏”中的方法、载荷字段与事件
|
|
203
233
|
5. 先完成“页面生成规范”中的静态自检,再执行 `page custom-update --dry-run`。CLI 会阻止缺少 React 源码或存在基础 JS/JSX/TS/TSX 语法错误的内容,但不推断变量引用、模块导出、数据契约或运行时行为
|
|
204
234
|
6. 更新后再次执行 `page custom-detail --id <pageId>`,确认最新保存的 `codeContent` 与提交内容一致
|
|
205
235
|
7. 需要让用户查看已发布页面时,先检查最新 `data.status`。状态为 `FORMAL` 时跳过发布;否则执行 `page custom-publish --dry-run`、取得确认后发布,并确认 `data.after.status` 为 `FORMAL` 和 `data.runtimePageUrl` 已返回
|
|
@@ -147,16 +147,116 @@ import {
|
|
|
147
147
|
useI18n,
|
|
148
148
|
useNavigate,
|
|
149
149
|
useLocation,
|
|
150
|
+
useAgent,
|
|
150
151
|
} from "@/context/app-context";
|
|
151
152
|
```
|
|
152
153
|
|
|
153
|
-
| 能力
|
|
154
|
-
|
|
|
154
|
+
| 能力 | 已确认用途 | 使用前应确认 | 详细规则 |
|
|
155
|
+
| --- | --- | --- | --- |
|
|
155
156
|
| `useSdkClient` | 获取当前页面的数据客户端 | 目标数据集、字段、操作和 SDK 调用方式 | 与 `@lovrabet/sdk` 客户端行为一致(见“数据客户端”) |
|
|
156
|
-
| `useI18n`
|
|
157
|
-
| `useNavigate`
|
|
158
|
-
| `useLocation`
|
|
159
|
-
| `useAppTheme`
|
|
157
|
+
| `useI18n` | 获取页面国际化实例 | 词条 key 和词包翻译 | 见“国际化” |
|
|
158
|
+
| `useNavigate` | 获取页面路由跳转方法 | 目标页面 code 和跳转方式 | 见“导航” |
|
|
159
|
+
| `useLocation` | 获取当前地址信息 | 需要读取的地址信息 | 见“导航” |
|
|
160
|
+
| `useAppTheme` | 获取当前主题 | 主题是否可用与组件兼容性 | 见“主题配置” |
|
|
161
|
+
| `useAgent` | 控制应用内置 Agent 侧边栏 | 目标会话、预填内容和用户触发时机 | 见“使用 Agent 侧边栏” |
|
|
162
|
+
|
|
163
|
+
### 使用 Agent 侧边栏
|
|
164
|
+
|
|
165
|
+
页面通过 `useAgent()` 控制应用内置的 Agent 侧边栏:打开、关闭、指定会话、预填输入框以及订阅事件。侧边栏由平台常驻挂载,无需初始化,也无需判断就绪状态;不得自行创建实例。同一应用内所有页面共享同一个侧边栏和会话状态。
|
|
166
|
+
|
|
167
|
+
适合放在页面里的场景是:页面负责收集、筛选和确认业务上下文,Agent 负责承接需要多步执行、跨数据组合或持续追问的任务。
|
|
168
|
+
|
|
169
|
+
#### 典型场景
|
|
170
|
+
|
|
171
|
+
- **承接当前页面的业务对象**:页面已展示某条记录(审批单、合同、工单、客户、报表等),用户点击“让 Agent 处理”后,把记录标识、关键字段摘要和期望结果预填给 Agent,由它查询明细、补充数据、生成文档或推进后续操作;过程中用户可在侧边栏继续追问、修正条件、确认结果。
|
|
172
|
+
- **页面只做选择,Agent 做执行**:页面完成筛选和勾选后,把选中对象与约束交给 Agent,避免在页面里堆叠复杂的分支操作和二次确认流程;执行结果回到页面后由用户复核。
|
|
173
|
+
- **需要跨数据源或多步推理**:页面只能展示单一数据集,但用户还要组合多个数据集、做汇总对比或生成分析结论时,引导到侧边栏,用同一会话持续迭代。
|
|
174
|
+
- **回到既有会话继续处理**:用户从待办列表重新进入某个业务对象时,用 `sessionId` 恢复上次会话,延续上下文,而不是重新描述一遍需求。
|
|
175
|
+
- **需要持续推进的长任务**:页面触发一次后即可离开当前区块,用户稍后在侧边栏查看进度、补充信息或调整目标。
|
|
176
|
+
|
|
177
|
+
#### 编写建议
|
|
178
|
+
|
|
179
|
+
- `text` 中写清业务对象标识(如记录 id)、关键字段摘要和期望产出;不要只传“帮我处理一下”,否则 Agent 无法定位数据。
|
|
180
|
+
- 大段或敏感数据先做摘要、传标识,由 Agent 在权限范围内读取,不要把整表数据拼接进 `text`。
|
|
181
|
+
- 需要立即执行用 `autoSubmit: true`;需要用户补全或确认时省略该字段,只做预填并聚焦输入框。
|
|
182
|
+
- 同一业务对象建议固定复用同一 `sessionId`,并通过 `sessionChanged` 记录会话归属,方便用户下次回到该上下文。
|
|
183
|
+
|
|
184
|
+
#### 方法
|
|
185
|
+
|
|
186
|
+
| 方法 | 用途 | 说明 |
|
|
187
|
+
| --- | --- | --- |
|
|
188
|
+
| `agent.open()` | 打开侧边栏 | 不改变当前会话;`/chat` 路由下忽略 |
|
|
189
|
+
| `agent.close()` | 关闭侧边栏 | 保留当前会话和 URL 中的 `chat_info`,再次 `open()` 或 `call()` 即可恢复 |
|
|
190
|
+
| `agent.destroy()` | 还原侧边栏状态 | 清空当前会话与显隐,并从 URL 中移除 `chat_info`;下次调用从新会话开始 |
|
|
191
|
+
| `agent.isOpen()` | 读取侧边栏是否展示 | 返回 `boolean` |
|
|
192
|
+
| `agent.call(action, payload?)` | 向侧边栏发送命令 | 返回 `Promise`;侧边栏关闭时会自动打开 |
|
|
193
|
+
| `agent.on(action, handler)` | 订阅侧边栏事件 | 返回退订函数;`action="*"` 订阅全部事件 |
|
|
194
|
+
| `agent.onMessageLinkClick(handler, options?)` | 接管消息内链接点击 | 注册即开启接管,默认阻止链接默认跳转 |
|
|
195
|
+
|
|
196
|
+
`call("setSenderInput", payload)` 在输入框中预填内容,可选自动提交:
|
|
197
|
+
|
|
198
|
+
| 字段 | 类型 | 默认 | 说明 |
|
|
199
|
+
| --- | --- | --- | --- |
|
|
200
|
+
| `text` | `string` | — | 预填的纯文本 |
|
|
201
|
+
| `files` | `File[]` | — | 本地文件,先上传沙箱再作为文件引用插入输入框 |
|
|
202
|
+
| `autoSubmit` | `boolean` | `false` | 预填后立即提交输入框当前内容 |
|
|
203
|
+
| `newSession` | `boolean` | `false` | 在新会话中执行;默认复用当前会话 |
|
|
204
|
+
| `sessionId` | `string \| null` | — | 目标会话 id,优先于 `newSession`;传 `null` 表示新会话 |
|
|
205
|
+
|
|
206
|
+
- `text` 与 `files` 至少提供一个;只传 `sessionId` 时表示仅切换会话,不预填内容。
|
|
207
|
+
- 返回值为 `{ ok: true, sessionId, files }`;参数不合法或发送器未就绪时返回 `{ ok: false, error }`。
|
|
208
|
+
- `sessionId` 与当前会话不同时,会先切换会话再预填或提交;以返回的 `sessionId` 为准,不假设指定会话一定存在或有权访问。
|
|
209
|
+
|
|
210
|
+
其他命令:
|
|
211
|
+
|
|
212
|
+
| 命令 | 载荷 | 用途 |
|
|
213
|
+
| --- | --- | --- |
|
|
214
|
+
| `call("focusSender")` | 无 | 聚焦侧边栏输入框 |
|
|
215
|
+
| `call("clearSenderInput")` | 无 | 清空侧边栏输入框 |
|
|
216
|
+
| `call("interceptMessageLinks", { preventDefault })` | `preventDefault?: boolean` | 开启消息内链接点击上报;通常直接使用 `onMessageLinkClick` |
|
|
217
|
+
|
|
218
|
+
可订阅事件:
|
|
219
|
+
|
|
220
|
+
| 事件 | 载荷 | 触发时机 |
|
|
221
|
+
| --- | --- | --- |
|
|
222
|
+
| `sessionChanged` | `{ sessionId: string \| null }` | 侧边栏切换或新建会话;`destroy()` 时上报 `null` |
|
|
223
|
+
| `senderPrefilled` | `{ text, files, sessionId }` | `setSenderInput` 完成预填后 |
|
|
224
|
+
| `messageLinkClick` | 链接详情对象 | 已接管消息内链接点击时,用户点击消息中的链接 |
|
|
225
|
+
| `"*"` | 原事件载荷 | 任一事件发生时;回调第二个参数为事件名 |
|
|
226
|
+
|
|
227
|
+
```jsx
|
|
228
|
+
const App = () => {
|
|
229
|
+
const agent = useAgent();
|
|
230
|
+
|
|
231
|
+
useEffect(() => {
|
|
232
|
+
const off = agent.on("sessionChanged", ({ sessionId }) => {
|
|
233
|
+
console.log("当前会话", sessionId);
|
|
234
|
+
});
|
|
235
|
+
return off;
|
|
236
|
+
}, [agent]);
|
|
237
|
+
|
|
238
|
+
return (
|
|
239
|
+
<Button
|
|
240
|
+
onClick={() =>
|
|
241
|
+
agent.call("setSenderInput", {
|
|
242
|
+
text: "帮我总结当前页面的数据",
|
|
243
|
+
autoSubmit: false,
|
|
244
|
+
})
|
|
245
|
+
}
|
|
246
|
+
>
|
|
247
|
+
询问 Agent
|
|
248
|
+
</Button>
|
|
249
|
+
);
|
|
250
|
+
};
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
使用边界:
|
|
254
|
+
|
|
255
|
+
- 这些调用会直接改变用户可见的侧边栏、写入输入框,`autoSubmit` 还会立即向 Agent 发送消息。只能在用户明确操作(如按钮点击)后调用,不得在模块加载、渲染过程或 `useEffect` 中自动触发。
|
|
256
|
+
- `agent.call` 返回的 Promise 可能 reject(例如 `/chat` 路由下不可用)。必须 `await` 并捕获异常,向用户给出明确反馈。
|
|
257
|
+
- `/chat` 路由及其子路由下侧边栏不展示,`agent.call` 会 reject;在这些页面中不要提供唤起侧边栏的入口。
|
|
258
|
+
- 只使用本节登记的 action、载荷字段和事件名,不传未登记参数,不依赖未返回的字段。
|
|
259
|
+
- `files` 必须是浏览器 `File` 对象;从接口获取或自行构造的文件内容需先转换为 `File` 再传入。
|
|
160
260
|
|
|
161
261
|
### 主题配置
|
|
162
262
|
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"name": "rabetbase",
|
|
4
4
|
"packageName": "@lovrabet/rabetbase-cli",
|
|
5
|
-
"packageVersion": "2.5.
|
|
6
|
-
"skillVersion": "2.5.
|
|
5
|
+
"packageVersion": "2.5.13-beta.1",
|
|
6
|
+
"skillVersion": "2.5.13-beta.1",
|
|
7
7
|
"files": [
|
|
8
8
|
"SKILL.md",
|
|
9
9
|
"guides/approval-flow-development-workflow.md",
|
|
@@ -159,5 +159,5 @@
|
|
|
159
159
|
"references/rabetbase-user-account.md",
|
|
160
160
|
"references/rabetbase-workspace.md"
|
|
161
161
|
],
|
|
162
|
-
"digest": "
|
|
162
|
+
"digest": "c4115e1cead1f78aeef3cc2b25b4a05d1a10f487b975d286d87ac61799d0e565"
|
|
163
163
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
2
|
"src/app/index.css": ".page-container {\n padding: 12px;\n color: var(--ant-color-text);\n background: var(--ant-color-bg-layout);\n}\n",
|
|
3
|
-
"src/app/index.jsx": "import { Card, ConfigProvider, theme as antdTheme } from \"antd\";\nimport {\n useAppTheme,\n useI18n,\n useLocation,\n useNavigate,\n useSdkClient,\n} from \"@/context/app-context\";\nimport { locales } from \"../locales\";\nimport \"./index.css\";\n\nconst App = () => {\n const client = useSdkClient();\n const $i18n = useI18n();\n const navigate = useNavigate();\n const location = useLocation();\n const theme = useAppTheme();\n\n $i18n.addLocale(locales);\n\n return (\n <ConfigProvider\n theme={{\n algorithm:\n theme?.mode === \"dark\"\n ? antdTheme.darkAlgorithm\n : antdTheme.defaultAlgorithm,\n cssVar: { key: \"blank-theme\" },\n ...(theme?.skinColor\n ? { token: { colorPrimary: theme.skinColor } }\n : {}),\n }}\n >\n <main className=\"blank-theme page-container\">\n <Card>{$i18n.t(\"pageDescription\")}</Card>\n </main>\n </ConfigProvider>\n );\n};\n\nexport default App;\n",
|
|
3
|
+
"src/app/index.jsx": "import { Card, ConfigProvider, theme as antdTheme } from \"antd\";\nimport {\n useAgent,\n useAppTheme,\n useI18n,\n useLocation,\n useNavigate,\n useSdkClient,\n} from \"@/context/app-context\";\nimport { locales } from \"../locales\";\nimport \"./index.css\";\n\nconst App = () => {\n const client = useSdkClient();\n const $i18n = useI18n();\n const navigate = useNavigate();\n const location = useLocation();\n const theme = useAppTheme();\n const agent = useAgent();\n\n $i18n.addLocale(locales);\n\n return (\n <ConfigProvider\n theme={{\n algorithm:\n theme?.mode === \"dark\"\n ? antdTheme.darkAlgorithm\n : antdTheme.defaultAlgorithm,\n cssVar: { key: \"blank-theme\" },\n ...(theme?.skinColor\n ? { token: { colorPrimary: theme.skinColor } }\n : {}),\n }}\n >\n <main className=\"blank-theme page-container\">\n <Card>{$i18n.t(\"pageDescription\")}</Card>\n </main>\n </ConfigProvider>\n );\n};\n\nexport default App;\n",
|
|
4
4
|
"src/locales/index.js": "export const locales = {\n 'zh-CN': {\n pageDescription: '这是一个基础页面模板,你可以在此基础上进行开发',\n },\n 'en-US': {\n pageDescription: 'This is a basic page template, you can develop based on it',\n },\n 'ja-JP': {\n pageDescription: 'これは基本ページテンプレートです。あなたは、これに基づいて開発できます',\n },\n 'tr-TR': {\n pageDescription: 'Bu bir temel sayfa şablonudur. Bu temaplana dayanarak geliştirilebilir',\n },\n 'id-ID': {\n pageDescription: 'Ini adalah sebuah halaman dasar. Anda dapat mengembangkan ini',\n },\n};\n"
|
|
5
5
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
2
|
"src/app/index.css": ".dashboard-container {\n padding: 12px;\n color: var(--ant-color-text);\n background: var(--ant-color-bg-layout);\n}\n.dashboard-toolbar {\n display: flex;\n justify-content: flex-end;\n margin-bottom: 20px;\n}\n.dashboard-metrics__list,\n.dashboard-grid,\n.dashboard-split,\n.dashboard-chart-grid {\n display: grid;\n gap: 12px;\n}\n.dashboard-card__content,\n.dashboard-metrics__list,\n.dashboard-grid,\n.dashboard-split,\n.dashboard-chart-grid,\n.dashboard-chart-card,\n.dashboard-chart-card .ant-card-body,\n.dashboard-chart {\n min-width: 0;\n}\n.dashboard-metrics,\n.dashboard-section {\n margin-bottom: 12px;\n}\n.dashboard-metrics__list {\n grid-template-columns: repeat(4, minmax(0, 1fr));\n}\n.dashboard-card {\n min-width: 0;\n padding: 12px;\n border-radius: 8px;\n background: var(--ant-color-bg-container);\n box-shadow: var(--ant-box-shadow-tertiary);\n}\n.dashboard-card__title {\n display: block;\n color: var(--ant-color-text-heading);\n font-size: 16px;\n font-weight: 600;\n}\n.dashboard-card__content {\n margin-top: 12px;\n}\n.dashboard-metric {\n height: 100%;\n border-radius: 8px;\n transition:\n box-shadow 0.3s ease,\n transform 0.3s ease;\n}\n.dashboard-metric:hover {\n box-shadow: var(--ant-box-shadow-secondary);\n cursor: pointer;\n transform: translateY(-2px);\n}\n.dashboard-metric__body {\n display: flex;\n min-height: 118px;\n flex-direction: column;\n}\n.dashboard-metric__statistic {\n text-align: left;\n}\n.dashboard-metric .ant-statistic-content {\n color: var(--ant-color-text-heading);\n font-weight: 700;\n}\n.dashboard-metric .ant-statistic-content-suffix {\n color: var(--ant-color-text);\n font-size: 14px;\n}\n.dashboard-metric__trend {\n display: flex;\n align-items: center;\n gap: 8px;\n margin-top: auto;\n color: var(--ant-color-text-secondary);\n font-size: 12px;\n line-height: 1.4;\n}\n.dashboard-metric__trend-value {\n color: var(--ant-color-error);\n font-weight: 700;\n}\n.dashboard-chart-card {\n display: flex;\n height: 100%;\n flex-direction: column;\n}\n.dashboard-chart-card .ant-card-body {\n flex: 1;\n}\n.dashboard-chart-card__header {\n padding: 0 12px;\n border-bottom: 2px solid var(--ant-color-primary);\n}\n.dashboard-chart-card__title {\n color: var(--ant-color-text);\n font-weight: 600;\n}\n.dashboard-grid,\n.dashboard-split,\n.dashboard-chart-grid {\n grid-template-columns: repeat(2, minmax(0, 1fr));\n}\n.dashboard-chart {\n width: 100%;\n height: 220px;\n}\n.dashboard-chart--trend {\n height: 244px;\n}\n@media (max-width: 960px) {\n .dashboard-metrics__list {\n grid-template-columns: repeat(2, minmax(0, 1fr));\n }\n}\n@media (max-width: 600px) {\n .dashboard-toolbar .ant-picker {\n width: 100%;\n }\n .dashboard-metrics__list,\n .dashboard-grid,\n .dashboard-chart-grid,\n .dashboard-split {\n grid-template-columns: 1fr;\n }\n}\n",
|
|
3
|
-
"src/app/index.jsx": "import { useEffect, useRef, useState } from \"react\";\nimport {\n Card,\n ConfigProvider,\n DatePicker,\n Statistic,\n Tag,\n theme as antdTheme,\n} from \"antd\";\nimport * as echarts from \"echarts/core\";\nimport { BarChart, FunnelChart, LineChart, PieChart } from \"echarts/charts\";\nimport {\n GridComponent,\n LegendComponent,\n TooltipComponent,\n} from \"echarts/components\";\nimport { CanvasRenderer } from \"echarts/renderers\";\nimport {\n useAppTheme,\n useI18n,\n useLocation,\n useNavigate,\n useSdkClient,\n} from \"@/context/app-context\";\nimport { locales } from \"../locales\";\nimport \"./index.css\";\n\necharts.use([\n BarChart,\n FunnelChart,\n LineChart,\n PieChart,\n GridComponent,\n LegendComponent,\n TooltipComponent,\n CanvasRenderer,\n]);\n\nconst DETAIL_PAGE_CODE = \"/replace-with-dashboard-detail-page-code\";\nconst metrics = [\n {\n key: \"dealAmount\",\n value: 128.6,\n precision: 1,\n suffix: \"unit.tenThousand\",\n },\n {\n key: \"paymentAmount\",\n value: 96.2,\n precision: 1,\n suffix: \"unit.tenThousand\",\n },\n { key: \"newOpportunities\", value: 36, suffix: \"unit.count\" },\n { key: \"newCustomers\", value: 18, suffix: \"unit.count\" },\n];\nconst documents = [\n [\"sales.opportunity\", 86],\n [\"sales.quotation\", 54],\n [\"sales.order\", 31],\n [\"sales.payment\", 22],\n];\nconst channels = [\n [\"channel.online\", 42],\n [\"channel.referral\", 28],\n [\"channel.event\", 18],\n [\"channel.other\", 12],\n];\nconst customerLevels = [\n [\"customer.a\", 28],\n [\"customer.b\", 35],\n [\"customer.c\", 24],\n [\"customer.d\", 13],\n];\nconst opportunityStages = [\n [\"stage.contact\", 34],\n [\"stage.requirement\", 29],\n [\"stage.solution\", 22],\n [\"stage.contract\", 15],\n];\nconst revenueTrend = [42, 54, 48, 68, 73, 65, 82, 91, 86, 102, 109, 128];\nconst departments = [\n [\"department.east\", 92],\n [\"department.south\", 86],\n [\"department.north\", 79],\n [\"department.west\", 72],\n];\n\nconst getThemeConfig = (appTheme) => ({\n algorithm:\n appTheme?.mode === \"dark\"\n ? antdTheme.darkAlgorithm\n : antdTheme.defaultAlgorithm,\n components: {\n Card: { bodyPadding: 12 },\n Statistic: { contentFontSize: 24, titleFontSize: 14 },\n },\n cssVar: { key: \"dashboard-theme\" },\n token: {\n borderRadius: 8,\n ...(appTheme?.skinColor ? { colorPrimary: appTheme.skinColor } : {}),\n },\n});\n\nconst Section = ({ children, className = \"\", title }) => (\n <section className={[\"dashboard-card\", className].filter(Boolean).join(\" \")}>\n <span className=\"dashboard-card__title\">{title}</span>\n <div className=\"dashboard-card__content\">{children}</div>\n </section>\n);\n\nconst ChartSection = ({ children, title }) => (\n <Card\n className=\"dashboard-chart-card\"\n classNames={{\n header: \"dashboard-chart-card__header\",\n title: \"dashboard-chart-card__title\",\n }}\n title={title}\n >\n {children}\n </Card>\n);\n\nconst createPieOption = (data, $i18n, colors, token) => ({\n color: colors,\n legend: {\n bottom: 0,\n left: \"center\",\n textStyle: { color: token.colorTextSecondary },\n },\n series: [\n {\n data: data.map(([key, value]) => ({ name: $i18n.t(key), value })),\n emphasis: {\n itemStyle: {\n shadowBlur: 10,\n shadowColor: token.colorBgMask,\n shadowOffsetX: 0,\n },\n },\n radius: \"50%\",\n type: \"pie\",\n },\n ],\n tooltip: { trigger: \"item\" },\n});\n\nconst createBarOption = (data, $i18n, colors, token, horizontal = false) => {\n const labels = data.map(([key]) => $i18n.t(key));\n const categoryAxis = {\n axisLabel: { color: token.colorTextSecondary },\n axisLine: { lineStyle: { color: token.colorBorderSecondary } },\n data: labels,\n type: \"category\",\n };\n const valueAxis = {\n axisLabel: { color: token.colorTextSecondary },\n splitLine: { lineStyle: { color: token.colorBorderSecondary } },\n type: \"value\",\n };\n\n return {\n grid: horizontal\n ? { bottom: 16, containLabel: true, left: 16, right: 16, top: 20 }\n : { bottom: 52, containLabel: true, left: 16, right: 16, top: 20 },\n series: [\n {\n barMaxWidth: 18,\n data: data.map(([, value], index) => ({\n itemStyle: { color: colors[index % colors.length] },\n value,\n })),\n type: \"bar\",\n },\n ],\n tooltip: { trigger: \"axis\" },\n xAxis: horizontal ? valueAxis : categoryAxis,\n yAxis: horizontal ? categoryAxis : valueAxis,\n };\n};\n\nconst Chart = ({ className = \"\", onItemClick, option }) => {\n const elementRef = useRef(null);\n const chartRef = useRef(null);\n\n useEffect(() => {\n const chart = echarts.init(elementRef.current);\n const resize = () => chart.resize();\n\n chartRef.current = chart;\n window.addEventListener(\"resize\", resize);\n\n return () => {\n window.removeEventListener(\"resize\", resize);\n chart.dispose();\n chartRef.current = null;\n };\n }, []);\n\n useEffect(() => {\n chartRef.current?.setOption(option, { notMerge: true });\n }, [option]);\n\n useEffect(() => {\n const chart = chartRef.current;\n\n if (!chart || !onItemClick) return;\n\n chart.on(\"click\", onItemClick);\n return () => {\n if (!chart.isDisposed()) chart.off(\"click\", onItemClick);\n };\n }, [onItemClick]);\n\n return (\n <div\n className={[\"dashboard-chart\", className].filter(Boolean).join(\" \")}\n ref={elementRef}\n />\n );\n};\n\nconst DashboardContent = () => {\n const client = useSdkClient();\n const $i18n = useI18n();\n const navigate = useNavigate();\n const location = useLocation();\n const { token } = antdTheme.useToken();\n const [filter, setFilter] = useState({ factor: 1, range: [] });\n const chartColors = [\n token.colorPrimary,\n token.colorInfo,\n token.colorSuccess,\n token.colorWarning,\n ];\n\n const scale = (data) =>\n data.map(([key, value]) => [key, Math.round(value * filter.factor)]);\n const filteredRevenueTrend = revenueTrend.map((value) =>\n Math.round(value * filter.factor),\n );\n\n $i18n.addLocale(locales);\n\n const openDetail = ({ name, value }) =>\n navigate(DETAIL_PAGE_CODE, {\n onePage: true,\n state: {\n dimension: name,\n filterRange: filter.range,\n from: location.pathname + location.search,\n value,\n },\n });\n\n const changeRange = (dates) => {\n if (!dates) {\n setFilter({ factor: 1, range: [] });\n return;\n }\n\n const days = dates[1].diff(dates[0], \"day\") + 1;\n setFilter({\n factor: Math.max(0.75, Math.min(1.25, days / 30)),\n range: dates.map((date) => date.format(\"YYYY-MM-DD\")),\n });\n };\n\n return (\n <main className=\"dashboard-container\">\n <div className=\"dashboard-toolbar\">\n <DatePicker.RangePicker\n allowClear={false}\n onChange={changeRange}\n placeholder={[\n $i18n.t(\"date.startPlaceholder\"),\n $i18n.t(\"date.endPlaceholder\"),\n ]}\n />\n </div>\n\n <Section className=\"dashboard-metrics\" title={$i18n.t(\"metrics.title\")}>\n <div className=\"dashboard-metrics__list\">\n {metrics.map((metric) => {\n const value = Number(\n (metric.value * filter.factor).toFixed(metric.precision ?? 0),\n );\n const openMetric = () =>\n openDetail({\n name: $i18n.t(\"metrics.\" + metric.key),\n value,\n });\n\n return (\n <Card\n className=\"dashboard-metric\"\n classNames={{ body: \"dashboard-metric__body\" }}\n key={metric.key}\n onClick={openMetric}\n onKeyDown={(event) => {\n if (event.key === \"Enter\" || event.key === \" \") openMetric();\n }}\n role=\"button\"\n tabIndex={0}\n title={$i18n.t(\"detail.pageCodeHint\")}\n >\n <Statistic\n className=\"dashboard-metric__statistic\"\n precision={metric.precision}\n suffix={$i18n.t(metric.suffix)}\n title={$i18n.t(\"metrics.\" + metric.key)}\n value={value}\n />\n <span className=\"dashboard-metric__trend\">\n {$i18n.t(\"monthOnMonth\")}\n <span className=\"dashboard-metric__trend-value\">\n +{(8 + filter.factor * 4.8).toFixed(1)}%\n </span>\n </span>\n </Card>\n );\n })}\n </div>\n </Section>\n\n <Section\n className=\"dashboard-section\"\n title={$i18n.t(\"salesConversion\")}\n >\n <div className=\"dashboard-chart-grid\">\n <ChartSection title={$i18n.t(\"salesDocuments\")}>\n <Chart\n onItemClick={openDetail}\n option={{\n color: chartColors,\n series: [\n {\n data: scale(documents).map(([key, value]) => ({\n name: $i18n.t(key),\n value,\n })),\n label: { formatter: \"{b} {c}\", position: \"inside\" },\n type: \"funnel\",\n },\n ],\n tooltip: { trigger: \"item\" },\n }}\n />\n </ChartSection>\n <ChartSection title={$i18n.t(\"salesChannels\")}>\n <Chart\n onItemClick={openDetail}\n option={createBarOption(\n scale(channels),\n $i18n,\n chartColors,\n token,\n )}\n />\n </ChartSection>\n </div>\n </Section>\n\n <Section\n className=\"dashboard-section\"\n title={$i18n.t(\"customerOpportunityAnalysis\")}\n >\n <div className=\"dashboard-split\">\n <ChartSection title={$i18n.t(\"customerLevel\")}>\n <Chart\n onItemClick={openDetail}\n option={createPieOption(\n scale(customerLevels),\n $i18n,\n chartColors,\n token,\n )}\n />\n </ChartSection>\n <ChartSection title={$i18n.t(\"opportunityStage\")}>\n <Chart\n onItemClick={openDetail}\n option={createBarOption(\n scale(opportunityStages),\n $i18n,\n chartColors,\n token,\n true,\n )}\n />\n </ChartSection>\n </div>\n </Section>\n\n <section className=\"dashboard-grid\">\n <ChartSection title={$i18n.t(\"revenueDealTrendAnalysis\")}>\n <Chart\n className=\"dashboard-chart--trend\"\n onItemClick={openDetail}\n option={{\n color: [token.colorPrimary],\n grid: { bottom: 28, left: 40, right: 16, top: 20 },\n tooltip: { trigger: \"axis\" },\n xAxis: {\n axisLabel: { color: token.colorTextSecondary },\n axisLine: {\n lineStyle: { color: token.colorBorderSecondary },\n },\n boundaryGap: false,\n data: filteredRevenueTrend.map(\n (_, index) => index + 1 + $i18n.t(\"month\"),\n ),\n type: \"category\",\n },\n yAxis: {\n axisLabel: { color: token.colorTextSecondary },\n splitLine: {\n lineStyle: { color: token.colorBorderSecondary },\n },\n type: \"value\",\n },\n series: [\n {\n areaStyle: { opacity: 0.16 },\n data: filteredRevenueTrend,\n lineStyle: { width: 3 },\n smooth: true,\n type: \"line\",\n },\n ],\n }}\n />\n </ChartSection>\n <ChartSection title={$i18n.t(\"departmentEfficiency\")}>\n <Chart\n onItemClick={openDetail}\n option={createPieOption(\n scale(departments),\n $i18n,\n chartColors,\n token,\n )}\n />\n <Tag color={token.colorPrimary}>{$i18n.t(\"efficiencyHint\")}</Tag>\n </ChartSection>\n </section>\n </main>\n );\n};\n\nconst Dashboard = () => {\n const theme = useAppTheme();\n\n return (\n <ConfigProvider theme={getThemeConfig(theme)}>\n <DashboardContent />\n </ConfigProvider>\n );\n};\n\nexport default Dashboard;\n",
|
|
3
|
+
"src/app/index.jsx": "import { useEffect, useRef, useState } from \"react\";\nimport {\n Card,\n ConfigProvider,\n DatePicker,\n Statistic,\n Tag,\n theme as antdTheme,\n} from \"antd\";\nimport * as echarts from \"echarts/core\";\nimport { BarChart, FunnelChart, LineChart, PieChart } from \"echarts/charts\";\nimport {\n GridComponent,\n LegendComponent,\n TooltipComponent,\n} from \"echarts/components\";\nimport { CanvasRenderer } from \"echarts/renderers\";\nimport {\n useAgent,\n useAppTheme,\n useI18n,\n useLocation,\n useNavigate,\n useSdkClient,\n} from \"@/context/app-context\";\nimport { locales } from \"../locales\";\nimport \"./index.css\";\n\necharts.use([\n BarChart,\n FunnelChart,\n LineChart,\n PieChart,\n GridComponent,\n LegendComponent,\n TooltipComponent,\n CanvasRenderer,\n]);\n\nconst DETAIL_PAGE_CODE = \"/replace-with-dashboard-detail-page-code\";\nconst metrics = [\n {\n key: \"dealAmount\",\n value: 128.6,\n precision: 1,\n suffix: \"unit.tenThousand\",\n },\n {\n key: \"paymentAmount\",\n value: 96.2,\n precision: 1,\n suffix: \"unit.tenThousand\",\n },\n { key: \"newOpportunities\", value: 36, suffix: \"unit.count\" },\n { key: \"newCustomers\", value: 18, suffix: \"unit.count\" },\n];\nconst documents = [\n [\"sales.opportunity\", 86],\n [\"sales.quotation\", 54],\n [\"sales.order\", 31],\n [\"sales.payment\", 22],\n];\nconst channels = [\n [\"channel.online\", 42],\n [\"channel.referral\", 28],\n [\"channel.event\", 18],\n [\"channel.other\", 12],\n];\nconst customerLevels = [\n [\"customer.a\", 28],\n [\"customer.b\", 35],\n [\"customer.c\", 24],\n [\"customer.d\", 13],\n];\nconst opportunityStages = [\n [\"stage.contact\", 34],\n [\"stage.requirement\", 29],\n [\"stage.solution\", 22],\n [\"stage.contract\", 15],\n];\nconst revenueTrend = [42, 54, 48, 68, 73, 65, 82, 91, 86, 102, 109, 128];\nconst departments = [\n [\"department.east\", 92],\n [\"department.south\", 86],\n [\"department.north\", 79],\n [\"department.west\", 72],\n];\n\nconst getThemeConfig = (appTheme) => ({\n algorithm:\n appTheme?.mode === \"dark\"\n ? antdTheme.darkAlgorithm\n : antdTheme.defaultAlgorithm,\n components: {\n Card: { bodyPadding: 12 },\n Statistic: { contentFontSize: 24, titleFontSize: 14 },\n },\n cssVar: { key: \"dashboard-theme\" },\n token: {\n borderRadius: 8,\n ...(appTheme?.skinColor ? { colorPrimary: appTheme.skinColor } : {}),\n },\n});\n\nconst Section = ({ children, className = \"\", title }) => (\n <section className={[\"dashboard-card\", className].filter(Boolean).join(\" \")}>\n <span className=\"dashboard-card__title\">{title}</span>\n <div className=\"dashboard-card__content\">{children}</div>\n </section>\n);\n\nconst ChartSection = ({ children, title }) => (\n <Card\n className=\"dashboard-chart-card\"\n classNames={{\n header: \"dashboard-chart-card__header\",\n title: \"dashboard-chart-card__title\",\n }}\n title={title}\n >\n {children}\n </Card>\n);\n\nconst createPieOption = (data, $i18n, colors, token) => ({\n color: colors,\n legend: {\n bottom: 0,\n left: \"center\",\n textStyle: { color: token.colorTextSecondary },\n },\n series: [\n {\n data: data.map(([key, value]) => ({ name: $i18n.t(key), value })),\n emphasis: {\n itemStyle: {\n shadowBlur: 10,\n shadowColor: token.colorBgMask,\n shadowOffsetX: 0,\n },\n },\n radius: \"50%\",\n type: \"pie\",\n },\n ],\n tooltip: { trigger: \"item\" },\n});\n\nconst createBarOption = (data, $i18n, colors, token, horizontal = false) => {\n const labels = data.map(([key]) => $i18n.t(key));\n const categoryAxis = {\n axisLabel: { color: token.colorTextSecondary },\n axisLine: { lineStyle: { color: token.colorBorderSecondary } },\n data: labels,\n type: \"category\",\n };\n const valueAxis = {\n axisLabel: { color: token.colorTextSecondary },\n splitLine: { lineStyle: { color: token.colorBorderSecondary } },\n type: \"value\",\n };\n\n return {\n grid: horizontal\n ? { bottom: 16, containLabel: true, left: 16, right: 16, top: 20 }\n : { bottom: 52, containLabel: true, left: 16, right: 16, top: 20 },\n series: [\n {\n barMaxWidth: 18,\n data: data.map(([, value], index) => ({\n itemStyle: { color: colors[index % colors.length] },\n value,\n })),\n type: \"bar\",\n },\n ],\n tooltip: { trigger: \"axis\" },\n xAxis: horizontal ? valueAxis : categoryAxis,\n yAxis: horizontal ? categoryAxis : valueAxis,\n };\n};\n\nconst Chart = ({ className = \"\", onItemClick, option }) => {\n const elementRef = useRef(null);\n const chartRef = useRef(null);\n\n useEffect(() => {\n const chart = echarts.init(elementRef.current);\n const resize = () => chart.resize();\n\n chartRef.current = chart;\n window.addEventListener(\"resize\", resize);\n\n return () => {\n window.removeEventListener(\"resize\", resize);\n chart.dispose();\n chartRef.current = null;\n };\n }, []);\n\n useEffect(() => {\n chartRef.current?.setOption(option, { notMerge: true });\n }, [option]);\n\n useEffect(() => {\n const chart = chartRef.current;\n\n if (!chart || !onItemClick) return;\n\n chart.on(\"click\", onItemClick);\n return () => {\n if (!chart.isDisposed()) chart.off(\"click\", onItemClick);\n };\n }, [onItemClick]);\n\n return (\n <div\n className={[\"dashboard-chart\", className].filter(Boolean).join(\" \")}\n ref={elementRef}\n />\n );\n};\n\nconst DashboardContent = () => {\n const client = useSdkClient();\n const agent = useAgent();\n const $i18n = useI18n();\n const navigate = useNavigate();\n const location = useLocation();\n const { token } = antdTheme.useToken();\n const [filter, setFilter] = useState({ factor: 1, range: [] });\n const chartColors = [\n token.colorPrimary,\n token.colorInfo,\n token.colorSuccess,\n token.colorWarning,\n ];\n\n const scale = (data) =>\n data.map(([key, value]) => [key, Math.round(value * filter.factor)]);\n const filteredRevenueTrend = revenueTrend.map((value) =>\n Math.round(value * filter.factor),\n );\n\n $i18n.addLocale(locales);\n\n const openDetail = ({ name, value }) =>\n navigate(DETAIL_PAGE_CODE, {\n onePage: true,\n state: {\n dimension: name,\n filterRange: filter.range,\n from: location.pathname + location.search,\n value,\n },\n });\n\n const changeRange = (dates) => {\n if (!dates) {\n setFilter({ factor: 1, range: [] });\n return;\n }\n\n const days = dates[1].diff(dates[0], \"day\") + 1;\n setFilter({\n factor: Math.max(0.75, Math.min(1.25, days / 30)),\n range: dates.map((date) => date.format(\"YYYY-MM-DD\")),\n });\n };\n\n return (\n <main className=\"dashboard-container\">\n <div className=\"dashboard-toolbar\">\n <DatePicker.RangePicker\n allowClear={false}\n onChange={changeRange}\n placeholder={[\n $i18n.t(\"date.startPlaceholder\"),\n $i18n.t(\"date.endPlaceholder\"),\n ]}\n />\n </div>\n\n <Section className=\"dashboard-metrics\" title={$i18n.t(\"metrics.title\")}>\n <div className=\"dashboard-metrics__list\">\n {metrics.map((metric) => {\n const value = Number(\n (metric.value * filter.factor).toFixed(metric.precision ?? 0),\n );\n const openMetric = () =>\n openDetail({\n name: $i18n.t(\"metrics.\" + metric.key),\n value,\n });\n\n return (\n <Card\n className=\"dashboard-metric\"\n classNames={{ body: \"dashboard-metric__body\" }}\n key={metric.key}\n onClick={openMetric}\n onKeyDown={(event) => {\n if (event.key === \"Enter\" || event.key === \" \") openMetric();\n }}\n role=\"button\"\n tabIndex={0}\n title={$i18n.t(\"detail.pageCodeHint\")}\n >\n <Statistic\n className=\"dashboard-metric__statistic\"\n precision={metric.precision}\n suffix={$i18n.t(metric.suffix)}\n title={$i18n.t(\"metrics.\" + metric.key)}\n value={value}\n />\n <span className=\"dashboard-metric__trend\">\n {$i18n.t(\"monthOnMonth\")}\n <span className=\"dashboard-metric__trend-value\">\n +{(8 + filter.factor * 4.8).toFixed(1)}%\n </span>\n </span>\n </Card>\n );\n })}\n </div>\n </Section>\n\n <Section\n className=\"dashboard-section\"\n title={$i18n.t(\"salesConversion\")}\n >\n <div className=\"dashboard-chart-grid\">\n <ChartSection title={$i18n.t(\"salesDocuments\")}>\n <Chart\n onItemClick={openDetail}\n option={{\n color: chartColors,\n series: [\n {\n data: scale(documents).map(([key, value]) => ({\n name: $i18n.t(key),\n value,\n })),\n label: { formatter: \"{b} {c}\", position: \"inside\" },\n type: \"funnel\",\n },\n ],\n tooltip: { trigger: \"item\" },\n }}\n />\n </ChartSection>\n <ChartSection title={$i18n.t(\"salesChannels\")}>\n <Chart\n onItemClick={openDetail}\n option={createBarOption(\n scale(channels),\n $i18n,\n chartColors,\n token,\n )}\n />\n </ChartSection>\n </div>\n </Section>\n\n <Section\n className=\"dashboard-section\"\n title={$i18n.t(\"customerOpportunityAnalysis\")}\n >\n <div className=\"dashboard-split\">\n <ChartSection title={$i18n.t(\"customerLevel\")}>\n <Chart\n onItemClick={openDetail}\n option={createPieOption(\n scale(customerLevels),\n $i18n,\n chartColors,\n token,\n )}\n />\n </ChartSection>\n <ChartSection title={$i18n.t(\"opportunityStage\")}>\n <Chart\n onItemClick={openDetail}\n option={createBarOption(\n scale(opportunityStages),\n $i18n,\n chartColors,\n token,\n true,\n )}\n />\n </ChartSection>\n </div>\n </Section>\n\n <section className=\"dashboard-grid\">\n <ChartSection title={$i18n.t(\"revenueDealTrendAnalysis\")}>\n <Chart\n className=\"dashboard-chart--trend\"\n onItemClick={openDetail}\n option={{\n color: [token.colorPrimary],\n grid: { bottom: 28, left: 40, right: 16, top: 20 },\n tooltip: { trigger: \"axis\" },\n xAxis: {\n axisLabel: { color: token.colorTextSecondary },\n axisLine: {\n lineStyle: { color: token.colorBorderSecondary },\n },\n boundaryGap: false,\n data: filteredRevenueTrend.map(\n (_, index) => index + 1 + $i18n.t(\"month\"),\n ),\n type: \"category\",\n },\n yAxis: {\n axisLabel: { color: token.colorTextSecondary },\n splitLine: {\n lineStyle: { color: token.colorBorderSecondary },\n },\n type: \"value\",\n },\n series: [\n {\n areaStyle: { opacity: 0.16 },\n data: filteredRevenueTrend,\n lineStyle: { width: 3 },\n smooth: true,\n type: \"line\",\n },\n ],\n }}\n />\n </ChartSection>\n <ChartSection title={$i18n.t(\"departmentEfficiency\")}>\n <Chart\n onItemClick={openDetail}\n option={createPieOption(\n scale(departments),\n $i18n,\n chartColors,\n token,\n )}\n />\n <Tag color={token.colorPrimary}>{$i18n.t(\"efficiencyHint\")}</Tag>\n </ChartSection>\n </section>\n </main>\n );\n};\n\nconst Dashboard = () => {\n const theme = useAppTheme();\n\n return (\n <ConfigProvider theme={getThemeConfig(theme)}>\n <DashboardContent />\n </ConfigProvider>\n );\n};\n\nexport default Dashboard;\n",
|
|
4
4
|
"src/locales/index.js": "export const locales = {\n \"zh-CN\": {\n monthOnMonth: \"环比\",\n month: \"月\",\n \"date.startPlaceholder\": \"开始日期\",\n \"date.endPlaceholder\": \"结束日期\",\n \"unit.tenThousand\": \"万\",\n \"unit.count\": \"个\",\n \"detail.pageCodeHint\": \"示例页面地址,请替换为实际明细页面 code\",\n \"metrics.title\": \"核心指标\",\n \"metrics.dealAmount\": \"成交金额\",\n \"metrics.paymentAmount\": \"回款金额\",\n \"metrics.newOpportunities\": \"新增商机\",\n \"metrics.newCustomers\": \"新增客户\",\n salesConversion: \"销售转化\",\n salesDocuments: \"销售单据\",\n salesChannels: \"销售渠道\",\n \"sales.opportunity\": \"销售机会\",\n \"sales.quotation\": \"报价单\",\n \"sales.order\": \"订单\",\n \"sales.payment\": \"回款\",\n \"channel.online\": \"线上获客\",\n \"channel.referral\": \"客户转介绍\",\n \"channel.event\": \"市场活动\",\n \"channel.other\": \"其他渠道\",\n customerOpportunityAnalysis: \"客户与商机分析\",\n customerLevel: \"客户等级\",\n opportunityStage: \"商机阶段\",\n \"customer.a\": \"A 级客户\",\n \"customer.b\": \"B 级客户\",\n \"customer.c\": \"C 级客户\",\n \"customer.d\": \"D 级客户\",\n \"stage.contact\": \"初步接触\",\n \"stage.requirement\": \"需求确认\",\n \"stage.solution\": \"方案制定\",\n \"stage.contract\": \"合同签约\",\n revenueDealTrendAnalysis: \"营收与成交趋势分析\",\n departmentEfficiency: \"部门效能\",\n \"department.east\": \"华东销售部\",\n \"department.south\": \"华南销售部\",\n \"department.north\": \"华北销售部\",\n \"department.west\": \"华西销售部\",\n efficiencyHint: \"整体转化效率较上月提升 8.6%\",\n },\n \"en-US\": {\n monthOnMonth: \"MoM\",\n month: \"M\",\n \"date.startPlaceholder\": \"Start date\",\n \"date.endPlaceholder\": \"End date\",\n \"unit.tenThousand\": \"10k\",\n \"unit.count\": \"items\",\n \"detail.pageCodeHint\": \"Replace the example path with the detail page code\",\n \"metrics.title\": \"Key metrics\",\n \"metrics.dealAmount\": \"Deal amount\",\n \"metrics.paymentAmount\": \"Payment amount\",\n \"metrics.newOpportunities\": \"New opportunities\",\n \"metrics.newCustomers\": \"New customers\",\n salesConversion: \"Sales conversion\",\n salesDocuments: \"Sales documents\",\n salesChannels: \"Sales channels\",\n \"sales.opportunity\": \"Opportunity\",\n \"sales.quotation\": \"Quotation\",\n \"sales.order\": \"Order\",\n \"sales.payment\": \"Payment\",\n \"channel.online\": \"Online\",\n \"channel.referral\": \"Referral\",\n \"channel.event\": \"Event\",\n \"channel.other\": \"Other\",\n customerOpportunityAnalysis: \"Customer and opportunity analysis\",\n customerLevel: \"Customer level\",\n opportunityStage: \"Opportunity stage\",\n \"customer.a\": \"Level A\",\n \"customer.b\": \"Level B\",\n \"customer.c\": \"Level C\",\n \"customer.d\": \"Level D\",\n \"stage.contact\": \"Initial contact\",\n \"stage.requirement\": \"Requirement\",\n \"stage.solution\": \"Solution\",\n \"stage.contract\": \"Contract\",\n revenueDealTrendAnalysis: \"Revenue and deal trend analysis\",\n departmentEfficiency: \"Department efficiency\",\n \"department.east\": \"East sales\",\n \"department.south\": \"South sales\",\n \"department.north\": \"North sales\",\n \"department.west\": \"West sales\",\n efficiencyHint: \"Overall conversion efficiency is up 8.6% month over month\",\n },\n};\n"
|
|
5
5
|
}
|