From 8ebd52aaf28319a57e2b129b8b9aa035988e7e9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E6=99=93=E9=B8=BD?= Date: Wed, 2 Nov 2022 19:49:34 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E5=A2=9E=E5=8A=A0=E5=AD=A6=E4=B9=A0?= =?UTF-8?q?=E8=B7=AF=E5=BE=84=E7=9A=84=E5=8F=91=E5=B8=83/=E5=81=9C?= =?UTF-8?q?=E7=94=A8/=E6=92=A4=E5=9B=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/index1.js | 14 ++- src/components/BreadCrumb.vue | 8 +- src/views/learningpath/LearningPath.vue | 145 ++++++++++++++++++++---- src/views/learningpath/LevelAdd.vue | 2 +- src/views/system/SystemManage.vue | 35 ++++++ 5 files changed, 178 insertions(+), 26 deletions(-) diff --git a/src/api/index1.js b/src/api/index1.js index 34e6f565..1b315788 100644 --- a/src/api/index1.js +++ b/src/api/index1.js @@ -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' diff --git a/src/components/BreadCrumb.vue b/src/components/BreadCrumb.vue index 1229413b..3124ba72 100644 --- a/src/components/BreadCrumb.vue +++ b/src/components/BreadCrumb.vue @@ -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", }, ]; } diff --git a/src/views/learningpath/LearningPath.vue b/src/views/learningpath/LearningPath.vue index f18a3419..6a8dc79f 100644 --- a/src/views/learningpath/LearningPath.vue +++ b/src/views/learningpath/LearningPath.vue @@ -398,21 +398,21 @@
产品经理上升路径
-
+
路径信息
-
当前路径共0个阶段,0个任务
+
当前路径共0个关卡,0个任务
学员信息
-
路径共0名学员
+
路径共{{ routeStudentsNum }}名学员
-
+
- 取消 - 发布 + 取消 + 发布
@@ -481,10 +481,10 @@
-
取消
+
取消
-
确定
+
确定
@@ -572,10 +572,10 @@
-
取消
+
取消
-
确定
+
确定
@@ -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 { >
{ + state.stopPathId = text.record.id; showStopModal(); }} > @@ -1100,7 +1201,7 @@ export default { >
{ - 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, diff --git a/src/views/learningpath/LevelAdd.vue b/src/views/learningpath/LevelAdd.vue index 0c0c09ba..9558cdd0 100644 --- a/src/views/learningpath/LevelAdd.vue +++ b/src/views/learningpath/LevelAdd.vue @@ -1115,7 +1115,7 @@ export default { pageSize: 10, visiblene: false, sh: false, - nodata: true, + nodata: false, closeDeleteAll: false, curLevel: "", taskSyllabusActive: 0, diff --git a/src/views/system/SystemManage.vue b/src/views/system/SystemManage.vue index 9f5e3800..12d39867 100644 --- a/src/views/system/SystemManage.vue +++ b/src/views/system/SystemManage.vue @@ -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 = () => {