Browse Source

系统菜单添加编辑时增加防重复点击

temp
duyufeng 3 months ago
parent
commit
572cdc60b3
  1. 34
      hx-op/src/view/systemManage/systemMenu/editSystemMenu.vue

34
hx-op/src/view/systemManage/systemMenu/editSystemMenu.vue

@ -107,6 +107,7 @@
const redirectIsshow = ref(true);//
const keepAliveIsshow = ref(false);//
const hideChildrenIsshow = ref(true);//
let isClicked = ref(true);//
interface FormState {
menuName: string;
previousMenu:string;
@ -161,6 +162,7 @@
const onClose = () => {
visible.value = false;
formRef.value.resetFields();
isClicked.value = true;
};
//
const chanageMenuType = (e:any,typeMenu:any)=>{
@ -247,21 +249,33 @@
params.hideChildren = formState.value.hideChildren;//
}
if(addOrEditType.value==1){//
http.post(menuS.queryMenuPageAdd, params).then(() => {
NsMessage.success('操作成功');
visible.value = !visible.value;
emit("editObject",formState)
});
if(isClicked.value){
isClicked.value = false;
http.post(menuS.queryMenuPageAdd, params).then(() => {
visible.value = !visible.value;
emit("editObject",formState);
NsMessage.success('操作成功');
setTimeout(() => {
isClicked.value = !visible.value;
}, 500);
});
}
}else{
params.permissionId = currentLineData.value.permissionId;
params.createTime = currentLineData.value.createTime;
params.updateTime = currentLineData.value.updateTime;
params.isDelete = currentLineData.value.isDelete;
http.post(menuS.queryMenuPageEdit, params).then(() => {
NsMessage.success('操作成功');
visible.value = !visible.value;
emit("editObject",formState)
});
if(isClicked.value){
isClicked.value = false;
http.post(menuS.queryMenuPageEdit, params).then(() => {
visible.value = !visible.value;
emit("editObject",formState);
NsMessage.success('操作成功');
setTimeout(() => {
isClicked.value = !visible.value;
}, 500);
});
}
}
})
}

Loading…
Cancel
Save