diff --git a/src/utils/api.js b/src/utils/api.js index 67e0964..650dd50 100644 --- a/src/utils/api.js +++ b/src/utils/api.js @@ -110,6 +110,7 @@ export default { delCourse: `${host}/nakadai/nakadai/curriculum/delCourse`, //单个、批量删除课程 isShelves: `${host}/nakadai/nakadai/curriculum/isShelves`, //上下架课程 getInternalProjectBySystemId: `${host}/occupationlab/projectManage/getInternalProjectBySystemId`, //根据系统id、项目权限获取系统内置项目 + checkConfig: `${host}/nakadai/nakadai/curriculum/checkConfig`, // 课程章节管理 addChapter: `${host}/nakadai/curriculum/chapter/addChapter`, //添加章节 editChapter: `${host}/nakadai/curriculum/chapter/editChapter`, //修改章节 diff --git a/src/views/serve/projectAdd.vue b/src/views/serve/projectAdd.vue index b67b42a..8ee8b78 100644 --- a/src/views/serve/projectAdd.vue +++ b/src/views/serve/projectAdd.vue @@ -248,6 +248,7 @@ export default { isDel: 0 // 是否删除(0、未删除 1、已删除 默认0) }, projectJudgmentData: [], //实验任务(项目判分点) + oriPer: '', // 原始项目权限,用于保存的时候对比是否有修改该值,如果有,要调另一个接口查询提示 selectedProjectJudgment: [], // 选中的项目判分点 dialogVisible: false, // 选择判分点对话框 @@ -350,6 +351,7 @@ export default { let { projectManage, projectJudgmentVos } = res; this.projectManage = projectManage; this.projectJudgmentData = projectJudgmentVos; + this.oriPer = projectManage.permissions this.projectJudgmentData.forEach((e, i) => { e.sort = i + 1; }); @@ -475,7 +477,14 @@ export default { updateProject(params) { // 更新项目 this.$post(`${this.api.updateProjectManage}`, params).then(res => { if (res.status === 200) { - this.$message.success("更新实验项目成功"); + // 中台创建的项目,并且更改了项目权限,就需要调这个接口 + if (!params.projectManage.founder && this.oriPer !== params.projectManage.permissions) { + this.$get(`${this.api.checkConfig}?projectId=${this.projectId}`).then(res => { + this.$message.success(res.message === 'success' ? '更新实验项目成功' : res.message) + }).catch(err => {}) + } else { + this.$message.success('更新实验项目成功') + } this.$router.back(); } }).catch(err => {