Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/objects/policy-attachment.object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand All @@ -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: '由所属版本自动带出',
Expand All @@ -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',
Expand All @@ -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',
Expand Down
12 changes: 6 additions & 6 deletions src/objects/policy-version.object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand All @@ -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',
Expand Down
2 changes: 0 additions & 2 deletions src/views/policy-attachment.view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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' }],
},
Expand Down
1 change: 0 additions & 1 deletion src/views/policy-version.view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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' }],
Expand Down