|
@@ -36,7 +36,14 @@ export function paasCard(metadata: Record<string, unknown>, input: Record<string
|
|
|
}
|
|
}
|
|
|
const science = record(record(metadata.research)?.science)
|
|
const science = record(record(metadata.research)?.science)
|
|
|
const outcome = record(science?.outcome)
|
|
const outcome = record(science?.outcome)
|
|
|
- const outcomes = outcome?.schema_version === 1 && Array.isArray(outcome.lines)
|
|
|
|
|
|
|
+ const sections = outcome?.schema_version === 1 && Array.isArray(outcome.sections)
|
|
|
|
|
+ ? outcome.sections.flatMap((value) => {
|
|
|
|
|
+ const section = record(value)
|
|
|
|
|
+ if (!section || !text(section.title) || !Array.isArray(section.lines)) return []
|
|
|
|
|
+ return [text(section.title), ...section.lines.filter((line): line is string => typeof line === "string").map(text),
|
|
|
|
|
+ typeof section.omitted === "number" && section.omitted > 0 ? `另有 ${section.omitted} 项,见完整研究报告` : ""].filter(Boolean)
|
|
|
|
|
+ }) : []
|
|
|
|
|
+ const outcomes = sections.length ? sections : outcome?.schema_version === 1 && Array.isArray(outcome.lines)
|
|
|
? outcome.lines.filter((line): line is string => typeof line === "string").map(text) : []
|
|
? outcome.lines.filter((line): line is string => typeof line === "string").map(text) : []
|
|
|
const operation = record(science?.operation)
|
|
const operation = record(science?.operation)
|
|
|
const researchIR = record(science?.research_ir)
|
|
const researchIR = record(science?.research_ir)
|