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

View File

@@ -1143,6 +1143,10 @@
<a-button class="pubtn2" @click="releaseLearnPath">发布</a-button> <a-button class="pubtn2" @click="releaseLearnPath">发布</a-button>
</div> </div>
</div> </div>
<!-- 加载动画 -->
<div class="aeLoading" :style="{ display: pubLoading ? 'flex' : 'none' }">
<a-spin :spinning="pubLoading" />
</div>
</a-modal> </a-modal>
<!-- 撤回路径弹窗 --> <!-- 撤回路径弹窗 -->
<a-modal <a-modal
@@ -1303,6 +1307,7 @@ export default {
action: null, action: null,
act: null, act: null,
pub: false, //发布弹窗 pub: false, //发布弹窗
pubLoading: false, //发布loading
backModal: false, //撤回弹窗 backModal: false, //撤回弹窗
dcopyModal: false, //复制弹窗 dcopyModal: false, //复制弹窗
closeBack: false, closeBack: false,
@@ -1813,13 +1818,14 @@ export default {
//显示发布弹窗 //显示发布弹窗
const showPub = () => { const showPub = () => {
state.pub = true; state.pub = true;
state.pubLoading = true;
// state.releasePathId = routerId; // state.releasePathId = routerId;
api api
.getLearnCount(state.routerId) .getLearnCount(state.routerId)
.then((res) => { .then((res) => {
if (res.status === 200) { if (res.status === 200) {
// console.log("获取关卡、任务、学员统计数据", res.data); // console.log("获取关卡、任务、学员统计数据", res.data);
state.routeStudentsNum = res.data.students; // state.routeStudentsNum = res.data.students;
state.routeChapters = res.data.chapters; state.routeChapters = res.data.chapters;
state.routeTasks = res.data.tasks; state.routeTasks = res.data.tasks;
} }
@@ -1827,6 +1833,24 @@ export default {
.catch((err) => { .catch((err) => {
console.log("err", err); console.log("err", err);
}); });
//获取学员列表
let stuobj = {
pageNo: 1,
pageSize: 10,
routerId: state.routerId,
};
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 showBackModal = () => { const showBackModal = () => {

File diff suppressed because it is too large Load Diff

View File

@@ -1707,7 +1707,9 @@
<div class="projectbox"> <div class="projectbox">
<div class="promessage"> <div class="promessage">
<div class="messageme">项目信息</div> <div class="messageme">项目信息</div>
<div class="messagege">当前项目共0个阶段0个任务</div> <div class="messagege">
当前项目共{{ projectStages }}个阶段,{{ projectTasks }}个任务
</div>
</div> </div>
<div class="stumessage"> <div class="stumessage">
<div class="messageme1">学员信息</div> <div class="messageme1">学员信息</div>
@@ -1731,6 +1733,13 @@
<a-button class="pubtn2" @click="releaseProject">发布</a-button> <a-button class="pubtn2" @click="releaseProject">发布</a-button>
</div> </div>
</div> </div>
<!-- 加载动画 -->
<div
class="aeLoading"
:style="{ display: projectPubLoading ? 'flex' : 'none' }"
>
<a-spin :spinning="projectPubLoading" />
</div>
</a-modal> </a-modal>
<!-- 撤回弹窗 --> <!-- 撤回弹窗 -->
@@ -2092,7 +2101,10 @@ export default {
action: null, action: null,
act: null, act: null,
projectPub: false, //发布弹窗 projectPub: false, //发布弹窗
projectPubLoading: false, //发布loading
projectStudentsNum: 0, //发布弹窗-学员人数 projectStudentsNum: 0, //发布弹窗-学员人数
projectStages: 0, //发布弹窗-阶段数
projectTasks: 0, //任务数
releaseProjectId: null, //发布的项目id releaseProjectId: null, //发布的项目id
releaseProjectName: null, //发布的项目名称 releaseProjectName: null, //发布的项目名称
releaseProjectTime: null, //发布的项目时间 releaseProjectTime: null, //发布的项目时间
@@ -3893,10 +3905,17 @@ export default {
//打开发布弹窗 //打开发布弹窗
const showProjectPub = () => { const showProjectPub = () => {
state.projectPub = true; state.projectPub = true;
state.projectPubLoading = true;
state.releaseProjectId = state.projectId; state.releaseProjectId = state.projectId;
state.releaseProjectName = state.name; state.releaseProjectName = state.name;
// state.releaseProjectTime = state.startTime; // state.releaseProjectTime = state.startTime;
// console.log("object", object); // console.log("object", object);
apiproj.getProjectCount(state.projectId).then((res) => {
console.log("获取关卡、任务、学员统计数据", res.data);
// state.projectStudentsNum = res.data.students;
state.projectStages = res.data.stages;
state.projectTasks = res.data.tasks;
});
//获取学员总数 //获取学员总数
let obj = { let obj = {
pageNo: 0, pageNo: 0,
@@ -3906,11 +3925,12 @@ export default {
apiproj apiproj
.projectStudent(obj) .projectStudent(obj)
.then((res) => { .then((res) => {
if (res.status === 200) { if (res.data.code === 200) {
// console.log("res", res.data); // console.log("res", res.data);
state.projectStudentsNum = res.data.data.total state.projectStudentsNum = res.data.data.total
? res.data.data.total ? res.data.data.total
: 0; : 0;
state.projectPubLoading = false;
} }
}) })
.catch((err) => { .catch((err) => {