nocobase-app-plugin-template-print
它能做什么
这项技能指导在 NocoBase 3 应用中实现模板打印,根据模板和业务数据生成文档或 PDF。适合需要用记录数据生成可打印文档的开发者。
适用场景
- ✓当你想打印填入了记录数据的 Word、Excel 或 PowerPoint 模板时。
- ✓当你需要在 NocoBase 应用中根据模板生成 PDF 时。
- ✓当文档输出需要二维码或附件时。
技能链接
https://github.com/nocobase/nocobase/blob/v3-develop/packages/plugins/app-plugin-template-print/skills/nocobase-app-plugin-template-print/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请帮我制作一个采购订单的 Word 模板,自动填入每个订单的详细信息,并导出为 PDF。”
每周 5 个新技能,1 分钟读完。
工作原理
AI 会规划该功能,使用所选模板渲染器的公开接口,并在应用中构建路由和权限检查。然后在目标查看器中验证输出结果。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Goal
Implement or debug an App-owned NocoBase 3 template-printing workflow that produces an authorized document or PDF from a DOCX, XLSX, or PPTX template and business data, with the selected feature branches verified in the intended viewer and deployment.
Scope
This package provides implementation guidance only. It exports no rendering service, route, database collection, or Client/Server plugin. The App or business plugin owns the feature you implement. There is no pre-existing template-print API to call after installing this package.
Non-Goals
- Do not implement ordinary browser page printing or silent physical-printer access.
- Do not assume this package installs a renderer, creates a route or collection, or supplies Client/Server runtime registration.
- Use only the installed App's v3 contracts and the selected renderer's documented public APIs.
- Do not add an undocumented renderer adapter or claim format support that has not been verified.
Input Contract
| Input | Required | Default | Validation | Clarification Question |
|---|---|---|---|---|
action |
yes | implement for a new feature; debug when a concrete failure is reported |
enum: implement, debug |
"Should I implement the workflow or diagnose an existing one?" |
format |
yes | use the supplied template extension; otherwise start with docx |
enum: docx, xlsx, pptx; must match the actual template |
"Which template format must be supported?" |
output |
no | same-format document download; add pdf only when requested |
enum: document, pdf, printable-pdf |
"Should the result be the source format, a PDF download, or a printable PDF?" |
data-scope |
yes when business data is rendered | one record for a record request; otherwise ask before selecting a broader scope | enum: record, selected, current-page, all-filtered; explicit maximum |
"Which records may be printed?" |
template-ownership |
no | fixed App-owned asset unless managed uploads are requested | enum: fixed-asset, managed-upload; separate manage/use permissions |
"Is the template fixed by the App or managed by users?" |
locale-timezone |
no | the App's current locale and timezone | validate against the App contract before querying or formatting | "Which locale and timezone should labels and dates use?" |
The supplied template, App instructions, installed package versions, and existing business code are authoritative for details not listed here. If the user says "you decide", use a fixed DOCX asset, one representative record with its required child data, same-format document output, and one authorized download. Do not add XLSX, PPTX, PDF conversion, or managed template uploads in the same first slice unless requested.
Mandatory Clarification Gate
Resolve the target App, actual template format, output mode, data scope, template ownership, authorization boundary, and converter prerequisites before adding or changing an endpoint, data query, schema, dependency, or file-processing path. If a required input is missing or ambiguous, stop and ask; do not mutate code or storage before the answer. Max clarification rounds: 2. Max questions per round: 3.
Inspect the target App's instructions, installed versions, server composition, business data access, file storage, and action UI. Use its available nocobase-app-development Skill for v3 composition; use the installed auth
常见问题
这会为普通网页添加打印按钮吗?
不会。它不适用于普通的浏览器打印。
插件包含渲染器吗?
不包含。插件包只提供指导,功能由应用自行构建。
涵盖哪些格式?
按技能所述,涵盖 DOCX、XLSX 和 PPTX 模板。
详情
作者的原始描述
Use when implementing or debugging NocoBase 3 template printing with DOCX, XLSX, or PPTX templates and business data, including record/list output, attachments, QR codes, or PDF conversion; ordinary browser page printing is outside this workflow.
repo: nocobase/nocobase
热度
- GitHub 星标
- 25k
- 排名
- #10106
- 许可证
- —
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
nocobase-app-development
25k帮你的智能体为完整的 NocoBase 3 业务应用构建页面、路由、数据、权限和测试。
shadcn
25k帮你的智能体在 Web 项目中查找、添加、修复和美化 shadcn/ui 组件,并使用其官方文档和注册表。
nocobase-app-plugin-development
25k帮你的智能体在现有应用中创建和维护 NocoBase 3 插件,包括服务端、客户端、数据库和注册部分。
nocobase-app-upgrade
25k帮你的智能体把 NocoBase 应用升级到较新的模板版本,引入模板的更改,同时保留你自己的工作。