| data | ||
| docs | ||
| frontend | ||
| scripts | ||
| src | ||
| .cursorrules | ||
| .gitignore | ||
| .python-version | ||
| config.py | ||
| LICENSE | ||
| loiteringmunitions.md | ||
| package.json | ||
| pyproject.toml | ||
| README.md | ||
| requirements.txt | ||
| run.py | ||
| vite.config.js | ||
数据库配置说明
本系统使用 MySQL 8.0+ 作为数据库。在安装 MySQL 后,需要:
- 创建数据库用户
CREATE USER 'equipment_user'@'localhost' IDENTIFIED BY 'your_password';
GRANT ALL PRIVILEGES ON equipment_cost_db.* TO 'equipment_user'@'localhost';
FLUSH PRIVILEGES;
- 配置数据库字符集 确保 MySQL 配置文件(my.cnf 或 my.ini)包含以下设置:
[mysqld]
character-set-server=utf8mb4
collation-server=utf8mb4_unicode_ci
[client]
default-character-set=utf8mb4
环境配置
本项目需要 Python 3.9-3.11 版本。推荐使用 Python 3.11.8。
使用脚本自动配置(推荐)
Unix/macOS:
chmod +x scripts/setup_env.sh
./scripts/setup_env.sh
Windows (PowerShell):
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
.\scripts\setup_env.ps1
手动配置
-
安装 pyenv
-
安装 Python 3.11.8:
pyenv install 3.11.8 -
设置本地 Python 版本:
pyenv local 3.11.8 -
创建虚拟环境:
python -m venv .venv -
激活虚拟环境:
source .venv/bin/activate # Unix .venv\Scripts\activate # Windows -
安装依赖:
pip install -e ".[dev]"