From ebe3dbeaab41c74bd14fa8a7c2655fcbb6277857 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E8=A3=95=E8=B4=A2?= Date: Thu, 30 Jun 2022 01:01:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=B5=8B=E8=AF=95=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1=E4=B8=8E=E6=89=A7=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/routes_xm.js | 2 +- src/views/xm/core/xmMenu/XmMenuEdit.vue | 10 +- .../xm/core/xmQuestion/XmQuestionAdd.vue | 25 ++-- .../xm/core/xmTestCase/XmTestCaseAdd.vue | 32 ++++- .../xm/core/xmTestCase/XmTestCaseEdit.vue | 4 +- .../xm/core/xmTestCase/XmTestCaseMng.vue | 109 +++++++++++++----- .../core/xmTestCaseExec/XmTestCaseExecMng.vue | 2 +- 7 files changed, 132 insertions(+), 52 deletions(-) diff --git a/src/router/routes_xm.js b/src/router/routes_xm.js index 9e85b89d..abe4e5db 100644 --- a/src/router/routes_xm.js +++ b/src/router/routes_xm.js @@ -54,7 +54,7 @@ export default { { path: 'xmQuestion/XmQuestionMng', component: _import('xm/core/xmQuestion/XmQuestionMng'), name: 'XmQuestionMng', meta: { title: '缺陷管理' }}, { path: 'xmQuestion/XmQuestionMngMy', component: _import('xm/core/xmQuestion/XmQuestionMngMy'), name: 'XmQuestionMngMy', meta: { title: '我的缺陷' }}, { path: 'xmTestCase/XmTestCaseMng', component: _import('xm/core/xmTestCase/XmTestCaseMng'), name: 'XmTestCaseMng', meta: { title: '测试设计' }}, - { path: 'xmTestCaseExec/XmTestCaseExecMng', component: _import('xm/core/xmTestCaseExec/XmTestCaseExecMng'), name: 'XmTestCaseExecMng', meta: { title: '测试执行' }}, + //{ path: 'xmTestCaseExec/XmTestCaseExecMng', component: _import('xm/core/xmTestCaseExec/XmTestCaseExecMng'), name: 'XmTestCaseExecMng', meta: { title: '测试执行' }}, { path: 'xmQuestion/XmQuestionDetailRoute', component: _import('xm/core/xmQuestion/XmQuestionDetailRoute'), name: 'XmQuestionDetailRoute', meta: { title: '缺陷明细' },hidden:true}, ] diff --git a/src/views/xm/core/xmMenu/XmMenuEdit.vue b/src/views/xm/core/xmMenu/XmMenuEdit.vue index 7d91039d..d8e43487 100644 --- a/src/views/xm/core/xmMenu/XmMenuEdit.vue +++ b/src/views/xm/core/xmMenu/XmMenuEdit.vue @@ -145,6 +145,10 @@  h + + + + 元 @@ -209,13 +213,14 @@ import {listXmMenuWithState,editXmMenu,editXmMenuSomeFields } from '@/api/xm/core/xmMenu'; import { mapGetters } from 'vuex' import UsersSelect from "@/views/mdp/sys/user/UsersSelect"; -import XmMenuOverview from './XmMenuOverview.vue'; -import XmMenuExchangeMng from '../xmMenuExchange/XmMenuExchangeMng.vue'; + import XmMenuOverview from './XmMenuOverview.vue'; + import XmMenuExchangeMng from '../xmMenuExchange/XmMenuExchangeMng.vue'; import TagMng from "@/views/mdp/arc/tag/TagMng"; import XmSubWorkItem from "@/views/xm/core/xmMenuWorkItem/XmSubWorkItem"; import XmRecord from '../xmRecord/XmRecord' import XmMyDoFocus from '@/views/myWork/my/components/DoFocus'; import ArchiveEdit from '@/views/xm/core/wiki/archive/WikiMenuEdit'; + import XmTestCaseMng from '@/views/xm/core/xmTestCase/XmTestCaseMng'; export default { computed: { @@ -523,6 +528,7 @@ import XmMenuExchangeMng from '../xmMenuExchange/XmMenuExchangeMng.vue'; XmRecord, XmMyDoFocus, ArchiveEdit, + XmTestCaseMng, }, mounted() { diff --git a/src/views/xm/core/xmQuestion/XmQuestionAdd.vue b/src/views/xm/core/xmQuestion/XmQuestionAdd.vue index ab2fec9a..3ce711e2 100644 --- a/src/views/xm/core/xmQuestion/XmQuestionAdd.vue +++ b/src/views/xm/core/xmQuestion/XmQuestionAdd.vue @@ -9,7 +9,7 @@ {{this.filters.selProject?this.filters.selProject.name:''}} - + @@ -182,7 +182,7 @@ } }, - props:['xmQuestion','visible',"selProject",'qtype','xmTestCaseExec','xmTestCase','xmProduct'], + props:['xmQuestion','visible',"selProject",'qtype','xmTestCase','xmTestCase','xmProduct'], watch: { 'xmQuestion':function( xmQuestion ) { this.addForm=Object.assign(this.addForm, this.xmQuestion); @@ -198,7 +198,7 @@ } this.addForm.id=sn() - this.initByExec(); + this.initByCase(); } }, @@ -450,18 +450,15 @@ this.addForm.projectId='' this.addForm.projectName='' }, - initByExec(){ - if(this.xmTestCaseExec){ - this.addForm.caseExecId=this.xmTestCaseExec.id - this.addForm.caseName=this.xmTestCaseExec.caseName - this.addForm.caseId=this.xmTestCaseExec.caseId + initByCase(){ + if(this.xmTestCase){ + this.addForm.caseName=this.xmTestCase.caseName + this.addForm.caseId=this.xmTestCase.id this.addForm.opStep=this.xmTestCase.testStep this.addForm.expectResult=this.xmTestCase.expectResult - this.addForm.menuId=this.xmTestCaseExec.menuId - this.addForm.menuName=this.xmTestCaseExec.menuName - this.addForm.taskId=this.xmTestCaseExec.taskId - this.addForm.taskName=this.xmTestCaseExec.taskName - this.addForm.name=this.xmTestCaseExec.caseName + this.addForm.menuId=this.xmTestCase.menuId + this.addForm.menuName=this.xmTestCase.menuName + this.addForm.name=this.xmTestCase.caseName } } @@ -482,7 +479,7 @@ } this.addForm.qtype=this.qtype this.setDefaultData(); - this.initByExec(); + this.initByCase(); initSimpleDicts('all',['bugSeverity','bugSolution','bugStatus','bugType','priority','bugRepRate']).then(res=>{ if(res.data.tips.isOk){ this.dicts['bugSeverity']=res.data.data.bugSeverity diff --git a/src/views/xm/core/xmTestCase/XmTestCaseAdd.vue b/src/views/xm/core/xmTestCase/XmTestCaseAdd.vue index bf22a063..bf79850f 100644 --- a/src/views/xm/core/xmTestCase/XmTestCaseAdd.vue +++ b/src/views/xm/core/xmTestCase/XmTestCaseAdd.vue @@ -16,13 +16,13 @@ - + - + @@ -34,7 +34,7 @@ - + @@ -56,7 +56,7 @@ 'userInfo','roles' ]) }, - props:['xmTestCase','visible'], + props:['xmTestCase','visible','xmProduct','xmMenu'], watch: { 'xmTestCase':function( xmTestCase ) { //this.addForm = xmTestCase; @@ -64,6 +64,18 @@ 'visible':function(visible) { if(visible==true){ //从新打开页面时某些数据需要重新加载,可以在这里添加 + if(this.xmProduct && this.xmProduct.id){ + this.addForm.productId=this.xmProduct.id + }else{ + this.addForm.productId='' + } + if(this.xmMenu && this.xmMenu.menuId){ + this.addForm.menuId=this.xmMenu.menuId + this.addForm.menuName=this.xmMenu.menuName + }else{ + this.addForm.menuId='' + this.addForm.menuName='' + } } } }, @@ -148,6 +160,18 @@ xmMenuSelect,VueEditor }, mounted() { + if(this.xmProduct && this.xmProduct.id){ + this.addForm.productId=this.xmProduct.id + }else{ + this.addForm.productId='' + } + if(this.xmMenu && this.xmMenu.menuId){ + this.addForm.menuId=this.xmMenu.menuId + this.addForm.menuName=this.xmMenu.menuName + }else{ + this.addForm.menuId='' + this.addForm.menuName='' + } //this.addForm=Object.assign(this.addForm, this.xmTestCase); /**在下面写其它函数***/ diff --git a/src/views/xm/core/xmTestCase/XmTestCaseEdit.vue b/src/views/xm/core/xmTestCase/XmTestCaseEdit.vue index 86c37cd9..64c16024 100644 --- a/src/views/xm/core/xmTestCase/XmTestCaseEdit.vue +++ b/src/views/xm/core/xmTestCase/XmTestCaseEdit.vue @@ -20,13 +20,13 @@ - + - + diff --git a/src/views/xm/core/xmTestCase/XmTestCaseMng.vue b/src/views/xm/core/xmTestCase/XmTestCaseMng.vue index bb3f029f..8fc82ada 100644 --- a/src/views/xm/core/xmTestCase/XmTestCaseMng.vue +++ b/src/views/xm/core/xmTestCase/XmTestCaseMng.vue @@ -3,9 +3,12 @@
- + + + 选择需求 {{filters.menus[0].menuName.substr(0,5)}}等({{filters.menus.length}})个 + - @@ -131,6 +142,9 @@ import XmProjectSelect from '@/views/xm/core/components/XmProjectSelect'; import XmGroupMng from '../xmGroup/XmGroupMng'; + import XmQuestionMng from '../xmQuestion/XmQuestionMng'; + import XmQuestionAdd from '../xmQuestion/XmQuestionAdd'; + import XmIterationSelect from '@/views/xm/core/components/XmIterationSelect.vue';//修改界面 export default { computed: { @@ -138,7 +152,25 @@ 'userInfo','roles' ]) }, - props:['multiSelect','selProject'], + props:['multiSelect','selProject','xmProduct','xmMenu'], + watch:{ + 'xmProduct.id':function(val){ + if(this.xmProduct && this.xmProduct.id){ + this.filters.product=this.xmProduct + }else{ + this.filters.product=null + } + this.searchXmTestCases(); + }, + 'xmMenu.menuId':function(val){ + + if(this.xmMenu && this.xmMenu.menuId){ + this.filters.menus=[this.xmMenu] + }else{ + this.filters.menus=[] + } + } + }, data() { const beginDate = new Date(); const endDate = new Date(); @@ -149,6 +181,7 @@ product:null, selProject:null, luser:null, + iteration:null, }, xmTestCases: [],//查询结果 pageInfo:{//分页数据 @@ -187,6 +220,8 @@ nextAction:'', dateRanger: [ ], pickerOptions: util.getPickerOptions('datarange'), + addBugVisible:false, + bugsVisible:false, /**end 自定义属性请在上面加 请加备注**/ } },//end data @@ -254,6 +289,9 @@ params.projectId=this.filters.selProject.id } + if(this.filters.iteration){ + params.iterationId=this.filters.iteration.id + } if(this.filters.key){ params.key='%'+this.filters.key+'%' } @@ -295,14 +333,7 @@ }, //删除xmTestCase handleDel: function (row,index) { - if( !this.roles.some(i=>i.roleid=='testAdmin') && !this.roles.some(i=>i.roleid=='tester') && !this.roles.some(i=>i.roleid=='testTeamAdmin') ){ - this.$notify({position:'bottom-left',showClose: true,message:"只有测试经理、测试组长、测试员可以操作",type:"error"}); - return ; - } - if(!this.roles.some(i=>i.roleid=='testAdmin')){ - this.$notify({position:'bottom-left',showClose:true,message: "只有测试管理员才能删除测试用例", type: 'error' }); - return; - } + this.$confirm('确认删除该记录吗?', '提示', { type: 'warning' }).then(() => { @@ -321,14 +352,7 @@ }, //批量删除xmTestCase batchDel: function () { - if( !this.roles.some(i=>i.roleid=='testAdmin') && !this.roles.some(i=>i.roleid=='tester') && !this.roles.some(i=>i.roleid=='testTeamAdmin') ){ - this.$notify({position:'bottom-left',showClose: true,message:"只有测试经理、测试组长、测试员可以操作",type:"error"}); - return ; - } - if(!this.roles.some(i=>i.roleid=='testAdmin')){ - this.$notify({position:'bottom-left',showClose:true,message: "只有测试管理员才能删除测试用例", type: 'error' }); - return; - } + this.$confirm('确认删除选中记录吗?', '提示', { type: 'warning' }).then(() => { @@ -429,19 +453,48 @@ setFiltersHandlerAsMySelf(){ this.filters.luser=this.userInfo; this.searchXmTestCases(); - } + }, + showBugs(row){ + this.editForm=row + this.bugsVisible=true; + }, + showAddBug(row){ + this.editForm=row + this.addBugVisible=true; + + }, + + onIterationSelected(iteration){ + this.filters.iteration=iteration + this.searchXmTestCases() + }, + + onIterationClear(){ + this.filters.iteration=null + this.searchXmTestCases() + }, /**end 自定义函数请在上面加**/ },//end methods components: { 'xm-test-case-add':XmTestCaseAdd, 'xm-test-case-edit':XmTestCaseEdit, - xmMenuSelect,XmProductSelect,XmProjectSelect,XmGroupMng + xmMenuSelect,XmProductSelect,XmProjectSelect,XmGroupMng,XmQuestionAdd, + XmQuestionMng,XmIterationSelect, //在下面添加其它组件 }, mounted() { this.$nextTick(() => { - this.filters.luser=this.userInfo; + if(this.xmProduct && this.xmProduct.id){ + this.filters.product=this.xmProduct + }else{ + this.filters.product=null + } + if(this.xmMenu && this.xmMenu.menuId){ + this.filters.menus=[this.xmMenu] + }else{ + this.filters.menus=[] + } this.getXmTestCases(); this.maxTableHeight = util.calcTableMaxHeight(this.$refs.table.$el); }); diff --git a/src/views/xm/core/xmTestCaseExec/XmTestCaseExecMng.vue b/src/views/xm/core/xmTestCaseExec/XmTestCaseExecMng.vue index b1eca560..b62357f2 100644 --- a/src/views/xm/core/xmTestCaseExec/XmTestCaseExecMng.vue +++ b/src/views/xm/core/xmTestCaseExec/XmTestCaseExecMng.vue @@ -740,7 +740,7 @@ mounted() { this.filters.selProject=this.selProject; - this.filters.execUser=this.userInfo; + //this.filters.execUser=this.userInfo; this.$nextTick(() => { this.maxTableHeight = util.calcTableMaxHeight(this.$refs.table.$el); this.getXmTestCaseExecs();