|
@@ -18,16 +18,6 @@ export default {
|
|
|
console.log("error", "服务异常", 1000);
|
|
|
}
|
|
|
},
|
|
|
- async startPlan({commit}, data) {
|
|
|
- try {
|
|
|
- const result = await planApi.startPlan(data);
|
|
|
- commit('setAutoPlanStatus', result)
|
|
|
- }catch(e) {
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- console.log('startPlanResult', result.data)
|
|
|
- },
|
|
|
async fetchPlanDetail({ commit }, data) {
|
|
|
try {
|
|
|
const detail = await planApi.getAutoPlanDetail(data.planId)
|
|
@@ -38,114 +28,5 @@ export default {
|
|
|
},
|
|
|
clearPlanList({commit}) {
|
|
|
commit('clearPlanList')
|
|
|
- },
|
|
|
- setCurrentTask({commit}, id) {
|
|
|
- commit('setCurrentTask', id)
|
|
|
- },
|
|
|
- setPlanExecId({commit}, id) {
|
|
|
- commit('setPlanExecId', id)
|
|
|
- },
|
|
|
- async getAutoPlanStatus({ commit }, name) {
|
|
|
- try{
|
|
|
- let getAutoPlanStatusParam = {
|
|
|
- name: name,
|
|
|
- currentPage: 1,
|
|
|
- pageSize: 20,
|
|
|
- };
|
|
|
- planApi.getAutoPlanStatus(getAutoPlanStatusParam).then((res) => {
|
|
|
- let rows = res.data.rows;
|
|
|
- for (let i in rows) {
|
|
|
- if (rows[i].id == planExecId.value) {
|
|
|
- autoTaskStatus.value = rows[i].status;
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- console.log('autoTaskStatus.value', autoTaskStatus.value);
|
|
|
- if (autoTaskStatus.value == "running" || autoTaskStatus.value == "waiting") {
|
|
|
- // activeAutoTab.value = 1;
|
|
|
- autoTaskStep.value = 3;
|
|
|
- } else {
|
|
|
- // activeAutoTab.value = 2;
|
|
|
- autoTaskStep.value = 1;
|
|
|
- }
|
|
|
- })
|
|
|
- .catch((err) => {
|
|
|
- logResultSubmitLoading.value = false;
|
|
|
- console.error(err);
|
|
|
- });
|
|
|
- } catch (e) {
|
|
|
-
|
|
|
- }
|
|
|
- },
|
|
|
- async getAutoPlanResult({ commit }, key) {
|
|
|
- let getPlanResultParam = {
|
|
|
- planExecId: state.planExecId,
|
|
|
- };
|
|
|
- planApi.getPlanResult(getPlanResultParam)
|
|
|
- .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++;
|
|
|
- }
|
|
|
- }
|
|
|
- autoTaskItems = res.data.list;
|
|
|
- let rate = (finishedCaseNum / planCaseNum) * 100;
|
|
|
- // console.log("rate", rate);
|
|
|
- taskItems[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 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);
|
|
|
- planApi
|
|
|
- .updateDmapCase(updateAutoCaseParam)
|
|
|
- .then((res) => {
|
|
|
- // console.log("resUpdateAutoCase", res);
|
|
|
- })
|
|
|
- .catch((err) => {
|
|
|
- console.error(err);
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- .catch((err) => {
|
|
|
- autoTaskSubmitLoading.value = false;
|
|
|
- console.error(err);
|
|
|
- });
|
|
|
- // autoPlanResult();
|
|
|
}
|
|
|
};
|