perf: 优化工作流获取

This commit is contained in:
kuaifan 2025-03-17 20:31:30 +08:00
parent ee6cf05a92
commit cc97d9f1ea
2 changed files with 7 additions and 3 deletions

View File

@ -2307,8 +2307,8 @@ class ProjectController extends AbstractController
* @apiGroup project
* @apiName task__flow
*
* @apiParam {Number} task_id 任务ID
* @apiParam {Number} project_id 项目ID - 存在时只返回这个项目的
* @apiParam {Number} [task_id] 任务ID
* @apiParam {Number} [project_id] 项目ID存在时只返回这个项目的工作流主要用于任务移动到其他项目时
*
* @apiSuccess {Number} ret 返回状态码1正确、0错误
* @apiSuccess {String} msg 返回信息(错误描述)

View File

@ -137,7 +137,11 @@ export default {
},
flow() {
return this.taskFlows.find(({task_id}) => task_id == this.task.id);
const item = this.taskFlows.find(({task_id}) => task_id == this.task.id);
if (item) {
return item;
}
return this.taskFlows.find(({flow_item_id}) => flow_item_id == this.task.flow_item_id);
},
turns() {