Commit Graph
397 Commits
Author SHA1 Message Date
zhangtao d59aaedf35 refactor(gencode): 升级代码生成模板对齐新组件架构 2026-05-12 16:25:09 +08:00
zhangtao c4ce0c5918 chore: 更新版本号至 3.0.0 2026-05-11 23:46:15 +08:00
zhangtao 6db264bef3 feat: 删除fastapi-backend.spec文件并更新依赖项注释
- 移除不再使用的fastapi-backend.spec文件
- 更新pyproject.toml和requirements.txt中的依赖项注释,增加了对OpenAI API客户端和其他依赖的描述
- 在多个API模块中统一返回类型为单数形式,提升代码一致性
- 更新前端环境配置,调整API基础URL和WebSocket端点为本地地址
2026-05-05 07:16:13 +08:00
zhangtao b12f7a0a11 feat(auth): 添加第三方OAuth登录支持
- 实现OAuth登录重定向和回调处理
- 更新配置文件以支持多种OAuth提供商
- 添加错误处理和状态管理功能
- 更新文档以反映新功能和配置要求
2026-05-03 06:42:13 +08:00
zhangtao 80263e98e1 feat: 重构前端项目结构并优化代码
refactor: 迁移前端资源文件至web目录
feat: 新增多种图标资源
style: 统一代码风格和格式化配置
docs: 更新README和文档说明
chore: 更新依赖和配置文件
fix: 修复部分类型定义和枚举
perf: 优化路由和组件加载逻辑
2026-05-01 01:01:17 +08:00
luomgf d2a4e95357 ### 摘要
- 菜单表与接口增加终端维度 `client`(`pc` | `app`),与规范「PC 桌面 / APP 移动端」一致。不改已有授权逻辑。
- 管理端动态路由仅下发 `client=pc`;菜单管理页通过 Tab + 查询参数 `menu_client` 分端维护。
- 种子数据 `sys_menu.json` 为全量 PC 菜单补 `client: pc`,并内置 5 条 APP 顶级目录(首页/同事/打卡/消息/我的),图标使用项目 `src/assets/icons` 内已有名称。

### 后端
- `MenuModel` 增加 `client` 列(默认 `pc`)。
- Schema:`MenuCreateSchema` / `MenuOutSchema` 含 `client`;`MenuQueryParam` 增加 `menu_client` 过滤。
- `menu_request_validator` 校验 `client ∈ {pc,app}`;父子终端一致校验在 `MenuService` 创建/更新中执行。
- `get_current_user_info` 菜单树与角色菜单 ID 仅保留 PC 端,避免 APP 菜单进入 Vue Router。

### 前端
- 菜单管理:PC/APP Tab、`menu_client` 列表参数、表格/详情/表单「终端」、子级继承父级 `client`。
- API 类型与 `MenuClientEnum`;`permission.store` 路由 `meta.client`(可选扩展)。

### 数据库(已有库)
-postgres
```
ALTER TABLE sys_menu ADD COLUMN IF NOT EXISTS client VARCHAR(20) NOT NULL DEFAULT 'pc';
COMMENT ON COLUMN sys_menu.client IS '终端(pc:管理端桌面 app:移动端)';
```

-mysql
```
ALTER TABLE sys_menu ADD COLUMN client VARCHAR(20) NOT NULL DEFAULT 'pc' COMMENT '终端(pc/app)';

```

### 兼容与注意
- 角色授权抽屉仍调用**不带** `menu_client` 的菜单树,可同时勾选 PC 与 APP。不改已有逻辑。
- 仅改种子 JSON 不影响**已有数据**库;已建库需执行 DDL,APP 示例菜单需在库中已存在或通过初始化导入。
2026-04-27 14:09:58 +08:00
zhangtao 10a35bb4b5 feat(类型转换): 增强数据库类型转换功能并添加测试
- 改进MySQL和PostgreSQL几何类型的特殊处理
- 完善数据库类型到Python和SQLAlchemy类型的映射
- 修改ango生成表位置与项目数据库中
- 添加全面的类型转换测试用例
- 修复数据库连接时的schema设置问题
2026-04-23 23:33:07 +08:00
zhangtao 4254a7951f feat: 添加跨平台运行脚本并移除旧脚本
新增 Windows 批处理脚本 run_win.bat 和 Linux shell 脚本 run_linux.sh,提供跨平台支持
移除旧版 run.sh 脚本,统一使用平台专用脚本
2026-04-21 00:01:51 +08:00
fastapiadmin b4a250e737 Merge pull request #364 from weiheweihe/dev
Dev
2026-04-20 23:47:28 +08:00
zhangtao f096886351 refactor(CURD): 移除搜索功能及相关代码
移除不再使用的搜索功能,包括工具栏中的搜索按钮、搜索区域切换按钮及相关事件处理逻辑。
同时更新模板文件和相关配置,确保代码一致性。

