feat(视图组件): 添加指标提示功能
在secondTop.vue和DetailedDataTable.vue中添加工具提示组件,当用户悬停在指标标签上时显示计算方式的详细说明
This commit is contained in:
@@ -134,13 +134,21 @@
|
||||
|
||||
<div class="metric-row">
|
||||
<div class="metric-item">
|
||||
<span class="metric-label">转化率</span>
|
||||
<span class="metric-label">转化率<i class="info-icon" @mouseenter="showTooltip($event, 'teamPerformance')" @mouseleave="hideTooltip">ⓘ</i></span>
|
||||
<span class="metric-value">{{ member.conversionRate }}%</span>
|
||||
</div>
|
||||
<div class="metric-item">
|
||||
<span class="metric-label">通话次数</span>
|
||||
<span class="metric-value">{{ member.callCount }}</span>
|
||||
</div>
|
||||
<!-- Tooltip 组件 -->
|
||||
<Tooltip
|
||||
:visible="tooltip.visible"
|
||||
:x="tooltip.x"
|
||||
:y="tooltip.y"
|
||||
:title="tooltip.title"
|
||||
:description="tooltip.description"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="metric-row">
|
||||
@@ -166,7 +174,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, computed } from 'vue'
|
||||
import { ref, onMounted, computed,reactive } from 'vue'
|
||||
|
||||
import CenterOverview from './components/CenterOverview.vue'
|
||||
import GroupComparison from './components/GroupComparison.vue'
|
||||
@@ -179,6 +187,7 @@
|
||||
import seniorManager from './components/seniorManager.vue'
|
||||
import UserDropdown from '@/components/UserDropdown.vue'
|
||||
import Loading from '@/components/Loading.vue'
|
||||
import Tooltip from '@/components/Tooltip.vue'
|
||||
import {
|
||||
getOverallCenterPerformance, getTotalGroupCount, getCenterConversionRate, getTotalCallCount, getNewCustomer
|
||||
, getDepositConversionRate, getCustomerTypeDistribution, getUrgentNeedToAddress, getCenterAdvancedManagerList, getTeamRanking,
|
||||
@@ -781,6 +790,39 @@ const conversionRateVsAverage = ref({})
|
||||
}
|
||||
})
|
||||
|
||||
// 工具提示状态
|
||||
const tooltip = reactive({
|
||||
visible: false,
|
||||
x: 0,
|
||||
y: 0,
|
||||
title: '',
|
||||
description: ''
|
||||
})
|
||||
|
||||
// 指标描述
|
||||
const metricDescriptions = {
|
||||
teamPerformance: {
|
||||
title: '转化率',
|
||||
description: '本期最终成交/本期客户总数'
|
||||
}
|
||||
}
|
||||
|
||||
// 显示工具提示
|
||||
const showTooltip = (event, metricType) => {
|
||||
const metric = metricDescriptions[metricType]
|
||||
if (metric) {
|
||||
tooltip.title = metric.title
|
||||
tooltip.description = metric.description
|
||||
tooltip.x = event.clientX
|
||||
tooltip.y = event.clientY
|
||||
tooltip.visible = true
|
||||
}
|
||||
}
|
||||
|
||||
// 隐藏工具提示
|
||||
const hideTooltip = () => {
|
||||
tooltip.visible = false
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@@ -1198,7 +1240,20 @@ const conversionRateVsAverage = ref({})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.info-icon {
|
||||
color: #94a3b8;
|
||||
font-size: 0.75rem;
|
||||
cursor: pointer;
|
||||
opacity: 0.7;
|
||||
transition: all 0.2s ease;
|
||||
margin-left: 0.25rem;
|
||||
|
||||
&:hover {
|
||||
opacity: 1;
|
||||
color: #3b82f6;
|
||||
transform: scale(1.1);
|
||||
}
|
||||
}
|
||||
// 客户详情区域
|
||||
.customer-detail-section {
|
||||
background: white;
|
||||
|
||||
Reference in New Issue
Block a user