diff --git a/src/store/index.js b/src/store/index.js index db9c688..9d26444 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -7,6 +7,7 @@ export default createStore({ state: { userInfo: {}, projectInfo: {}, + projectError: {}, routerInfo: {} }, getters: {}, @@ -17,6 +18,9 @@ export default createStore({ SET_PROJECT_INFO(state, info) { state.projectInfo = info; }, + SET_PROJECT_ERROR(state,error){ + state.projectError = error; + }, INIT_PROJECT_INFO(state) { if (state.projectInfo.status === -1) { state.projectInfo.stageProcessList.forEach((t) => { @@ -109,6 +113,7 @@ export default createStore({ getProjectInfo(content, { projectId }) { request(PROJECT_PROCESS, { projectId, type: 1 }).then(res => { content.commit("SET_PROJECT_INFO", res.data); + content.commit("SET_PROJECT_ERROR", res); content.commit("INIT_PROJECT_INFO"); }); }, diff --git a/src/views/project/ProjectDetails.vue b/src/views/project/ProjectDetails.vue index 13e4c0d..2045c31 100644 --- a/src/views/project/ProjectDetails.vue +++ b/src/views/project/ProjectDetails.vue @@ -3,8 +3,8 @@
- {{ data.name }} - @@ -13,7 +13,7 @@
-
+
{{ i.stageName }}
@@ -92,11 +92,11 @@ -
{{ data.notice || "暂无公告" }}
+
{{ data?.notice || "暂无公告" }}
-
@@ -125,7 +125,7 @@
- +
@@ -143,9 +143,9 @@
-
-
上次学到:{{ data.lastLearned }}
-
继续学习
+
+
上次学到:{{ data?.lastLearned }}
+
继续学习
@@ -153,7 +153,7 @@
总进度
-
- {{ parseInt((data.totalProgress || 0) * 100) }}% + {{ parseInt((data?.totalProgress || 0) * 100) }}%
@@ -176,7 +176,7 @@
必修进度
-
- {{parseInt(((data.compulsoryProgress || 0) * 100)) }}% + {{parseInt(((data?.compulsoryProgress || 0) * 100)) }}%
@@ -202,7 +202,7 @@
-
+
@@ -212,7 +212,7 @@ - +
@@ -350,7 +350,7 @@