fix(测试跟踪): 测试计划-报告统计中查看场景报告详情显示未同步变更

--bug=1027023 --user=白奇 【测试跟踪】测试计划-报告统计中查看场景报告详情显示未同步变更 https://www.tapd.cn/55049933/s/1381694
This commit is contained in:
baiqi 2023-06-14 14:41:00 +08:00 committed by fit2-zhao
parent 04aae0195d
commit f8547ca7d0
1 changed files with 110 additions and 86 deletions

View File

@ -1,47 +1,55 @@
<template> <template>
<el-container class="scenario-info"> <el-container class="scenario-info">
<ms-aside-container width="500px" :default-hidden-bottom-top="200" :enable-auto-height="true"> <ms-aside-container
width="500px"
:default-hidden-bottom-top="200"
:enable-auto-height="true"
>
<el-card> <el-card>
<el-scrollbar> <el-scrollbar>
<ms-table v-loading="loading" <ms-table
:show-select-all="false" v-loading="loading"
:screen-height="null" :show-select-all="false"
:enable-selection="false" :screen-height="null"
:highlight-current-row="true" :enable-selection="false"
@refresh="getScenarioApiCase" :highlight-current-row="true"
@handleRowClick="rowClick" @refresh="getScenarioApiCase"
:data="scenarioCases"> @handleRowClick="rowClick"
:data="scenarioCases"
>
<ms-table-column <ms-table-column
:width="80" :width="80"
:label="$t('commons.id')" :label="$t('commons.id')"
prop="customNum"> prop="customNum"
>
</ms-table-column> </ms-table-column>
<ms-table-column <ms-table-column :label="$t('commons.name')" prop="name">
:label="$t('commons.name')"
prop="name">
</ms-table-column> </ms-table-column>
<el-table-column <el-table-column
prop="principalName" prop="principalName"
:label="$t('test_track.plan.plan_principal')"/> :label="$t('test_track.plan.plan_principal')"
/>
<ms-table-column <ms-table-column
:label="$t('test_track.case.priority')" :label="$t('test_track.case.priority')"
:width="80"> :width="80"
>
<template v-slot:default="scope"> <template v-slot:default="scope">
<priority-table-item :value="scope.row.level" ref="priority"/> <priority-table-item :value="scope.row.level" ref="priority" />
</template> </template>
</ms-table-column> </ms-table-column>
<ms-table-column <ms-table-column
:width="70" :width="70"
:label="$t('api_test.automation.step')" :label="$t('api_test.automation.step')"
prop="stepTotal"> prop="stepTotal"
>
</ms-table-column> </ms-table-column>
<ms-table-column <ms-table-column
:width="80" :width="80"
:label="$t('test_track.plan_view.execute_result')" :label="$t('test_track.plan_view.execute_result')"
prop="lastResult"> prop="lastResult"
<template v-slot:default="{row}"> >
<ms-test-plan-api-status :status="row.lastResult"/> <template v-slot:default="{ row }">
<ms-test-plan-api-status :status="row.lastResult" />
</template> </template>
</ms-table-column> </ms-table-column>
</ms-table> </ms-table>
@ -49,7 +57,6 @@
</el-card> </el-card>
</ms-aside-container> </ms-aside-container>
<el-main> <el-main>
<div v-if="showResponse"> <div v-if="showResponse">
<micro-app <micro-app
v-if="!isTemplate" v-if="!isTemplate"
@ -61,25 +68,28 @@
shareId, shareId,
isPlanReport: true, isPlanReport: true,
isTemplate, isTemplate,
response response,
}"/> }"
<ms-api-report v-else />
:report-id="reportId" <ms-api-report
:is-share="isShare" v-else
:share-id="shareId" :report-id="reportId"
:is-plan="true" :is-share="isShare"
:is-template="isTemplate" :share-id="shareId"
:template-report="response"/> :is-plan="true"
:is-template="isTemplate"
:template-report="response"
/>
</div> </div>
<div class="empty" v-else>{{ $t('test_track.plan.load_case.content_empty') }}</div> <div class="empty" v-else>
{{ $t("test_track.plan.load_case.content_empty") }}
</div>
</el-main> </el-main>
</el-container> </el-container>
</template> </template>
<script> <script>
import MsApiReport from "../api/ApiReportDetail"; import MsApiReport from "../api/ApiReportDetail";
import PriorityTableItem from "../../../../../../common/tableItems/planview/PriorityTableItem"; import PriorityTableItem from "../../../../../../common/tableItems/planview/PriorityTableItem";
@ -94,7 +104,7 @@ import {
getPlanScenarioErrorReportCase, getPlanScenarioErrorReportCase,
getSharePlanScenarioErrorReportCase, getSharePlanScenarioErrorReportCase,
getPlanScenarioUnExecuteCase, getPlanScenarioUnExecuteCase,
getSharePlanScenarioUnExecuteCase getSharePlanScenarioUnExecuteCase,
} from "@/api/remote/plan/test-plan"; } from "@/api/remote/plan/test-plan";
import MsTable from "metersphere-frontend/src/components/table/MsTable"; import MsTable from "metersphere-frontend/src/components/table/MsTable";
import MsTableColumn from "metersphere-frontend/src/components/table/MsTableColumn"; import MsTableColumn from "metersphere-frontend/src/components/table/MsTableColumn";
@ -110,8 +120,13 @@ export default {
MsMainContainer, MsMainContainer,
MsAsideContainer, MsAsideContainer,
MicroApp, MicroApp,
MsTableColumn, MsTable, StatusTableItem, MethodTableItem, TypeTableItem, PriorityTableItem, MsTableColumn,
MsApiReport MsTable,
StatusTableItem,
MethodTableItem,
TypeTableItem,
PriorityTableItem,
MsApiReport,
}, },
props: { props: {
planId: String, planId: String,
@ -130,8 +145,8 @@ export default {
loading: false, loading: false,
reportId: null, reportId: null,
response: {}, response: {},
showResponse: false showResponse: false,
} };
}, },
mounted() { mounted() {
this.getScenarioApiCase(); this.getScenarioApiCase();
@ -139,81 +154,87 @@ export default {
watch: { watch: {
scenarioCases() { scenarioCases() {
if (this.scenarioCases) { if (this.scenarioCases) {
this.$emit('setSize', this.scenarioCases.length); this.$emit("setSize", this.scenarioCases.length);
} }
} },
}, },
methods: { methods: {
getScenarioApiCase() { getScenarioApiCase() {
if (this.isTemplate || this.isDb) { if (this.isTemplate || this.isDb) {
if (this.isErrorReport) { if (this.isErrorReport) {
this.scenarioCases = this.report.errorReportScenarios ? this.report.errorReportScenarios : []; this.scenarioCases = this.report.errorReportScenarios
? this.report.errorReportScenarios
: [];
} else if (this.isUnExecute) { } else if (this.isUnExecute) {
this.scenarioCases = this.report.unExecuteScenarios ? this.report.unExecuteScenarios : []; this.scenarioCases = this.report.unExecuteScenarios
? this.report.unExecuteScenarios
: [];
} else if (this.isAll) { } else if (this.isAll) {
this.scenarioCases = this.report.scenarioAllCases ? this.report.scenarioAllCases : []; this.scenarioCases = this.report.scenarioAllCases
? this.report.scenarioAllCases
: [];
} else { } else {
this.scenarioCases = this.report.scenarioFailureCases ? this.report.scenarioFailureCases : []; this.scenarioCases = this.report.scenarioFailureCases
? this.report.scenarioFailureCases
: [];
} }
} else if (this.isShare) { } else if (this.isShare) {
if (this.isErrorReport) { if (this.isErrorReport) {
this.loading = true; this.loading = true;
getSharePlanScenarioErrorReportCase(this.shareId, this.planId) getSharePlanScenarioErrorReportCase(this.shareId, this.planId).then(
.then((r) => { (r) => {
this.loading = false; this.loading = false;
this.scenarioCases = r.data; this.scenarioCases = r.data;
}); }
);
} else if (this.isUnExecute) { } else if (this.isUnExecute) {
this.loading = true; this.loading = true;
getSharePlanScenarioUnExecuteCase(this.shareId, this.planId) getSharePlanScenarioUnExecuteCase(this.shareId, this.planId).then(
.then((r) => { (r) => {
this.loading = false; this.loading = false;
this.scenarioCases = r.data; this.scenarioCases = r.data;
}); }
);
} else if (this.isAll) { } else if (this.isAll) {
this.loading = true; this.loading = true;
getSharePlanScenarioAllCase(this.shareId, this.planId) getSharePlanScenarioAllCase(this.shareId, this.planId).then((r) => {
.then((r) => { this.loading = false;
this.loading = false; this.scenarioCases = r.data;
this.scenarioCases = r.data; });
});
} else { } else {
this.loading = true; this.loading = true;
getSharePlanScenarioFailureCase(this.shareId, this.planId) getSharePlanScenarioFailureCase(this.shareId, this.planId).then(
.then((r) => { (r) => {
this.loading = false; this.loading = false;
this.scenarioCases = r.data; this.scenarioCases = r.data;
}); }
);
} }
} else { } else {
if (this.isErrorReport) { if (this.isErrorReport) {
this.loading = true; this.loading = true;
getPlanScenarioErrorReportCase(this.planId) getPlanScenarioErrorReportCase(this.planId).then((r) => {
.then((r) => { this.loading = false;
this.loading = false; this.scenarioCases = r.data;
this.scenarioCases = r.data; });
});
} else if (this.isUnExecute) { } else if (this.isUnExecute) {
this.loading = true; this.loading = true;
getPlanScenarioUnExecuteCase(this.planId) getPlanScenarioUnExecuteCase(this.planId).then((r) => {
.then((r) => { this.loading = false;
this.loading = false; this.scenarioCases = r.data;
this.scenarioCases = r.data; });
});
} else if (this.isAll) { } else if (this.isAll) {
this.loading = true; this.loading = true;
getPlanScenarioAllCase(this.planId) getPlanScenarioAllCase(this.planId).then((r) => {
.then((r) => { this.loading = false;
this.loading = false; this.scenarioCases = r.data;
this.scenarioCases = r.data; });
});
} else { } else {
this.loading = true; this.loading = true;
getPlanScenarioFailureCase(this.planId) getPlanScenarioFailureCase(this.planId).then((r) => {
.then((r) => { this.loading = false;
this.loading = false; this.scenarioCases = r.data;
this.scenarioCases = r.data; });
});
} }
} }
}, },
@ -222,23 +243,26 @@ export default {
this.$nextTick(() => { this.$nextTick(() => {
if (this.isTemplate) { if (this.isTemplate) {
if (row.response) { if (row.response) {
this.showResponse = true;
this.response = row.response; this.response = row.response;
this.showResponse = true;
} }
} else { } else {
if (row.reportId && row.lastResult !== "Running" && row.lastResult !== "Waiting") { if (
this.showResponse = true; row.reportId &&
row.lastResult !== "Running" &&
row.lastResult !== "Waiting"
) {
this.reportId = row.reportId; this.reportId = row.reportId;
this.showResponse = true;
} }
} }
}); });
} },
} },
} };
</script> </script>
<style scoped> <style scoped>
.padding-col { .padding-col {
padding-right: 0px; padding-right: 0px;
} }