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 @@ >
{
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/views/learningpath/LevelAddDetail.vue b/src/views/learningpath/LevelAddDetail.vue
index 6969dd7c..413f60a7 100644
--- a/src/views/learningpath/LevelAddDetail.vue
+++ b/src/views/learningpath/LevelAddDetail.vue
@@ -501,6 +501,7 @@
margin-right: 25px;
cursor: pointer;
"
+ @click="decideType(element.lei, element.courseId)"
>
编辑
@@ -871,6 +872,10 @@ export default {
name: "默认关卡",
},
],
+ isRefEdit: 1, //外链编辑
+ isLiveEdit: 1, //直播编辑
+ EditRefId: null, //要编辑的外链的id
+ EditLiveId: null, //要编辑的直播的id
tableData: [
{
key: 1,
@@ -1687,18 +1692,39 @@ export default {
let obj = {
chapterId: state.isactive,
routerTaskIdList: state.selectRow,
- }
+ };
api
- .moveTask(obj)
- .then((res) => {
- console.log("移动成功", res);
- message.destroy();
- message.success("移动成功");
- })
- .catch((err) => {
- console.log("移动失败",err);
- })
- }
+ .moveTask(obj)
+ .then((res) => {
+ console.log("移动成功", res);
+ message.destroy();
+ message.success("移动成功");
+ })
+ .catch((err) => {
+ console.log("移动失败", err);
+ });
+ };
+ //打开编辑外链的弹窗
+ const showEditRefDrawer = (id) => {
+ state.addrefvisible = true;
+ 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 {
...toRefs(state),
// tableDataFunc,
@@ -1737,6 +1763,9 @@ export default {
deletecTaskAll,
moveTask,
showDeleteModal,
+ showEditRefDrawer,
+ showEditLiveDrawer,
+ decideType,
};
},
};
diff --git a/src/views/projectcenter/TaskAdd.vue b/src/views/projectcenter/TaskAdd.vue
index e7bf8819..3e8d5d35 100644
--- a/src/views/projectcenter/TaskAdd.vue
+++ b/src/views/projectcenter/TaskAdd.vue
@@ -191,6 +191,10 @@