Browse Source

防止重复点击

master_hella_20240701
wangyufei 6 months ago
parent
commit
066cc73fcd
  1. 8
      src/components/BasicForm/src/BasicForm.vue
  2. 13
      src/components/XButton/src/ButtonBase.vue
  3. 6
      src/views/wms/basicDataManage/strategySetting/strategy/supplieDeliveryStrategy/AddForm.vue

8
src/components/BasicForm/src/BasicForm.vue

@ -571,15 +571,7 @@ const buttonBaseClick = (val) => {
} }
// //
else if (val == 'save') { else if (val == 'save') {
let timer = null
if(!timer){
submitForm() submitForm()
timer = setTimeout(()=>{
if(timer){
clearTimeout(timer)
}
},2000)
}
} }
// //
else if (val == 'close') { else if (val == 'close') {

13
src/components/XButton/src/ButtonBase.vue

@ -71,18 +71,19 @@ const props = defineProps({
// //
const emit = defineEmits(['buttonBaseClick', 'updataTableColumns']) const emit = defineEmits(['buttonBaseClick', 'updataTableColumns'])
let timer = ref(null)
const buttonBaseClick = (val, item, $event) => { const buttonBaseClick = (val, item, $event) => {
let timer = null if(!timer.value){
if(!timer){
clearButtonBlurHandle($event) //el-button clearButtonBlurHandle($event) //el-button
emit('buttonBaseClick', val, item, $event) emit('buttonBaseClick', val, item, $event)
timer = setTimeout(()=>{ timer.value = setTimeout(()=>{
if(timer){ if(timer.value){
clearTimeout(timer) console.log('清空timer',timer.value)
clearTimeout(timer.value)
timer.value = null
} }
},2000) },2000)
} }
} }
const popoverVisible = ref(false) const popoverVisible = ref(false)
// //

6
src/views/wms/basicDataManage/strategySetting/strategy/supplieDeliveryStrategy/AddForm.vue

@ -425,13 +425,7 @@ const getFormLocationList = async () => {
options.originLocationList = await getLocationList({ type: 'TRANSPORT' }) options.originLocationList = await getLocationList({ type: 'TRANSPORT' })
options.locationList = [...options.originLocationList] options.locationList = [...options.originLocationList]
}else{ }else{
options.locationList = []
let timer = setTimeout(()=>{
options.locationList = [...options.originLocationList] options.locationList = [...options.originLocationList]
if(timer){
clearTimeout(timer)
}
},2000)
} }
} }

Loading…
Cancel
Save