feat:合并

This commit is contained in:
songwc
2022-11-07 17:25:00 +08:00
parent 2f093f96c7
commit fe744abde2
3 changed files with 94 additions and 53 deletions

View File

@@ -8,8 +8,7 @@
>
<div class="drawerMain">
<div class="header">
<div v-if="isRefEdit == 2" class="headerTitle">编辑外链</div>
<div v-else class="headerTitle">添加外链</div>
<div class="headerTitle">{{ title }}外链</div>
<img
style="width: 29px; height: 29px; cursor: pointer"
src="../../assets/images/basicinfo/close.png"
@@ -127,20 +126,13 @@ export default {
type: Number,
default: null,
},
isactive: {
type: Number,
default: null,
},
routerId: {
type: Number,
default: null,
},
},
setup(props, ctx) {
const state = reactive({
inputV1: "",
inputV2: "",
textV1: "",
title: null,
});
const closeDrawer = () => {
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 {
}
}
}
</style>
</style>