Browse Source

优化

master
陈裕财 3 years ago
parent
commit
f1dd64ea0e
  1. 4
      src/views/xm/core/xmFunc/XmFuncSelect.vue
  2. 2
      src/views/xm/core/xmGroup/XmGroupMng.vue
  3. 2
      src/views/xm/core/xmMenu/XmEpicFeatures.vue
  4. 152
      src/views/xm/core/xmMenu/XmEpicFeaturesSelect.vue
  5. 45
      src/views/xm/core/xmQuestion/XmQuestionEdit.vue
  6. 4
      src/views/xm/core/xmTask/XmPhase.vue
  7. 31
      src/views/xm/core/xmTask/XmPhaseSelect.vue
  8. 6
      src/views/xm/core/xmWorkload/XmWorkloadRecord.vue
  9. 2
      src/views/xm/rpt/testPlan/testDayTimesCalc.vue

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

@ -23,7 +23,7 @@
width="400" width="400"
trigger="hover"> trigger="hover">
<el-button type="primary" @click.stop="showSubAdd( scope.row,scope.$index)" icon="el-icon-plus" title="新建子功能模块" >新建子功能模块 </el-button>
<el-button type="primary" @click.stop="showSubAdd( scope.row,scope.$index)" icon="el-icon-plus" title="新建子模块" >新建子模块 </el-button>
<el-button @click.stop="showEdit( scope.row,scope.$index )" icon="el-icon-edit" title="编辑">编辑</el-button> <el-button @click.stop="showEdit( scope.row,scope.$index )" icon="el-icon-edit" title="编辑">编辑</el-button>
<el-button type="danger" v-loading="load.del" @click="handleDel(scope.row,scope.$index)" icon="el-icon-delete" >删除</el-button> <el-button type="danger" v-loading="load.del" @click="handleDel(scope.row,scope.$index)" icon="el-icon-delete" >删除</el-button>
@ -303,7 +303,7 @@ export default {
}, },
setDatasToCache(datas){ setDatasToCache(datas){
debugger;
if(!this.xmProduct || !this.xmProduct.id){ if(!this.xmProduct || !this.xmProduct.id){
return; return;
} }

2
src/views/xm/core/xmGroup/XmGroupMng.vue

@ -677,7 +677,7 @@ XmTaskExecuserSelect,
if(groupUsers==null||groupUsers.length==0){ if(groupUsers==null||groupUsers.length==0){
return; return;
} }
debugger;
var params=groupUsers.map(i=>{ var params=groupUsers.map(i=>{
var u={ var u={
userid:i.userid, userid:i.userid,

2
src/views/xm/core/xmMenu/XmEpicFeatures.vue

@ -683,7 +683,7 @@
}, },
setDatasToCache(datas){ setDatasToCache(datas){
debugger;
if(!this.filters.product || !this.filters.product.id){ if(!this.filters.product || !this.filters.product.id){
return; return;
} }

152
src/views/xm/core/xmMenu/XmEpicFeaturesSelect.vue

@ -4,7 +4,7 @@
<el-col :span="24" class="padding-left"> <el-col :span="24" class="padding-left">
<el-row > <el-row >
<xm-product-select ref="xmProductSelect1" style="display:inline;" v-if="!xmProduct && !xmIteration" :auto-select="false" :link-project-id="selProject?selProject.id:null" @row-click="onProductSelected" :iterationId="xmIteration?xmIteration.id:null" @clear="onProductClearSelect"></xm-product-select>
<xm-product-select ref="xmProductSelect1" style="display:inline;" v-if="!xmProduct" :auto-select="false" :link-project-id="selProject?selProject.id:null" @row-click="onProductSelected" :iterationId="xmIteration?xmIteration.id:null" @clear="onProductClearSelect"></xm-product-select>
<el-input style="width:120px;" v-model="filters.key" placeholder="名称模糊查询" clearable></el-input> <el-input style="width:120px;" v-model="filters.key" placeholder="名称模糊查询" clearable></el-input>
<el-button icon="el-icon-search" @click="searchXmMenus()"></el-button> <el-button icon="el-icon-search" @click="searchXmMenus()"></el-button>
@ -103,17 +103,14 @@
} }
}, },
watch:{ watch:{
xmIteration:function(){
this.filters.iterationFilterType="join-curr-iteration"
this.filters.iteration=this.xmIteration
},
xmProduct:function(){ xmProduct:function(){
this.filters.product=this.xmProduct this.filters.product=this.xmProduct
}, },
selProject:function(){ selProject:function(){
}, },
toSearchCpd:function(){ toSearchCpd:function(){
this.searchXmMenus();
this.loadDatasFirstCache();
} }
}, },
data() { data() {
@ -208,102 +205,25 @@
this.getXmMenus(); this.getXmMenus();
}, },
getParams(params){ getParams(params){
if(this.filters.mmUser){
params.mmUserid=this.filters.mmUser.userid;
}
if(this.filters.iterationFilterType){
params.iterationFilterType=this.filters.iterationFilterType
if(params.iterationFilterType==='not-join-any-iteration'){
}else if(params.iterationFilterType==='join-any-iteration'){
}else if(params.iterationFilterType==='not-join-curr-iteration'){
params.filterIterationId=this.filters.iteration.id
}else if(params.iterationFilterType==='join-curr-iteration'){
params.filterIterationId=this.filters.iteration.id
}
params.ntype="0"
}else{
if(this.filters.iteration){
params.iterationId=this.filters.iteration.id
}
}
if(this.xmIteration && this.xmIteration.id){
params.linkIterationId=this.xmIteration.id
}
if(this.filters.taskFilterType){
params.taskFilterType=this.filters.taskFilterType
if(params.taskFilterType==='not-join-curr-project'){
params.projectId=this.selProject.id
}
if(params.taskFilterType==='join-curr-project'){
params.projectId=this.selProject.id
}
params.ntype="0"
}
if(this.selProject && this.selProject.id){
params.linkProjectId=this.selProject.id
}
if(this.filters.product){ if(this.filters.product){
params.productId=this.filters.product.id params.productId=this.filters.product.id
} }
if(this.filters.status){
params.status=this.filters.status
}
if(this.filters.dlvl){
params.dlvl=this.filters.dlvl
}
if(this.filters.dtype){
params.dtype=this.filters.dtype
}
if(this.filters.priority){
params.priority=this.filters.priority
}
if(this.filters.source){
params.source=this.filters.source
}
if( this.dateRanger && this.dateRanger.length==2){
params.ctimeStart=this.dateRanger[0]
params.ctimeEnd=this.dateRanger[1]
}
if(this.filters.tags && this.filters.tags.length>0){
params.tagIdList=this.filters.tags.map(i=>i.tagId)
}
if(this.filters.dclasss){ if(this.filters.dclasss){
params.dclasss=this.filters.dclasss params.dclasss=this.filters.dclasss
}
if(this.filters.menuId){
params.menuId=this.filters.menuId
}
if(this.filters.productId){
params.productId=this.filters.productId
}
}
return params; return params;
}, },
// XmMenu xm_project_menu // XmMenu xm_project_menu
getXmMenus() { getXmMenus() {
let params = { let params = {
//pageSize: this.pageInfo.pageSize,
//pageNum: this.pageInfo.pageNum,
//total: this.pageInfo.total,
//count:this.pageInfo.count
pageSize: this.pageInfo.pageSize,
pageNum: this.pageInfo.pageNum,
total: this.pageInfo.total,
count:this.pageInfo.count
}; };
//this.xmMenus=[]
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.product && this.filters.product.id){
params.productId=this.filters.product.id
}
params=this.getParams(params); params=this.getParams(params);
if(!params.productId){ if(!params.productId){
return; return;
@ -314,6 +234,7 @@
this.pageInfo.total = res.data.total; this.pageInfo.total = res.data.total;
this.pageInfo.count=false; this.pageInfo.count=false;
this.xmMenus = res.data.data; this.xmMenus = res.data.data;
this.setDatasToCache(this.xmMenus)
}else{ }else{
this.$notify({position:'bottom-left',showClose:true,message: tips.msg, type: 'error' }); this.$notify({position:'bottom-left',showClose:true,message: tips.msg, type: 'error' });
} }
@ -332,14 +253,13 @@
}, },
onProductSelected:function(product){ onProductSelected:function(product){
this.filters.product=product this.filters.product=product
this.xmMenus=[]
this.getXmMenus()
this.xmMenus=[]
this.loadDatasFirstCache();
this.$emit("product-select",product) this.$emit("product-select",product)
}, },
onProductClearSelect:function(){ onProductClearSelect:function(){
this.filters.product=null this.filters.product=null
this.xmMenus=[]
this.getXmMenus()
this.xmMenus=[]
this.$emit("product-select",null) this.$emit("product-select",null)
}, },
select(row){ select(row){
@ -370,6 +290,34 @@
this.$emit('row-click',null) this.$emit('row-click',null)
this.$refs.table.setCurrentRow(); this.$refs.table.setCurrentRow();
}, },
loadDatasFirstCache(){
if(!this.filters.product || !this.filters.product.id){
return;
}
var key="xm_epic_features_cache_"+this.filters.product.id
var dataStr=sessionStorage.getItem(key)
if(dataStr && dataStr!='null' && dataStr!='undefined'){
this.xmMenus=JSON.parse(dataStr)
this.pageInfo.total=this.xmMenus.length;
}else{
this.getXmMenus();
}
},
setDatasToCache(datas){
if(!this.filters.product || !this.filters.product.id){
return;
}
var key="xm_epic_features_cache_"+this.filters.product.id
if(!datas || datas.length==0){
sessionStorage.removeItem(key)
}else{
sessionStorage.setItem(key,JSON.stringify(datas))
}
}
},//end methods },//end methods
components: { components: {
XmProductSelect, XmProductSelect,
@ -379,18 +327,10 @@
initSimpleDicts("all",['menuStatus','demandSource','demandLvl','demandType','priority','dclass']).then(res=>{ initSimpleDicts("all",['menuStatus','demandSource','demandLvl','demandType','priority','dclass']).then(res=>{
Object.assign(this.dicts,res.data.data) Object.assign(this.dicts,res.data.data)
}) })
this.filters.product=this.xmProduct
if(this.xmIteration && this.xmIteration.id){
this.filters.iterationFilterType='join-curr-iteration'
this.filters.iteration=this.xmIteration
}
this.filters.product=this.xmProduct
this.$nextTick(() => { this.$nextTick(() => {
this.maxTableHeight = util.calcTableMaxHeight(this.$refs.table.$el);
if(this.xmProduct && this.xmProduct.id){
this.getXmMenus();
}
this.maxTableHeight = util.calcTableMaxHeight(this.$refs.table.$el);
this.loadDatasFirstCache();
}); });
} }

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

@ -178,12 +178,9 @@
<el-row style="float:right;" v-if="opType==='add'"> <el-row style="float:right;" v-if="opType==='add'">
<el-button type="primary" @click="saveSubmit">保存</el-button> <el-button type="primary" @click="saveSubmit">保存</el-button>
</el-row> </el-row>
</el-form>
<el-drawer title="选中任务" :visible.sync="selectTaskVisible" size="70%" append-to-body :close-on-click-modal="false">
<xm-task-list v-if="selectTaskVisible" :sel-project="selProject" @task-selected="onSelectedTask"></xm-task-list>
</el-drawer>
</el-form>
<el-drawer append-to-body title="需求选择" :visible.sync="selectMenuVisible" size="60%" :close-on-click-modal="false">
<el-drawer append-to-body title="需求选择" :visible.sync="selectMenuVisible" size="80%" :close-on-click-modal="false">
<xm-menu-select v-if="selectMenuVisible" :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> <xm-menu-select v-if="selectMenuVisible" :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-drawer>
</el-row> </el-row>
@ -192,13 +189,13 @@
</tag-mng> </tag-mng>
</el-drawer> </el-drawer>
<el-dialog append-to-body title="模块选择" :visible.sync="funcVisible" width="60%" top="20px" :close-on-click-modal="false">
<xm-func-select v-if="funcVisible" @row-click="onFuncSelected" :xm-product="editForm.productId?{id:editForm.productId,productName:editForm.productName}:xmProductCpd"></xm-func-select>
<el-dialog append-to-body title="模块选择" :visible.sync="funcVisible" size="40%" top="20px" :close-on-click-modal="false">
<xm-func-select class="padding-left padding-right" v-if="funcVisible" @row-click="onFuncSelected" :xm-product="editForm.productId?{id:editForm.productId,productName:editForm.productName}:xmProductCpd"></xm-func-select>
</el-dialog> </el-dialog>
<el-dialog append-to-body title="执行用例选择" :visible.sync="caseVisible" width="80%" top="20px" :close-on-click-modal="false">
<el-drawer append-to-body title="执行用例选择" :visible.sync="caseVisible" size="80%" top="20px" :close-on-click-modal="false">
<xm-test-plan-case-mng v-if="caseVisible" :select="true" :visible="caseVisible" :xm-project="selProject&&selProject.id?selProject:(editForm.projectId?{id:editForm.projectId}:null)" :xm-test-plan="xmTestPlan" :xm-product="editForm.productId?{id:editForm.productId,productName:editForm.productName}:xmProductCpd" @select="onTestPlanCaseSelected" ></xm-test-plan-case-mng> <xm-test-plan-case-mng v-if="caseVisible" :select="true" :visible="caseVisible" :xm-project="selProject&&selProject.id?selProject:(editForm.projectId?{id:editForm.projectId}:null)" :xm-test-plan="xmTestPlan" :xm-product="editForm.productId?{id:editForm.productId,productName:editForm.productName}:xmProductCpd" @select="onTestPlanCaseSelected" ></xm-test-plan-case-mng>
</el-dialog>
</el-drawer>
</section> </section>
</template> </template>
@ -210,8 +207,7 @@
import AttachmentUpload from "@/views/mdp/arc/archiveAttachment/AttachmentUpload"; // import AttachmentUpload from "@/views/mdp/arc/archiveAttachment/AttachmentUpload"; //
import {sn} from '@/common/js/sequence'; import {sn} from '@/common/js/sequence';
import VueEditor from '@/components/Tinymce/index'; import VueEditor from '@/components/Tinymce/index';
import XmTaskList from '../xmTask/XmTaskList';
import xmMenuSelect from '../xmMenu/XmMenuSelect';
import xmMenuSelect from '../xmMenu/XmMenuSelect';
import XmQuestionHandleMng from '../xmQuestionHandle/XmQuestionHandleMng';// import XmQuestionHandleMng from '../xmQuestionHandle/XmQuestionHandleMng';//
import TagMng from "@/views/mdp/arc/tag/TagMng"; import TagMng from "@/views/mdp/arc/tag/TagMng";
@ -422,30 +418,7 @@
}, },
handleQuestion:function(tardgetBugStatus){ handleQuestion:function(tardgetBugStatus){
this.editSubmit(tardgetBugStatus); this.editSubmit(tardgetBugStatus);
},
showSelectTask:function(){
if(this.selProject==null){
this.$notify({position:'bottom-left',showClose:true,message: "请先选项目", type: 'error' });
return ;
}
this.selectTaskVisible=true;
},
onSelectedTask(task){
if(task.ntype=='1'){
this.$notify({position:'bottom-left',showClose:true,message: "您选择的【"+task.name+"】属于任务集,请重新选择。建议选择树中叶子节点", type: 'error' });
return;
}
this.editForm.taskId=task.id
this.editForm.taskName=task.name
if(!this.editForm.menuId){
this.editForm.menuId=task.menuId
this.editForm.menuName=task.menuName
this.editForm.productId=task.productId
}
this.editForm.handlerUserid=task.executorUserid
this.editForm.handlerUsername=task.executorUsername
this.selectTaskVisible=false;
},
},
handleCloseTaskTag:function(){ handleCloseTaskTag:function(){
this.editForm.taskId='' this.editForm.taskId=''
this.editForm.taskName="" this.editForm.taskName=""
@ -697,7 +670,7 @@
},//end method },//end method
components: { components: {
// 'xm-question-edit':XmQuestionEdit // 'xm-question-edit':XmQuestionEdit
'upload': AttachmentUpload,VueEditor,XmTaskList,xmMenuSelect,XmQuestionHandleMng,TagMng,XmProjectSelect,XmProductSelect,
'upload': AttachmentUpload,VueEditor,xmMenuSelect,XmQuestionHandleMng,TagMng,XmProjectSelect,XmProductSelect,
XmMyDoFocus,XmFuncSelect,MdpSelectUserXm,TestStepConfig,TestStepResult, XmMyDoFocus,XmFuncSelect,MdpSelectUserXm,TestStepConfig,TestStepResult,
xmTestPlanCaseMng:()=>import('../xmTestPlanCase/XmTestPlanCaseSelect'), xmTestPlanCaseMng:()=>import('../xmTestPlanCase/XmTestPlanCaseSelect'),
'xm-workload-record':()=>import("../xmWorkload/XmWorkloadRecord"), 'xm-workload-record':()=>import("../xmWorkload/XmWorkloadRecord"),

4
src/views/xm/core/xmTask/XmPhase.vue

@ -1054,7 +1054,7 @@ export default {
}, },
loadDatasFirstCache(){ loadDatasFirstCache(){
debugger;
if(!this.filters.selProject || !this.filters.selProject.id){ if(!this.filters.selProject || !this.filters.selProject.id){
return; return;
} }
@ -1069,7 +1069,7 @@ export default {
}, },
setDatasToCache(datas){ setDatasToCache(datas){
debugger;
if(!this.filters.selProject || !this.filters.selProject.id){ if(!this.filters.selProject || !this.filters.selProject.id){
return; return;
} }

31
src/views/xm/core/xmTask/XmPhaseSelect.vue

@ -169,7 +169,7 @@ export default {
xmIteration: function () { xmIteration: function () {
}, },
toSearchCpd:function(){ toSearchCpd:function(){
this.searchXmTasks();
this.loadDatasFromCache();
} }
}, },
data() { data() {
@ -417,6 +417,35 @@ export default {
} }
}, },
loadDatasFirstCache(){
if(!this.filters.selProject || !this.filters.selProject.id){
return;
}
var key="xm_phase_cache_"+this.filters.selProject.id
var dataStr=sessionStorage.getItem(key)
if(dataStr && dataStr!='null' && dataStr!='undefined'){
this.xmTasks=JSON.parse(dataStr)
this.pageInfo.total=this.xmTasks.length;
}else{
this.getXmTasks()
}
},
setDatasToCache(datas){
if(!this.filters.selProject || !this.filters.selProject.id){
return;
}
var key="xm_phase_cache_"+this.filters.selProject.id
if(!datas || datas.length==0){
sessionStorage.removeItem(key)
}else{
sessionStorage.setItem(key,JSON.stringify(datas))
}
}
}, //end methods }, //end methods
components: { components: {
XmProjectSelect, XmProjectSelect,

6
src/views/xm/core/xmWorkload/XmWorkloadRecord.vue

@ -67,7 +67,7 @@
computed: { computed: {
...mapGetters([ 'userInfo' ]), ...mapGetters([ 'userInfo' ]),
initVal(){ initVal(){
debugger;
var params={} var params={}
if( this.xmTask && this.xmTask.id){ if( this.xmTask && this.xmTask.id){
params.id=this.xmTask.id params.id=this.xmTask.id
@ -157,7 +157,7 @@
saveSubmit: function () { saveSubmit: function () {
}, },
initData: function(){ initData: function(){
debugger;
this.editForm=Object.assign({},this.initVal) this.editForm=Object.assign({},this.initVal)
this.editFormBak=Object.assign({},this.editForm) this.editFormBak=Object.assign({},this.editForm)
}, },
@ -165,7 +165,7 @@
editSomeFields(row,fieldName,$event){ editSomeFields(row,fieldName,$event){
debugger;
var func=null; var func=null;
var emit="edit-some-fields" var emit="edit-some-fields"
var params={ids:[row.id]}; var params={ids:[row.id]};

2
src/views/xm/rpt/testPlan/testDayTimesCalc.vue

@ -265,7 +265,7 @@
}, },
onXmTestPlanSelected(xmTestPlan){ onXmTestPlanSelected(xmTestPlan){
debugger;
this.filters.testPlan=xmTestPlan this.filters.testPlan=xmTestPlan
}, },

Loading…
Cancel
Save