fix(性能测试): 编辑性能测试兼容老版本的数据

This commit is contained in:
Captain.B 2021-07-15 09:57:42 +08:00 committed by 刘瑞斌
parent 128763be38
commit 068348764b
1 changed files with 6 additions and 0 deletions

View File

@ -297,6 +297,7 @@ export default {
this.$get('/performance/get-load-config/' + this.testId, (response) => { this.$get('/performance/get-load-config/' + this.testId, (response) => {
if (response.data) { if (response.data) {
let data = JSON.parse(response.data); let data = JSON.parse(response.data);
let oldVersion;
for (let i = 0; i < data.length; i++) { for (let i = 0; i < data.length; i++) {
let d = data[i]; let d = data[i];
d.forEach(item => { d.forEach(item => {
@ -312,6 +313,7 @@ export default {
break; break;
case DURATION: case DURATION:
this.threadGroups[i].duration = item.value; this.threadGroups[i].duration = item.value;
oldVersion = item.unit;
break; break;
case UNIT: case UNIT:
this.threadGroups[i].unit = item.value; this.threadGroups[i].unit = item.value;
@ -365,6 +367,10 @@ export default {
}); });
} }
for (let i = 0; i < this.threadGroups.length; i++) { for (let i = 0; i < this.threadGroups.length; i++) {
//
if (oldVersion) {
break;
}
// //
switch (this.threadGroups[i].unit) { switch (this.threadGroups[i].unit) {
case 'M': case 'M':