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 @@
>
{
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 @@