10 changed files with 9 additions and 1138 deletions
-
34src/api/xm/core/xmTestCaseExec.js
-
6src/views/xm/core/xmIteration/XmIterationInfo.vue
-
6src/views/xm/core/xmProduct/XmProductInfo.vue
-
6src/views/xm/core/xmProject/XmProjectInfo.vue
-
5src/views/xm/core/xmQuestion/XmQuestionForTask.vue
-
2src/views/xm/core/xmQuestion/XmQuestionMng.vue
-
162src/views/xm/core/xmTestCaseExec/XmTestCaseExecAdd.vue
-
157src/views/xm/core/xmTestCaseExec/XmTestCaseExecEdit.vue
-
767src/views/xm/core/xmTestCaseExec/XmTestCaseExecMng.vue
-
2src/views/xm/core/xmTestPlanCase/XmTestPlanCaseEdit.vue
@ -1,34 +0,0 @@ |
|||||
import axios from '@/utils/request' |
|
||||
|
|
||||
import config from '@/common/config' |
|
||||
|
|
||||
let base = config.getCoreBasePath(); |
|
||||
|
|
||||
|
|
||||
/** |
|
||||
* xm_test_case_exec |
|
||||
*1 默认只开放普通查询,所有查询,只要上传 分页参数 {currentPage:当前页码从1开始,pageSize:每页记录数,total:总记录【数如果是0后台会自动计算总记录数非0不会自动计算】},后台都会自动按分页查询 其它 api用到再打开,没用到的api请注释掉, |
|
||||
*2 查询、新增、修改的参数格式 params={id:'执行编号 主键',execUserid:'执行人',startTime:'开始时间',projectId:'项目编号',projectName:'项目名称',caseId:'测试案例编号',caseName:'测试案例名称',endTime:'到期时间',remark:'问题描述',createUserid:'问题创建人编号',createUsername:'问题创建人',createTime:'创建时间',execStatus:'0新建1测试中2已完成',iterationId:'迭代编号',iterationName:'迭代名称',execUsername:'执行人姓名',taskId:'归属测试任务编号',taskName:'归属测试任务名称',menuId:'需求编号'} |
|
||||
**/ |
|
||||
|
|
||||
//普通查询 条件之间and关系
|
|
||||
export const listXmTestCaseExec = params => { return axios.get(`${base}/xm/core/xmTestCaseExec/list`, { params: params }); }; |
|
||||
|
|
||||
//模糊查询xm_test_case_exec 条件之间or关系
|
|
||||
//export const listXmTestCaseExecKey = params => { return axios.get(`${base}/xm/core/xmTestCaseExec/listKey`, { params: params }); };
|
|
||||
|
|
||||
//删除一条xm_test_case_exec params={id:'执行编号 主键'}
|
|
||||
export const delXmTestCaseExec = params => { return axios.post(`${base}/xm/core/xmTestCaseExec/del`,params); }; |
|
||||
|
|
||||
//批量删除xm_test_case_exec params=[{id:'执行编号 主键'}]
|
|
||||
export const batchDelXmTestCaseExec = params => { return axios.post(`${base}/xm/core/xmTestCaseExec/batchDel`, params); }; |
|
||||
|
|
||||
//修改一条xm_test_case_exec记录
|
|
||||
export const editXmTestCaseExec = params => { return axios.post(`${base}/xm/core/xmTestCaseExec/edit`, params); }; |
|
||||
|
|
||||
//新增一条xm_test_case_exec
|
|
||||
export const addXmTestCaseExec = params => { return axios.post(`${base}/xm/core/xmTestCaseExec/add`, params); }; |
|
||||
|
|
||||
export const batchAddXmTestCaseExec = params => { return axios.post(`${base}/xm/core/xmTestCaseExec/batchAdd`, params); }; |
|
||||
export const batchEditXmTestCaseExec = params => { return axios.post(`${base}/xm/core/xmTestCaseExec/batchEdit`, params); }; |
|
||||
|
|
||||
@ -1,162 +0,0 @@ |
|||||
<template> |
|
||||
<section class="page-container padding border"> |
|
||||
<el-row> |
|
||||
<!--新增界面 XmTestCaseExec xm_test_case_exec--> |
|
||||
<el-form :model="addForm" label-width="120px" :rules="addFormRules" ref="addForm"> |
|
||||
<el-form-item label="执行人" prop="execUserid"> |
|
||||
<el-input v-model="addForm.execUserid" placeholder="执行人" ></el-input> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="开始时间" prop="startTime"> |
|
||||
<el-date-picker type="date" placeholder="选择日期" v-model="addForm.startTime" value-format="yyyy-MM-dd HH:mm:ss" format="yyyy-MM-dd"></el-date-picker> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="执行编号" prop="id"> |
|
||||
<el-input v-model="addForm.id" placeholder="执行编号" ></el-input> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="项目编号" prop="projectId"> |
|
||||
<el-input v-model="addForm.projectId" placeholder="项目编号" ></el-input> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="项目名称" prop="projectName"> |
|
||||
<el-input v-model="addForm.projectName" placeholder="项目名称" ></el-input> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="测试用例编号" prop="caseId"> |
|
||||
<el-input v-model="addForm.caseId" placeholder="测试用例编号" ></el-input> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="测试用例名称" prop="caseName"> |
|
||||
<el-input v-model="addForm.caseName" placeholder="测试用例名称" ></el-input> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="到期时间" prop="endTime"> |
|
||||
<el-date-picker type="date" placeholder="选择日期" v-model="addForm.endTime" value-format="yyyy-MM-dd HH:mm:ss" format="yyyy-MM-dd"></el-date-picker> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="缺陷描述" prop="remark"> |
|
||||
<el-input v-model="addForm.remark" placeholder="缺陷描述" ></el-input> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="缺陷创建人编号" prop="createUserid"> |
|
||||
<el-input v-model="addForm.createUserid" placeholder="缺陷创建人编号" ></el-input> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="缺陷创建人" prop="createUsername"> |
|
||||
<el-input v-model="addForm.createUsername" placeholder="缺陷创建人" ></el-input> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="创建时间" prop="createTime"> |
|
||||
<el-date-picker type="date" placeholder="选择日期" v-model="addForm.createTime" value-format="yyyy-MM-dd HH:mm:ss" format="yyyy-MM-dd"></el-date-picker> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="0新建1测试中2已完成" prop="execStatus"> |
|
||||
<el-input v-model="addForm.execStatus" placeholder="0新建1测试中2已完成" ></el-input> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="迭代编号" prop="iterationId"> |
|
||||
<el-input v-model="addForm.iterationId" placeholder="迭代编号" ></el-input> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="迭代名称" prop="iterationName"> |
|
||||
<el-input v-model="addForm.iterationName" placeholder="迭代名称" ></el-input> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="执行人姓名" prop="execUsername"> |
|
||||
<el-input v-model="addForm.execUsername" placeholder="执行人姓名" ></el-input> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="归属测试任务编号" prop="taskId"> |
|
||||
<el-input v-model="addForm.taskId" placeholder="归属测试任务编号" ></el-input> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="归属测试任务名称" prop="taskName"> |
|
||||
<el-input v-model="addForm.taskName" placeholder="归属测试任务名称" ></el-input> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="需求编号" prop="menuId"> |
|
||||
<el-input v-model="addForm.menuId" placeholder="需求编号" ></el-input> |
|
||||
</el-form-item> |
|
||||
<el-form-item> |
|
||||
<el-col :span="24" :offset="8"> |
|
||||
<el-button @click.native="handleCancel">取消</el-button> |
|
||||
<el-button v-loading="load.add" type="primary" @click.native="addSubmit" :disabled="load.add==true">提交</el-button> |
|
||||
</el-col> |
|
||||
</el-form-item> |
|
||||
</el-form> |
|
||||
</el-row> |
|
||||
</section> |
|
||||
</template> |
|
||||
|
|
||||
<script> |
|
||||
import util from '@/common/js/util';//全局公共库 |
|
||||
import { initSimpleDicts } from '@/api/mdp/meta/item';//下拉框数据查询 |
|
||||
import { addXmTestCaseExec } from '@/api/xm/core/xmTestCaseExec'; |
|
||||
import { mapGetters } from 'vuex' |
|
||||
|
|
||||
export default { |
|
||||
computed: { |
|
||||
...mapGetters([ |
|
||||
'userInfo','roles' |
|
||||
]) |
|
||||
}, |
|
||||
props:['xmTestCaseExec','visible'], |
|
||||
watch: { |
|
||||
'xmTestCaseExec':function( xmTestCaseExec ) { |
|
||||
this.addForm = xmTestCaseExec; |
|
||||
}, |
|
||||
'visible':function(visible) { |
|
||||
if(visible==true){ |
|
||||
//从新打开页面时某些数据需要重新加载,可以在这里添加 |
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
data() { |
|
||||
return { |
|
||||
dicts:{},//下拉选择框的所有静态数据 params=[{categoryId:'0001',itemCode:'sex'}] 返回结果 {'sex':[{optionValue:'1',optionName:'男',seqOrder:'1',fp:'',isDefault:'0'},{optionValue:'2',optionName:'女',seqOrder:'2',fp:'',isDefault:'0'}]} |
|
||||
load:{ list: false, edit: false, del: false, add: false },//查询中... |
|
||||
addFormRules: { |
|
||||
id: [ |
|
||||
//{ required: true, message: '执行编号不能为空', trigger: 'blur' } |
|
||||
] |
|
||||
}, |
|
||||
//新增界面数据 xm_test_case_exec |
|
||||
addForm: { |
|
||||
execUserid:'',startTime:'',id:'',projectId:'',projectName:'',caseId:'',caseName:'',endTime:'',remark:'',createUserid:'',createUsername:'',createTime:'',execStatus:'',iterationId:'',iterationName:'',execUsername:'',taskId:'',taskName:'',menuId:'' |
|
||||
} |
|
||||
/**begin 在下面加自定义属性,记得补上面的一个逗号**/ |
|
||||
|
|
||||
/**end 在上面加自定义属性**/ |
|
||||
}//end return |
|
||||
},//end data |
|
||||
methods: { |
|
||||
// 取消按钮点击 父组件监听@cancel="addFormVisible=false" 监听 |
|
||||
handleCancel:function(){ |
|
||||
this.$refs['addForm'].resetFields(); |
|
||||
this.$emit('cancel'); |
|
||||
}, |
|
||||
//新增提交XmTestCaseExec xm_test_case_exec 父组件监听@submit="afterAddSubmit" |
|
||||
addSubmit: function () { |
|
||||
|
|
||||
this.$refs.addForm.validate((valid) => { |
|
||||
if (valid) { |
|
||||
|
|
||||
this.$confirm('确认提交吗?', '提示', {}).then(() => { |
|
||||
this.load.add=true |
|
||||
let params = Object.assign({}, this.addForm); |
|
||||
addXmTestCaseExec(params).then((res) => { |
|
||||
this.load.add=false |
|
||||
var tips=res.data.tips; |
|
||||
if(tips.isOk){ |
|
||||
this.$refs['addForm'].resetFields(); |
|
||||
this.$emit('submit');// @submit="afterAddSubmit" |
|
||||
} |
|
||||
this.$notify({position:'bottom-left',showClose:true,message: tips.msg, type: tips.isOk?'success':'error' }); |
|
||||
}).catch( err => this.load.add=false); |
|
||||
}); |
|
||||
} |
|
||||
}); |
|
||||
}, |
|
||||
/**begin 在下面加自定义方法,记得补上面的一个逗号**/ |
|
||||
|
|
||||
/**end 在上面加自定义方法**/ |
|
||||
|
|
||||
},//end method |
|
||||
components: { |
|
||||
//在下面添加其它组件 'xm-test-case-exec-edit':XmTestCaseExecEdit |
|
||||
}, |
|
||||
mounted() { |
|
||||
this.addForm=Object.assign(this.addForm, this.xmTestCaseExec); |
|
||||
/**在下面写其它函数***/ |
|
||||
|
|
||||
}//end mounted |
|
||||
} |
|
||||
|
|
||||
</script> |
|
||||
|
|
||||
<style scoped> |
|
||||
|
|
||||
</style> |
|
||||
@ -1,157 +0,0 @@ |
|||||
<template> |
|
||||
<section class="page-container padding border"> |
|
||||
<el-row> |
|
||||
<!--编辑界面 XmTestCaseExec xm_test_case_exec--> |
|
||||
<el-form :model="editForm" label-width="120px" :rules="editFormRules" ref="editForm"> |
|
||||
<el-form-item label="执行人" prop="execUserid"> |
|
||||
<el-input v-model="editForm.execUserid" placeholder="执行人"></el-input> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="开始时间" prop="startTime"> |
|
||||
<el-date-picker type="date" placeholder="选择日期" v-model="editForm.startTime" value-format="yyyy-MM-dd HH:mm:ss" format="yyyy-MM-dd"></el-date-picker> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="执行编号" prop="id"> |
|
||||
<el-input v-model="editForm.id" placeholder="执行编号"></el-input> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="项目编号" prop="projectId"> |
|
||||
<el-input v-model="editForm.projectId" placeholder="项目编号"></el-input> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="项目名称" prop="projectName"> |
|
||||
<el-input v-model="editForm.projectName" placeholder="项目名称"></el-input> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="测试用例编号" prop="caseId"> |
|
||||
<el-input v-model="editForm.caseId" placeholder="测试用例编号"></el-input> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="测试用例名称" prop="caseName"> |
|
||||
<el-input v-model="editForm.caseName" placeholder="测试用例名称"></el-input> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="到期时间" prop="endTime"> |
|
||||
<el-date-picker type="date" placeholder="选择日期" v-model="editForm.endTime" value-format="yyyy-MM-dd HH:mm:ss" format="yyyy-MM-dd"></el-date-picker> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="缺陷描述" prop="remark"> |
|
||||
<el-input v-model="editForm.remark" placeholder="缺陷描述"></el-input> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="缺陷创建人编号" prop="createUserid"> |
|
||||
<el-input v-model="editForm.createUserid" placeholder="缺陷创建人编号"></el-input> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="缺陷创建人" prop="createUsername"> |
|
||||
<el-input v-model="editForm.createUsername" placeholder="缺陷创建人"></el-input> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="创建时间" prop="createTime"> |
|
||||
<el-date-picker type="date" placeholder="选择日期" v-model="editForm.createTime" value-format="yyyy-MM-dd HH:mm:ss" format="yyyy-MM-dd"></el-date-picker> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="0新建1测试中2已完成" prop="execStatus"> |
|
||||
<el-input v-model="editForm.execStatus" placeholder="0新建1测试中2已完成"></el-input> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="迭代编号" prop="iterationId"> |
|
||||
<el-input v-model="editForm.iterationId" placeholder="迭代编号"></el-input> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="迭代名称" prop="iterationName"> |
|
||||
<el-input v-model="editForm.iterationName" placeholder="迭代名称"></el-input> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="执行人姓名" prop="execUsername"> |
|
||||
<el-input v-model="editForm.execUsername" placeholder="执行人姓名"></el-input> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="归属测试任务编号" prop="taskId"> |
|
||||
<el-input v-model="editForm.taskId" placeholder="归属测试任务编号"></el-input> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="归属测试任务名称" prop="taskName"> |
|
||||
<el-input v-model="editForm.taskName" placeholder="归属测试任务名称"></el-input> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="需求编号" prop="menuId"> |
|
||||
<el-input v-model="editForm.menuId" placeholder="需求编号"></el-input> |
|
||||
</el-form-item> |
|
||||
<el-form-item> |
|
||||
<el-col :span="24" :offset="8"> |
|
||||
<el-button @click.native="handleCancel">取消</el-button> |
|
||||
<el-button v-loading="load.edit" type="primary" @click.native="editSubmit" :disabled="load.edit==true">提交</el-button> |
|
||||
</el-col> |
|
||||
</el-form-item> |
|
||||
</el-form> |
|
||||
</el-row> |
|
||||
</section> |
|
||||
</template> |
|
||||
|
|
||||
<script> |
|
||||
import util from '@/common/js/util';//全局公共库 |
|
||||
import { initSimpleDicts } from '@/api/mdp/meta/item';//下拉框数据查询 |
|
||||
import { editXmTestCaseExec } from '@/api/xm/core/xmTestCaseExec'; |
|
||||
import { mapGetters } from 'vuex' |
|
||||
|
|
||||
export default { |
|
||||
computed: { |
|
||||
...mapGetters([ |
|
||||
'userInfo','roles' |
|
||||
]) |
|
||||
}, |
|
||||
props:['xmTestCaseExec','visible'], |
|
||||
watch: { |
|
||||
'xmTestCaseExec':function( xmTestCaseExec ) { |
|
||||
this.editForm = xmTestCaseExec; |
|
||||
}, |
|
||||
'visible':function(visible) { |
|
||||
if(visible==true){ |
|
||||
//从新打开页面时某些数据需要重新加载,可以在这里添加 |
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
data() { |
|
||||
return { |
|
||||
dicts:{},//下拉选择框的所有静态数据 params=[{categoryId:'0001',itemCode:'sex'}] 返回结果 {'sex':[{optionValue:'1',optionName:'男',seqOrder:'1',fp:'',isDefault:'0'},{optionValue:'2',optionName:'女',seqOrder:'2',fp:'',isDefault:'0'}]} |
|
||||
load:{ list: false, edit: false, del: false, add: false },//查询中... |
|
||||
editFormRules: { |
|
||||
id: [ |
|
||||
//{ required: true, message: '执行编号不能为空', trigger: 'blur' } |
|
||||
] |
|
||||
}, |
|
||||
//编辑界面数据 XmTestCaseExec xm_test_case_exec |
|
||||
editForm: { |
|
||||
execUserid:'',startTime:'',id:'',projectId:'',projectName:'',caseId:'',caseName:'',endTime:'',remark:'',createUserid:'',createUsername:'',createTime:'',execStatus:'',iterationId:'',iterationName:'',execUsername:'',taskId:'',taskName:'',menuId:'' |
|
||||
} |
|
||||
/**begin 在下面加自定义属性,记得补上面的一个逗号**/ |
|
||||
|
|
||||
/**end 在上面加自定义属性**/ |
|
||||
}//end return |
|
||||
},//end data |
|
||||
methods: { |
|
||||
// 取消按钮点击 父组件监听@cancel="editFormVisible=false" 监听 |
|
||||
handleCancel:function(){ |
|
||||
this.$refs['editForm'].resetFields(); |
|
||||
this.$emit('cancel'); |
|
||||
}, |
|
||||
//编辑提交XmTestCaseExec xm_test_case_exec父组件监听@submit="afterEditSubmit" |
|
||||
editSubmit: function () { |
|
||||
this.$refs.editForm.validate((valid) => { |
|
||||
if (valid) { |
|
||||
this.$confirm('确认提交吗?', '提示', {}).then(() => { |
|
||||
this.load.edit=true |
|
||||
let params = Object.assign({}, this.editForm); |
|
||||
editXmTestCaseExec(params).then((res) => { |
|
||||
this.load.edit=false |
|
||||
var tips=res.data.tips; |
|
||||
if(tips.isOk){ |
|
||||
this.$refs['editForm'].resetFields(); |
|
||||
this.$emit('submit');// @submit="afterEditSubmit" |
|
||||
} |
|
||||
this.$notify({position:'bottom-left',showClose:true,message: tips.msg, type: tips.isOk?'success':'error' }); |
|
||||
}).catch( err =>this.load.edit=false); |
|
||||
}); |
|
||||
} |
|
||||
}); |
|
||||
}, |
|
||||
/**begin 在下面加自定义方法,记得补上面的一个逗号**/ |
|
||||
|
|
||||
/**end 在上面加自定义方法**/ |
|
||||
},//end method |
|
||||
components: { |
|
||||
//在下面添加其它组件 'xm-test-case-exec-edit':XmTestCaseExecEdit |
|
||||
}, |
|
||||
mounted() { |
|
||||
this.editForm=Object.assign(this.editForm, this.xmTestCaseExec); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
</script> |
|
||||
|
|
||||
<style scoped> |
|
||||
|
|
||||
</style> |
|
||||
@ -1,767 +0,0 @@ |
|||||
<template> |
|
||||
<section class="page-container padding border"> |
|
||||
<el-row v-if="!batchEditVisible"> |
|
||||
<xm-product-select style="display:inline;" :auto-select="false" :link-project-id="filters.selProject?filters.selProject.id:null" @row-click="onProductSelected" @clear="filters.xmProduct=null"></xm-product-select> |
|
||||
<xm-project-select style="display:inline;" :auto-select="false" :link-product-id="filters.product?filters.product.id:null" @row-click="onPorjectConfirm" @clear="filters.selProject=null"></xm-project-select> |
|
||||
<el-button v-if=" !filters.menus || filters.menus.length==0" @click="showMenu"> 选择需求</el-button> |
|
||||
<el-tag v-else closable @close="clearFiltersMenu(filters.menus[0])">{{filters.menus[0].menuName.substr(0,5)}}等({{filters.menus.length}})个</el-tag> |
|
||||
<el-input v-model="filters.key" style="width: 20%;" placeholder="模糊查询"> |
|
||||
</el-input> |
|
||||
<el-button type="primary" v-loading="load.list" :disabled="load.list==true" v-on:click="searchXmTestCaseExecs" icon="el-icon-search"></el-button> |
|
||||
<el-popover |
|
||||
placement="top-start" |
|
||||
title="更多查询条件或操作" |
|
||||
width="400" |
|
||||
trigger="click" > |
|
||||
<el-row> |
|
||||
<el-col :span="24" style="padding-top:5px;"> |
|
||||
<xm-product-select :auto-select="false" :link-project-id="filters.selProject" @row-click="onProductSelected"></xm-product-select> |
|
||||
</el-col> |
|
||||
<el-col :span="24" style="padding-top:5px;" v-if="!selProject" > |
|
||||
<xm-project-select :auto-select="false" :link-product-id="filters.product?filters.product.id:null" @row-click="onPorjectConfirm"></xm-project-select> |
|
||||
</el-col> |
|
||||
<el-col :span="24" style="padding-top:5px;"> |
|
||||
<font class="more-label-font">需求:</font> |
|
||||
<font v-if=" filters.menus && filters.menus.length>0"> |
|
||||
<el-tag v-for="(item,index) in filters.menus" :key="index" closable @close="clearFiltersMenu(item)">{{item.menuName.substr(0,10)}}</el-tag> |
|
||||
</font> |
|
||||
<el-button v-else @click="showMenu" type="plian">选需求</el-button> |
|
||||
</el-col> |
|
||||
<el-col :span="24" style="padding-top:5px;"> |
|
||||
<font class="more-label-font">执行人:</font> |
|
||||
<el-tag v-if=" filters.execUser " closable @close="clearFiltersExecUser">{{this.filters.execUser.username}}</el-tag> |
|
||||
<el-button v-else @click="showExecUsersForFilters" type="plian">选执行人</el-button> |
|
||||
<el-button v-if=" !filters.execUser || filters.execUser.userid!=userInfo.userid" @click="setFiltersHandlerAsMySelf">我的</el-button> |
|
||||
</el-col> |
|
||||
<el-col :span="24" style="padding-top:5px;"> |
|
||||
<font class="more-label-font">创建时间:</font> |
|
||||
<el-date-picker |
|
||||
v-model="dateRanger" |
|
||||
type="daterange" |
|
||||
align="right" |
|
||||
unlink-panels |
|
||||
range-separator="至" |
|
||||
start-placeholder="开始日期" |
|
||||
end-placeholder="完成日期" |
|
||||
value-format="yyyy-MM-dd HH:mm:ss" |
|
||||
:default-time="['00:00:00','23:59:59']" |
|
||||
:picker-options="pickerOptions" |
|
||||
></el-date-picker> |
|
||||
</el-col> |
|
||||
|
|
||||
<el-col :span="24" style="padding-top:5px;"> |
|
||||
<el-checkbox v-model="gstcVisible" >甘特图</el-checkbox> |
|
||||
</el-col> |
|
||||
|
|
||||
<el-col :span="24" style="padding-top:5px;"> |
|
||||
<el-button type="primary" icon="el-icon-search" @click="searchXmTestCaseExecs">查询</el-button> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
<el-button slot="reference" icon="el-icon-more"></el-button> |
|
||||
</el-popover> |
|
||||
|
|
||||
<span style="float:right;"> |
|
||||
<el-button type="primary" @click="showCase" icon="el-icon-plus">由用例创建计划</el-button> |
|
||||
<el-button @click="showBatchEdit" icon="el-icon-right">批量修改</el-button> |
|
||||
</span> |
|
||||
</el-row> |
|
||||
<el-row class="page-main" v-else> |
|
||||
<el-input v-model="filters.key" style="width: 20%;" placeholder="模糊查询"> |
|
||||
<template slot="append"> |
|
||||
<el-button type="primary" v-loading="load.list" :disabled="load.list==true" v-on:click="searchXmTestCaseExecs" icon="el-icon-search"></el-button> |
|
||||
</template> |
|
||||
</el-input> |
|
||||
<el-button type="warning" @click="batchEditXmTestCaseExec" icon="el-icon-finished">批量保存</el-button> |
|
||||
<el-button @click="noBatchEdit" icon="el-icon-back">返回</el-button> |
|
||||
</el-row> |
|
||||
<el-row class="page-main "> |
|
||||
<!--列表 XmTestCaseExec xm_test_case_exec--> |
|
||||
<el-table ref="table" :height="maxTableHeight" v-if="!gstcVisible" :data="xmTestCaseExecs" @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="45"></el-table-column> |
|
||||
<el-table-column sortable type="index" width="45"></el-table-column> |
|
||||
<el-table-column prop="projectName" label="项目名称" min-width="100" show-overflow-tooltip> |
|
||||
<template slot="header" v-if="!selProject"> |
|
||||
项目<el-button type="text" @click="showProjectList" icon="el-icon-search" ></el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="caseName" label="用例(点击详情)" min-width="100" show-overflow-tooltip> |
|
||||
<template slot-scope="scope"> |
|
||||
{{scope.row.caseId}} <el-link type="primary" @click="showCaseDetail(scope.row)">{{scope.row.caseName}}</el-link> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="menuName" label="需求" min-width="100" show-overflow-tooltip> |
|
||||
<template slot="header" slot-scope="scope"> |
|
||||
需求<el-button type="text" @click="showMenu" icon="el-icon-search" ></el-button> |
|
||||
</template> |
|
||||
|
|
||||
</el-table-column> |
|
||||
|
|
||||
<el-table-column prop="taskName" label="任务" min-width="100" show-overflow-tooltip> |
|
||||
<template slot-scope="scope"> |
|
||||
{{scope.row.taskName?scope.row.taskName:'未关联任务'}} |
|
||||
<el-button v-if=" batchEditVisible==true " type="warning" @click="showSelectTask(scope.row)">选任务</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="execUsername" label="执行人姓名" min-width="100" show-overflow-tooltip> |
|
||||
<template slot-scope="scope"> |
|
||||
{{scope.row.execUsername?scope.row.execUsername:'未设置'}} |
|
||||
<el-button v-if=" batchEditVisible==true " type="warning" @click="showGroupUsers(scope.row)">选人</el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="startTime" label="起止时间" min-width="100" show-overflow-tooltip> |
|
||||
<template slot-scope="scope"> |
|
||||
<div v-if="batchEditVisible"> |
|
||||
<el-date-picker style="width:100%;" |
|
||||
v-model="scope.row.startTime" |
|
||||
|
|
||||
align="right" |
|
||||
type="date" |
|
||||
value-format="yyyy-MM-dd HH:mm:ss" |
|
||||
format="yyyy-MM-dd" |
|
||||
placeholder="选择日期" |
|
||||
:picker-options="pickerOptions" @change="fieldChange(scope.row,'startTime')"> |
|
||||
</el-date-picker> |
|
||||
<el-date-picker style="width:100%;" |
|
||||
v-model="scope.row.endTime" |
|
||||
:disabled="!batchEditVisible" |
|
||||
align="right" |
|
||||
type="date" |
|
||||
value-format="yyyy-MM-dd HH:mm:ss" |
|
||||
format="yyyy-MM-dd" |
|
||||
placeholder="选择日期" |
|
||||
:picker-options="pickerOptions" @change="fieldChange(scope.row,'endTime')"> |
|
||||
</el-date-picker> |
|
||||
</div> |
|
||||
<div v-else>{{scope.row.startTime?scope.row.startTime.substr(0,10):""}} ~ {{scope.row.endTime?scope.row.endTime.substr(0,10):""}}</div> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="execStatus" label="状态" width="100" :formatter="formatterExecStatus" > |
|
||||
<template slot-scope="scope"> |
|
||||
<el-select :disabled="!batchEditVisible" v-model="scope.row.execStatus" @change="fieldChange(scope.row,'execStatus')"> |
|
||||
<el-option :value="'0'" label="新建"></el-option> |
|
||||
<el-option :value="'1'" label="测试中"></el-option> |
|
||||
<el-option :value="'2'" label="已完成"></el-option> |
|
||||
</el-select> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column v-if="!batchEditVisible" label="操作" width="300" fixed="right"> |
|
||||
<template scope="scope"> |
|
||||
<el-button type="primary" @click="showAddBug(scope.row,scope.$index)" icon="el-icon-plus">bug</el-button> |
|
||||
<el-button @click="showBugs(scope.row,scope.$index)" icon="el-icon-s-data">查bug</el-button> |
|
||||
<el-button type="danger" @click="handleDel(scope.row,$index)" icon="el-icon-delete"></el-button> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
<el-pagination v-if="!gstcVisible" 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> |
|
||||
<xm-gantt v-if="gstcVisible" :tree-data="xmTestCaseExecs" :project-phase="selProject" :columns="ganrrColumns" :useRealTime="false"></xm-gantt> |
|
||||
|
|
||||
<!--编辑 XmTestCaseExec xm_test_case_exec界面--> |
|
||||
<el-drawer title="编辑xm_test_case_exec" :visible.sync="editFormVisible" size="50%" append-to-body :close-on-click-modal="false"> |
|
||||
<xm-test-case-exec-edit :xm-test-case-exec="editForm" :visible="editFormVisible" @cancel="editFormVisible=false" @submit="afterEditSubmit"></xm-test-case-exec-edit> |
|
||||
</el-drawer> |
|
||||
|
|
||||
<!--新增 XmTestCaseExec xm_test_case_exec界面--> |
|
||||
<el-drawer title="新增xm_test_case_exec" :visible.sync="addFormVisible" size="60%" append-to-body :close-on-click-modal="false"> |
|
||||
<xm-test-case-exec-add :xm-test-case-exec="addForm" :visible="addFormVisible" @cancel="addFormVisible=false" @submit="afterAddSubmit"></xm-test-case-exec-add> |
|
||||
</el-drawer> |
|
||||
<el-drawer title="选择用例" :visible.sync="xmTestCaseMngVisible" size="60%" append-to-body :close-on-click-modal="false"> |
|
||||
<xm-test-case-mng :multi-select="true" :visible="xmTestCaseMngVisible" @selected="onCaseSelected"></xm-test-case-mng> |
|
||||
</el-drawer> |
|
||||
<el-drawer append-to-body title="需求选择" :visible.sync="menuVisible" fullscreen size="60%" :close-on-click-modal="false"> |
|
||||
<xm-menu-select :visible="menuVisible" :is-select-menu="true" :multi="true" @menus-selected="onSelectedMenus" ></xm-menu-select> |
|
||||
</el-drawer> |
|
||||
<el-drawer title="选中用户" :visible.sync="selectUserForFiltersVisible" size="60%" append-to-body :close-on-click-modal="false"> |
|
||||
<xm-group-mng v-if="filters.selProject" :sel-project=" filters.selProject " :is-select-single-user="1" @user-confirm="onFiltersUserConfirm"></xm-group-mng> |
|
||||
</el-drawer> |
|
||||
<el-drawer title="选中用户" :visible.sync="selectUserVisible" size="60%" append-to-body :close-on-click-modal="false"> |
|
||||
<xm-group-mng v-if="filters.selProject" :sel-project=" filters.selProject " :is-select-single-user="1" @user-confirm="onUserConfirm"></xm-group-mng> |
|
||||
</el-drawer> |
|
||||
<el-drawer title="选中任务" :visible.sync="selectTaskVisible" size="60%" append-to-body :close-on-click-modal="false"> |
|
||||
<xm-task-list :sel-project="filters.selProject" @task-selected="onSelectedTask"></xm-task-list> |
|
||||
</el-drawer> |
|
||||
|
|
||||
<el-drawer title="查看用例" :visible.sync="caseVisible" size="60%" fullscreen append-to-body :close-on-click-modal="false"> |
|
||||
<xm-test-case-mng :case-id="editForm.caseId" :visible="caseVisible" ></xm-test-case-mng> |
|
||||
</el-drawer> |
|
||||
<el-drawer title="测试用例" :visible.sync="caseVisible" size="60%" append-to-body :close-on-click-modal="false"> |
|
||||
<xm-test-case-edit :xm-test-case="xmTestCase" :visible="caseVisible" @cancel="caseVisible=false" ></xm-test-case-edit> |
|
||||
</el-drawer> |
|
||||
<el-drawer title="缺陷列表" :visible.sync="bugsVisible" size="60%" append-to-body fullscreen :close-on-click-modal="false"> |
|
||||
<xm-question-mng :xm-test-case="xmTestCase" :xm-test-case-exec="editForm" :sel-project="filters.selProject" :visible="bugsVisible" @cancel="bugsVisible=false" ></xm-question-mng> |
|
||||
</el-drawer> |
|
||||
<!--新增 XmQuestion xm_question界面--> |
|
||||
<el-drawer title="新增缺陷" :visible.sync="addBugVisible" size="60%" append-to-body :close-on-click-modal="false"> |
|
||||
<xm-question-add :xm-test-case-exec="editForm" :xm-test-case="xmTestCase" :sel-project=" filters.selProject " :visible="addBugVisible" @cancel="addBugVisible=false"></xm-question-add> |
|
||||
</el-drawer> |
|
||||
</el-row> |
|
||||
</section> |
|
||||
</template> |
|
||||
|
|
||||
<script> |
|
||||
import util from '@/common/js/util';//全局公共库 |
|
||||
import {sn} from '@/common/js/sequence';//全局公共库 |
|
||||
|
|
||||
import config from '@/common/config';//全局公共库 |
|
||||
import { initSimpleDicts } from '@/api/mdp/meta/item';//下拉框数据查询 |
|
||||
import { listXmTestCaseExec, delXmTestCaseExec, batchDelXmTestCaseExec,batchAddXmTestCaseExec,batchEditXmTestCaseExec } from '@/api/xm/core/xmTestCaseExec'; |
|
||||
import { listXmTestCase} from '@/api/xm/core/xmTestCase'; |
|
||||
|
|
||||
import XmTestCaseExecAdd from './XmTestCaseExecAdd';//新增界面 |
|
||||
import XmTestCaseExecEdit from './XmTestCaseExecEdit';//修改界面 |
|
||||
import XmTestCaseMng from '../xmTestCase/XmTestCaseMng';//修改界面 |
|
||||
import XmProjectSelect from '@/views/xm/core/components/XmProjectSelect'; |
|
||||
import xmMenuSelect from '../xmMenu/XmMenuSelect'; |
|
||||
import XmGroupMng from '../xmGroup/XmGroupMng'; |
|
||||
import XmTaskList from '../xmTask/XmTaskList'; |
|
||||
import XmTestCaseEdit from '../xmTestCase/XmTestCaseEdit';//修改界面 |
|
||||
import XmQuestionMng from '../xmQuestion/XmQuestionMng';//修改界面 |
|
||||
import XmQuestionAdd from '../xmQuestion/XmQuestionAdd';//修改界面 |
|
||||
import XmProductSelect from '@/views/xm/core/components/XmProductSelect';//修改界面 |
|
||||
import XmGantt from '../components/xm-gantt'; |
|
||||
|
|
||||
import { mapGetters } from 'vuex' |
|
||||
|
|
||||
export default { |
|
||||
computed: { |
|
||||
...mapGetters([ |
|
||||
'userInfo','roles' |
|
||||
]), |
|
||||
}, |
|
||||
props:['selProject'], |
|
||||
watch:{ |
|
||||
selProject(selProject){ |
|
||||
this.filters.selProject=selProject; |
|
||||
this.getXmTestCaseExecs(); |
|
||||
} |
|
||||
}, |
|
||||
data() { |
|
||||
|
|
||||
const beginDate = new Date(); |
|
||||
const endDate = new Date(); |
|
||||
beginDate.setTime(beginDate.getTime() - 3600 * 1000 * 24 * 7 * 4 * 12 ); |
|
||||
return { |
|
||||
filters: { |
|
||||
key: '', |
|
||||
selProject:null, |
|
||||
menus:[], |
|
||||
execUser:null, |
|
||||
product:null, |
|
||||
}, |
|
||||
xmTestCaseExecs: [],//查询结果 |
|
||||
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:[], |
|
||||
},//下拉选择框的所有静态数据 params=[{categoryId:'0001',itemCode:'sex'}] 返回结果 {'sex':[{optionValue:'1',optionName:'男',seqOrder:'1',fp:'',isDefault:'0'},{optionValue:'2',optionName:'女',seqOrder:'2',fp:'',isDefault:'0'}]} |
|
||||
|
|
||||
addFormVisible: false,//新增xmTestCaseExec界面是否显示 |
|
||||
//新增xmTestCaseExec界面初始化数据 |
|
||||
addForm: { |
|
||||
execUserid:'',startTime:'',id:'',projectId:'',projectName:'',caseId:'',caseName:'',endTime:'',remark:'',createUserid:'',createUsername:'',createTime:'',execStatus:'',iterationId:'',iterationName:'',execUsername:'',taskId:'',taskName:'',menuId:'' |
|
||||
}, |
|
||||
xmTestCase:null, |
|
||||
editFormVisible: false,//编辑界面是否显示 |
|
||||
//编辑xmTestCaseExec界面初始化数据 |
|
||||
editForm: { |
|
||||
execUserid:'',startTime:'',id:'',projectId:'',projectName:'',caseId:'',caseName:'',endTime:'',remark:'',createUserid:'',createUsername:'',createTime:'',execStatus:'',iterationId:'',iterationName:'',execUsername:'',taskId:'',taskName:'',menuId:'' |
|
||||
}, |
|
||||
/**begin 自定义属性请在下面加 请加备注**/ |
|
||||
xmTestCaseMngVisible:false, |
|
||||
selectProjectVisible:false, |
|
||||
menuVisible:false, |
|
||||
batchEditVisible:false, |
|
||||
valueChangeRows:[], |
|
||||
selectUserVisible:false, |
|
||||
selectUserForFiltersVisible:false, |
|
||||
selectTaskVisible:false, |
|
||||
caseVisible:false, |
|
||||
bugsVisible:false, |
|
||||
addBugVisible:false, |
|
||||
productSelectVisible:false, |
|
||||
nextAction:'', |
|
||||
dateRanger: [ ], |
|
||||
pickerOptions: util.getPickerOptions('datarange'), |
|
||||
gstcVisible:false, |
|
||||
ganrrColumns: { |
|
||||
children: 'children', |
|
||||
name: 'projectName', |
|
||||
id: 'id', |
|
||||
pid: 'parentPhaseId', |
|
||||
startDate: 'startTime', |
|
||||
endDate: 'endTime', |
|
||||
|
|
||||
}, |
|
||||
maxTableHeight:300, |
|
||||
/**end 自定义属性请在上面加 请加备注**/ |
|
||||
} |
|
||||
},//end data |
|
||||
methods: { |
|
||||
handleSizeChange(pageSize) { |
|
||||
this.pageInfo.pageSize=pageSize; |
|
||||
this.getXmTestCaseExecs(); |
|
||||
}, |
|
||||
handleCurrentChange(pageNum) { |
|
||||
this.pageInfo.pageNum = pageNum; |
|
||||
this.getXmTestCaseExecs(); |
|
||||
}, |
|
||||
// 表格排序 obj.order=ascending/descending,需转化为 asc/desc ; obj.prop=表格中的排序字段,字段驼峰命名 |
|
||||
sortChange( obj ){ |
|
||||
var dir='asc'; |
|
||||
if(obj.order=='ascending'){ |
|
||||
dir='asc' |
|
||||
}else{ |
|
||||
dir='desc'; |
|
||||
} |
|
||||
if(obj.prop=='xxx'){ |
|
||||
this.pageInfo.orderFields=['xxx']; |
|
||||
this.pageInfo.orderDirs=[dir]; |
|
||||
} |
|
||||
this.getXmTestCaseExecs(); |
|
||||
}, |
|
||||
searchXmTestCaseExecs(){ |
|
||||
this.pageInfo.count=true; |
|
||||
this.getXmTestCaseExecs(); |
|
||||
}, |
|
||||
//获取列表 XmTestCaseExec xm_test_case_exec |
|
||||
getXmTestCaseExecs() { |
|
||||
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.menus && this.filters.menus.length==1){ |
|
||||
params.menuId=this.filters.menus[0].menuId |
|
||||
}else if(this.filters.menus && this.filters.menus.length>1){ |
|
||||
params.menuIds=this.filters.menus.map(i=>i.menuId) |
|
||||
}else{ |
|
||||
//params.xxx=xxxxx |
|
||||
} |
|
||||
if(this.dateRanger&&this.dateRanger.length==2){ |
|
||||
params.createTimeStart=this.dateRanger[0] |
|
||||
params.createTimeEnd=this.dateRanger[1] |
|
||||
|
|
||||
} |
|
||||
if(this.filters.product){ |
|
||||
params.productId=this.filters.product.id |
|
||||
} |
|
||||
|
|
||||
if(this.filters.execUser){ |
|
||||
params.execUserid=this.filters.execUser.userid |
|
||||
} |
|
||||
if(this.filters.selProject){ |
|
||||
params.projectId=this.filters.selProject.id |
|
||||
} |
|
||||
if(this.filters.key){ |
|
||||
params.key='%'+this.filters.key+'%' |
|
||||
} |
|
||||
this.load.list = true; |
|
||||
listXmTestCaseExec(params).then((res) => { |
|
||||
var tips=res.data.tips; |
|
||||
if(tips.isOk){ |
|
||||
this.pageInfo.total = res.data.total; |
|
||||
this.pageInfo.count=false; |
|
||||
this.xmTestCaseExecs = 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 ); |
|
||||
}, |
|
||||
|
|
||||
//显示编辑界面 XmTestCaseExec xm_test_case_exec |
|
||||
showEdit: function ( row,index ) { |
|
||||
this.editFormVisible = true; |
|
||||
this.editForm = Object.assign({}, row); |
|
||||
}, |
|
||||
//显示新增界面 XmTestCaseExec xm_test_case_exec |
|
||||
showAdd: function () { |
|
||||
this.addFormVisible = true; |
|
||||
//this.addForm=Object.assign({}, this.editForm); |
|
||||
}, |
|
||||
afterAddSubmit(){ |
|
||||
this.addFormVisible=false; |
|
||||
this.pageInfo.count=true; |
|
||||
this.getXmTestCaseExecs(); |
|
||||
}, |
|
||||
afterEditSubmit(){ |
|
||||
this.editFormVisible=false; |
|
||||
}, |
|
||||
//选择行xmTestCaseExec |
|
||||
selsChange: function (sels) { |
|
||||
this.sels = sels; |
|
||||
}, |
|
||||
//删除xmTestCaseExec |
|
||||
handleDel: function (row,index) { |
|
||||
this.$confirm('确认删除该记录吗?', '提示', { |
|
||||
type: 'warning' |
|
||||
}).then(() => { |
|
||||
this.load.del=true; |
|
||||
let params = { id: row.id }; |
|
||||
delXmTestCaseExec(params).then((res) => { |
|
||||
this.load.del=false; |
|
||||
var tips=res.data.tips; |
|
||||
if(tips.isOk){ |
|
||||
this.pageInfo.count=true; |
|
||||
this.getXmTestCaseExecs(); |
|
||||
} |
|
||||
this.$notify({position:'bottom-left',showClose:true,message: tips.msg, type: tips.isOk?'success':'error' }); |
|
||||
}).catch( err => this.load.del=false ); |
|
||||
}); |
|
||||
}, |
|
||||
//批量删除xmTestCaseExec |
|
||||
batchDel: function () { |
|
||||
if( !this.roles.some(i=>i.roleid=='testAdmin') && !this.roles.some(i=>i.roleid=='testTeamAdmin') ){ |
|
||||
this.$notify({position:'bottom-left',showClose: true,message:"只有测试经理、测试组长可以操作",type:"error"}); |
|
||||
return ; |
|
||||
} |
|
||||
this.$confirm('确认删除选中记录吗?', '提示', { |
|
||||
type: 'warning' |
|
||||
}).then(() => { |
|
||||
this.load.del=true; |
|
||||
batchDelXmTestCaseExec(this.sels).then((res) => { |
|
||||
this.load.del=false; |
|
||||
var tips=res.data.tips; |
|
||||
if( tips.isOk ){ |
|
||||
this.pageInfo.count=true; |
|
||||
this.getXmTestCaseExecs(); |
|
||||
} |
|
||||
this.$notify({position:'bottom-left',showClose:true,message: tips.msg, type: tips.isOk?'success':'error'}); |
|
||||
}).catch( err => this.load.del=false ); |
|
||||
}); |
|
||||
}, |
|
||||
rowClick: function(row, event, column){ |
|
||||
this.$emit('row-click',row, event, column);// @row-click="rowClick" |
|
||||
}, |
|
||||
/**begin 自定义函数请在下面加**/ |
|
||||
onCaseSelected(cases){ |
|
||||
if(cases.length>0){ |
|
||||
this.load.add=true; |
|
||||
var execs=JSON.parse(JSON.stringify(cases)) |
|
||||
execs.forEach(i=>{ |
|
||||
|
|
||||
i.projectId=this.filters.selProject.id |
|
||||
i.projectName=this.filters.selProject.name |
|
||||
i.execUserid=this.userInfo.userid |
|
||||
i.execUsername=this.userInfo.username |
|
||||
i.caseId=i.id |
|
||||
i.caseName=i.caseName |
|
||||
i.remark=i.remark |
|
||||
i.menuId=i.menuId |
|
||||
i.menuName=i.menuName |
|
||||
i.createUserid=this.userInfo.userid |
|
||||
i.createUsername=this.userInfo.username, |
|
||||
i.opType="add" |
|
||||
i.id=sn('tce_'); |
|
||||
}) |
|
||||
batchAddXmTestCaseExec(execs).then(res=>{ |
|
||||
this.load.add=false; |
|
||||
this.xmTestCaseMngVisible=false; |
|
||||
|
|
||||
var tips=res.data.tips; |
|
||||
if( tips.isOk ){ |
|
||||
this.pageInfo.count=true; |
|
||||
this.getXmTestCaseExecs(); |
|
||||
} |
|
||||
this.$notify({position:'bottom-left',showClose:true,message: tips.msg, type: tips.isOk?'success':'error'}); |
|
||||
}) |
|
||||
}else{ |
|
||||
this.xmTestCaseMngVisible=false; |
|
||||
} |
|
||||
|
|
||||
}, |
|
||||
showCase(){ |
|
||||
if(!this.filters.selProject){ |
|
||||
this.$notify({position:'bottom-left',showClose: true,message:"请先选择项目",type:"warning"}); |
|
||||
nextAction="showCase" |
|
||||
this.showProjectList(); |
|
||||
return; |
|
||||
} |
|
||||
this.xmTestCaseMngVisible=true; |
|
||||
}, |
|
||||
|
|
||||
clearProject(){ |
|
||||
this.filters.selProject=null |
|
||||
this.getXmTestCaseExecs() |
|
||||
}, |
|
||||
showProjectList:function(){ |
|
||||
this.selectProjectVisible=true; |
|
||||
}, |
|
||||
onPorjectConfirm:function(nextAction,project){ |
|
||||
this.filters.selProject=project |
|
||||
this.selectProjectVisible=false; |
|
||||
this.getXmTestCaseExecs(); |
|
||||
if(nextAction=="showBatchEdit"){ |
|
||||
this.showBatchEdit(); |
|
||||
nextAction="" |
|
||||
}else if(nextAction=="showCase"){ |
|
||||
this.showCase(); |
|
||||
nextAction="" |
|
||||
}else if(nextAction=="showAddBug"){ |
|
||||
this.showAddBug(this.editForm); |
|
||||
nextAction="" |
|
||||
}else if(nextAction=="showBugs"){ |
|
||||
this.showBugs(this.editForm); |
|
||||
nextAction="" |
|
||||
}else if(nextAction=="showSelectTask"){ |
|
||||
this.showSelectTask(this.editForm); |
|
||||
nextAction="" |
|
||||
}else if(nextAction=="showExecUsersForFilters"){ |
|
||||
this.showExecUsersForFilters(); |
|
||||
nextAction="" |
|
||||
} |
|
||||
}, |
|
||||
formatterExecStatus(row,column,cellValue, index){ |
|
||||
var columnName=column.property; |
|
||||
if(cellValue=="0"){ |
|
||||
return "新建" |
|
||||
}if(cellValue=="1"){ |
|
||||
return "执行中" |
|
||||
}else if(cellValue=="2"){ |
|
||||
return "已结束" |
|
||||
}else { |
|
||||
return "新建"; |
|
||||
} |
|
||||
}, |
|
||||
showMenu(){ |
|
||||
this.menuVisible=true; |
|
||||
}, |
|
||||
clearProduct(){ |
|
||||
this.filters.product=null; |
|
||||
this.searchXmTestCaseExecs(); |
|
||||
}, |
|
||||
showProductVisible(){ |
|
||||
this.productSelectVisible=true; |
|
||||
}, |
|
||||
onProductSelected(product){ |
|
||||
this.filters.product=product; |
|
||||
this.productSelectVisible=false; |
|
||||
this.searchXmTestCaseExecs(); |
|
||||
}, |
|
||||
onSelectedMenus(menus){ |
|
||||
if(!menus || menus.length==0){ |
|
||||
this.menuVisible=false |
|
||||
return; |
|
||||
} |
|
||||
this.menuVisible=false |
|
||||
|
|
||||
this.filters.menus=menus; |
|
||||
this.getXmTestCaseExecs(); |
|
||||
}, |
|
||||
clearFiltersMenu(menu){ |
|
||||
var index=this.filters.menus.findIndex(i=>i.menuId==menu.menuId) |
|
||||
this.filters.menus.splice(index,1); |
|
||||
this.getXmTestCaseExecs(); |
|
||||
}, |
|
||||
showBatchEdit: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.filters.selProject ){ |
|
||||
this.$notify({position:'bottom-left',showClose:true,message:"请先选择项目", type: 'warning'}); |
|
||||
nextAction="showBatchEdit" |
|
||||
this.showProjectList(); |
|
||||
return ; |
|
||||
} |
|
||||
this.batchEditVisible=true |
|
||||
}, |
|
||||
batchEditXmTestCaseExec:function(){ |
|
||||
if(this.valueChangeRows.length==0){ |
|
||||
this.$notify({position:'bottom-left',showClose:true,message:"没有改变任何数据,无需保存", type: 'success'}); |
|
||||
return; |
|
||||
}else { |
|
||||
this.load.edit=true; |
|
||||
batchEditXmTestCaseExec(this.valueChangeRows).then(res=>{ |
|
||||
this.load.edit=false; |
|
||||
var tips =res.data.tips; |
|
||||
if(tips.isOk){ |
|
||||
this.valueChangeRows=[] |
|
||||
this.getXmTestCaseExecs(); |
|
||||
} |
|
||||
this.$notify({position:'bottom-left',showClose:true,message: tips.msg, type: tips.isOk?'success':'error'}); |
|
||||
|
|
||||
}).catch(e=>this.load.edit=false); |
|
||||
} |
|
||||
|
|
||||
}, |
|
||||
noBatchEdit(){ |
|
||||
this.batchEditVisible=false; |
|
||||
if(this.valueChangeRows.length>0){ |
|
||||
this.valueChangeRows=[]; |
|
||||
this.getXmTestCaseExecs() |
|
||||
} |
|
||||
|
|
||||
}, |
|
||||
fieldChange:function(row,fieldName){ |
|
||||
|
|
||||
if(this.valueChangeRows.some(i=>i.id==row.id)){ |
|
||||
return; |
|
||||
}else{ |
|
||||
this.valueChangeRows.push(row) |
|
||||
} |
|
||||
}, |
|
||||
|
|
||||
showGroupUsers:function(row){ |
|
||||
this.editForm=row |
|
||||
this.selectUserVisible=true; |
|
||||
}, |
|
||||
clearFiltersExecUser(){ |
|
||||
this.filters.execUser=null; |
|
||||
this.searchXmTestCaseExecs(); |
|
||||
}, |
|
||||
showExecUsersForFilters:function(){ |
|
||||
if(!this.filters.selProject){ |
|
||||
nextAction="showExecUsersForFilters" |
|
||||
this.showProjectList(); |
|
||||
}else{ |
|
||||
this.selectUserForFiltersVisible=true; |
|
||||
} |
|
||||
|
|
||||
}, |
|
||||
onFiltersUserConfirm:function(groupUsers){ |
|
||||
if(groupUsers==null || groupUsers.length==0){ |
|
||||
this.filters.execUser=null |
|
||||
}else{ |
|
||||
this.filters.execUser=groupUsers[0] |
|
||||
} |
|
||||
if(nextAction=="showExecUsersForFilters"){ |
|
||||
nextAction="" |
|
||||
} |
|
||||
this.selectUserForFiltersVisible=false |
|
||||
this.searchXmTestCaseExecs(); |
|
||||
}, |
|
||||
onUserConfirm:function(groupUsers){ |
|
||||
if(groupUsers==null || groupUsers.length==0){ |
|
||||
this.editForm.execUserid="" |
|
||||
this.editForm.execUsername="" |
|
||||
}else{ |
|
||||
var user=groupUsers[0] |
|
||||
this.editForm.execUserid=user.userid |
|
||||
this.editForm.execUsername=user.username |
|
||||
|
|
||||
} |
|
||||
this.fieldChange(this.editForm) |
|
||||
this.selectUserVisible=false |
|
||||
}, |
|
||||
showSelectTask:function(row){ |
|
||||
this.editForm=row |
|
||||
if(this.filters.selProject==null){ |
|
||||
this.$notify({position:'bottom-left',showClose:true,message: "请先选项目", type: 'success' }); |
|
||||
nextAction="showSelectTask" |
|
||||
this.showProjectList(); |
|
||||
|
|
||||
return ; |
|
||||
} |
|
||||
this.selectTaskVisible=true; |
|
||||
}, |
|
||||
onSelectedTask(task){ |
|
||||
this.editForm.taskId=task.id |
|
||||
this.editForm.taskName=task.name |
|
||||
this.fieldChange(this.editForm) |
|
||||
this.selectTaskVisible=false; |
|
||||
}, |
|
||||
showCaseDetail(row){ |
|
||||
this.editForm=row |
|
||||
if(row.caseId){ |
|
||||
var xmTestCase=JSON.parse(JSON.stringify(row)) |
|
||||
xmTestCase.id=xmTestCase.caseId |
|
||||
this.xmTestCase=xmTestCase |
|
||||
this.caseVisible=true; |
|
||||
}else{ |
|
||||
this.$notify.success("该用例已不存在") |
|
||||
} |
|
||||
|
|
||||
}, |
|
||||
showBugs(row){ |
|
||||
this.editForm=row |
|
||||
if(!this.filters.selProject){ |
|
||||
this.$notify({position:'bottom-left',showClose:true,message: "请先选项目", type: 'success' }); |
|
||||
this.showProjectList(); |
|
||||
nextAction="showBugs" |
|
||||
return ; |
|
||||
} |
|
||||
if(row.caseId){ |
|
||||
var xmTestCase=JSON.parse(JSON.stringify(row)) |
|
||||
xmTestCase.id=xmTestCase.caseId |
|
||||
this.xmTestCase=xmTestCase |
|
||||
this.bugsVisible=true; |
|
||||
}else{ |
|
||||
this.$notify.success("该用例已不存在") |
|
||||
} |
|
||||
}, |
|
||||
showAddBug(row){ |
|
||||
this.editForm=row |
|
||||
if(!this.filters.selProject){ |
|
||||
|
|
||||
this.$notify({position:'bottom-left',showClose:true,message: "请先选项目", type: 'success' }); |
|
||||
nextAction="showAddBug" |
|
||||
this.showProjectList(); |
|
||||
return ; |
|
||||
} |
|
||||
if(row.caseId){ |
|
||||
var xmTestCase=JSON.parse(JSON.stringify(row)) |
|
||||
xmTestCase.id=xmTestCase.caseId |
|
||||
this.xmTestCase=xmTestCase |
|
||||
this.addBugVisible=true; |
|
||||
}else{ |
|
||||
this.$notify.success("该用例已不存在") |
|
||||
} |
|
||||
}, |
|
||||
/**end 自定义函数请在上面加**/ |
|
||||
|
|
||||
setFiltersHandlerAsMySelf(){ |
|
||||
this.filters.execUser=this.userInfo; |
|
||||
this.searchXmTestCaseExecs(); |
|
||||
}, |
|
||||
},//end methods |
|
||||
components: { |
|
||||
'xm-test-case-exec-add':XmTestCaseExecAdd, |
|
||||
'xm-test-case-exec-edit':XmTestCaseExecEdit, |
|
||||
XmTestCaseMng,XmProjectSelect,xmMenuSelect,XmGroupMng,XmTaskList,XmTestCaseEdit,XmQuestionMng,XmQuestionAdd, XmGantt,XmProductSelect |
|
||||
//在下面添加其它组件 |
|
||||
}, |
|
||||
|
|
||||
mounted() { |
|
||||
this.filters.selProject=this.selProject; |
|
||||
//this.filters.execUser=this.userInfo; |
|
||||
this.$nextTick(() => { |
|
||||
this.maxTableHeight = util.calcTableMaxHeight(this.$refs.table.$el); |
|
||||
this.getXmTestCaseExecs(); |
|
||||
}); |
|
||||
/** 举例, |
|
||||
initSimpleDicts( "all",["sex","grade"] ).then(res=>{ |
|
||||
if(res.data.tips.isOk){ |
|
||||
this.dicts=res.data.data |
|
||||
} |
|
||||
}); |
|
||||
**/ |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
</script> |
|
||||
|
|
||||
<style lang="scss" scoped> |
|
||||
|
|
||||
.more-label-font{ |
|
||||
text-align:center; |
|
||||
float:left; |
|
||||
padding-top:5px; |
|
||||
} |
|
||||
</style> |
|
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue