feat(文档库): 补检查类型与关联项目标签并按关联项目编码搜索

按原型 V10.2 卡片上的两条信息补齐(此前完全没有对应字段):

- DocumentRecord / TemplateResponseDto 增加 examType 与 projectCodes(可选)。
  后端当前不返回,声明为可选是为了它补齐后前端不用再改;取不到时整条标签不渲染。
- 卡片渲染「🔬 检查类型」标签(原型 .exam-tag 蓝底)与「关联项目」编码
  (原型 .proj-code 紫底等宽),配色照抄原型。
- 搜索关键词纳入检查类型与关联项目编码,占位文案改为原型的
  「搜索模板名 / 编号 / 科室 / 关联项目编码」。
- 演示种子补 projectCodes: ['PHA-NAR'](原型 library 里这份文书就是这条)。
  刻意不给 examType:麻精同意书是告知类文书,本来就不挂检查类型,
  演示里看不到这条标签是正确结果,不编造取值。
- mock.ts 的 toLocalDocument 是逐字段列出的,同步带上两个新字段,
  否则演示文库保存一次,卡片上的标签就丢了。
This commit is contained in:
yelan
2026-09-26 19:45:31 +08:00
parent 7a94368bea
commit f871613abe
7 changed files with 95 additions and 3 deletions
@@ -186,9 +186,18 @@ const filteredTemplates = computed(() => {
const matchesDepartment = !filters.department || template.departmentKey === filters.department
const matchesStatus =
filters.status === 'all' || readLibraryStatus(template) === filters.status
// 搜索范围照原型:模板名 / 编号 / 科室 / 分类,外加检查类型与关联项目编码。
// 后两者是卡片上看得见的字段,搜不到会让人以为这份文书不存在。
const matchesKeyword =
!keyword ||
[template.name, template.code, template.department, template.category]
[
template.name,
template.code ?? '',
template.department,
template.category,
template.examType ?? '',
(template.projectCodes ?? []).join(','),
]
.join(' ')
.toLowerCase()
.includes(keyword)