From 79dada422696ba044854bb606869cd379fa80809 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 17 Oct 2026 10:39:01 +0800 Subject: [PATCH] ui: type-aware editor form + detail reordered by importance --- .../components/records/RecordDetailDialog.tsx | 140 ++++---- .../components/records/RecordEditorDialog.tsx | 147 ++++---- app/src/lib/typeProfiles.ts | 25 ++ ...Page-CvXqFjxQ.js => AdminPage-Dcg7zdwR.js} | 6 +- ...-DiCrzien.js => DashboardPage-Dwtnc-2L.js} | 2 +- ...age-NB__ODNR.js => GradesPage-Dbm013_S.js} | 2 +- ...ge-Btqncm1G.js => RecordsPage-ChyLehha.js} | 2 +- ...e-P178KH9X.js => TaxonomyPage-Co-11tkH.js} | 2 +- ...Page-B579jwyf.js => TypesPage-CMjoR68B.js} | 2 +- .../{card-DASBiK00.js => card-DMi0z8Hh.js} | 2 +- sync-server/www/assets/index-B60u283l.css | 1 - sync-server/www/assets/index-BpXGbBE-.js | 322 ++++++++++++++++++ sync-server/www/assets/index-BxEr63go.js | 322 ------------------ sync-server/www/assets/index-D6K8zE2F.css | 1 + ...7PeojK9.js => mammoth.browser-BCRr-i_l.js} | 2 +- ...Chart-eUS_Zp3L.js => useChart-D4kPoPsx.js} | 2 +- sync-server/www/index.html | 4 +- 17 files changed, 519 insertions(+), 465 deletions(-) create mode 100644 app/src/lib/typeProfiles.ts rename sync-server/www/assets/{AdminPage-CvXqFjxQ.js => AdminPage-Dcg7zdwR.js} (97%) rename sync-server/www/assets/{DashboardPage-DiCrzien.js => DashboardPage-Dwtnc-2L.js} (94%) rename sync-server/www/assets/{GradesPage-NB__ODNR.js => GradesPage-Dbm013_S.js} (99%) rename sync-server/www/assets/{RecordsPage-Btqncm1G.js => RecordsPage-ChyLehha.js} (99%) rename sync-server/www/assets/{TaxonomyPage-P178KH9X.js => TaxonomyPage-Co-11tkH.js} (97%) rename sync-server/www/assets/{TypesPage-B579jwyf.js => TypesPage-CMjoR68B.js} (98%) rename sync-server/www/assets/{card-DASBiK00.js => card-DMi0z8Hh.js} (89%) delete mode 100644 sync-server/www/assets/index-B60u283l.css create mode 100644 sync-server/www/assets/index-BpXGbBE-.js delete mode 100644 sync-server/www/assets/index-BxEr63go.js create mode 100644 sync-server/www/assets/index-D6K8zE2F.css rename sync-server/www/assets/{mammoth.browser-C7PeojK9.js => mammoth.browser-BCRr-i_l.js} (99%) rename sync-server/www/assets/{useChart-eUS_Zp3L.js => useChart-D4kPoPsx.js} (92%) diff --git a/app/src/components/records/RecordDetailDialog.tsx b/app/src/components/records/RecordDetailDialog.tsx index f92ba1a..efadab4 100644 --- a/app/src/components/records/RecordDetailDialog.tsx +++ b/app/src/components/records/RecordDetailDialog.tsx @@ -131,7 +131,7 @@ export function RecordDetailDialog({ open, onClose, footprintId, onEdit }: {
加载中…
) : (
- {/* 徽章行 */} + {/* 徽章行:类型 · 级别 · 奖等 · 角色 · 状态 · 名次 */}
{d.type_name} @@ -142,15 +142,69 @@ export function RecordDetailDialog({ open, onClose, footprintId, onEdit }: { {d.rank != null && 第 {d.rank} 名}
- {/* 基本信息网格 */} -
- - - {d.group_id && } - {d.parent_id != null && } - - -
+ {/* 事项要素:时间/组织方 + 类型专属字段(按模板定义顺序 = 重要性顺序) */} +
+
+ + + {fields.map(f => )} +
+
+ + {/* 附件佐证 */} + {(d.attachments?.length ?? 0) > 0 && ( +
+ {atts.length ? ( +
+ {images.length > 0 && ( +
+ {images.map(a => ( + + ))} +
+ )} + {docs.length > 0 && ( +
+ {docs.map(a => ( + + ))} +
+ )} +
点击图片 / 文件可在线预览(图片 · PDF · 文本 · Word · Excel · 音视频)
+
+ ) : ( +

暂无佐证附件

+ )} +
+ )} {d.description && (
@@ -164,14 +218,6 @@ export function RecordDetailDialog({ open, onClose, footprintId, onEdit }: {
)} - {fields.length > 0 && ( -
-
- {fields.map(f => )} -
-
- )} - {(d.metrics && Object.keys(d.metrics).length > 0) && (
@@ -197,57 +243,13 @@ export function RecordDetailDialog({ open, onClose, footprintId, onEdit }: {
)} -
- {atts.length ? ( -
- {images.length > 0 && ( -
- {images.map(a => ( - - ))} -
- )} - {docs.length > 0 && ( -
- {docs.map(a => ( - - ))} -
- )} -
点击图片 / 文件可在线预览(图片 · PDF · 文本 · Word · Excel · 音视频)
-
- ) : ( -

暂无佐证附件

- )} -
+ {/* 系统信息(最末位) */} +
+ 创建于 {fmtDateTime(d.created_at)} + 更新于 {fmtDateTime(d.updated_at)} + {d.group_id && 事件组 {d.group_id}} + {d.parent_id != null && 上级 #{d.parent_id}} +
)} diff --git a/app/src/components/records/RecordEditorDialog.tsx b/app/src/components/records/RecordEditorDialog.tsx index a56bb00..40ec1b6 100644 --- a/app/src/components/records/RecordEditorDialog.tsx +++ b/app/src/components/records/RecordEditorDialog.tsx @@ -11,6 +11,7 @@ import { Button, Dialog, Field, Input, Select, Textarea, useToast } from '@/comp import { TagInput } from '@/components/common/TagInput'; import { DynamicForm, type TaxonomyOptionsMap } from '@/components/common/DynamicForm'; import { AttachmentPicker, fileToPending, type PendingAtt } from '@/components/common/AttachmentPicker'; +import { getTypeProfile } from '@/lib/typeProfiles'; interface FormState { type_id: number | null; @@ -83,6 +84,7 @@ export function RecordEditorDialog({ open, onClose, footprintId, onSaved }: { () => typesQ.data?.items.find(t => t.id === form.type_id), [typesQ.data, form.type_id] ); + const profile = getTypeProfile(selectedType?.name); const parentQ = useQuery({ queryKey: ['parent-candidates', form.type_id], @@ -182,6 +184,38 @@ export function RecordEditorDialog({ open, onClose, footprintId, onSaved }: { onSuccess: () => void qc.invalidateQueries({ queryKey: ['attachments', footprintId] }) }); + const renderCoreField = (key: string) => { + if (key === 'organizer') return ( + + set('organizer', e.target.value)} placeholder="如:中国工业与应用数学学会" /> + + ); + if (key === 'role') return ( + + set('level', e.target.value)} + options={[{ value: '', label: '未设置' }, ...(taxonomies['level'] ?? [])]} /> + + ); + if (key === 'award_grade') return ( + + set('rank', e.target.value)} placeholder="如 2" /> + + ); + return null; + }; + return (
- - set('organizer', e.target.value)} placeholder="如:中国工业与应用数学学会" /> - set('start_date', e.target.value)} /> set('end_date', e.target.value)} /> -
- -
- - set('level', e.target.value)} - options={[{ value: '', label: '未设置' }, ...(taxonomies['level'] ?? [])]} /> - set('weight', e.target.value)} - options={[1, 2, 3, 4, 5].map(n => ({ value: String(n), label: String(n) }))} /> -
-
- - set('rank', e.target.value)} placeholder="如 2" /> - - - set('parent_id', e.target.value)} - options={[ - { value: '', label: '无' }, - ...(parentQ.data?.items ?? []) - .filter(p => p.id !== footprintId) - .map(p => ({ value: String(p.id), label: p.title.slice(0, 24) })) - ]} - /> - +
+
+ 类型要素{selectedType ? ' · ' + selectedType.name : ''} +
+
+ {profile.core.map(k => renderCoreField(k))} +
+ + {selectedType && selectedType.form_template.length > 0 && ( +
+
专项信息
+ set('extras', v)} + taxonomies={taxonomies} + /> +
+ )}
-
+