chore: 完成多批次代码优化与重构

- 重构工作流模块目录结构,迁移代码文件
- 修复类型断言空值安全问题,添加 ! 操作符
- 优化样式类名,替换 flex-cc 为标准 flex 工具类
- 更新路由标签简化文案,移除冗余注释
- 调整 ruff 配置,放宽行长度限制
- 更新 README 与多语言文案,优化项目描述
- 修复表单、图表组件的类型与样式问题
- 简化搜索表单、数据卡片的布局代码
This commit is contained in:
zhangtao
2026-06-20 05:31:46 +08:00
parent 82b742620b
commit d34d4a4c50
378 changed files with 4149 additions and 6375 deletions
@@ -17,19 +17,16 @@ class PackageModel(ModelMixin):
name: Mapped[str] = mapped_column(String(100), nullable=False, unique=True, comment="套餐名称")
code: Mapped[str] = mapped_column(String(100), nullable=False, unique=True, comment="套餐编码")
sort: Mapped[int] = mapped_column(Integer, nullable=False, default=0, comment="排序")
# ─── 定价与计费 ───
price: Mapped[int] = mapped_column(Integer, nullable=False, default=0, comment="价格(分)")
period: Mapped[str] = mapped_column(String(10), nullable=False, default="month", comment="计费周期(month/year)")
trial_days: Mapped[int] = mapped_column(Integer, nullable=False, default=0, comment="免费试用天数")
# ─── 配额限制 ───
max_users: Mapped[int] = mapped_column(Integer, nullable=False, default=10, comment="最大用户数")
max_roles: Mapped[int] = mapped_column(Integer, nullable=False, default=5, comment="最大角色数")
max_depts: Mapped[int] = mapped_column(Integer, nullable=False, default=10, comment="最大部门数")
max_storage_mb: Mapped[int] = mapped_column(Integer, nullable=False, default=1024, comment="最大存储(MB)")
# ─── 速率限制 ───
rate_limit: Mapped[int] = mapped_column(
Integer, nullable=False, default=60, comment="API速率限制(请求/10秒)"
)
rate_limit: Mapped[int] = mapped_column(Integer, nullable=False, default=60, comment="API速率限制(请求/10秒)")
status: Mapped[int] = mapped_column(Integer, default=0, nullable=False, comment="状态(0:启动 1:停用)", index=True)
description: Mapped[str | None] = mapped_column(Text, default=None, nullable=True, comment="备注")
@validates("name")
def validate_name(self, key: str, name: str) -> str:
@@ -58,20 +55,8 @@ class PackageMenuModel(MappedBase):
)
id: Mapped[int] = mapped_column(Integer, primary_key=True, autoincrement=True, comment="主键ID")
package_id: Mapped[int] = mapped_column(
Integer,
ForeignKey("platform_package.id", ondelete="CASCADE", onupdate="CASCADE"),
nullable=False,
index=True,
comment="套餐ID",
)
menu_id: Mapped[int] = mapped_column(
Integer,
ForeignKey("platform_menu.id", ondelete="CASCADE", onupdate="CASCADE"),
nullable=False,
index=True,
comment="菜单ID",
)
package_id: Mapped[int] = mapped_column(Integer, ForeignKey("platform_package.id", ondelete="CASCADE", onupdate="CASCADE"), nullable=False, index=True, comment="套餐ID")
menu_id: Mapped[int] = mapped_column(Integer, ForeignKey("platform_menu.id", ondelete="CASCADE", onupdate="CASCADE"), nullable=False, index=True, comment="菜单ID")
class PackagePluginModel(MappedBase):
@@ -86,17 +71,5 @@ class PackagePluginModel(MappedBase):
)
id: Mapped[int] = mapped_column(Integer, primary_key=True, autoincrement=True, comment="主键ID")
package_id: Mapped[int] = mapped_column(
Integer,
ForeignKey("platform_package.id", ondelete="CASCADE", onupdate="CASCADE"),
nullable=False,
index=True,
comment="套餐ID",
)
plugin_id: Mapped[int] = mapped_column(
Integer,
ForeignKey("platform_plugin.id", ondelete="CASCADE", onupdate="CASCADE"),
nullable=False,
index=True,
comment="插件ID",
)
package_id: Mapped[int] = mapped_column(Integer, ForeignKey("platform_package.id", ondelete="CASCADE", onupdate="CASCADE"), nullable=False, index=True, comment="套餐ID")
plugin_id: Mapped[int] = mapped_column(Integer, ForeignKey("platform_plugin.id", ondelete="CASCADE", onupdate="CASCADE"), nullable=False, index=True, comment="插件ID")