feat: 测试计划报告入口
This commit is contained in:
parent
5868d06069
commit
1610c32f24
|
@ -1550,8 +1550,9 @@ public class TestPlanService {
|
||||||
BufferedReader bufferedReader = new BufferedReader(isr);
|
BufferedReader bufferedReader = new BufferedReader(isr);
|
||||||
String line = null;
|
String line = null;
|
||||||
while (null != (line = bufferedReader.readLine())) {
|
while (null != (line = bufferedReader.readLine())) {
|
||||||
line = line.replace("\"#report\"", JSONObject.toJSONString(report));
|
if (line.contains("\"#report\"")) {
|
||||||
// line = line.replace("\"#preview\"", JSONObject.toJSONString(previews));
|
line = line.replace("\"#report\"", JSONObject.toJSONString(report));
|
||||||
|
}
|
||||||
line += "\n";
|
line += "\n";
|
||||||
byte[] lineBytes = line.getBytes(StandardCharsets.UTF_8);
|
byte[] lineBytes = line.getBytes(StandardCharsets.UTF_8);
|
||||||
int start = 0;
|
int start = 0;
|
||||||
|
|
|
@ -42,16 +42,16 @@ export default {
|
||||||
component: () => import('@/business/components/settings/workspace/template/IssuesTemplateList'),
|
component: () => import('@/business/components/settings/workspace/template/IssuesTemplateList'),
|
||||||
meta: {workspaceTemplate: true, title: 'workspace.issue_template_manage', permissions: ['WORKSPACE_TEMPLATE:READ+ISSUE_TEMPLATE']},
|
meta: {workspaceTemplate: true, title: 'workspace.issue_template_manage', permissions: ['WORKSPACE_TEMPLATE:READ+ISSUE_TEMPLATE']},
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
path: 'workspace/template/report',
|
// path: 'workspace/template/report',
|
||||||
name: 'testCaseReportTemplate',
|
// name: 'testCaseReportTemplate',
|
||||||
component: () => import('@/business/components/settings/workspace/template/TestCaseReportTemplate'),
|
// component: () => import('@/business/components/settings/workspace/template/TestCaseReportTemplate'),
|
||||||
meta: {
|
// meta: {
|
||||||
workspaceTemplate: true,
|
// workspaceTemplate: true,
|
||||||
title: 'test_track.plan_view.report_template',
|
// title: 'test_track.plan_view.report_template',
|
||||||
permissions: ['WORKSPACE_TEMPLATE:READ+REPORT_TEMPLATE']
|
// permissions: ['WORKSPACE_TEMPLATE:READ+REPORT_TEMPLATE']
|
||||||
}
|
// }
|
||||||
},
|
// },
|
||||||
{
|
{
|
||||||
path: 'testresourcepool',
|
path: 'testresourcepool',
|
||||||
component: () => import('@/business/components/settings/system/TestResourcePool'),
|
component: () => import('@/business/components/settings/system/TestResourcePool'),
|
||||||
|
|
|
@ -195,13 +195,8 @@
|
||||||
<ms-table-operator-button :tip="$t('commons.copy')" icon="el-icon-copy-document"
|
<ms-table-operator-button :tip="$t('commons.copy')" icon="el-icon-copy-document"
|
||||||
@exec="handleCopy(scope.row)" v-permission="['PROJECT_TRACK_PLAN:READ+COPY']"/>
|
@exec="handleCopy(scope.row)" v-permission="['PROJECT_TRACK_PLAN:READ+COPY']"/>
|
||||||
<ms-table-operator-button v-permission="['PROJECT_TRACK_PLAN:READ+EDIT']"
|
<ms-table-operator-button v-permission="['PROJECT_TRACK_PLAN:READ+EDIT']"
|
||||||
v-if="!scope.row.reportId"
|
|
||||||
:tip="$t('test_track.plan_view.create_report')" icon="el-icon-s-data"
|
|
||||||
@exec="openTestReportTemplate(scope.row)"/>
|
|
||||||
<ms-table-operator-button v-if="scope.row.reportId"
|
|
||||||
v-permission="['PROJECT_TRACK_PLAN:READ+EDIT']"
|
|
||||||
:tip="$t('test_track.plan_view.view_report')" icon="el-icon-s-data"
|
:tip="$t('test_track.plan_view.view_report')" icon="el-icon-s-data"
|
||||||
@exec="openReport(scope.row.id, scope.row.reportId)"/>
|
@exec="openReport(scope.row)"/>
|
||||||
</template>
|
</template>
|
||||||
</ms-table-operator>
|
</ms-table-operator>
|
||||||
<el-dropdown @command="handleCommand($event, scope.row)" class="scenario-ext-btn">
|
<el-dropdown @command="handleCommand($event, scope.row)" class="scenario-ext-btn">
|
||||||
|
@ -227,14 +222,13 @@
|
||||||
|
|
||||||
<ms-table-pagination :change="initTableData" :current-page.sync="currentPage" :page-size.sync="pageSize"
|
<ms-table-pagination :change="initTableData" :current-page.sync="currentPage" :page-size.sync="pageSize"
|
||||||
:total="total"/>
|
:total="total"/>
|
||||||
<test-report-template-list @openReport="openReport" ref="testReportTemplateList"/>
|
|
||||||
<test-case-report-view @refresh="initTableData" ref="testCaseReportView"/>
|
|
||||||
<ms-delete-confirm :title="$t('test_track.plan.plan_delete')" @delete="_handleDelete" ref="deleteConfirm"
|
<ms-delete-confirm :title="$t('test_track.plan.plan_delete')" @delete="_handleDelete" ref="deleteConfirm"
|
||||||
:with-tip="enableDeleteTip">
|
:with-tip="enableDeleteTip">
|
||||||
{{ $t('test_track.plan.plan_delete_tip') }}
|
{{ $t('test_track.plan.plan_delete_tip') }}
|
||||||
</ms-delete-confirm>
|
</ms-delete-confirm>
|
||||||
<ms-test-plan-schedule-maintain ref="scheduleMaintain" @refreshTable="initTableData"/>
|
<ms-test-plan-schedule-maintain ref="scheduleMaintain" @refreshTable="initTableData"/>
|
||||||
<plan-run-mode-with-env @handleRunBatch="_handleRun" ref="runMode" :plan-case-ids="[]" :type="'plan'" :plan-id="currentPlanId"/>
|
<plan-run-mode-with-env @handleRunBatch="_handleRun" ref="runMode" :plan-case-ids="[]" :type="'plan'" :plan-id="currentPlanId"/>
|
||||||
|
<test-plan-report-review ref="testCaseReportView"/>
|
||||||
</el-card>
|
</el-card>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -247,8 +241,6 @@ import MsTableOperatorButton from "../../../common/components/MsTableOperatorBut
|
||||||
import MsTableOperator from "../../../common/components/MsTableOperator";
|
import MsTableOperator from "../../../common/components/MsTableOperator";
|
||||||
import PlanStatusTableItem from "../../common/tableItems/plan/PlanStatusTableItem";
|
import PlanStatusTableItem from "../../common/tableItems/plan/PlanStatusTableItem";
|
||||||
import PlanStageTableItem from "../../common/tableItems/plan/PlanStageTableItem";
|
import PlanStageTableItem from "../../common/tableItems/plan/PlanStageTableItem";
|
||||||
import TestReportTemplateList from "../view/comonents/TestReportTemplateList";
|
|
||||||
import TestCaseReportView from "../view/comonents/report/TestCaseReportView";
|
|
||||||
import MsDeleteConfirm from "../../../common/components/MsDeleteConfirm";
|
import MsDeleteConfirm from "../../../common/components/MsDeleteConfirm";
|
||||||
import {TEST_PLAN_CONFIGS} from "../../../common/components/search/search-components";
|
import {TEST_PLAN_CONFIGS} from "../../../common/components/search/search-components";
|
||||||
import {
|
import {
|
||||||
|
@ -267,16 +259,16 @@ import MsTag from "@/business/components/common/components/MsTag";
|
||||||
import MsTestPlanScheduleMaintain from "@/business/components/track/plan/components/ScheduleMaintain";
|
import MsTestPlanScheduleMaintain from "@/business/components/track/plan/components/ScheduleMaintain";
|
||||||
import {getCurrentProjectID, getCurrentUserId, hasPermission} from "@/common/js/utils";
|
import {getCurrentProjectID, getCurrentUserId, hasPermission} from "@/common/js/utils";
|
||||||
import PlanRunModeWithEnv from "@/business/components/track/plan/common/PlanRunModeWithEnv";
|
import PlanRunModeWithEnv from "@/business/components/track/plan/common/PlanRunModeWithEnv";
|
||||||
|
import TestPlanReportReview from "@/business/components/track/report/components/TestPlanReportReview";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "TestPlanList",
|
name: "TestPlanList",
|
||||||
components: {
|
components: {
|
||||||
|
TestPlanReportReview,
|
||||||
MsTag,
|
MsTag,
|
||||||
HeaderLabelOperate,
|
HeaderLabelOperate,
|
||||||
HeaderCustom,
|
HeaderCustom,
|
||||||
MsDeleteConfirm,
|
MsDeleteConfirm,
|
||||||
TestCaseReportView,
|
|
||||||
TestReportTemplateList,
|
|
||||||
PlanStageTableItem,
|
PlanStageTableItem,
|
||||||
PlanStatusTableItem,
|
PlanStatusTableItem,
|
||||||
MsTestPlanScheduleMaintain,
|
MsTestPlanScheduleMaintain,
|
||||||
|
@ -446,13 +438,8 @@ export default {
|
||||||
this.saveSortField(this.tableHeaderKey,this.condition.orders);
|
this.saveSortField(this.tableHeaderKey,this.condition.orders);
|
||||||
this.initTableData();
|
this.initTableData();
|
||||||
},
|
},
|
||||||
openTestReportTemplate(data) {
|
openReport(plan) {
|
||||||
this.$refs.testReportTemplateList.open(data.id);
|
this.$refs.testCaseReportView.open(plan);
|
||||||
},
|
|
||||||
openReport(planId, reportId) {
|
|
||||||
if (reportId) {
|
|
||||||
this.$refs.testCaseReportView.open(planId, reportId);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
scheduleTask(row) {
|
scheduleTask(row) {
|
||||||
row.redirectFrom = "testPlan";
|
row.redirectFrom = "testPlan";
|
||||||
|
|
|
@ -0,0 +1,97 @@
|
||||||
|
<template>
|
||||||
|
<el-drawer
|
||||||
|
:visible.sync="showDialog"
|
||||||
|
:with-header="false"
|
||||||
|
:modal-append-to-body="false"
|
||||||
|
size="100%"
|
||||||
|
ref="drawer"
|
||||||
|
v-loading="result.loading">
|
||||||
|
<template v-slot:default="scope">
|
||||||
|
<el-row type="flex" class="head-bar">
|
||||||
|
<el-col :span="12">
|
||||||
|
<div class="name-edit">
|
||||||
|
<el-button plain size="mini" icon="el-icon-back" @click="handleClose">{{$t('test_track.return')}}
|
||||||
|
</el-button>
|
||||||
|
<span class="title">{{plan.name}}</span>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12" class="head-right">
|
||||||
|
<!-- <el-button v-permission="['PROJECT_TRACK_REPORT:READ+EXPORT']" :disabled="!isTestManagerOrTestUser" plain size="mini" @click="handleExport(report.name)">-->
|
||||||
|
<!-- {{$t('test_track.plan_view.export_report')}}-->
|
||||||
|
<!-- </el-button>-->
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-scrollbar>
|
||||||
|
<div class="container">
|
||||||
|
<test-plan-report-content :plan-id="plan.id"/>
|
||||||
|
</div>
|
||||||
|
</el-scrollbar>
|
||||||
|
</template>
|
||||||
|
</el-drawer>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
import TestPlanReportContent from "@/business/components/track/plan/view/comonents/report/detail/TestPlanReportContent";
|
||||||
|
export default {
|
||||||
|
name: "TestPlanReportReview",
|
||||||
|
components: {
|
||||||
|
TestPlanReportContent
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
result: {},
|
||||||
|
showDialog: false,
|
||||||
|
plan: {},
|
||||||
|
isTestManagerOrTestUser: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.isTestManagerOrTestUser = true;
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
listenGoBack() {
|
||||||
|
//监听浏览器返回操作,关闭该对话框
|
||||||
|
if (window.history && window.history.pushState) {
|
||||||
|
history.pushState(null, null, document.URL);
|
||||||
|
window.addEventListener('popstate', this.goBack, false);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
goBack() {
|
||||||
|
this.handleClose();
|
||||||
|
},
|
||||||
|
open(plan) {
|
||||||
|
this.plan = plan;
|
||||||
|
this.showDialog = true;
|
||||||
|
this.listenGoBack();
|
||||||
|
},
|
||||||
|
handleClose() {
|
||||||
|
window.removeEventListener('popstate', this.goBack, false);
|
||||||
|
this.$emit('refresh');
|
||||||
|
this.showDialog = false;
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
.head-bar {
|
||||||
|
background: white;
|
||||||
|
height: 45px;
|
||||||
|
line-height: 45px;
|
||||||
|
padding: 0 10px;
|
||||||
|
border: 1px solid #EBEEF5;
|
||||||
|
box-shadow: 0 0 2px 0 rgba(31, 31, 31, 0.15), 0 1px 2px 0 rgba(31, 31, 31, 0.15);
|
||||||
|
}
|
||||||
|
|
||||||
|
.container {
|
||||||
|
height: 100vh;
|
||||||
|
background: #F5F5F5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.head-right {
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
Loading…
Reference in New Issue