1.0.4 • Published 12 months ago
adi-data v1.0.4
Aid数据下载
Installation
方式1,使用构建工具:
npm install adi-data -S
方式2,使用script标签:先下载本库到本地,然后将dist文件夹下的bundle.js通过script标签引入
<script src=".bundle.js"></script>
Usage
通过方式1安装的,可以通过以下代码使用
import * as AdiData from "adi-data";
通过方式2安装的,会在全局变量中创建一个AdiData的变量,可以直接使用
API
//本次登录保存的token
let token='xxxxxxx'
//下载原始数据
AdiData.downloadRaw({
fileName:'xxx-rawdata',
motorId:'3970dfc1-7313-4653-a9d1-927d5b9deedf',
start:1708272586041,
end:1708272586041,
headers:{
Authorization:token,
}
}).then(res=>{
console.log(res);
}).catch(e=>{
//error
})
//下载性能数据
AdiData.downloadPerformance({
fileName:'xxx-performance',
motorId:'3970dfc1-7313-4653-a9d1-927d5b9deedf',
start:1702870240770,
end:1708227040770,
headers:{
Authorization:token,
}
}).then(res=>{
console.log(res);
}).catch(e=>{
//error
})
//下载健康数据
//下载性能数据
AdiData.downloadHealth({
fileName:'xxx-health',
motorId:'3970dfc1-7313-4653-a9d1-927d5b9deedf',
start:1702870240770,
end:1708227040770,
headers:{
Authorization:token,
}
}).then(res=>{
console.log(res);
}).catch(e=>{
//error
})
其他参数请参考项目的d.ts