Browse Source

优化

master
陈裕财 4 years ago
parent
commit
2aa391d3fb
  1. 34
      src/views/xm/core/xmFunc/XmFuncEdit.vue
  2. 319
      src/views/xm/core/xmFunc/XmFuncSelect.vue
  3. 284
      src/views/xm/core/xmTestCase/XmTestCaseMng.vue
  4. 2
      src/views/xm/core/xmTestPlan/XmTestPlanMng.vue

34
src/views/xm/core/xmFunc/XmFuncEdit.vue

@ -5,27 +5,13 @@
<el-row class="page-main" :style="{overflowX:'auto',height:maxTableHeight+'px'}" ref="table">
<!--编辑界面 XmFunc 功能模块表-->
<el-form :model="editForm" label-width="120px" :rules="editFormRules" ref="editFormRef">
<el-form-item label="主键" prop="id">
<el-input v-model="editForm.id" placeholder="主键" :maxlength="50" @change="editSomeFields(editForm,'id',$event)"></el-input>
</el-form-item>
<el-form-item label="编号" prop="id">
<el-input v-model="editForm.id" :disabled="opType!='add'" placeholder="编号,留空则后台自动生成" :maxlength="50" @change="editSomeFields(editForm,'id',$event)"></el-input>
</el-form-item>
<el-form-item label="名称" prop="name">
<el-input v-model="editForm.name" placeholder="名称" :maxlength="255" @change="editSomeFields(editForm,'name',$event)"></el-input>
</el-form-item>
<el-form-item label="上级编号" prop="pid">
<el-input v-model="editForm.pid" placeholder="上级编号" :maxlength="50" @change="editSomeFields(editForm,'pid',$event)"></el-input>
</el-form-item>
<el-form-item label="上级名称" prop="pname">
<el-input v-model="editForm.pname" placeholder="上级名称" :maxlength="255" @change="editSomeFields(editForm,'pname',$event)"></el-input>
</el-form-item>
<el-form-item label="上级路径,直到自身,逗号分割,包含自身" prop="pidPaths">
<el-input v-model="editForm.pidPaths" placeholder="上级路径,直到自身,逗号分割,包含自身" :maxlength="255" @change="editSomeFields(editForm,'pidPaths',$event)"></el-input>
</el-form-item>
<el-form-item label="产品编号" prop="productId">
<el-input v-model="editForm.productId" placeholder="产品编号" :maxlength="50" @change="editSomeFields(editForm,'productId',$event)"></el-input>
</el-form-item>
<el-form-item label="菜单级别0-根,1,2,3,4,5依次类推" prop="lvl">
<el-input-number v-model="editForm.lvl" :min="0" :max="200"></el-input-number>
</el-form-item>
</el-form-item>
</el-form>
</el-row>
@ -51,7 +37,7 @@
...mapGetters([ 'userInfo' ]),
},
props:['xmFunc','visible','opType'],
props:['xmFunc','visible','opType','parentFunc'],
watch: {
'xmFunc':function( xmFunc ) {
@ -128,7 +114,13 @@
if(this.opType=='edit'){
}else{
if(this.parentFunc && this.parentFunc.id){
this.editForm.pid=this.parentFunc.id
this.editForm.pname=this.parentFunc.name
}else{
this.editForm.pid=null
this.editForm.pname=null
}
}
this.editFormBak={...this.editForm}
},

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

@ -0,0 +1,319 @@
<template>
<section>
<el-row>
<el-input v-model="filters.key" style="width: 60%;" placeholder="名称 按回车" @keyup.enter.native="searchXmFuncs" clearable></el-input>
<span style="float:right;">
<el-button type="primary" @click="showAdd" icon="el-icon-plus" plain> </el-button>
</span>
</el-row>
<el-row>
<!--列表 XmFunc 功能模块表-->
<el-table ref="xmFuncTable" element-loading-text="努力加载中" element-loading-spinner="el-icon-loading" :data="xmFuncsTreeData" :height="maxTableHeight" @sort-change="sortChange" highlight-current-row v-loading="load.list" border @selection-change="selsChange" @row-click="rowClick" style="width: 100%;" current-row-key="id" row-key="id" :tree-props="{children: 'children'}" >
<el-table-column prop="name" label="模块" min-width="150" >
<template slot="header"> 模块 &nbsp;<slot name="title-bar"></slot><el-button type="text" @click="unselectRow()">清除选中的行</el-button></template>
<template slot-scope="scope">
<span> {{scope.row.name}} </span>
<div class="tool-bar">
<span class="u-btn">
<el-button @click.stop="showSubAdd( scope.row,scope.$index)" icon="el-icon-plus" title="新建子功能模块" circle plain size="mini"> </el-button>
<el-button @click.stop="showEdit( scope.row,scope.$index)" icon="el-icon-edit" title="编辑" circle plain size="mini"> </el-button>
<el-button type="danger" v-loading="load.del" @click="handleDel(scope.row)" :disabled=" !editForm || !editForm.id || load.del==true" icon="el-icon-delete" circle plain size="mini"></el-button>
</span>
</div>
</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-row>
<!--编辑 XmFunc 功能模块表界面-->
<el-drawer title="编辑功能模块表" :visible.sync="editFormVisible" size="60%" append-to-body :close-on-click-modal="false">
<xm-func-edit op-type="edit" :xm-func="editForm" :visible="editFormVisible" @cancel="editFormVisible=false" @submit="afterEditSubmit"></xm-func-edit>
</el-drawer>
<!--新增 XmFunc 功能模块表界面-->
<el-drawer title="新增功能模块表" :visible.sync="addFormVisible" size="60%" append-to-body :close-on-click-modal="false">
<xm-func-edit op-type="add" :xm-func="addForm" :parent-func="parentFunc" :visible="addFormVisible" @cancel="addFormVisible=false" @submit="afterAddSubmit"></xm-func-edit>
</el-drawer>
</el-row>
</section>
</template>
<script>
import util from '@/common/js/util';//
import treeTool from '@/common/js/treeTool';//
import config from '@/common/config';//
import { initDicts,listXmFunc, delXmFunc, batchDelXmFunc,editSomeFieldsXmFunc } from '@/api/xm/core/xmFunc';
import XmFuncEdit from './XmFuncEdit';//
import { mapGetters } from 'vuex'
export default {
name:'xmFuncMng',
components: {
XmFuncEdit,
},
props:['visible','xmProduct'],
computed: {
...mapGetters(['userInfo']),
xmFuncsTreeData() {
let xmFuncs = JSON.parse(JSON.stringify(this.xmFuncs || []));
let xmFuncsTreeData = treeTool.translateDataToTree(xmFuncs,"pid","id");
return xmFuncsTreeData;
},
},
watch:{
visible(val){
if(val==true){
this.initData();
this.searchXmFuncs()
}
}
},
data() {
return {
filters: {
key: ''
},
xmFuncs: [],//
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:{
//sex: [{id:'1',name:''},{id:'2',name:''}]
},// params={categoryId:'all',itemCodes:['sex']} {sex: [{id:'1',name:''},{id:'2',name:''}]}
addFormVisible: false,//xmFunc
addForm: {
id:'',name:'',pid:'',pname:'',pidPaths:'',productId:'',lvl:''
},
editFormVisible: false,//
editForm: {
id:'',name:'',pid:'',pname:'',pidPaths:'',productId:'',lvl:''
},
parentFunc:{ id:'',name:'',pid:'',pname:'',pidPaths:'',productId:'',lvl:''},
maxTableHeight:300,
}
},//end data
methods: {
...util,
handleSizeChange(pageSize) {
this.pageInfo.pageSize=pageSize;
this.getXmFuncs();
},
handleCurrentChange(pageNum) {
this.pageInfo.pageNum = pageNum;
this.getXmFuncs();
},
// 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.getXmFuncs();
},
searchXmFuncs(){
this.pageInfo.count=true;
this.getXmFuncs();
},
// XmFunc
getXmFuncs() {
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.xmProduct && this.xmProduct.id){
params.productId=this.xmProduct.id
}
this.load.list = true;
listXmFunc(params).then((res) => {
var tips=res.data.tips;
if(tips.isOk){
this.pageInfo.total = res.data.total;
this.pageInfo.count=false;
this.xmFuncs = 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 );
},
// XmFunc
showEdit: function ( row,index ) {
this.editFormVisible = true;
this.editForm = Object.assign({}, row);
},
// XmFunc
showAdd: function () {
this.parentFunc=null;
this.addForm.productId=this.xmProduct.id
this.addForm.productName=this.xmProduct.productName
this.addFormVisible = true;
//this.addForm=Object.assign({}, this.editForm);
},
showSubAdd:function(row){
this.$refs.xmFuncTable.setCurrentRow(row)
if(this.editForm && row.id!=this.editForm.id){
this.$refs.xmFuncTable.setCurrentRow(row);
this.$emit("row-click",row)
}
this.addForm={...this.addFormInit}
this.editForm=row
this.parentFunc=row
this.addForm.productId=row.productId
if(this.xmProduct && row.productId==this.xmProduct.id){
this.addForm.productName=this.xmProduct.productName
}else{
this.addForm.productName=null;
}
this.addFormVisible=true
},
afterAddSubmit(){
this.addFormVisible=false;
this.pageInfo.count=true;
this.getXmFuncs();
},
afterEditSubmit(){
this.editFormVisible=false;
},
//xmFunc
selsChange: function (sels) {
this.sels = sels;
},
//xmFunc
handleDel: function (row,index) {
this.$confirm('确认删除该记录吗?', '提示', {
type: 'warning'
}).then(() => {
this.load.del=true;
let params = { id:row.id };
delXmFunc(params).then((res) => {
this.load.del=false;
var tips=res.data.tips;
if(tips.isOk){
this.searchXmFuncs();
}
this.$notify({ position:'bottom-left', showClose:true, message: tips.msg, type: tips.isOk?'success':'error' });
}).catch( err => this.load.del=false );
});
},
//xmFunc
batchDel: function () {
if(this.sels.length<=0){
return;
}
var params=this.sels.map(i=>{
return { id:i.id}
})
this.$confirm('确认删除选中记录吗?', '提示', {
type: 'warning'
}).then(() => {
this.load.del=true;
batchDelXmFunc(params).then((res) => {
this.load.del=false;
var tips=res.data.tips;
if( tips.isOk ){
this.searchXmFuncs();
}
this.$notify({ position:'bottom-left',showClose:true, message: tips.msg, type: tips.isOk?'success':'error'});
}).catch( err => this.load.del=false );
});
},
editSomeFields(row,fieldName,$event){
let params={};
if(this.sels.length>0){
if(!this.sels.some(k=> k.id==row.id)){
this.$notify({position:'bottom-left',showClose:true,message:'请编辑选中的行',type:'warning'})
Object.assign(this.editForm,this.editFormBak)
return;
}
params['ids']=this.sels.map(i=>i.id)
}else{
params['ids']=[row].map(i=>i.id)
}
params[fieldName]=$event
var func = editSomeFieldsXmFunc
func(params).then(res=>{
let tips = res.data.tips;
if(tips.isOk){
if(this.sels.length>0){
this.searchXmFuncs();
}
this.editFormBak=[...this.editForm]
}else{
Object.assign(this.editForm,this.editFormBak)
this.$notify({position:'bottom-left',showClose:true,message:tips.msg,type:tips.isOk?'success':'error'})
}
}).catch((e)=>Object.assign(this.editForm,this.editFormBak))
},
rowClick: function(row, event, column){
this.editForm=row
this.editFormBak={...row};
this.$emit('row-click',row, event, column);// @row-click="rowClick"
},
initData: function(){
},
unselectRow(){
this.editForm=null;
this.$emit('row-click',null)
this.$refs.xmFuncTable.setCurrentRow();
},
},//end methods
mounted() {
this.$nextTick(() => {
initDicts(this);
this.initData()
this.searchXmFuncs();
this.maxTableHeight = util.calcTableMaxHeight(this.$refs.xmFuncTable.$el)
});
}
}
</script>
<style scoped>
</style>

284
src/views/xm/core/xmTestCase/XmTestCaseMng.vue

@ -1,134 +1,144 @@
<template>
<section class="page-container border padding">
<el-row>
<el-input v-model="filters.key" style="width: 20%;" placeholder="模糊查询"></el-input>
<el-button v-loading="load.list" :disabled="load.list==true" @click="searchXmTestCases" icon="el-icon-search">查询</el-button>
<span style="float:right;">
<el-button type="primary" @click="showAdd" icon="el-icon-plus" plain> </el-button>
<el-button type="danger" v-loading="load.del" @click="batchDel" :disabled="this.sels.length===0 || load.del==true" icon="el-icon-delete" plain></el-button>
</span>
</el-row>
<el-row class="padding-top">
<!--列表 XmTestCase 测试用例-->
<el-table ref="xmTestCaseTable" :data="xmTestCases" :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 type="selection" width="55" show-overflow-tooltip fixed="left"></el-table-column>
<el-table-column sortable type="index" width="55" show-overflow-tooltip fixed="left"></el-table-column>
<!--
<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="id" label="主键" min-width="120" show-overflow-tooltip fixed="left"></el-table-column>
<el-table-column prop="caseName" label="标题" min-width="120" show-overflow-tooltip>
<template slot-scope="scope">
<span> {{scope.row.caseName}} </span>
</template>
</el-table-column>
<el-table-column prop="caseRemark" label="备注" min-width="120" show-overflow-tooltip>
<template slot-scope="scope">
<span> {{scope.row.caseRemark}} </span>
</template>
</el-table-column>
<el-table-column prop="testStep" label="测试步骤" min-width="120" show-overflow-tooltip>
<template slot-scope="scope">
<span> {{scope.row.testStep}} </span>
</template>
</el-table-column>
<el-table-column prop="expectResult" label="期望结果" min-width="120" show-overflow-tooltip>
<template slot-scope="scope">
<span> {{scope.row.expectResult}} </span>
</template>
</el-table-column>
<el-table-column prop="menuId" label="关联的故事" min-width="120" show-overflow-tooltip>
<template slot-scope="scope">
<span> {{scope.row.menuId}} </span>
</template>
</el-table-column>
<el-table-column prop="menuName" label="关联故事名" min-width="120" show-overflow-tooltip>
<template slot-scope="scope">
<span> {{scope.row.menuName}} </span>
</template>
</el-table-column>
<el-table-column prop="ctime" label="创建时间" min-width="120" show-overflow-tooltip>
<template slot-scope="scope">
<span> {{scope.row.ctime}} </span>
</template>
</el-table-column>
<el-table-column prop="ltime" label="更新时间" min-width="120" show-overflow-tooltip>
<template slot-scope="scope">
<span> {{scope.row.ltime}} </span>
</template>
</el-table-column>
<el-table-column prop="luserid" label="更新人编号" min-width="120" show-overflow-tooltip>
<template slot-scope="scope">
<span> {{scope.row.luserid}} </span>
</template>
</el-table-column>
<el-table-column prop="lusername" label="更新人姓名" min-width="120" show-overflow-tooltip>
<template slot-scope="scope">
<span> {{scope.row.lusername}} </span>
</template>
</el-table-column>
<el-table-column prop="cbranchId" label="创建机构" min-width="120" show-overflow-tooltip>
<template slot-scope="scope">
<span> {{scope.row.cbranchId}} </span>
</template>
</el-table-column>
<el-table-column prop="moduleId" label="模块编号" min-width="120" show-overflow-tooltip>
<template slot-scope="scope">
<span> {{scope.row.moduleId}} </span>
</template>
</el-table-column>
<el-table-column prop="moduleName" label="模块名称" min-width="120" show-overflow-tooltip>
<template slot-scope="scope">
<span> {{scope.row.moduleName}} </span>
</template>
</el-table-column>
<el-table-column prop="caseStatus" label="用例状态1正常0废弃" min-width="120" show-overflow-tooltip>
<template slot-scope="scope">
<span> {{scope.row.caseStatus}} </span>
</template>
</el-table-column>
<el-table-column prop="cuserid" label="创建人编号" min-width="120" show-overflow-tooltip>
<template slot-scope="scope">
<span> {{scope.row.cuserid}} </span>
</template>
</el-table-column>
<el-table-column prop="cusername" label="创建人姓名" min-width="120" show-overflow-tooltip>
<template slot-scope="scope">
<span> {{scope.row.cusername}} </span>
</template>
</el-table-column>
<el-table-column prop="productId" label="产品编号" min-width="120" show-overflow-tooltip>
<template slot-scope="scope">
<span> {{scope.row.productId}} </span>
</template>
</el-table-column>
<el-table-column prop="verNum" label="版本号" min-width="120" show-overflow-tooltip>
<template slot-scope="scope">
<span> {{scope.row.verNum}} </span>
</template>
</el-table-column>
<el-table-column prop="casedbId" label="用例库编号" min-width="120" show-overflow-tooltip>
<template slot-scope="scope">
<span> {{scope.row.casedbId}} </span>
</template>
</el-table-column>
<el-table-column prop="casedbName" label="用例库名称" min-width="120" show-overflow-tooltip>
<template slot-scope="scope">
<span> {{scope.row.casedbName}} </span>
</template>
</el-table-column>
<el-table-column label="操作" width="180" fixed="right">
<template scope="scope">
<el-button type="primary" @click="showEdit( scope.row,scope.$index)" icon="el-icon-edit" plain></el-button>
<el-button type="danger" @click="handleDel(scope.row,scope.$index)" icon="el-icon-delete" plain></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>
<section>
<el-row>
<el-col :span="6">
<xm-func-select class="padding-right padding-left" :xm-product="{id:'xxxxx',name:'xxxxxxx'}" @row-click="onXmFuncRowClick">
</xm-func-select>
</el-col>
<el-col :span="18">
<el-row>
<el-input v-model="filters.key" style="width: 20%;" placeholder="名称 按回车" @keyup.enter.native="searchXmTestCases"></el-input>
<el-button v-loading="load.list" :disabled="load.list==true" @click="searchXmTestCases" icon="el-icon-search">查询</el-button>
<span style="float:right;">
<el-button type="primary" @click="showAdd" icon="el-icon-plus" plain> </el-button>
<el-button type="danger" v-loading="load.del" @click="batchDel" :disabled="this.sels.length===0 || load.del==true" icon="el-icon-delete" plain></el-button>
</span>
</el-row>
<el-row>
<!--列表 XmTestCase 测试用例-->
<el-table ref="xmTestCaseTable" :data="xmTestCases" :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 type="selection" width="55" show-overflow-tooltip fixed="left"></el-table-column>
<el-table-column sortable type="index" width="55" show-overflow-tooltip fixed="left"></el-table-column>
<!--
<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="id" label="编号" min-width="120" show-overflow-tooltip fixed="left"></el-table-column>
<el-table-column prop="caseName" label="标题" min-width="120" show-overflow-tooltip>
<template slot-scope="scope">
<span> {{scope.row.caseName}} </span>
</template>
</el-table-column>
<el-table-column prop="caseRemark" label="备注" min-width="120" show-overflow-tooltip>
<template slot-scope="scope">
<span> {{scope.row.caseRemark}} </span>
</template>
</el-table-column>
<el-table-column prop="testStep" label="测试步骤" min-width="120" show-overflow-tooltip>
<template slot-scope="scope">
<span> {{scope.row.testStep}} </span>
</template>
</el-table-column>
<el-table-column prop="expectResult" label="期望结果" min-width="120" show-overflow-tooltip>
<template slot-scope="scope">
<span> {{scope.row.expectResult}} </span>
</template>
</el-table-column>
<el-table-column prop="menuId" label="关联的故事" min-width="120" show-overflow-tooltip>
<template slot-scope="scope">
<span> {{scope.row.menuId}} </span>
</template>
</el-table-column>
<el-table-column prop="menuName" label="关联故事名" min-width="120" show-overflow-tooltip>
<template slot-scope="scope">
<span> {{scope.row.menuName}} </span>
</template>
</el-table-column>
<el-table-column prop="ctime" label="创建时间" min-width="120" show-overflow-tooltip>
<template slot-scope="scope">
<span> {{scope.row.ctime}} </span>
</template>
</el-table-column>
<el-table-column prop="ltime" label="更新时间" min-width="120" show-overflow-tooltip>
<template slot-scope="scope">
<span> {{scope.row.ltime}} </span>
</template>
</el-table-column>
<el-table-column prop="luserid" label="更新人编号" min-width="120" show-overflow-tooltip>
<template slot-scope="scope">
<span> {{scope.row.luserid}} </span>
</template>
</el-table-column>
<el-table-column prop="lusername" label="更新人姓名" min-width="120" show-overflow-tooltip>
<template slot-scope="scope">
<span> {{scope.row.lusername}} </span>
</template>
</el-table-column>
<el-table-column prop="cbranchId" label="创建机构" min-width="120" show-overflow-tooltip>
<template slot-scope="scope">
<span> {{scope.row.cbranchId}} </span>
</template>
</el-table-column>
<el-table-column prop="moduleId" label="模块编号" min-width="120" show-overflow-tooltip>
<template slot-scope="scope">
<span> {{scope.row.moduleId}} </span>
</template>
</el-table-column>
<el-table-column prop="moduleName" label="模块名称" min-width="120" show-overflow-tooltip>
<template slot-scope="scope">
<span> {{scope.row.moduleName}} </span>
</template>
</el-table-column>
<el-table-column prop="caseStatus" label="用例状态1正常0废弃" min-width="120" show-overflow-tooltip>
<template slot-scope="scope">
<span> {{scope.row.caseStatus}} </span>
</template>
</el-table-column>
<el-table-column prop="cuserid" label="创建人编号" min-width="120" show-overflow-tooltip>
<template slot-scope="scope">
<span> {{scope.row.cuserid}} </span>
</template>
</el-table-column>
<el-table-column prop="cusername" label="创建人姓名" min-width="120" show-overflow-tooltip>
<template slot-scope="scope">
<span> {{scope.row.cusername}} </span>
</template>
</el-table-column>
<el-table-column prop="productId" label="产品编号" min-width="120" show-overflow-tooltip>
<template slot-scope="scope">
<span> {{scope.row.productId}} </span>
</template>
</el-table-column>
<el-table-column prop="verNum" label="版本号" min-width="120" show-overflow-tooltip>
<template slot-scope="scope">
<span> {{scope.row.verNum}} </span>
</template>
</el-table-column>
<el-table-column prop="casedbId" label="用例库编号" min-width="120" show-overflow-tooltip>
<template slot-scope="scope">
<span> {{scope.row.casedbId}} </span>
</template>
</el-table-column>
<el-table-column prop="casedbName" label="用例库名称" min-width="120" show-overflow-tooltip>
<template slot-scope="scope">
<span> {{scope.row.casedbName}} </span>
</template>
</el-table-column>
<el-table-column label="操作" width="180" fixed="right">
<template scope="scope">
<el-button type="primary" @click="showEdit( scope.row,scope.$index)" icon="el-icon-edit" plain></el-button>
<el-button type="danger" @click="handleDel(scope.row,scope.$index)" icon="el-icon-delete" plain></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>
<el-row>
<!--编辑 XmTestCase 测试用例界面-->
<el-drawer title="编辑测试用例" :visible.sync="editFormVisible" size="60%" append-to-body :close-on-click-modal="false">
@ -149,12 +159,13 @@ import util from '@/common/js/util';//全局公共库
import config from '@/common/config';//
import { initDicts,listXmTestCase, delXmTestCase, batchDelXmTestCase,editSomeFieldsXmTestCase } from '@/api/xm/core/xmTestCase';
import XmTestCaseEdit from './XmTestCaseEdit';//
import XmFuncSelect from '../xmFunc/XmFuncSelect';//
import { mapGetters } from 'vuex'
export default {
name:'xmTestCaseMng',
components: {
XmTestCaseEdit,
XmTestCaseEdit,XmFuncSelect
},
props:['visible'],
computed: {
@ -172,7 +183,8 @@ export default {
data() {
return {
filters: {
key: ''
key: '',
xmFunc:null,
},
xmTestCases: [],//
pageInfo:{//
@ -251,6 +263,10 @@ export default {
}
if(this.filters.key){
params.key=this.filters.key
}
if(this.filters.xmFunc && this.filters.xmFunc.id){
params.funcPidPathsLike=this.filters.xmFunc.pidPaths
}
this.load.list = true;
@ -363,6 +379,10 @@ export default {
initData: function(){
},
onXmFuncRowClick(row){
this.filters.xmFunc=row
this.searchXmTestCases();
}
},//end methods
mounted() {

2
src/views/xm/core/xmTestPlan/XmTestPlanMng.vue

@ -56,7 +56,7 @@
</el-table-column>
<el-table-column prop="totalCases" label="进度" min-width="120" show-overflow-tooltip>
<template slot-scope="scope">
<el-tooltip open-delay="500" :content="'总用例数:'+scope.row.totalCases+' 成功:'+scope.row.okCases +' 失败:'+scope.row.errCases+' 忽略:'+scope.row.igCases+' 阻塞:'+scope.row.blCases">
<el-tooltip :open-delay="500" :content="'总用例数:'+scope.row.totalCases+' 成功:'+scope.row.okCases +' 失败:'+scope.row.errCases+' 忽略:'+scope.row.igCases+' 阻塞:'+scope.row.blCases">
<el-progress :stroke-width="22" :text-inside="true" :status="scope.row.totalCases>0 && scope.row.errCases<=0 ?'success':'exception'" :percentage="scope.row.totalCases>0?parseInt((parseInt(scope.row.okCases)+parseInt(scope.row.igCases)+parseInt(scope.row.errCases)+parseInt(scope.row.blCases))*100/parseInt(scope.row.totalCases)):0"></el-progress>
</el-tooltip>
</template>

Loading…
Cancel
Save