fix:修改学员总数不一致

This commit is contained in:
lixg
2022-12-08 15:24:08 +08:00
parent 84ee457c09
commit a189d96260
4 changed files with 784 additions and 683 deletions

View File

@@ -418,6 +418,10 @@
<a-button class="pubtn2" @click="releaseLearnPath">发布</a-button>
</div>
</div>
<!-- 加载动画 -->
<div class="aeLoading" :style="{ display: pubLoading ? 'flex' : 'none' }">
<a-spin :spinning="pubLoading" />
</div>
</a-modal>
<!-- 复制路径弹窗 -->
<a-modal
@@ -723,6 +727,7 @@ export default {
// learnPathBg: null, //创建路径选择的路径图背景
// learnPathBg2: null, //编辑路径选择的路径图背景
pub: false, //发布弹窗
pubLoading: false, //发布loading
checked: false, //发布弹窗switch
checkedTeacher: false, //发布弹窗勾选
checkStu: false, //发布弹窗勾选
@@ -853,6 +858,7 @@ export default {
const showPub = (router) => {
console.log("router", router);
state.pub = true;
state.pubLoading = true;
state.releasePathId = router.id;
state.releasePathName = router.manager;
api
@@ -860,7 +866,7 @@ export default {
.then((res) => {
console.log("获取关卡、任务、学员统计数据", res.data);
if (res.status === 200) {
state.routeStudentsNum = res.data.students;
// state.routeStudentsNum = res.data.students;
state.routeChapters = res.data.chapters;
state.routeTasks = res.data.tasks;
}
@@ -868,6 +874,24 @@ export default {
.catch((err) => {
console.log("err", err);
});
//获取学员列表
let stuobj = {
pageNo: 1,
pageSize: 10,
routerId: router.id,
};
api
.getStudent(stuobj)
.then((res) => {
console.log("获取学员列表", res.data.data.total);
if (res.data.code === 200) {
state.routeStudentsNum = res.data.data.total;
state.pubLoading = false;
}
})
.catch((err) => {
console.log("获取学员列表失败", err);
});
};
//确定发布
const releaseLearnPath = () => {
@@ -897,6 +921,11 @@ export default {
const closePub = () => {
state.pub = false;
state.releasePathId = null;
state.releasePathName = null;
state.routeChapters = null;
state.routeTasks = null;
state.routeStudentsNum = null;
};
//显示复制窗口
const showCopyModal = () => {
@@ -1544,8 +1573,8 @@ export default {
.getRouterDetail(id)
.then((res) => {
if (res.data.code === 200) {
console.log("获取学习路径详情成功", res.data.data);
let detail = res.data.data.routerInfo;
// console.log("获取详情成功", detail);
state.pathName = detail.name;
state.pathBg = detail.picUrl;
state.pathBgId = "";