|
@@ -54,70 +54,12 @@ export default {
|
|
commit('setPlanExecId', id)
|
|
commit('setPlanExecId', id)
|
|
},
|
|
},
|
|
async getAutoPlanResult({ commit }, info) {
|
|
async getAutoPlanResult({ commit }, info) {
|
|
- return;
|
|
|
|
let getPlanResultParam = {
|
|
let getPlanResultParam = {
|
|
- planExecId: info.planId
|
|
|
|
|
|
+ planExecId: String(info.planExecId)
|
|
};
|
|
};
|
|
caseApi.getPlanResult(getPlanResultParam)
|
|
caseApi.getPlanResult(getPlanResultParam)
|
|
.then((res) => {
|
|
.then((res) => {
|
|
- // autoTaskMode.value = "Bench Search";
|
|
|
|
- let planCaseNum = res.data.list.length;
|
|
|
|
- let finishedCaseNum = 0;
|
|
|
|
- for (let i in res.data.list) {
|
|
|
|
- if (res.data.list[i].status) {
|
|
|
|
- finishedCaseNum++;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- state.autoTaskItems = res.data.list;
|
|
|
|
- let rate = (finishedCaseNum / planCaseNum) * 100;
|
|
|
|
- // console.log("rate", rate);
|
|
|
|
- taskItems[info.key].percentage = rate;
|
|
|
|
-
|
|
|
|
- getAutoPlanStatus();
|
|
|
|
- // console.log("taskItems.value", taskItems.value);
|
|
|
|
- // console.log("taskItems.value[key]", taskItems.value[key]);
|
|
|
|
- if (rate == 100) {
|
|
|
|
- clearInterval(state.autoPlanResultInterval);
|
|
|
|
- localStorage.remove("autoCurrentTaskData");
|
|
|
|
-
|
|
|
|
- getAutoPlanStatus();
|
|
|
|
-
|
|
|
|
- for (let i in state.autoTaskItems) {
|
|
|
|
- let unique_id = "";
|
|
|
|
- for (let j in taskItems.value[2].case) {
|
|
|
|
- if (taskItems[2].case[j].title == autoTaskItems[i].caseName) {
|
|
|
|
- unique_id = taskItems.value[2].case[j].unique_identifier;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- let result = JSON.parse(
|
|
|
|
- JSON.stringify(autoTaskItems[i].result)
|
|
|
|
- );
|
|
|
|
- if (result == "passed") {
|
|
|
|
- result = "pass";
|
|
|
|
- } else if (result == "failed") {
|
|
|
|
- result = "fail";
|
|
|
|
- }
|
|
|
|
- let updateAutoCaseParam = {
|
|
|
|
- comments: undefined,
|
|
|
|
- issue_descr: undefined,
|
|
|
|
- result: result,
|
|
|
|
- sw: "e4245",
|
|
|
|
- tb_type: undefined,
|
|
|
|
- testing_carline: autoTaskItems[i].Carline,
|
|
|
|
- testing_variant: autoTaskItems[i].Variant,
|
|
|
|
- unique_identifier: unique_id,
|
|
|
|
- };
|
|
|
|
- console.log("updateAutoCaseParam", updateAutoCaseParam);
|
|
|
|
- caseApi
|
|
|
|
- .updateDmapCase(updateAutoCaseParam)
|
|
|
|
- .then((res) => {
|
|
|
|
- // console.log("resUpdateAutoCase", res);
|
|
|
|
- })
|
|
|
|
- .catch((err) => {
|
|
|
|
- console.error(err);
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ commit('setAutoPlanResult', {info, res})
|
|
})
|
|
})
|
|
.catch((err) => {
|
|
.catch((err) => {
|
|
console.error(err);
|
|
console.error(err);
|
|
@@ -163,5 +105,8 @@ export default {
|
|
} catch (e) {
|
|
} catch (e) {
|
|
|
|
|
|
}
|
|
}
|
|
|
|
+ },
|
|
|
|
+ setCurrentPlanId({commit}, planId) {
|
|
|
|
+ commit('setCurrentPlanId', planId)
|
|
}
|
|
}
|
|
};
|
|
};
|