|
@@ -414,6 +414,7 @@ export default {
|
|
|
confirming: false,
|
|
confirming: false,
|
|
|
payload: {
|
|
payload: {
|
|
|
type: 'gut_flora',
|
|
type: 'gut_flora',
|
|
|
|
|
+ reportFormat: '',
|
|
|
summary: {},
|
|
summary: {},
|
|
|
indicators: [],
|
|
indicators: [],
|
|
|
gutFlora: [],
|
|
gutFlora: [],
|
|
@@ -595,6 +596,10 @@ export default {
|
|
|
if (res.data.payload) {
|
|
if (res.data.payload) {
|
|
|
self.payload = Object.assign({}, self.defaultPayload(), res.data.payload)
|
|
self.payload = Object.assign({}, self.defaultPayload(), res.data.payload)
|
|
|
}
|
|
}
|
|
|
|
|
+ // 报告来源格式优先取 payload,兜底取 report 实体字段
|
|
|
|
|
+ if (!self.payload.reportFormat && report.reportFormat) {
|
|
|
|
|
+ self.payload.reportFormat = report.reportFormat
|
|
|
|
|
+ }
|
|
|
// 后端无 blocks 时从 payload 自动组装
|
|
// 后端无 blocks 时从 payload 自动组装
|
|
|
var cleanBlocks = self.stripFoodBlocks(backendBlocks)
|
|
var cleanBlocks = self.stripFoodBlocks(backendBlocks)
|
|
|
if (cleanBlocks.length > 0) {
|
|
if (cleanBlocks.length > 0) {
|
|
@@ -620,6 +625,7 @@ export default {
|
|
|
defaultPayload() {
|
|
defaultPayload() {
|
|
|
return {
|
|
return {
|
|
|
type: 'gut_flora',
|
|
type: 'gut_flora',
|
|
|
|
|
+ reportFormat: '',
|
|
|
summary: {},
|
|
summary: {},
|
|
|
indicators: [],
|
|
indicators: [],
|
|
|
gutFlora: [],
|
|
gutFlora: [],
|
|
@@ -1072,25 +1078,37 @@ export default {
|
|
|
var p = this.payload
|
|
var p = this.payload
|
|
|
if (!p) return blocks
|
|
if (!p) return blocks
|
|
|
|
|
|
|
|
- // 1. 评分圆环块
|
|
|
|
|
|
|
+ // 1. 评分圆环块(北京/谷禾报告评分体系不同:北京用 GMHI 指数,谷禾用健康总分)
|
|
|
var scoreItems = []
|
|
var scoreItems = []
|
|
|
|
|
+ var isBeijing = p.reportFormat === 'beijing'
|
|
|
if (p.summary) {
|
|
if (p.summary) {
|
|
|
- this._addScoreItem(scoreItems, '综合', p.summary.overallScore)
|
|
|
|
|
- this._addScoreItem(scoreItems, '菌群健康', p.summary.gutHealthScore)
|
|
|
|
|
- this._addScoreItem(scoreItems, '慢病控制', p.summary.chronicDiseaseScore)
|
|
|
|
|
- // 子项
|
|
|
|
|
- if (p.summary.nutritionScore != null) { this._addSubScore(scoreItems, '综合', '营养均衡', p.summary.nutritionScore) }
|
|
|
|
|
- if (p.summary.gutBalanceScore != null) { this._addSubScore(scoreItems, '菌群健康', '平衡', p.summary.gutBalanceScore) }
|
|
|
|
|
- if (p.summary.gutDiversityScore != null) { this._addSubScore(scoreItems, '菌群健康', '多样性', p.summary.gutDiversityScore) }
|
|
|
|
|
- if (p.summary.beneficialBacteriaScore != null) { this._addSubScore(scoreItems, '菌群健康', '有益菌', p.summary.beneficialBacteriaScore) }
|
|
|
|
|
- if (p.summary.harmfulBacteriaScore != null) { this._addSubScore(scoreItems, '菌群健康', '有害菌', p.summary.harmfulBacteriaScore) }
|
|
|
|
|
- if (p.summary.coreSpeciesScore != null) { this._addSubScore(scoreItems, '菌群健康', '核心菌属', p.summary.coreSpeciesScore) }
|
|
|
|
|
- // 肠道年龄/肠型
|
|
|
|
|
|
|
+ if (isBeijing) {
|
|
|
|
|
+ // 北京菌群报告:GMHI 肠道微生物健康指数为主评分
|
|
|
|
|
+ this._addScoreItem(scoreItems, 'GMHI 肠道微生物健康指数', p.summary.overallScore != null ? p.summary.overallScore : p.summary.gmhiIndex)
|
|
|
|
|
+ this._addScoreItem(scoreItems, '菌群健康', p.summary.gutHealthScore)
|
|
|
|
|
+ if (p.summary.gutBalanceScore != null) { this._addSubScore(scoreItems, '菌群健康', '平衡', p.summary.gutBalanceScore) }
|
|
|
|
|
+ if (p.summary.gutDiversityScore != null) { this._addSubScore(scoreItems, '菌群健康', '多样性', p.summary.gutDiversityScore) }
|
|
|
|
|
+ if (p.summary.beneficialBacteriaScore != null) { this._addSubScore(scoreItems, '菌群健康', '有益菌', p.summary.beneficialBacteriaScore) }
|
|
|
|
|
+ if (p.summary.coreSpeciesScore != null) { this._addSubScore(scoreItems, '菌群健康', '核心菌属', p.summary.coreSpeciesScore) }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // 谷禾/其它报告:健康总分 + 细分维度
|
|
|
|
|
+ this._addScoreItem(scoreItems, '综合', p.summary.overallScore)
|
|
|
|
|
+ this._addScoreItem(scoreItems, '菌群健康', p.summary.gutHealthScore)
|
|
|
|
|
+ this._addScoreItem(scoreItems, '慢病控制', p.summary.chronicDiseaseScore)
|
|
|
|
|
+ // 子项
|
|
|
|
|
+ if (p.summary.nutritionScore != null) { this._addSubScore(scoreItems, '综合', '营养均衡', p.summary.nutritionScore) }
|
|
|
|
|
+ if (p.summary.gutBalanceScore != null) { this._addSubScore(scoreItems, '菌群健康', '平衡', p.summary.gutBalanceScore) }
|
|
|
|
|
+ if (p.summary.gutDiversityScore != null) { this._addSubScore(scoreItems, '菌群健康', '多样性', p.summary.gutDiversityScore) }
|
|
|
|
|
+ if (p.summary.beneficialBacteriaScore != null) { this._addSubScore(scoreItems, '菌群健康', '有益菌', p.summary.beneficialBacteriaScore) }
|
|
|
|
|
+ if (p.summary.harmfulBacteriaScore != null) { this._addSubScore(scoreItems, '菌群健康', '有害菌', p.summary.harmfulBacteriaScore) }
|
|
|
|
|
+ if (p.summary.coreSpeciesScore != null) { this._addSubScore(scoreItems, '菌群健康', '核心菌属', p.summary.coreSpeciesScore) }
|
|
|
|
|
+ }
|
|
|
|
|
+ // 肠道年龄/肠型(两种格式均有或部分有)
|
|
|
if (p.summary.gutAge) { this._addScoreItem(scoreItems, '肠道年龄', p.summary.gutAge) }
|
|
if (p.summary.gutAge) { this._addScoreItem(scoreItems, '肠道年龄', p.summary.gutAge) }
|
|
|
if (p.summary.gutType) { this._addScoreItem(scoreItems, '肠型', p.summary.gutType) }
|
|
if (p.summary.gutType) { this._addScoreItem(scoreItems, '肠型', p.summary.gutType) }
|
|
|
}
|
|
}
|
|
|
if (scoreItems.length > 0) {
|
|
if (scoreItems.length > 0) {
|
|
|
- blocks.push({ type: 'score', title: '健康评分', items: scoreItems })
|
|
|
|
|
|
|
+ blocks.push({ type: 'score', title: isBeijing ? '肠道微生物健康指数' : '健康评分', items: scoreItems })
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 2. 疾病风险分组块
|
|
// 2. 疾病风险分组块
|