Browse Source

测试用例

master
陈裕财 3 years ago
parent
commit
8e2e8e9294
  1. 20
      src/views/xm/core/xmTestCase/XmTestCaseEdit.vue
  2. 55
      src/views/xm/core/xmTestCasedb/XmTestCasedbMng.vue

20
src/views/xm/core/xmTestCase/XmTestCaseEdit.vue

@ -8,6 +8,7 @@
<el-form-item label="测试库" prop="casedbName">
{{editForm.casedbName?editForm.casedbName:editForm.casedbId }}
<el-button type="text" @click="testCasedbVisible=true" v-if="opType==='add' && (!xmTestCasedb||!xmTestCasedb.id)">选择测试库</el-button>
</el-form-item>
<el-form-item label="产品" prop="productId">
@ -111,6 +112,10 @@
<el-dialog title="需求详情" :visible.sync="menuFormVisible" :with-header="false" width="90%" top="20px" append-to-body :close-on-click-modal="false" >
<xm-menu-edit v-if="menuFormVisible" :reload="true" :xm-menu="{menuId:editForm.menuId}" :visible="menuFormVisible" @cancel="menuFormVisible=false"></xm-menu-edit>
</el-dialog>
<el-dialog title="选择测试库" :visible.sync="testCasedbVisible" :with-header="false" width="90%" top="20px" append-to-body :close-on-click-modal="false" >
<xm-test-casedb-mng v-if="testCasedbVisible" :select="true" :xm-product="xmProduct?xmProduct:(xmMenu?{id:xmMenu.productId,productName:xmMenu.productName}:null)" :visible="testCasedbVisible" @cancel="testCasedbVisible=false" @select="onTestCasedbSelect"></xm-test-casedb-mng>
</el-dialog>
</section>
</template>
@ -131,7 +136,9 @@ import MdpSelectUserXm from '@/views/xm/core/components/MdpSelectUserXm';//修
export default {
name:'xmTestCaseEdit',
components: {
XmMenuSelect,XmFuncSelect,MyInput,TestStepConfig,XmQuestionMng,XmTestPlanCaseMng,MdpSelectUserXm,XmMenuEdit:()=>import("../xmMenu/XmMenuDetail")
XmMenuSelect,XmFuncSelect,MyInput,TestStepConfig,XmQuestionMng,XmTestPlanCaseMng,MdpSelectUserXm,
XmMenuEdit:()=>import("../xmMenu/XmMenuDetail"),
XmTestCasedbMng:()=>import('../xmTestCasedb/XmTestCasedbMng')
},
computed: {
...mapGetters([ 'userInfo' ]),
@ -174,6 +181,7 @@ import MdpSelectUserXm from '@/views/xm/core/components/MdpSelectUserXm';//修
menuFormVisible:false,
funcVisible:false,
activeTab:'1',
testCasedbVisible:false,
}//end return
},//end data
methods: {
@ -294,6 +302,16 @@ import MdpSelectUserXm from '@/views/xm/core/components/MdpSelectUserXm';//修
if(this.opType!=='add'){
this.editSomeFields(this.editForm,'funcId',row)
}
},
onTestCasedbSelect(testCasedb){
this.editForm.casedbId=testCasedb.id
this.editForm.casedbName=testCasedb.Name
if(testCasedb.productId){
this.editForm.productId=testCasedb.productId
this.editForm.productName=testCasedb.productName
}
this.testCasedbVisible=false;
}
},//end method
mounted() {

55
src/views/xm/core/xmTestCasedb/XmTestCasedbMng.vue

@ -1,5 +1,5 @@
<template>
<section class="page-container border padding">
<section class="border padding">
<el-row>
<xm-product-select v-if="!xmProduct" style="display:inline;" :auto-select="false" :link-project-id="selProject?selProject.id:null" @row-click="onProductSelected" @clear="clearProduct"></xm-product-select>
<el-input v-model="filters.key" style="width: 20%;" placeholder="模糊查询"></el-input>
@ -9,7 +9,7 @@
<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">
<el-row>
<!--列表 XmTestCasedb 测试用例库-->
<el-table ref="xmTestCasedbTable" :data="xmTestCasedbs" :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>
@ -23,29 +23,36 @@
<el-table-column prop="name" label="用例库名称" min-width="120" show-overflow-tooltip>
<template slot-scope="scope">
<span><el-link @click="goCasedbInfo(scope.row)">{{scope.row.name}} </el-link> </span>
<span class="tool-bar">
<el-button type="primary" @click="showEdit( scope.row,scope.$index)" icon="el-icon-edit" plain circle></el-button>
</span>
</template>
</el-table-column>
<el-table-column prop="productName" label="产品名称" min-width="120" show-overflow-tooltip>
<template slot-scope="scope">
<span> {{scope.row.productName}} </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="ctime" label="创建日期" min-width="120" show-overflow-tooltip>
<template slot-scope="scope">
<span> {{scope.row.ctime}} </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>
<template v-if="select!==true">
<el-table-column prop="productName" label="产品名称" min-width="120" show-overflow-tooltip>
<template slot-scope="scope">
<span> {{scope.row.productName}} </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="ctime" label="创建日期" min-width="120" show-overflow-tooltip>
<template slot-scope="scope">
<span> {{scope.row.ctime}} </span>
</template>
</el-table-column>
</template>
<template v-else>
<el-table-column label="操作" width="180" fixed="right">
<template scope="scope">
<el-button type="primary" @click="$emit('select',scope.row)">选择</el-button>
</template>
</el-table-column>
</template>
</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>
@ -77,7 +84,7 @@ export default {
components: {
XmTestCasedbEdit,XmProductSelect,
},
props:['visible','xmProduct','selProject'],
props:['visible','xmProduct','selProject','select'],
computed: {
...mapGetters(['userInfo']),

Loading…
Cancel
Save