|
|
@@ -25,6 +25,46 @@
|
|
|
<view v-if="pageMode==='view'">
|
|
|
<report-blocks-renderer v-if="blocks && blocks.length > 0" :blocks="blocks" @help="onBlockHelp" />
|
|
|
<view class="empty-hint" v-else>暂无报告内容</view>
|
|
|
+
|
|
|
+ <!-- guhe_v2 报告:异常菌清单 + 亚健康诊断(§6.2 接口附加字段 · 入库前核对) -->
|
|
|
+ <view class="card guhe-v2-card" v-if="guheV2SummaryVisible">
|
|
|
+ <view class="guhe-summary-block" v-if="subhealthLabel || fbRatio || shannonIndexNorm">
|
|
|
+ <view class="card-title">
|
|
|
+ <text>亚健康诊断</text>
|
|
|
+ </view>
|
|
|
+ <view class="guhe-subhealth-row" v-if="subhealthLabel">
|
|
|
+ <text class="guhe-label">亚健康诊断</text>
|
|
|
+ <text class="guhe-subhealth-value">{{ subhealthLabel }}</text>
|
|
|
+ </view>
|
|
|
+ <view class="guhe-ratio-row" v-if="fbRatio || shannonIndexNorm">
|
|
|
+ <text class="guhe-ratio-item" v-if="fbRatio">F/B 比值:{{ fbRatio }}</text>
|
|
|
+ <text class="guhe-ratio-item" v-if="shannonIndexNorm">菌群多样性:{{ shannonIndexNorm }}</text>
|
|
|
+ </view>
|
|
|
+ <view class="guhe-selfcheck" v-if="hasParseSelfCheck">
|
|
|
+ <text class="guhe-selfcheck-text">解析自检:{{ parseSelfCheckText }}</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <view class="card-title" v-if="abnormalSpecies && abnormalSpecies.length > 0">
|
|
|
+ <text>异常菌清单</text>
|
|
|
+ <text class="title-count">共 {{ abnormalSpecies.length }} 条</text>
|
|
|
+ </view>
|
|
|
+ <view class="guhe-species-item" v-for="(item, idx) in abnormalSpecies" :key="getSpeciesKey(idx)">
|
|
|
+ <view class="guhe-species-head">
|
|
|
+ <text class="guhe-species-name">{{ item.cnName || item.latinName || '未知菌种' }}</text>
|
|
|
+ <text class="guhe-species-latin" v-if="item.latinName">{{ item.latinName }}</text>
|
|
|
+ <text class="guhe-species-dir" v-if="item.direction">{{ item.direction }}</text>
|
|
|
+ </view>
|
|
|
+ <view class="guhe-species-detail">
|
|
|
+ <text class="guhe-species-meta" v-if="item.abundance">丰度 {{ item.abundance }}</text>
|
|
|
+ <text class="guhe-species-meta" v-if="item.refRange">参考 {{ item.refRange }}</text>
|
|
|
+ <text class="guhe-species-meta" v-if="item.category">{{ item.category }}</text>
|
|
|
+ </view>
|
|
|
+ <text class="guhe-species-func" v-if="item.functionDesc">{{ item.functionDesc }}</text>
|
|
|
+ </view>
|
|
|
+ <view class="empty-hint" v-if="!abnormalSpecies || abnormalSpecies.length === 0">暂无非异常菌记录</view>
|
|
|
+ </view>
|
|
|
+
|
|
|
<view class="edit-btn" v-if="isGutFlora && pageMode==='view'">
|
|
|
<view class="nav-edit" @tap="enterEditMode"><text>{{ backendBlocksExist ? '编辑' : '查看完整数据 ›' }}</text></view>
|
|
|
</view>
|
|
|
@@ -536,7 +576,16 @@ export default {
|
|
|
// 三档筛选:all 全部 / changed 有变化 / abnormal 异常
|
|
|
indicatorFilter: 'all',
|
|
|
// D1 裁定:「显示变化对照」默认开
|
|
|
- showChangeCompare: true
|
|
|
+ showChangeCompare: true,
|
|
|
+ // ===== 谷禾新版(guhe_v2)报告详情附加字段(§6.2 接口契约)=====
|
|
|
+ // 异常菌清单(↑↓ 分组 12 条)、物种功能库(76 条)、F/B 比值、菌群多样性评级、
|
|
|
+ // 亚健康诊断标签、解析自检 JSON —— 由详情接口响应透传到组件状态,供展示卡片消费
|
|
|
+ abnormalSpecies: [],
|
|
|
+ speciesLibrary: [],
|
|
|
+ subhealthLabel: '',
|
|
|
+ fbRatio: '',
|
|
|
+ shannonIndexNorm: '',
|
|
|
+ parseSelfCheck: {}
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -727,6 +776,25 @@ export default {
|
|
|
if (lists[i] && lists[i].length) total += lists[i].length
|
|
|
}
|
|
|
return total
|
|
|
+ },
|
|
|
+ // ===== guhe_v2 报告展示卡片相关计算属性(§6.2 契约)=====
|
|
|
+ guheV2SummaryVisible() {
|
|
|
+ return !!(this.subhealthLabel || this.fbRatio || this.shannonIndexNorm ||
|
|
|
+ (this.abnormalSpecies && this.abnormalSpecies.length > 0))
|
|
|
+ },
|
|
|
+ hasParseSelfCheck() {
|
|
|
+ return this.parseSelfCheck && typeof this.parseSelfCheck === 'object' &&
|
|
|
+ Object.keys(this.parseSelfCheck).length > 0
|
|
|
+ },
|
|
|
+ parseSelfCheckText() {
|
|
|
+ if (!this.hasParseSelfCheck) return ''
|
|
|
+ var p = this.parseSelfCheck
|
|
|
+ var parts = []
|
|
|
+ if (p.通过 !== undefined) parts.push(p.通过 ? '通过' : '未通过')
|
|
|
+ if (p.P0 !== undefined) parts.push('P0: ' + p.P0)
|
|
|
+ if (p.P1 !== undefined) parts.push('P1: ' + p.P1)
|
|
|
+ if (p.errorText) parts.push(p.errorText)
|
|
|
+ return parts.length ? parts.join(';') : JSON.stringify(p)
|
|
|
}
|
|
|
},
|
|
|
onLoad(options) {
|
|
|
@@ -752,6 +820,10 @@ export default {
|
|
|
openFeedback: function() {
|
|
|
this.feedbackVisible = true
|
|
|
},
|
|
|
+ // guhe_v2 异常菌条目 :key(数组无稳定业务主键,用遍历序号;模板禁带运算符表达式)
|
|
|
+ getSpeciesKey: function(idx) {
|
|
|
+ return 'species-' + idx
|
|
|
+ },
|
|
|
closeFeedback: function() {
|
|
|
this.feedbackVisible = false
|
|
|
},
|
|
|
@@ -771,6 +843,13 @@ export default {
|
|
|
head.reportDate = report.reportDate ? formatDate(report.reportDate) : ''
|
|
|
head.reportDateText = head.reportDate
|
|
|
self.headInfo = head
|
|
|
+ // ===== §6.2 guhe_v2 报告详情附加字段:透传到组件状态供展示卡片消费 =====
|
|
|
+ self.abnormalSpecies = (res.data.abnormalSpecies && Array.isArray(res.data.abnormalSpecies)) ? res.data.abnormalSpecies : []
|
|
|
+ self.speciesLibrary = (res.data.speciesLibrary && Array.isArray(res.data.speciesLibrary)) ? res.data.speciesLibrary : []
|
|
|
+ self.subhealthLabel = res.data.subhealthLabel || ''
|
|
|
+ self.fbRatio = res.data.fbRatio || ''
|
|
|
+ self.shannonIndexNorm = res.data.shannonIndexNorm || ''
|
|
|
+ self.parseSelfCheck = (res.data.parseSelfCheck && typeof res.data.parseSelfCheck === 'object') ? res.data.parseSelfCheck : {}
|
|
|
var backendBlocks = (res.data && res.data.blocks) || report.blocks || []
|
|
|
if (res.data.payload) {
|
|
|
self.payload = Object.assign({}, self.defaultPayload(), res.data.payload)
|
|
|
@@ -1712,6 +1791,111 @@ $c-rptd-orange-line: #FFD4A8; // 暖橙描边
|
|
|
color: $app-text-subtle;
|
|
|
margin-left: 8rpx;
|
|
|
}
|
|
|
+
|
|
|
+/* ===== guhe_v2 报告展示卡(§6.2 异常菌清单 + 亚健康诊断) ===== */
|
|
|
+.guhe-v2-card {
|
|
|
+ margin: 20rpx 0;
|
|
|
+ padding: 24rpx;
|
|
|
+ background: $app-surface;
|
|
|
+ border-radius: 16rpx;
|
|
|
+}
|
|
|
+.guhe-summary-block {
|
|
|
+ margin-bottom: 20rpx;
|
|
|
+}
|
|
|
+.guhe-subhealth-row {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row;
|
|
|
+ align-items: center;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ margin-top: 12rpx;
|
|
|
+}
|
|
|
+.guhe-label {
|
|
|
+ font-size: calc(24rpx * var(--font-scale, 1));
|
|
|
+ color: $facade-text-muted;
|
|
|
+ margin-right: 12rpx;
|
|
|
+}
|
|
|
+.guhe-subhealth-value {
|
|
|
+ font-size: calc(28rpx * var(--font-scale, 1));
|
|
|
+ font-weight: 600;
|
|
|
+ color: $mat-orange-strong;
|
|
|
+}
|
|
|
+.guhe-ratio-row {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ gap: 24rpx;
|
|
|
+ margin-top: 12rpx;
|
|
|
+}
|
|
|
+.guhe-ratio-item {
|
|
|
+ font-size: calc(24rpx * var(--font-scale, 1));
|
|
|
+ color: $facade-text-body;
|
|
|
+ background: $c-rptd-card;
|
|
|
+ padding: 8rpx 16rpx;
|
|
|
+ border-radius: 10rpx;
|
|
|
+}
|
|
|
+.guhe-selfcheck {
|
|
|
+ margin-top: 12rpx;
|
|
|
+}
|
|
|
+.guhe-selfcheck-text {
|
|
|
+ font-size: calc(22rpx * var(--font-scale, 1));
|
|
|
+ color: $facade-text-muted;
|
|
|
+ line-height: 1.6;
|
|
|
+}
|
|
|
+.guhe-species-item {
|
|
|
+ border: 2rpx solid $c-rptd-line;
|
|
|
+ border-radius: 14rpx;
|
|
|
+ padding: 18rpx;
|
|
|
+ margin-bottom: 16rpx;
|
|
|
+ background: $facade-fill-slate;
|
|
|
+}
|
|
|
+.guhe-species-head {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row;
|
|
|
+ align-items: center;
|
|
|
+ flex-wrap: wrap;
|
|
|
+}
|
|
|
+.guhe-species-name {
|
|
|
+ font-size: calc(28rpx * var(--font-scale, 1));
|
|
|
+ font-weight: 600;
|
|
|
+ color: $facade-text-strong;
|
|
|
+ margin-right: 12rpx;
|
|
|
+}
|
|
|
+.guhe-species-latin {
|
|
|
+ font-size: calc(22rpx * var(--font-scale, 1));
|
|
|
+ color: $facade-text-muted;
|
|
|
+ font-style: italic;
|
|
|
+ margin-right: 12rpx;
|
|
|
+ flex: 1;
|
|
|
+}
|
|
|
+.guhe-species-dir {
|
|
|
+ font-size: calc(24rpx * var(--font-scale, 1));
|
|
|
+ font-weight: 600;
|
|
|
+ color: $mat-orange-strong;
|
|
|
+ background: $c-rptd-orange-tint;
|
|
|
+ padding: 2rpx 12rpx;
|
|
|
+ border-radius: 8rpx;
|
|
|
+}
|
|
|
+.guhe-species-detail {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ gap: 16rpx;
|
|
|
+ margin-top: 12rpx;
|
|
|
+}
|
|
|
+.guhe-species-meta {
|
|
|
+ font-size: calc(22rpx * var(--font-scale, 1));
|
|
|
+ color: $facade-text-body;
|
|
|
+ background: $app-surface;
|
|
|
+ padding: 4rpx 12rpx;
|
|
|
+ border-radius: 8rpx;
|
|
|
+}
|
|
|
+.guhe-species-func {
|
|
|
+ display: block;
|
|
|
+ font-size: calc(22rpx * var(--font-scale, 1));
|
|
|
+ color: $facade-text-muted;
|
|
|
+ line-height: 1.6;
|
|
|
+ margin-top: 10rpx;
|
|
|
+}
|
|
|
.title-abnormal {
|
|
|
font-size: calc(24rpx * var(--font-scale, 1));
|
|
|
font-weight: normal;
|