|
|
@@ -228,7 +228,7 @@ const pushRes = (data: any) => {
|
|
|
|
|
|
//获取推送列表
|
|
|
const searchPush = async () => {
|
|
|
- if(!userToken.value) return
|
|
|
+ if (!userToken.value) return
|
|
|
let res = await customApi.PushMessageList({ type: null });
|
|
|
if (res.code == 200) {
|
|
|
if (res.data == null) {
|
|
|
@@ -242,7 +242,7 @@ const searchPush = async () => {
|
|
|
}
|
|
|
//获取原因列表
|
|
|
const searchReasons = async () => {
|
|
|
- if(!userToken.value) return
|
|
|
+ if (!userToken.value) return
|
|
|
let res = await customApi.reasonsRefusalList({ type: null });
|
|
|
if (res.code == 200) {
|
|
|
if (res.data == null) {
|
|
|
@@ -294,22 +294,45 @@ function openRightDrawer() {
|
|
|
|
|
|
const sidebarVisible = ref(false)
|
|
|
const maskVisible = ref(false)
|
|
|
+let sidebarTimer: any = null
|
|
|
+let isAnimating = ref(false)
|
|
|
+
|
|
|
+function debounce<T extends (...args: any[]) => void>(fn: T, delay: number): T {
|
|
|
+ let timer: any = null
|
|
|
+ return ((...args: any[]) => {
|
|
|
+ if (timer) clearTimeout(timer)
|
|
|
+ timer = setTimeout(() => fn(...args), delay)
|
|
|
+ }) as T
|
|
|
+}
|
|
|
+
|
|
|
+const toggleSidebar = debounce(() => {
|
|
|
+ if (isAnimating.value) return
|
|
|
+
|
|
|
+ isAnimating.value = true
|
|
|
|
|
|
-function openLeftDrawer() {
|
|
|
- // 真正显示时 → 关闭
|
|
|
if (maskVisible.value) {
|
|
|
maskVisible.value = false
|
|
|
- setTimeout(() => {
|
|
|
+ sidebarTimer = setTimeout(() => {
|
|
|
sidebarVisible.value = false
|
|
|
+ isAnimating.value = false
|
|
|
+ sidebarTimer = null
|
|
|
}, 200)
|
|
|
- }
|
|
|
- // 隐藏时 → 打开
|
|
|
- else {
|
|
|
+ } else {
|
|
|
sidebarVisible.value = true
|
|
|
- setTimeout(() => {
|
|
|
+ sidebarTimer = setTimeout(() => {
|
|
|
maskVisible.value = true
|
|
|
+ isAnimating.value = false
|
|
|
+ sidebarTimer = null
|
|
|
}, 200)
|
|
|
}
|
|
|
+}, 300)
|
|
|
+
|
|
|
+function openLeftDrawer() {
|
|
|
+ if (sidebarTimer) {
|
|
|
+ clearTimeout(sidebarTimer)
|
|
|
+ sidebarTimer = null
|
|
|
+ }
|
|
|
+ toggleSidebar()
|
|
|
}
|
|
|
|
|
|
function handleDrawerNavigate(path: string) {
|