调整页面布局样式,优化执行日志抽屉的显示效果。
在代码生成器中添加保存按钮,允许在配置过程中保存当前进度。
2026-04-20 23:40:16 +08:00
weihe0720 6dba8079e8 fix(redis_crud): 修复哈希操作方法未正确使用await的问题
移除hash_get方法返回类型中错误的Awaitable联合类型,并确保hash_set和hash_get方法内部正确使用await调用Redis客户端方法,以支持异步操作。
2026-04-20 23:38:57 +08:00
coderxslee 531b1ea752 fix: 修复同步数据库时 super_column 字段导致的创建失败问题
问题:
- 同步数据库接口 /api/v1/generator/gencode/sync_db/{table_name} 报错
- 错误信息:'super_column' is an invalid keyword argument for GenTableColumnModel

原因:
- GenTableColumnOutSchema 包含 super_column 输出字段
- GenTableColumnModel 数据库模型不包含此字段
- 同步时直接使用 OutSchema 对象创建/更新数据库记录导致参数错误

解决方案:
- 在创建/更新数据库记录前,将 GenTableColumnOutSchema 转换为 GenTableColumnSchema
- 使用 model_dump(exclude={"super_column"}) 排除输出专用字段
- 确保传递给 CRUD 层的数据只包含数据库模型支持的字段
2026-04-20 22:31:40 +08:00
coderxslee 698418b3e5 feat: 添加 FastAPI 项目管理脚本
- 新增 run.sh 交互式管理脚本,提供以下功能:
  - 启动开发服务器(自动检查并创建数据库)
  - 生成和应用数据库迁移
  - 重置迁移记录
  - 清理和删除数据库
  - 执行 SQL 初始化脚本
- 支持从 .env.dev 文件读取数据库配置
- 提供彩色输出和友好的交互界面
- 包含安全确认机制防止误操作
2026-04-20 22:05:40 +08:00
coderxslee 4b0c146520 git commit -m "fix(codegen): 添加软删除字段支持,避免字段重复定义
## 背景
本次修复包含前后端两部分:
1. 前端SQL模板添加软删除字段(新功能)
2. 后端代码模板排除软删除字段(预防性修复)

## 修复内容

### 前端模板:添加软删除字段(新功能)
**文件**: createTableVisualPresets.ts

之前前端SQL模板缺少软删除字段,导致生成的表不完整。

- **mixinMysql()**: 添加软删除字段
  - is_deleted: tinyint(1) NOT NULL - 标记是否已删除
  - deleted_time: datetime NULL - 记录删除时间
  - deleted_id: int NULL - 记录删除人ID

- **mixinPostgres()**: 添加软删除字段
  - is_deleted: boolean NOT NULL - 标记是否已删除
  - deleted_time: timestamp without time zone NULL - 记录删除时间
  - deleted_id: integer NULL - 记录删除人ID

### 后端模板:排除软删除字段(预防性修复)
**文件**: model.py.j2, schema.py.j2

虽然之前前端模板没有软删除字段,但为了配合前端修复,需要确保后端模板正确排除这些字段。

- **model.py.j2**: 在排除列表中添加 is_deleted, deleted_time, deleted_id
  - 原排除列表: ['id', 'uuid', 'status', 'description', 'created_time', 'updated_time', 'created_id', 'updated_id']
  - 新排除列表: 添加 'is_deleted', 'deleted_time', 'deleted_id'
  - 原因: 这些字段由 ModelMixin 和 UserMixin 提供,不应在生成的模型中重复定义

- **schema.py.j2**: 在排除列表中添加 is_deleted, deleted_time, deleted_id
  - 原排除列表: ['uuid', 'created_time', 'updated_time', 'created_id', 'updated_id']
  - 新排除列表: 添加 'is_deleted', 'deleted_time', 'deleted_id'
  - 原因: 软删除字段由系统自动管理,不应出现在新增/更新Schema中

## 技术说明

### 软删除机制
软删除(逻辑删除)是一种不物理删除数据的删除方式:
- **is_deleted**: 标记记录是否已删除(false=未删除, true=已删除)
- **deleted_time**: 记录删除时间,用于审计和数据恢复
- **deleted_id**: 记录删除操作人ID,外键关联sys_user表

