diff --git a/src/api/index1.js b/src/api/index1.js index cab6920e..16e7ee9d 100644 --- a/src/api/index1.js +++ b/src/api/index1.js @@ -2,7 +2,7 @@ * @Author: lixg lixg@dongwu-inc.com * @Date: 2022-11-04 22:45:31 * @LastEditors: lixg lixg@dongwu-inc.com - * @LastEditTime: 2022-11-07 11:12:01 + * @LastEditTime: 2022-11-06 16:48:50 * @FilePath: /fe-manage/src/api/index1.js * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE */ @@ -72,22 +72,12 @@ export const addStudent = (obj) => http.post('/admin/router/addStudent', obj); //项目基础信息----------------------------------- -//学员获取 -export const getProjectStudent=(obj)=>http.post('/admin/project/studentList',obj) //项目积分榜单 export const scoreRank = (obj) => http.post('/admin/project/scoreRank', obj); -//获取规则 -export const scoreRule=(projectId)=>http.get('/admin/project/scoreRule',{ - params: { - projectId: projectId, - } -}) //排行榜 export const billboard = (obj) => http.post('/admin/project/billboard', obj); - //项目基础信息----------------------------------- - // 测试方法 // import * as api from '../../api/index' // api.getLearnPath({}).then(res => { diff --git a/src/api/indexExternalChain.js b/src/api/indexExternalChain.js index 97005b86..653a5883 100644 --- a/src/api/indexExternalChain.js +++ b/src/api/indexExternalChain.js @@ -15,11 +15,7 @@ export const deleteLink = (obj) => http.post('/link/deleteLink', { params: obj } }) //获取外链详细信息接口 -export const getLink = (obj) => http.post('/link/getOne', obj, { - headers: { - 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8' - } -}) +export const getLink = (obj) => http.post('/link/getOne', { params: obj }) // 更新外链数据 export const updateLinks = (obj) => http.post('/link/updateLinks', obj, { diff --git a/src/api/indexLevel.js b/src/api/indexLevel.js index d23f2206..4cfe5d58 100644 --- a/src/api/indexLevel.js +++ b/src/api/indexLevel.js @@ -4,16 +4,9 @@ import http from "./config"; export const editChapter = (obj) => http.post('/admin/router/editChapter', obj); //编辑关卡 export const updateChapter = (obj) => http.post('/admin/router/editChapter', obj); + //删除任务 export const deleteTask = (obj) => http.delete('/admin/router/deleteTask',{params: obj}); + //移动任务到关卡 export const moveTask = (obj) => http.post('/admin/router/moveTask',obj); -// 学员路径图进度明细(概览) -export const studentProcess = (obj) => http.get(`admin/router/studentProcess?routerId=${obj.routerId}&studentId=${obj.studentId}`); - -// 学员关卡设置 - -// 添加学员 -export const addStudent = (obj) => http.post('/admin/router/addStudent',obj); -// 删除学员 -export const deleteStudent = (obj) => http.post('/admin/router/deleteStudent',obj); diff --git a/src/api/indexWork.js b/src/api/indexWork.js index a571b310..d44b72eb 100644 --- a/src/api/indexWork.js +++ b/src/api/indexWork.js @@ -1,14 +1,18 @@ import http from "./config"; // 创建作业信息接口 -export const createWorkTask = (obj) => http.post('/work/createWorkTask', obj, { - headers: { - 'token': '123' - } +export const createWorkTask = (obj) => http.post('/work/createWorkTask',obj,{ + headers: { + 'token': '123' + } }); // 删除作业信息接口 -export const deleteWorkTask = (obj) => http.post('/work/deleteWorkTask', obj); +export const deleteWorkTask = (obj) => http.post('/work/deleteWorkTask',obj); // 根据ID获取作业信息详情 -export const queryWorkDetailById = (obj) => http.post('/work/queryWorkDetailById', { params: obj }); +export const queryWorkDetailById = (obj) => http.post('/work/queryWorkDetailById',obj,{ + headers: { + 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8' + } +}); // 修改作业信息接口 -export const updateWorkTaskUsing = (obj) => http.post('/work/updateWorkTask', obj); +export const updateWorkTaskUsing = (obj) => http.post('/work/updateWorkTask',obj); diff --git a/src/components/drawers/AddActive.vue b/src/components/drawers/AddActive.vue index 655b7a3f..030878b3 100644 --- a/src/components/drawers/AddActive.vue +++ b/src/components/drawers/AddActive.vue @@ -9,7 +9,8 @@ >
-
添加活动
+
编辑活动
+
添加活动
{ ctx.emit("update:addactiveVisible", false); + ctx.emit("update:edit", false); state.radioV1 = ""; state.inputV1 = ""; state.inputV2 = ""; diff --git a/src/components/drawers/AddDiscuss.vue b/src/components/drawers/AddDiscuss.vue index 90f9f4f7..172e24a6 100644 --- a/src/components/drawers/AddDiscuss.vue +++ b/src/components/drawers/AddDiscuss.vue @@ -126,6 +126,10 @@ export default { chooseStageId: { type: Number, default: null, + }, + editDiscussId: { + type: Number, + default: null, } }, setup(props, ctx) { @@ -161,13 +165,24 @@ export default { createTime: "", //创建时间 createUser: 0, //创建人 discussFlag: "", //活动逻辑删除标识 - discussId: 0, //讨论Id + discussId: props.editDiscussId == null ? 0 : props.editDiscussId, //讨论Id discussTag: "", //是否必修的标识 updateTime: "", //更新时间 updateUser: 0, //更新人 projectId: 0, //项目id }; - api + if(props.edit){ + //console.log("编辑"); + api + .updateDiscuss(obj) + .then((res) => { + console.log("编辑成功", res); + message.success("编辑成功"); + closeDrawer(); + }) + .catch((err) => console.log(err)); + }else{ + api .createDiscuss(obj) .then((res) => { console.log("创建成功", res); @@ -179,7 +194,7 @@ export default { if(props.isStudiscuss){ let editObj1 = { chapterId:props.isactive, - courseId: 0, + courseId: res.data.data.discussId, duration: 0, flag: true, name: obj.discussName, @@ -202,7 +217,7 @@ export default { console.log("项目添加讨论"); apiTask .addTask({ - courseId: 0, + courseId: res.data.data.discussId, duration: 0, flag: true, name: obj.discussName, @@ -227,6 +242,8 @@ export default { .catch((err) => { console.log("创建失败", err); }); + } + }; return { ...toRefs(state), diff --git a/src/components/drawers/AddLive.vue b/src/components/drawers/AddLive.vue index 8c8e4a8b..d7e04481 100644 --- a/src/components/drawers/AddLive.vue +++ b/src/components/drawers/AddLive.vue @@ -10,8 +10,7 @@ >
-
编辑直播
-
添加直播
+
添加直播
{ ctx.emit("update:addliveVisible", false); - ctx.emit("update:isLiveEdit", 1); console.log(props, "props"); state.radioV1 = ""; state.playback = false; @@ -502,7 +567,7 @@ export default { liveStartTime: startTime, liveExplain: state.textV1, liveFlag: "", - liveId: props.EditLiveId == null ? 0 : props.EditLiveId, + liveId: 0, liveLink: state.inputV4, liveName: state.inputV1, livePlayback: "", @@ -516,74 +581,61 @@ export default { updateUser: 0, }; let name = state.inputV1; - if (props.isLiveEdit == 2) { - api - .updateLiveBroadcastMessage(state.obj) - .then((res) => { - console.log("编辑成功", res); - message.success("编辑成功"); - closeDrawer(); - ctx.emit("changeData", false); - }) - .catch((err) => console.log(err)); - } else { - api - .createLiveBroadcast(state.obj) - .then((res) => { - console.log("调用添加直播接口后", res.data.data); - // console.log(state, 2222); - message.success("提交成功"); - closeDrawer(); - //学习路径的创建 - if (props.isStudy == 1) { - console.log("hhhhh", name); - let objj = { - chapterId: props.isactive, - courseId: res.data.data.liveId, + api + .createLiveBroadcast(state.obj) + .then((res) => { + console.log("调用添加直播接口后", res.data.data); + // console.log(state, 2222); + message.success("提交成功"); + closeDrawer(); + + if (props.isStudy == 1) { + console.log("hhhhh", name); + let objj = { + chapterId: 36, + courseId: 0, + duration: state.obj.liveDuration, + flag: true, + name: name, + routerId: 92, + routerTaskId: 0, + type: 6, + }; + RouterEditTask(objj) + .then((res) => { + console.log(res, 11111); + }) + .catch((err) => { + console.log(err, 1111); + }); + } else { + apiTask + .addTask({ + courseId: 0, duration: state.obj.liveDuration, flag: true, - name: name, - routerId: props.routerId, - routerTaskId: 0, + name: state.obj.liveName, + projectId: props.projectId, + projectTaskId: 0, + stageId: props.chooseStageId, type: 6, - }; - RouterEditTask(objj) - .then((res) => { - console.log(res, 11111); - }) - .catch((err) => { - console.log(err, 1111); - }); - } else { - //项目的创建 - apiTask - .addTask({ - courseId: res.data.data.liveId, - duration: state.obj.liveDuration, - flag: true, - name: state.obj.liveName, - projectId: props.projectId, - projectTaskId: 0, - stageId: props.chooseStageId, - type: 6, - }) - .then((res) => { - console.log("调用项目添加接口后", res.data); - //自定义事件给父组件传值 - ctx.emit("changeData", false); - //重新获取任务列表 - // apiTask.getTask({ projectId: 28 }); - // router.push("/taskadd"); - }) - .catch((err) => { - console.log(err); - }); - } - }) - .catch((err) => { - console.log(err, 2222); - }); - } + }) + .then((res) => { + console.log("调用项目添加接口后", res.data); + //自定义事件给父组件传值 + ctx.emit("changeData", false); + //重新获取任务列表 + // apiTask.getTask({ projectId: 28 }); + // router.push("/taskadd"); + }) + .catch((err) => { + console.log(err); + }); + } + }) + .catch((err) => { + console.log(err, 2222); + }); }; return { diff --git a/src/components/drawers/AddRef.vue b/src/components/drawers/AddRef.vue index cca298ae..5e24516f 100644 --- a/src/components/drawers/AddRef.vue +++ b/src/components/drawers/AddRef.vue @@ -8,8 +8,7 @@ >
-
编辑外链
-
添加外链
+
{{ title }}外链
{ console.log(props, 1111); @@ -164,10 +156,10 @@ export default { createTime: "", linkAddress: state.inputV2, linkDescription: state.textV1, - linkFlag: "0", + linkFlag: "", linkId: props.EditRefId == null ? 0 : props.EditRefId, linkName: state.inputV1, - linkTag: "0", + linkTag: "", updateTime: "", updateUser: 0, }; @@ -179,11 +171,9 @@ export default { console.log("编辑成功", res); message.success("编辑成功"); closeDrawer(); - ctx.emit("changeData", false); }) .catch((err) => console.log(err)); } else { - //创建外链 api .createExternalChain(obj) .then((res) => { @@ -193,12 +183,12 @@ export default { //学习路径的创建 if (props.isStudy == 1) { let objj = { - chapterId: props.isactive, - courseId: res.data.data.linkId, + chapterId: 36, + courseId: 0, duration: 0, flag: true, name: obj.linkName, - routerId: props.routerId, + routerId: 92, routerTaskId: 0, type: 7, }; @@ -239,13 +229,10 @@ export default { }); } }; + //不生效 onMounted(() => { - console.log("few"); - // api.getLink({ linkId: props.EditRefId }).then((res) => { - // console.log(res), "获取成功"; - // }); + state.title = props.isRefEdit == 2 ? "编辑" : "添加"; }); - return { ...toRefs(state), afterVisibleChange, @@ -395,4 +382,4 @@ export default { } } } - + \ No newline at end of file diff --git a/src/components/drawers/ProjectScore.vue b/src/components/drawers/ProjectScore.vue index ea35085c..0ba76354 100644 --- a/src/components/drawers/ProjectScore.vue +++ b/src/components/drawers/ProjectScore.vue @@ -9,16 +9,16 @@
姓名:
-
+
搜索
-
+
重置
@@ -367,17 +367,13 @@ export default { activeKeyScore: "2", stuName: "请输入姓名", todayvalue: "1", - + tableDataTotal: 30, stuValue: false, Svisible: false, score1: 5, score2: 5, edit: true, searchRankName:null,//榜单搜索名称 - studentName:null,//学员搜索名称 - pageSize:10, - currentPage:1, - tableDataTotal: -1, }); const getTableData = () => { let datas = state.tabledataStu; @@ -403,59 +399,21 @@ export default { getTableData(); const tabsChange = (e) => { - if (e == 1) { - // console.log('获取项目积分-学员') - getProjectStudent(); - } if (e == 2) { // console.log('获取项目积分-榜单') scoreRank(1, 1); } - if(e==3){ - scoreRule() - } - projectStudentReset() rankReset() state.todayvalue='1' state.stuValue=1 }; - // start -------学员---------------学员------------学员------------------学员--------- - //重置 - const projectStudentReset=()=>{ - state.studentName=null - } - //搜索 - const searchProjectStudent = () => { - state.currentPage=1 - getProjectStudent() - }; - //项目积分榜单 - const getProjectStudent = () => { - console.log("projectId", props.projectId,state.studentName); - let obj = { - projectId:props.projectId, - pageSize:state.pageSize, - pageNo:state.currentPage, - name:state.studentName, - }; - api - .getProjectStudent(obj) - .then((res) => { - console.log("获取项目积分-学员", res); - }) - .catch((err) => { - console.log("获取项目积分-学员", err); - }); - }; - // end -----学员----------------学员----------------------学员-----------学员---------- - - // start -------榜单---------------榜单------------榜单------------------榜单--------- //重置 const rankReset=()=>{ state.searchRankName=null } + // start -------榜单---------------榜单------------榜单------------------榜单--------- //学员积分还是小组积分 const typeChange = (num) => { state.stuValue = num; @@ -491,22 +449,6 @@ export default { }); }; // end -----榜单----------------榜单----------------------榜单-----------榜单---------- - - // start -------获取规则---------------获取规则------------获取规则------------------获取规则--------- - - //获取规则 - const scoreRule = () => { - console.log("projectId", props.projectId); - api - .scoreRule(props.projectId) - .then((res) => { - console.log("获取项目积分-获取规则", res); - }) - .catch((err) => { - console.log("获取项目积分-获取规则", err); - }); - }; - // end -----获取规则----------------获取规则----------------------获取规则-----------获取规则---------- return { ...toRefs(state), typeChange, @@ -514,11 +456,7 @@ export default { searchRank, rankReset, tabsChange, - projectStudentReset, - searchProjectStudent, - getProjectStudent, scoreRank, - scoreRule, }; }, computed: { diff --git a/src/views/learningpath/LevelAdd.vue b/src/views/learningpath/LevelAdd.vue index 81ac30c7..f5708800 100644 --- a/src/views/learningpath/LevelAdd.vue +++ b/src/views/learningpath/LevelAdd.vue @@ -886,7 +886,7 @@