Browse Source

添加防抖

milestone-20251117-DeepChart后台一期
liruiqiang 3 weeks ago
parent
commit
64cb4377ab
  1. 10
      src/views/UserPermissions/Market.vue
  2. 20
      src/views/UserPermissions/Module.vue

10
src/views/UserPermissions/Market.vue

@ -323,10 +323,18 @@ const checkRemark = () => {
return true; return true;
}; };
//
const Noshake = ref(false)
// //
const submitForm = async () => { const submitForm = async () => {
//
if (Noshake.value) return;
Noshake.value = true;
// //
if (!checkHlids() || !checkTime() || !checkRemark()) { if (!checkHlids() || !checkTime() || !checkRemark()) {
Noshake.value = false;
return; return;
} }
@ -366,6 +374,8 @@ const submitForm = async () => {
fetchTableData(); fetchTableData();
} catch (error) { } catch (error) {
ElMessage.error('添加权限失败,请重试'); ElMessage.error('添加权限失败,请重试');
} finally {
Noshake.value = false;
} }
}; };

20
src/views/UserPermissions/Module.vue

@ -707,10 +707,18 @@ const checkTokenNum = () => {
return true; return true;
}; };
//
const NoshakeDM = ref(false)
// DeepMate // DeepMate
const submitFormDM = async () => { const submitFormDM = async () => {
//
if (NoshakeDM.value) return;
NoshakeDM.value = true;
// //
if (!checkHlids() || !checkTokenNum()) { if (!checkHlids() || !checkTokenNum()) {
NoshakeDM.value = false;
return; return;
} }
@ -740,6 +748,8 @@ const submitFormDM = async () => {
DMTableData(); DMTableData();
} catch (error) { } catch (error) {
ElMessage.error('添加权限失败,请重试'); ElMessage.error('添加权限失败,请重试');
} finally {
NoshakeDM.value = false;
} }
}; };
@ -1037,10 +1047,18 @@ const checkRemark = () => {
return true; return true;
}; };
//
const NoshakeDE = ref(false)
// //
const submitFormDE = async () => { const submitFormDE = async () => {
//
if (NoshakeDE.value) return;
NoshakeDE.value = true;
// //
if (!checkHlidsDE() || !checkmodel() || !checkTime() || !checkRemark()) { if (!checkHlidsDE() || !checkmodel() || !checkTime() || !checkRemark()) {
NoshakeDE.value = false;
return; return;
} }
@ -1081,6 +1099,8 @@ const submitFormDE = async () => {
DETableData(); DETableData();
} catch (error) { } catch (error) {
ElMessage.error('添加权限失败,请重试'); ElMessage.error('添加权限失败,请重试');
} finally {
NoshakeDE.value = false;
} }
}; };

Loading…
Cancel
Save