diff --git a/src/api/indexExternalChain.js b/src/api/indexExternalChain.js index 653a5883..97005b86 100644 --- a/src/api/indexExternalChain.js +++ b/src/api/indexExternalChain.js @@ -15,7 +15,11 @@ export const deleteLink = (obj) => http.post('/link/deleteLink', { params: obj } }) //获取外链详细信息接口 -export const getLink = (obj) => http.post('/link/getOne', { params: obj }) +export const getLink = (obj) => http.post('/link/getOne', obj, { + headers: { + 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8' + } +}) // 更新外链数据 export const updateLinks = (obj) => http.post('/link/updateLinks', obj, { diff --git a/src/api/indexStudy.js b/src/api/indexStudy.js new file mode 100644 index 00000000..d948affb --- /dev/null +++ b/src/api/indexStudy.js @@ -0,0 +1,3 @@ +import http from "./config"; +//路径图删除任务 +export const deleteStudyTask = (obj) => http.delete('/admin/router/deleteTask', { params: obj }) \ No newline at end of file diff --git a/src/api/indexWork.js b/src/api/indexWork.js index d44b72eb..a571b310 100644 --- a/src/api/indexWork.js +++ b/src/api/indexWork.js @@ -1,18 +1,14 @@ 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',obj,{ - headers: { - 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8' - } -}); +export const queryWorkDetailById = (obj) => http.post('/work/queryWorkDetailById', { params: obj }); // 修改作业信息接口 -export const updateWorkTaskUsing = (obj) => http.post('/work/updateWorkTask',obj); +export const updateWorkTaskUsing = (obj) => http.post('/work/updateWorkTask', obj); diff --git a/src/components/drawers/AddLive.vue b/src/components/drawers/AddLive.vue index d7e04481..8c8e4a8b 100644 --- a/src/components/drawers/AddLive.vue +++ b/src/components/drawers/AddLive.vue @@ -10,7 +10,8 @@ >
-
添加直播
+
编辑直播
+
添加直播
{ ctx.emit("update:addliveVisible", false); + ctx.emit("update:isLiveEdit", 1); console.log(props, "props"); state.radioV1 = ""; state.playback = false; @@ -567,7 +502,7 @@ export default { liveStartTime: startTime, liveExplain: state.textV1, liveFlag: "", - liveId: 0, + liveId: props.EditLiveId == null ? 0 : props.EditLiveId, liveLink: state.inputV4, liveName: state.inputV1, livePlayback: "", @@ -581,61 +516,74 @@ export default { updateUser: 0, }; let name = state.inputV1; - 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, + 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, duration: state.obj.liveDuration, flag: true, - name: state.obj.liveName, - projectId: props.projectId, - projectTaskId: 0, - stageId: props.chooseStageId, + name: name, + routerId: props.routerId, + routerTaskId: 0, 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); - }); + }; + 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); + }); + } }; return { diff --git a/src/components/drawers/AddRef.vue b/src/components/drawers/AddRef.vue index 3b049523..cca298ae 100644 --- a/src/components/drawers/AddRef.vue +++ b/src/components/drawers/AddRef.vue @@ -8,7 +8,8 @@ >
-
{{ title }}外链
+
编辑外链
+
添加外链
{ console.log(props, 1111); @@ -156,10 +164,10 @@ export default { createTime: "", linkAddress: state.inputV2, linkDescription: state.textV1, - linkFlag: "", + linkFlag: "0", linkId: props.EditRefId == null ? 0 : props.EditRefId, linkName: state.inputV1, - linkTag: "", + linkTag: "0", updateTime: "", updateUser: 0, }; @@ -171,9 +179,11 @@ export default { console.log("编辑成功", res); message.success("编辑成功"); closeDrawer(); + ctx.emit("changeData", false); }) .catch((err) => console.log(err)); } else { + //创建外链 api .createExternalChain(obj) .then((res) => { @@ -183,12 +193,12 @@ export default { //学习路径的创建 if (props.isStudy == 1) { let objj = { - chapterId: 36, - courseId: 0, + chapterId: props.isactive, + courseId: res.data.data.linkId, duration: 0, flag: true, name: obj.linkName, - routerId: 92, + routerId: props.routerId, routerTaskId: 0, type: 7, }; @@ -229,10 +239,13 @@ export default { }); } }; - //不生效 onMounted(() => { - state.title = props.isRefEdit == 2 ? "编辑" : "添加"; + console.log("few"); + // api.getLink({ linkId: props.EditRefId }).then((res) => { + // console.log(res), "获取成功"; + // }); }); + return { ...toRefs(state), afterVisibleChange, diff --git a/src/views/learningpath/LevelAddDetail.vue b/src/views/learningpath/LevelAddDetail.vue index e483883d..d53b8154 100644 --- a/src/views/learningpath/LevelAddDetail.vue +++ b/src/views/learningpath/LevelAddDetail.vue @@ -504,7 +504,7 @@ 删除 @@ -778,9 +778,16 @@ - + { state.AddImpStuvisible = true; }; - const tableDataFunc = () => { - const columns = [ - { - title: "类型", - dataIndex: "state", - // width: "30%", - key: "state", - width: 60, - align: "left", - className: "classify", - scopedSlots: { customRender: "action" }, //引入的插槽 - customRender: (text) => { - // console.log(text.record.checked1); - return ( -
-
{ - console.log("点击了"); - }} - >
- {text.record.lei} - - {/** -
- - {text.record.lei} - -*/} -
- ); - }, - }, - { - title: "任务名称", - dataIndex: "creater", - // width: "30%", - key: "creater", - width: 200, - align: "center", - className: "h", - }, - { - title: "必修/选修", - dataIndex: "pubtime", - key: "pubtime", - // width: 100, - align: "center", - className: "h", - scopedSlots: { customRender: "action" }, //引入的插槽 - customRender: (text) => { - // console.log(text.record.checked1); - return ( -
-
- { - console.log("点击了"); - text.record.checked1 = !text.record.checked1; - }} - /> -
-
- 必修 -
-
选修
-
-
-
- ); - }, - }, - { - title: "时长", - dataIndex: "cretime", - key: "cretime", - // width: 100, - align: "center", - className: "h", - }, - { - title: "操作", - className: "h", - dataIndex: "opacation", - key: "opacation", - // width: 100, - align: "center", - scopedSlots: { customRender: "action" }, //引入的插槽 - customRender: (e) => { - return ( -
-
- { - console.log("编辑id", e.record.routerTaskId); - console.log("编辑类型", e.record.lei); - state.editID = e.record.routerTaskId; - //state.addhomeworkvisible = true; - }} - > - 编辑 - - { - showDeleteModal(e.record.routerTaskId); - }} - > - 删除 - -
-
- ); - }, - }, - ]; - return columns; - }; + // const tableDataFunc = () => { + // const columns = [ + // { + // title: "类型", + // dataIndex: "state", + // // width: "30%", + // key: "state", + // width: 60, + // align: "left", + // className: "classify", + // scopedSlots: { customRender: "action" }, //引入的插槽 + // customRender: (text) => { + // // console.log(text.record.checked1); + // return ( + //
+ //
{ + // console.log("点击了"); + // }} + // >
+ // {text.record.lei} + //
+ // ); + // }, + // }, + // { + // title: "任务名称", + // dataIndex: "creater", + // // width: "30%", + // key: "creater", + // width: 200, + // align: "center", + // className: "h", + // }, + // { + // title: "必修/选修", + // dataIndex: "pubtime", + // key: "pubtime", + // // width: 100, + // align: "center", + // className: "h", + // scopedSlots: { customRender: "action" }, //引入的插槽 + // customRender: (text) => { + // // console.log(text.record.checked1); + // return ( + //
+ //
+ // { + // console.log("点击了"); + // text.record.checked1 = !text.record.checked1; + // }} + // /> + //
+ //
+ // 必修 + //
+ //
选修
+ //
+ //
+ //
+ // ); + // }, + // }, + // { + // title: "时长", + // dataIndex: "cretime", + // key: "cretime", + // // width: 100, + // align: "center", + // className: "h", + // }, + // { + // title: "操作", + // className: "h", + // dataIndex: "opacation", + // key: "opacation", + // // width: 100, + // align: "center", + // scopedSlots: { customRender: "action" }, //引入的插槽 + // customRender: (e) => { + // return ( + //
+ //
+ // { + // console.log("编辑id", e.record.routerTaskId); + // console.log("编辑类型", e.record.lei); + // state.editID = e.record.routerTaskId; + // //state.addhomeworkvisible = true; + // }} + // > + // 编辑 + // + // { + // showDeleteModal(e.record.routerTaskId); + // }} + // > + // 删除 + // + //
+ //
+ // ); + // }, + // }, + // ]; + // return columns; + // }; const checkType = (index) => { let typeRules = [ "", @@ -1381,13 +1383,6 @@ export default { return (
{text.record.name} - - {/** -
- - {text.record.lei} - -*/}
); }, @@ -1558,9 +1553,9 @@ export default { }); const changebgc = (chapterId) => { state.isactive = chapterId; - state.selectRow = [] //选择行 - state.selectAll = 0 //0:未选择,1:全选,2:部分选择 - dataAssignment(chapterId); + state.selectRow = []; //选择行 + state.selectAll = 0; //0:未选择,1:全选,2:部分选择 + dataAssignment(chapterId); }; const gqxy_hShow = () => { state.gqxy_hs = !state.gqxy_hs; @@ -1574,6 +1569,7 @@ export default { }; const showDeleteModal = (id) => { state.deleteID = id; + console.log(id); state.deleteModal = true; }; const closeConfirm = () => { @@ -1582,14 +1578,17 @@ export default { state.editID = ""; }; const deleteLevelTask = () => { - RouterDeleteTask(state.listChoosedId) - .then((res) => { - console.log(`删除成功${res}`); - message.success("删除成功"); - }) - .catch((err) => { - console.log(`删除失败${err}`); - }); + deleteStudyTask({ routerTaskIds: state.deleteID }).then((res) => + console.log("删除成功", res) + ); + // RouterDeleteTask(state.listChoosedId) + // .then((res) => { + // console.log(`删除成功${res}`); + // message.success("删除成功"); + // }) + // .catch((err) => { + // console.log(`删除失败${err}`); + // }); }; const showDrawerAddLive = () => { @@ -1663,50 +1662,50 @@ export default { //批量删除任务 const deletecTaskAll = () => { let arr = state.selectRow; - console.log("选择的行信息",arr); - arr.map( value => { + console.log("选择的行信息", arr); + arr.map((value) => { let obj = { routerTaskIds: value, - } - console.log("value",value); + }; + console.log("value", value); api - .deleteTask(obj) - .then((res) => { - console.log(res); - message.destroy(); - message.success("批量删除成功"); - }) - .catch((err) => { - console.log(err); - }); - }) - } + .deleteTask(obj) + .then((res) => { + console.log(res); + message.destroy(); + message.success("批量删除成功"); + }) + .catch((err) => { + console.log(err); + }); + }); + }; //移动任务到关卡 const moveTask = () => { let arr = state.selectRow; - console.log("选择的行信息",arr); - console.log("选择的关卡id",state.isactive); - arr.map( value => { - console.log("value:",value); + console.log("选择的行信息", arr); + console.log("选择的关卡id", state.isactive); + arr.map((value) => { + console.log("value:", value); let obj = { chapterId: state.isactive, - routerTaskIdList: value, - } + routerTaskIdList: value, + }; api .moveTask(obj) .then((res) => { - console.log("移动成功",res); + console.log("移动成功", res); message.destroy(); message.success("移动成功"); }) .catch((err) => { - console.log("移动失败",err); - }) - }) + console.log("移动失败", err); + }); + }); }; return { ...toRefs(state), - tableDataFunc, + // tableDataFunc, tableDataFunc2, showDrawer, closeDrawer, @@ -1741,6 +1740,7 @@ export default { changeRow, deletecTaskAll, moveTask, + showDeleteModal, }; }, }; diff --git a/src/views/projectcenter/TaskAdd.vue b/src/views/projectcenter/TaskAdd.vue index c5f62a6b..e88646d5 100644 --- a/src/views/projectcenter/TaskAdd.vue +++ b/src/views/projectcenter/TaskAdd.vue @@ -172,6 +172,8 @@ @changeData="updateTableData" v-model:projectId="projectId" v-model:chooseStageId="chooseStageId" + v-model:isLiveEdit="isLiveEdit" + v-model:EditLiveId="EditLiveId" />
@@ -285,8 +287,8 @@
@@ -839,7 +841,9 @@ export default { : null, chooseStageId: null, isRefEdit: 1, //外链编辑 + isLiveEdit: 1, //直播编辑 EditRefId: null, //要编辑的外链的id + EditLiveId: null, //要编辑的直播的id projectNameList: [ { id: 1, @@ -1019,9 +1023,9 @@ export default { .editStage(obj) .then((res) => { console.log("添加阶段成功", res); - state.valuesname = "", - state.valuesnotice = "", - state.stage = false; + (state.valuesname = ""), + (state.valuesnotice = ""), + (state.stage = false); message.destroy(); message.success("添加阶段成功"); }) @@ -1534,69 +1538,6 @@ export default { }); }; - //编辑直播信息 - const editLiveBroadcast = () => { - let obj = { - afterSignIn: "", - beforeSignIn: "", - createTime: "", - createUser: 0, - liveCover: "", - liveDuration: 0, - liveEndTime: "", - liveExplain: "", - liveFlag: "", - liveId: 0, - liveLink: "", - liveName: "", - livePlayback: "", - livePlaybackLink: "", - liveStartTime: "", - liveTag: "", - liveTeacherId: 0, - otherSettings: "", - signOutTime: "", - standardSettings: "", - updateTime: "", - updateUser: 0, - }; - apilive - .updateLiveBroadcastMessage(obj) - .then((res) => { - console.log(res); - message.success("修改成功"); - }) - .catch((err) => { - console.log(err); - message.warn("修改失败"); - }); - }; - //编辑外链信息 - const editExternal = () => { - let obj = { - createTime: "", - createUser: 0, - linkAddress: "", - linkDescription: "", - linkFlag: "", - linkId: 0, - linkName: "", - linkTag: "", - updateTime: "", - updateUser: 0, - }; - apiExternal - .updateLinks(obj) - .then((res) => { - console.log(res); - message.success("修改成功"); - }) - .catch((err) => { - console.log(err); - message.warn("修改失败"); - }); - }; - //删除评估测试 const deleteInvistText = () => { let obj = { @@ -1722,11 +1663,11 @@ export default { let obj = { chapterId: state.chooseStageId, routerTaskIdList: value, - } + }; apimove .moveTask(obj) .then((res) => { - console.log("移动成功",res); + console.log("移动成功", res); message.destroy(); message.success("移动成功"); }) @@ -1744,18 +1685,18 @@ export default { projectTaskIds: value, }; api - .deleteTask(obj) - .then((res) => { - console.log(res); - message.destroy(); - message.success("批量删除成功"); - getTask(); - }) - .catch((err) => { - console.log(err); - }); - }) - } + .deleteTask(obj) + .then((res) => { + console.log(res); + message.destroy(); + message.success("批量删除成功"); + getTask(); + }) + .catch((err) => { + console.log(err); + }); + }); + }; const onSelectChange = (selectedRowKeys) => { console.log("selectedRowKeys changed: ", selectedRowKeys); state.selectedRowKeys = selectedRowKeys; @@ -1927,11 +1868,19 @@ export default { state.isRefEdit = 2; state.EditRefId = id; }; + //打开编辑直播的弹窗 + const showEditLiveDrawer = (id) => { + state.addlivevisible = true; + state.isLiveEdit = 2; + state.EditLiveId = id; + }; //编辑的按钮 const decideType = (type, id) => { console.log(type, id); if (type == "外链") { showEditRefDrawer(id); + } else if (type == "直播") { + showEditLiveDrawer(id); } }; return { @@ -1976,8 +1925,6 @@ export default { editActivity, editEvalPath, deleteInvistText, - editLiveBroadcast, - editExternal, editInvistPath, editVotePath, getTableData, @@ -1996,6 +1943,7 @@ export default { deleteWork, decideType, showEditRefDrawer, + showEditLiveDrawer, }; }, };