Browse Source

优化

master
陈裕财 4 years ago
parent
commit
741a9bb5cf
  1. 19
      src/views/xm/core/xmTestCase/XmTestCaseEdit.vue
  2. 6
      src/views/xm/core/xmTestCase/XmTestCaseMng.vue

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

@ -161,12 +161,25 @@ TestStepConfig,
} }
let params={}; let params={};
params['ids']=[row].map(i=>i.id) params['ids']=[row].map(i=>i.id)
if(fieldName=='funcId'){
params[fieldName]=$event.id
params['funcName']=$event.name
}else if(fieldName=='menuId'){
params[fieldName]=$event.menuId
params['menuName']=$event.menuName
}else if(fieldName=='cuserid'){
params[fieldName]=$event.userid
params['cusername']=$event.username
}else{
params[fieldName]=$event
}
params[fieldName]=$event params[fieldName]=$event
var func = editSomeFieldsXmTestCase var func = editSomeFieldsXmTestCase
func(params).then(res=>{ func(params).then(res=>{
let tips = res.data.tips; let tips = res.data.tips;
if(tips.isOk){ if(tips.isOk){
this.editFormBak=[...this.editForm] this.editFormBak=[...this.editForm]
this.$emit('edit-fields',params)
}else{ }else{
Object.assign(this.editForm,this.editFormBak) Object.assign(this.editForm,this.editFormBak)
this.$notify({position:'bottom-left',showClose:true,message:tips.msg,type:tips.isOk?'success':'error'}) this.$notify({position:'bottom-left',showClose:true,message:tips.msg,type:tips.isOk?'success':'error'})
@ -177,11 +190,17 @@ TestStepConfig,
this.editForm.menuId=row.menuId this.editForm.menuId=row.menuId
this.editForm.menuName=row.menuName this.editForm.menuName=row.menuName
this.menuVisible=false; this.menuVisible=false;
if(this.opType!=='add'){
this.editSomeFieldsXmTestCase(this.editForm,'menuId',row)
}
}, },
onFuncSelected(row){ onFuncSelected(row){
this.editForm.funcId=row.id this.editForm.funcId=row.id
this.editForm.funcName=row.name this.editForm.funcName=row.name
this.funcVisible=false; this.funcVisible=false;
if(this.opType!=='add'){
this.editSomeFieldsXmTestCase(this.editForm,'funcId',row)
}
} }
},//end method },//end method
mounted() { mounted() {

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

@ -58,7 +58,7 @@
<el-row> <el-row>
<!--编辑 XmTestCase 测试用例界面--> <!--编辑 XmTestCase 测试用例界面-->
<el-dialog title="编辑测试用例" :visible.sync="editFormVisible" width="60%" top="20px" append-to-body :close-on-click-modal="false"> <el-dialog title="编辑测试用例" :visible.sync="editFormVisible" width="60%" top="20px" append-to-body :close-on-click-modal="false">
<xm-test-case-edit op-type="edit" :xm-test-case="editForm" :visible="editFormVisible" @cancel="editFormVisible=false" @submit="afterEditSubmit"></xm-test-case-edit>
<xm-test-case-edit op-type="edit" :xm-test-case="editForm" :visible="editFormVisible" @cancel="editFormVisible=false" @submit="afterEditSubmit" @edit-fields="onEditFields"></xm-test-case-edit>
</el-dialog> </el-dialog>
<!--新增 XmTestCase 测试用例界面--> <!--新增 XmTestCase 测试用例界面-->
@ -299,6 +299,10 @@ export default {
onXmFuncRowClick(row){ onXmFuncRowClick(row){
this.filters.xmFunc=row this.filters.xmFunc=row
this.searchXmTestCases(); this.searchXmTestCases();
},
onEditFields(params){
Object.assign(this.editForm,params)
this.editFormBak={...this.editForm}
} }
},//end methods },//end methods

Loading…
Cancel
Save