-- 任务

This commit is contained in:
yuping
2022-11-30 23:44:28 +08:00
parent cb88683a8d
commit a0f563d68e

View File

@@ -176,7 +176,7 @@ export default {
console.log(errors);
// message.error("handleFinishFailed");
};
const updateTask = (res) => {
const updateTask = async (res) => {
if (props.isLevel == 1) {
RouterEditTask({
chapterId: props.isactive,
@@ -186,9 +186,9 @@ export default {
routerTaskId: props.routerTaskId || 0,
type: 7,
})
.then(() => {
.then(async () => {
// message.success(`${props.edit ? "编辑" : "新增"}关卡任务成功`);
ctx.emit("changeData", false);
await ctx.emit("changeData", false);
closeDrawer();
state.addLoading = false;
})
@@ -254,18 +254,18 @@ export default {
if (props.edit) {
api
.updateLinks(obj)
.then((res) => {
.then(async (res) => {
message.success("编辑成功");
updateTask(res);
await updateTask(res);
ctx.emit("changeData", false);
})
.catch(() => {});
} else {
api
.createExternalChain(obj)
.then((res) => {
.then(async (res) => {
message.success("提交成功");
updateTask(res);
await updateTask(res);
ctx.emit("changeData", false);
})
.catch(() => {});