fix(api): 修正获取优秀录音文件的API路径并实现功能

修复top.js和secondTop.js中获取优秀录音文件的API路径错误,将common路径改为正确的level_four和level_five路径
在secondTop.vue中实现获取优秀录音文件的功能,添加参数验证和错误处理
This commit is contained in:
2025-10-22 17:34:34 +08:00
parent d75fd9beb8
commit 99efa8de75
3 changed files with 45 additions and 28 deletions

View File

@@ -860,31 +860,46 @@ const conversionRateVsAverage = ref({})
})
}
// 获取优秀录音
const excellentRecord = ref({});
const excellentRecord = ref([]);
// 获取优秀录音文件
// async function CentergetGoodRecord() {
// const params = getRequestParams()
// const params1 = {
// user_level:userStore.userInfo.user_level.toString(),
// user_name:userStore.userInfo.username
// }
// const hasParams = params.user_name
// const requestParams = hasParams ? {
// ...params,
// } : params1
// console.log(188811111,requestParams)
// try {
// const res = await withCache('CentergetGoodRecord',
// () => getExcellentRecordFile(requestParams),
// requestParams
// )
// excellentRecord.value = res.data.excellent_record_list
// console.log(111111,res.data.excellent_record_list)
// } catch (error) {
// console.error("获取优秀录音失败:", error);
// }
// }
async function CentergetGoodRecord() {
console.log('CentergetGoodRecord 开始执行')
try {
const params = getRequestParams()
const params1 = {
user_level: userStore.userInfo?.user_level?.toString() || '',
user_name: userStore.userInfo?.username || ''
}
// 检查参数是否有效
const hasParams = params.user_name && params.user_level
const requestParams = hasParams ? {
...params,
} : params1
console.log('CentergetGoodRecord request params:', requestParams)
// 验证必要参数是否存在
if (!requestParams.user_name || !requestParams.user_level) {
console.error("缺少必要的请求参数:", requestParams);
return;
}
// 直接发送请求,不使用缓存
const res = await getExcellentRecordFile(requestParams)
if (res && res.code === 200 && res.data) {
excellentRecord.value = res.data || []
console.log('获取优秀录音成功:', res.data)
} else {
console.error("获取优秀录音失败,响应数据不完整:", res);
excellentRecord.value = []
}
} catch (error) {
console.error("获取优秀录音失败:", error);
excellentRecord.value = []
}
}
// 缓存管理功能
// 清除所有缓存
@@ -941,7 +956,7 @@ const excellentRecord = ref({});
if (!isFromRoute) {
await CenterCampPeriodAdmin()
}
await CentergetGoodRecord()
await CenterOverallCenterPerformance()
await CenterTotalGroupCount()
await CenterConversionRate()
@@ -951,6 +966,7 @@ const excellentRecord = ref({});
await CenterCustomerType()
await CenterUrgentNeedToAddress()
await CenterConversionRateVsAverage()
await CenterSeniorManagerList()
await CenterGroupList('all')
@@ -980,6 +996,7 @@ const excellentRecord = ref({});
await CenterTotalGroupCount()
await CenterConversionRate()
await CenterTotalCallCount()
await CentergetGoodRecord()
await CenterNewCustomer()
await CenterDepositConversionRate()
await CenterCustomerType()