所属产品: Mingcedar Studio DESIGNER
模板使用说明 | Mingcedar Studio
模板的核心价值不是提升复制速度,而是让重复结构在复制后仍然便于维护。只要一个结构会重复出现,模板通常比纯复制粘贴更适合长期维护。
<section id="preface" class="docs-block docs-block-intro"> <span class="section-kicker">模板</span> <h2>使用前说明</h2> <p>模板的核心价值不是提升复制速度,而是让重复结构在复制后仍然便于维护。只要一个结构会重复出现,模板通常比纯复制粘贴更适合长期维护。</p> <div class="docs-task-grid"> <article id="preface-item-1" class="docs-task-card"> <span>模板</span> <strong>先区分组和模板</strong> <p>普通组负责一起选中、移动和复制;模板是在组的基础上增加模板元数据和实例配置。因此,模板本质上是组,但并非所有组都适合保存为模板。</p> </article><article id="preface-item-2" class="docs-task-card"> <span>模板</span> <strong>模板化的判断标准</strong> <p>只要某块内容会在多个页面重复出现,或一处修改后希望同类内容便于同步调整,就应优先评估模板化。设备卡片、弹窗、输入区、按键区和表格区都是高频模板对象。</p> </article><article id="preface-item-3" class="docs-task-card"> <span>模板</span> <strong>阅读顺序</strong> <p>先阅读模板库和模板编辑,再阅读三类内置模板:input、keypad、table。最后阅读脚本中公开的模板方法 template.getValue()。</p> </article> </div> </section> <section id="template-library" class="docs-block"> <span class="section-kicker">库</span> <h2>模板库:可复用组件的统一管理</h2> <p>模板库是模板资产的管理入口,用于统一解决模板存放、检索和复用问题。</p> <div class="docs-detail-list"> <article id="template-library-item-1" class="docs-detail-row"> <strong>模板库能做什么</strong> <p>模板库支持搜索模板、按模板组查看模板卡片、保存模板、导入模板、导出模板和删除模板。它是项目中的复用资产库,不是一次性暂存区。</p> <ul> <li>Search:按模板名称或分类搜索定位</li><li>Save:将选中的可复用内容保存到模板库</li><li>Import / Export:便于模板资产迁移和共享</li><li>Delete:清理已经不用的模板</li> </ul> </article><article id="template-library-item-2" class="docs-detail-row"> <strong>保存为模板的时机</strong> <p>当一个结构已经稳定、未来会重复使用,而且复制后需要反复调整字段时,就应保存成模板。仍在频繁变化、字段和结构尚未确定的页面,不建议过早模板化。</p> </article><article id="template-library-item-3" class="docs-detail-row"> <strong>插入模板的推荐顺序</strong> <p>先在模板库中确认目标模板,再双击或拖拽插入,插入后进入 Template Edit 调整实例尺寸和实例配置。模板插入后不建议先大量复制,再逐个补充配置。</p> </article><article id="template-library-item-4" class="docs-detail-row"> <strong>模板库最适合管理什么</strong> <p>最适合放进模板库的通常是设备卡片、状态块、诊断弹窗、操作弹窗、通用按钮组、输入 + 按键组合区和标准表格区。这些内容复用频率高,结构变化也容易影响多个页面。</p> </article><article id="template-library-item-5" class="docs-detail-row"> <strong>模板保存前检查</strong> <p>保存前先确认选中对象只包含需要长期复用的内容。对象命名、默认文本、Tag 片段、模板变量和图层顺序都应保持清晰;仅用于当前页面的说明、占位标记和辅助对象不应进入模板。</p> </article><article id="template-library-item-6" class="docs-detail-row"> <strong>模板命名与分组</strong> <p>模板名建议直接说明用途,例如“设备状态卡片”“参数输入区”“诊断弹窗”。模板组建议按业务或页面模块划分,例如设备、报警、配方、报表。名称越稳定,后续搜索、替换和团队交接越容易。</p> </article> </div> <div class="docs-note-grid"> <figure id="template-library-image-1" class="docs-note-card manual-doc-image-card"> <img src="/WEB_img/HQPPT/TemplateLibraryForm.png" alt="模板库" loading="lazy" decoding="async"> <figcaption> <strong>模板库</strong> <p>模板库适合统一管理已经定型、准备反复使用的页面结构和组件组合。</p> </figcaption> </figure> </div> </section><section id="template-creation" class="docs-block"> <span class="section-kicker">制作</span> <h2>模板创建、保存与实例验证</h2> <p>这部分按实际动作顺序说明从 PPT 画面到模板实例的完整流程。</p> <div class="docs-detail-list"> <article id="template-creation-item-1" class="docs-detail-row"> <strong>第一步:完成需要复用的组件布局</strong> <p>模板不是空白结构,它来自已经完成的页面内容。建议先在 PPT 中完成外框、标题、状态块、输入区、按钮区和说明文字,再考虑模板化。模板用于保存可复用结构,不用于替代页面结构设计。</p> </article><article id="template-creation-item-2" class="docs-detail-row"> <strong>第二步:将需要一起复用的对象组合</strong> <p>模板边界应保持清晰。确实需要一起复用、移动、缩放和维护的对象,才适合放入同一个组。参考线、当前页说明文字、仅当前页需要的提示不应进入模板组。模板本质上是带模板元数据的组,因此分组边界就是模板边界。</p> <ul> <li>会一起出现、一起移动、一起维护的对象放进同一组</li><li>组名应体现用途,避免直接沿用默认对象名</li><li>只属于当前页的文字、辅助线和说明不应进入模板</li> </ul> </article><article id="template-creation-item-3" class="docs-detail-row"> <strong>第三步:在 Template Library 中保存选区</strong> <p>选中完整对象组,打开 MX Design → Templates → Library,点击 Save selection。核对选区并填写模板名,如“泵状态卡片”。</p> <ul> <li>保存前先确认只选中了需要复用的对象组</li><li>模板名应直接说明用途,便于后续搜索</li><li>如果模板库中有模板组,建议按业务分类保存</li> </ul> </article><article id="template-creation-item-4" class="docs-detail-row"> <strong>第四步:保存后从模板库再插回页面确认</strong> <p>模板不是保存后即完成。合格的模板应能够从模板库重新插入页面,并保持结构完整、尺寸合理、默认文本干净。建议保存后立即双击或拖拽插入一次,检查结构、尺寸和默认内容。</p> <ul> <li>双击或拖拽将模板重新插回页面</li><li>检查对象组是否完整</li><li>检查默认文字、默认大小、默认位置是否合理</li><li>检查是否包含上一页的残留文字和值</li> </ul> </article><article id="template-creation-item-5" class="docs-detail-row"> <strong>第五步:配置模板实例的位置和参数</strong> <p>选中实例根组,打开 MX Design → Templates → Edit Instance。核对来源,调整 X、Y、Width、Height 和实例参数,再配置行为与脚本。</p> <ul> <li>先调整 X / Y,确认位置</li><li>再调整 Width / Height,确认占位</li><li>再补充实例参数、变量、Tag 或文本</li><li>确认实例配置后,再继续配置行为和脚本</li> </ul> </article><article id="template-creation-item-6" class="docs-detail-row"> <strong>第六步:发现需要修改时,先判断修改模板源还是当前实例</strong> <p>仅当前实例的位置、尺寸或绑定不同:修改实例。同类模板都需调整布局、字段或按钮:修改模板源。</p> </article> </div> <div class="docs-note-grid"> <figure id="template-creation-image-1" class="docs-note-card manual-doc-image-card"> <img src="/WEB_img/HQPPT/TemplateLibraryForm.png" alt="模板保存与再次插入" loading="lazy" decoding="async"> <figcaption> <strong>模板保存与再次插入</strong> <p>模板保存后应重新插入一次,确认它是否具备稳定复用条件。</p> </figcaption> </figure><figure id="template-creation-image-2" class="docs-note-card manual-doc-image-card"> <img src="/WEB_img/HQPPT/TemplateInstanceEditorFormInput.png" alt="模板插入后的实例调整" loading="lazy" decoding="async"> <figcaption> <strong>模板插入后的实例调整</strong> <p>选中模板实例根组,通过 Templates → Edit Instance 打开 Template Edit,配置位置、尺寸和实例参数。</p> </figcaption> </figure><figure id="template-creation-image-3" class="docs-note-card manual-doc-image-card"> <img src="/WEB_img/HQPPT/TemplateMetadataForm.png" alt="模板元数据" loading="lazy" decoding="async"> <figcaption> <strong>模板元数据</strong> <p>模板保存或整理时,名称、分类和说明应保持清晰,便于后续团队检索和复用。</p> </figcaption> </figure> </div> </section><section id="template-edit" class="docs-block"> <span class="section-kicker">实例</span> <h2>Template Edit:插入后如何调整实例配置</h2> <p>Template Edit 修改当前页面上的模板实例。模板源与实例分别保存;实例配置只影响所选实例。</p> <div class="docs-detail-list"> <article id="template-edit-item-1" class="docs-detail-row"> <strong>所有模板实例都支持什么</strong> <p>模板实例支持 X、Y、Width、Height,可在模板编辑器中调整实例在页面上的位置和尺寸。</p> </article><article id="template-edit-item-2" class="docs-detail-row"> <strong>模板实例和模板源的关系</strong> <p>模板源保存可复用的结构、输入项和默认内容;模板实例保存当前页面的位置、尺寸、参数值以及变量或 Tag 绑定。</p> </article><article id="template-edit-item-3" class="docs-detail-row"> <strong>模板变量填写方法</strong> <p>Template variables 填替换值,如 PLC_LINE01。目标字段可直接用 <PLC>.PUMP01.SPEED_SETPOINT;JavaScript 字符串才加引号,如 ReadTagDouble("<PLC>.PUMP01.SPEED", 0)。动态名称使用 = 表达式。</p> <ul> <li>实例参数:PLC 填 PLC_LINE01,不再次添加尖括号。</li><li>固定 Tag 目标:<PLC>.PUMP01.SPEED_SETPOINT。</li><li>动态目标:="<PLC>." + selectedPumpCode + ".SPEED_SETPOINT"。</li><li>脚本字符串:ReadTagDouble("<PLC>.PUMP01.SPEED", 0)。</li> </ul> </article><article id="template-edit-item-4" class="docs-detail-row"> <strong>实例尺寸与模板源的调整边界</strong> <p>如果只是当前页这一个实例位置不同、尺寸不同,就改实例;如果是所有同类模板结构都要变,例如多一列、多一个按钮、字段布局整体改变,就该回模板源调整。</p> </article><article id="template-edit-item-5" class="docs-detail-row"> <strong>推荐配置顺序</strong> <p>先插入模板,再打开 Template Edit,依次调整 X、Y、Width、Height 和实例级配置。确认实例配置完整后,再继续连接脚本或 Tag。</p> </article><article id="template-edit-item-6" class="docs-detail-row"> <strong>实例变量维护顺序</strong> <p>建议先维护影响范围最大的变量,例如 PLC、设备编码、DB、画面标题,再维护单个对象的 Tag、文本和单位。这样可以先建立实例的主要数据边界,再处理细节字段。</p> </article><article id="template-edit-item-7" class="docs-detail-row"> <strong>变量替换范围</strong> <p>模板参数仅替换当前实例中的对应占位符。Batch Replace 的范围为当前选区或当前页面;需要修改其他页面时分别执行,并检查预览。不要将其视为自动覆盖整个演示文稿的替换操作。</p> </article> </div> <div class="docs-note-grid"> <figure id="template-edit-image-1" class="docs-note-card manual-doc-image-card"> <img src="/WEB_img/HQPPT/TemplateInstanceEditorFormInput.png" alt="模板编辑" loading="lazy" decoding="async"> <figcaption> <strong>模板编辑</strong> <p>模板插入到页面后,实例位置、尺寸和具体配置优先在这里调整。</p> </figcaption> </figure> </div> </section><section id="input-template" class="docs-block"> <span class="section-kicker">Input</span> <h2>内置输入模板:三种模式,先按数据目标选择</h2> <p>Input 支持 Plain Input、Runtime Variable、PLC Tag。按输入用途选择模式;名称字段直接填名称,脚本中的字符串参数加引号。</p> <div class="docs-detail-list"> <article id="input-template-item-1" class="docs-detail-row"> <strong>Plain Input 模式:先只收输入,不自动写标签</strong> <p>Plain Input 暂存输入,不填写 PLC Tag,也不自动写设备。脚本通过 template.getValue("Input Template") 读取,参数为输入实例名。</p> <ul> <li>适合先输入、后确认的场景</li><li>适合需要脚本二次判断的场景</li><li>适合页面暂存输入,不直接写设备</li> </ul> <pre class="docs-code-block"><code>var recipeName = template.getValue("Input Template");
if (recipeName !== "") {
WriteTagString("PLC_LINE01.PUMP01.RECIPE", recipeName);
}</code></pre> </article><article id="input-template-item-2" class="docs-detail-row"> <strong>Runtime Variable 模式:输入结果先进入运行时变量</strong> <p>Runtime Variable 保存当前页输入。固定目标填 speedSetpointDraft,不加引号;动态目标填 =selectedVariableName,须返回有效变量名。Set Variable on Click 的 Variable 仍填赋值目标名,两者规则不同。</p> <ul> <li>适合页面内联动</li><li>适合局部筛选和局部状态切换</li><li>适合暂存值,后续再统一处理</li><li>配置框示例:recipeName,不是 "recipeName"</li> </ul> </article><article id="input-template-item-3" class="docs-detail-row"> <strong>PLC Tag 模式:输入后直接面向设备或系统值</strong> <p>PLC Tag 固定目标填 PLC_LINE01.PUMP01.SPEED_SETPOINT,模板目标填 <PLC>.PUMP01.SPEED_SETPOINT,动态目标填 =selectedSetpointTag 并返回完整名称。此字段不填读取或写入调用;计算 Tag 不可写入。</p> <ul> <li>适合设定值和参数值</li><li>适合明确要写 PLC 的输入项</li><li>固定目标:PLC_LINE01.PUMP01.SPEED_SETPOINT;动态目标:=selectedSetpointTag。</li><li>关键操作建议配合确认和权限规则一起考虑</li> </ul> </article><article id="input-template-item-4" class="docs-detail-row"> <strong>输入值类型处理</strong> <p>PLC Tag 模式识别数字、布尔和字符串。自定义上下限须用 Plain Input 配合按钮校验后写入;单位、范围提示和确认框不执行校验。</p> </article><article id="input-template-item-5" class="docs-detail-row"> <strong>确认动作放置位置</strong> <p>范围校验、原因填写和组合写入由 Plain Input 配合按钮或 Click Script 完成。Keypad OK 不会调用另一按钮的校验。</p> </article><article id="input-template-item-6" class="docs-detail-row"> <strong>字段与脚本的引号规则</strong> <p>Input 固定目标、Runtime Variable 名称和模板占位符不加引号;= 表示求值后使用返回名称。JavaScript 名称参数加引号,如 template.getValue("SpeedSetpointInput")。</p> <ul> <li>固定 PLC Tag:PLC_LINE01.PUMP01.SPEED_SETPOINT。</li><li>模板 PLC Tag:<PLC>.PUMP01.SPEED_SETPOINT。</li><li>Runtime Variable:speedSetpointDraft;动态变量名:=selectedVariableName。</li><li>脚本读取输入框:template.getValue("SpeedSetpointInput")。</li><li>脚本读取 Tag:ReadTagDouble("PLC_LINE01.PUMP01.SPEED", 0)。</li> </ul> </article><article id="input-template-item-7" class="docs-detail-row"> <strong>写入触发方式选择</strong> <p>需先校验再写入时,使用 Plain Input 和独立按钮。PLC Tag Input 按自身规则提交,另一按钮不能拦截 Keypad OK。</p> </article> </div> <div class="docs-note-grid"> <figure id="input-template-image-1" class="docs-note-card manual-doc-image-card"> <img src="/WEB_img/HQPPT/TemplateInstanceEditorFormInput.png" alt="输入模板实例" loading="lazy" decoding="async"> <figcaption> <strong>输入模板实例</strong> <p>输入模板应先选清楚 Plain Input、Runtime Variable 或 PLC Tag,再决定是否由脚本统一提交。</p> </figcaption> </figure> </div> </section><section id="keypad-template" class="docs-block"> <span class="section-kicker">Keypad</span> <h2>按键模板:面向目标输入模板的数字录入组件</h2> <p>keypad 模板通常和 input 模板成对出现。它负责把数字键、退格、清空、确认这些动作打包成一个标准输入区。</p> <div class="docs-detail-list"> <article id="keypad-template-item-1" class="docs-detail-row"> <strong>Keypad 目标输入:使用前先选目标输入模板</strong> <p>Target Input Name 填当前页 Input 实例名。未关联有效实例时,数字键、Back、Clear 和 OK 无目标。</p> </article><article id="keypad-template-item-2" class="docs-detail-row"> <strong>数字键、Back、Clear、OK 分别做什么</strong> <p>数字键负责追加字符;Back 删除最后一个字符;Clear 清空当前输入;OK 会把当前值通过目标输入模板提交。keypad 可作为可复用的输入动作面板使用。</p> </article><article id="keypad-template-item-3" class="docs-detail-row"> <strong>Keypad 和 Plain Input 的组合</strong> <p>Plain Input 的 Keypad OK 仅提交输入;脚本再用 template.getValue("输入模板实例名") 读取,校验后决定是否写 Tag。</p> </article><article id="keypad-template-item-4" class="docs-detail-row"> <strong>Keypad 和 PLC Tag 的组合</strong> <p>PLC Tag Input 即使设为 External,Keypad OK 仍会提交。External 仅关闭自动提交;自定义范围校验应使用 Plain Input 和校验按钮。</p> </article><article id="keypad-template-item-5" class="docs-detail-row"> <strong>输入与确认分离的场景</strong> <p>如果输入值会直接影响设备,建议把输入和确认分成两步,让用户先在输入模板中看到值,再通过 OK 或单独确认按钮提交。这样比边输边写更安全,也更符合现场操作习惯。</p> </article><article id="keypad-template-item-6" class="docs-detail-row"> <strong>按键模板最适合什么场景</strong> <p>数值设定、数字配方号、工艺参数设定、数字批次号适合 keypad 模板。当前输入模板使用普通文本输入,不提供密码掩码,不应用它收集密码。</p> </article> </div> <div class="docs-note-grid"> <figure id="keypad-template-image-1" class="docs-note-card manual-doc-image-card"> <img src="/WEB_img/HQPPT/TemplateInstanceEditorFormKeypad.png" alt="键盘模板实例" loading="lazy" decoding="async"> <figcaption> <strong>键盘模板实例</strong> <p>键盘模板要服务明确的目标输入框,检查数字、退格(Back)、清空(Clear)和确认(OK);当前不提供独立取消键。</p> </figcaption> </figure> </div> </section><section id="table-template" class="docs-block"> <span class="section-kicker">Table</span> <h2>表格模板:先定列头和行,再决定 Rows 写数组、变量名还是函数名</h2> <p>table 模板适合统一展示规则化的二维数据。它通过表头、行数据和数据来源驱动内容更新,避免逐个单元格手工维护。</p> <div class="docs-detail-list"> <article id="table-template-item-1" class="docs-detail-row"> <strong>表格模板有哪些关键字段</strong> <p>Table name 为显示标题,Table text ID 为标题翻译键,均非脚本查找名。Headers 为列标题,Header text IDs 为列标题翻译键,Rows 为二维数组。</p> </article><article id="table-template-item-2" class="docs-detail-row"> <strong>Headers 和 Rows 字段填写规则</strong> <p>Headers、Rows 接受数组、Page Script 数组变量或返回数组的函数,如 =buildPumpRows()。固定文字加引号;Tag 名称字符串不能直接作为行数据。</p> <ul> <li>直接表头:['设备', '状态']</li><li>直接行:[['Pump 1', 'Running'], ['Pump 2', 'Stop']]</li><li>引用变量:Rows 填 tableRows</li><li>引用函数:Rows 填 buildTableRows;显式调用填写 =buildTableRows()</li> </ul> </article><article id="table-template-item-3" class="docs-detail-row"> <strong>Table Rows 写法:数组、变量名或函数名</strong> <p>Rows 既可以直接写数组,也可以写变量名,还可以写函数名。推荐把稍复杂的数据放在 Page Script 里准备好,然后在 Rows 配置框里填变量名 tableRows。</p> <ul> <li>直接数组适合快速静态表格</li><li>变量名适合页面脚本提前准备数据</li><li>函数名适合需要运行时重新计算表格数据的场景</li> </ul> <pre class="docs-code-block"><code>var tableRows = [
["Pump 1", "Running"],
["Pump 2", "Stop"]
];
// Table 模板的 Rows 配置框填:tableRows</code></pre> </article><article id="table-template-item-4" class="docs-detail-row"> <strong>表格中接入 Tag 结果</strong> <p>把 Tag 读取放进 Page Script 函数,每次表格求值时返回最新二维数组。Rows 使用函数名或显式 = 调用。仅在页面脚本顶层读取一次并存入数组,不会自动重新读取 Tag。</p> <pre class="docs-code-block"><code>function buildTableRows() {
return [
["Pump 1", ReadTagString("PLC_LINE01.PUMP01.STATUS_TEXT", "")],
["Pump 2", ReadTagString("PLC_LINE01.PUMP02.STATUS_TEXT", "")]
];
}
// Table 模板的 Rows 配置框填:buildTableRows
// 或者:=buildTableRows()</code></pre> </article><article id="table-template-item-5" class="docs-detail-row"> <strong>结构化行数据接入</strong> <p>后端或聚合数据可写入 JSON Tag。Page Script 用 ReadTagJson("PLC_LINE01.REPORT01.ROWS", []) 读取,再转换为 Table 所需二维数组。</p> </article><article id="table-template-item-6" class="docs-detail-row"> <strong>表头和多语言</strong> <p>Headers 适合直接声明当前表头;Header Text IDs 适合接入统一语言键。项目需要多语言时,优先维护稳定 Text ID,再把默认表头作为默认显示。</p> </article><article id="table-template-item-7" class="docs-detail-row"> <strong>表格常见错法</strong> <p>Rows 接受数组、数组变量、函数或 =buildPumpRows() 表达式。复杂整理放在 Page Script 函数中;一次读取的数组不会持续更新。</p> </article><article id="table-template-item-8" class="docs-detail-row"> <strong>表格模板的高价值场景</strong> <p>当页面需要维护多行、多列内容,且这些内容未来会随配置、Tag 或脚本变化时,表格模板可以显著降低维护成本。它特别适合设备清单、诊断列表、参数表和状态列表。</p> </article> </div> <div class="docs-note-grid"> <figure id="table-template-image-1" class="docs-note-card manual-doc-image-card"> <img src="/WEB_img/HQPPT/TemplateInstanceEditorFormTable.png" alt="表格模板实例" loading="lazy" decoding="async"> <figcaption> <strong>表格模板实例</strong> <p>表格模板适合把列头、行样式和数据来源分开管理,避免每个单元格都靠手工维护。</p> </figcaption> </figure> </div> </section><section id="template-runtime" class="docs-block"> <span class="section-kicker">方法</span> <h2>脚本里读取输入模板值:template.getValue(controlName)</h2> <p>输入模板用于收集值时,可通过 template.getValue() 读取当前输入。controlName 填输入模板实例名,不填 PLC Tag 名。</p> <div class="docs-detail-list"> <article id="template-runtime-item-1" class="docs-detail-row"> <strong>controlName 填什么</strong> <p>controlName 是当前页 Input 实例名或控件名,不是 Tag 名。匹配不区分大小写,名称应唯一。脚本参数加引号,如 template.getValue("Input Template")。</p> <pre class="docs-code-block"><code>var value = template.getValue("Input Template");
hqVisuDesigner.setComponentText("InputPreview", value);</code></pre> </article><article id="template-runtime-item-2" class="docs-detail-row"> <strong>template.getValue(controlName) 能做什么</strong> <p>先排除空白,再检查数字是否有限且在业务范围内:Number('') 为 0,Number.isNaN() 不能排除 Infinity。示例范围为 0~100,须按项目修改。</p> <pre class="docs-code-block"><code>var setpointText = template.getValue("Input Template");
var trimmed = String(setpointText == null ? "" : setpointText).trim();
var setpoint = Number(trimmed);
if (trimmed !== "" && Number.isFinite(setpoint) && setpoint >= 0 && setpoint <= 100) {
WriteTagDouble("PLC_LINE01.PUMP01.SETPOINT", setpoint);
}</code></pre> </article><article id="template-runtime-item-3" class="docs-detail-row"> <strong>适用场景</strong> <p>当输入模板只是采集值、不直接写 Tag,或需要先校验、转换、提交,或需要组合多个输入框值时,template.getValue() 就很关键。</p> </article><article id="template-runtime-item-4" class="docs-detail-row"> <strong>无需使用的场景</strong> <p>如果输入模板已经直接绑定 PLC Tag,且业务上不需要再做脚本判断,那很多时候不需要额外在脚本里读值。把事情交给配置完成,通常更可靠。</p> </article><article id="template-runtime-item-5" class="docs-detail-row"> <strong>使用边界</strong> <p>脚本里只使用手册写明的方法。不要推测模板底层结构,也不要将模板作为可任意遍历的普通对象处理。这样后续升级和交接更可控。</p> </article> </div> <div class="docs-note-grid"> <figure id="template-runtime-image-1" class="docs-note-card manual-doc-image-card"> <img src="/WEB_img/HQPPT/TemplateInstanceEditorFormInput.png" alt="模板编辑中的实例配置" loading="lazy" decoding="async"> <figcaption> <strong>模板实例配置</strong> <p>输入、按键和表格这三类模板,最终都应通过实例配置和公开方法来使用。</p> </figcaption> </figure> </div> </section>