feat:增加学习路径的发布/停用/撤回

This commit is contained in:
李晓鸽
2022-11-02 19:49:34 +08:00
parent 7d54b888ec
commit 8ebd52aaf2
5 changed files with 178 additions and 26 deletions

View File

@@ -43,14 +43,24 @@ export const uploadFile = (obj) => http.post('/test/testRequest', qs.stringify({
export const createLearnPath = (obj) => http.post('/admin/router/edit', obj);
// 获取学习路径图列表
export const getLearnPath = (obj) => http.post('/admin/router/list', obj);
//删除学习路径图
export const deleteLearnPath = (obj) => http.post('/admin/router/handle', obj);
//学习路径图的发布、停用、删除
export const handleLearnPath = (obj) => http.post('/admin/router/handle', obj);
//获取关卡
export const getChapter = (obj) => http.post('/admin/router/detail', { params: obj });
//新建或编辑关卡
export const editChapter = (obj) => http.post('/admin/router/editChapter', obj);
//获取学员列表
export const getStudent = (obj) => http.post('/admin/router/studentList', obj);
//获取路径图详情-包含关卡及任务列表
export const getRouterDetail = (routerId) => http.get('/admin/router/detail', {
params: {
routerId: routerId,
}
});
// 测试方法
// import * as api from '../../api/index'

View File

@@ -49,7 +49,7 @@ export default {
href: "/learningpath",
},
{
name: "关卡",
name: "管理",
},
];
}
@@ -60,7 +60,7 @@ export default {
href: "/learningpath",
},
{
name: "关卡",
name: "管理",
href: "/leveladd",
},
{
@@ -75,7 +75,7 @@ export default {
href: "/learningpath",
},
{
name: "关卡",
name: "管理",
href: "/leveladd",
},
{
@@ -155,7 +155,7 @@ export default {
},
{
name: "查看",
href:"/libraryadd",
href: "/libraryadd",
},
];
}

View File

@@ -398,21 +398,21 @@
</div>
<div class="modalMain">
<div class="projectname">产品经理上升路径</div>
<div class="projecttime">
<!-- <div class="projecttime">
<span class="timeti">路径时间</span
><span class="timeme">2022/08/01-2022/08/30</span>
</div>
</div> -->
<div class="projectbox">
<div class="promessage">
<div class="messageme">路径信息</div>
<div class="messagege">当前路径共0个阶段0个任务</div>
<div class="messagege">当前路径共0个关卡0个任务</div>
</div>
<div class="stumessage">
<div class="messageme1">学员信息</div>
<div class="messagege1">路径共0名学员</div>
<div class="messagege1">路径共{{ routeStudentsNum }}名学员</div>
</div>
</div>
<div class="send">
<!-- <div class="send">
<a-switch v-model:checked="checked" size="small" />
<span class="sendtext">发送路径通知</span>
</div>
@@ -423,10 +423,10 @@
<a-checkbox v-model:checked="checkStu"
><span class="sendpeo">发给学员</span></a-checkbox
>
</div>
</div> -->
<div class="pubtn">
<a-button class="pubtn1" @click="closeModal">取消</a-button>
<a-button class="pubtn2" @click="closeModal">发布</a-button>
<a-button class="pubtn1" @click="closePub">取消</a-button>
<a-button class="pubtn2" @click="releaseLearnPath">发布</a-button>
</div>
</div>
</a-modal>
@@ -481,10 +481,10 @@
</div>
<div class="del_btnbox">
<div class="del_btn btn1">
<div class="btnText" @click="delete_exit">取消</div>
<div class="btnText" @click="closeStopModal">取消</div>
</div>
<div class="del_btn btn2">
<div class="btnText" @click="delete_exit">确定</div>
<div class="btnText" @click="stopLearnPath">确定</div>
</div>
</div>
</div>
@@ -572,10 +572,10 @@
</div>
<div class="del_btnbox">
<div class="del_btn btn1">
<div class="btnText" @click="delete_exit">取消</div>
<div class="btnText" @click="closeBackModal">取消</div>
</div>
<div class="del_btn btn2">
<div class="btnText" @click="delete_exit">确定</div>
<div class="btnText" @click="recallPath">确定</div>
</div>
</div>
</div>
@@ -726,6 +726,11 @@ export default {
searchdate: null, //选择时间
startTime: null, //开始时间
endTime: null, //结束时间
//发布---------------
releasePathId: null, //发布路径id
routeStudentsNum: 0,
recallPathId: null, //撤回路径id
stopPathId: null, //停用路径id
});
const selectProjectName = (value, index) => {
@@ -761,9 +766,58 @@ export default {
console.log(id);
state.learnPathBg2 = id;
};
const showPub = () => {
//发布弹窗
const showPub = (routerId) => {
state.pub = true;
state.releasePathId = routerId;
//获取学员总数
let obj = {
pageNo: 0,
pageSize: 0,
routerId: routerId,
};
api
.getStudent(obj)
.then((res) => {
if (res.status === 200) {
// console.log("res", res.data.data);
state.routeStudentsNum = res.data.data.total;
}
})
.catch((err) => {
console.log("err", err);
});
//获取学习路径详细信息
api
.getRouterDetail(routerId)
.then((res) => {
console.log("学习路径详情", res);
})
.catch((err) => {
console.log("学习路径详情获取错误", err);
});
};
//确定发布
const releaseLearnPath = () => {
// console.log("state.releasePathId", state.releasePathId);
let obj = {
routerId: state.releasePathId,
type: 1,
};
api
.handleLearnPath(obj)
.then((res) => {
console.log("发布成功", res);
message.destroy();
message.success("发布成功");
state.pub = false;
getLearnPath();
})
.catch((err) => {
console.log("发布失败", err);
});
};
const closePub = () => {
state.pub = false;
};
@@ -773,12 +827,34 @@ export default {
const closeCopyModal = () => {
state.copyModal = false;
};
//显示停用窗口
const showStopModal = () => {
state.stopModal = true;
};
//关闭停用窗口
const closeStopModal = () => {
state.stopModal = false;
};
//确认停用
const stopLearnPath = () => {
let obj = {
routerId: state.stopPathId,
type: -1,
};
api
.handleLearnPath(obj)
.then((res) => {
console.log("停用成功", res);
message.destroy();
message.success("停用成功");
state.stopModal = false;
getLearnPath();
})
.catch((err) => {
console.log("停用失败", err);
});
};
const showDeleteModal = () => {
state.deleteModal = true;
};
@@ -792,12 +868,35 @@ export default {
const closeStartModal = () => {
state.startModal = false;
};
const showBackModal = () => {
//打开撤回弹窗
const showBackModal = (routerId) => {
state.backModal = true;
state.recallPathId = routerId;
};
//关闭撤回弹窗
const closeBackModal = () => {
state.backModal = false;
};
//确定撤回
const recallPath = () => {
let obj = {
routerId: state.recallPathId,
type: 0,
};
api
.handleLearnPath(obj)
.then((res) => {
console.log("撤回成功", res);
message.destroy();
message.success("撤回成功");
state.backModal = false;
getLearnPath();
})
.catch((err) => {
console.log("撤回失败", err);
});
};
const showOwner = () => {
state.Ownervisible = true;
};
@@ -913,7 +1012,8 @@ export default {
style="cursor:pointer"
class="jc"
onClick={() => {
showPub();
// console.log("text.record.", text.record);
showPub(text.record.id);
}}
>
发布
@@ -1047,6 +1147,7 @@ export default {
>
<div
onClick={() => {
state.stopPathId = text.record.id;
showStopModal();
}}
>
@@ -1100,7 +1201,7 @@ export default {
>
<div
onClick={() => {
showBackModal();
showBackModal(text.record.id);
}}
>
撤回
@@ -1166,7 +1267,10 @@ export default {
};
//创建学习路径图
const createLearnPath = () => {
if (!state.pathName) return message.warning("请输入路径图名称");
if (!state.pathName) {
message.destroy();
return message.warning("请输入路径图名称");
}
// if (!state.organizationSelectName) return message.warning("请选择归属组织");
// state.createLoading = true;
let obj = {
@@ -1206,7 +1310,7 @@ export default {
.getLearnPath(obj)
.then((res) => {
if (res.status === 200) {
console.log("获取路径列表数据", res.data.data);
// console.log("获取路径列表数据", res.data.data);
let arr = res.data.data.rows;
if (
arr.length === 0 &&
@@ -1237,7 +1341,7 @@ export default {
type: -2,
};
api
.deleteLearnPath(obj)
.handleLearnPath(obj)
.then((res) => {
console.log("删除成功", res);
message.success("删除成功");
@@ -1326,17 +1430,20 @@ export default {
handleOut,
handleOut1,
showPub,
releaseLearnPath,
closePub,
showCopyModal,
closeCopyModal,
showStopModal,
closeStopModal,
stopLearnPath,
showDeleteModal,
closeDeleteModal,
showStartModal,
closeStartModal,
showBackModal,
closeBackModal,
recallPath,
showOwner,
showPower,
tableDataFunc,

View File

@@ -1115,7 +1115,7 @@ export default {
pageSize: 10,
visiblene: false,
sh: false,
nodata: true,
nodata: false,
closeDeleteAll: false,
curLevel: "",
taskSyllabusActive: 0,

View File

@@ -90,6 +90,41 @@ export default {
imageUrl: "",
loading: false,
fileList: [],
voteList: [
{
id: 1,
stem: "题干一", //题干
options: [
{
id: 1,
option: "选项一",
imgUrl: "",
},
{
id: 2,
option: "选项二",
imgUrl: "",
},
],
},
{
id: 2,
stem: "题干二", //题干
options: [
{
id: 1,
option: "选项一",
imgUrl: "",
},
{
id: 2,
option: "选项二",
imgUrl: "",
},
],
},
],
});
const showDrawer = () => {