mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-18 15:26:48 +08:00
fix:修改任务频繁点击增加多条问题
This commit is contained in:
@@ -105,6 +105,7 @@ export default {
|
||||
assessment1: null,
|
||||
assessmentVisible: false,
|
||||
titleTag: false,
|
||||
isClick: false
|
||||
});
|
||||
// const getCheckedAss = (ass) => {
|
||||
// state.assessmentId = ass.assessmentId;
|
||||
@@ -153,6 +154,12 @@ export default {
|
||||
message.destroy();
|
||||
return message.warning("请先选中关卡");
|
||||
}
|
||||
if(state.isClick){
|
||||
message.destroy();
|
||||
message.error('请勿频繁点击')
|
||||
return
|
||||
}
|
||||
state.isClick = true;
|
||||
IsExistence({
|
||||
chapterId: Number(props.isactive),
|
||||
courseTaskId: l_data_id,
|
||||
@@ -174,6 +181,7 @@ export default {
|
||||
}
|
||||
message.destroy();
|
||||
message.warning("评估(" + tipStr + ")重复添加");
|
||||
state.isClick = false;
|
||||
return;
|
||||
} else {
|
||||
RouterEditTask({
|
||||
@@ -192,17 +200,26 @@ export default {
|
||||
ctx.emit("changeData", false);
|
||||
closeDrawer();
|
||||
state.addLoading = false;
|
||||
state.isClick = false;
|
||||
})
|
||||
.catch(() => {
|
||||
message.destroy();
|
||||
message.error(`${props.edit ? "编辑" : "新增"}关卡任务失败`);
|
||||
state.isClick = false;
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
state.isClick = false;
|
||||
});
|
||||
} else if (props.isLevel == 2) {
|
||||
if(state.isClick){
|
||||
message.destroy();
|
||||
message.error('请勿频繁点击')
|
||||
return
|
||||
}
|
||||
state.isClick = true;
|
||||
IsExistenceProject({
|
||||
courseTaskId: l_data_id,
|
||||
projectId: props.projectId,
|
||||
@@ -224,6 +241,7 @@ export default {
|
||||
}
|
||||
message.destroy();
|
||||
message.warning("评估(" + tipStr + ")重复添加");
|
||||
state.isClick = false;
|
||||
return;
|
||||
} else {
|
||||
apiTask
|
||||
@@ -239,16 +257,25 @@ export default {
|
||||
message.success(`${props.edit ? "编辑" : "新增"}任务成功`);
|
||||
ctx.emit("changeData", false);
|
||||
closeDrawer();
|
||||
state.isClick = false;
|
||||
})
|
||||
.catch(() => {
|
||||
message.error(`${props.edit ? "编辑" : "新增"}任务失败`);
|
||||
state.isClick = false;
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
state.isClick = false;
|
||||
});
|
||||
} else if (props.isLevel == 3) {
|
||||
if(state.isClick){
|
||||
message.destroy();
|
||||
message.error('请勿频繁点击')
|
||||
return
|
||||
}
|
||||
state.isClick = true;
|
||||
IsExistenceProjectTemplate({
|
||||
courseTaskId: l_data_id,
|
||||
projectTemplateId: props.projectTemplateId,
|
||||
@@ -269,6 +296,7 @@ export default {
|
||||
}
|
||||
message.destroy();
|
||||
message.warning("评估(" + tipStr + ")重复添加");
|
||||
state.isClick = false;
|
||||
return;
|
||||
} else {
|
||||
addTempTask({
|
||||
@@ -284,10 +312,12 @@ export default {
|
||||
message.success(`${props.edit ? "编辑" : "新增"}任务成功`);
|
||||
ctx.emit("changeData", false);
|
||||
closeDrawer();
|
||||
state.isClick = false;
|
||||
})
|
||||
.catch(() => {
|
||||
message.destroy();
|
||||
message.error(`${props.edit ? "编辑" : "新增"}任务失败`);
|
||||
state.isClick = false;
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user