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 @@ ...@@ -25,7 +25,7 @@
<view class="ring-bg"></view> <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 ring-half-left">
<view class="ring-half-inner" :style="ringLeftStyle"></view> <view class="ring-half-inner" :style="ringLeftStyle"></view>
</view> </view>
...@@ -71,8 +71,8 @@ const props = withDefaults( ...@@ -71,8 +71,8 @@ const props = withDefaults(
metricsVisible?: boolean metricsVisible?: boolean
}>(), }>(),
{ {
targetValueText: '122万', targetValueText: '--',
achievementValueText: '20%', achievementValueText: '--',
metricsVisible: true metricsVisible: true
} }
) )
...@@ -113,6 +113,18 @@ const ringPercentDisplay = computed((): string => { ...@@ -113,6 +113,18 @@ const ringPercentDisplay = computed((): string => {
return props.summary.ringPercent 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 => { const targetValueDisplay = computed((): string => {
if (props.metricsVisible == false) { if (props.metricsVisible == false) {
return '****' return '****'
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!