if(this.DEV.currentPathInfo.subprojectType == 98 || this.DEV.currentPathInfo.subprojectType == 99 || this.DEV.currentPathInfo.subprojectType == 2002) {
// list view search
let tempData = [];
let queryParam = {
"ShowStoryOption": 0,
"ShowAll": false,
"GetCount": true,
"PageSize": pageSize,
"PageIndex": 1,
"SortFieldId":0,
"Condition": {
"TaskId": "",
"Keyword": searchValue,
"Subproject": {
"SubIds": [subProjectId],
"IncludeChildren": true,
"IncludeClosed": true,
"IncludeBacklog": false
},
"Status": statusArr,
"Owner": ownerArr
},
"ProjectId": projectId,
"FieldIds": [601,101,108,104,606,607,620,621]
};
var queryTask = DevTrackApi + 'Task/Query';
this.axios.post(queryTask,queryParam).then(res=>{
if(res.data.Data.Tasks != undefined && res.data.Data.Tasks.length >0) {
var tasks = res.data.Data.Tasks;
this.DEV.taskTotal = res.data.Data.Total;
tasks.forEach(task =>{
let totalTime = 0,percent=0;
let timeSpent = Number(task.Values[6].Value.replace(/\D/,' '));
let timeRemain = Number(task.Values[7].Value.replace(/\D/,' '));
totalTime = timeSpent + timeRemain;
if (totalTime !== 0) {
percent = (timeSpent/totalTime).toFixed(2)*100;
}else {
percent = 0;
};
let taskObj = {
"ID":task.ItemId.Id,
"Title":task.Values[1].Value,
"Status":task.Values[0].Value,
"Assigned To":task.Values[2].Value,
"Priority":task.Values[3].Value,
"Percent": percent
};
tempData.push(taskObj)
})
this.changeDevListData(tempData);
}else {
// no task
this.changeDevListData(tempData);
}
},err=>{
console.log(err)
})
}else if(this.DEV.currentPathInfo.subprojectType == 33){
// search in backlog
this.getDevelopBackLogTask();
}else {
// query task according
var devOption = this.DEV.devOption;
let param = {
searchValue: searchValue,
ownerArr: ownerArr,
statusArr:statusArr
};
switch(devOption) {
case 0:
_this.getBoardViewTask();
break;
case 1:
_this.getColumnLeadingTasks(param);
break;
case 2:
_this.getBoardViewTask();
break;
case 3:
_this.getColumnLeadingTasks(param);
break;
case 4:
_this.getDevelopGroupSetting(param);
break;
case 5:
_this.getDevelopGroupSetting(param);
break;
case 6:
_this.getDevelopGroupSetting(param);
break;
case 7:
_this.getDevelopGroupSetting(param);
break;
case 8:
_this.getDevSatusGroupTasks();
break;
case 9:
_this.getDevSatusGroupTasks();
break;
case 10:
_this.getDevSatusGroupTasks();
break;
case 11:
_this.getDevSatusGroupTasks();
break;
case 12:
_this.getDevelopGroupSetting(param);
break;
case 13:
_this.getDevelopGroupSetting(param);
break;
case 14:
_this.getDevelopGroupSetting(param);
break;
case 15:
_this.getDevelopGroupSetting(param);
break;
case 18:
_this.getDevelopGroupSetting(param);
break;
case 19:
_this.developAllGetTask(param);
break;
}
}
//请自行将这段代码封装成一个function