Initial commit: One Pipe System

完整的管理系统,包含账户管理、卡片管理、套餐管理、财务管理等功能模块。

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
sexygoat
2026-01-22 16:35:33 +08:00
commit 222e5bb11a
495 changed files with 145440 additions and 0 deletions

38
src/utils/ui/loading.ts Normal file
View File

@@ -0,0 +1,38 @@
import { fourDotsSpinnerSvg } from '@/assets/svg/loading'
import { ElLoading } from 'element-plus'
const DEFAULT_LOADING_CONFIG = {
lock: true,
background: 'rgba(0, 0, 0, 0)',
svg: fourDotsSpinnerSvg,
svgViewBox: '0 0 40 40'
} as const
interface LoadingInstance {
close: () => void
}
let loadingInstance: LoadingInstance | null = null
export const loadingService = {
/**
* 显示 loading
* @returns 关闭 loading 的函数
*/
showLoading(): () => void {
if (!loadingInstance) {
loadingInstance = ElLoading.service(DEFAULT_LOADING_CONFIG)
}
return () => this.hideLoading()
},
/**
* 隐藏 loading
*/
hideLoading(): void {
if (loadingInstance) {
loadingInstance.close()
loadingInstance = null
}
}
}