diff --git a/.claude/settings.local.json b/.claude/settings.local.json new file mode 100644 index 0000000..81392f0 --- /dev/null +++ b/.claude/settings.local.json @@ -0,0 +1,39 @@ +{ + "permissions": { + "allow": [ + "WebFetch(domain:tauri.app)", + "Bash(npm install @tauri-apps/plugin-http @tauri-apps/plugin-autostart)", + "Bash(npx tauri build)", + "Bash(cargo update)", + "Bash(cargo build)", + "Bash(where link.exe)", + "Bash(PATH=\"C:/Program Files \\(x86\\)/Microsoft Visual Studio/2022/BuildTools/VC/Tools/MSVC/14.44.35207/bin/Hostx64/x64:$PATH\" cargo build)", + "Bash(export PATH=\"C:/Program Files \\(x86\\)/Microsoft Visual Studio/2022/BuildTools/VC/Tools/MSVC/14.44.35207/bin/Hostx64/x64:$PATH\")", + "Bash(CC=\"C:/Program Files \\(x86\\)/Microsoft Visual Studio/2022/BuildTools/VC/Tools/MSVC/14.44.35207/bin/Hostx64/x64/cl.exe\" CXX=\"C:/Program Files \\(x86\\)/Microsoft Visual Studio/2022/BuildTools/VC/Tools/MSVC/14.44.35207/bin/Hostx64/x64/cl.exe\" INCLUDE=\"C:/Program Files \\(x86\\)/Microsoft Visual Studio/2022/BuildTools/VC/Tools/MSVC/14.44.35207/include;C:/Program Files \\(x86\\)/Windows Kits/10/Include/10.0.26100.0/ucrt;C:/Program Files \\(x86\\)/Windows Kits/10/Include/10.0.26100.0/um;C:/Program Files \\(x86\\)/Windows Kits/10/Include/10.0.26100.0/shared\" LIB=\"C:/Program Files \\(x86\\)/Microsoft Visual Studio/2022/BuildTools/VC/Tools/MSVC/14.44.35207/lib/x64;C:/Program Files \\(x86\\)/Windows Kits/10/Lib/10.0.26100.0/um/x64;C:/Program Files \\(x86\\)/Windows Kits/10/Lib/10.0.26100.0/ucrt/x64\" PATH=\"C:/Program Files \\(x86\\)/Microsoft Visual Studio/2022/BuildTools/VC/Tools/MSVC/14.44.35207/bin/Hostx64/x64:$PATH\" cargo build)", + "Bash(echo $PATH)", + "Bash(echo \"PATH=$PATH\")", + "Bash(cmd.exe /C \"\"\"C:/Program Files \\(x86\\)/Microsoft Visual Studio/2022/BuildTools/VC/Auxiliary/Build/vcvars64.bat\"\" && cargo build\")", + "Bash(cmd.exe //C \"\"\"C:\\\\Program Files \\(x86\\)\\\\Microsoft Visual Studio\\\\2022\\\\BuildTools\\\\VC\\\\Auxiliary\\\\Build\\\\vcvars64.bat\"\" >nul 2>&1 & cargo build\")", + "Bash(cmd.exe //C \"D:\\\\Projects\\\\tauri\\\\tauri-app\\\\build.bat\")", + "Bash(npx vue-tsc --noEmit)", + "Bash(tasklist)", + "Bash(taskkill //F //IM tauri-app.exe)", + "Bash(taskkill //F //IM vite.exe)", + "Bash(cmd.exe //C \"D:\\\\Projects\\\\tauri\\\\tauri-app\\\\run.bat\")", + "Bash(cmd /c \"\"\"C:\\\\Program Files \\(x86\\)\\\\Microsoft Visual Studio\\\\2022\\\\BuildTools\\\\VC\\\\Auxiliary\\\\Build\\\\vcvars64.bat\"\" >nul 2>&1 && set\")", + "Bash(cmd /c \"\"\"C:\\\\Program Files \\(x86\\)\\\\Microsoft Visual Studio\\\\2022\\\\BuildTools\\\\VC\\\\Auxiliary\\\\Build\\\\vcvars64.bat\"\" && set\")", + "Bash(powershell -Command \":*)", + "Bash(powershell.exe -NoProfile -Command \"& { $out = cmd /c ''\"\"C:\\\\Program Files \\(x86\\)\\\\Microsoft Visual Studio\\\\2022\\\\BuildTools\\\\VC\\\\Auxiliary\\\\Build\\\\vcvars64.bat\"\" && set'' 2>&1; $out | Select-String ''^\\(PATH|INCLUDE|LIB|LIBPATH|VCINSTALLDIR|VCToolsVersion|WindowsSdkDir\\)='' }\")", + "Bash(powershell.exe -NoProfile -ExecutionPolicy Bypass -File \"C:\\\\Users\\\\Administrator\\\\AppData\\\\Local\\\\Temp\\\\get_vcvars.ps1\")", + "Bash(\"C:/Users/Administrator/AppData/Local/Temp/set_msvc_env.ps1\":*)", + "Bash(powershell.exe -NoProfile -ExecutionPolicy Bypass -File \"C:\\\\Users\\\\Administrator\\\\AppData\\\\Local\\\\Temp\\\\set_msvc_env.ps1\")", + "Bash(powershell.exe -NoProfile -Command \"[System.Environment]::GetEnvironmentVariable\\(''INCLUDE'',''User''\\) | Select-String ''MSVC''; [System.Environment]::GetEnvironmentVariable\\(''LIB'',''User''\\) | Select-String ''MSVC''; [System.Environment]::GetEnvironmentVariable\\(''PATH'',''User''\\) | Select-String ''HostX64''\")", + "Bash(powershell.exe -NoProfile -Command \"where.exe cl.exe\")", + "Bash(powershell.exe -NoProfile -Command \"Get-ItemProperty ''HKCU:\\\\Environment'' | Select-Object -ExpandProperty PATH | Select-String ''HostX64''\")", + "Bash(cargo check)", + "Bash(pnpm run tauri dev)", + "Bash(netstat -ano)", + "Bash(findstr :1420)" + ] + } +} diff --git a/.gitignore b/.gitignore index 4108b33..3ba8bea 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,7 @@ dist-ssr *.njsproj *.sln *.sw? + +target/ +.bak +*.bak.* diff --git a/.vscode/extensions.json b/.vscode/extensions.json index afa935a..237524e 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,6 +1,5 @@ { "recommendations": [ - "Vue.volar", "tauri-apps.tauri-vscode", "rust-lang.rust-analyzer" ] diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..4e7843b --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,74 @@ +# CLAUDE.md + +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. + +## 项目概述 + +这是一个基于 **Tauri 2.x + Vue 3** 的工单监控桌面应用,用于监控 CRM 系统(crm.yunvip123.com)的待处理工单并发送系统通知。 + +## 常用命令 + +项目使用 **npm** 作为包管理器(存在 package-lock.json)。 + +```bash +# 启动开发模式(前端 + Tauri) +pnpm run tauri dev + +# 仅启动前端开发服务器 +pnpm run dev + +# 构建生产版本 +npm run tauri build + +# 前端类型检查 + 构建 +pnpm run build + +# Rust 后端检查 +cd src-tauri && cargo check +cd src-tauri && cargo clippy +``` + +## 架构概述 + +**前端驱动架构**:所有业务逻辑(API 调用、定时任务、通知)都在 Vue 前端实现,Rust 后端仅负责系统级功能。 + +### 前端(src/) +- `src/App.vue` - 主界面,包含全部业务逻辑:用户认证、监控调度、通知、网络检测、配置管理、系统托盘 +- 使用 Vue 3 Composition API(` - - - - Welcome to Tauri + Vue - - - - - - - - - - - - - Click on the Tauri, Vite, and Vue logos to learn more. - - - - Greet - - {{ greetMsg }} - - - - - \ No newline at end of file + + + + + + 系统监控设置 + + + + + {{ isLoggedIn ? '已登录' : '未登录' }} + {{ isMonitoring ? ' - 监控中' : '' }} + + + + + + {{ getNetworkStatusText() }} + + ({{ formatResponseTime(networkStatus.response_time) }}) + + + + + + + + + + 登录设置 + + + 用户名 + + + + 密码 + + + + {{ isLoading ? '保存中...' : '保存设置' }} + + + + + + + 监控控制 + + + {{ isLoading ? '启动中...' : '开始监控' }} + + + 停止监控 + + + {{ isLoading ? '检查中...' : '手动检查API' }} + + + 最小化到托盘 + + + + + + + 测试功能 + + + {{ isLoading ? '检查中...' : '网络检测' }} + + + {{ showLogs ? '隐藏日志' : '显示日志' }} + + + {{ showConfig ? '隐藏配置' : '显示配置' }} + + + + + + + 高级配置 + + + 检查间隔(秒) + + + + 网络超时(秒) + + + + + + 开机自启动 + + + + + + 显示系统通知 + + + + {{ isLoading ? '保存中...' : '保存配置' }} + + + + + + + + 系统日志 + 清除日志 + + + 暂无日志记录 + + + {{ log.timestamp }} + [{{ log.category }}] + {{ log.level }} + {{ log.message }} + + + + + + + + + {{ message }} + × + + + + + + + diff --git a/src/App2.vue b/src/App2.vue new file mode 100644 index 0000000..9686596 --- /dev/null +++ b/src/App2.vue @@ -0,0 +1,71 @@ + + + + + 登录设置 + + 用户名: + + + + 密码: + + + 登录 + + + 正在监控... + 程序已最小化到系统托盘。 + showSettings = true">重新打开设置 + + + + \ No newline at end of file
Click on the Tauri, Vite, and Vue logos to learn more.
{{ greetMsg }}
{{ message }}
程序已最小化到系统托盘。