- 新增 openapi-miniapp-company.yaml 文件,定义 tbl_company 的基础 CRUD 接口文档,包括查询、创建、更新和删除公司记录的详细描述和示例。 - 新增 pocketbase.file-fields-to-attachments.js 脚本,用于迁移 PocketBase 中的文件字段到文本字段,并处理 tbl_attachments 集合的公开规则。
3.2 KiB
document-manage-console Specification
Purpose
定义 /pb/manage/document-manage 的编辑、上传、反馈与附件管理体验,确保文档管理页在图片、视频、文件三类附件下保持一致交互。
Requirements
Requirement: Document management SHALL support three attachment categories
The document management console SHALL provide separate upload and editing areas for image attachments, video attachments, and generic file attachments, and the three categories SHALL all persist attachment IDs to the document record.
Scenario: User uploads generic files to a document
- WHEN a management user adds files in the file attachment area and saves the document
- THEN the saved document SHALL persist those attachment IDs in
document_file
Scenario: Existing attachments are editable by category
- WHEN a management user opens a document in edit mode
- THEN the page SHALL show existing images, videos, and files in their corresponding sections and allow removing them from the document
Requirement: Document editor visibility and state SHALL follow editing intent
The document management page SHALL load with the document list only, keep the editor hidden until the user enters create or edit mode, and SHALL remain in the current editing context after upload or save operations.
Scenario: Page loads without editor
- WHEN the user first opens
/pb/manage/document-manage - THEN the page SHALL show the document list and SHALL NOT show the editor section until create or edit mode is entered
Scenario: Save keeps current editing context
- WHEN the user successfully creates or updates a document
- THEN the page SHALL stay on the current document editing context instead of clearing the form and forcing a return to blank create mode
Scenario: Upload does not reset editor mode
- WHEN the user uploads attachments while editing a document
- THEN the page SHALL keep the current editor state and SHALL NOT implicitly switch modes
Requirement: Document management SHALL provide immediate user feedback
The document management console SHALL show operation feedback both in the global page status area and near the save actions so that users receive confirmation or error context without scrolling.
Scenario: Local save feedback is visible
- WHEN a save or upload request succeeds or fails
- THEN the page SHALL show the status message below the save controls in addition to the top-level message area
Scenario: Long-running requests show blocking feedback
- WHEN the page is waiting for a long-running upload, save, delete, or query response
- THEN it SHALL show a full-screen loading mask so the user can tell the action is in progress
Requirement: Document and dictionary images SHALL support full-screen preview
Image previews rendered in the management pages SHALL support opening the original image in a full-screen preview overlay.
Scenario: User previews an image
- WHEN the user clicks an image preview in document or dictionary management
- THEN the page SHALL open a full-screen overlay showing the original image and SHALL allow closing it with explicit controls