wezard 2.8.8 → 3.0.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/.claude-plugin/plugin.json +0 -6
- package/CLAUDE.md +36 -16
- package/README.md +41 -54
- package/cli/wezard.sh +3 -0
- package/config.example.jsonc +6 -8
- package/dist/cli/codex-hook.js +20 -4
- package/dist/cli/codex-hook.js.map +1 -1
- package/dist/cli/init.js +45 -8
- package/dist/cli/init.js.map +1 -1
- package/dist/cli/skills.js +113 -0
- package/dist/cli/skills.js.map +1 -0
- package/dist/cli/sync.js +32 -112
- package/dist/cli/sync.js.map +1 -1
- package/dist/daemon/apprentice.js +75 -0
- package/dist/daemon/apprentice.js.map +1 -0
- package/dist/daemon/approval.js +78 -20
- package/dist/daemon/approval.js.map +1 -1
- package/dist/daemon/channel-context.js +69 -0
- package/dist/daemon/channel-context.js.map +1 -0
- package/dist/daemon/channel-posts.js +53 -0
- package/dist/daemon/channel-posts.js.map +1 -0
- package/dist/daemon/channel-store.js +96 -0
- package/dist/daemon/channel-store.js.map +1 -0
- package/dist/daemon/channel.js +805 -0
- package/dist/daemon/channel.js.map +1 -0
- package/dist/daemon/chat-name.js +24 -161
- package/dist/daemon/chat-name.js.map +1 -1
- package/dist/daemon/classes.js +418 -0
- package/dist/daemon/classes.js.map +1 -0
- package/dist/daemon/config-api.js +11 -3
- package/dist/daemon/config-api.js.map +1 -1
- package/dist/daemon/danger.js +24 -205
- package/dist/daemon/danger.js.map +1 -1
- package/dist/daemon/detail.js +14 -8
- package/dist/daemon/detail.js.map +1 -1
- package/dist/daemon/handoff.js +266 -50
- package/dist/daemon/handoff.js.map +1 -1
- package/dist/daemon/http.js +25 -18
- package/dist/daemon/http.js.map +1 -1
- package/dist/daemon/idle-reap.js +30 -0
- package/dist/daemon/idle-reap.js.map +1 -0
- package/dist/daemon/inbound.js +366 -143
- package/dist/daemon/inbound.js.map +1 -1
- package/dist/daemon/index.js +2232 -2616
- package/dist/daemon/index.js.map +1 -1
- package/dist/daemon/last-response.js +44 -9
- package/dist/daemon/last-response.js.map +1 -1
- package/dist/daemon/memory-steward.js +1 -1
- package/dist/daemon/memory-steward.js.map +1 -1
- package/dist/daemon/message-format.js +10 -2
- package/dist/daemon/message-format.js.map +1 -1
- package/dist/daemon/mirror-bridge.js +714 -485
- package/dist/daemon/mirror-bridge.js.map +1 -1
- package/dist/daemon/mirror-store.js +24 -0
- package/dist/daemon/mirror-store.js.map +1 -1
- package/dist/daemon/notices.js +2 -2
- package/dist/daemon/notices.js.map +1 -1
- package/dist/daemon/onboarding.js +384 -0
- package/dist/daemon/onboarding.js.map +1 -0
- package/dist/daemon/outbound.js +21 -11
- package/dist/daemon/outbound.js.map +1 -1
- package/dist/daemon/peers.js +38 -230
- package/dist/daemon/peers.js.map +1 -1
- package/dist/daemon/pending.js +7 -5
- package/dist/daemon/pending.js.map +1 -1
- package/dist/daemon/picker-policy.js +27 -12
- package/dist/daemon/picker-policy.js.map +1 -1
- package/dist/daemon/plans.js.map +1 -1
- package/dist/daemon/room-auto-adhoc.js +18 -0
- package/dist/daemon/room-auto-adhoc.js.map +1 -0
- package/dist/daemon/room-facts.js +35 -0
- package/dist/daemon/room-facts.js.map +1 -0
- package/dist/daemon/room-hub.js +430 -0
- package/dist/daemon/room-hub.js.map +1 -0
- package/dist/daemon/room-overdue.js +98 -0
- package/dist/daemon/room-overdue.js.map +1 -0
- package/dist/daemon/room-prune.js +74 -0
- package/dist/daemon/room-prune.js.map +1 -0
- package/dist/daemon/room-spawn.js +20 -0
- package/dist/daemon/room-spawn.js.map +1 -0
- package/dist/daemon/room-watchdog.js +153 -0
- package/dist/daemon/room-watchdog.js.map +1 -0
- package/dist/daemon/rooms.js +107 -0
- package/dist/daemon/rooms.js.map +1 -0
- package/dist/daemon/route.js +7 -18
- package/dist/daemon/route.js.map +1 -1
- package/dist/daemon/spawn-tmux.js +171 -55
- package/dist/daemon/spawn-tmux.js.map +1 -1
- package/dist/daemon/steward-guard.js +2 -2
- package/dist/daemon/steward.js +132 -0
- package/dist/daemon/steward.js.map +1 -0
- package/dist/daemon/tasks.js +4 -14
- package/dist/daemon/tasks.js.map +1 -1
- package/dist/daemon/turn-opening.js +25 -0
- package/dist/daemon/turn-opening.js.map +1 -0
- package/dist/daemon/wake-tail.js +55 -0
- package/dist/daemon/wake-tail.js.map +1 -0
- package/dist/daemon/weixin-cmd.js +10 -14
- package/dist/daemon/weixin-cmd.js.map +1 -1
- package/dist/daemon/wezard-session.js +7 -2
- package/dist/daemon/wezard-session.js.map +1 -1
- package/dist/daemon/wizard-names.js +0 -22
- package/dist/daemon/wizard-names.js.map +1 -1
- package/dist/daemon/wizard.js +589 -145
- package/dist/daemon/wizard.js.map +1 -1
- package/dist/mcp/output.js +6 -5
- package/dist/mcp/output.js.map +1 -1
- package/dist/mcp/tools.js +258 -236
- package/dist/mcp/tools.js.map +1 -1
- package/dist/shared/allow-rules.js +32 -8
- package/dist/shared/allow-rules.js.map +1 -1
- package/dist/shared/charter-rearm.js +179 -0
- package/dist/shared/charter-rearm.js.map +1 -0
- package/dist/shared/chat-http.js +374 -459
- package/dist/shared/chat-http.js.map +1 -1
- package/dist/shared/chat-record.js +55 -0
- package/dist/shared/chat-record.js.map +1 -0
- package/dist/shared/chat-render.js +7 -4
- package/dist/shared/chat-render.js.map +1 -1
- package/dist/shared/chat-view.js +2 -41
- package/dist/shared/chat-view.js.map +1 -1
- package/dist/shared/cli-backends.js +27 -5
- package/dist/shared/cli-backends.js.map +1 -1
- package/dist/shared/config.js +122 -38
- package/dist/shared/config.js.map +1 -1
- package/dist/shared/detail-render.js +104 -21
- package/dist/shared/detail-render.js.map +1 -1
- package/dist/shared/detail-store.js.map +1 -1
- package/dist/shared/group-members.js +35 -0
- package/dist/shared/group-members.js.map +1 -0
- package/dist/shared/inject-view.js +105 -0
- package/dist/shared/inject-view.js.map +1 -0
- package/dist/shared/json-map-store.js +23 -6
- package/dist/shared/json-map-store.js.map +1 -1
- package/dist/shared/legacy-routes.js +199 -0
- package/dist/shared/legacy-routes.js.map +1 -0
- package/dist/shared/mem-guard.js +32 -0
- package/dist/shared/mem-guard.js.map +1 -0
- package/dist/shared/message-footer.js +4 -3
- package/dist/shared/message-footer.js.map +1 -1
- package/dist/shared/pricing.js +5 -0
- package/dist/shared/pricing.js.map +1 -1
- package/dist/shared/reminder.js +30 -38
- package/dist/shared/reminder.js.map +1 -1
- package/dist/shared/repl-script.js +114 -26
- package/dist/shared/repl-script.js.map +1 -1
- package/dist/shared/role-render.js +209 -210
- package/dist/shared/role-render.js.map +1 -1
- package/dist/shared/role-view.js +61 -299
- package/dist/shared/role-view.js.map +1 -1
- package/dist/shared/room-label.js +13 -0
- package/dist/shared/room-label.js.map +1 -0
- package/dist/shared/room-migrate.js +404 -0
- package/dist/shared/room-migrate.js.map +1 -0
- package/dist/shared/room-overdue.js +81 -0
- package/dist/shared/room-overdue.js.map +1 -0
- package/dist/shared/room-search.js +102 -0
- package/dist/shared/room-search.js.map +1 -0
- package/dist/shared/room-view.js +261 -0
- package/dist/shared/room-view.js.map +1 -0
- package/dist/shared/room.js +610 -0
- package/dist/shared/room.js.map +1 -0
- package/dist/shared/session-hooks.js +58 -0
- package/dist/shared/session-hooks.js.map +1 -0
- package/dist/shared/session-label.js +80 -60
- package/dist/shared/session-label.js.map +1 -1
- package/dist/shared/session-mcp.js +77 -0
- package/dist/shared/session-mcp.js.map +1 -0
- package/dist/shared/session-skills.js +63 -0
- package/dist/shared/session-skills.js.map +1 -0
- package/dist/shared/skill-sync.js +229 -0
- package/dist/shared/skill-sync.js.map +1 -0
- package/dist/shared/smarts.js +39 -0
- package/dist/shared/smarts.js.map +1 -0
- package/dist/shared/stream-page.js +22 -0
- package/dist/shared/stream-page.js.map +1 -0
- package/dist/shared/task-file.js +0 -5
- package/dist/shared/task-file.js.map +1 -1
- package/dist/shared/task-template.js +1 -1
- package/dist/shared/task-template.js.map +1 -1
- package/dist/shared/tool-hints.js +76 -17
- package/dist/shared/tool-hints.js.map +1 -1
- package/dist/shared/workspace-trust.js +8 -0
- package/dist/shared/workspace-trust.js.map +1 -1
- package/dist/shared/world.js +101 -166
- package/dist/shared/world.js.map +1 -1
- package/dist/svr/facts-store.js +26 -0
- package/dist/svr/facts-store.js.map +1 -0
- package/dist/svr/index.js +62 -6
- package/dist/svr/index.js.map +1 -1
- package/hooks/pre-tool-use.sh +18 -0
- package/hooks/stop.sh +26 -0
- package/package.json +7 -3
- package/scripts/install.sh +11 -0
- package/skills/LICENSE.wecom-unified.txt +21 -0
- package/skills/wecom-unified/SKILL.md +151 -0
- package/skills/wecom-unified/assets/templates/broadside/DESIGN.preset.md +172 -0
- package/skills/wecom-unified/assets/templates/broadside/shell/content.jsx +31 -0
- package/skills/wecom-unified/assets/templates/broadside/slides/01_cover.slide +48 -0
- package/skills/wecom-unified/assets/templates/broadside/slides/02_section.slide +58 -0
- package/skills/wecom-unified/assets/templates/broadside/slides/03_cards.slide +53 -0
- package/skills/wecom-unified/assets/templates/broadside/slides/04_image.slide +64 -0
- package/skills/wecom-unified/assets/templates/cartesian/DESIGN.preset.md +139 -0
- package/skills/wecom-unified/assets/templates/cartesian/shell/content.jsx +28 -0
- package/skills/wecom-unified/assets/templates/cartesian/slides/01_cover.slide +44 -0
- package/skills/wecom-unified/assets/templates/cartesian/slides/02_compare.slide +79 -0
- package/skills/wecom-unified/assets/templates/cartesian/slides/03_table.slide +79 -0
- package/skills/wecom-unified/assets/templates/cobalt-grid/DESIGN.preset.md +118 -0
- package/skills/wecom-unified/assets/templates/cobalt-grid/shell/content.jsx +24 -0
- package/skills/wecom-unified/assets/templates/cobalt-grid/slides/01_cover.slide +61 -0
- package/skills/wecom-unified/assets/templates/cobalt-grid/slides/02_structure.slide +85 -0
- package/skills/wecom-unified/assets/templates/cobalt-grid/slides/03_data.slide +60 -0
- package/skills/wecom-unified/assets/templates/editorial-forest/DESIGN.preset.md +135 -0
- package/skills/wecom-unified/assets/templates/editorial-forest/shell/content.jsx +19 -0
- package/skills/wecom-unified/assets/templates/editorial-forest/slides/01_cover.slide +29 -0
- package/skills/wecom-unified/assets/templates/editorial-forest/slides/02_cards.slide +60 -0
- package/skills/wecom-unified/assets/templates/editorial-forest/slides/03_data.slide +49 -0
- package/skills/wecom-unified/assets/templates/editorial-forest/slides/04_image.slide +46 -0
- package/skills/wecom-unified/assets/templates/emerald-editorial/DESIGN.preset.md +119 -0
- package/skills/wecom-unified/assets/templates/emerald-editorial/shell/content.jsx +18 -0
- package/skills/wecom-unified/assets/templates/emerald-editorial/slides/01_cover.slide +36 -0
- package/skills/wecom-unified/assets/templates/emerald-editorial/slides/02_section.slide +39 -0
- package/skills/wecom-unified/assets/templates/emerald-editorial/slides/03_data.slide +79 -0
- package/skills/wecom-unified/assets/templates/emerald-editorial/slides/04_steps.slide +53 -0
- package/skills/wecom-unified/assets/templates/grove/DESIGN.preset.md +159 -0
- package/skills/wecom-unified/assets/templates/grove/shell/content.jsx +18 -0
- package/skills/wecom-unified/assets/templates/grove/shell/content_light.jsx +18 -0
- package/skills/wecom-unified/assets/templates/grove/slides/01_cover.slide +26 -0
- package/skills/wecom-unified/assets/templates/grove/slides/02_compare.slide +92 -0
- package/skills/wecom-unified/assets/templates/grove/slides/03_table.slide +68 -0
- package/skills/wecom-unified/assets/templates/index.json +280 -0
- package/skills/wecom-unified/assets/templates/long-table/DESIGN.preset.md +135 -0
- package/skills/wecom-unified/assets/templates/long-table/shell/content.jsx +36 -0
- package/skills/wecom-unified/assets/templates/long-table/slides/01_cover.slide +71 -0
- package/skills/wecom-unified/assets/templates/long-table/slides/02_cards.slide +72 -0
- package/skills/wecom-unified/assets/templates/long-table/slides/03_timeline.slide +81 -0
- package/skills/wecom-unified/assets/templates/long-table/slides/04_image.slide +60 -0
- package/skills/wecom-unified/assets/templates/sakura-chroma/DESIGN.preset.md +121 -0
- package/skills/wecom-unified/assets/templates/sakura-chroma/shell/content.jsx +13 -0
- package/skills/wecom-unified/assets/templates/sakura-chroma/slides/01_cover.slide +54 -0
- package/skills/wecom-unified/assets/templates/sakura-chroma/slides/02_products.slide +134 -0
- package/skills/wecom-unified/assets/templates/sakura-chroma/slides/03_section.slide +30 -0
- package/skills/wecom-unified/assets/templates/sakura-chroma/slides/04_schedule.slide +65 -0
- package/skills/wecom-unified/assets/templates/signal/DESIGN.preset.md +121 -0
- package/skills/wecom-unified/assets/templates/signal/shell/content.jsx +18 -0
- package/skills/wecom-unified/assets/templates/signal/shell/content_dark.jsx +23 -0
- package/skills/wecom-unified/assets/templates/signal/slides/01_cover.slide +48 -0
- package/skills/wecom-unified/assets/templates/signal/slides/02_cards.slide +67 -0
- package/skills/wecom-unified/assets/templates/signal/slides/03_data.slide +68 -0
- package/skills/wecom-unified/references/wecomcli-calendar-agenda.md +227 -0
- package/skills/wecom-unified/references/wecomcli-calendar-cancel.md +108 -0
- package/skills/wecom-unified/references/wecomcli-calendar-create.md +238 -0
- package/skills/wecom-unified/references/wecomcli-calendar-freebusy.md +207 -0
- package/skills/wecom-unified/references/wecomcli-calendar-meeting-room.md +170 -0
- package/skills/wecom-unified/references/wecomcli-calendar-search.md +209 -0
- package/skills/wecom-unified/references/wecomcli-calendar-update.md +272 -0
- package/skills/wecom-unified/references/wecomcli-calendar.md +296 -0
- package/skills/wecom-unified/references/wecomcli-contact.md +48 -0
- package/skills/wecom-unified/references/wecomcli-disk.md +380 -0
- package/skills/wecom-unified/references/wecomcli-doc-contents-append.md +20 -0
- package/skills/wecom-unified/references/wecomcli-doc-contents-overwrite.md +27 -0
- package/skills/wecom-unified/references/wecomcli-doc-create.md +162 -0
- package/skills/wecom-unified/references/wecomcli-doc-manage-doc-members-update.md +24 -0
- package/skills/wecom-unified/references/wecomcli-doc-manage-doc-names-update.md +20 -0
- package/skills/wecom-unified/references/wecomcli-doc-manage-doc-rules-update.md +22 -0
- package/skills/wecom-unified/references/wecomcli-doc-manage.md +127 -0
- package/skills/wecom-unified/references/wecomcli-doc.md +135 -0
- package/skills/wecom-unified/references/wecomcli-email-forward-mail.md +131 -0
- package/skills/wecom-unified/references/wecomcli-email-get-mail.md +187 -0
- package/skills/wecom-unified/references/wecomcli-email-reply-mail.md +138 -0
- package/skills/wecom-unified/references/wecomcli-email-search-mail.md +114 -0
- package/skills/wecom-unified/references/wecomcli-email-security.md +52 -0
- package/skills/wecom-unified/references/wecomcli-email-send-mail.md +186 -0
- package/skills/wecom-unified/references/wecomcli-email-send-schedule.md +83 -0
- package/skills/wecom-unified/references/wecomcli-email.md +206 -0
- package/skills/wecom-unified/references/wecomcli-media.md +89 -0
- package/skills/wecom-unified/references/wecomcli-meeting-cancel.md +113 -0
- package/skills/wecom-unified/references/wecomcli-meeting-create.md +167 -0
- package/skills/wecom-unified/references/wecomcli-meeting-list.md +228 -0
- package/skills/wecom-unified/references/wecomcli-meeting-original-get.md +101 -0
- package/skills/wecom-unified/references/wecomcli-meeting-search.md +176 -0
- package/skills/wecom-unified/references/wecomcli-meeting-update.md +217 -0
- package/skills/wecom-unified/references/wecomcli-meeting.md +366 -0
- package/skills/wecom-unified/references/wecomcli-message.md +190 -0
- package/skills/wecom-unified/references/wecomcli-pptx-component-animation.md +62 -0
- package/skills/wecom-unified/references/wecomcli-pptx-component-box.md +102 -0
- package/skills/wecom-unified/references/wecomcli-pptx-component-chart.md +261 -0
- package/skills/wecom-unified/references/wecomcli-pptx-component-codeblock.md +70 -0
- package/skills/wecom-unified/references/wecomcli-pptx-component-diagram.md +54 -0
- package/skills/wecom-unified/references/wecomcli-pptx-component-faicon.md +71 -0
- package/skills/wecom-unified/references/wecomcli-pptx-component-hyperlink.md +55 -0
- package/skills/wecom-unified/references/wecomcli-pptx-component-image.md +107 -0
- package/skills/wecom-unified/references/wecomcli-pptx-component-math.md +65 -0
- package/skills/wecom-unified/references/wecomcli-pptx-component-qrcode.md +22 -0
- package/skills/wecom-unified/references/wecomcli-pptx-component-slide.md +74 -0
- package/skills/wecom-unified/references/wecomcli-pptx-component-svg.md +95 -0
- package/skills/wecom-unified/references/wecomcli-pptx-component-table.md +72 -0
- package/skills/wecom-unified/references/wecomcli-pptx-component-text.md +96 -0
- package/skills/wecom-unified/references/wecomcli-pptx-content-contract.md +73 -0
- package/skills/wecom-unified/references/wecomcli-pptx-create-from-material.md +67 -0
- package/skills/wecom-unified/references/wecomcli-pptx-create-from-scratch.md +178 -0
- package/skills/wecom-unified/references/wecomcli-pptx-create-from-template.md +123 -0
- package/skills/wecom-unified/references/wecomcli-pptx-design-principle.md +65 -0
- package/skills/wecom-unified/references/wecomcli-pptx-government-contract.md +40 -0
- package/skills/wecom-unified/references/wecomcli-pptx-human-alignment.md +140 -0
- package/skills/wecom-unified/references/wecomcli-pptx-pptx-api.md +161 -0
- package/skills/wecom-unified/references/wecomcli-pptx-pptx-edit.md +37 -0
- package/skills/wecom-unified/references/wecomcli-pptx-story-principle.md +184 -0
- package/skills/wecom-unified/references/wecomcli-pptx-templates-README.md +165 -0
- package/skills/wecom-unified/references/wecomcli-pptx-templates-anti-ai-slop.md +52 -0
- package/skills/wecom-unified/references/wecomcli-pptx.md +158 -0
- package/skills/wecom-unified/references/wecomcli-sheet-conditional-formatting.md +203 -0
- package/skills/wecom-unified/references/wecomcli-sheet-filter.md +179 -0
- package/skills/wecom-unified/references/wecomcli-sheet-float-image.md +235 -0
- package/skills/wecom-unified/references/wecomcli-sheet-formulas.md +71 -0
- package/skills/wecom-unified/references/wecomcli-sheet-history.md +118 -0
- package/skills/wecom-unified/references/wecomcli-sheet-protection.md +170 -0
- package/skills/wecom-unified/references/wecomcli-sheet-range-operations.md +306 -0
- package/skills/wecom-unified/references/wecomcli-sheet-read-data.md +151 -0
- package/skills/wecom-unified/references/wecomcli-sheet-search-replace.md +121 -0
- package/skills/wecom-unified/references/wecomcli-sheet-structure-operations.md +394 -0
- package/skills/wecom-unified/references/wecomcli-sheet-style.md +246 -0
- package/skills/wecom-unified/references/wecomcli-sheet-table-style.md +199 -0
- package/skills/wecom-unified/references/wecomcli-sheet-validation.md +217 -0
- package/skills/wecom-unified/references/wecomcli-sheet-visual-standards.md +166 -0
- package/skills/wecom-unified/references/wecomcli-sheet-workbook.md +264 -0
- package/skills/wecom-unified/references/wecomcli-sheet-write-cells.md +320 -0
- package/skills/wecom-unified/references/wecomcli-sheet-xlsx-process.md +324 -0
- package/skills/wecom-unified/references/wecomcli-sheet.md +96 -0
- package/skills/wecom-unified/references/wecomcli-smartpage-data-driven-pages.md +50 -0
- package/skills/wecom-unified/references/wecomcli-smartpage-edit.md +526 -0
- package/skills/wecom-unified/references/wecomcli-smartpage-formula-arraylist.md +369 -0
- package/skills/wecom-unified/references/wecomcli-smartpage-formula-datetime.md +283 -0
- package/skills/wecom-unified/references/wecomcli-smartpage-formula-logic.md +247 -0
- package/skills/wecom-unified/references/wecomcli-smartpage-formula-math.md +362 -0
- package/skills/wecom-unified/references/wecomcli-smartpage-formula-operators.md +246 -0
- package/skills/wecom-unified/references/wecomcli-smartpage-formula-pageblock.md +76 -0
- package/skills/wecom-unified/references/wecomcli-smartpage-formula-reference.md +192 -0
- package/skills/wecom-unified/references/wecomcli-smartpage-formula-templates.md +410 -0
- package/skills/wecom-unified/references/wecomcli-smartpage-formula-text.md +377 -0
- package/skills/wecom-unified/references/wecomcli-smartpage-formula-user.md +22 -0
- package/skills/wecom-unified/references/wecomcli-smartpage-mdx-syntax.md +739 -0
- package/skills/wecom-unified/references/wecomcli-smartpage.md +179 -0
- package/skills/wecom-unified/references/wecomcli-smartsheet-chart-types.md +95 -0
- package/skills/wecom-unified/references/wecomcli-smartsheet-common.md +160 -0
- package/skills/wecom-unified/references/wecomcli-smartsheet-edit.md +609 -0
- package/skills/wecom-unified/references/wecomcli-smartsheet-field-types.md +438 -0
- package/skills/wecom-unified/references/wecomcli-smartsheet-formula.md +845 -0
- package/skills/wecom-unified/references/wecomcli-smartsheet-read.md +411 -0
- package/skills/wecom-unified/references/wecomcli-smartsheet-record-values.md +218 -0
- package/skills/wecom-unified/references/wecomcli-smartsheet-template-ai_efficiency.md +709 -0
- package/skills/wecom-unified/references/wecomcli-smartsheet-template-connect_to_app.md +380 -0
- package/skills/wecom-unified/references/wecomcli-smartsheet-template-financial_accounting.md +369 -0
- package/skills/wecom-unified/references/wecomcli-smartsheet-template-hr_and_administration.md +475 -0
- package/skills/wecom-unified/references/wecomcli-smartsheet-template-ledger_records.md +156 -0
- package/skills/wecom-unified/references/wecomcli-smartsheet-template-manufacturing.md +395 -0
- package/skills/wecom-unified/references/wecomcli-smartsheet-template-marketing.md +186 -0
- package/skills/wecom-unified/references/wecomcli-smartsheet-template-office_essentials.md +299 -0
- package/skills/wecom-unified/references/wecomcli-smartsheet-template-personal_efficiency.md +70 -0
- package/skills/wecom-unified/references/wecomcli-smartsheet-template-procurement_logistics.md +325 -0
- package/skills/wecom-unified/references/wecomcli-smartsheet-template-project_management.md +564 -0
- package/skills/wecom-unified/references/wecomcli-smartsheet-template-rd_process_customer.md +222 -0
- package/skills/wecom-unified/references/wecomcli-smartsheet-template-rd_process_ops.md +105 -0
- package/skills/wecom-unified/references/wecomcli-smartsheet-template-rd_process_project.md +109 -0
- package/skills/wecom-unified/references/wecomcli-smartsheet-template-rd_process_research.md +92 -0
- package/skills/wecom-unified/references/wecomcli-smartsheet-template-sales_and_operations.md +446 -0
- package/skills/wecom-unified/references/wecomcli-smartsheet-template-store_management.md +431 -0
- package/skills/wecom-unified/references/wecomcli-smartsheet-template-team_tasks.md +274 -0
- package/skills/wecom-unified/references/wecomcli-smartsheet-template-wechat_customer.md +384 -0
- package/skills/wecom-unified/references/wecomcli-smartsheet-template-work_report.md +100 -0
- package/skills/wecom-unified/references/wecomcli-smartsheet-templates.md +53 -0
- package/skills/wecom-unified/references/wecomcli-smartsheet-view-types.md +373 -0
- package/skills/wecom-unified/references/wecomcli-smartsheet-webhook-examples.md +176 -0
- package/skills/wecom-unified/references/wecomcli-smartsheet-webhook.md +186 -0
- package/skills/wecom-unified/references/wecomcli-smartsheet.md +147 -0
- package/skills/wecom-unified/references/wecomcli-todo-create.md +137 -0
- package/skills/wecom-unified/references/wecomcli-todo-delete.md +63 -0
- package/skills/wecom-unified/references/wecomcli-todo-finish.md +72 -0
- package/skills/wecom-unified/references/wecomcli-todo-get.md +69 -0
- package/skills/wecom-unified/references/wecomcli-todo-list.md +136 -0
- package/skills/wecom-unified/references/wecomcli-todo-update.md +112 -0
- package/skills/wecom-unified/references/wecomcli-todo.md +68 -0
- package/skills/wecom-unified/scripts/build_docx.py +1274 -0
- package/skills/wecom-unified/scripts/build_page.py +2449 -0
- package/skills/wecom-unified/scripts/collect.py +868 -0
- package/skills/wecom-unified/scripts/doc_image_extractor.py +498 -0
- package/skills/wecom-unified/scripts/pptx2image.py +268 -0
- package/skills/wecom-unified/scripts/recalc.py +403 -0
- package/systemd/wezard.service.template +6 -0
- package/web/chat.css +70 -273
- package/web/chat.js +2228 -2190
- package/dist/daemon/chat-log.js +0 -130
- package/dist/daemon/chat-log.js.map +0 -1
- package/dist/daemon/dispatch.js +0 -6
- package/dist/daemon/dispatch.js.map +0 -1
- package/dist/daemon/idle-nudge.js +0 -69
- package/dist/daemon/idle-nudge.js.map +0 -1
- package/dist/daemon/message-events.js +0 -1083
- package/dist/daemon/message-events.js.map +0 -1
- package/dist/daemon/pending-items.js +0 -160
- package/dist/daemon/pending-items.js.map +0 -1
- package/dist/daemon/router.js +0 -742
- package/dist/daemon/router.js.map +0 -1
- package/dist/daemon/tips.js +0 -25
- package/dist/daemon/tips.js.map +0 -1
- package/dist/daemon/wedoc.js +0 -210
- package/dist/daemon/wedoc.js.map +0 -1
- package/dist/shared/role-search.js +0 -100
- package/dist/shared/role-search.js.map +0 -1
- package/dist/shared/startup-notice.js +0 -21
- package/dist/shared/startup-notice.js.map +0 -1
- package/dist/shared/turn-state.js +0 -27
- package/dist/shared/turn-state.js.map +0 -1
- package/hooks/hooks.json +0 -16
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
# 公式运算符 - =, !=, <>, ==, !==, >, >=, <, <=, +, -, *, /, ^, &
|
|
2
|
+
|
|
3
|
+
> 用于数值比较、文本拼接、四则运算等基础表达式构建,适用于条件筛选、数值计算、文本连接等场景。
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## = - 等于
|
|
8
|
+
|
|
9
|
+
**表达式**: `=`
|
|
10
|
+
|
|
11
|
+
**函数说明**: 等于
|
|
12
|
+
|
|
13
|
+
**参数说明**: 两个内容进行比较,比较内容是否相等,和顺序、格式等无关。
|
|
14
|
+
|
|
15
|
+
**示例**:
|
|
16
|
+
```
|
|
17
|
+
1 = "01" => TRUE // 文本字段的1和数字字段1是相等的
|
|
18
|
+
[1,2]=[2,1] => TRUE // 列表内容一致就是相等的
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## != - 不等于
|
|
24
|
+
|
|
25
|
+
**表达式**: `!=`
|
|
26
|
+
|
|
27
|
+
**函数说明**: 不等于
|
|
28
|
+
|
|
29
|
+
**参数说明**: 两个内容进行比较,比较内容是否不相等,和顺序、格式等无关。
|
|
30
|
+
|
|
31
|
+
**示例**:
|
|
32
|
+
```
|
|
33
|
+
1 !=2 => TRUE
|
|
34
|
+
[1,2,3] != [1,2] => TRUE
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## <> - 不等于
|
|
40
|
+
|
|
41
|
+
**表达式**: `<>`
|
|
42
|
+
|
|
43
|
+
**函数说明**: 不等于
|
|
44
|
+
|
|
45
|
+
**参数说明**: 两个内容进行比较,比较内容是否不相等,和顺序、格式等无关。
|
|
46
|
+
|
|
47
|
+
**示例**:
|
|
48
|
+
```
|
|
49
|
+
1 <> 2 => TRUE
|
|
50
|
+
[1,2,3] <> [1,2] => TRUE
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## == - 严格相等
|
|
56
|
+
|
|
57
|
+
**表达式**: `==`
|
|
58
|
+
|
|
59
|
+
**函数说明**: 严格相等
|
|
60
|
+
|
|
61
|
+
**参数说明**: 两个内容进行比较,比较内容、顺序、格式是否都一致。
|
|
62
|
+
|
|
63
|
+
**示例**:
|
|
64
|
+
```
|
|
65
|
+
1=="1" => FALSE
|
|
66
|
+
[1,2]==[2,1] => FALSE
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## !== - 严格不相等
|
|
72
|
+
|
|
73
|
+
**表达式**: `!==`
|
|
74
|
+
|
|
75
|
+
**函数说明**: 严格不相等
|
|
76
|
+
|
|
77
|
+
**参数说明**: 两个内容进行比较,比较内容、顺序、格式是否都一致。
|
|
78
|
+
|
|
79
|
+
**示例**:
|
|
80
|
+
```
|
|
81
|
+
1!=="1" => TRUE
|
|
82
|
+
[1,2] !== [2,1] => TRUE
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## > - 大于
|
|
88
|
+
|
|
89
|
+
**表达式**: `>`
|
|
90
|
+
|
|
91
|
+
**函数说明**: 大于
|
|
92
|
+
|
|
93
|
+
**参数说明**: 主要是数值类的大小比较
|
|
94
|
+
|
|
95
|
+
**示例**:
|
|
96
|
+
```
|
|
97
|
+
3>1 => TRUE
|
|
98
|
+
DATE(2026,5,22)>DATE(2026,5,10) => TRUE
|
|
99
|
+
[项目计划完成日期]>[项目实际完成日期] => TRUE // 判断项目是否按计划日期完工;结果为 TRUE 代表提前完成,否则代表延后。
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## >= - 大于等于
|
|
105
|
+
|
|
106
|
+
**表达式**: `>=`
|
|
107
|
+
|
|
108
|
+
**函数说明**: 大于等于
|
|
109
|
+
|
|
110
|
+
**参数说明**: 主要是数值类的大小比较
|
|
111
|
+
|
|
112
|
+
**示例**:
|
|
113
|
+
```
|
|
114
|
+
2>=2 => TRUE
|
|
115
|
+
DATE(2026,5,22)>=DATE(2026,5,22) => TRUE
|
|
116
|
+
[项目计划完成日期]>=[项目实际完成日期] => TRUE // 判断项目是否按计划完工;结果为 TRUE 代表提前或准时完成,否则代表延后。
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## < - 小于
|
|
122
|
+
|
|
123
|
+
**表达式**: `<`
|
|
124
|
+
|
|
125
|
+
**函数说明**: 小于
|
|
126
|
+
|
|
127
|
+
**参数说明**: 主要是数值类的大小比较
|
|
128
|
+
|
|
129
|
+
**示例**:
|
|
130
|
+
```
|
|
131
|
+
1< 3 => TRUE
|
|
132
|
+
DATE(2026,5,12)<DATE(2026,5,22) => TRUE
|
|
133
|
+
[项目实际完成日期]<[项目计划完成日期] => TRUE // 判断项目是否按计划日期完工;结果为 TRUE 代表项目提前完成,否则代表延后。
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
## <= - 小于等于
|
|
139
|
+
|
|
140
|
+
**表达式**: `<=`
|
|
141
|
+
|
|
142
|
+
**函数说明**: 小于等于
|
|
143
|
+
|
|
144
|
+
**参数说明**: 主要是数值类的大小比较
|
|
145
|
+
|
|
146
|
+
**示例**:
|
|
147
|
+
```
|
|
148
|
+
2<=2 => TRUE
|
|
149
|
+
DATE(2026,5,22)<=DATE(2026,5,22) => TRUE
|
|
150
|
+
[项目实际完成日期]<=[项目计划完成日期] => TRUE // 判断项目是否按计划日期完工;结果为 TRUE 代表项目提前或准时完成,否则代表延后。
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
## + - 加法
|
|
156
|
+
|
|
157
|
+
**表达式**: `+`
|
|
158
|
+
|
|
159
|
+
**函数说明**: 两个数值相加
|
|
160
|
+
|
|
161
|
+
**参数说明**: 左右两边相加的参数需要是数值型字段,比如数字、日期、进度;如果不是数值型字段会尝试转换为数值后参与计算。注意:+ 用于两个字段的简单相加。如果是多个字段求和,优先使用 SUM 函数。
|
|
162
|
+
|
|
163
|
+
**示例**:
|
|
164
|
+
```
|
|
165
|
+
"2"+1=> 3
|
|
166
|
+
[门店线上收入]+[门店线下收入]=> 总收入
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
## - - 减法
|
|
172
|
+
|
|
173
|
+
**表达式**: `-`
|
|
174
|
+
|
|
175
|
+
**函数说明**: 两个数值相减
|
|
176
|
+
|
|
177
|
+
**参数说明**: 左右两边相减的参数需要是数值型字段,比如数字、日期、进度;如果不是数值型字段会尝试转换为数值后参与计算。
|
|
178
|
+
|
|
179
|
+
**示例**:
|
|
180
|
+
```
|
|
181
|
+
3-1=> 2
|
|
182
|
+
[销售额]-[成本] => [利润]
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
---
|
|
186
|
+
|
|
187
|
+
## * - 乘法
|
|
188
|
+
|
|
189
|
+
**表达式**: `*`
|
|
190
|
+
|
|
191
|
+
**函数说明**: 两个数值相乘
|
|
192
|
+
|
|
193
|
+
**参数说明**: 左右两边相乘的参数需要是数值型字段,比如数字、日期、进度;如果不是数值型字段会尝试转换为数值后参与计算。
|
|
194
|
+
|
|
195
|
+
**示例**:
|
|
196
|
+
```
|
|
197
|
+
3*2=> 6
|
|
198
|
+
[订单量]*[商品单价]=> 销售额 //计算当个商品的销售额
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
---
|
|
202
|
+
|
|
203
|
+
## / - 除法
|
|
204
|
+
|
|
205
|
+
**表达式**: `/`
|
|
206
|
+
|
|
207
|
+
**函数说明**: 两个数值相除
|
|
208
|
+
|
|
209
|
+
**参数说明**: 左右两边相除的参数需要是数值型字段,且被除数不能为0,比如数字、日期、进度;如果不是数值型字段会尝试转换为数值后参与计算。
|
|
210
|
+
|
|
211
|
+
**示例**:
|
|
212
|
+
```
|
|
213
|
+
6/2=> 3
|
|
214
|
+
[销售额]/[目标额]=> 销售进度
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
---
|
|
218
|
+
|
|
219
|
+
## ^ - 求幂
|
|
220
|
+
|
|
221
|
+
**表达式**: `^`
|
|
222
|
+
|
|
223
|
+
**函数说明**: 求幂
|
|
224
|
+
|
|
225
|
+
**参数说明**: 计算数字的求幂结果
|
|
226
|
+
|
|
227
|
+
**示例**:
|
|
228
|
+
```
|
|
229
|
+
2^2=> 4
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
---
|
|
233
|
+
|
|
234
|
+
## & - 文本拼接
|
|
235
|
+
|
|
236
|
+
**表达式**: `&`
|
|
237
|
+
|
|
238
|
+
**函数说明**: 将两个文本进行拼接
|
|
239
|
+
|
|
240
|
+
**参数说明**: 将两个文本内容进行拼接,返回合并内容后的结果。
|
|
241
|
+
|
|
242
|
+
**示例**:
|
|
243
|
+
```
|
|
244
|
+
"智能" &"表格" => 智能表格
|
|
245
|
+
[项目名称]&[项目时间] => 项目名称2026年5月22日
|
|
246
|
+
```
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# 页面控件专用公式函数
|
|
2
|
+
|
|
3
|
+
> 用于在页面中打开外部链接或跳转其他页面,适用于超链接按钮、表单提交跳转、通过点击按钮跳转页面、修改数据库记录等场景。
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## OPENLINK - 打开链接
|
|
8
|
+
|
|
9
|
+
OPENLINK(链接地址, [打开方式])
|
|
10
|
+
|
|
11
|
+
在页面控件中打开指定的链接。
|
|
12
|
+
|
|
13
|
+
**示例**:
|
|
14
|
+
|
|
15
|
+
// 打开外部链接
|
|
16
|
+
OPENLINK("https://www.example.com")
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### 特殊用法 - 文档内页面互相跳转
|
|
20
|
+
|
|
21
|
+
当你知道当前 URL 时(currentUrl),你可以通过修改/拼接 `p=<page_id>` 参数,来跳转到 `<page_id>` 对应的页面。
|
|
22
|
+
|
|
23
|
+
// 假设 currentUrl="https://doc.weixin.qq.com/smartpage/<docid>?p=<current_page_id>"
|
|
24
|
+
|
|
25
|
+
// 假设你想跳转到 page_id 为 <new_page_id> 的页面
|
|
26
|
+
OPENLINK("https://doc.weixin.qq.com/smartpage/<docid>?p=<new_page_id>")
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## ADDRECORD - 对指定表添加一行记录
|
|
31
|
+
|
|
32
|
+
ADDRECORD(数据表,[字段1,值1,字段2,值2...])
|
|
33
|
+
|
|
34
|
+
**参数说明**:
|
|
35
|
+
- 数据表: 必填。表和视图,智能主页文档内的工作表和视图和图表
|
|
36
|
+
- 字段: 数据表或视图(包括图表)下的字段
|
|
37
|
+
- 值: 需要填入的字段值。不同字段类型,输入的格式不同
|
|
38
|
+
|
|
39
|
+
**示例**:
|
|
40
|
+
|
|
41
|
+
// 项目管理表新增一行记录
|
|
42
|
+
ADDRECORD([项目管理表])
|
|
43
|
+
|
|
44
|
+
// 项目管理表新增一行项目状态为"未开始"的记录
|
|
45
|
+
ADDRECORD([项目管理表],[项目状态],"未开始")
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## MODIFYRECORDS - 根据查询条件,修改数据表中某条/某些记录的值
|
|
50
|
+
|
|
51
|
+
场景:用于条件/非条件方式修改数据表中字段值。通过查询语句动态指定范围
|
|
52
|
+
|
|
53
|
+
MODIFYRECORDS(目标记录集, 字段1, 值1, [字段2, 值2...])
|
|
54
|
+
- 目标记录集:支持指定单条记录(如 [表].FIRST()),也**完全支持**通过 FILTER 函数动态查询出的多条记录集合(如 [表].FILTER(条件))。
|
|
55
|
+
|
|
56
|
+
示例 1:
|
|
57
|
+
// 将项目管理表首行记录的项目状态改为已完成
|
|
58
|
+
MODIFYRECORDS([项目管理表].FIRST(),[项目管理表.项目状态],"已完成")
|
|
59
|
+
|
|
60
|
+
示例 2:动态查询并修改
|
|
61
|
+
// 将项目管理表中状态为“未开始”的所有项目改为“已完成”
|
|
62
|
+
MODIFYRECORDS([项目管理表].FILTER([Each].[项目状态]="未开始"),[项目管理表.项目状态],"已完成")
|
|
63
|
+
|
|
64
|
+
// 将项目管理表中名为“张三”的人的*所有*项目状态都改为“已完成”
|
|
65
|
+
MODIFYRECORDS([项目管理表].FILTER([Each].[人名]="张三"),[项目管理表.项目状态],"已完成")
|
|
66
|
+
// 将项目管理表中名为“张三”的人的*第一个*项目状态改为“已完成”
|
|
67
|
+
MODIFYRECORDS([项目管理表].FILTER([Each].[人名]="张三").FIRST(),[项目管理表.项目状态],"已完成")
|
|
68
|
+
|
|
69
|
+
// 与页面绑定。设计有个输入框title为项目状态输入框
|
|
70
|
+
MODIFYRECORDS([项目管理表].FILTER([Each].[项目状态]=[页面1.项目状态输入框]),[项目管理表.项目状态],"已完成")
|
|
71
|
+
|
|
72
|
+
示例 3: 更复杂的示例,与条件语句组合,实现“有则修改,无则添加”
|
|
73
|
+
// 学生信息表中如果有学生姓名为 小妹 的,则把小孩数改成 50,否则插入一条。
|
|
74
|
+
IF([学生信息].FILTER([Each].[学生名称]="小妹").COUNTA()>0,MODIFYRECORDS([学生信息].FILTER([Each].[学生名称]="小妹"),[学生信息.小孩数],50),ADDRECORD([学生信息],[学生信息.学生名称],"小妹",[学生信息.小孩数],50))
|
|
75
|
+
|
|
76
|
+
> MODIFYRECORDS 结合 FILTER 是实现“查找并更新 (Find & Update)”的唯一标准做法,无需写成多步代码,一行公式即可实现查询+修改。
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
# 公式字符串语法指南
|
|
2
|
+
|
|
3
|
+
## 概述
|
|
4
|
+
|
|
5
|
+
公式字符串是智能文档(智能主页 / smartpage)中用于动态计算和数据处理的核心能力,可用于:
|
|
6
|
+
|
|
7
|
+
- 引用数据表字段或页面控件
|
|
8
|
+
- 执行函数运算与四则运算
|
|
9
|
+
- 表单字段自动计算
|
|
10
|
+
- 实现复杂的业务逻辑
|
|
11
|
+
|
|
12
|
+
**重要约束**:
|
|
13
|
+
|
|
14
|
+
- 公式中优先使用语义化引用:`[页面名.控件名]`、`[表名.字段名]`、`[字段名]`(仅限当前记录上下文),避免直接使用控件id。
|
|
15
|
+
- 公式系统**仅支持**本目录下文档列出的函数与运算符;未列出的(如取模 `%`、三元 `?:`)一律不支持,遇到无法表达的需求应直接告知用户。
|
|
16
|
+
- 字符串值用**双引号**包裹(如 `"完成"`),不能用单引号。
|
|
17
|
+
- 函数用法以本文档为准,不要凭 Excel/JS 经验编写。
|
|
18
|
+
|
|
19
|
+
## 函数分类索引
|
|
20
|
+
|
|
21
|
+
按需求场景定位对应文档;一个需求涉及多类时,逐条查阅。
|
|
22
|
+
|
|
23
|
+
| 分类 | 适用场景 / 关键能力 | 查阅文档 |
|
|
24
|
+
| --- | --- | --- |
|
|
25
|
+
| 日期时间 | 日期构造 DATE、当前日期 NOW/TODAY、日期比较与差值、工作日计算;倒计时、工龄、截止日期判断 | [formula/datetime.md](wecomcli-smartpage-formula-datetime.md) |
|
|
26
|
+
| 用户信息 | 获取当前登录用户信息;个人任务筛选、数据权限、我的待办 | [formula/user.md](wecomcli-smartpage-formula-user.md) |
|
|
27
|
+
| 数学计算 | SUM、AVERAGE、MAX/MIN、COUNT/COUNTA、COUNTIF、SUMIF、ROUND 等数值计算与统计汇总;金额计算 | [formula/math.md](wecomcli-smartpage-formula-math.md) |
|
|
28
|
+
| 逻辑判断 | IF、AND、OR、ISBLANK 条件判断与空值/错误处理;数据校验、状态显示、条件渲染 | [formula/logic.md](wecomcli-smartpage-formula-logic.md) |
|
|
29
|
+
| 文本处理 | 文本拼接 `&`、LEFT/RIGHT 截取、SUBSTITUTE 替换、格式化、大小写;姓名规范化、日期格式化 | [formula/text.md](wecomcli-smartpage-formula-text.md) |
|
|
30
|
+
| 数组列表 | FILTER 筛选、数组提取/合并/去重;数据统计、关联查询、列表处理 | [formula/arraylist.md](wecomcli-smartpage-formula-arraylist.md) |
|
|
31
|
+
| 页面动作 | 打开外部链接、跳转页面、按钮点击修改数据(OPENLINK / MODIFYRECORDS / ADDRECORD) | [formula/pageblock.md](wecomcli-smartpage-formula-pageblock.md) |
|
|
32
|
+
| 运算符 | 四则运算 `+-*/`、比较运算 `> < =`、文本拼接 `&`;条件筛选、数值计算 | [formula/operators.md](wecomcli-smartpage-formula-operators.md) |
|
|
33
|
+
| 实用模板 | 排名、环比增长、重复标记、进度跟踪、日期提醒、工龄计算、逾期判断等开箱即用模板 | [formula/templates.md](wecomcli-smartpage-formula-templates.md) |
|
|
34
|
+
|
|
35
|
+
## 公式语法
|
|
36
|
+
|
|
37
|
+
### 引用语法
|
|
38
|
+
|
|
39
|
+
页面公式(按钮 `formulaString`、`<formulaSpan>`、控件 `defaultValueFormula` 等)**优先使用下列三种带前缀的语义化引用形式**;禁止使用裸字段(如 `[字段名]`)。
|
|
40
|
+
|
|
41
|
+
| 引用对象 | 写法 | 说明 |
|
|
42
|
+
| --- | --- | --- |
|
|
43
|
+
| 数据表字段 | `[表名.字段名]` | 返回该字段在整张表中的值数组;`表名` 用数据表实际名称、`字段名` 用 `field.name`,不要写 `tableId`/`blockId` |
|
|
44
|
+
| 整张数据表 | `[表名]` | 用于配合 `.FILTER()`、`.COUNTA()` 等链式调用 |
|
|
45
|
+
| 页面控件 | `[页面名.控件名]` | `页面名` 是页面实际名称,`控件名` 是控件的 `title`/`name`;必须带页面名前缀 |
|
|
46
|
+
|
|
47
|
+
**示例**
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
[销售表.金额] // 数据表字段
|
|
51
|
+
[订单表] // 整张表
|
|
52
|
+
[学生信息页.学生姓名] // 页面控件
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
**通用规则**
|
|
56
|
+
|
|
57
|
+
- 表名、字段名、页面名、控件名一律放在方括号 `[]` 内
|
|
58
|
+
- 字符串值用双引号 `""` 包裹(`"是"`、`"否"`)
|
|
59
|
+
- 函数名全大写(`SUM`、`FILTER`、`IF`)
|
|
60
|
+
|
|
61
|
+
## 常见错误
|
|
62
|
+
|
|
63
|
+
### 字段引用格式错误
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
// [反例] 页面公式省略表名(裸字段)
|
|
67
|
+
[销售额].SUM()
|
|
68
|
+
|
|
69
|
+
// [正例] 必须 [表名.字段名]
|
|
70
|
+
[销售表.销售额].SUM()
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### 引号使用错误
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
// [反例] 单引号
|
|
77
|
+
IF([状态] = '完成', "是", "否")
|
|
78
|
+
|
|
79
|
+
// [正例] 双引号
|
|
80
|
+
IF([状态] = "完成", "是", "否")
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### 括号不匹配
|
|
84
|
+
|
|
85
|
+
```
|
|
86
|
+
// [反例] 缺少闭合括号
|
|
87
|
+
IF([金额] > 1000, "大额"
|
|
88
|
+
|
|
89
|
+
// [正例]
|
|
90
|
+
IF([金额] > 1000, "大额", "小额")
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### 类型不匹配
|
|
94
|
+
|
|
95
|
+
```
|
|
96
|
+
// [反例] 文本字段做数学加法
|
|
97
|
+
[员工表.姓名] + [员工表.年龄]
|
|
98
|
+
|
|
99
|
+
// [正例] 文本拼接用 &
|
|
100
|
+
[员工表.姓名] & " " & [员工表.年龄]
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### FILTER / IF 多条件未包裹
|
|
104
|
+
|
|
105
|
+
多条件必须包在 `AND()` 或 `OR()` 内,不能在同一层级散写:
|
|
106
|
+
|
|
107
|
+
```
|
|
108
|
+
// [反例]
|
|
109
|
+
[任务表].FILTER([Each].[状态]="完成", [Each].[金额]>1000)
|
|
110
|
+
|
|
111
|
+
// [正例]
|
|
112
|
+
[任务表].FILTER(AND([Each].[状态]="完成", [Each].[金额]>1000))
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### 人员(user)字段的特殊规则
|
|
116
|
+
|
|
117
|
+
- **筛选**:推荐用 `CONTAINTEXT`(全等比较容易因显示名差异失败);与 `USER()` 比较时可使用 `=`:
|
|
118
|
+
|
|
119
|
+
```
|
|
120
|
+
[表.人员列].FILTER([Each].CONTAINTEXT("<英文名>(<中文名>)")).FIRST()
|
|
121
|
+
[任务表].FILTER([Each].[负责人] = USER())
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
- **赋值**:人员字段不支持直接用文本字面值赋值。`ADDRECORD([表], [表.人员列], "人名")` 是错的;应使用 `USER()` 或通过 `FILTER` 取其他人员列的值赋值。
|
|
125
|
+
|
|
126
|
+
## 场景示例
|
|
127
|
+
|
|
128
|
+
### 示例 1:销售数据分析
|
|
129
|
+
|
|
130
|
+
```
|
|
131
|
+
// 总销售额
|
|
132
|
+
[订单表.金额].SUM()
|
|
133
|
+
|
|
134
|
+
// 平均订单金额
|
|
135
|
+
[订单表.金额].AVERAGE()
|
|
136
|
+
|
|
137
|
+
// 大客户订单数量(金额 > 10000)
|
|
138
|
+
[订单表].FILTER([Each].[金额] > 10000).[订单号].COUNTA()
|
|
139
|
+
|
|
140
|
+
// 本月订单总额
|
|
141
|
+
[订单表].FILTER(MONTH([Each].[日期]) = MONTH(TODAY())).[金额].SUM()
|
|
142
|
+
|
|
143
|
+
// 统计销售额大于1000的销售总和
|
|
144
|
+
[商品销售表.销售额].SUMIF([Each]>1000)
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
### 示例 2:任务管理
|
|
148
|
+
|
|
149
|
+
```
|
|
150
|
+
// 已完成任务数
|
|
151
|
+
[任务表].FILTER([Each].[状态] = "完成").[任务名].COUNTA()
|
|
152
|
+
|
|
153
|
+
// 我负责的任务数(负责人为人员字段)
|
|
154
|
+
// 方法 1:与 USER() 直接比较
|
|
155
|
+
[任务表].FILTER([Each].[负责人] = USER()).[任务名].COUNTA()
|
|
156
|
+
|
|
157
|
+
// 方法 2:用 CONTAINTEXT 按文本匹配(推荐,规避显示名差异)
|
|
158
|
+
[任务表].FILTER([Each].[负责人].CONTAINTEXT("zhangsan")).[任务名].COUNTA()
|
|
159
|
+
|
|
160
|
+
// 超期任务数
|
|
161
|
+
[任务表].FILTER(AND([Each].[截止日期] < TODAY(), [Each].[状态] <> "完成")).[任务名].COUNTA()
|
|
162
|
+
|
|
163
|
+
// 任务完成率
|
|
164
|
+
[任务表].FILTER([Each].[状态] = "完成").[任务名].COUNTA() / [任务表.任务名].COUNTA() * 100
|
|
165
|
+
|
|
166
|
+
// 项目总预算
|
|
167
|
+
[项目主表.预算].SUM()
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
### 示例 3:员工信息
|
|
171
|
+
|
|
172
|
+
```
|
|
173
|
+
// 部门人数(页面公式写法:使用完整表名前缀)
|
|
174
|
+
[员工表].FILTER([Each].[部门] = "研发部").[姓名].COUNTA()
|
|
175
|
+
|
|
176
|
+
// 平均工龄
|
|
177
|
+
[员工表.入职日期].AVERAGE()
|
|
178
|
+
|
|
179
|
+
// 全名(页面公式中需使用 [表名.字段名])
|
|
180
|
+
[员工表.姓] & [员工表.名]
|
|
181
|
+
|
|
182
|
+
// 工作年限(页面公式中需使用 [表名.字段名])
|
|
183
|
+
DATEDIF([员工表.入职日期], TODAY(), "Y")
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
### 示例 4:添加记录
|
|
187
|
+
|
|
188
|
+
```
|
|
189
|
+
// 配合button使用,将页面1中各种类别的数据写入各个字段
|
|
190
|
+
// ADDRECORD中不允许省略数据表、页面名
|
|
191
|
+
ADDRECORD([数据表], [数据表.字段1], [页面1.输入控件名], [数据表.字段2], "静态文本", [数据表.字段3], [页面1.公式名])
|
|
192
|
+
```
|