diff --git a/src/api/index1.js b/src/api/index1.js index 0024073f..e21c301b 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-09 09:32:52 + * @LastEditTime: 2022-11-10 11:41:52 * @FilePath: /fe-manage/src/api/index1.js * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE */ @@ -59,6 +59,7 @@ export const getChapter = (obj) => http.post('/admin/router/detail', { params: o //新建或编辑关卡 export const editChapter = (obj) => http.post('/admin/router/editChapter', obj); + //获取学员列表 export const getStudent = (obj) => http.post('/admin/router/studentList', obj); //获取路径图详情-包含关卡及任务列表 diff --git a/src/api/indexActivity.js b/src/api/indexActivity.js index 8adaca20..9b1c566f 100644 --- a/src/api/indexActivity.js +++ b/src/api/indexActivity.js @@ -1,7 +1,7 @@ import http from "./config"; //获取活动信息接口 -export const getActivity = (obj) => http.get('/activity', { params: obj }); +export const getActivity = (activeId) => http.get(`/activity?activityId=${activeId}`); //创建活动接口 export const createActivity = (obj) => http.post('/activity/createActivity', obj); diff --git a/src/api/indexDiscuss.js b/src/api/indexDiscuss.js index f9e07d46..7d8866ed 100644 --- a/src/api/indexDiscuss.js +++ b/src/api/indexDiscuss.js @@ -5,8 +5,12 @@ import http from "./config"; export const createDiscuss = (obj) => http.post("/discuss/createDiscuss", obj); //获取讨论信息接口 -export const getDiscussDetail = (obj) => http.post('/discuss/getDiscussDetail', obj); - +export const getDiscussDetail = (obj) => http.post('/discuss/getDiscussDetail', obj,{ + headers: { + 'token': '123', + 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8', + } +}) //删除讨论接口 export const deleteDiscuss = (obj) => http.post("/discuss/deleteDiscuss", { params: obj }); diff --git a/src/api/indexExternalChain.js b/src/api/indexExternalChain.js index 6bc219d3..aacc2f8b 100644 --- a/src/api/indexExternalChain.js +++ b/src/api/indexExternalChain.js @@ -15,7 +15,12 @@ export const deleteLink = (obj) => http.post('/link/deleteLink', { params: obj } }) //获取外链详细信息接口 -export const getLink = (obj) => http.post('/link/getOne', obj) +export const getLink = (obj) => http.post('/link/getOne', obj,{ + headers: { + 'token': '123', + 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8', + } +}) // 更新外链数据 export const updateLinks = (obj) => http.post('/link/updateLinks', obj, { diff --git a/src/api/indexLearningPath.js b/src/api/indexLearningPath.js new file mode 100644 index 00000000..f32f7d01 --- /dev/null +++ b/src/api/indexLearningPath.js @@ -0,0 +1,4 @@ +import http from "./config"; + +// 获取路径图概览 +export const getRouterOverview = (routerId) => http.get(`/admin/router/overview?routerId=${routerId}`) \ No newline at end of file diff --git a/src/api/indexLevel.js b/src/api/indexLevel.js index 4cfe5d58..303fe7ea 100644 --- a/src/api/indexLevel.js +++ b/src/api/indexLevel.js @@ -1,10 +1,19 @@ +/* + * @Author: lixg lixg@dongwu-inc.com + * @Date: 2022-11-09 09:26:26 + * @LastEditors: lixg lixg@dongwu-inc.com + * @LastEditTime: 2022-11-10 11:50:08 + * @FilePath: /fe-manage/src/api/indexLevel.js + * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE + */ 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 deleteChapter=(obj)=>http.delete('/admin/router/deleteChapter',{params:obj}) //删除任务 export const deleteTask = (obj) => http.delete('/admin/router/deleteTask',{params: obj}); diff --git a/src/api/indexLibrary.js b/src/api/indexLibrary.js new file mode 100644 index 00000000..a5f8feb2 --- /dev/null +++ b/src/api/indexLibrary.js @@ -0,0 +1,10 @@ +import http from "./config"; + +// 获取模板库列表 +export const templateList = obj => http.post('/admin/project/template/list', obj); + +// 获取模板详情 +export const templateDetail = id => http.get(`/admin/project/template/detail?projectTemplateId=${id}`); + +// 操作模板(撤回,发布,删除) +export const templateHadle = obj => http.post(`/admin/project/template/handle`,obj); \ No newline at end of file diff --git a/src/api/indexProjStu.js b/src/api/indexProjStu.js index 0dc883a6..8d9ddff3 100644 --- a/src/api/indexProjStu.js +++ b/src/api/indexProjStu.js @@ -4,4 +4,16 @@ import http from "./config"; export const getProjStu = (obj) => http.post('/admin/project/studentList', obj) //删除学员 -export const deleteStu = (obj) => http.post('/admin/project/deleteStudent', obj) \ No newline at end of file +export const deleteStu = (obj) => http.post('/admin/project/deleteStudent', obj) + +//获取小组列表 +export const getGroupList = (obj) => http.post('/admin/project/groupList', obj) + +//删除小组 +export const deleteGroup = (obj) => http.delete('/admin/project/deleteGroup', { params: obj }) + +//新增或编辑小组 +export const editGroup = (obj) => http.post('/admin/project/editGroup', obj) + +//查看学员 +export const studentProcess = (obj) => http.get('/admin/project/studentProcess', { params: obj }) \ No newline at end of file diff --git a/src/assets/images/leveladd/delete.png b/src/assets/images/leveladd/delete.png new file mode 100644 index 00000000..bdfeacc1 Binary files /dev/null and b/src/assets/images/leveladd/delete.png differ diff --git a/src/components/Modals/projSet.vue b/src/components/Modals/projSet.vue new file mode 100644 index 00000000..d41a38c6 --- /dev/null +++ b/src/components/Modals/projSet.vue @@ -0,0 +1,457 @@ + + + + + \ No newline at end of file diff --git a/src/components/drawers/AddActive.vue b/src/components/drawers/AddActive.vue index a520aab3..fb0719f1 100644 --- a/src/components/drawers/AddActive.vue +++ b/src/components/drawers/AddActive.vue @@ -9,8 +9,8 @@ >
-
编辑活动
-
添加活动
+ +
{{edit?'编辑':'添加'}}活动
- +
@@ -228,7 +228,7 @@ import * as api from "../../api/indexActivity"; import * as apiTask from "../../api/indexTaskadd"; import { RouterEditTask } from "@/api/indexTask" import { message } from "ant-design-vue"; -import { toDate } from "../../api/method.js"; +import dayjs from 'dayjs'; const rowSelection = ref({ checkStrictly: false, onChange: (selectedRowKeys, selectedRows) => { @@ -254,16 +254,12 @@ export default { type: Boolean, default: false, }, - isStudiscuss: { - type: Boolean, - default: false, - }, - isactive: { + EditActiveId: { type: Number, default: null, }, - routerId: { - type: Number, + edit: { // 是否为编辑 + type: Boolean, default: null, }, projectId: { @@ -274,17 +270,29 @@ export default { type: Number, default: null, }, - edit: { - type: Boolean, - default: false, + routerTaskId: { + type: Number, + default: 0, }, - editActivityId: { + isLevel: { // 是否是关卡页面触发 type: Boolean, - default: false, + default: null, }, - projectTaskId: { - type: Boolean, - default: false, + EditWorkId: { // 要编辑的workId + type: Number, + default: null, + }, + projectTaskId: { // 要编辑的projectId + type: Number, + default: null, + }, + routerId: { + type: Number, + default: null, + }, + isactive: { + type: Number, + default: null, } }, setup(props, ctx) { @@ -314,49 +322,77 @@ export default { state.textV1 = ""; state.textV2 = ""; state.time = ""; + message.success(`${props.edit ? '编辑' : '新增'}关卡任务成功`) + }; + const queryActive = () => { + console.log("props.EditActiveId======",props.EditActiveId,props.chooseStageId,props.routerTaskId); + api.getActivity(props.EditActiveId).then(res => { + console.log('获取讨论信息成功',res.data.data.standardSettings) + + //更新讨论信息 + state.inputV1 = res.data.data.activityName; + state.textV1 = res.data.data.activityNotice; + state.textV2 = res.data.data.activityExplain; + state.inputV2 = res.data.data.activityDuration; + state.inputV3 = res.data.data.activityAddress; + state.inputV5 = res.data.data.afterSignIn; + state.inputV6 =res.data.data.signOutTime; + state.inputV4 = res.data.data.beforeSignIn; + state.radioV1 = Number(res.data.data.standardSettings); + + state.time = [dayjs(res.data.data.activityStartTime, "YYYY-MM-DD"), dayjs(res.data.data.activityEndTime, "YYYY-MM-DD")] + }).catch(err=>{ + console.log('获取讨论信息失败',err) + }) + } const afterVisibleChange = (bool) => { - console.log("state", bool); - console.log("活动ID",props.editActivityId); - console.log("项目中任务ID",props.projectTaskId); - if(bool){ - if(props.isStudiscuss == false){ - if(props.edit){ - //编辑讨论 - console.log("props.editActivityId",props.editActivityId) - let obj = { - activityId: props.editActivityId, - } - api.getActivity(obj).then(res => { - console.log('获取讨论信息成功',res.data.data) - - //更新讨论信息 - state.inputV1 = res.data.data.activityName; - state.textV1 = res.data.data.activityNotice; - state.textV2 = res.data.data.activityExplain; - state.inputV2 = res.data.data.activityDuration; - state.inputV3 = res.data.data.activityAddress; - state.inputV5 = res.data.data.afterSignIn; - state.inputV4 = res.data.data.beforeSignIn; - state.radioV1 = res.data.data.standardSettings; - state.time[0] = res.data.data.activityStartTime; - state.time[1] = res.data.data.activityEndTime; - console.log(state.time[0]) - }).catch(err=>{ - console.log('获取讨论信息失败',err) - }) - - } - } + if(bool && props.edit){ + queryActive(); } + }; const cloradio1 = (value) => { if (value != "") { state.radioV1 = ""; } }; + const updateTask = (res) => { + if(props.isLevel){ + RouterEditTask({ + chapterId:props.isactive, + courseId: res.data.data.activityId, + duration: res.data.data.activityDuration, + name: res.data.data.activityName, + routerId: props.routerId, + routerTaskId: props.routerTaskId ||0, + type: 9, + }).then(res => { + console.log("新增关卡任务成功",res); + + }).catch(err => { + console.log("新增关卡任务失败",err); + }) + }else{ + apiTask.addTask({ + courseId: res.data.data.activityId, + duration: res.data.data.activityDuration, + name: res.data.data.activityName, + projectId: props.projectId, + projectTaskId: props.projectTaskId ||0, + stageId:props.chooseStageId, + type: 9, + }).then((res)=> { + console.log("更新任务列表成功",res); + + }) + .catch((err)=> { + console.log("更新任务列表失败",err); + }) + } + } //创建活动 - const createActivity = () => { + const updateActivityInfo = () => { if(!state.inputV1){ message.destroy(); return message.warning("请输入活动名称"); @@ -377,17 +413,16 @@ export default { message.destroy(); return message.warning("请输入活动地址"); } - let startTime = toDate(new Date(state.time[0].$d).getTime() / 1000, "Y-M-D"); - let endTime = toDate(new Date(state.time[1].$d).getTime() / 1000, "Y-M-D"); + let obj = { activityAddress: state.inputV3, //活动地址 activityDuration: state.inputV2, //活动时长 activityExplain: state.textV2, //活动说明 - activityEndTime: endTime, //活动结束时间 - activityId: 0, //活动ID + activityEndTime: dayjs(state.time[1]).format("YYYY-MM-DD"), //活动结束时间 + activityId: props.edit?props.EditActiveId:0, //活动ID activityName: state.inputV1, //活动名称 activityNotice: state.textV1, //活动公告 - activityStartTime: startTime, //活动开始时间 + activityStartTime:dayjs(state.time[0]).format("YYYY-MM-DD"),//活动开始时间 activityTag: "", //活动逻辑删除标识 afterSignIn: state.inputV5, //活动开始后多少分钟签到 beforeSignIn: state.inputV4, //活动开始前多少分钟签到 @@ -397,67 +432,25 @@ export default { }; if(props.edit){ //更新编辑活动信息 - updateActivity(); + api + .updateActivity(obj) + .then((res) => { + closeDrawer(); + updateTask(res); + ctx.emit("changeData", false); + }) + .catch((err) => { + console.log("更新失败",err); + }) }else{ //新建活动信息 api .createActivity(obj) .then((res) => { - console.log("创建成功", res); message.success("创建成功"); - state.radioV1 = ""; - state.inputV1 = ""; - state.inputV2 = ""; - state.inputV3 = ""; - state.inputV4 = ""; - state.inputV5 = ""; - state.inputV6 = ""; - state.textV1 = ""; - state.textV2 = ""; - state.time = ""; - ctx.emit("update:addactiveVisible", false); - console.log("学习路径",props.isStudiscuss); - if(props.isStudiscuss){ - let editObj1 = { - chapterId:props.isactive, - courseId: 0, - duration: obj.activityDuration, - flag: true, - name: obj.activityName, - routerId: props.routerId, - routerTaskId: 0, - type: 9, - } - RouterEditTask(editObj1).then(res => { - console.log("新增关卡任务成功",res); - closeDrawer(); - }).catch(err => { - console.log("新增关卡任务失败",err); - }) - }else{ - apiTask - .addTask({ - courseId: res.data.data.activityId, - duration: obj.activityDuration, - flag: true, - name: obj.activityName, - projectId: props.projectId, - projectTaskId: 0, - stageId: props.chooseStageId, - type: 9, - }) - .then((res) => { - console.log("调用项目添加接口后", res.data); - ctx.emit("changeData", false); - //重新获取任务列表 - // apiTask.getTask({ projectId: 28 }); - // router.push("/taskadd"); - }) - .catch((err) => { - console.log(err); - }); - } - + closeDrawer(); + updateTask(res); + ctx.emit("changeData", false); }) .catch((err) => { console.log("创建失败",err); @@ -465,40 +458,14 @@ export default { } }; - //更新编辑活动信息 - const updateActivity = (obj) => { - console.log("编辑"); - api.updateActivity(obj) - .then((res) => { - console.log("更新成功",res); - let taskObj = { - courseId: res.data.data.activityId, - duration: obj.activityDuration, - flag: true, - name: obj.activityName, - projectId: props.projectId, - projectTaskId: props.projectTaskId, - stageId: 0, - type: 9, - } - api.updateTask(taskObj).then((res)=> { - console.log("更新任务列表成功",res); - }) - .catch((err)=> { - console.log("更新任务列表失败",err); - }) - }) - .catch((err) => { - console.log("更新失败",err); - }) - }; + return { ...toRefs(state), afterVisibleChange, closeDrawer, rowSelection, cloradio1, - createActivity, + updateActivityInfo, }; }, }; diff --git a/src/components/drawers/AddDiscuss.vue b/src/components/drawers/AddDiscuss.vue index ccaaad30..b2166686 100644 --- a/src/components/drawers/AddDiscuss.vue +++ b/src/components/drawers/AddDiscuss.vue @@ -8,8 +8,7 @@ >
-
编辑讨论
-
添加讨论
+
{{edit?'编辑':'添加'}}讨论
讨论设置:
- 允许评论 + 允许评论
- +
-
- -
+