Browse Source

优化

master
陈裕财 3 years ago
parent
commit
61276f538a
  1. 1
      src/router/routes_xm.js
  2. 2
      src/views/xm/core/xmFunc/XmFuncSelect.vue
  3. 83
      src/views/xm/core/xmQuestion/XmQuestionEdit.vue
  4. 3
      src/views/xm/core/xmTestPlanCase/XmTestPlanCaseMng.vue
  5. 251
      src/views/xm/core/xmTestPlanCase/XmTestPlanCaseSelect.vue

1
src/router/routes_xm.js

@ -555,6 +555,7 @@ export default {
title: '测试管理',
icon: 'bug'
},
hidden:true,
// leaf: true,//只有一个节点
children: [

2
src/views/xm/core/xmFunc/XmFuncSelect.vue

@ -27,7 +27,7 @@
</template>
</el-table-column>
</el-table>
<el-pagination layout="total, sizes, prev, pager, next" @current-change="handleCurrentChange" @size-change="handleSizeChange" :page-sizes="[10,20, 50, 100, 500]" :current-page="pageInfo.pageNum" :page-size="pageInfo.pageSize" :total="pageInfo.total" style="float:right;"></el-pagination>
<el-pagination layout="total,prev, next" @current-change="handleCurrentChange" @size-change="handleSizeChange" :page-sizes="[10,20, 50, 100, 500]" :current-page="pageInfo.pageNum" :page-size="pageInfo.pageSize" :total="pageInfo.total" style="float:right;"></el-pagination>
</el-row>
<el-row>
<!--编辑 XmFunc 功能模块表界面-->

83
src/views/xm/core/xmQuestion/XmQuestionEdit.vue

@ -9,20 +9,25 @@
{{editForm.projectId}}
</el-form-item>
<el-form-item label="归属产品" prop="productId">
{{editForm.productId}}
</el-form-item>
<el-form-item label="关联用例" prop="caseId">
<span>{{editForm.caseName?editForm.caseName:'无'}} <el-button type="text" @click="caseVisible=true">选择用例</el-button></span>
</el-form-item>
<el-form-item label="归属模块" prop="funcId">
<span>{{editForm.funcName?editForm.funcName:'无'}} <el-button type="text" @click="funcVisible=true">选择模块</el-button></span>
</el-form-item>
<el-form-item label="归属需求" prop="menuId">
<el-tag title="隶属需求" style="width:100%;" closable @click="showSelectMenu" @close.stop="handleCloseMenuTag">
<div class="icon" :style="{backgroundColor: 'rgb(79, 140, 255)' }">
<i :class=" 'el-icon-document' " ></i>
</div> {{editForm.menuName?editForm.menuName:"未关联需求"}}</el-tag>
<span v-if="editForm.productId">{{editForm.productId}}</span>
<span v-if="!xmProductCpd || !xmProductCpd.id">
<xm-product-select ref="xmProductSelect1" style="display:inline;" :auto-select="false" :link-project-id="selProject?selProject.id:null" @row-click="onProductSelected" @clear="onProductClearSelect" ></xm-product-select>
</span>
</el-form-item>
<span v-if="editForm.productId">
<el-form-item label="关联用例" prop="caseId">
<span>{{editForm.caseName?editForm.caseName:'无'}} <el-button type="text" @click="caseVisible=true">选择用例</el-button></span>
</el-form-item>
<el-form-item label="归属模块" prop="funcId">
<span>{{editForm.funcName?editForm.funcName:'无'}} <el-button type="text" @click="funcVisible=true">选择模块</el-button></span>
</el-form-item>
<el-form-item label="归属需求" prop="menuId">
<el-tag title="隶属需求" style="width:100%;" closable @click="showSelectMenu" @close.stop="handleCloseMenuTag">
<div class="icon" :style="{backgroundColor: 'rgb(79, 140, 255)' }">
<i :class=" 'el-icon-document' " ></i>
</div> {{editForm.menuName?editForm.menuName:"未关联需求"}}</el-tag>
</el-form-item>
</span>
</el-row>
<el-row class="padding border">
@ -182,7 +187,7 @@
</el-drawer>
<el-drawer append-to-body title="需求选择" :visible.sync="selectMenuVisible" size="60%" :close-on-click-modal="false">
<xm-menu-select :xm-product="xmProduct" :xm-iteration="xmIteration" :visible="selectMenuVisible" :is-select-menu="true" checkScope="3" @selected="onSelectedMenu" :sel-project="selProject"></xm-menu-select>
<xm-menu-select :xm-product="editForm.productId?{id:editForm.productId,productName:editForm.productName}:xmProductCpd" :xm-iteration="xmIteration" :visible="selectMenuVisible" :is-select-menu="true" checkScope="3" @selected="onSelectedMenu" :sel-project="selProject"></xm-menu-select>
</el-drawer>
</el-row>
<el-drawer append-to-body title="标签" :visible.sync="tagSelectVisible" class="dialog-body" size="60%">
@ -191,11 +196,11 @@
</el-drawer>
<el-dialog append-to-body title="模块选择" :visible.sync="funcVisible" width="60%" top="20px" :close-on-click-modal="false">
<xm-func-select @row-click="onFuncSelected" :xm-product="{id:editForm.productId}"></xm-func-select>
<xm-func-select @row-click="onFuncSelected" :xm-product="editForm.productId?{id:editForm.productId,productName:editForm.productName}:xmProductCpd"></xm-func-select>
</el-dialog>
<el-dialog append-to-body title="执行用例选择" :visible.sync="caseVisible" width="80%" top="20px" :close-on-click-modal="false">
<xm-test-plan-case-mng :select="true" :visible="caseVisible" :xm-test-plan="xmTestPlan" :xm-product="editForm.productId?{id:editForm.productId,productName:editForm.productName}:null" @select="onTestPlanCaseSelected" ></xm-test-plan-case-mng>
<xm-test-plan-case-mng :select="true" :visible="caseVisible" :xm-test-plan="xmTestPlan" :xm-product="editForm.productId?{id:editForm.productId,productName:editForm.productName}:xmProductCpd" @select="onTestPlanCaseSelected" ></xm-test-plan-case-mng>
</el-dialog>
</section>
</template>
@ -222,6 +227,7 @@
import MdpSelectUserXm from '@/views/xm/core/components/MdpSelectUserXm/index'
import TestStepConfig from '../xmTestCase/TestStepConfig.vue';
import TestStepResult from '../xmTestPlanCase/TestStepResult.vue';
import XmProductSelect from '@/views/xm/core/components/XmProductSelect'
export default {
computed: {
...mapGetters([
@ -242,7 +248,32 @@
return 0;
}
}
},
xmProductCpd(){
if(this.xmQuestion && this.xmQuestion.id && this.xmQuestion.productId){
return {id:this.xmQuestion.productId,productName:this.xmQuestion.productName}
}
if(this.xmProduct&& this.xmProduct.id){
return this.xmProduct
}
if(this.xmTestPlan && this.xmTestPlan.id){
return {id:this.xmTestPlan.productId,productName:this.xmTestPlan.productName}
}
if(this.xmTestPlanCase && this.xmTestPlanCase.id && this.xmTestPlanCase.productId){
return {id:this.xmTestPlanCase.productId,productName:this.xmTestPlanCase.productName}
}
if(this.xmTestCase && this.xmTestCase.id){
return {id:this.xmTestCase.productId,productName:this.xmTestCase.productName}
}
if(this.xmMenu && this.xmMenu.menuId){
return {id:this.xmMenu.productId,productName:this.xmMenu.productName}
}
if(this.xmIteration && this.xmIteration.id){
return {id:this.xmIteration.productId,productName:this.xmIteration.productName}
}
return null
}
},
props:['xmQuestion','visible',"selProject",'opType','xmProduct','xmTestCase','xmTestPlanCase','xmMenu','xmIteration','xmTestPlan'],
watch: {
@ -626,12 +657,12 @@
this.editForm.menuId=this.xmMenu.menuId
this.editForm.menuName=this.xmMenu.menuName
if(this.xmMenu.productId){
this.editForm.productId=this.xmMenu.id
this.editForm.productId=this.xmMenu.productId
this.editForm.productName=this.xmMenu.productName
}
if(this.xmMenu.funcId){
this.editForm.funcId=this.xmTestPlanCase.funcId
this.editForm.funcName=this.xmTestPlanCase.funcName
this.editForm.funcId=this.xmMenu.funcId
this.editForm.funcName=this.xmMenu.funcName
}
}
}else{
@ -657,13 +688,21 @@
Object.assign(this.editForm,params)
this.editXmQuestionSomeFields(this.editForm,"caseId",params)
this.caseVisible=false;
},
onProductSelected(product){
this.editForm.productId=product.id
this.editForm.productName=product.productName
},
onProductClearSelect(){
this.editForm.productId=""
this.editForm.productName=""
}
},//end method
components: {
// 'xm-question-edit':XmQuestionEdit
'upload': AttachmentUpload,XmGroupMng,VueEditor,XmTaskList,xmMenuSelect,XmQuestionHandleMng,TagMng,XmProjectSelect,
'upload': AttachmentUpload,XmGroupMng,VueEditor,XmTaskList,xmMenuSelect,XmQuestionHandleMng,TagMng,XmProjectSelect,XmProductSelect,
XmMyDoFocus,XmFuncSelect,MdpSelectUserXm,TestStepConfig,TestStepResult,
xmTestPlanCaseMng:()=>import('../xmTestPlanCase/XmTestPlanCaseMng'),
xmTestPlanCaseMng:()=>import('../xmTestPlanCase/XmTestPlanCaseSelect'),
'xm-workload-record':()=>import("../xmWorkload/XmWorkloadRecord"),
},
mounted() {

3
src/views/xm/core/xmTestPlanCase/XmTestPlanCaseMng.vue

@ -228,6 +228,9 @@ export default {
if(this.filters.xmFunc && this.filters.xmFunc.id){
params.funcPidPathsLike=this.filters.xmFunc.pidPaths
}
if(this.xmProductCpd && this.xmProductCpd.id){
params.productId=this.xmProductCpd.id
}
this.load.list = true;
listXmTestPlanCase(params).then((res) => {

251
src/views/xm/core/xmTestPlanCase/XmTestPlanCaseSelect.vue

@ -0,0 +1,251 @@
<template>
<section>
<el-row>
<el-col :span="6" v-if="!xmTestCase||!xmTestCase.id">
<xm-func-select class="padding-right padding-left" :xm-product="xmProductCpd" @row-click="onXmFuncRowClick">
</xm-func-select>
</el-col>
<el-col :span="(xmTestCase&&xmTestCase.id)?24:18">
<el-row>
<el-input v-model="filters.key" style="width:40%;" placeholder="模糊查询" clearable></el-input>
<el-button v-loading="load.list" :disabled="load.list==true" @click="searchXmTestPlanCases" icon="el-icon-search">查询</el-button>
</el-row>
<el-row>
<!--列表 XmTestPlanCase 测试计划与用例关系表-->
<el-table ref="xmTestPlanCaseTable" :data="xmTestPlanCases" :height="maxTableHeight" @sort-change="sortChange" highlight-current-row v-loading="load.list" border @selection-change="selsChange" @row-click="rowClick" style="width: 100%;">
<!--
<el-table-column sortable prop="username" width="55" show-overflow-tooltip fixed="left">
<span class="cell-text"> {{scope.row.username}}} </span>
<span class="cell-bar"><el-input style="display:inline;" v-model="scope.row.username" placeholder="" @change="editSomeFields(scope.row,'username',$event)" :maxlength="22"></el-input></span>
</el-table-column>
-->
<el-table-column prop="caseName" label="用例名称" min-width="350">
</el-table-column>
<el-table-column prop="caseStatus" label="用例状态" width="100" show-overflow-tooltip>
<template slot-scope="scope">
<mdp-select-dict-tag :dict="dicts['testCaseStatus']" v-model="scope.row.caseStatus" effect="dark" :disabled="true"></mdp-select-dict-tag>
</template>
</el-table-column>
<el-table-column prop="execStatus" label="执行结果" width="120" show-overflow-tooltip>
<template slot-scope="scope">
<mdp-select-dict-tag :dict="dicts['testStepTcode']" v-model="scope.row.execStatus" effect="dark" :disabled="true"></mdp-select-dict-tag>
</template>
</el-table-column>
<el-table-column prop="execUsername" label="执行人姓名" min-width="120" >
<template slot-scope="scope">
<mdp-select-user-xm userid-key="execUserid" username-key="execUsername" v-model="scope.row" :disabled="true">
</mdp-select-user-xm>
</template>
</el-table-column>
<el-table-column prop="priority" label="优先级" width="120" >
<template slot-scope="scope">
<mdp-select-dict-tag :dict="dicts['priority']" v-model="scope.row.priority" :disabled="true"></mdp-select-dict-tag>
</template>
</el-table-column>
<el-table-column label="操作" width="150">
<template slot-scope="scope">
<el-button type="primary" @click="$emit('select',scope.row)">选择</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination layout="total, sizes, prev, pager, next" @current-change="handleCurrentChange" @size-change="handleSizeChange" :page-sizes="[10,20, 50, 100, 500]" :current-page="pageInfo.pageNum" :page-size="pageInfo.pageSize" :total="pageInfo.total" style="float:right;"></el-pagination>
</el-row>
</el-col>
</el-row>
</section>
</template>
<script>
import util from '@/common/js/util';//
import config from '@/common/config';//
import { initDicts,listXmTestPlanCase, delXmTestPlanCase, batchDelXmTestPlanCase,editSomeFieldsXmTestPlanCase,importFromTestCase } from '@/api/xm/core/xmTestPlanCase';
import XmFuncSelect from '../xmFunc/XmFuncSelect';//
import MdpSelectUserXm from '@/views/xm/core/components/MdpSelectUserXm';//
import { mapGetters } from 'vuex'
export default {
name:'xmTestPlanCaseSelect',
components: {
XmFuncSelect,MdpSelectUserXm,
},
props:['visible','xmTestPlan','xmTestCasedb','xmTestCase','xmProduct','select'],
computed: {
...mapGetters(['userInfo']),
xmProductCpd(){
if(this.xmProduct&& this.xmProduct.id){
return this.xmProduct
}
if(this.xmTestCasedb && this.xmTestCasedb.id){
return {id:this.xmTestCasedb.productId,productName:this.xmTestCasedb.productName}
}
if(this.xmTestPlan && this.xmTestPlan.id){
return {id:this.xmTestPlan.productId,productName:this.xmTestPlan.productName}
}
if(this.xmTestCase && this.xmTestCase.id){
return {id:this.xmTestCase.productId,productName:this.xmTestCase.productName}
}
return null
}
},
watch:{
visible(val){
if(val==true){
this.initData();
this.searchXmTestPlanCases()
}
}
},
data() {
return {
filters: {
key: '',
xmFunc:null,
},
xmTestPlanCases: [],//
pageInfo:{//
total:0,//0>0
pageSize:10,//
count:false,//
pageNum:1,//1
orderFields:[],// ['sex','student_id']
orderDirs:[]// asc,desc ['asc','desc']
},
load:{ list: false, edit: false, del: false, add: false },//...
sels: [],//
dicts:{
testCaseStatus:[],
//sex: [{id:'1',name:''},{id:'2',name:''}]
},// params={categoryId:'all',itemCodes:['sex']} {sex: [{id:'1',name:''},{id:'2',name:''}]}
addFormVisible: false,//xmTestPlanCase
addForm: {
bugs:'',execUserid:'',caseId:'',ltime:'',ctime:'',execStatus:'',execUsername:'',planId:'',caseName:'',priority:'',remark:'',testStep:''
},
editFormVisible: false,//
editForm: {
bugs:'',execUserid:'',caseId:'',ltime:'',ctime:'',execStatus:'',execUsername:'',planId:'',caseName:'',priority:'',remark:'',testStep:''
},
maxTableHeight:300,
}
},//end data
methods: {
...util,
handleSizeChange(pageSize) {
this.pageInfo.pageSize=pageSize;
this.getXmTestPlanCases();
},
handleCurrentChange(pageNum) {
this.pageInfo.pageNum = pageNum;
this.getXmTestPlanCases();
},
// obj.order=ascending/descending, asc/desc ; obj.prop=,
sortChange( obj ){
if(obj.order==null){
this.pageInfo.orderFields=[];
this.pageInfo.orderDirs=[];
}else{
var dir='asc';
if(obj.order=='ascending'){
dir='asc'
}else{
dir='desc';
}
this.pageInfo.orderFields=[util.toLine(obj.prop)];
this.pageInfo.orderDirs=[dir];
}
this.getXmTestPlanCases();
},
searchXmTestPlanCases(){
this.pageInfo.count=true;
this.getXmTestPlanCases();
},
// XmTestPlanCase
getXmTestPlanCases() {
let params = {
pageSize: this.pageInfo.pageSize,
pageNum: this.pageInfo.pageNum,
total: this.pageInfo.total,
count:this.pageInfo.count
};
if(this.pageInfo.orderFields!=null && this.pageInfo.orderFields.length>0){
let orderBys=[];
for(var i=0;i<this.pageInfo.orderFields.length;i++){
orderBys.push(this.pageInfo.orderFields[i]+" "+this.pageInfo.orderDirs[i])
}
params.orderBy= orderBys.join(",")
}
if(this.filters.key){
params.key=this.filters.key
}
if(this.xmTestCasedb && this.xmTestCasedb.id){
params.casedbId=this.xmTestCasedb.id
}
if(this.xmTestCase && this.xmTestCase.id){
params.caseId=this.xmTestCase.id
}
if(this.xmTestPlan && this.xmTestPlan.id){
params.planId=this.xmTestPlan.id
}
if(this.filters.xmFunc && this.filters.xmFunc.id){
params.funcPidPathsLike=this.filters.xmFunc.pidPaths
}
if(this.xmProductCpd && this.xmProductCpd.id){
params.productId=this.xmProductCpd.id
}
this.load.list = true;
listXmTestPlanCase(params).then((res) => {
var tips=res.data.tips;
if(tips.isOk){
this.pageInfo.total = res.data.total;
this.pageInfo.count=false;
this.xmTestPlanCases = res.data.data;
}else{
this.$notify({ position:'bottom-left',showClose:true, message: tips.msg, type: 'error' });
}
this.load.list = false;
}).catch( err => this.load.list = false );
},
//xmTestPlanCase
selsChange: function (sels) {
this.sels = sels;
},
rowClick: function(row, event, column){
this.editForm=row
this.editFormBak={...row};
this.$emit('row-click',row, event, column);// @row-click="rowClick"
},
initData: function(){
},
onXmFuncRowClick(row){
this.filters.xmFunc=row
this.searchXmTestPlanCases();
},
},//end methods
mounted() {
this.$nextTick(() => {
initDicts(this);
this.initData()
this.searchXmTestPlanCases();
this.maxTableHeight = util.calcTableMaxHeight(this.$refs.xmTestPlanCaseTable.$el)
});
}
}
</script>
<style scoped>
</style>
Loading…
Cancel
Save