feat(文档库): 补检查类型与关联项目标签并按关联项目编码搜索
按原型 V10.2 卡片上的两条信息补齐(此前完全没有对应字段):
- DocumentRecord / TemplateResponseDto 增加 examType 与 projectCodes(可选)。
后端当前不返回,声明为可选是为了它补齐后前端不用再改;取不到时整条标签不渲染。
- 卡片渲染「🔬 检查类型」标签(原型 .exam-tag 蓝底)与「关联项目」编码
(原型 .proj-code 紫底等宽),配色照抄原型。
- 搜索关键词纳入检查类型与关联项目编码,占位文案改为原型的
「搜索模板名 / 编号 / 科室 / 关联项目编码」。
- 演示种子补 projectCodes: ['PHA-NAR'](原型 library 里这份文书就是这条)。
刻意不给 examType:麻精同意书是告知类文书,本来就不挂检查类型,
演示里看不到这条标签是正确结果,不编造取值。
- mock.ts 的 toLocalDocument 是逐字段列出的,同步带上两个新字段,
否则演示文库保存一次,卡片上的标签就丢了。
This commit is contained in:
@@ -110,6 +110,10 @@ function mapDocument(dto: TemplateResponseDto): DocumentRecord {
|
||||
departmentName: dto.departmentId ? undefined : '全院通用',
|
||||
campusId: dto.campusId,
|
||||
description: dto.description ?? '',
|
||||
// 后端补齐这两个字段后卡片会自动显示「检查类型 / 关联项目」;
|
||||
// 现在取不到就是 undefined,卡片不渲染对应标签,不伪造取值
|
||||
examType: dto.examType ?? undefined,
|
||||
projectCodes: dto.projectCodes ?? undefined,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -34,6 +34,21 @@ export interface DocumentRecord {
|
||||
campusId?: string | null
|
||||
campusName?: string
|
||||
description?: string
|
||||
/**
|
||||
* 检查类型(原型 V10.2 卡片上的「🔬 检查类型:xxx」)。
|
||||
*
|
||||
* 只有检查/检验类文书才有值(如「平扫 / 增强」「分子检测」),
|
||||
* 告知类文书为空。当前后端模板接口不返回它,因此**真实模式下为空时整条标签不渲染**,
|
||||
* 不为它编一个取值。
|
||||
*/
|
||||
examType?: string | null
|
||||
/**
|
||||
* 关联项目编码(原型 V10.2 卡片上的「关联项目」编码串)。
|
||||
*
|
||||
* 用于把文书与 HIS 的检查/检验项目对应起来,卡片上以 `.proj-code` 小标签展示。
|
||||
* 同样只在后端提供时才有值,缺省即不显示。
|
||||
*/
|
||||
projectCodes?: string[]
|
||||
contentHtml?: string
|
||||
contentSha256?: string
|
||||
/** 当前已发布版本;发起签署必须使用它,不能误用最新草稿版本。 */
|
||||
@@ -60,6 +75,14 @@ export interface TemplateResponseDto {
|
||||
campusId: string
|
||||
departmentId?: string | null
|
||||
category?: string | null
|
||||
/**
|
||||
* 检查类型与关联项目编码(原型 V10.2 卡片上的两条信息)。
|
||||
*
|
||||
* 当前后端不返回,声明为可选是为了在它补齐后**不需要再改前端**就能显示出来;
|
||||
* 取不到时卡片整条标签不渲染,不编造取值。
|
||||
*/
|
||||
examType?: string | null
|
||||
projectCodes?: string[] | null
|
||||
status?: BackendTemplateStatus | null
|
||||
currentVersionId?: string | null
|
||||
latestVersionId?: string | null
|
||||
|
||||
Reference in New Issue
Block a user