fix: 测试计划报告总结保存失败

--bug=1009123 --user=陈建星 [ github#8603]报告总结里面编辑完之后,无法保存到报告里面。 https://www.tapd.cn/55049933/s/1092758
This commit is contained in:
chenjianxing 2022-01-17 11:41:25 +08:00 committed by 刘瑞斌
parent 3bd751f23b
commit b06940796a
2 changed files with 14 additions and 4 deletions

View File

@ -41,6 +41,7 @@ import TestPlanApiReport from "@/business/components/track/plan/view/comonents/r
import {generateShareInfoWithExpired} from "@/network/share";
import TestPlanReportEdit
from "@/business/components/track/plan/view/comonents/report/detail/component/TestPlanReportEdit";
import {editPlanReport, saveTestPlanReport} from "@/network/test-plan";
export default {
name: "TestPlanReportButtons",
components: {
@ -80,8 +81,8 @@ export default {
handleSave() {
let param = {};
this.buildParam(param);
this.$get('/test/plan/report/saveTestPlanReport/'+this.planId+'/MANUAL', () => {
this.result = this.$post('/case/report/edit', param, () => {
editPlanReport({id: this.planId, reportSummary: this.report.summary}, () => {
saveTestPlanReport(this.planId, () => {
this.$success(this.$t('commons.save_success'));
});
});

View File

@ -24,9 +24,13 @@ export function getShareTestPlanReport(shareId, planId, callback) {
}
}
export function editPlanReport(param) {
export function editPlanReport(param, callback) {
return post('/test/plan/edit/report', param, () => {
success(i18n.t('commons.save_success'));
if (callback) {
callback();
} else {
success(i18n.t('commons.save_success'));
}
});
}
@ -145,3 +149,8 @@ export function getPlanStageOption(callback) {
let wId = getCurrentWorkspaceId();
return wId ? baseGet('/test/plan/get/stage/option/' + wId, callback) : {};
}
export function saveTestPlanReport(planId, callback) {
return planId ? baseGet('/test/plan/report/saveTestPlanReport/' + planId + '/MANUAL', callback) : {};
}