feat(录音管理): 添加优秀录音组件并优化API调用
refactor(性能优化): 使用Promise.all并行请求核心KPI接口 style(样式调整): 修改ProblemRanking组件高度和内边距 chore: 移除调试用的console.log语句
This commit is contained in:
@@ -365,26 +365,38 @@ async function getCoreKpi() {
|
||||
try {
|
||||
const params = getRequestParams()
|
||||
const hasParams = params.user_name
|
||||
|
||||
|
||||
// 并发请求所有KPI接口
|
||||
const [
|
||||
todayCallRes,
|
||||
conversionRes,
|
||||
avgCallTimeRes,
|
||||
callSuccessRateRes
|
||||
] = await Promise.all([
|
||||
getTodayCall(hasParams ? params : undefined),
|
||||
getConversionRateAndAllocatedData(hasParams ? params : undefined),
|
||||
getAvgCallTime(hasParams ? params : undefined),
|
||||
getCallSuccessRate(hasParams ? params : undefined)
|
||||
])
|
||||
|
||||
// 今日通话数据
|
||||
const res = await getTodayCall(hasParams ? params : undefined)
|
||||
if (res.code === 200) {
|
||||
kpiDataState.totalCalls = res.data.call_count
|
||||
if (todayCallRes.code === 200) {
|
||||
kpiDataState.totalCalls = todayCallRes.data.call_count
|
||||
}
|
||||
|
||||
// 转化率、分配数据量、加微率
|
||||
const conversionRes = await getConversionRateAndAllocatedData(hasParams ? params : undefined)
|
||||
if (conversionRes.code === 200) {
|
||||
kpiDataState.conversionRate = conversionRes.data.conversion_rate || 0
|
||||
kpiDataState.assignedData = conversionRes.data.all_count || 0
|
||||
kpiDataState.wechatAddRate = conversionRes.data.plus_v_conversion_rate || 0
|
||||
}
|
||||
}
|
||||
|
||||
// 平均通话时长
|
||||
const avgCallTimeRes = await getAvgCallTime(hasParams ? params : undefined)
|
||||
if (avgCallTimeRes.code === 200) {
|
||||
kpiDataState.avgDuration = avgCallTimeRes.data.call_time || 0
|
||||
}
|
||||
|
||||
// 电话接通率
|
||||
const callSuccessRateRes = await getCallSuccessRate(hasParams ? params : undefined)
|
||||
if (callSuccessRateRes.code === 200) {
|
||||
kpiDataState.successRate = callSuccessRateRes.data.call_success_rate || 0
|
||||
}
|
||||
@@ -401,26 +413,35 @@ async function getStatisticsData() {
|
||||
const params = getRequestParams()
|
||||
const hasParams = params.user_name
|
||||
|
||||
// 获取表单填写率
|
||||
const fillingRateRes = await getTableFillingRate(hasParams ? params : undefined)
|
||||
// 并发请求所有统计数据
|
||||
const [
|
||||
fillingRateRes,
|
||||
avgResponseRes,
|
||||
communicationRes,
|
||||
timeoutRes
|
||||
] = await Promise.all([
|
||||
getTableFillingRate(hasParams ? params : undefined),
|
||||
getAverageResponseTime(hasParams ? params : undefined),
|
||||
getWeeklyActiveCommunicationRate(hasParams ? params : undefined),
|
||||
getTimeoutResponseRate(hasParams ? params : undefined)
|
||||
])
|
||||
|
||||
// 处理表单填写率
|
||||
if (fillingRateRes.code === 200) {
|
||||
statisticsData.formCompletionRate = fillingRateRes.data.filling_rate
|
||||
}
|
||||
|
||||
// 获取平均响应时间
|
||||
const avgResponseRes = await getAverageResponseTime(hasParams ? params : undefined)
|
||||
// 处理平均响应时间
|
||||
if (avgResponseRes.code === 200) {
|
||||
statisticsData.averageResponseTime = avgResponseRes.data.average_minutes
|
||||
}
|
||||
|
||||
// 获取客户沟通率
|
||||
const communicationRes = await getWeeklyActiveCommunicationRate(hasParams ? params : undefined)
|
||||
// 处理客户沟通率
|
||||
if (communicationRes.code === 200) {
|
||||
statisticsData.customerCommunicationRate = communicationRes.data.communication_rate
|
||||
}
|
||||
|
||||
// 获取超时响应率
|
||||
const timeoutRes = await getTimeoutResponseRate(hasParams ? params : undefined)
|
||||
// 处理超时响应率
|
||||
if (timeoutRes.code === 200) {
|
||||
statisticsData.timeoutResponseRate = timeoutRes.data.overtime_rate_600
|
||||
statisticsData.severeTimeoutRate = timeoutRes.data.overtime_rate_800
|
||||
|
||||
1145
my-vue-app/src/views/senorManger/components/GoodMusic.vue
Normal file
1145
my-vue-app/src/views/senorManger/components/GoodMusic.vue
Normal file
File diff suppressed because it is too large
Load Diff
@@ -87,7 +87,7 @@ $white: #ffffff;
|
||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 26rem !important;
|
||||
height: 21.5rem !important;
|
||||
max-height: 26rem;
|
||||
// flex: 1;
|
||||
}
|
||||
@@ -96,7 +96,7 @@ $white: #ffffff;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 20px 20px 16px;
|
||||
padding: 10px 20px 10px;
|
||||
border-bottom: 1px solid #ebeef5;
|
||||
|
||||
h3 {
|
||||
|
||||
@@ -53,7 +53,12 @@
|
||||
@update-check-type="updateCheckType"
|
||||
/>
|
||||
<div v-if="cardVisibility.teamAlerts" class="action-items-compact">
|
||||
<TeamAlerts style="height: 300px;" :abnormalData="teamAlerts" />
|
||||
<!-- <TeamAlerts style="height: 300px;" :abnormalData="teamAlerts" /> -->
|
||||
<div v-if="cardVisibility.problemRanking" class="problem-ranking">
|
||||
<!-- 客户迫切解决的问题 -->
|
||||
<ProblemRanking :problemRanking="problemRanking" />
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<StatisticalIndicators
|
||||
@@ -79,10 +84,7 @@
|
||||
@select-group="selectGroup"
|
||||
/>
|
||||
</div>
|
||||
<div v-if="cardVisibility.problemRanking" class="problem-ranking">
|
||||
<!-- 客户迫切解决的问题 -->
|
||||
<ProblemRanking :problemRanking="problemRanking" />
|
||||
</div>
|
||||
<GoodMusic style="height: 300px;" :abnormalData="teamAlerts" />
|
||||
<!-- Right Section - Group Comparison -->
|
||||
<div v-if="cardVisibility.groupComparison" class="right-section">
|
||||
<GroupComparison
|
||||
@@ -201,6 +203,7 @@ import Tooltip from '@/components/Tooltip.vue'
|
||||
import CenterOverview from './components/CenterOverview.vue'
|
||||
import GroupComparison from './components/GroupComparison.vue'
|
||||
import GroupRanking from './components/GroupRanking.vue'
|
||||
import GoodMusic from './components/GoodMusic.vue'
|
||||
import TeamAlerts from '../maneger/components/TeamAlerts.vue'
|
||||
import ProblemRanking from './components/ProblemRanking.vue'
|
||||
import StatisticalIndicators from './components/StatisticalIndicators.vue'
|
||||
@@ -209,7 +212,8 @@ import Loading from '@/components/Loading.vue'
|
||||
import PerformanceComparison from './components/PerformanceComparison.vue'; // 1. 导入新组件
|
||||
import { getOverallTeamPerformance,getTotalGroupCount,getConversionRate,getTotalCallCount,
|
||||
getNewCustomer,getDepositConversionRate,getActiveCustomerCommunicationRate,getAverageAnswerTime,
|
||||
getTimeoutRate,getTableFillingRate,getUrgentNeedToAddress,getTeamRanking,getTeamRankingInfo,getAbnormalResponseRate,getTeamSalesFunnel } from '@/api/senorManger.js'
|
||||
getTimeoutRate,getTableFillingRate,getUrgentNeedToAddress,getTeamRanking,getTeamRankingInfo,getAbnormalResponseRate,getTeamSalesFunnel } from '@/api/senorManger.js'
|
||||
import { getExcellentRecordFile } from '@/api/top.js'
|
||||
import { useUserStore } from '@/stores/user.js'
|
||||
import FeedbackForm from "@/components/FeedbackForm.vue";
|
||||
|
||||
@@ -259,6 +263,26 @@ const clearCache = () => {
|
||||
console.log('所有缓存已清除')
|
||||
}
|
||||
|
||||
// 优秀录音
|
||||
const excellentRecord = ref([]);
|
||||
async function CenterExcellentRecord() {
|
||||
const params={
|
||||
user_level:userStore.userInfo.user_level.toString(),
|
||||
user_name:userStore.userInfo.username
|
||||
}
|
||||
try {
|
||||
const cacheKey = getCacheKey('CenterExcellentRecord', params);
|
||||
const result = await withCache(cacheKey, async () => {
|
||||
const res = await getExcellentRecordFile(params);
|
||||
return res.data;
|
||||
});
|
||||
excellentRecord.value = result;
|
||||
console.log(111111,result);
|
||||
} catch (error) {
|
||||
console.error("获取优秀录音失败:", error);
|
||||
}
|
||||
}
|
||||
|
||||
const clearSpecificCache = (functionName, params = {}) => {
|
||||
const cacheKey = getCacheKey(functionName, params)
|
||||
cache.delete(cacheKey)
|
||||
@@ -771,6 +795,7 @@ onMounted(async ()=>{
|
||||
await fetchTableFillingRate()
|
||||
await fetchUrgentNeedToAddress()
|
||||
await fetchTeamRanking()
|
||||
await CenterExcellentRecord()
|
||||
|
||||
console.log('缓存状态:', getCacheInfo())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user