### 字段继承关系
生成的模型继承自两个基类:
- **ModelMixin**: 提供 id, uuid, status, description, created_time, updated_time, is_deleted, deleted_time
- **UserMixin**: 提供 created_id, updated_id, deleted_id 及对应的关联关系

代码生成器应排除这些字段,避免重复定义。

## 修复效果

### 修复前
- 前端模板生成的表缺少软删除字段 
- 后端模板排除列表不完整(虽然暂时没问题,因为前端也没生成这些字段)

### 修复后
- 前端模板生成的表包含完整的软删除字段 
- 后端模板正确排除软删除字段,避免重复定义 
- 前后端配合,生成的代码正确继承基类的软删除功能 

## 影响范围
-  使用\"单表·MySQL\"或\"单表·PostgreSQL\"模板创建的表自动包含软删除字段
-  生成的model.py只包含业务字段,不会重复定义基础字段
-  所有新生成的模型自动支持软删除功能
-  与现有系统的软删除机制保持一致"
2026-04-20 20:18:53 +08:00
zhangtao a462ab5793 feat: 实现软删除功能并添加相关字段
在全局类型定义、模型、CRUD操作中添加软删除支持
- 在BaseModel中添加is_deleted和deleted_time字段
- 在UserMixin中添加deleted_id和deleted_by关联
- 修改CRUDBase的delete和clear方法实现软删除逻辑
- 更新所有相关模型添加deleted_by字段
- 修改前端接口定义添加deleted_by字段
- 移除冗余的成功提示消息
2026-04-19 23:08:27 +08:00
zhangtao 7b7f617455 fix(database): 修正redis_connect函数参数类型从str到bool
修复redis_connect函数参数status的类型错误,从字符串类型改为布尔类型以正确反映其用途
2026-04-16 23:22:41 +08:00
zhangtao d30e07d570 fix(配置): 强制从服务器获取最新配置数据
修改多处配置获取逻辑,添加强制刷新参数确保获取最新配置
设置Redis缓存默认过期时间为24小时
2026-04-15 23:36:51 +08:00
zhangtao 0f3f617458 chore: 更新后端数据中的group.jpg图片 2026-04-15 22:06:51 +08:00
zhangtao 53cdccca43 更新初始化sql 2026-04-14 23:35:29 +08:00
zhangtao fd11490024 refactor(CURD): 统一工具栏按钮类型和权限命名
标准化工具栏按钮类型定义,移除重复项并统一权限命名
更新多个视图的默认工具栏配置以保持一致
添加批量修改按钮并调整相关权限名称
2026-04-12 21:54:14 +08:00
zhangtao 17c24a4ccf refactor(ip解析): 移除LOGIN_RESOLVE_IP_LOCATION配置,改用DEBUG控制IP解析
不再使用单独的LOGIN_RESOLVE_IP_LOCATION配置项控制IP归属地解析,改为直接依赖DEBUG模式设置。当DEBUG为False时关闭外网IP解析功能,减少登录时的网络请求延迟。
2026-04-10 22:41:36 +08:00
zhangtao 0887b649a1 refactor(frontend): 替换 LockDialog 组件中的 el-dialog 为 EnhancedDialog
调整对话框组件以使用增强版的 EnhancedDialog,提升组件一致性和功能扩展性
2026-04-10 20:34:42 +08:00
zhangtao 329dd791d2 refactor(tenant): 移除租户工具模块并优化相关代码
重构租户模块,删除不再使用的工具类文件,包括查询、写入、缓存键等功能
优化模型字段格式和CRUD方法顺序,调整前端暗黑模式颜色变量
简化租户服务逻辑,移除平台租户管理校验,改进初始管理员创建流程
2026-04-08 00:06:20 +08:00
zhangtao 9f3846adca feat(tenant): 新增多租户功能支持
refactor(application): 重构应用模块为门户应用,支持租户隔离
feat(portal): 添加门户应用管理功能

perf(health): 新增就绪探针检查,优化健康检查接口
fix(middleware): 修复请求日志中间件的异常处理

style(menu): 调整菜单表格列顺序,优化展示效果
style(table): 优化表格内操作按钮的焦点样式

docs: 更新README文档,修正智能体框架描述
chore(deps): 移除langchain相关依赖,更新项目依赖

test: 添加多租户相关测试用例
ci: 更新CI配置,支持多租户测试环境

