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,6 +146,7 @@ import {addUser, editUser, getUser, getRoleOption, deleteUser, getUserDetail} fr
import {ElLoading, ElMessage, ElMessageBox} from "element-plus";
import {getTunnelOption} from "@/api/tunnel";
import TunnelTitle from "@/components/tunnelTitle/index.vue";
import {debounce} from 'lodash'
const router = useRouter()
const title = ref('添加用户')
@@ -218,7 +219,7 @@ const handleEditUser = (row) => {
lock: true,
text: '正在加载系统资源...',
background: 'rgba(0, 0, 0, 0.7)',
customClass:'allLoading'
customClass: 'allLoading'
})
getUserDetail(row.userId).then(res => {
if (res.code === 1000) {
@@ -234,7 +235,7 @@ const handleEditUser = (row) => {
}
const handleDelete = () => {
const handleDelete = debounce(() => {
if (userIds.value === undefined) {
ElMessage.warning('请先选择用户进行删除')
} else {
@@ -251,7 +252,7 @@ const handleDelete = () => {
})
})
}
}
}, 1000)
const reset = () => {
form.value = {
password: '',
@@ -276,7 +277,7 @@ const getInfo = () => {
lock: true,
text: '正在加载系统资源...',
background: 'rgba(0, 0, 0, 0.7)',
customClass:'allLoading'
customClass: 'allLoading'
})
getUser({
siteId: siteId,
@@ -305,7 +306,7 @@ const handleCurrentChange = (val) => {
pageInfo.pageNum = val
getInfo()
}
const handleSubmit = (formInstance) => {
const handleSubmit = debounce((formInstance) => {
if (!formInstance) return;
formInstance.validate((valid) => {
if (!valid) return;
@@ -345,7 +346,7 @@ const handleSubmit = (formInstance) => {
})
}
})
}
}, 1000)
const handleSelect = async (selection, row) => {
if (selection.length !== 0) {
// disabled.value = false
@@ -368,6 +369,7 @@ const handleSelect = async (selection, row) => {
}
}
}
.el-select__wrapper {
min-height: 75px;
height: auto !important;
@@ -775,8 +777,9 @@ const handleSelect = async (selection, row) => {
color: #60DDDE;
font-size: 38px;
font-weight: bold;
:deep(.el-pagination.is-background ) {
.btn-next,.btn-prev {
.btn-next, .btn-prev {
background-color: transparent;
}