Commit Graph
875 Commits
Author SHA1 Message Date
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 c32823138d feat: 实现对话框全屏时表格高度自适应
- EnhancedDialog 新增 fullscreen-change 事件,用于监听全屏状态变化

- GenColumnsStep 表格高度改为动态计算,适配不同屏幕尺寸

- ImportDbTableDialog 支持全屏模式,表格高度根据全屏状态自动调整

- 优化表格高度计算逻辑,确保内容区域合理利用屏幕空间
2026-04-20 20:59:19 +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 ff4034b32e refactor(gencode): 将导入弹窗查询表单改为ref类型以保持响应性 2026-04-08 22:26:26 +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 efd24f85f7 chore: remove obsolete role management files
- Deleted unused role management schemas, CRUD operations, and service files to streamline the codebase.
- Removed related frontend components and API interactions to enhance maintainability and reduce complexity.
2026-04-04 01:25:07 +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 dcf8844453 chore(dependencies): adjust prefect and websockets version constraints for compatibility
- Updated prefect dependency to a range (>=3.5.0,<4) to ensure compatibility with newer versions of related packages.
- Modified websockets dependency to a range (>=15.0.1,<16.0) to align with the updated prefect version requirements.
2026-04-03 01:36:14 +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 2085f9200b docs: 删除过时的BUG与需求梳理文档
该文档已不再维护,相关信息已迁移至issue跟踪系统
2026-04-03 01:02:31 +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 c5ec09f06f refactor(menu): simplify menu active state synchronization logic
- Streamlined the synchronization of the active menu state by reducing multiple calls to syncMenuActive to a single call within nextTick.
- Added a comment to clarify the rationale behind the change and potential fallback options for synchronization issues.
2026-03-29 20:36:48 +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 a9856d142b feat(styles): enhance dark theme color variables with color-mix for better theme integration
- Updated CSS variables for background, fill, border, and menu hover colors in dark mode to use color-mix for improved visual consistency with primary theme color.
- Removed deprecated layout-* color variables to streamline styling approach.
- Enhanced comments for clarity on color mixing logic and its relation to theme colors.
2026-03-29 01:18:01 +08:00
zhangtao 787a453973 feat(CURD): integrate EnhancedDialog and improve modal components
- Added EnhancedDialog component to replace el-dialog in ExportModal.vue, ImportModal.vue, and PageModal.vue for better customization.
- Updated styles in PageContent.vue to enhance layout and toolbar functionality.
- Refactored PageSearch.vue to improve query handling and layout responsiveness.
- Introduced new properties in types.ts for better configuration options in search and content components.
- Updated package.json to include plop for improved project scaffolding.
2026-03-29 01:14:12 +08:00
zhangtao c304fa92d8 feat(navbar): enhance NavbarActions and TagsView with improved hover effects and quick link functionality
- Updated NavbarActions.vue to refine hover styles for icons and buttons, ensuring better visual feedback.
- Enhanced TagsView.vue by integrating a bookmark button for quick links, allowing users to easily add or remove favorites.
- Introduced a mechanism to synchronize quick link changes with local storage for immediate UI updates.
- Improved overall styling for better user experience and accessibility.
2026-03-28 02:59:08 +08:00
zhangtao 015e403060 feat(theme): 添加侧边栏配色方案和相关设置
- 引入侧边栏配色方案枚举,支持经典蓝和极简白
- 更新设置存储以包含侧边栏配色方案
- 在主题设置中添加侧边栏配色选项
- 优化相关组件样式以适应新配色方案
- 更新语言包以支持新设置项
2026-03-28 00:44:34 +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 817a5ffc17 refactor(theme): 移除侧边栏配色方案并优化主题样式
移除侧边栏配色方案相关代码,统一使用主题变量控制样式
优化表格区域样式,修复布局问题
更新主题色预设,提供更丰富的颜色选择
调整暗黑模式和明亮模式下的样式表现
2026-03-22 21:12:46 +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 9d1ad8d9d5 refactor(docker): 修改nginx挂载路径以直接使用源码目录
将前端、H5和文档的挂载路径从dist目录改为源码目录,便于开发时直接查看修改效果
2026-03-15 04:16:14 +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 a9167a4149 chore: 更新.gitignore文件中的环境配置文件
移除旧的环境配置文件命名,添加新的开发和生产环境配置文件
2026-03-15 03:33:04 +08:00
zhangtao 10ba8baa83 chore: 删除所有环境配置文件和docker-compose文件 2026-03-15 03:32:54 +08:00