build: 更新构建配置,支持租户插件
2026-04-07 00:53:22 +08:00
zhangtao 1255729cd4 feat: enforce required department and role codes with validation
- Updated DeptModel and RoleModel to make the `code` field mandatory and unique.
- Enhanced DeptCreateSchema and RoleCreateSchema to require a valid `code` format, ensuring it starts with a letter and is 2-16 characters long.
- Implemented validation logic in the backend to check for existing codes during updates, preventing duplicates.
- Adjusted frontend forms to reflect the required `code` field and added validation messages for user guidance.
2026-04-04 02:16:53 +08:00
zhangtao 8397c305bd docs: add packaging philosophy section to README files
- Introduced a new section on packaging philosophy in both English and Chinese README files, explaining the project's approach to organizing source directories by feature rather than by layer.
- Updated the "Start Here" section to include a link to the new packaging philosophy for better guidance on project structure.
- Added a reference to the packaging philosophy in the backend README for consistency and clarity.
2026-04-04 01:48:36 +08:00
zhangtao b0ae6af3b1 chore: update .gitignore and enhance docstrings across multiple files
- Added *.pyc and *.pyo to .gitignore to prevent compiled Python files from being tracked.
- Improved docstrings in various modules, providing clearer descriptions of functions, parameters, and return values to enhance code readability and maintainability.
2026-04-04 01:21:59 +08:00
zhangtao 8e7a193a4a chore(dependencies): update prefect and websockets version constraints for compatibility
- Changed prefect dependency from a fixed version to a range (>=3.5.0,<4) to ensure compatibility with typer>=0.19 and prevent issues with future updates.
- Updated websockets dependency to a range (>=15.0.1,<16.0) to align with the new prefect version requirements and maintain consistency with deployment configurations.
2026-04-03 01:20:05 +08:00
zhangtao aeda9316d6 chore(dependencies): update croniter version constraint for compatibility
- Changed croniter dependency from a fixed version to a range (>=1.0.12,<5.0.0) to ensure compatibility with prefect==3.1.0 and prevent potential issues with future updates.
2026-04-03 01:13:46 +08:00
zhangtao c2417b466a chore(dependencies): update websockets version constraint for compatibility
- Changed websockets dependency from a fixed version to a range (>=10.4,<14.0) to ensure compatibility with prefect==3.1.0 and prevent potential issues with future updates.
2026-04-03 01:10:36 +08:00
zhangtao ee40e33cda build: 添加 prefect 依赖用于工作流编排 2026-04-03 01:01:52 +08:00
zhangtao b552b29ac5 feat: 重构代码生成模块并优化相关功能
- 重构代码生成模板,统一路由前缀和业务路径规范
- 优化数据库表分页查询性能,支持方言特定实现
- 新增同步数据库差异预览功能
- 调整字段配置界面,支持拖拽排序和批量设置
- 清理旧版示例代码和冗余配置
- 修复权限和路由嵌套路径处理问题
- 优化前端样式和交互细节
2026-04-03 00:43:50 +08:00
zhangtao 8a3360ef35 fix(菜单配置): 更新示例管理目录的默认重定向路径
将示例管理目录的默认重定向路径从null改为/example/demo-group/demo01,确保用户访问时能正确跳转到示例01页面
2026-03-30 22:14:18 +08:00
zhangtao 837d8a5aa7 feat: 优化代码生成器功能并修复多个问题
- 前端表格列添加溢出提示工具
- 后端登录IP归属地查询与设置统一处理
- 分页服务明确仅用于非SQL数据源场景
- 代码生成器添加字段筛选和帮助面板
- 修复菜单高亮和布局切换问题
- 更新文档中的BUG状态和解决方案
- 优化AI聊天界面样式和交互
- 添加数据库分页支持到多个模块
- 代码生成器表单校验和流程优化
- 修复PostgreSQL日期类型问题
2026-03-30 00:37:16 +08:00
zhangtao 7081850d46 feat(dependencies): update asyncmy and pandas versions for improved performance and compatibility
- Upgraded asyncmy from version 0.2.9 to 0.2.11 to leverage enhancements and bug fixes.
- Updated pandas from version 2.2.2 to 2.2.3 for better data processing capabilities.
- Added a new configuration option LOGIN_RESOLVE_IP_LOCATION to control IP location resolution during login.
- Enhanced login service to handle IP location resolution based on the new configuration.
- Improved validation logic in menu request handling to ensure proper redirection address for specific menu types.
- Adjusted CRUD template generation to dynamically use primary key column names for better flexibility.
- Updated Vue components to ensure proper handling of dynamic primary key references in menu items and forms.
2026-03-29 20:33:33 +08:00
zhangtao 25f497a55b feat(docs): update README files for improved local setup instructions and architecture overview
- Enhanced the "Quick Start" section in both English and Chinese README files to clarify steps for running the project locally, including environment setup and backend initialization.
- Added a new section detailing local architecture and default ports, aligning with configuration files for better user guidance.
- Improved clarity on API documentation access and emphasized automatic database initialization on the first backend start.
- Updated backend README to reflect changes in migration commands and emphasize the automatic setup process during the first run.
2026-03-29 07:42:33 +08:00
zhangtao d2a863652e feat(docs): enhance README and backend documentation for new user onboarding and backend conventions
- Added a "Start Here" section in both English and Chinese README files to guide new users on running the project locally and exploring its features.
- Introduced backend conventions for date and serialization handling, clarifying the use of Pydantic v2 and PostgreSQL.
- Updated the "Quick Start" section with detailed steps for first-time local setup, including environment requirements and backend setup instructions.
- Improved overall structure and clarity of documentation to facilitate better understanding for developers and contributors.
2026-03-29 07:25:09 +08:00
zhangtao bf26563083 feat(menu): add new user management section to sys_menu.json
- Introduced a "用户管理" (User Management) section in sys_menu.json with actions for creating, updating, deleting, and viewing user details.
- Enhanced the menu structure for improved organization and accessibility of user management features.
- Updated related styles to ensure consistency with the overall application theme.
2026-03-29 04:08:30 +08:00
zhangtao 77a6d24172 feat(workflow): add workflow management section to sys_menu.json
- Introduced a new "流程管理" (Workflow Management) section in sys_menu.json with various actions including create, debug, modify, delete, detail, and query workflows.
- Enhanced the menu structure to facilitate better organization and access to workflow management features.
- Updated related styles and variables for improved theme integration across the application.
2026-03-29 04:08:16 +08:00
zhangtao 7484560d9f feat(menu): add example management directory and related actions
- Introduced a new "示例管理目录" (Example Management Directory) in sys_menu.json with a structured hierarchy.
- Added multiple actions under "示例01管理" including create, update, delete, and import/export functionalities with appropriate permissions.
- Enhanced the menu structure to support better organization and access to example management features.
2026-03-29 03:21:23 +08:00
zhangtao 565663be4a refactor(captcha): 调整验证码字体大小并增强验证码生成逻辑
- 修改验证码字体大小从40调整为35
- 增加验证码生成的难度参数,支持不同难度级别的运算
- 优化验证码图像生成逻辑,增加随机噪点和干扰线,提升安全性和可读性
2026-03-25 01:18:24 +08:00
zhangtao fd8ee5d3af feat(theme): 添加侧边栏logo的文本颜色和背景色变量
feat(editor): 替换模拟文件上传为实际API调用

