-- 任务

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