webtopoAPI 接口文档¶
Webtopo 组态编辑器通过 webtopoAPI 对象与业务系统对接。在 Vue 项目中实现以下方法并传入 <Webtopo :webtopoAPI="webAPI"> 或 <preview :webtopoAPI="webAPI"> 组件即可。
GitHub:bighhhh/webtopo-vue3-community
接口列表¶
webtopoAPI 接口列表如下,需在你的项目中实现这些方法并传入组件:
webtopoAPI: {
// 查询历史数据,历史图展示时使用
getCaptcha: ({ mps, startTime, endTime }) => {},
// 查询你系统中所有点位信息,绑定点位时使用
getPoints: ({ page, limit }) => {},
// 根据点位(表计)查询遥信、遥测列表
getAttrs: ({ mpId, consId, readAndWriteVar }) => {},
// 保存画面信息,后台存到数据库或文件系统均可
saveOrUpdate: ({ cells, points, graph }) => {},
// 画面 id,preview 组件根据 id 加载画面 JSON
getJSONById: (id) => {},
// 获取拖拽到编辑器上传的所有图片或图元
getImages: () => {},
// 拖拽到编辑器上传图片或图元的接口
uploadFile: (file) => {},
// 获取画面列表,配置内部跳转时供选择
listNotPage: ({ consId, notSearchId }) => {},
// 批量获取点位名称
getMpAndMstypeNames: (mpAttrs) => {},
// 向表计/点位下发控制数据
setData: (id, mpId, attrId, value) => {}
}
接口说明¶
| 接口 | 用途 |
|---|---|
getCaptcha |
查询历史数据,用于历史曲线展示 |
getPoints |
分页查询系统中所有点位,绑定点位时使用 |
getAttrs |
根据点位查询遥信、遥测属性列表 |
saveOrUpdate |
保存或更新画面 JSON 数据 |
getJSONById |
根据画面 ID 获取画面 JSON |
getImages |
获取已上传的图片/图元列表 |
uploadFile |
上传图片或图元文件 |
listNotPage |
获取画面列表(不分页) |
getMpAndMstypeNames |
批量获取点位名称 |
setData |
向后台发送控制数据 |