fix(api): 修正获取优秀录音文件的API路径并实现功能
修复top.js和secondTop.js中获取优秀录音文件的API路径错误,将common路径改为正确的level_four和level_five路径 在secondTop.vue中实现获取优秀录音文件的功能,添加参数验证和错误处理
This commit is contained in:
@@ -66,7 +66,7 @@ export const getCampPeriodAdmin = (params) => {
|
|||||||
}
|
}
|
||||||
// 获取优秀录音文件 /api/v1/level_four/overview/get_excellent_record_file
|
// 获取优秀录音文件 /api/v1/level_four/overview/get_excellent_record_file
|
||||||
export const getExcellentRecordFile = (params) => {
|
export const getExcellentRecordFile = (params) => {
|
||||||
return https.post('/api/v1/common/get_excellent_record_file', params)
|
return https.post('/api/v1/level_four/overview/get_excellent_record_file', params)
|
||||||
}
|
}
|
||||||
// 修改营期 /api/v1/level_four/overview/change_camp_period
|
// 修改营期 /api/v1/level_four/overview/change_camp_period
|
||||||
export const changeCampPeriod = (params) => {
|
export const changeCampPeriod = (params) => {
|
||||||
|
|||||||
@@ -69,8 +69,8 @@ export const getDetailedDataTable = (params) => {
|
|||||||
export const getPeriodStage = (params) => {
|
export const getPeriodStage = (params) => {
|
||||||
return https.get('/api/v1/level_five/overview/get_period_stage', params)
|
return https.get('/api/v1/level_five/overview/get_period_stage', params)
|
||||||
}
|
}
|
||||||
// 获取优秀录音文件 /api/v1/level_four/overview/get_excellent_record_file
|
// 获取优秀录音文件 /api/v1/level_five/overview/get_excellent_record_file
|
||||||
export const getExcellentRecordFile = (params) => {
|
export const getExcellentRecordFile = (params) => {
|
||||||
return https.post('/api/v1/common/get_excellent_record_file', params)
|
return https.post('/api/v1/level_five/overview/get_excellent_record_file', params)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -860,31 +860,46 @@ const conversionRateVsAverage = ref({})
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
// 获取优秀录音
|
// 获取优秀录音
|
||||||
const excellentRecord = ref({});
|
const excellentRecord = ref([]);
|
||||||
// 获取优秀录音文件
|
// 获取优秀录音文件
|
||||||
// async function CentergetGoodRecord() {
|
async function CentergetGoodRecord() {
|
||||||
// const params = getRequestParams()
|
console.log('CentergetGoodRecord 开始执行')
|
||||||
// const params1 = {
|
try {
|
||||||
// user_level:userStore.userInfo.user_level.toString(),
|
const params = getRequestParams()
|
||||||
// user_name:userStore.userInfo.username
|
const params1 = {
|
||||||
// }
|
user_level: userStore.userInfo?.user_level?.toString() || '',
|
||||||
// const hasParams = params.user_name
|
user_name: userStore.userInfo?.username || ''
|
||||||
// const requestParams = hasParams ? {
|
}
|
||||||
// ...params,
|
|
||||||
// } : params1
|
|
||||||
// console.log(188811111,requestParams)
|
|
||||||
|
|
||||||
// try {
|
// 检查参数是否有效
|
||||||
// const res = await withCache('CentergetGoodRecord',
|
const hasParams = params.user_name && params.user_level
|
||||||
// () => getExcellentRecordFile(requestParams),
|
const requestParams = hasParams ? {
|
||||||
// requestParams
|
...params,
|
||||||
// )
|
} : params1
|
||||||
// excellentRecord.value = res.data.excellent_record_list
|
|
||||||
// console.log(111111,res.data.excellent_record_list)
|
console.log('CentergetGoodRecord request params:', requestParams)
|
||||||
// } catch (error) {
|
|
||||||
// console.error("获取优秀录音失败:", error);
|
// 验证必要参数是否存在
|
||||||
// }
|
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) {
|
if (!isFromRoute) {
|
||||||
await CenterCampPeriodAdmin()
|
await CenterCampPeriodAdmin()
|
||||||
}
|
}
|
||||||
|
await CentergetGoodRecord()
|
||||||
await CenterOverallCenterPerformance()
|
await CenterOverallCenterPerformance()
|
||||||
await CenterTotalGroupCount()
|
await CenterTotalGroupCount()
|
||||||
await CenterConversionRate()
|
await CenterConversionRate()
|
||||||
@@ -951,6 +966,7 @@ const excellentRecord = ref({});
|
|||||||
await CenterCustomerType()
|
await CenterCustomerType()
|
||||||
await CenterUrgentNeedToAddress()
|
await CenterUrgentNeedToAddress()
|
||||||
await CenterConversionRateVsAverage()
|
await CenterConversionRateVsAverage()
|
||||||
|
|
||||||
await CenterSeniorManagerList()
|
await CenterSeniorManagerList()
|
||||||
await CenterGroupList('all')
|
await CenterGroupList('all')
|
||||||
|
|
||||||
@@ -980,6 +996,7 @@ const excellentRecord = ref({});
|
|||||||
await CenterTotalGroupCount()
|
await CenterTotalGroupCount()
|
||||||
await CenterConversionRate()
|
await CenterConversionRate()
|
||||||
await CenterTotalCallCount()
|
await CenterTotalCallCount()
|
||||||
|
await CentergetGoodRecord()
|
||||||
await CenterNewCustomer()
|
await CenterNewCustomer()
|
||||||
await CenterDepositConversionRate()
|
await CenterDepositConversionRate()
|
||||||
await CenterCustomerType()
|
await CenterCustomerType()
|
||||||
|
|||||||
Reference in New Issue
Block a user