Home > SCH_ManufactureData > uploadBomTemplateFile
SCH_ManufactureData.uploadBomTemplateFile() method
此 API 当前处于 BETA 预览状态,希望得到开发者的反馈。它的任何功能都可能在接下来的开发进程中被修改,请不要将它用于任何正式环境。
上传 BOM 模板文件
签名
typescript
public uploadBomTemplateFile(templateFile: File, template?: string): Promise<string | undefined>;1
参数名
参数 | 类型 | 描述 |
|---|---|---|
templateFile | File | BOM 模板文件 |
template | string | (可选) BOM 模板名称,如若为 |
返回值
Promise<string | undefined>
BOM 模板名称
示例
javascript
// 1. 从本地选择模板文件(弹窗需要用户交互)
// const templateFile = await eda.sys_FileSystem.openReadFileDialog('.xlsx');
// 2. 上传为新的 BOM 模板(第二参数指定模板名,不传则从文件名取)
// const templateName = await eda.sch_ManufactureData.uploadBomTemplateFile(templateFile, '嘉立创示例_模板');
// console.log('上传后的模板名 ' + templateName);
// 3. 上传后用 getBomTemplates 查看列表确认,不再需要时用 deleteBomTemplate 删除
console.log('演示流程:openReadFileDialog 读取 xlsx → uploadBomTemplateFile 上传 → getBomTemplates 确认');1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9