|
@@ -54,16 +54,16 @@
|
|
|
<text class="indicator-range" v-if="ind.refRange">参考值: {{ ind.refRange }}</text>
|
|
<text class="indicator-range" v-if="ind.refRange">参考值: {{ ind.refRange }}</text>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="indicator-right">
|
|
<view class="indicator-right">
|
|
|
- <text class="indicator-value" :class="getStatusClass(ind)">{{ ind.indicatorValue }}</text>
|
|
|
|
|
|
|
+ <text class="indicator-value" :class="ind.statusClass">{{ ind.indicatorValue }}</text>
|
|
|
<text class="indicator-unit" v-if="ind.unit">{{ ind.unit }}</text>
|
|
<text class="indicator-unit" v-if="ind.unit">{{ ind.unit }}</text>
|
|
|
- <text class="indicator-status" :class="getStatusClass(ind)">{{ ind.status || '--' }}</text>
|
|
|
|
|
|
|
+ <text class="indicator-status" :class="ind.statusClass">{{ ind.status || '--' }}</text>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
<!-- 空状态 -->
|
|
<!-- 空状态 -->
|
|
|
- <view class="empty-wrap" v-if="!loading && indicatorGroups.length === 0">
|
|
|
|
|
|
|
+ <view class="empty-wrap" v-if="!loading && indicators.length === 0">
|
|
|
<text class="empty-icon">📋</text>
|
|
<text class="empty-icon">📋</text>
|
|
|
<text class="empty-text">暂无指标数据</text>
|
|
<text class="empty-text">暂无指标数据</text>
|
|
|
</view>
|
|
</view>
|
|
@@ -144,13 +144,17 @@ export default {
|
|
|
var data = res.data
|
|
var data = res.data
|
|
|
self.report = data.report || data
|
|
self.report = data.report || data
|
|
|
// 指标可能来自 indicators 字段或直接是 report 的一部分
|
|
// 指标可能来自 indicators 字段或直接是 report 的一部分
|
|
|
|
|
+ var list = []
|
|
|
if (data.indicators) {
|
|
if (data.indicators) {
|
|
|
- self.indicators = data.indicators
|
|
|
|
|
|
|
+ list = data.indicators
|
|
|
} else if (data.indicatorList) {
|
|
} else if (data.indicatorList) {
|
|
|
- self.indicators = data.indicatorList
|
|
|
|
|
- } else {
|
|
|
|
|
- self.indicators = []
|
|
|
|
|
|
|
+ list = data.indicatorList
|
|
|
}
|
|
}
|
|
|
|
|
+ // 预计算状态样式类(小程序 :class 不支持方法调用语法)
|
|
|
|
|
+ list.forEach(function(ind) {
|
|
|
|
|
+ ind.statusClass = self.getStatusClass(ind)
|
|
|
|
|
+ })
|
|
|
|
|
+ self.indicators = list
|
|
|
} else {
|
|
} else {
|
|
|
uni.showToast({ title: res.message || '加载失败', icon: 'none' })
|
|
uni.showToast({ title: res.message || '加载失败', icon: 'none' })
|
|
|
}
|
|
}
|