Browse Source

防止重复点击

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

10
src/components/BasicForm/src/BasicForm.vue

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

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

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

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

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

Loading…
Cancel
Save