Commit Graph
1117 Commits
Author SHA1 Message Date
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
fastapiadmin f1b144e517 Merge pull request #363 from fastapiadmin/dev
feat: 实现软删除功能并添加相关字段
2026-04-19 23:09:19 +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
fastapiadmin cdb23cfa3d Merge pull request #361 from fastapiadmin/dev
fix(database): 修正redis_connect函数参数类型从str到bool
2026-04-16 23:23:33 +08:00
zhangtao 7b7f617455 fix(database): 修正redis_connect函数参数类型从str到bool
修复redis_connect函数参数status的类型错误,从字符串类型改为布尔类型以正确反映其用途
2026-04-16 23:22:41 +08:00
fastapiadmin 4a4f6f2da1 Merge pull request #360 from fastapiadmin/dev
fix(配置): 强制从服务器获取最新配置数据
2026-04-15 23:37:30 +08:00
zhangtao d30e07d570 fix(配置): 强制从服务器获取最新配置数据
修改多处配置获取逻辑,添加强制刷新参数确保获取最新配置
设置Redis缓存默认过期时间为24小时
2026-04-15 23:36:51 +08:00
fastapiadmin 76485fc2e2 Merge pull request #359 from fastapiadmin/dev
chore: 更新后端数据中的group.jpg图片
2026-04-15 22:07:29 +08:00
zhangtao 0f3f617458 chore: 更新后端数据中的group.jpg图片 2026-04-15 22:06:51 +08:00
fastapiadmin 8e2fc00750 Merge pull request #358 from fastapiadmin/dev
更新初始化sql
2026-04-14 23:37:16 +08:00
zhangtao 53cdccca43 更新初始化sql 2026-04-14 23:35:29 +08:00
fastapiadmin 45e4649ada Merge pull request #354 from fastapiadmin/dev
refactor(CURD): 统一工具栏按钮类型和权限命名
2026-04-12 21:56:10 +08:00
zhangtao fd11490024 refactor(CURD): 统一工具栏按钮类型和权限命名
标准化工具栏按钮类型定义,移除重复项并统一权限命名
更新多个视图的默认工具栏配置以保持一致
添加批量修改按钮并调整相关权限名称
2026-04-12 21:54:14 +08:00
fastapiadmin b7eacc9065 Merge pull request #353 from fastapiadmin/dev
refactor(ip解析): 移除LOGIN_RESOLVE_IP_LOCATION配置,改用DEBUG控制IP解析
2026-04-10 22:44:03 +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
fastapiadmin 851dd4e31e Merge pull request #352 from fastapiadmin/dev
refactor(frontend): 替换 LockDialog 组件中的 el-dialog 为 EnhancedDialog
2026-04-10 20:37:08 +08:00
zhangtao 0887b649a1 refactor(frontend): 替换 LockDialog 组件中的 el-dialog 为 EnhancedDialog
调整对话框组件以使用增强版的 EnhancedDialog,提升组件一致性和功能扩展性
2026-04-10 20:34:42 +08:00
fastapiadmin 366a676437 Merge pull request #349 from fastapiadmin/dev
refactor(gencode): 将导入弹窗查询表单改为ref类型以保持响应性
2026-04-08 22:27:15 +08:00
zhangtao ff4034b32e refactor(gencode): 将导入弹窗查询表单改为ref类型以保持响应性 2026-04-08 22:26:26 +08:00
fastapiadmin 9a10954ee7 Merge pull request #348 from fastapiadmin/dev
refactor(tenant): 移除租户工具模块并优化相关代码
2026-04-08 00:07:12 +08:00
zhangtao 329dd791d2 refactor(tenant): 移除租户工具模块并优化相关代码
重构租户模块,删除不再使用的工具类文件,包括查询、写入、缓存键等功能
优化模型字段格式和CRUD方法顺序,调整前端暗黑模式颜色变量
简化租户服务逻辑,移除平台租户管理校验,改进初始管理员创建流程
2026-04-08 00:06:20 +08:00
fastapiadmin 46ae18980f Merge pull request #347 from fastapiadmin/dev
feat(tenant): 新增多租户功能支持
2026-04-07 00:56:24 +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
fastapiadmin 74e6cfa5b6 Merge pull request #346 from fastapiadmin/dev
feat: enforce required department and role codes with validation
2026-04-04 02:21:10 +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
fastapiadmin 4398ad4d1e Merge pull request #345 from fastapiadmin/dev
Dev
2026-04-04 02:00:18 +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
fastapiadmin a3afae33b9 Merge pull request #343 from fastapiadmin/dev
chore(dependencies): adjust prefect and websockets version constraint…
2026-04-03 01:37:07 +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
fastapiadmin 5c8e1c0166 Merge pull request #342 from fastapiadmin/dev
Dev
2026-04-03 01:20:52 +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
fastapiadmin e3636dd61c Merge pull request #341 from fastapiadmin/dev
chore(dependencies): update websockets version constraint for compati…
2026-04-03 01:11:22 +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
fastapiadmin 4f21a0982a Merge pull request #340 from fastapiadmin/dev
Dev
2026-04-03 01:03:25 +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
fastapiadmin 51e76b309b Merge pull request #339 from fastapiadmin/dev
feat: 重构代码生成模块并优化相关功能
2026-04-03 00:46:46 +08:00
zhangtao b552b29ac5 feat: 重构代码生成模块并优化相关功能
- 重构代码生成模板,统一路由前缀和业务路径规范
- 优化数据库表分页查询性能,支持方言特定实现
- 新增同步数据库差异预览功能
- 调整字段配置界面,支持拖拽排序和批量设置
- 清理旧版示例代码和冗余配置
- 修复权限和路由嵌套路径处理问题
- 优化前端样式和交互细节
2026-04-03 00:43:50 +08:00
fastapiadmin 0186696465 Merge pull request #337 from fastapiadmin/dev
fix(菜单配置): 更新示例管理目录的默认重定向路径
2026-03-30 22:15:28 +08:00
zhangtao 8a3360ef35 fix(菜单配置): 更新示例管理目录的默认重定向路径
将示例管理目录的默认重定向路径从null改为/example/demo-group/demo01,确保用户访问时能正确跳转到示例01页面
2026-03-30 22:14:18 +08:00
fastapiadmin 551c08e26c Merge pull request #336 from fastapiadmin/dev
Dev
2026-03-30 00:39:07 +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
fastapiadmin 52a887fddc Merge pull request #335 from fastapiadmin/dev
Dev
2026-03-29 07:44:46 +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