|
@@ -5,29 +5,45 @@ export default {
|
|
while (state.caseListMap[uuid] && state.caseListMap[uuid].length) {
|
|
while (state.caseListMap[uuid] && state.caseListMap[uuid].length) {
|
|
state.caseListMap[uuid].pop();
|
|
state.caseListMap[uuid].pop();
|
|
}
|
|
}
|
|
|
|
+
|
|
caseList.forEach((caseA) => {
|
|
caseList.forEach((caseA) => {
|
|
if (!state.caseListMap[uuid]) {
|
|
if (!state.caseListMap[uuid]) {
|
|
state.caseListMap[uuid] = []
|
|
state.caseListMap[uuid] = []
|
|
}
|
|
}
|
|
- if(!state.caseListMap[uuid].some(p => p.case_no == caseA.case_no)) {
|
|
|
|
|
|
+ if (!state.caseListMap[uuid].some(p => p.case_no == caseA.case_no)) {
|
|
state.caseListMap[uuid].push(caseA)
|
|
state.caseListMap[uuid].push(caseA)
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
+
|
|
if (state.caseListMap[uuid] && state.caseListMap[uuid].length) {
|
|
if (state.caseListMap[uuid] && state.caseListMap[uuid].length) {
|
|
state.caseList = state.caseListMap[uuid];
|
|
state.caseList = state.caseListMap[uuid];
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ let length = state.caseList ? state.caseList.length : 0;
|
|
|
|
+ let finished = 0;
|
|
|
|
+ for (let i = 0; i < length; i++) {
|
|
|
|
+ if (
|
|
|
|
+ state.caseList[i].result == "pass" ||
|
|
|
|
+ state.caseList[i].result == "fail" ||
|
|
|
|
+ state.caseList[i].result == "tb"
|
|
|
|
+ ) {
|
|
|
|
+ finished++;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ let rate = (finished / length) * 100;
|
|
|
|
+ state.autoTaskPercentMap[uuid] = rate;
|
|
},
|
|
},
|
|
setAutoCaseList(state, data) {
|
|
setAutoCaseList(state, data) {
|
|
let autoCaseList = data.autoCaseList;
|
|
let autoCaseList = data.autoCaseList;
|
|
let planId = data.planId;
|
|
let planId = data.planId;
|
|
- while(state.autoCaseListMap[planId] && state.autoCaseListMap[planId].length) {
|
|
|
|
|
|
+ while (state.autoCaseListMap[planId] && state.autoCaseListMap[planId].length) {
|
|
state.autoCaseListMap[planId].pop()
|
|
state.autoCaseListMap[planId].pop()
|
|
}
|
|
}
|
|
autoCaseList.forEach((caseA) => {
|
|
autoCaseList.forEach((caseA) => {
|
|
if (!state.autoCaseListMap[planId]) {
|
|
if (!state.autoCaseListMap[planId]) {
|
|
state.autoCaseListMap[planId] = []
|
|
state.autoCaseListMap[planId] = []
|
|
}
|
|
}
|
|
- if(!state.autoCaseListMap[planId].some(p => p.id == caseA.id)) {
|
|
|
|
|
|
+ if (!state.autoCaseListMap[planId].some(p => p.id == caseA.id)) {
|
|
state.autoCaseListMap[planId].push(caseA)
|
|
state.autoCaseListMap[planId].push(caseA)
|
|
}
|
|
}
|
|
});
|
|
});
|
|
@@ -37,7 +53,7 @@ export default {
|
|
},
|
|
},
|
|
setAutoPlanStatus(state, rows) {
|
|
setAutoPlanStatus(state, rows) {
|
|
let map = JSON.parse(localStorage.getItem("autoCurrentTaskData"))
|
|
let map = JSON.parse(localStorage.getItem("autoCurrentTaskData"))
|
|
- for(let key in map) {
|
|
|
|
|
|
+ for (let key in map) {
|
|
let planExecId = map[key];
|
|
let planExecId = map[key];
|
|
for (let i in res) {
|
|
for (let i in res) {
|
|
if (res[i].id == planExecId) {
|
|
if (res[i].id == planExecId) {
|
|
@@ -58,21 +74,22 @@ export default {
|
|
// console.log('autoCaseList', state.autoCaseList);
|
|
// console.log('autoCaseList', state.autoCaseList);
|
|
})
|
|
})
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
+ }
|
|
},
|
|
},
|
|
setPlanExecId(state, id) {
|
|
setPlanExecId(state, id) {
|
|
state.planExecId = id
|
|
state.planExecId = id
|
|
},
|
|
},
|
|
setAutoStatus(state, data) {
|
|
setAutoStatus(state, data) {
|
|
// state.autoTaskSubmitLoading = false;
|
|
// state.autoTaskSubmitLoading = false;
|
|
- state.autoTaskStatus = "running";
|
|
|
|
- state.autoTaskStatusMap[data.id] = "running";
|
|
|
|
|
|
+ debugger
|
|
|
|
+ state.autoTaskStatus = data.res.data.result;
|
|
|
|
+ state.autoTaskStatusMap[data.id] = data.res.data.result;
|
|
state.planExecId = data.res.data.info[0];
|
|
state.planExecId = data.res.data.info[0];
|
|
state.planExecIdMap[data.id] = data.res.data.info[0];
|
|
state.planExecIdMap[data.id] = data.res.data.info[0];
|
|
localStorage.setItem("autoCurrentTaskData", JSON.stringify(state.planExecIdMap));
|
|
localStorage.setItem("autoCurrentTaskData", JSON.stringify(state.planExecIdMap));
|
|
- state.autoCaseListMap[data.id].forEach(c => {
|
|
|
|
- c.status = "running"
|
|
|
|
- })
|
|
|
|
|
|
+ // state.autoCaseListMap[data.id].forEach(c => {
|
|
|
|
+ // c.status = "running"
|
|
|
|
+ // })
|
|
},
|
|
},
|
|
setCurrentTask(state, id) {
|
|
setCurrentTask(state, id) {
|
|
state.currentTaskIndex = id;
|
|
state.currentTaskIndex = id;
|
|
@@ -81,12 +98,12 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
cancelPlan(state, res) {
|
|
cancelPlan(state, res) {
|
|
- state.autoTaskStatus = "ready";
|
|
|
|
|
|
+ state.autoTaskStatus = "stopped";
|
|
localStorage.removeItem("autoCurrentTaskData")
|
|
localStorage.removeItem("autoCurrentTaskData")
|
|
},
|
|
},
|
|
setAllAutoPlanStatus(state, data) {
|
|
setAllAutoPlanStatus(state, data) {
|
|
let map = JSON.parse(localStorage.getItem("autoCurrentTaskData"))
|
|
let map = JSON.parse(localStorage.getItem("autoCurrentTaskData"))
|
|
- for(let key in map) {
|
|
|
|
|
|
+ for (let key in map) {
|
|
let planExecId = map[key];
|
|
let planExecId = map[key];
|
|
for (let i in data.res) {
|
|
for (let i in data.res) {
|
|
if (data.res[i].id == planExecId) {
|
|
if (data.res[i].id == planExecId) {
|
|
@@ -129,8 +146,7 @@ export default {
|
|
let caseTemp = state.autoCaseList.find(t => t.id == caseId);
|
|
let caseTemp = state.autoCaseList.find(t => t.id == caseId);
|
|
if (caseTemp) {
|
|
if (caseTemp) {
|
|
caseTemp.status = c.status;
|
|
caseTemp.status = c.status;
|
|
- if(caseTemp.status == 'finished')
|
|
|
|
- {
|
|
|
|
|
|
+ if (caseTemp.status == 'finished') {
|
|
caseTemp.status = c.result;
|
|
caseTemp.status = c.result;
|
|
}
|
|
}
|
|
}
|
|
}
|