Browse Source

优化

master
陈裕财 3 years ago
parent
commit
964916bd0b
  1. 14
      src/router/routes_xm.js
  2. 6
      src/views/xm/core/xmTestPlan/XmTestPlanInfo.vue
  3. 257
      src/views/xm/rpt/branch/branchRptOverview.vue
  4. 67
      src/views/xm/rpt/comps.js
  5. 2
      src/views/xm/rpt/index/CompsCard.vue
  6. 4
      src/views/xm/rpt/index/CompsCardHisDetail.vue
  7. 57
      src/views/xm/rpt/index/CompsSet.vue
  8. 0
      src/views/xm/rpt/index/common.scss
  9. 66
      src/views/xm/rpt/index/comps.js
  10. 0
      src/views/xm/rpt/index/index.scss
  11. 0
      src/views/xm/rpt/index/index.vue
  12. 0
      src/views/xm/rpt/index/indexForHis.vue
  13. 0
      src/views/xm/rpt/index/indexForHisDetail.vue
  14. 0
      src/views/xm/rpt/index/indexForIteration.vue
  15. 0
      src/views/xm/rpt/index/indexForProduct.vue
  16. 0
      src/views/xm/rpt/index/indexForProject.vue
  17. 0
      src/views/xm/rpt/index/indexForTest.vue
  18. 145
      src/views/xm/rpt/index/overview.scss
  19. 266
      src/views/xm/rpt/iteration/iterationRptOverview.vue
  20. 266
      src/views/xm/rpt/product/productRptOverview.vue
  21. 266
      src/views/xm/rpt/project/projectRptOverview.vue
  22. 266
      src/views/xm/rpt/testCase/testCasedbRptOverview.vue
  23. 145
      src/views/xm/rpt/testPlan/testPlanRptOverview.vue

14
src/router/routes_xm.js

