Просмотр исходного кода

fix(health): 菌群报告手风琴加有效/异常指标数量

肠道功能与代谢物、营养指标手风琴标题右侧增加 有效N / 异常N / 共N项 统计。

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
E2E Test Bot 2 месяцев назад
Родитель
Сommit
2fecad9b56
1 измененных файлов с 29 добавлено и 0 удалено
  1. 29 0
      cfc-frontend/pages/health/gut-flora-detail.vue

+ 29 - 0
cfc-frontend/pages/health/gut-flora-detail.vue

@@ -129,6 +129,7 @@
       <view class="accordion-section">
         <view class="accordion-header" @tap="toggleAccordion('gut')">
           <text class="accordion-title">肠道功能与代谢物</text>
+          <text class="accordion-stats" v-if="gutStats.total > 0">有效 {{ gutStats.valid }} / 异常 {{ gutStats.abnormal }} / 共 {{ gutStats.total }} 项</text>
           <text class="accordion-arrow">{{ accordionOpen.gut ? '收起' : '展开' }}</text>
         </view>
         <view class="accordion-body" v-if="accordionOpen.gut">
@@ -160,6 +161,7 @@
       <view class="accordion-section">
         <view class="accordion-header" @tap="toggleAccordion('nutri')">
           <text class="accordion-title">营养指标</text>
+          <text class="accordion-stats" v-if="nutriStats.total > 0">有效 {{ nutriStats.valid }} / 异常 {{ nutriStats.abnormal }} / 共 {{ nutriStats.total }} 项</text>
           <text class="accordion-arrow">{{ accordionOpen.nutri ? '收起' : '展开' }}</text>
         </view>
         <view class="accordion-body" v-if="accordionOpen.nutri">
@@ -277,6 +279,32 @@ export default {
       parsing: false
     }
   },
+  computed: {
+    gutStats: function() {
+      var list = this.gutIndicators || []
+      var valid = 0, abnormal = 0
+      for (var i = 0; i < list.length; i++) {
+        var item = list[i]
+        if (item.indicatorValue && String(item.indicatorValue).trim() !== '') valid++
+        if (item.status && item.status !== '正常') abnormal++
+      }
+      return { total: list.length, valid: valid, abnormal: abnormal }
+    },
+    nutriStats: function() {
+      var list = [], groups = this.nutritionGroups || []
+      for (var g = 0; g < groups.length; g++) {
+        var items = groups[g].items
+        if (items) for (var i = 0; i < items.length; i++) list.push(items[i])
+      }
+      var valid = 0, abnormal = 0
+      for (var i = 0; i < list.length; i++) {
+        var item = list[i]
+        if (item.indicatorValue && String(item.indicatorValue).trim() !== '') valid++
+        if (item.status && item.status !== '正常') abnormal++
+      }
+      return { total: list.length, valid: valid, abnormal: abnormal }
+    }
+  },
   onLoad: function(options) {
     this.reportId = options.reportId ? parseInt(options.reportId) : null
     this.draftId = options.draftId ? parseInt(options.draftId) : null
@@ -679,6 +707,7 @@ export default {
 .accordion-section { background: #fff; margin-bottom: 16rpx; }
 .accordion-header { display: flex; justify-content: space-between; padding: 30rpx; border-bottom: 1rpx solid #f0f0f0; }
 .accordion-title { font-size: 30rpx; font-weight: 600; color: #333; }
+.accordion-stats { font-size: 22rpx; color: #999; margin-left: 16rpx; }
 .accordion-arrow { font-size: 24rpx; color: #999; }
 .accordion-body { padding: 10rpx 30rpx 20rpx; }