feat(录音管理): 添加优秀录音组件并优化API调用
refactor(性能优化): 使用Promise.all并行请求核心KPI接口 style(样式调整): 修改ProblemRanking组件高度和内边距 chore: 移除调试用的console.log语句
This commit is contained in:
@@ -129,7 +129,7 @@ const handleSubmit = async () => {
|
|||||||
'Authorization': `Bearer ${token}`
|
'Authorization': `Bearer ${token}`
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
console.log('响应状态8888:', response.data.message);
|
// console.log('响应状态8888:', response.data.message);
|
||||||
// 提交成功
|
// 提交成功
|
||||||
submitStatus.value = 'success';
|
submitStatus.value = 'success';
|
||||||
// 触发父组件的事件,并传递数据
|
// 触发父组件的事件,并传递数据
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { useUserStore } from '@/stores/user'
|
|||||||
|
|
||||||
// 创建axios实例
|
// 创建axios实例
|
||||||
const service = axios.create({
|
const service = axios.create({
|
||||||
baseURL: 'https://mldash.nycjy.cn/' || '', // API基础路径,支持完整URL
|
baseURL: 'https://mldash.nycjy.cn/' || '', // API基础路径,支持完整URL
|
||||||
// baseURL: 'http://192.168.15.121:8890' || '', // API基础路径,支持完整URL
|
// baseURL: 'http://192.168.15.121:8890' || '', // API基础路径,支持完整URL
|
||||||
timeout: 100000, // 请求超时时间
|
timeout: 100000, // 请求超时时间
|
||||||
headers: {
|
headers: {
|
||||||
|
|||||||
@@ -365,26 +365,38 @@ async function getCoreKpi() {
|
|||||||
try {
|
try {
|
||||||
const params = getRequestParams()
|
const params = getRequestParams()
|
||||||
const hasParams = params.user_name
|
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 (todayCallRes.code === 200) {
|
||||||
if (res.code === 200) {
|
kpiDataState.totalCalls = todayCallRes.data.call_count
|
||||||
kpiDataState.totalCalls = res.data.call_count
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 转化率、分配数据量、加微率
|
// 转化率、分配数据量、加微率
|
||||||
const conversionRes = await getConversionRateAndAllocatedData(hasParams ? params : undefined)
|
|
||||||
if (conversionRes.code === 200) {
|
if (conversionRes.code === 200) {
|
||||||
kpiDataState.conversionRate = conversionRes.data.conversion_rate || 0
|
kpiDataState.conversionRate = conversionRes.data.conversion_rate || 0
|
||||||
kpiDataState.assignedData = conversionRes.data.all_count || 0
|
kpiDataState.assignedData = conversionRes.data.all_count || 0
|
||||||
kpiDataState.wechatAddRate = conversionRes.data.plus_v_conversion_rate || 0
|
kpiDataState.wechatAddRate = conversionRes.data.plus_v_conversion_rate || 0
|
||||||
}
|
}
|
||||||
|
|
||||||
// 平均通话时长
|
// 平均通话时长
|
||||||
const avgCallTimeRes = await getAvgCallTime(hasParams ? params : undefined)
|
|
||||||
if (avgCallTimeRes.code === 200) {
|
if (avgCallTimeRes.code === 200) {
|
||||||
kpiDataState.avgDuration = avgCallTimeRes.data.call_time || 0
|
kpiDataState.avgDuration = avgCallTimeRes.data.call_time || 0
|
||||||
}
|
}
|
||||||
|
|
||||||
// 电话接通率
|
// 电话接通率
|
||||||
const callSuccessRateRes = await getCallSuccessRate(hasParams ? params : undefined)
|
|
||||||
if (callSuccessRateRes.code === 200) {
|
if (callSuccessRateRes.code === 200) {
|
||||||
kpiDataState.successRate = callSuccessRateRes.data.call_success_rate || 0
|
kpiDataState.successRate = callSuccessRateRes.data.call_success_rate || 0
|
||||||
}
|
}
|
||||||
@@ -401,26 +413,35 @@ async function getStatisticsData() {
|
|||||||
const params = getRequestParams()
|
const params = getRequestParams()
|
||||||
const hasParams = params.user_name
|
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) {
|
if (fillingRateRes.code === 200) {
|
||||||
statisticsData.formCompletionRate = fillingRateRes.data.filling_rate
|
statisticsData.formCompletionRate = fillingRateRes.data.filling_rate
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取平均响应时间
|
// 处理平均响应时间
|
||||||
const avgResponseRes = await getAverageResponseTime(hasParams ? params : undefined)
|
|
||||||
if (avgResponseRes.code === 200) {
|
if (avgResponseRes.code === 200) {
|
||||||
statisticsData.averageResponseTime = avgResponseRes.data.average_minutes
|
statisticsData.averageResponseTime = avgResponseRes.data.average_minutes
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取客户沟通率
|
// 处理客户沟通率
|
||||||
const communicationRes = await getWeeklyActiveCommunicationRate(hasParams ? params : undefined)
|
|
||||||
if (communicationRes.code === 200) {
|
if (communicationRes.code === 200) {
|
||||||
statisticsData.customerCommunicationRate = communicationRes.data.communication_rate
|
statisticsData.customerCommunicationRate = communicationRes.data.communication_rate
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取超时响应率
|
// 处理超时响应率
|
||||||
const timeoutRes = await getTimeoutResponseRate(hasParams ? params : undefined)
|
|
||||||
if (timeoutRes.code === 200) {
|
if (timeoutRes.code === 200) {
|
||||||
statisticsData.timeoutResponseRate = timeoutRes.data.overtime_rate_600
|
statisticsData.timeoutResponseRate = timeoutRes.data.overtime_rate_600
|
||||||
statisticsData.severeTimeoutRate = timeoutRes.data.overtime_rate_800
|
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);
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
height: 26rem !important;
|
height: 21.5rem !important;
|
||||||
max-height: 26rem;
|
max-height: 26rem;
|
||||||
// flex: 1;
|
// flex: 1;
|
||||||
}
|
}
|
||||||
@@ -96,7 +96,7 @@ $white: #ffffff;
|
|||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 20px 20px 16px;
|
padding: 10px 20px 10px;
|
||||||
border-bottom: 1px solid #ebeef5;
|
border-bottom: 1px solid #ebeef5;
|
||||||
|
|
||||||
h3 {
|
h3 {
|
||||||
|
|||||||
@@ -53,7 +53,12 @@
|
|||||||
@update-check-type="updateCheckType"
|
@update-check-type="updateCheckType"
|
||||||
/>
|
/>
|
||||||
<div v-if="cardVisibility.teamAlerts" class="action-items-compact">
|
<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>
|
||||||
</div>
|
</div>
|
||||||
<StatisticalIndicators
|
<StatisticalIndicators
|
||||||
@@ -79,10 +84,7 @@
|
|||||||
@select-group="selectGroup"
|
@select-group="selectGroup"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="cardVisibility.problemRanking" class="problem-ranking">
|
<GoodMusic style="height: 300px;" :abnormalData="teamAlerts" />
|
||||||
<!-- 客户迫切解决的问题 -->
|
|
||||||
<ProblemRanking :problemRanking="problemRanking" />
|
|
||||||
</div>
|
|
||||||
<!-- Right Section - Group Comparison -->
|
<!-- Right Section - Group Comparison -->
|
||||||
<div v-if="cardVisibility.groupComparison" class="right-section">
|
<div v-if="cardVisibility.groupComparison" class="right-section">
|
||||||
<GroupComparison
|
<GroupComparison
|
||||||
@@ -201,6 +203,7 @@ import Tooltip from '@/components/Tooltip.vue'
|
|||||||
import CenterOverview from './components/CenterOverview.vue'
|
import CenterOverview from './components/CenterOverview.vue'
|
||||||
import GroupComparison from './components/GroupComparison.vue'
|
import GroupComparison from './components/GroupComparison.vue'
|
||||||
import GroupRanking from './components/GroupRanking.vue'
|
import GroupRanking from './components/GroupRanking.vue'
|
||||||
|
import GoodMusic from './components/GoodMusic.vue'
|
||||||
import TeamAlerts from '../maneger/components/TeamAlerts.vue'
|
import TeamAlerts from '../maneger/components/TeamAlerts.vue'
|
||||||
import ProblemRanking from './components/ProblemRanking.vue'
|
import ProblemRanking from './components/ProblemRanking.vue'
|
||||||
import StatisticalIndicators from './components/StatisticalIndicators.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 PerformanceComparison from './components/PerformanceComparison.vue'; // 1. 导入新组件
|
||||||
import { getOverallTeamPerformance,getTotalGroupCount,getConversionRate,getTotalCallCount,
|
import { getOverallTeamPerformance,getTotalGroupCount,getConversionRate,getTotalCallCount,
|
||||||
getNewCustomer,getDepositConversionRate,getActiveCustomerCommunicationRate,getAverageAnswerTime,
|
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 { useUserStore } from '@/stores/user.js'
|
||||||
import FeedbackForm from "@/components/FeedbackForm.vue";
|
import FeedbackForm from "@/components/FeedbackForm.vue";
|
||||||
|
|
||||||
@@ -259,6 +263,26 @@ const clearCache = () => {
|
|||||||
console.log('所有缓存已清除')
|
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 clearSpecificCache = (functionName, params = {}) => {
|
||||||
const cacheKey = getCacheKey(functionName, params)
|
const cacheKey = getCacheKey(functionName, params)
|
||||||
cache.delete(cacheKey)
|
cache.delete(cacheKey)
|
||||||
@@ -771,6 +795,7 @@ onMounted(async ()=>{
|
|||||||
await fetchTableFillingRate()
|
await fetchTableFillingRate()
|
||||||
await fetchUrgentNeedToAddress()
|
await fetchUrgentNeedToAddress()
|
||||||
await fetchTeamRanking()
|
await fetchTeamRanking()
|
||||||
|
await CenterExcellentRecord()
|
||||||
|
|
||||||
console.log('缓存状态:', getCacheInfo())
|
console.log('缓存状态:', getCacheInfo())
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user