| | |
| | |
|
| | | // 获取参数
|
| | | this.getTestData();
|
| | | |
| | | // 设置实时请求
|
| | | this.getTestDataTimer = setInterval(function() {
|
| | | self.getTestData();
|
| | | }, 4000);
|
| | |
|
| | | // 监控获取测试数据返回结果
|
| | | this.getTestDataWorker.onmessage = function(res) {
|
| | |
| | | if(rs.code == 1) {
|
| | | self.testData = rs.data;
|
| | | }
|
| | | |
| | | // 设置延时请求
|
| | | self.getTestDataTimer = setTimeout(function() {
|
| | | self.getTestData();
|
| | | }, 4000);
|
| | | }
|
| | |
|
| | | // 监控启动测试返回结果
|
| | | this.startTestWorker.onmessage = function(res) {
|
| | | // 关闭等待框
|
| | | self.loading.hide();
|
| | | var rs = res.data;
|
| | | var rs = res.data(res);
|
| | | if(rs.code == 1) {
|
| | | bui.alert('启动成功!');
|
| | | }else {
|
| | |
| | | this.stopTestWorker.onmessage = function(res) {
|
| | | // 关闭等待框
|
| | | self.loading.hide();
|
| | | var rs = res.data;
|
| | | var rs = res.data(res);
|
| | | if(rs.code == 1) {
|
| | | bui.alert('停止成功!');
|
| | | }else {
|
| | |
| | | this.pauseTestWorker.onmessage = function(res) {
|
| | | // 关闭等待框
|
| | | self.loading.hide();
|
| | | var rs = res.data;
|
| | | var rs = res.data(res);
|
| | | if(rs.code == 1) {
|
| | | bui.alert('暂停成功!');
|
| | | }else {
|
| | |
| | | this.stopTestWorker.terminate();
|
| | | this.pauseTestWorker.terminate();
|
| | |
|
| | | // 关闭延时请求
|
| | | clearTimeout(this.getTestDataTimer);
|
| | | // 关闭实时请求
|
| | | clearInterval(this.getTestDataTimer);
|
| | | }
|
| | | });
|
| | | },
|
| | |
| | |
|
| | | // 获取参数
|
| | | this.getTestData();
|
| | | |
| | | // 设置实时请求
|
| | | this.getTestDataTimer = setInterval(function() {
|
| | | self.getTestData();
|
| | | }, 4000);
|
| | |
|
| | | // 监控获取测试数据返回结果
|
| | | this.getTestDataWorker.onmessage = function(res) {
|
| | |
| | | if(rs.code == 1) {
|
| | | self.testData = rs.data;
|
| | | }
|
| | | |
| | | // 设置延时请求
|
| | | self.getTestDataTimer = setTimeout(function() {
|
| | | self.getTestData();
|
| | | }, 4000);
|
| | | }
|
| | |
|
| | | // 监控启动测试返回结果
|
| | |
| | | this.stopTestWorker.terminate();
|
| | | this.pauseTestWorker.terminate();
|
| | |
|
| | | // 关闭延时请求
|
| | | clearTimeout(this.getTestDataTimer);
|
| | | // 关闭实时请求
|
| | | clearInterval(this.getTestDataTimer);
|
| | | }
|
| | | });
|
| | | },
|