From 5c5c8e4b2c89956fbfb8131f8837582091406205 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 25 Nov 2026 09:36:43 +0000 Subject: [PATCH] =?UTF-8?q?=E5=AF=BC=E5=85=A5=E5=B7=A5=E5=85=B7=E7=BB=B4?= =?UTF-8?q?=E6=8A=A4=E7=9A=84=E5=AD=97=E6=AE=B5=E4=B8=8D=E5=86=8D=E5=87=BA?= =?UTF-8?q?=E7=8E=B0=E5=9C=A8=E7=95=8C=E9=9D=A2=E4=B8=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 条号索引、字数、token 估算、内容哈希(附件还有有文本、自动带出的所属制度和现行) 加 hidden,不进表单;列表去掉字数、有文本两列。导入工具经接口照常写入(已实测)。 原件单独一组「原件」,默认折叠。 Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01RKKVniLvsfBswNHAfKKTVi --- src/objects/policy-attachment.object.ts | 16 ++++++++-------- src/objects/policy-version.object.ts | 12 ++++++------ src/views/policy-attachment.view.ts | 2 -- src/views/policy-version.view.ts | 1 - 4 files changed, 14 insertions(+), 17 deletions(-) diff --git a/src/objects/policy-attachment.object.ts b/src/objects/policy-attachment.object.ts index 86cf6ec..34888bd 100644 --- a/src/objects/policy-attachment.object.ts +++ b/src/objects/policy-attachment.object.ts @@ -40,8 +40,8 @@ export const PolicyAttachment = ObjectSchema.create({ fieldGroups: [ { key: 'basic', label: '附件信息' }, { key: 'content', label: '附件正文' }, - // 自动带出 / 导入工具维护的字段和原件:收在最后,默认折叠 - { key: 'import', label: '原件与导入信息', collapse: 'collapsed' }, + // 原件单独一组、默认折叠;自动带出(所属制度、现行)和导入工具维护的字段 hidden,不进表单 + { key: 'import', label: '原件', collapse: 'collapsed' }, ], fields: { @@ -58,7 +58,7 @@ export const PolicyAttachment = ObjectSchema.create({ group: 'basic', deleteBehavior: 'cascade', }), - policy: Field.lookup('brightrule_policy', { + policy: Field.lookup('brightrule_policy', { hidden: true, label: '所属制度', group: 'import', description: '由所属版本自动带出', @@ -81,7 +81,7 @@ export const PolicyAttachment = ObjectSchema.create({ description: '原文里的编号,如「附件1」「附表2」', }), sort_no: Field.number({ label: '序号', scale: 0, min: 1, group: 'basic', }), - is_current: Field.boolean({ + is_current: Field.boolean({ hidden: true, label: '现行', defaultValue: false, group: 'import', @@ -96,10 +96,10 @@ export const PolicyAttachment = ObjectSchema.create({ description: '规范性附件的全文(Markdown,已脱敏);表单、仅原件的附件为空', }), - has_text: Field.boolean({ label: '有文本', defaultValue: false, group: 'import' }), - text_chars: Field.number({ label: '字数', scale: 0, min: 0, group: 'import' }), - text_tokens: Field.number({ label: 'Token 估算', scale: 0, min: 0, group: 'import' }), - content_hash: Field.text({ + has_text: Field.boolean({ hidden: true, label: '有文本', defaultValue: false, group: 'import' }), + text_chars: Field.number({ hidden: true, label: '字数', scale: 0, min: 0, group: 'import' }), + text_tokens: Field.number({ hidden: true, label: 'Token 估算', scale: 0, min: 0, group: 'import' }), + content_hash: Field.text({ hidden: true, label: '内容哈希', maxLength: 64, group: 'import', diff --git a/src/objects/policy-version.object.ts b/src/objects/policy-version.object.ts index f8aa312..5f2d2c4 100644 --- a/src/objects/policy-version.object.ts +++ b/src/objects/policy-version.object.ts @@ -40,8 +40,8 @@ export const PolicyVersion = ObjectSchema.create({ fieldGroups: [ { key: 'details', label: '版本信息' }, { key: 'content', label: '正文' }, - // 导入工具维护的字段和原件:收在最后,默认折叠 - { key: 'import', label: '原件与导入信息', collapse: 'collapsed' }, + // 原件单独一组、默认折叠;导入工具维护的字段(条号索引、字数、token、哈希)hidden,不进表单 + { key: 'import', label: '原件', collapse: 'collapsed' }, ], fields: { @@ -66,16 +66,16 @@ export const PolicyVersion = ObjectSchema.create({ group: 'content', description: '脱敏后的正文全文(Markdown):条文以 **第X条** 开头,章节用 ## 标题。AI 按它作答,规范性附件的全文在附件里', }), - article_index: Field.json({ + article_index: Field.json({ hidden: true, label: '条号索引', group: 'import', description: '每一条:{ article, chapter, redacted: [起, 止] },偏移按正文的码点计;作答时直接读 body_md 即可', }), original_file: Field.file({ label: '正文原件(docx / PDF)', group: 'import' }), - text_chars: Field.number({ label: '字数', scale: 0, min: 0, group: 'import', description: '正文的字数(码点数);0 表示还没有正文' }), - text_tokens: Field.number({ label: 'Token 估算', scale: 0, min: 0, group: 'import' }), - content_hash: Field.text({ + text_chars: Field.number({ hidden: true, label: '字数', scale: 0, min: 0, group: 'import', description: '正文的字数(码点数);0 表示还没有正文' }), + text_tokens: Field.number({ hidden: true, label: 'Token 估算', scale: 0, min: 0, group: 'import' }), + content_hash: Field.text({ hidden: true, label: '内容哈希', maxLength: 64, group: 'import', diff --git a/src/views/policy-attachment.view.ts b/src/views/policy-attachment.view.ts index bc2d7fd..eccc855 100644 --- a/src/views/policy-attachment.view.ts +++ b/src/views/policy-attachment.view.ts @@ -15,8 +15,6 @@ const policyAttachmentViews: UI.View = { { field: 'attachment_class' }, { field: 'sort_no' }, { field: 'is_current' }, - { field: 'has_text' }, - { field: 'text_chars' }, ], sort: [{ field: 'sort_no', order: 'asc' }], }, diff --git a/src/views/policy-version.view.ts b/src/views/policy-version.view.ts index 83194a7..8977429 100644 --- a/src/views/policy-version.view.ts +++ b/src/views/policy-version.view.ts @@ -25,7 +25,6 @@ const policyVersionViews: UI.View = { { field: 'policy' }, { field: 'version_no' }, { field: 'effective_date' }, - { field: 'text_chars' }, { field: 'change_note' }, ], filter: [{ field: 'version_status', operator: 'equals', value: 'draft' }],