|
@@ -7,6 +7,9 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
setAutoCaseList(state, caseList) {
|
|
|
+ while(state.autoCaseList.length) {
|
|
|
+ state.autoCaseList.pop()
|
|
|
+ }
|
|
|
caseList.forEach((caseA) => {
|
|
|
if(!state.autoCaseList.some(p => p.id == caseA.id)) {
|
|
|
state.autoCaseList.push(caseA)
|
|
@@ -14,17 +17,30 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
setAutoPlanStatus(state, rows) {
|
|
|
- let obj = JSON.parse(localStorage.getItem("autoCurrentTaskData"))
|
|
|
- let planExecId = obj? obj.id : 0;
|
|
|
- for (let i in rows) {
|
|
|
- if (rows[i].id == planExecId) {
|
|
|
- state.autoTaskStatus = rows[i].status;
|
|
|
- break;
|
|
|
+ let map = JSON.parse(localStorage.getItem("autoCurrentTaskData"))
|
|
|
+ for(let key in map) {
|
|
|
+ let planExecId = map[key];
|
|
|
+ for (let i in res) {
|
|
|
+ if (res[i].id == planExecId) {
|
|
|
+ state.autoTaskStatus = res[i].status;
|
|
|
+ state.autoTaskStatusMap[key] = res[i].status;
|
|
|
+ break;
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- state.autoCaseList.forEach(c => {
|
|
|
- c.status = state.autoTaskStatus
|
|
|
- })
|
|
|
+
|
|
|
+ if (state.currentPlanId) {
|
|
|
+ debugger
|
|
|
+ let cases = state.autoTaskItemsMap[state.currentPlanId];
|
|
|
+ cases.forEach(c => {
|
|
|
+ let caseId = c.testcase_id;
|
|
|
+ let caseTemp = state.autoCaseList.find(t => t.id == caseId);
|
|
|
+ if (caseTemp) {
|
|
|
+ caseTemp.status = c.status;
|
|
|
+ }
|
|
|
+ // console.log('autoCaseList', state.autoCaseList);
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
setPlanExecId(state, id) {
|
|
|
state.planExecId = id
|
|
@@ -49,13 +65,28 @@ export default {
|
|
|
localStorage.removeItem("autoCurrentTaskData")
|
|
|
},
|
|
|
setAllAutoPlanStatus(state, data) {
|
|
|
- let obj = JSON.parse(localStorage.getItem("autoCurrentTaskData"))
|
|
|
- let planExecId = obj? obj.id : 0;
|
|
|
- for (let i in data.res) {
|
|
|
- if (data.res[i].id == planExecId) {
|
|
|
- // state.autoTaskStatus = rows[i].status;
|
|
|
- state.autoTaskStatusMap[data.id] = rows[i].status;
|
|
|
- break;
|
|
|
+ debugger
|
|
|
+ let map = JSON.parse(localStorage.getItem("autoCurrentTaskData"))
|
|
|
+ for(let key in map) {
|
|
|
+ let planExecId = map[key];
|
|
|
+ for (let i in data.res) {
|
|
|
+ if (data.res[i].id == planExecId) {
|
|
|
+ state.autoTaskStatus = data.res[i].status;
|
|
|
+ state.autoTaskStatusMap[key] = data.res[i].status;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (state.currentPlanId) {
|
|
|
+ let cases = state.autoTaskItemsMap[state.currentPlanId];
|
|
|
+ cases.forEach(c => {
|
|
|
+ let caseId = c.testcase_id;
|
|
|
+ let caseTemp = state.autoCaseList.find(t => t.id == caseId);
|
|
|
+ if (caseTemp) {
|
|
|
+ caseTemp.status = c.status;
|
|
|
+ }
|
|
|
+ // console.log('autoCaseList', state.autoCaseList);
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -73,6 +104,7 @@ export default {
|
|
|
state.autoTaskStatusMap[data.info.planId] = data.res.data.detail.status;
|
|
|
if (state.currentPlanId) {
|
|
|
let cases = state.autoTaskItemsMap[state.currentPlanId];
|
|
|
+ if (!cases) return;
|
|
|
cases.forEach(c => {
|
|
|
let caseId = c.testcase_id;
|
|
|
let caseTemp = state.autoCaseList.find(t => t.id == caseId);
|