deeafe239f
前端: - 新增 Pinia theme store,localStorage 持久化,data-theme 切换 - App.vue: :root 新增 --font-*/--sidebar-* CSS 变量;新增 :root[data-theme=light] 完整配色(极简黑白金 + Noto Sans SC) - DesktopLayout: 侧边栏 15 个变量化 + 顶栏主题切换按钮 - MobileLayout: 装饰色变量化 - Settings: 新增「界面主题」卡片 - 21 个组件 font-family 统一替换为 var(--font-*) - 新增 utils/managerColor.ts — 12 色调色板 + 自适应文字色 + 后端自定义色优先 - WorkPlans/MiniBusiness/KeyVisits/CustomerManage: 客户经理标签色统一走共享工具 - UserManage: 编辑弹窗新增颜色选择器(仅 manager) - LightBoard: 去标题星标图标 - ManagerWorkspace/WorkPlans/MiniBusiness/KeyVisits: 删除按钮改为实心红底白字 后端: - User 模型新增 color 列 + lifespan 自动迁移 - users API 支持 color 字段读写 - UserOut schema 新增 color Co-Authored-By: Claude <noreply@anthropic.com>
21 lines
1017 B
Python
21 lines
1017 B
Python
import uuid
|
|
from datetime import datetime
|
|
from sqlalchemy import String, DateTime, func
|
|
from sqlalchemy.orm import Mapped, mapped_column
|
|
from sqlalchemy.dialects.postgresql import UUID
|
|
from app.database import Base
|
|
|
|
|
|
class User(Base):
|
|
__tablename__ = "users"
|
|
|
|
id: Mapped[uuid.UUID] = mapped_column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4)
|
|
casdoor_id: Mapped[str] = mapped_column(String(100), unique=True, index=True)
|
|
name: Mapped[str] = mapped_column(String(50))
|
|
role: Mapped[str] = mapped_column(String(30)) # manager / director / leader
|
|
department: Mapped[str] = mapped_column(String(100), default="")
|
|
wecom_userid: Mapped[str | None] = mapped_column(String(100), unique=True, nullable=True)
|
|
require_report: Mapped[bool] = mapped_column(default=True, server_default="true")
|
|
color: Mapped[str | None] = mapped_column(String(7), nullable=True) # e.g. "#C62828"
|
|
created_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), server_default=func.now())
|