@ -221,7 +221,7 @@ export default {
},
{
path: 'rpt',
component: _import('xm/rpt/indexForProject'),
component: _import('xm/rpt/index/indexForProject'),
name: 'projectRpt',
iconCls: 'fa el-icon-menu',
meta: {
@ -423,7 +423,7 @@ export default {
},
{
path: 'rpt',
component: _import('xm/rpt/indexForProduct'),
component: _import('xm/rpt/index/indexForProduct'),
name: 'productRpt',
iconCls: 'fa el-icon-menu',
meta: {
@ -562,7 +562,7 @@ export default {
},
{
path: 'rpt',
component: _import('xm/rpt/indexForIteration'),
component: _import('xm/rpt/index/indexForIteration'),
name: 'iterationRpt',
iconCls: 'fa el-icon-menu',
meta: {
@ -610,7 +610,7 @@ export default {
{ path: 'flow', component: _import('xm/core/xmTestCase/XmTestCaseFlow'), name: 'testFlow', meta: { title: '用例评审',roles:["user"] },hidden:true},
{ path: 'plan', component: _import('xm/core/xmTestPlan/Overview'), name: 'testPlan', meta: { title: '测试计划',roles:["user"] },hidden:true},
{ path: 'group', component: _import('xm/core/xmGroup/XmGroupForTest'), name: 'testGroup', meta: { title: '团队',roles:["user"] },hidden:true},
{ path: 'rpt', component: _import('xm/rpt/indexForTest'), name: 'testRpt', meta: { title: '统计分析',roles:["user"] },hidden:true},
{ path: 'rpt', component: _import('xm/rpt/index/indexForTest'), name: 'testRpt', meta: { title: '统计分析',roles:["user"] },hidden:true},
]
},
@ -644,9 +644,9 @@ export default {
children: [
{ path: 'his', component: _import('xm/rpt/indexForHis'), name: 'rptHis', meta: { title: '历史报告',roles:["user"] }},
{ path: 'his/detail', component: _import('xm/rpt/indexForHisDetail'), name: 'rptHisDetail', meta: { title: '报告明细',roles:["user"] },hidden:true},
{ path: 'index', component: _import('xm/rpt/index'), name: 'rptIndex', meta: { title: '指标分析',roles:["user"] }},
{ path: 'his', component: _import('xm/rpt/index/indexForHis'), name: 'rptHis', meta: { title: '历史报告',roles:["user"] }},
{ path: 'his/detail', component: _import('xm/rpt/index/indexForHisDetail'), name: 'rptHisDetail', meta: { title: '报告明细',roles:["user"] },hidden:true},
{ path: 'index', component: _import('xm/rpt/index/index'), name: 'rptIndex', meta: { title: '指标分析',roles:["user"] }},
{ path: 'branch/branchDatavFullScreen', name: 'branchDatavFullScreen', meta: { title: '机构效能',openTab:true,outUrl:"${curlDomain}/"+process.env.CONTEXT+"/"+process.env.VERSION+"/#/datav/xm/branch/branchDatavFullScreen" }},
]
},

6
src/views/xm/core/xmTestPlan/XmTestPlanInfo.vue

@ -40,11 +40,11 @@
</el-row>
<el-row v-if="subPage=='testRpt'">
<xm-test-plan-rpt key="rpt" ref="rpt" :xm-test-casedb="xmTestCasedb" :xm-test-plan="xmTestPlan" :xm-product="{id:xmTestCasedb.productId,productName:xmTestCasedb.productName}" :xm-project="{id:xmTestPlan.projectId,name:xmTestPlan.projectName}" category="测试级"></xm-test-plan-rpt >
<xm-test-plan-rpt key="rpt" ref="rpt" :xm-test-casedb="xmTestCasedb" :xm-test-plan="xmTestPlan" :xm-product="{id:xmTestCasedb.productId,productName:xmTestCasedb.productName}" :xm-project="{id:xmTestPlan.projectId,name:xmTestPlan.projectName}" category="测试计划级"></xm-test-plan-rpt >
</el-row>
<el-row v-if="subPage=='xmRpt'">
<xm-rpt key="xmRpt" ref="xmRpt" :xm-test-casedb="xmTestCasedb" :xm-test-plan="xmTestPlan" :xm-product="{id:xmTestCasedb.productId,productName:xmTestCasedb.productName}" :xm-project="{id:xmTestPlan.projectId,name:xmTestPlan.projectName}" category="测试级"></xm-rpt >
<xm-rpt key="xmRpt" ref="xmRpt" :xm-test-casedb="xmTestCasedb" :xm-test-plan="xmTestPlan" :xm-product="{id:xmTestCasedb.productId,productName:xmTestCasedb.productName}" :xm-project="{id:xmTestPlan.projectId,name:xmTestPlan.projectName}" category="测试计划级"></xm-rpt >
</el-row>
</el-row>
<xm-test-plan-mng v-else @select="onTestPlanSelect" :xm-test-casedb="xmTestCasedb"> </xm-test-plan-mng>
@ -66,7 +66,7 @@ export default {
name:'xmTestCasedbMng',
components: {
XmProductSelect,XmQuestionMng,
"xm-test-plan-rpt":()=>import("../../rpt/index.vue"),
"xm-test-plan-rpt":()=>import("../../rpt/index/index.vue"),
"xm-rpt":()=>import("../../rpt/index"),
"xm-test-plan-mng":()=>import("../xmTestPlan/XmTestPlanMng.vue"),
"xm-test-case-mng":()=>import("../xmTestCase/XmTestCaseMng.vue"),

src/views/xm/core/xmTestPlan/xmTestRptOverview.vue → src/views/xm/rpt/branch/branchRptOverview.vue

67
src/views/xm/rpt/comps.js

@ -1,67 +0,0 @@
export default {
xmTestRptOverview:()=>import("../core/xmTestPlan/xmTestRptOverview.vue"),
xmMenuDayTrend:()=>import("./product/menuDayTrend.vue"),
xmMenuDayAccumulate:()=>import("./product/menuDayTrend.vue"),
xmMenuAttDist:()=>import('./product/menuAttDist'),
xmMenuAgeDist:()=>import('./product/menuAgeDist.vue'),
xmMenuSort:()=>import('./product/menuSort.vue'),
xmMenuFuncSort:()=>import('./product/menuSort.vue'),
xmMenuProductSort:()=>import('./product/menuSort.vue'),
xmMenuIterationSort:()=>import('./product/menuSort.vue'),
xmProductWorkItemDayList:()=>import('./product/productWorkItemDayList.vue'),
xmTaskDayTrend:()=>import('./project/taskDayTrend.vue'),
xmTaskDayAccumulate:()=>import('./project/taskDayAccumulate.vue'),
xmTaskAttDist:()=>import('./project/taskAttDist.vue'),
xmTaskAgeDist:()=>import('./project/taskAgeDist.vue'),
xmTaskSort:()=>import('./project/taskSort.vue'),
xmProjectWorkItemDayList:()=>import('./project/projectWorkItemDayList.vue'),
xmProjectWorkloadSetDayList:()=>import('./project/projectWorkloadSetDayList.vue'),
xmProjectWorkloadSetMonthList:()=>import('./project/projectWorkloadSetMonthList.vue'),
xmQuestionDayTrend:()=>import('./product/questionDayTrend.vue'),
xmQuestionDayAccumulate:()=>import('./product/questionDayAccumulate.vue'),
xmQuestionAttDist:()=>import('./product/questionAttDist.vue'),
xmQuestionStateDist:()=>import('./product/questionAttDist.vue'),
xmQuestionAgeDist:()=>import('./product/questionAgeDist.vue'),
xmQuestionBugReasonDist:()=>import('./product/questionAttDist.vue'),
xmQuestionBugTypeDist:()=>import('./product/questionAttDist.vue'),
xmQuestionPriorityDist:()=>import('./product/questionAttDist.vue'),
xmQuestionSort:()=>import('./product/questionSort.vue'),
xmQuestionAskUserSort:()=>import('./product/questionSort.vue'),
xmQuestionHandlerUserSort:()=>import('./product/questionSort.vue'),
xmQuestionFuncSort:()=>import('./product/questionSort.vue'),
xmQuestionMenuSort:()=>import('./product/questionSort.vue'),
xmQuestionRetestDist:()=>import('./product/questionRetestDist.vue'),
xmTestPlanRptOverview:()=>import('./testPlan/testPlanRptOverview.vue'),
xmTestPlanCaseExecStatusDist:()=>import('./testPlan/testPlanCaseExecStatusDist.vue'),
xmTestPlanCaseUserDist:()=>import('./testPlan/testPlanCaseUserDist.vue'),
xmTestDayTimesCalc:()=>import('./testPlan/testDayTimesCalc.vue'),
xmTestCaseToPlanCalc:()=>import('./testPlan/testCaseToPlanCalc.vue'),
xmTestCaseSort:()=>import('./testCase/testCaseSort.vue'),
xmTestCaseCuserSort:()=>import('./testCase/testCaseSort.vue'),
xmTestCaseFuncSort:()=>import('./testCase/testCaseSort.vue'),
xmTestCaseMenuSort:()=>import('./testCase/testCaseSort.vue'),
xmIterationMenuDayTrend:()=>import('./iteration/menuDayTrend.vue'),
xmIterationMenuDayAccumulate:()=>import('./iteration/menuDayAccumulate.vue'),
xmIterationBurnout:()=>import('./iteration/burnout.vue'),
xmIterationWorkItemDayList:()=>import('./iteration/iterationWorkItemDayList.vue'),
xmIterationQuestionDayTrend:()=>import('./iteration/questionDayTrend.vue'),
xmIterationQuestionDayAccumulate:()=>import('./iteration/questionDayAccumulate.vue'),
xmBranchWorkItemDayList:()=>import('./branch/branchWorkItemDayList.vue'),
xmBranchQuestionDayTrend:()=>import('./branch/questionDayTrend.vue'),
xmBranchQuestionDayAccumulate:()=>import('./branch/questionDayAccumulate.vue'),
xmBranchMenuDayTrend:()=>import('./branch/menuDayTrend.vue'),
xmBranchMenuDayAccumulate:()=>import('./branch/menuDayAccumulate.vue'),
};

src/views/xm/rpt/CompsCard.vue → src/views/xm/rpt/index/CompsCard.vue

src/views/xm/rpt/CompsCardHisDetail.vue → src/views/xm/rpt/index/CompsCardHisDetail.vue

src/views/xm/rpt/CompsSet.vue → src/views/xm/rpt/index/CompsSet.vue

src/views/xm/rpt/common.scss → src/views/xm/rpt/index/common.scss

66
src/views/xm/rpt/index/comps.js

@ -0,0 +1,66 @@
export default {
xmMenuDayTrend:()=>import("../product/menuDayTrend.vue"),
xmMenuDayAccumulate:()=>import("../product/menuDayTrend.vue"),
xmMenuAttDist:()=>import("../product/menuAttDist"),
xmMenuAgeDist:()=>import("../product/menuAgeDist.vue"),
xmMenuSort:()=>import("../product/menuSort.vue"),
xmMenuFuncSort:()=>import("../product/menuSort.vue"),
xmMenuProductSort:()=>import("../product/menuSort.vue"),
xmMenuIterationSort:()=>import("../product/menuSort.vue"),
xmProductWorkItemDayList:()=>import("../product/productWorkItemDayList.vue"),
xmTaskDayTrend:()=>import("../project/taskDayTrend.vue"),
xmTaskDayAccumulate:()=>import("../project/taskDayAccumulate.vue"),
xmTaskAttDist:()=>import("../project/taskAttDist.vue"),
xmTaskAgeDist:()=>import("../project/taskAgeDist.vue"),
xmTaskSort:()=>import("../project/taskSort.vue"),
xmProjectWorkItemDayList:()=>import("../project/projectWorkItemDayList.vue"),
xmProjectWorkloadSetDayList:()=>import("../project/projectWorkloadSetDayList.vue"),
xmProjectWorkloadSetMonthList:()=>import("../project/projectWorkloadSetMonthList.vue"),
xmQuestionDayTrend:()=>import("../product/questionDayTrend.vue"),
xmQuestionDayAccumulate:()=>import("../product/questionDayAccumulate.vue"),
xmQuestionAttDist:()=>import("../product/questionAttDist.vue"),
xmQuestionStateDist:()=>import("../product/questionAttDist.vue"),
xmQuestionAgeDist:()=>import("../product/questionAgeDist.vue"),
xmQuestionBugReasonDist:()=>import("../product/questionAttDist.vue"),
xmQuestionBugTypeDist:()=>import("../product/questionAttDist.vue"),
xmQuestionPriorityDist:()=>import("../product/questionAttDist.vue"),
xmQuestionSort:()=>import("../product/questionSort.vue"),
xmQuestionAskUserSort:()=>import("../product/questionSort.vue"),
xmQuestionHandlerUserSort:()=>import("../product/questionSort.vue"),
xmQuestionFuncSort:()=>import("../product/questionSort.vue"),
xmQuestionMenuSort:()=>import("../product/questionSort.vue"),
xmQuestionRetestDist:()=>import("../product/questionRetestDist.vue"),
xmTestPlanRptOverview:()=>import("../testPlan/testPlanRptOverview.vue"),
xmTestPlanCaseExecStatusDist:()=>import("../testPlan/testPlanCaseExecStatusDist.vue"),
xmTestPlanCaseUserDist:()=>import("../testPlan/testPlanCaseUserDist.vue"),
xmTestDayTimesCalc:()=>import("../testPlan/testDayTimesCalc.vue"),
xmTestCaseToPlanCalc:()=>import("../testPlan/testCaseToPlanCalc.vue"),
xmTestCaseSort:()=>import("../testCase/testCaseSort.vue"),
xmTestCaseCuserSort:()=>import("../testCase/testCaseSort.vue"),
xmTestCaseFuncSort:()=>import("../testCase/testCaseSort.vue"),
xmTestCaseMenuSort:()=>import("../testCase/testCaseSort.vue"),
xmIterationMenuDayTrend:()=>import("../iteration/menuDayTrend.vue"),
xmIterationMenuDayAccumulate:()=>import("../iteration/menuDayAccumulate.vue"),
xmIterationBurnout:()=>import("../iteration/burnout.vue"),
xmIterationWorkItemDayList:()=>import("../iteration/iterationWorkItemDayList.vue"),
xmIterationQuestionDayTrend:()=>import("../iteration/questionDayTrend.vue"),
xmIterationQuestionDayAccumulate:()=>import("../iteration/questionDayAccumulate.vue"),
xmBranchWorkItemDayList:()=>import("../branch/branchWorkItemDayList.vue"),
xmBranchQuestionDayTrend:()=>import("../branch/questionDayTrend.vue"),
xmBranchQuestionDayAccumulate:()=>import("../branch/questionDayAccumulate.vue"),
xmBranchMenuDayTrend:()=>import("../branch/menuDayTrend.vue"),
xmBranchMenuDayAccumulate:()=>import("../branch/menuDayAccumulate.vue"),
};

src/views/xm/rpt/index.scss → src/views/xm/rpt/index/index.scss

src/views/xm/rpt/index.vue → src/views/xm/rpt/index/index.vue

src/views/xm/rpt/indexForHis.vue → src/views/xm/rpt/index/indexForHis.vue

src/views/xm/rpt/indexForHisDetail.vue → src/views/xm/rpt/index/indexForHisDetail.vue

src/views/xm/rpt/indexForIteration.vue → src/views/xm/rpt/index/indexForIteration.vue

src/views/xm/rpt/indexForProduct.vue → src/views/xm/rpt/index/indexForProduct.vue

src/views/xm/rpt/indexForProject.vue → src/views/xm/rpt/index/indexForProject.vue

src/views/xm/rpt/indexForTest.vue → src/views/xm/rpt/index/indexForTest.vue

145
src/views/xm/rpt/index/overview.scss

@ -0,0 +1,145 @@
.box{
.box-red{
background-color: #ff75750d;
height: 100px;
border-left-width: 2px;
border-left-color: red;
border-left-style: solid;
align-items: center;
line-height: 100px;
text-align: center;
display:flex;
flex-direction: column;
.box-info{
display:flex;
flex-direction: column;
margin-top: 20px;
height: 100px;
line-height: 100px;
.label{
color: #999;
height: 30px;
line-height: 30px;
font-size: 0.875rem;
}
.num{
height: 30px;
line-height: 30px;
color:red ;
font-size: 30px;
}
}
}
.box-green{
background-color: #73d8970d;;
height: 100px;
border-left-width: 2px;
border-left-color: green;
border-left-style: solid;
align-items: center;
line-height: 100px;
text-align: center;
display:flex;
flex-direction: column;
.box-info{
display:flex;
flex-direction: column;
margin-top: 20px;
height: 100px;
line-height: 100px;
.label{
color: #999;
height: 30px;
line-height: 30px;
font-size: 0.875rem;
}
.num{
height: 30px;
line-height: 30px;
color:green ;
font-size: 30px;
}
}
}
.box-blue{
background-color: #5dcfff0d;
height: 100px;
border-left-width: 2px;
border-left-color: blue;
border-left-style: solid;
align-items: center;
line-height: 100px;
text-align: center;
display:flex;
flex-direction: column;
.box-info{
display:flex;
flex-direction: column;
margin-top: 20px;
height: 100px;
line-height: 100px;
.label{
color: #999;
height: 30px;
line-height: 30px;
font-size: 0.875rem;
}
.num{
height: 30px;
line-height: 30px;
color:blue ;
font-size: 30px;
}
}
}
.box-orange{
background-color: #ffcd5d0d;
height: 100px;
border-left-width: 2px;
border-left-color: orange;
border-left-style: solid;
align-items: center;
line-height: 100px;
text-align: center;
display:flex;
flex-direction: column;
.box-info{
display:flex;
flex-direction: column;
margin-top: 20px;
height: 100px;
line-height: 100px;
.label{
color: #999;
height: 30px;
line-height: 30px;
font-size: 0.875rem;
}
.num{
height: 30px;
line-height: 30px;
color:orange ;
font-size: 30px;
}
}
}
box-font{
font-size: 0.875rem;
}
}

266
src/views/xm/rpt/iteration/iterationRptOverview.vue

@ -0,0 +1,266 @@
<template>
<section class="padding">
<el-row :class="{'row-box':true,'cfg':isRptCfg}">
<div class="rpt-title">{{ rawDatas.name }}</div>
<el-input class="input" v-model="rawDatas.name" placeholder="计划名称"/>
</el-row>
<el-row :class="{'row-box':true,'cfg':isRptCfg}">
<div class="title">{{ title?title:'报告概览' }}</div>
<el-input class="input" v-model="title" placeholder="报告概览"/>
</el-row>
<el-row ref="table">
<el-row class="box">
<el-col :span="6" class="box-red">
<div class="box-info">
<div class="num">{{rawDatas.totalCases?rawDatas.totalCases:'0'}}</div>
<div class="label">用例数</div>
</div>
</el-col>
<el-col :span="6" class="box-blue">
<div class="box-info">
<div class="num">{{caseFuGaiLv}}%</div>
<div class="label">用例覆盖率</div>
</div>
</el-col>
<el-col :span="6" class="box-green">
<div class="box-info">
<div class="num">{{caseTongGuoLv}}%</div>
<div class="label">用例通过率</div>
</div>
</el-col>
<el-col :span="6" class="box-orange">
<div class="box-info">
<div class="num">{{rawDatas.bugCnt?rawDatas.bugCnt:0}}</div>
<div class="label">缺陷数</div>
</div>
</el-col>
</el-row>
<!--编辑界面 XmTestPlan 测试计划-->
<el-form :model="rawDatas" label-width="120px" :rules="rawDatasRules" ref="rawDatasRef" label-position="left">
<el-row class="padding">
<el-col :span="8">
<mdp-select-user-xm label="负责人" userid-key="cuserid" username-key="cusername" v-model="rawDatas"></mdp-select-user-xm>
</el-col>
<el-col :span="8">
<mdp-select-dict-x label="状态" :dict="dicts['testPlanStatus']" v-model="rawDatas.status"></mdp-select-dict-x>
</el-col>
<el-col :span="8">
<mdp-select-dict-x label="测试结果" :dict="dicts['testPlanTcode']" v-model="rawDatas.tcode"></mdp-select-dict-x>
</el-col>
</el-row>
<el-form-item label="归属测试库" prop="casedbName">
{{rawDatas.casedbName}}
</el-form-item>
<el-form-item label="归属项目" prop="projectId">
<span v-if="opType=='add'">
<xm-project-select v-if="!selProject || !selProject.id" ref="xmProjectSelect" :link-product-id="xmTestCasedb? xmTestCasedb.productId:null" @row-click="onPorjectConfirm" :auto-select="false">
<span slot="title">选择项目</span>
</xm-project-select>
<div v-else>{{rawDatas.projectName}}</div>
</span>
<div v-else>{{rawDatas.projectName}}</div>
</el-form-item>
<el-form-item label="归属产品" prop="productName">
{{rawDatas.productName}}
</el-form-item>
<el-form-item label="起止时间" prop="stime">
<mdp-date-range :auto-default="false" placeholder="选择日期" v-model="rawDatas" start-key="stime" end-key="etime" value-format="yyyy-MM-dd HH:mm:ss" format="yyyy-MM-dd" ></mdp-date-range>
</el-form-item>
</el-form>
</el-row>
<el-row class="padding-bottom">
<span>报告总结</span>
</el-row>
<el-row>
<el-input type="textarea" :rows="8" v-model="rawDatas.summaryRemark"></el-input>
</el-row>
<el-row v-if="rawDatas.summaryRemark!==rawDatasBak.summaryRemark" >
<span style="float:right;">
<el-button type="primary" @click.native="editSomeFields(rawDatas,'summaryRemark',rawDatas.summaryRemark)">提交</el-button>
</span>
</el-row>
</section>
</template>
<script>
import util from '@/common/js/util';//
import config from "@/common/config"; //import
import { initDicts, addXmTestPlan,editXmTestPlan,editSomeFieldsXmTestPlan } from '@/api/xm/core/xmTestPlan';
import { mapGetters } from 'vuex'
import XmProjectSelect from '@/views/xm/core/components/XmProjectSelect';
import MdpSelectUserXm from '@/views/xm/core/components/MdpSelectUserXm';//
export default {
name:'xmTestPlanEdit',
components: {
XmProjectSelect,MdpSelectUserXm,
},
computed: {
...mapGetters([ 'userInfo' ]),
caseFuGaiLv(){
if(!this.rawDatas.totalCases){
return 0
}
var okCases=parseInt(this.rawDatas.okCases>0?this.rawDatas.okCases:0)
var errCases=parseInt(this.rawDatas.errCases>0?this.rawDatas.errCases:0)
var igCases=parseInt(this.rawDatas.igCases>0?this.rawDatas.igCases:0)
var blCases=parseInt(this.rawDatas.blCases>0?this.rawDatas.blCases:0)
var totalExecs=okCases+errCases+igCases+blCases
var rate=parseInt(totalExecs/this.rawDatas.totalCases*100)
return rate;
},
caseTongGuoLv(){
if(!this.rawDatas.totalCases){
return 0
}
var okCases=parseInt(this.rawDatas.okCases>0?this.rawDatas.okCases:0)
var errCases=parseInt(this.rawDatas.errCases>0?this.rawDatas.errCases:0)
var igCases=parseInt(this.rawDatas.igCases>0?this.rawDatas.igCases:0)
var blCases=parseInt(this.rawDatas.blCases>0?this.rawDatas.blCases:0)
var totalExecs=okCases+igCases
var rate=parseInt(totalExecs/this.rawDatas.totalCases*100)
return rate;
}
},
props:['xmTestPlan','visible','opType','selProject','xmTestCasedb','rptDatas','isRptCfg'],
watch: {
'xmTestPlan':function( xmTestPlan ) {
if(xmTestPlan){
this.rawDatas = {...xmTestPlan};
}
},
'visible':function(visible) {
if(visible==true){
this.initData()
}
}
},
data() {
return {
title:'',
remark:'',
currOpType:'add',//add/edit
load:{ list: false, edit: false, del: false, add: false },//...
dicts:{
testPlanStatus:[],
testPlanTcode:[],
},// params={categoryId:'all',itemCodes:['sex']} {sex: [{id:'1',name:''},{id:'2',name:''}]}
rawDatasRules: {
},
rawDatas: {
id:'',name:'',casedbId:'',casedbName:'',projectId:'',projectName:'',cuserid:'',cusername:'',ctime:'',stime:'',etime:'',status:'',tcode:'',totalCases:'',okCases:'',errCases:'',igCases:'',blCases:'',productId:'',productName:'',flowState:'',summaryRemark:''
},
rawDatasBak: {
id:'',name:'',casedbId:'',casedbName:'',projectId:'',projectName:'',cuserid:'',cusername:'',ctime:'',stime:'',etime:'',status:'',tcode:'',totalCases:'',okCases:'',errCases:'',igCases:'',blCases:'',productId:'',productName:'',flowState:'',summaryRemark:''
},
maxTableHeight:300,
summaryRemarkEditVisible:false,
}//end return
},//end data
methods: {
...util,
// @cancel="rawDatasVisible=false"
handleCancel:function(){
this.$refs['rawDatasRef'].resetFields();
this.$emit('cancel');
},
//XmTestPlan @submit="afterEditSubmit"
saveSubmit: function () {
this.$refs.rawDatasRef.validate((valid) => {
if (valid) {
this.$confirm('确认提交吗?', '提示', {}).then(() => {
this.load.edit=true
let params = Object.assign({}, this.rawDatas);
var func=addXmTestPlan
if(this.currOpType=='edit'){
func=editXmTestPlan
}
func(params).then((res) => {
this.load.edit=false
var tips=res.data.tips;
if(tips.isOk){
this.rawDatas=res.data.data
this.initData()
this.currOpType="edit";
this.$emit('submit');// @submit="afterAddSubmit"
}
this.$notify({ position:'bottom-left',showClose:true, message: tips.msg, type: tips.isOk?'success':'error' });
}).catch( err =>this.load.edit=false);
});
}else{
this.$notify({ showClose:true, message: "表单验证不通过,请修改表单数据再提交", type: 'error' });
}
});
},
initData: function(){
if(this.xmTestPlan){
this.rawDatas = Object.assign({},this.xmTestPlan);
}
if(this.rptDatas){
this.rawDatas=Object.assign({},this.rptDatas)
}
this.rawDatasBak={...this.rawDatas}
},
editSomeFields(row,fieldName,$event){
if(this.opType=='add'){
return;
}
let params={};
params['ids']=[row].map(i=>i.id)
if(fieldName=='stime'){
params[fieldName]=$event.stime
params.etime=$event.etime
}else if(fieldName=='cuserid'){
params[fieldName]=$event[0].userid
params.cusername=$event[0].username
}else{
params[fieldName]=$event
}
var func = editSomeFieldsXmTestPlan
func(params).then(res=>{
let tips = res.data.tips;
if(tips.isOk){
this.rawDatasBak=[...this.rawDatas]
this.$emit('edit-fields',params)
}else{
Object.assign(this.rawDatas,this.rawDatasBak)
this.$notify({position:'bottom-left',showClose:true,message:tips.msg,type:tips.isOk?'success':'error'})
}
}).catch((e)=>Object.assign(this.rawDatas,this.rawDatasBak))
},
onPorjectConfirm(row){
this.rawDatas.projectId=row.id
this.rawDatas.projectName=row.name
this.rawDatas.name=this.rawDatas.projectName+'-测试计划-V1.0'
},
sizeAutoChange(){
}
},//end method
mounted() {
this.$nextTick(() => {
initDicts(this);
this.initData()
this.maxTableHeight = util.calcTableMaxHeight(this.$refs.table.$el)
});
}
}
</script>
<style lang="scss" scoped>
@import url('../index/overview.scss');
</style>

266
src/views/xm/rpt/product/productRptOverview.vue

@ -0,0 +1,266 @@
<template>
<section class="padding">
<el-row :class="{'row-box':true,'cfg':isRptCfg}">
<div class="rpt-title">{{ rawDatas.name }}</div>
<el-input class="input" v-model="rawDatas.name" placeholder="计划名称"/>
</el-row>
<el-row :class="{'row-box':true,'cfg':isRptCfg}">
<div class="title">{{ title?title:'报告概览' }}</div>
<el-input class="input" v-model="title" placeholder="报告概览"/>
</el-row>
<el-row ref="table">
<el-row class="box">
<el-col :span="6" class="box-red">
<div class="box-info">
<div class="num">{{rawDatas.totalCases?rawDatas.totalCases:'0'}}</div>
<div class="label">用例数</div>
</div>
</el-col>
<el-col :span="6" class="box-blue">
<div class="box-info">
<div class="num">{{caseFuGaiLv}}%</div>
<div class="label">用例覆盖率</div>
</div>
</el-col>
<el-col :span="6" class="box-green">
<div class="box-info">
<div class="num">{{caseTongGuoLv}}%</div>
<div class="label">用例通过率</div>
</div>
</el-col>
<el-col :span="6" class="box-orange">
<div class="box-info">
<div class="num">{{rawDatas.bugCnt?rawDatas.bugCnt:0}}</div>
<div class="label">缺陷数</div>
</div>
</el-col>
</el-row>
<!--编辑界面 XmTestPlan 测试计划-->
<el-form :model="rawDatas" label-width="120px" :rules="rawDatasRules" ref="rawDatasRef" label-position="left">
<el-row class="padding">
<el-col :span="8">
<mdp-select-user-xm label="负责人" userid-key="cuserid" username-key="cusername" v-model="rawDatas"></mdp-select-user-xm>
</el-col>
<el-col :span="8">
<mdp-select-dict-x label="状态" :dict="dicts['testPlanStatus']" v-model="rawDatas.status"></mdp-select-dict-x>
</el-col>
<el-col :span="8">
<mdp-select-dict-x label="测试结果" :dict="dicts['testPlanTcode']" v-model="rawDatas.tcode"></mdp-select-dict-x>
</el-col>
</el-row>
<el-form-item label="归属测试库" prop="casedbName">
{{rawDatas.casedbName}}
</el-form-item>
<el-form-item label="归属项目" prop="projectId">
<span v-if="opType=='add'">
<xm-project-select v-if="!selProject || !selProject.id" ref="xmProjectSelect" :link-product-id="xmTestCasedb? xmTestCasedb.productId:null" @row-click="onPorjectConfirm" :auto-select="false">
<span slot="title">选择项目</span>
</xm-project-select>
<div v-else>{{rawDatas.projectName}}</div>
</span>
<div v-else>{{rawDatas.projectName}}</div>
</el-form-item>
<el-form-item label="归属产品" prop="productName">
{{rawDatas.productName}}
</el-form-item>
<el-form-item label="起止时间" prop="stime">
<mdp-date-range :auto-default="false" placeholder="选择日期" v-model="rawDatas" start-key="stime" end-key="etime" value-format="yyyy-MM-dd HH:mm:ss" format="yyyy-MM-dd" ></mdp-date-range>
</el-form-item>
</el-form>
</el-row>
<el-row class="padding-bottom">
<span>报告总结</span>
</el-row>
<el-row>
<el-input type="textarea" :rows="8" v-model="rawDatas.summaryRemark"></el-input>
</el-row>
<el-row v-if="rawDatas.summaryRemark!==rawDatasBak.summaryRemark" >
<span style="float:right;">
<el-button type="primary" @click.native="editSomeFields(rawDatas,'summaryRemark',rawDatas.summaryRemark)">提交</el-button>
</span>
</el-row>
</section>
</template>
<script>
import util from '@/common/js/util';//
import config from "@/common/config"; //import
import { initDicts, addXmTestPlan,editXmTestPlan,editSomeFieldsXmTestPlan } from '@/api/xm/core/xmTestPlan';
import { mapGetters } from 'vuex'
import XmProjectSelect from '@/views/xm/core/components/XmProjectSelect';
import MdpSelectUserXm from '@/views/xm/core/components/MdpSelectUserXm';//
export default {
name:'xmTestPlanEdit',
components: {
XmProjectSelect,MdpSelectUserXm,
},
computed: {
...mapGetters([ 'userInfo' ]),
caseFuGaiLv(){
if(!this.rawDatas.totalCases){
return 0
}
var okCases=parseInt(this.rawDatas.okCases>0?this.rawDatas.okCases:0)
var errCases=parseInt(this.rawDatas.errCases>0?this.rawDatas.errCases:0)
var igCases=parseInt(this.rawDatas.igCases>0?this.rawDatas.igCases:0)
var blCases=parseInt(this.rawDatas.blCases>0?this.rawDatas.blCases:0)
var totalExecs=okCases+errCases+igCases+blCases
var rate=parseInt(totalExecs/this.rawDatas.totalCases*100)
return rate;
},
caseTongGuoLv(){
if(!this.rawDatas.totalCases){
return 0
}
var okCases=parseInt(this.rawDatas.okCases>0?this.rawDatas.okCases:0)
var errCases=parseInt(this.rawDatas.errCases>0?this.rawDatas.errCases:0)
var igCases=parseInt(this.rawDatas.igCases>0?this.rawDatas.igCases:0)
var blCases=parseInt(this.rawDatas.blCases>0?this.rawDatas.blCases:0)
var totalExecs=okCases+igCases
var rate=parseInt(totalExecs/this.rawDatas.totalCases*100)
return rate;
}
},
props:['xmTestPlan','visible','opType','selProject','xmTestCasedb','rptDatas','isRptCfg'],
watch: {
'xmTestPlan':function( xmTestPlan ) {
if(xmTestPlan){
this.rawDatas = {...xmTestPlan};
}
},
'visible':function(visible) {
if(visible==true){
this.initData()
}
}
},
data() {
return {
title:'',
remark:'',
currOpType:'add',//add/edit
load:{ list: false, edit: false, del: false, add: false },//...
dicts:{
testPlanStatus:[],
testPlanTcode:[],
},// params={categoryId:'all',itemCodes:['sex']} {sex: [{id:'1',name:''},{id:'2',name:''}]}
rawDatasRules: {
},
rawDatas: {
id:'',name:'',casedbId:'',casedbName:'',projectId:'',projectName:'',cuserid:'',cusername:'',ctime:'',stime:'',etime:'',status:'',tcode:'',totalCases:'',okCases:'',errCases:'',igCases:'',blCases:'',productId:'',productName:'',flowState:'',summaryRemark:''
},
rawDatasBak: {
id:'',name:'',casedbId:'',casedbName:'',projectId:'',projectName:'',cuserid:'',cusername:'',ctime:'',stime:'',etime:'',status:'',tcode:'',totalCases:'',okCases:'',errCases:'',igCases:'',blCases:'',productId:'',productName:'',flowState:'',summaryRemark:''
},
maxTableHeight:300,
summaryRemarkEditVisible:false,
}//end return
},//end data
methods: {
...util,
// @cancel="rawDatasVisible=false"
handleCancel:function(){
this.$refs['rawDatasRef'].resetFields();
this.$emit('cancel');
},
//XmTestPlan @submit="afterEditSubmit"
saveSubmit: function () {
this.$refs.rawDatasRef.validate((valid) => {
if (valid) {
this.$confirm('确认提交吗?', '提示', {}).then(() => {
this.load.edit=true
let params = Object.assign({}, this.rawDatas);
var func=addXmTestPlan
if(this.currOpType=='edit'){
func=editXmTestPlan
}
func(params).then((res) => {
this.load.edit=false
var tips=res.data.tips;
if(tips.isOk){
this.rawDatas=res.data.data
this.initData()
this.currOpType="edit";
this.$emit('submit');// @submit="afterAddSubmit"
}
this.$notify({ position:'bottom-left',showClose:true, message: tips.msg, type: tips.isOk?'success':'error' });
}).catch( err =>this.load.edit=false);
});
}else{
this.$notify({ showClose:true, message: "表单验证不通过,请修改表单数据再提交", type: 'error' });
}
});
},
initData: function(){
if(this.xmTestPlan){
this.rawDatas = Object.assign({},this.xmTestPlan);
}
if(this.rptDatas){
this.rawDatas=Object.assign({},this.rptDatas)
}
this.rawDatasBak={...this.rawDatas}
},
editSomeFields(row,fieldName,$event){
if(this.opType=='add'){
return;
}
let params={};
params['ids']=[row].map(i=>i.id)
if(fieldName=='stime'){
params[fieldName]=$event.stime
params.etime=$event.etime
}else if(fieldName=='cuserid'){
params[fieldName]=$event[0].userid
params.cusername=$event[0].username
}else{
params[fieldName]=$event
}
var func = editSomeFieldsXmTestPlan
func(params).then(res=>{
let tips = res.data.tips;
if(tips.isOk){
this.rawDatasBak=[...this.rawDatas]
this.$emit('edit-fields',params)
}else{
Object.assign(this.rawDatas,this.rawDatasBak)
this.$notify({position:'bottom-left',showClose:true,message:tips.msg,type:tips.isOk?'success':'error'})
}
}).catch((e)=>Object.assign(this.rawDatas,this.rawDatasBak))
},
onPorjectConfirm(row){
this.rawDatas.projectId=row.id
this.rawDatas.projectName=row.name
this.rawDatas.name=this.rawDatas.projectName+'-测试计划-V1.0'
},
sizeAutoChange(){
}
},//end method
mounted() {
this.$nextTick(() => {
initDicts(this);
this.initData()
this.maxTableHeight = util.calcTableMaxHeight(this.$refs.table.$el)
});
}
}
</script>
<style lang="scss" scoped>
@import url('../index/overview.scss');
</style>

266
src/views/xm/rpt/project/projectRptOverview.vue

@ -0,0 +1,266 @@
<template>
<section class="padding">
<el-row :class="{'row-box':true,'cfg':isRptCfg}">
<div class="rpt-title">{{ rawDatas.name }}</div>
<el-input class="input" v-model="rawDatas.name" placeholder="计划名称"/>
</el-row>
<el-row :class="{'row-box':true,'cfg':isRptCfg}">
<div class="title">{{ title?title:'报告概览' }}</div>
<el-input class="input" v-model="title" placeholder="报告概览"/>
</el-row>
<el-row ref="table">
<el-row class="box">
<el-col :span="6" class="box-red">
<div class="box-info">
<div class="num">{{rawDatas.totalCases?rawDatas.totalCases:'0'}}</div>
<div class="label">用例数</div>
</div>
</el-col>
<el-col :span="6" class="box-blue">
<div class="box-info">
<div class="num">{{caseFuGaiLv}}%</div>
<div class="label">用例覆盖率</div>
</div>
</el-col>
<el-col :span="6" class="box-green">
<div class="box-info">
<div class="num">{{caseTongGuoLv}}%</div>
<div class="label">用例通过率</div>
</div>
</el-col>
<el-col :span="6" class="box-orange">
<div class="box-info">
<div class="num">{{rawDatas.bugCnt?rawDatas.bugCnt:0}}</div>
<div class="label">缺陷数</div>
</div>
</el-col>
</el-row>
<!--编辑界面 XmTestPlan 测试计划-->
<el-form :model="rawDatas" label-width="120px" :rules="rawDatasRules" ref="rawDatasRef" label-position="left">
<el-row class="padding">
<el-col :span="8">
<mdp-select-user-xm label="负责人" userid-key="cuserid" username-key="cusername" v-model="rawDatas"></mdp-select-user-xm>
</el-col>
<el-col :span="8">
<mdp-select-dict-x label="状态" :dict="dicts['testPlanStatus']" v-model="rawDatas.status"></mdp-select-dict-x>
</el-col>
<el-col :span="8">
<mdp-select-dict-x label="测试结果" :dict="dicts['testPlanTcode']" v-model="rawDatas.tcode"></mdp-select-dict-x>
</el-col>
</el-row>
<el-form-item label="归属测试库" prop="casedbName">
{{rawDatas.casedbName}}
</el-form-item>
<el-form-item label="归属项目" prop="projectId">
<span v-if="opType=='add'">
<xm-project-select v-if="!selProject || !selProject.id" ref="xmProjectSelect" :link-product-id="xmTestCasedb? xmTestCasedb.productId:null" @row-click="onPorjectConfirm" :auto-select="false">
<span slot="title">选择项目</span>
</xm-project-select>
<div v-else>{{rawDatas.projectName}}</div>
</span>
<div v-else>{{rawDatas.projectName}}</div>
</el-form-item>
<el-form-item label="归属产品" prop="productName">
{{rawDatas.productName}}
</el-form-item>
<el-form-item label="起止时间" prop="stime">
<mdp-date-range :auto-default="false" placeholder="选择日期" v-model="rawDatas" start-key="stime" end-key="etime" value-format="yyyy-MM-dd HH:mm:ss" format="yyyy-MM-dd" ></mdp-date-range>
</el-form-item>
</el-form>
</el-row>
<el-row class="padding-bottom">
<span>报告总结</span>
</el-row>
<el-row>
<el-input type="textarea" :rows="8" v-model="rawDatas.summaryRemark"></el-input>
</el-row>
<el-row v-if="rawDatas.summaryRemark!==rawDatasBak.summaryRemark" >
<span style="float:right;">
<el-button type="primary" @click.native="editSomeFields(rawDatas,'summaryRemark',rawDatas.summaryRemark)">提交</el-button>
</span>
</el-row>
</section>
</template>
<script>
import util from '@/common/js/util';//
import config from "@/common/config"; //import
import { initDicts, addXmTestPlan,editXmTestPlan,editSomeFieldsXmTestPlan } from '@/api/xm/core/xmTestPlan';
import { mapGetters } from 'vuex'
import XmProjectSelect from '@/views/xm/core/components/XmProjectSelect';
import MdpSelectUserXm from '@/views/xm/core/components/MdpSelectUserXm';//
export default {
name:'xmTestPlanEdit',
components: {
XmProjectSelect,MdpSelectUserXm,
},
computed: {
...mapGetters([ 'userInfo' ]),
caseFuGaiLv(){
if(!this.rawDatas.totalCases){
return 0
}
var okCases=parseInt(this.rawDatas.okCases>0?this.rawDatas.okCases:0)
var errCases=parseInt(this.rawDatas.errCases>0?this.rawDatas.errCases:0)
var igCases=parseInt(this.rawDatas.igCases>0?this.rawDatas.igCases:0)
var blCases=parseInt(this.rawDatas.blCases>0?this.rawDatas.blCases:0)
var totalExecs=okCases+errCases+igCases+blCases
var rate=parseInt(totalExecs/this.rawDatas.totalCases*100)
return rate;
},
caseTongGuoLv(){
if(!this.rawDatas.totalCases){
return 0
}
var okCases=parseInt(this.rawDatas.okCases>0?this.rawDatas.okCases:0)
var errCases=parseInt(this.rawDatas.errCases>0?this.rawDatas.errCases:0)
var igCases=parseInt(this.rawDatas.igCases>0?this.rawDatas.igCases:0)
var blCases=parseInt(this.rawDatas.blCases>0?this.rawDatas.blCases:0)
var totalExecs=okCases+igCases
var rate=parseInt(totalExecs/this.rawDatas.totalCases*100)
return rate;
}
},
props:['xmTestPlan','visible','opType','selProject','xmTestCasedb','rptDatas','isRptCfg'],
watch: {
'xmTestPlan':function( xmTestPlan ) {
if(xmTestPlan){
this.rawDatas = {...xmTestPlan};
}
},
'visible':function(visible) {
if(visible==true){
this.initData()
}
}
},
data() {
return {
title:'',
remark:'',
currOpType:'add',//add/edit
load:{ list: false, edit: false, del: false, add: false },//...
dicts:{
testPlanStatus:[],
testPlanTcode:[],
},// params={categoryId:'all',itemCodes:['sex']} {sex: [{id:'1',name:''},{id:'2',name:''}]}
rawDatasRules: {
},
rawDatas: {
id:'',name:'',casedbId:'',casedbName:'',projectId:'',projectName:'',cuserid:'',cusername:'',ctime:'',stime:'',etime:'',status:'',tcode:'',totalCases:'',okCases:'',errCases:'',igCases:'',blCases:'',productId:'',productName:'',flowState:'',summaryRemark:''
},
rawDatasBak: {
id:'',name:'',casedbId:'',casedbName:'',projectId:'',projectName:'',cuserid:'',cusername:'',ctime:'',stime:'',etime:'',status:'',tcode:'',totalCases:'',okCases:'',errCases:'',igCases:'',blCases:'',productId:'',productName:'',flowState:'',summaryRemark:''
},
maxTableHeight:300,
summaryRemarkEditVisible:false,
}//end return
},//end data
methods: {
...util,
// @cancel="rawDatasVisible=false"
handleCancel:function(){
this.$refs['rawDatasRef'].resetFields();
this.$emit('cancel');
},
//XmTestPlan @submit="afterEditSubmit"
saveSubmit: function () {
this.$refs.rawDatasRef.validate((valid) => {
if (valid) {
this.$confirm('确认提交吗?', '提示', {}).then(() => {
this.load.edit=true
let params = Object.assign({}, this.rawDatas);
var func=addXmTestPlan
if(this.currOpType=='edit'){
func=editXmTestPlan
}
func(params).then((res) => {
this.load.edit=false
var tips=res.data.tips;
if(tips.isOk){
this.rawDatas=res.data.data
this.initData()
this.currOpType="edit";
this.$emit('submit');// @submit="afterAddSubmit"
}
this.$notify({ position:'bottom-left',showClose:true, message: tips.msg, type: tips.isOk?'success':'error' });
}).catch( err =>this.load.edit=false);
});
}else{
this.$notify({ showClose:true, message: "表单验证不通过,请修改表单数据再提交", type: 'error' });
}
});
},
initData: function(){
if(this.xmTestPlan){
this.rawDatas = Object.assign({},this.xmTestPlan);
}
if(this.rptDatas){
this.rawDatas=Object.assign({},this.rptDatas)
}
this.rawDatasBak={...this.rawDatas}
},
editSomeFields(row,fieldName,$event){
if(this.opType=='add'){
return;
}
let params={};
params['ids']=[row].map(i=>i.id)
if(fieldName=='stime'){
params[fieldName]=$event.stime
params.etime=$event.etime
}else if(fieldName=='cuserid'){
params[fieldName]=$event[0].userid
params.cusername=$event[0].username
}else{
params[fieldName]=$event
}
var func = editSomeFieldsXmTestPlan
func(params).then(res=>{
let tips = res.data.tips;
if(tips.isOk){
this.rawDatasBak=[...this.rawDatas]
this.$emit('edit-fields',params)
}else{
Object.assign(this.rawDatas,this.rawDatasBak)
this.$notify({position:'bottom-left',showClose:true,message:tips.msg,type:tips.isOk?'success':'error'})
}
}).catch((e)=>Object.assign(this.rawDatas,this.rawDatasBak))
},
onPorjectConfirm(row){
this.rawDatas.projectId=row.id
this.rawDatas.projectName=row.name
this.rawDatas.name=this.rawDatas.projectName+'-测试计划-V1.0'
},
sizeAutoChange(){
}
},//end method
mounted() {
this.$nextTick(() => {
initDicts(this);
this.initData()
this.maxTableHeight = util.calcTableMaxHeight(this.$refs.table.$el)
});
}
}
</script>
<style lang="scss" scoped>
@import url('../index/overview.scss');
</style>

266
src/views/xm/rpt/testCase/testCasedbRptOverview.vue

@ -0,0 +1,266 @@
<template>
<section class="padding">
<el-row :class="{'row-box':true,'cfg':isRptCfg}">
<div class="rpt-title">{{ rawDatas.name }}</div>
<el-input class="input" v-model="rawDatas.name" placeholder="计划名称"/>
</el-row>
<el-row :class="{'row-box':true,'cfg':isRptCfg}">
<div class="title">{{ title?title:'报告概览' }}</div>
<el-input class="input" v-model="title" placeholder="报告概览"/>
</el-row>
<el-row ref="table">
<el-row class="box">
<el-col :span="6" class="box-red">
<div class="box-info">
<div class="num">{{rawDatas.totalCases?rawDatas.totalCases:'0'}}</div>
<div class="label">用例数</div>
</div>
</el-col>
<el-col :span="6" class="box-blue">
<div class="box-info">
<div class="num">{{caseFuGaiLv}}%</div>
<div class="label">用例覆盖率</div>
</div>
</el-col>
<el-col :span="6" class="box-green">
<div class="box-info">
<div class="num">{{caseTongGuoLv}}%</div>
<div class="label">用例通过率</div>
</div>
</el-col>
<el-col :span="6" class="box-orange">
<div class="box-info">
<div class="num">{{rawDatas.bugCnt?rawDatas.bugCnt:0}}</div>
<div class="label">缺陷数</div>
</div>
</el-col>
</el-row>
<!--编辑界面 XmTestPlan 测试计划-->
<el-form :model="rawDatas" label-width="120px" :rules="rawDatasRules" ref="rawDatasRef" label-position="left">
<el-row class="padding">
<el-col :span="8">
<mdp-select-user-xm label="负责人" userid-key="cuserid" username-key="cusername" v-model="rawDatas"></mdp-select-user-xm>
</el-col>
<el-col :span="8">
<mdp-select-dict-x label="状态" :dict="dicts['testPlanStatus']" v-model="rawDatas.status"></mdp-select-dict-x>
</el-col>
<el-col :span="8">
<mdp-select-dict-x label="测试结果" :dict="dicts['testPlanTcode']" v-model="rawDatas.tcode"></mdp-select-dict-x>
</el-col>
</el-row>
<el-form-item label="归属测试库" prop="casedbName">
{{rawDatas.casedbName}}
</el-form-item>
<el-form-item label="归属项目" prop="projectId">
<span v-if="opType=='add'">
<xm-project-select v-if="!selProject || !selProject.id" ref="xmProjectSelect" :link-product-id="xmTestCasedb? xmTestCasedb.productId:null" @row-click="onPorjectConfirm" :auto-select="false">
<span slot="title">选择项目</span>
</xm-project-select>
<div v-else>{{rawDatas.projectName}}</div>
</span>
<div v-else>{{rawDatas.projectName}}</div>
</el-form-item>
<el-form-item label="归属产品" prop="productName">
{{rawDatas.productName}}
</el-form-item>
<el-form-item label="起止时间" prop="stime">
<mdp-date-range :auto-default="false" placeholder="选择日期" v-model="rawDatas" start-key="stime" end-key="etime" value-format="yyyy-MM-dd HH:mm:ss" format="yyyy-MM-dd" ></mdp-date-range>
</el-form-item>
</el-form>
</el-row>
<el-row class="padding-bottom">
<span>报告总结</span>
</el-row>
<el-row>
<el-input type="textarea" :rows="8" v-model="rawDatas.summaryRemark"></el-input>
</el-row>
<el-row v-if="rawDatas.summaryRemark!==rawDatasBak.summaryRemark" >
<span style="float:right;">
<el-button type="primary" @click.native="editSomeFields(rawDatas,'summaryRemark',rawDatas.summaryRemark)">提交</el-button>
</span>
</el-row>
</section>
</template>
<script>
import util from '@/common/js/util';//
import config from "@/common/config"; //import
import { initDicts, addXmTestPlan,editXmTestPlan,editSomeFieldsXmTestPlan } from '@/api/xm/core/xmTestPlan';
import { mapGetters } from 'vuex'
import XmProjectSelect from '@/views/xm/core/components/XmProjectSelect';
import MdpSelectUserXm from '@/views/xm/core/components/MdpSelectUserXm';//
export default {
name:'xmTestPlanEdit',
components: {
XmProjectSelect,MdpSelectUserXm,
},
computed: {
...mapGetters([ 'userInfo' ]),
caseFuGaiLv(){
if(!this.rawDatas.totalCases){
return 0
}
var okCases=parseInt(this.rawDatas.okCases>0?this.rawDatas.okCases:0)
var errCases=parseInt(this.rawDatas.errCases>0?this.rawDatas.errCases:0)
var igCases=parseInt(this.rawDatas.igCases>0?this.rawDatas.igCases:0)
var blCases=parseInt(this.rawDatas.blCases>0?this.rawDatas.blCases:0)
var totalExecs=okCases+errCases+igCases+blCases
var rate=parseInt(totalExecs/this.rawDatas.totalCases*100)
return rate;
},
caseTongGuoLv(){
if(!this.rawDatas.totalCases){
return 0
}
var okCases=parseInt(this.rawDatas.okCases>0?this.rawDatas.okCases:0)
var errCases=parseInt(this.rawDatas.errCases>0?this.rawDatas.errCases:0)
var igCases=parseInt(this.rawDatas.igCases>0?this.rawDatas.igCases:0)
var blCases=parseInt(this.rawDatas.blCases>0?this.rawDatas.blCases:0)
var totalExecs=okCases+igCases
var rate=parseInt(totalExecs/this.rawDatas.totalCases*100)
return rate;
}
},
props:['xmTestPlan','visible','opType','selProject','xmTestCasedb','rptDatas','isRptCfg'],
watch: {
'xmTestPlan':function( xmTestPlan ) {
if(xmTestPlan){
this.rawDatas = {...xmTestPlan};
}
},
'visible':function(visible) {
if(visible==true){
this.initData()
}
}
},
data() {
return {
title:'',
remark:'',
currOpType:'add',//add/edit
load:{ list: false, edit: false, del: false, add: false },//...
dicts:{
testPlanStatus:[],
testPlanTcode:[],
},// params={categoryId:'all',itemCodes:['sex']} {sex: [{id:'1',name:''},{id:'2',name:''}]}
rawDatasRules: {
},
rawDatas: {
id:'',name:'',casedbId:'',casedbName:'',projectId:'',projectName:'',cuserid:'',cusername:'',ctime:'',stime:'',etime:'',status:'',tcode:'',totalCases:'',okCases:'',errCases:'',igCases:'',blCases:'',productId:'',productName:'',flowState:'',summaryRemark:''
},
rawDatasBak: {
id:'',name:'',casedbId:'',casedbName:'',projectId:'',projectName:'',cuserid:'',cusername:'',ctime:'',stime:'',etime:'',status:'',tcode:'',totalCases:'',okCases:'',errCases:'',igCases:'',blCases:'',productId:'',productName:'',flowState:'',summaryRemark:''
},
maxTableHeight:300,
summaryRemarkEditVisible:false,
}//end return
},//end data
methods: {
...util,
// @cancel="rawDatasVisible=false"
handleCancel:function(){
this.$refs['rawDatasRef'].resetFields();
this.$emit('cancel');
},
//XmTestPlan @submit="afterEditSubmit"
saveSubmit: function () {
this.$refs.rawDatasRef.validate((valid) => {
if (valid) {
this.$confirm('确认提交吗?', '提示', {}).then(() => {
this.load.edit=true
let params = Object.assign({}, this.rawDatas);
var func=addXmTestPlan
if(this.currOpType=='edit'){
func=editXmTestPlan
}
func(params).then((res) => {
this.load.edit=false
var tips=res.data.tips;
if(tips.isOk){
this.rawDatas=res.data.data
this.initData()
this.currOpType="edit";
this.$emit('submit');// @submit="afterAddSubmit"
}
this.$notify({ position:'bottom-left',showClose:true, message: tips.msg, type: tips.isOk?'success':'error' });
}).catch( err =>this.load.edit=false);
});
}else{
this.$notify({ showClose:true, message: "表单验证不通过,请修改表单数据再提交", type: 'error' });
}
});
},
initData: function(){
if(this.xmTestPlan){
this.rawDatas = Object.assign({},this.xmTestPlan);
}
if(this.rptDatas){
this.rawDatas=Object.assign({},this.rptDatas)
}
this.rawDatasBak={...this.rawDatas}
},
editSomeFields(row,fieldName,$event){
if(this.opType=='add'){
return;
}
let params={};
params['ids']=[row].map(i=>i.id)
if(fieldName=='stime'){
params[fieldName]=$event.stime
params.etime=$event.etime
}else if(fieldName=='cuserid'){
params[fieldName]=$event[0].userid
params.cusername=$event[0].username
}else{
params[fieldName]=$event
}
var func = editSomeFieldsXmTestPlan
func(params).then(res=>{
let tips = res.data.tips;
if(tips.isOk){
this.rawDatasBak=[...this.rawDatas]
this.$emit('edit-fields',params)
}else{
Object.assign(this.rawDatas,this.rawDatasBak)
this.$notify({position:'bottom-left',showClose:true,message:tips.msg,type:tips.isOk?'success':'error'})
}
}).catch((e)=>Object.assign(this.rawDatas,this.rawDatasBak))
},
onPorjectConfirm(row){
this.rawDatas.projectId=row.id
this.rawDatas.projectName=row.name
this.rawDatas.name=this.rawDatas.projectName+'-测试计划-V1.0'
},
sizeAutoChange(){
}
},//end method
mounted() {
this.$nextTick(() => {
initDicts(this);
this.initData()
this.maxTableHeight = util.calcTableMaxHeight(this.$refs.table.$el)
});
}
}
</script>
<style lang="scss" scoped>
@import url('../index/overview.scss');
</style>

145
src/views/xm/rpt/testPlan/testPlanRptOverview.vue

@ -262,148 +262,5 @@ import MdpSelectUserXm from '@/views/xm/core/components/MdpSelectUserXm';//修
</script>
<style lang="scss" scoped>
.box{
.box-red{
background-color: #ff75750d;
height: 100px;
border-left-width: 2px;
border-left-color: red;
border-left-style: solid;
align-items: center;
line-height: 100px;
text-align: center;
display:flex;
flex-direction: column;
.box-info{
display:flex;
flex-direction: column;
margin-top: 20px;
height: 100px;
line-height: 100px;
.label{
color: #999;
height: 30px;
line-height: 30px;
font-size: 0.875rem;
}
.num{
height: 30px;
line-height: 30px;
color:red ;
font-size: 30px;
}
}
}
.box-green{
background-color: #73d8970d;;
height: 100px;
border-left-width: 2px;
border-left-color: green;
border-left-style: solid;
align-items: center;
line-height: 100px;
text-align: center;
display:flex;
flex-direction: column;
.box-info{
display:flex;
flex-direction: column;
margin-top: 20px;
height: 100px;
line-height: 100px;
.label{
color: #999;
height: 30px;
line-height: 30px;
font-size: 0.875rem;
}
.num{
height: 30px;
line-height: 30px;
color:green ;
font-size: 30px;
}
}
}
.box-blue{
background-color: #5dcfff0d;
height: 100px;
border-left-width: 2px;
border-left-color: blue;
border-left-style: solid;
align-items: center;
line-height: 100px;
text-align: center;
display:flex;
flex-direction: column;
.box-info{
display:flex;
flex-direction: column;
margin-top: 20px;
height: 100px;
line-height: 100px;
.label{
color: #999;
height: 30px;
line-height: 30px;
font-size: 0.875rem;
}
.num{
height: 30px;
line-height: 30px;
color:blue ;
font-size: 30px;
}
}
}
.box-orange{
background-color: #ffcd5d0d;
height: 100px;
border-left-width: 2px;
border-left-color: orange;
border-left-style: solid;
align-items: center;
line-height: 100px;
text-align: center;
display:flex;
flex-direction: column;
.box-info{
display:flex;
flex-direction: column;
margin-top: 20px;
height: 100px;
line-height: 100px;
.label{
color: #999;
height: 30px;
line-height: 30px;
font-size: 0.875rem;
}
.num{
height: 30px;
line-height: 30px;
color:orange ;
font-size: 30px;
}
}
}
box-font{
font-size: 0.875rem;
}
}
@import url('../index/overview.scss');
</style>
Loading…
Cancel
Save