//定时器用法
setTimeout(function(){
_this.initdata();
},1000);
//Vue中的axios用法
//post和put方法传不止一个参数时,直接用{}框起来。对应后台的[FromBody]
axios.post(common_url + '/mainlist/device/file',{
"DeviceId":_this.deviceId,
"Url":_this.url,
}).then(function(res) {
代码块
}).catch(function(err) {
commonMessage(_this,"请求异常");
})
//get方法要传不止一个参数时,要写params 。对应后台的[FromUri]
axios.get(common_url + "/mainlist/device/daqchart", {
params: {
DeviceID: _this.deviceId,
StartTime: _this.search.starttime,
EndTime: _this.search.endtime,
}
}).then(function (res) {
代码块
}).catch(function (err) {
_this.loading = false;
});
//去掉开头的~字符
string.TrimStart('~');
//设置定时器,每5秒刷新一次数据
setInterval(function () {
//初始化实时数据图表
vuemodel.InitRealDataChart();
}, 5 * 1000);
JS技术积累
最新推荐文章于 2025-08-09 22:45:00 发布
138

被折叠的 条评论
为什么被折叠?