fix(validator): 为日期和时间类型添加格式验证器
2026-03-22 23:59:05 +08:00
zhangtao 751b6910f2 feat(前端): 改进元数据输入方式为键值对列表
重构元数据输入表单,将原来的JSON文本输入改为可动态添加的键值对列表
2026-03-22 21:38:41 +08:00
zhangtao 014b5439da refactor(vue模板): 移除未使用的data-table样式 2026-03-16 01:00:38 +08:00
zhangtao 7e9e32d1b4 feat: 优化前端表格样式和查询表单布局
refactor(backend): 重构查询参数处理逻辑并使用枚举

fix: 修复状态显示不一致问题

style: 调整代码格式和导入顺序

perf(frontend): 优化表格高度自适应和溢出处理

docs: 添加方法参数和返回值的注释
2026-03-16 00:59:48 +08:00
zhangtao 91f330a547 chore: 添加项目图片资源并更新文档引用路径
将项目所需的图片资源添加到 backend/data 目录
更新 README.md 和 README.en.md 中的图片引用路径,从远程地址改为本地路径
2026-03-15 04:48:34 +08:00
zhangtao aa3fc617d0 build: 添加 openai 2.28.0 依赖
更新 pyproject.toml、requirements.txt 和 uv.lock 文件,添加 openai 2.28.0 版本依赖
2026-03-15 03:52:56 +08:00
zhangtao 10ba8baa83 chore: 删除所有环境配置文件和docker-compose文件 2026-03-15 03:32:54 +08:00
zhangtao 1a564e5018 docs: 更新环境配置示例文件和docker-compose配置
更新前后端环境配置示例文件,替换占位符为通用值
添加docker-compose示例文件
优化.gitignore文件,添加本地覆盖配置
统一各环境配置文件的格式和说明
2026-03-15 03:28:46 +08:00
zhangtao 2021241836 docs: 更新环境变量和docker-compose配置中的占位文本
将环境变量和docker-compose配置中的示例密码和密钥替换为更明确的占位文本
添加配置项的注释说明
2026-03-15 01:59:14 +08:00