立项配置数据入库、审计日志数据入库、编辑页UI界面美化、设备管理内容补充、审计日志显示优化

This commit is contained in:
Cheng Zhou
2026-02-27 16:16:26 +08:00
parent fd7e3fc948
commit db2d38edbc
48 changed files with 2936 additions and 909 deletions
+29
View File
@@ -0,0 +1,29 @@
import uuid
from datetime import datetime
from sqlalchemy import Boolean, DateTime, ForeignKey, Integer, String, func
from sqlalchemy.dialects.postgresql import UUID
from sqlalchemy.orm import Mapped, mapped_column
from app.db.base_class import Base
class MaterialEquipment(Base):
__tablename__ = "material_equipments"
id: Mapped[uuid.UUID] = mapped_column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4)
study_id: Mapped[uuid.UUID] = mapped_column(UUID(as_uuid=True), ForeignKey("studies.id"), index=True, nullable=False)
name: Mapped[str] = mapped_column(String(255), nullable=False)
spec_model: Mapped[str] = mapped_column(String(255), nullable=False)
unit: Mapped[str | None] = mapped_column(String(50), nullable=True)
brand: Mapped[str] = mapped_column(String(100), nullable=False)
origin: Mapped[str | None] = mapped_column(String(255), nullable=True)
production_permit_file_name: Mapped[str | None] = mapped_column(String(255), nullable=True)
tech_index_file_name: Mapped[str | None] = mapped_column(String(255), nullable=True)
need_calibration: Mapped[bool] = mapped_column(Boolean, nullable=False, server_default="false")
calibration_cycle_days: Mapped[int | None] = mapped_column(Integer, nullable=True)
created_by: Mapped[uuid.UUID | None] = mapped_column(UUID(as_uuid=True), ForeignKey("users.id"), nullable=True)
created_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), nullable=False, server_default=func.now())
updated_at: Mapped[datetime] = mapped_column(
DateTime(timezone=True), nullable=False, server_default=func.now(), onupdate=func.now()
)