测试报告修改至测试计划
This commit is contained in:
parent
c7a927c78c
commit
9569be7d1f
|
@ -84,13 +84,22 @@
|
|||
<el-table-column
|
||||
:label="$t('commons.operating')">
|
||||
<template v-slot:default="scope">
|
||||
<ms-table-operator :is-tester-permission="true" @editClick="handleEdit(scope.row)" @deleteClick="handleDelete(scope.row)"/>
|
||||
<ms-table-operator :is-tester-permission="true" @editClick="handleEdit(scope.row)" @deleteClick="handleDelete(scope.row)">
|
||||
<template v-slot:middle>
|
||||
<ms-table-operator-button type="success" v-if="!scope.row.reportId" :tip="$t('test_track.plan_view.create_report')" icon="el-icon-document" @exec="openTestReportTemplate(scope.row)"/>
|
||||
<ms-table-operator-button type="success" v-if="scope.row.reportId" :tip="$t('test_track.plan_view.view_report')" icon="el-icon-document" @exec="openReport(scope.row.id, scope.row.reportId)"/>
|
||||
</template>
|
||||
</ms-table-operator>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<ms-table-pagination :change="initTableData" :current-page.sync="currentPage" :page-size.sync="pageSize"
|
||||
:total="total"/>
|
||||
|
||||
<test-report-template-list @openReport="openReport" ref="testReporTtemplateList"/>
|
||||
<test-case-report-view @refresh="initTableData" ref="testCaseReportView"/>
|
||||
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
|
@ -104,10 +113,14 @@
|
|||
import PlanStatusTableItem from "../../common/tableItems/plan/PlanStatusTableItem";
|
||||
import PlanStageTableItem from "../../common/tableItems/plan/PlanStageTableItem";
|
||||
import {_filter, _sort} from "../../../../../common/js/utils";
|
||||
import TestReportTemplateList from "../view/comonents/TestReportTemplateList";
|
||||
import TestCaseReportView from "../view/comonents/report/TestCaseReportView";
|
||||
|
||||
export default {
|
||||
name: "TestPlanList",
|
||||
components: {
|
||||
TestCaseReportView,
|
||||
TestReportTemplateList,
|
||||
PlanStageTableItem,
|
||||
PlanStatusTableItem,
|
||||
MsTableOperator, MsTableOperatorButton, MsDialogFooter, MsTableHeader, MsCreateBox, MsTablePagination},
|
||||
|
@ -198,7 +211,15 @@
|
|||
sort(column) {
|
||||
_sort(column, this.condition);
|
||||
this.initTableData();
|
||||
}
|
||||
},
|
||||
openTestReportTemplate(data) {
|
||||
this.$refs.testReporTtemplateList.open(data.id);
|
||||
},
|
||||
openReport(planId, reportId) {
|
||||
if (reportId) {
|
||||
this.$refs.testCaseReportView.open(planId, reportId);
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -13,8 +13,6 @@
|
|||
<ms-table-button :is-tester-permission="true" icon="el-icon-unlock" :content="$t('test_track.plan_view.cancel_relevance')" @click="handleBatch('delete')"/>
|
||||
<ms-table-button :is-tester-permission="true" icon="el-icon-edit-outline" :content="$t('test_track.plan_view.change_execution_results')" @click="handleBatch('status')"/>
|
||||
<ms-table-button :is-tester-permission="true" icon="el-icon-user" :content="$t('test_track.plan_view.change_executor')" @click="handleBatch('executor')"/>
|
||||
<ms-table-button :is-tester-permission="true" v-if="!testPlan.reportId" icon="el-icon-document" :content="$t('test_track.plan_view.create_report')" @click="openTestReport"/>
|
||||
<ms-table-button :is-tester-permission="true" v-if="testPlan.reportId" icon="el-icon-document" :content="$t('test_track.plan_view.view_report')" @click="openReport"/>
|
||||
</template>
|
||||
</ms-table-header>
|
||||
</template>
|
||||
|
@ -138,9 +136,6 @@
|
|||
:is-read-only="isReadOnly"
|
||||
@refreshTable="search"/>
|
||||
|
||||
<test-report-template-list @openReport="openReport" :plan-id="planId" ref="testReporTtemplateList"/>
|
||||
<test-case-report-view :plan-id="planId" ref="testCaseReportView"/>
|
||||
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -169,8 +164,6 @@
|
|||
export default {
|
||||
name: "TestPlanTestCaseList",
|
||||
components: {
|
||||
TestCaseReportView,
|
||||
TestReportTemplateList,
|
||||
MsTableOperatorButton,
|
||||
MsTableOperator,
|
||||
MethodTableItem,
|
||||
|
@ -351,9 +344,6 @@
|
|||
}
|
||||
this.initTableData();
|
||||
},
|
||||
openTestReport() {
|
||||
this.$refs.testReporTtemplateList.open();
|
||||
},
|
||||
statusChange(param) {
|
||||
this.$post('/test/plan/case/edit' , param, () => {
|
||||
for (let i = 0; i < this.tableData.length; i++) {
|
||||
|
@ -372,13 +362,6 @@
|
|||
});
|
||||
}
|
||||
},
|
||||
openReport(id) {
|
||||
this.getTestPlanById();
|
||||
if (!id) {
|
||||
id = this.testPlan.reportId;
|
||||
}
|
||||
this.$refs.testCaseReportView.open(id);
|
||||
},
|
||||
filter(filters) {
|
||||
_filter(filters, this.condition);
|
||||
this.initTableData();
|
||||
|
|
|
@ -21,12 +21,8 @@
|
|||
data() {
|
||||
return {
|
||||
templateVisible: false,
|
||||
templates: []
|
||||
}
|
||||
},
|
||||
props: {
|
||||
planId: {
|
||||
type: String
|
||||
templates: [],
|
||||
planId: ''
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
@ -43,12 +39,13 @@
|
|||
param.planId = this.planId;
|
||||
param.templateId = templateId;
|
||||
this.$post('/case/report/add', param, response => {
|
||||
this.$emit('openReport', response.data);
|
||||
this.$emit('openReport', param.planId, response.data);
|
||||
this.templateVisible = false;
|
||||
});
|
||||
},
|
||||
open() {
|
||||
open(planId) {
|
||||
this.templateVisible = true;
|
||||
this.planId = planId;
|
||||
this.initData();
|
||||
}
|
||||
|
||||
|
|
|
@ -62,6 +62,7 @@
|
|||
report: {},
|
||||
reportId: '',
|
||||
metric: {},
|
||||
planId: '',
|
||||
componentMap: new Map(
|
||||
[
|
||||
[1, { name: this.$t('test_track.plan_view.base_info'), id: 1 , type: 'system'}],
|
||||
|
@ -72,11 +73,6 @@
|
|||
)
|
||||
}
|
||||
},
|
||||
props: {
|
||||
planId: {
|
||||
type: String
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
listenGoBack() {
|
||||
//监听浏览器返回操作,关闭该对话框
|
||||
|
@ -88,7 +84,8 @@
|
|||
goBack() {
|
||||
this.handleClose();
|
||||
},
|
||||
open(id) {
|
||||
open(planId, id) {
|
||||
this.planId = planId;
|
||||
if (id) {
|
||||
this.reportId = id;
|
||||
}
|
||||
|
@ -125,6 +122,7 @@
|
|||
},
|
||||
handleClose() {
|
||||
window.removeEventListener('popstate', this.goBack, false);
|
||||
this.$emit('refresh');
|
||||
this.showDialog = false;
|
||||
},
|
||||
handleEdit() {
|
||||
|
|
Loading…
Reference in New Issue