feat:讨论活动的修改接口对接,添加关卡的编辑

This commit is contained in:
岳佳鑫
2022-11-02 18:00:31 +08:00
parent 2fb92ee77a
commit d986680eae
7 changed files with 247 additions and 184 deletions

View File

@@ -817,9 +817,10 @@ export default {
isactive: -1,
isActive: false,
projectChecked: null, //项目单选框
updateChapterID: null, //修改关卡id
});
//新建或编辑关卡
//新建关卡
const editChapter = () => {
if(!state.value1) return message.warning("请输入关卡名称");
let obj = {
@@ -845,6 +846,25 @@ export default {
console.log("创建失败", err);
});
}
//编辑关卡
const updateChapter = () => {
let obj = {
chapterId: state.updateChapterID,
name: "",
remark:"",
routerId: 0,
};
api
.updateChapter(obj)
.then((res) => {
console.log("修改成功",res);
message.success("修改成功");
})
.catch((err) => {
console.log("修改失败",err);
})
};
const showDrawer = () => {
state.visible = true;
};
@@ -973,7 +993,9 @@ export default {
<span style="color:#4EA6FF;margin-right:25px;cursor:pointer">
编辑
</span>
<span style="color:#4EA6FF;cursor:pointer">删除</span>
<span style="color:#4EA6FF;cursor:pointer" onClick={() => {
updateChapter();
}}>删除</span>
</div>
</div>
);
@@ -1204,6 +1226,7 @@ export default {
delete_exit,
drawertableColumns,
editChapter,
updateChapter,
};
},
};