Skip to content

[P0] field-type: file field has no upload UI; no attachment_list type — attachments end-to-end blocked #1296

Description

@xuyushun441-sys

来源:docs/PLATFORM_GAPS_FROM_TEMPLATES.md 第 3 + 第 28 条(P0,合并)。
实证发现自 contracts / compliance / procurement / helpdesk 4 个模板。

本 issue 把缺陷 #3(单文件字段无上传 UI)与 #28(附件 / 附件列表)合并处理:两者是同一组件能力的两个 step(单文件 → 多文件 + 拖拽 + 缩略图)。

现象

  • file 字段类型存在于 spec 里,但没有端到端可用的上传 UI:表单 / 详情页里看不到「上传」按钮。
  • 没有「附件列表 / 多文件」字段类型:合同附件、整改证据、报销发票、客户截图全部无落地。
  • 即使勉强通过 API 上传到 storage,UI 也无法预览、下载、删除。

复现

# contracts 模板 contracts_contract 对象上加:
{ name: 'signed_pdf', type: 'file' }
# pnpm dev 后打开记录详情页 — 字段呈现为空白或被吞掉,没有上传控件

当前 workaround

  • contracts 在 README 里写「附件请通过外部链接(OneDrive / Notion)记录 URL」。
  • compliance 把证据材料降级成 textarea,让用户贴链接。
  • helpdesk 直接不实现客户截图。

均不符合企业级体验。

业务覆盖矩阵

场景 文件数 类型 备注
合同签署 PDF 1-3 pdf 主合同 + 附录
整改证据 多 image / pdf / docx 多次补充
报销凭证 多 image / pdf 拍照为主
客服截图 0-N image 高频
KB 文章配图 N image 富文本内嵌
工单附件 0-N 任意 含日志 zip

建议范围

M1:file 单文件字段端到端

  • spec:file 字段在 form / detail / list 都有渲染:拖拽 / 选择 / 进度 / 替换 / 下载 / 删除
  • storage 后端:用现成 StorageServicePlugin,先 local fs,扩展点支持 S3 / OSS
  • 显示:列表小 chip(含文件名 + size),详情大卡片(含预览 thumbnail)

M2:attachment_list 字段类型(多文件)

  • spec 新增字段类型 attachment_list,子项是 { file, name, mime, size, uploadedBy, uploadedAt, caption? }
  • UI:拖拽多文件 / 排序 / 单独删除 / 内联预览

M3:与 message composer 集成

M4:访问控制

  • 通过 sharing 规则继承父记录权限
  • 短时签名 URL 防止越权直链

验收

关联

Activity

  1. added
    bugSomething isn't working
    enhancementNew feature or request
    priority:p0Critical: blocker, must ship before MVP
    on May 25, 2026
  2. os-zhuang commented on Jun 27, 2026

    @os-zhuang
    Contributor

    Triage (2026-06-27, for 11.0 epic #2364): looks RESOLVED. file field type exists (packages/spec/src/data/field.zod.ts) and objectui ships a full FileField widget (drag-drop, camera, per-file progress, multi-file) wired to useUpload(). Remaining question: is a distinct attachment_list type still wanted, or does file (multiple) cover it? If the latter, this can close.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingenhancementNew feature or requestpriority:p0Critical: blocker, must ship before MVP

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions