feat:关卡 路径图 必选修切换

This commit is contained in:
宋文超
2022-11-15 10:19:04 +08:00
parent d362f3db09
commit 6360034221
3 changed files with 168 additions and 118 deletions

View File

@@ -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)

View File

@@ -296,7 +296,6 @@
v-model:routerTaskId="routerTaskId"
v-model:edit="edit"
v-model:EditLiveId="EditLiveId"
/>
</div>
<div class="lin"></div>
@@ -319,7 +318,6 @@
v-model:routerTaskId="routerTaskId"
v-model:edit="edit"
v-model:EditRefId="EditRefId"
/>
</div>
<div class="lin"></div>
@@ -342,7 +340,6 @@
v-model:chooseStageId="chooseStageId"
v-model:routerTaskId="routerTaskId"
v-model:EditDiscussId="EditDiscussId"
/>
</div>
<div class="lin"></div>
@@ -584,10 +581,10 @@
<div class="opacationt clearfix">
<a-switch
style="margin-left: -50px; margin-top: 3px"
:checked="element.checked1"
v-model:checked="element.checked1"
size="small"
active-color="red"
@click="changeCourseType(element.id)"
@click="changeCourseType(element)"
/>
<div class="showt clearfix">
<div
@@ -834,7 +831,6 @@
<!-- 导入学员抽屉 -->
<imp-stu v-model:AddImpStuvisible="AddImpStuvisible" />
<!-- 添加讨论侧弹窗 -->
<!-- 添加活动侧弹窗 -->
<!-- 批量删除学员弹窗 -->
@@ -867,7 +863,7 @@
</div>
</div>
</a-modal>
<!-- 是否确认删除任务弹窗 -->
<!-- 确认删除阶段弹窗 -->
<a-modal
@@ -921,6 +917,7 @@ import { message } from "ant-design-vue";
import { storage } from "../../api/storage";
import { deleteStudyTask } from "../../api/indexStudy";
import draggable from "vuedraggable";
import { editTask } from "../../api/indexTaskadd";
export default {
name: "LevelAddDetail",
components: {
@@ -949,7 +946,7 @@ export default {
name: "默认关卡",
},
],
tableData: [
{
key: 1,
@@ -1150,15 +1147,15 @@ export default {
editID: "", // 要编辑的任务id
EditWorkId: "", // 要编辑的 workid
EditTestId: "",
EditRefId:"",
EditLiveId:"",
EditDiscussId:"",
EditActiveId:"",
EditEvalId:"",
EditInvistId:"",
EditVoteId:"",
EditRefId: "",
EditLiveId: "",
EditDiscussId: "",
EditActiveId: "",
EditEvalId: "",
EditInvistId: "",
EditVoteId: "",
routerTaskId: "",
chapterId:"",
chapterId: "",
stageId: "",
cC: false,
value1: "",
@@ -1181,7 +1178,7 @@ export default {
selectRow: [], //选择行
selectAll: 0, //0未选择1全选2部分选择
});
//新建关卡
const editChapter = () => {
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,
};
},
};

View File

@@ -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"
/>
</div>
<!-- 添加投票侧弹窗 -->
@@ -495,10 +495,10 @@
<div class="opacationt clearfix">
<a-switch
style="margin-left: -50px; margin-top: 3px"
:checked="element.checked1"
v-model:checked="element.checked1"
size="small"
active-color="red"
@click="changeCourseType(element.id)"
@click="changeCourseType(element)"
/>
<div class="showt clearfix">
<div
@@ -951,15 +951,15 @@ export default {
EditRefId: null, //要编辑的外链的id
EditLiveId: null, //要编辑的直播的ids
deAll: false,
EditDiscussId:null,//要编辑的讨论的id
EditActiveId:null,//要编辑的活动id
EditWorkId:null, // 要编辑的作业id
EditTestId: null,// 要编辑的考试id
EditEvalId:null,
EditInvistId:null,
EditDiscussId: null, //要编辑的讨论的id
EditActiveId: null, //要编辑的活动id
EditWorkId: null, // 要编辑的作业id
EditTestId: null, // 要编辑的考试id
EditEvalId: null,
EditInvistId: null,
EditVoteId: null, //编辑需要投票的id
ballotId: "", //编辑需要的题干id
projectTaskId:null, // 要编辑的具体任务id
projectTaskId: null, // 要编辑的具体任务id
projectNameList: [
{
id: 1,
@@ -1192,6 +1192,9 @@ export default {
checked1: value.flag ? true : false,
checked: false, //是否选中类型
courseId: value.courseId,
projectId: value.projectId,
stageId: value.stageId,
type: value.type,
};
array.push(obj);
});
@@ -1382,8 +1385,6 @@ export default {
});
};
//获取修改、删除id投票)
const changeVData = (data) => {
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 {