From 6360034221856e36e4d87fe2b018b97f83606304 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=8B=E6=96=87=E8=B6=85?= Date: Tue, 15 Nov 2022 10:19:04 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E5=85=B3=E5=8D=A1=20=E8=B7=AF=E5=BE=84?= =?UTF-8?q?=E5=9B=BE=20=E5=BF=85=E9=80=89=E4=BF=AE=E5=88=87=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/indexTaskadd.js | 3 + src/views/learningpath/LevelAddDetail.vue | 90 ++++++---- src/views/projectcenter/TaskAdd.vue | 193 ++++++++++++---------- 3 files changed, 168 insertions(+), 118 deletions(-) diff --git a/src/api/indexTaskadd.js b/src/api/indexTaskadd.js index ac0f16bf..dc6a6bcb 100644 --- a/src/api/indexTaskadd.js +++ b/src/api/indexTaskadd.js @@ -15,3 +15,6 @@ export const deleteTask = (obj) => http.delete('/admin/project/deleteTask', { pa //新建或编辑项目 export const editProj = (obj) => http.post('/admin/project/edit', obj) + +//路径图里的新建或编辑关卡任务 +export const editTask = (obj) => http.post('/admin/router/editTask', obj) diff --git a/src/views/learningpath/LevelAddDetail.vue b/src/views/learningpath/LevelAddDetail.vue index 81a71774..aea37d17 100644 --- a/src/views/learningpath/LevelAddDetail.vue +++ b/src/views/learningpath/LevelAddDetail.vue @@ -296,7 +296,6 @@ v-model:routerTaskId="routerTaskId" v-model:edit="edit" v-model:EditLiveId="EditLiveId" - />
@@ -319,7 +318,6 @@ v-model:routerTaskId="routerTaskId" v-model:edit="edit" v-model:EditRefId="EditRefId" - />
@@ -342,7 +340,6 @@ v-model:chooseStageId="chooseStageId" v-model:routerTaskId="routerTaskId" v-model:EditDiscussId="EditDiscussId" - />
@@ -584,10 +581,10 @@
- @@ -867,7 +863,7 @@
- + { if (!state.value1) return message.warning("请输入关卡名称"); @@ -1232,7 +1229,7 @@ export default { }; // 作业和考试的抽屉 const showDrawerAddHomework = (id, eleId) => { - console.log("homework==============",id,state.isactive) + console.log("homework==============", id, state.isactive); state.addhomeworkvisible = true; state.EditWorkId = id; state.routerTaskId = eleId; @@ -1253,8 +1250,7 @@ export default { // state.addinvistVisible = true; state.addinvistvisible = true; state.routerTaskId = eleId; - state.EditInvistId =id; - + state.EditInvistId = id; }; const showDrawerAddVote = (id, eleId) => { // state.addhomeworkvisible = true; @@ -1272,7 +1268,7 @@ export default { state.EditRefId = id; state.routerTaskId = eleId; }; - + const showDrawerAddDiscuss = (id, eleId) => { state.adddiscussvisible = true; state.EditDiscussId = id; @@ -1300,6 +1296,10 @@ export default { checked1: element.flag, routerTaskId: element.routerTaskId, courseId: element.courseId, + stageId: element.stageId, + type: element.type, + routerId: element.routerId, + chapterId: element.chapterId, }; array.push(obj); }); @@ -1347,7 +1347,7 @@ export default { const showImpStu = () => { state.AddImpStuvisible = true; }; - + const checkType = (index) => { let typeRules = [ "", @@ -1590,7 +1590,6 @@ export default { }); }; - const closeDeleteModel = () => { state.deleteModal = false; state.deleteID = ""; @@ -1692,7 +1691,6 @@ export default { }); }; - //编辑的按钮 const decideType = (type, id, eleId) => { state.edit = true; @@ -1705,22 +1703,21 @@ export default { showDrawerAddHomework(id, eleId); } else if (type == "考试") { showDrawerAddTest(id, eleId); - }else if (type == "讨论") { + } else if (type == "讨论") { showDrawerAddDiscuss(id, eleId); - }else if (type == "活动") { + } else if (type == "活动") { showDrawerAddActive(id, eleId); - }else if (type == "测评") { - showDrawerAddInvist (id, eleId); - }else if (type == "评估") { - showDrawerAddEval (id, eleId); - } - else if (type == "投票") { + } else if (type == "测评") { + showDrawerAddInvist(id, eleId); + } else if (type == "评估") { + showDrawerAddEval(id, eleId); + } else if (type == "投票") { showDrawerAddVote(id, eleId); } }; //删除关卡 const deleteChapter = (chapterId) => { - console.log('chapterId',chapterId) + console.log("chapterId", chapterId); let obj = { chapterId: chapterId, }; @@ -1733,6 +1730,32 @@ export default { console.log("删除关卡失败", err); }); }; + + const changeCourseType = (ele) => { + console.log("任务id", ele.id); + console.log("flag", ele.checked1); + let obj = { + chapterId: ele.chapterId, + courseId: ele.courseId, + duration: ele.cretime, + flag: ele.checked1, + name: ele.creater, + routerId: ele.routerId, + routerTaskId: ele.routerTaskId, + type: ele.type, + }; + editTask(obj) + .then((res) => { + console.log(`修改状态成功${res.data}`); + message.destroy(); + message.success("修改成功"); + }) + .catch((err) => { + console.log(`修改状态失败${err.data}`); + message.destroy(); + message.warning("修改失败"); + }); + }; return { ...toRefs(state), // tableDataFunc, @@ -1774,6 +1797,7 @@ export default { decideType, updateTableData, deleteChapter, + changeCourseType, }; }, }; diff --git a/src/views/projectcenter/TaskAdd.vue b/src/views/projectcenter/TaskAdd.vue index 0a0cf6a0..9607571d 100644 --- a/src/views/projectcenter/TaskAdd.vue +++ b/src/views/projectcenter/TaskAdd.vue @@ -326,8 +326,8 @@ v-model:chooseStageId="chooseStageId" v-model:projectTaskId="projectTaskId" v-model:EditVoteId="EditVoteId" - v-model:voteId = "voteId" - v-model:ballotId = "ballotId" + v-model:voteId="voteId" + v-model:ballotId="ballotId" />
@@ -495,10 +495,10 @@
{ console.log("获取修改、删除id投票", data); @@ -1554,7 +1555,7 @@ export default { state.projectTaskId = eleId; }; const showDrawerAddVote = (id, eleId) => { - console.log(id, eleId, '95835325932953295325'); + console.log(id, eleId, "95835325932953295325"); state.addvotevisible = true; state.EditVoteId = id; state.projectTaskId = eleId; @@ -1644,8 +1645,31 @@ export default { state.selectRow = array; }; //修改任务的课程类型 id为任务id - const changeCourseType = (id) => { - console.log("任务id", id); + const changeCourseType = (ele) => { + console.log("任务id", ele.id); + console.log("flag", ele.checked1); + let obj = { + courseId: ele.courseId, + duration: ele.cretime == "-" ? 0 : ele.cretime, + flag: ele.checked1, + name: ele.creater, + projectId: ele.projectId, + projectTaskId: ele.id, + stageId: ele.stageId, + type: ele.type, + }; + api + .addTask(obj) + .then((res) => { + console.log(`修改状态成功${res.data}`); + message.destroy(); + message.success("修改成功"); + }) + .catch((err) => { + console.log(`修改状态失败${err.data}`); + message.destroy(); + message.warning("修改失败"); + }); }; //打开测评的弹窗 @@ -1681,10 +1705,10 @@ export default { } }; const showdeAll = () => { - if(state.selectRow.length==0){ - message.destroy() - return message.warning("请选择要删除的任务") - }else{ + if (state.selectRow.length == 0) { + message.destroy(); + return message.warning("请选择要删除的任务"); + } else { state.deAll = true; } }; @@ -1888,75 +1912,74 @@ export default { } } -.name { - width: 78%; - // background-color: lightcoral; - display: flex; - margin-top: 20px; - align-items: center; - //height: 40px; - // border: 1px solid black; - .namebox { - width: 120px; + .name { + width: 78%; + // background-color: lightcoral; display: flex; + margin-top: 20px; align-items: center; - justify-content: flex-end; - flex-shrink: 0; - .nameimg { - width: 10px; - height: 10px; + //height: 40px; + // border: 1px solid black; + .namebox { + width: 120px; + display: flex; + align-items: center; + justify-content: flex-end; + flex-shrink: 0; + .nameimg { + width: 10px; + height: 10px; + } + } + .d { + margin-top: 8px; + font-size: 25px; + color: #ff4e4e; + } + .box { + position: relative; + margin-left: 14px; + .box1 { + position: absolute; + left: 50%; + top: 50%; + width: 50px; + margin-left: -25px; + margin-top: -5px; + border-top: 2px solid rgba(78, 166, 255, 1); + } + .box2 { + position: absolute; + left: 50%; + top: 50%; + height: 50px; + //margin-left: -5px; + margin-top: -25px; + border-left: 2px solid rgba(78, 166, 255, 1); + } + } + .inname { + color: #000000; + font-size: 14px; + margin-left: 7px; + } + .in { + margin-left: 14px; + flex: 1; + // .ant-radio-wrapper { + // } + .ant-input-affix-wrapper { + width: 384px; + border-radius: 8px; + } + .ant-input { + border-radius: 8px; + // height: 120%; + //width: 384px; + height: 30px; + } } } - .d { - margin-top: 8px; - font-size: 25px; - color: #ff4e4e; - } - .box { - position: relative; - margin-left: 14px; - .box1 { - position: absolute; - left: 50%; - top: 50%; - width: 50px; - margin-left: -25px; - margin-top: -5px; - border-top: 2px solid rgba(78, 166, 255, 1); - } - .box2 { - position: absolute; - left: 50%; - top: 50%; - height: 50px; - //margin-left: -5px; - margin-top: -25px; - border-left: 2px solid rgba(78, 166, 255, 1); - } - } - .inname { - color: #000000; - font-size: 14px; - margin-left: 7px; - } - .in { - margin-left: 14px; - flex: 1; - // .ant-radio-wrapper { - // } - .ant-input-affix-wrapper { - width: 384px; - border-radius: 8px; - } - .ant-input { - border-radius: 8px; - // height: 120%; - //width: 384px; - height: 30px; - } - } -} - } .moveModal { .ant-modal {