fix : 修复确认按钮防抖

This commit is contained in:
2024-03-25 16:31:37 +08:00
parent ef3bd6a125
commit 1cde879d78
7 changed files with 62 additions and 35 deletions

View File

@@ -146,7 +146,7 @@ import {ElMessage, ElMessageBox} from "element-plus";
import TunnelTitle from "@/components/tunnelTitle/index.vue";
import {getToken} from '@/utils/auth'
import {ElLoading} from 'element-plus'
import { debounce } from 'lodash'
const router = useRouter()
const userId = reactive(router.currentRoute.value.params.userId)
const siteId = reactive(router.currentRoute.value.params.siteId)
@@ -294,7 +294,7 @@ const handleAdd = () => {
formInstance.value.clearValidate()
})
}
const handleSubmit = (instance) => {
const handleSubmit =debounce((instance) => {
if (!instance) return
instance.validate(valid => {
if (!valid) return
@@ -320,8 +320,8 @@ const handleSubmit = (instance) => {
});
}
})
}
const handleChooseAll = () => {
},1000)
const handleChooseAll = debounce(() => {
siteList.value.map(item => {
item.checked = !item.checked
if (item.checked && !item.isDefault) {
@@ -334,8 +334,8 @@ const handleChooseAll = () => {
})
}
})
}
const handleMoreDelete = () => {
},1000)
const handleMoreDelete =debounce(() => {
if (siteIds.value.length === 0) {
ElMessage.warning('请先选择站点进行删除')
} else {
@@ -372,7 +372,7 @@ const handleMoreDelete = () => {
})
}
}
}
},1000)
const firstPage = () => {
pageInfo.pageNum = 1
getList()