Commit dde67d29 by liimin

Merge branch 'feature/rework' of http://192.168.3.233:8090/monorepo/venus into feature/rework

2 parents 5f2f3568 c41ea63b
......@@ -25,7 +25,7 @@
<view class="ring-bg"></view>
<!-- 进度半圆 -->
<view v-if="metricsVisible" class="ring-progress-wrap">
<view v-if="ringProgressVisible" class="ring-progress-wrap">
<view class="ring-half ring-half-left">
<view class="ring-half-inner" :style="ringLeftStyle"></view>
</view>
......@@ -71,8 +71,8 @@ const props = withDefaults(
metricsVisible?: boolean
}>(),
{
targetValueText: '122万',
achievementValueText: '20%',
targetValueText: '--',
achievementValueText: '--',
metricsVisible: true
}
)
......@@ -113,6 +113,18 @@ const ringPercentDisplay = computed((): string => {
return props.summary.ringPercent
})
/** 有效数据且>0时才显示进度弧;0 或无数据仅展示浅色背景环 */
const ringProgressVisible = computed((): boolean => {
if (props.metricsVisible == false) {
return false
}
const p = ringPercentNumForChart.value
// 无数据常见占位:'--';隐藏态为 '**'
const text = ringPercentDisplay.value
const hasData = text != '--' && text != '**' && text != ''
return hasData && p > 0
})
const targetValueDisplay = computed((): string => {
if (props.metricsVisible == false) {
return '****'
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!