From 2f0ee1649d839036fda5e52eba07e90c17bf4107 Mon Sep 17 00:00:00 2001 From: zhangsir Date: Tue, 28 May 2024 09:03:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86=E6=95=B0=E6=8D=AE=E4=B8=BAnu?= =?UTF-8?q?ll=E7=9A=84=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/index.js | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/store/index.js b/src/store/index.js index 5969bd9..7a43d3c 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -27,12 +27,7 @@ export default createStore({ } if (state.projectInfo.unlockMode === 1) { state.projectInfo.stageProcessList.forEach((t) => { - if(t.studyModel == 0){ - t.statusName = "进行中"; - t.taskProcessList?.forEach((s) => s.statusName = (s.status === 1) ? "已完成" : s.status === 2 ? (s.statusName = "进行中") : TASK_TYPES.toName[s.type]); - t.taskProcessList?.every((s) => s.status === 1) && (t.statusName = "已完成"); - } - else{ + if(t.studyModel == 1){ state.projectInfo.stageProcessList?.forEach((t1) => { t1.statusName = "已完成"; const stageState = t1.taskProcessList?.some((s) => { @@ -45,11 +40,28 @@ export default createStore({ return stageState; }); } + else{ + t.statusName = "进行中"; + t.taskProcessList?.forEach((s) => s.statusName = (s.status === 1) ? "已完成" : s.status === 2 ? (s.statusName = "进行中") : TASK_TYPES.toName[s.type]); + t.taskProcessList?.every((s) => s.status === 1) && (t.statusName = "已完成"); + } }); return; } state.projectInfo.stageProcessList.filter(i => i.id != 0).forEach((item,i)=>{ - if(item.studyModel == 0){ + if(item.studyModel == 1){ + state.projectInfo.stageProcessList?.some((t) => { + t.statusName = "已完成"; + const stageState = t.taskProcessList?.some((s) => { + s.unlock = true; + s.statusName = "已完成"; + s.status !== 1 && (s.statusName = s.status==2? '进行中' : TASK_TYPES.toName[s.type]) + return state.projectInfo.unlockMode === 2 ? s.status !== 1 : (s.status !== 1 && s.flag) + }); + stageState && (t.statusName = "进行中"); + return stageState; + }); + }else{ if(i == 0){ item.statusName = "进行中"; item.taskProcessList?.forEach((s) => s.statusName = (s.status === 1) ? "已完成" : s.status === 2 ? (s.statusName = "进行中") : TASK_TYPES.toName[s.type]); @@ -64,18 +76,6 @@ export default createStore({ item.statusName = "未解锁"; } } - }else{ - state.projectInfo.stageProcessList?.some((t) => { - t.statusName = "已完成"; - const stageState = t.taskProcessList?.some((s) => { - s.unlock = true; - s.statusName = "已完成"; - s.status !== 1 && (s.statusName = s.status==2? '进行中' : TASK_TYPES.toName[s.type]) - return state.projectInfo.unlockMode === 2 ? s.status !== 1 : (s.status !== 1 && s.flag) - }); - stageState && (t.statusName = "进行中"); - return stageState; - }); } }) },