|
@@ -5,18 +5,18 @@
|
|
|
<view v-if="block.type === 'score'" class="block score-block">
|
|
<view v-if="block.type === 'score'" class="block score-block">
|
|
|
<view class="block-title">{{ block.title }}</view>
|
|
<view class="block-title">{{ block.title }}</view>
|
|
|
<view class="score-grid">
|
|
<view class="score-grid">
|
|
|
-<view class="score-item" v-for="(item, si) in block.items" :key="getScoreKey(si)">
|
|
|
|
|
- <view class="score-circle" :style="'border-color:' + (item.color || '#4A9BD7')">
|
|
|
|
|
- <text class="score-value">{{ item.value }}</text>
|
|
|
|
|
- </view>
|
|
|
|
|
- <text class="score-label">{{ item.label }}</text>
|
|
|
|
|
- <view class="sub-items" v-if="item.subItems && item.subItems.length" style="margin-top:8rpx; display:flex; flex-direction:column; align-items:center;">
|
|
|
|
|
- <view class="sub-item" v-for="(sub, ssi) in item.subItems" :key="getSubKey(ssi)" style="display:flex; flex-direction:row; align-items:center;">
|
|
|
|
|
- <text class="sub-label" style="font-size:20rpx; color:#666; margin-right:4rpx;">{{ sub.label }}:</text>
|
|
|
|
|
- <text class="sub-value" style="font-size:20rpx; color:#333;">{{ sub.value }}</text>
|
|
|
|
|
- </view>
|
|
|
|
|
|
|
+ <view class="score-item" v-for="(item, si) in block.items" :key="getScoreKey(si)">
|
|
|
|
|
+ <view class="score-circle" :style="'border-color:' + (item.color || '#4A9BD7')">
|
|
|
|
|
+ <text class="score-value">{{ item.value }}</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <text class="score-label">{{ item.label }}</text>
|
|
|
|
|
+ <view class="sub-items" v-if="item.subItems && item.subItems.length" style="margin-top:8rpx; display:flex; flex-direction:column; align-items:center;">
|
|
|
|
|
+ <view class="sub-item" v-for="(sub, ssi) in item.subItems" :key="getSubKey(ssi)" style="display:flex; flex-direction:row; align-items:center;">
|
|
|
|
|
+ <text class="sub-label" style="font-size:20rpx; color:#666; margin-right:4rpx;">{{ sub.label }}:</text>
|
|
|
|
|
+ <text class="sub-value" style="font-size:20rpx; color:#333;">{{ sub.value }}</text>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
+ </view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
@@ -28,6 +28,7 @@
|
|
|
<text class="risk-name">{{ item.name }}</text>
|
|
<text class="risk-name">{{ item.name }}</text>
|
|
|
<text class="risk-value">风险值: {{ item.value || '--' }}</text>
|
|
<text class="risk-value">风险值: {{ item.value || '--' }}</text>
|
|
|
<text class="risk-badge" :class="'badge-' + riskCss(item.level)">{{ riskText(item.level) }}</text>
|
|
<text class="risk-badge" :class="'badge-' + riskCss(item.level)">{{ riskText(item.level) }}</text>
|
|
|
|
|
+ <text class="ind-help-btn" @tap.stop="onHelp(item, 'indicator')">?</text>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
@@ -41,19 +42,22 @@
|
|
|
<text class="ind-name">{{ item.name }}</text>
|
|
<text class="ind-name">{{ item.name }}</text>
|
|
|
<text class="ind-value">{{ item.value }} {{ item.unit }}</text>
|
|
<text class="ind-value">{{ item.value }} {{ item.unit }}</text>
|
|
|
<text class="ind-status" :class="'status-' + statusCss(item.status)">{{ item.status }}</text>
|
|
<text class="ind-status" :class="'status-' + statusCss(item.status)">{{ item.status }}</text>
|
|
|
|
|
+ <text class="ind-help-btn" @tap.stop="onHelp(item, 'indicator')">?</text>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
- <!-- list: 通用列表(columns 驱动) -->
|
|
|
|
|
|
|
+ <!-- list: 通用列表(columns 驱动,含 ? 按钮) -->
|
|
|
<view v-else-if="block.type === 'list'" class="block list-block">
|
|
<view v-else-if="block.type === 'list'" class="block list-block">
|
|
|
<view class="block-title">{{ block.title }}</view>
|
|
<view class="block-title">{{ block.title }}</view>
|
|
|
<view class="list-head" v-if="block.columns">
|
|
<view class="list-head" v-if="block.columns">
|
|
|
<text class="list-cell head-cell" v-for="(colItem, ci) in block.columns" :key="getColumnKey(ci)"
|
|
<text class="list-cell head-cell" v-for="(colItem, ci) in block.columns" :key="getColumnKey(ci)"
|
|
|
:style="'flex:' + (ci === 0 ? 2 : 1)">{{ colItem.label }}</text>
|
|
:style="'flex:' + (ci === 0 ? 2 : 1)">{{ colItem.label }}</text>
|
|
|
|
|
+ <text class="list-cell head-cell" style="flex:0 0 60rpx;">帮助</text>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="list-row" v-for="(item, li) in block.items" :key="getListItemKey(li)">
|
|
<view class="list-row" v-for="(item, li) in block.items" :key="getListItemKey(li)">
|
|
|
<text class="list-cell" :style="'flex:' + (ci === 0 ? 2 : 1)"
|
|
<text class="list-cell" :style="'flex:' + (ci === 0 ? 2 : 1)"
|
|
|
v-for="(colItem, ci) in block.columns" :key="getListColumnKey(ci)">{{ item[colItem.key] || '--' }}</text>
|
|
v-for="(colItem, ci) in block.columns" :key="getListColumnKey(ci)">{{ item[colItem.key] || '--' }}</text>
|
|
|
|
|
+ <text class="list-cell ind-help-btn" style="flex:0 0 60rpx; text-align:center;" @tap.stop="onHelp(item, 'bacteria')">?</text>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
@@ -82,7 +86,6 @@ export default {
|
|
|
getBlockKey: function(bi) { return 'b' + bi },
|
|
getBlockKey: function(bi) { return 'b' + bi },
|
|
|
getSubKey: function(ssi) { return 'sub' + ssi },
|
|
getSubKey: function(ssi) { return 'sub' + ssi },
|
|
|
getScoreKey: function(si) { return 's' + si },
|
|
getScoreKey: function(si) { return 's' + si },
|
|
|
- getSubKey: function(ssi) { return 'sub' + ssi },
|
|
|
|
|
getRiskKey: function(ri) { return 'r' + ri },
|
|
getRiskKey: function(ri) { return 'r' + ri },
|
|
|
getIndicatorKey: function(ii) { return 'i' + ii },
|
|
getIndicatorKey: function(ii) { return 'i' + ii },
|
|
|
getColumnKey: function(ci) { return 'c' + ci },
|
|
getColumnKey: function(ci) { return 'c' + ci },
|
|
@@ -99,6 +102,9 @@ export default {
|
|
|
statusCss: function(status) {
|
|
statusCss: function(status) {
|
|
|
var map = { '偏高': 'high', '偏低': 'low', '缺乏': 'low', '不足': 'low', '过多': 'high', '异常': 'high' }
|
|
var map = { '偏高': 'high', '偏低': 'low', '缺乏': 'low', '不足': 'low', '过多': 'high', '异常': 'high' }
|
|
|
return map[status] || 'normal'
|
|
return map[status] || 'normal'
|
|
|
|
|
+ },
|
|
|
|
|
+ onHelp: function(item, blockType) {
|
|
|
|
|
+ this.$emit('help', item, blockType)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -140,4 +146,6 @@ export default {
|
|
|
/* text */
|
|
/* text */
|
|
|
.text-content { font-size: 26rpx; color: #555; line-height: 1.7; white-space: pre-wrap; }
|
|
.text-content { font-size: 26rpx; color: #555; line-height: 1.7; white-space: pre-wrap; }
|
|
|
.chart-placeholder { font-size: 24rpx; color: #ccc; }
|
|
.chart-placeholder { font-size: 24rpx; color: #ccc; }
|
|
|
-</style>
|
|
|
|
|
|
|
+/* help button */
|
|
|
|
|
+.ind-help-btn { display: inline-flex; align-items: center; justify-content: center; width: 36rpx; height: 36rpx; border-radius: 50%; background: #E3F2FD; color: #1976D2; font-size: 22rpx; font-weight: 600; margin-left: 8rpx; flex-shrink: 0; }
|
|
|
|
|
+</style>
|