feat:语音仪表盘样式修改
This commit is contained in:
@@ -355,24 +355,24 @@ async function fetchBusyHourData(neId: string) {
|
||||
timestamp: timestamp
|
||||
}
|
||||
|
||||
console.log('获取Busy Hour数据参数:', params)
|
||||
// console.log('获取Busy Hour数据参数:', params)
|
||||
|
||||
const res = await getbusyhour(params)
|
||||
console.log('Busy Hour数据响应:', res)
|
||||
// console.log('Busy Hour数据响应:', res)
|
||||
|
||||
if (res.code === 1 && Array.isArray(res.data)) {
|
||||
busyHourData.value = res.data
|
||||
console.log('Busy Hour数据加载完成:', busyHourData.value)
|
||||
// console.log('Busy Hour数据加载完成:', busyHourData.value)
|
||||
|
||||
// 更新Call Attempts和Call Completions图表
|
||||
updateCallAttemptsChart()
|
||||
updateCallCompletionsChart()
|
||||
} else {
|
||||
console.warn('获取Busy Hour数据失败或数据为空')
|
||||
// console.warn('获取Busy Hour数据失败或数据为空')
|
||||
busyHourData.value = null
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取Busy Hour数据出错:', error)
|
||||
// console.error('获取Busy Hour数据出错:', error)
|
||||
busyHourData.value = null
|
||||
}
|
||||
}
|
||||
@@ -1547,7 +1547,7 @@ function updateMosChart() {
|
||||
}
|
||||
|
||||
// 从MOS数据中提取MOS值
|
||||
const chartData = mosData.value.map((item: any) => Number(item.mosSum) || 0)
|
||||
const chartData = mosData.value.map((item: any) => Number(item.mosAvg) || 0)
|
||||
|
||||
// 生成时间轴数据
|
||||
const xAxisData = Array.from({ length: chartData.length }, (_, i) => i + 1)
|
||||
@@ -1695,7 +1695,7 @@ function updateCctChart() {
|
||||
}
|
||||
|
||||
// 从CCT数据中提取CCT值
|
||||
const chartData = cctData.value.map((item: any) => Number(item.cctSum) || 0)
|
||||
const chartData = cctData.value.map((item: any) => Number(item.cctAvg) || 0)
|
||||
|
||||
// 生成时间轴数据
|
||||
const xAxisData = Array.from({ length: chartData.length }, (_, i) => i + 1)
|
||||
@@ -1985,13 +1985,13 @@ function calculateMTValue() {
|
||||
|
||||
// 计算MO变化值(完善版本)
|
||||
function calculateMOChange() {
|
||||
if (imsRealtimeRawData.value.length < 2) return t('views.perfManage.voiceOverView.last') +' 1 Min'+' Smooth'
|
||||
if (imsRealtimeRawData.value.length < 2) return t('views.perfManage.voiceOverView.last') +' 1 Min'+' +0%'
|
||||
|
||||
// 获取最新和上一个数据点
|
||||
const latestData = imsRealtimeRawData.value[imsRealtimeRawData.value.length - 1]
|
||||
const previousData = imsRealtimeRawData.value[imsRealtimeRawData.value.length - 2]
|
||||
|
||||
if (!latestData?.data || !previousData?.data) return t('views.perfManage.voiceOverView.last') +' 1 Min'+' Smooth'
|
||||
if (!latestData?.data || !previousData?.data) return t('views.perfManage.voiceOverView.last') +' 1 Min'+' +0%'
|
||||
|
||||
const latestKpi = latestData.data
|
||||
const previousKpi = previousData.data
|
||||
@@ -2000,13 +2000,13 @@ function calculateMOChange() {
|
||||
const previousMO = calculateMOValueFromData(previousKpi)
|
||||
|
||||
// 检查MO是否有有效值
|
||||
if (latestMO === '-' || previousMO === '-') return t('views.perfManage.voiceOverView.last') +' 1 Min'+' Smooth'
|
||||
if (latestMO === '-' || previousMO === '-') return t('views.perfManage.voiceOverView.last') +' 1 Min'+' +0%'
|
||||
|
||||
// 计算变化幅度
|
||||
const change = latestMO - previousMO
|
||||
|
||||
// 检查是否有变化
|
||||
if (change === 0) return t('views.perfManage.voiceOverView.last') +' 1 Min'+' Smooth'
|
||||
if (change === 0) return t('views.perfManage.voiceOverView.last') +' 1 Min'+' +0%'
|
||||
|
||||
const changeText = change > 0 ? `+${change.toFixed(2)}%` : `${change.toFixed(2)}%`
|
||||
|
||||
@@ -2018,13 +2018,13 @@ function calculateMOChange() {
|
||||
|
||||
// 计算MT变化值(完善版本)
|
||||
function calculateMTChange() {
|
||||
if (imsRealtimeRawData.value.length < 2) return t('views.perfManage.voiceOverView.last') +' 1 Min'+' Smooth'
|
||||
if (imsRealtimeRawData.value.length < 2) return t('views.perfManage.voiceOverView.last') +' 1 Min'+' +0%'
|
||||
|
||||
// 获取最新和上一个数据点
|
||||
const latestData = imsRealtimeRawData.value[imsRealtimeRawData.value.length - 1]
|
||||
const previousData = imsRealtimeRawData.value[imsRealtimeRawData.value.length - 2]
|
||||
|
||||
if (!latestData?.data || !previousData?.data) return t('views.perfManage.voiceOverView.last') +' 1 Min'+' Smooth'
|
||||
if (!latestData?.data || !previousData?.data) return t('views.perfManage.voiceOverView.last') +' 1 Min'+' +0%'
|
||||
|
||||
const latestKpi = latestData.data
|
||||
const previousKpi = previousData.data
|
||||
@@ -2033,13 +2033,13 @@ function calculateMTChange() {
|
||||
const previousMT = calculateMTValueFromData(previousKpi)
|
||||
|
||||
// 检查MT是否有有效值
|
||||
if (latestMT === '-' || previousMT === '-') return t('views.perfManage.voiceOverView.last') +' 1 Min'+' Smooth'
|
||||
if (latestMT === '-' || previousMT === '-') return t('views.perfManage.voiceOverView.last') +' 1 Min'+' +0%'
|
||||
|
||||
// 计算变化幅度
|
||||
const change = latestMT - previousMT
|
||||
|
||||
// 检查是否有变化
|
||||
if (change === 0) return t('views.perfManage.voiceOverView.last') +' 1 Min'+' Smooth'
|
||||
if (change === 0) return t('views.perfManage.voiceOverView.last') +' 1 Min'+' +0%'
|
||||
|
||||
const changeText = change > 0 ? `+${change.toFixed(2)}%` : `${change.toFixed(2)}%`
|
||||
|
||||
@@ -2157,13 +2157,13 @@ function calculateRegSuccessValue() {
|
||||
|
||||
// 计算registration success变化值
|
||||
function calculateRegSuccessChange() {
|
||||
if (imsRealtimeRawData.value.length < 2) return t('views.perfManage.voiceOverView.last') +' 1 Min'+' Smooth'
|
||||
if (imsRealtimeRawData.value.length < 2) return t('views.perfManage.voiceOverView.last') +' 1 Min'+' +0%'
|
||||
|
||||
// 获取最新和上一个数据点
|
||||
const latestData = imsRealtimeRawData.value[imsRealtimeRawData.value.length - 1]
|
||||
const previousData = imsRealtimeRawData.value[imsRealtimeRawData.value.length - 2]
|
||||
|
||||
if (!latestData?.data || !previousData?.data) return t('views.perfManage.voiceOverView.last') +' 1 Min'+' Smooth'
|
||||
if (!latestData?.data || !previousData?.data) return t('views.perfManage.voiceOverView.last') +' 1 Min'+' +0%'
|
||||
|
||||
const latestKpi = latestData.data
|
||||
const previousKpi = previousData.data
|
||||
@@ -2172,13 +2172,13 @@ function calculateRegSuccessChange() {
|
||||
const previousRegSuccess = calculateRegSuccessValueFromData(previousKpi)
|
||||
|
||||
// 检查registration success是否有有效值
|
||||
if (latestRegSuccess === '-' || previousRegSuccess === '-') return t('views.perfManage.voiceOverView.last') +' 1 Min'+' Smooth'
|
||||
if (latestRegSuccess === '-' || previousRegSuccess === '-') return t('views.perfManage.voiceOverView.last') +' 1 Min'+' +0%'
|
||||
|
||||
// 计算变化幅度
|
||||
const change = latestRegSuccess - previousRegSuccess
|
||||
|
||||
// 检查是否有变化
|
||||
if (change === 0) return t('views.perfManage.voiceOverView.last') +' 1 Min'+' Smooth'
|
||||
if (change === 0) return t('views.perfManage.voiceOverView.last') +' 1 Min'+' +0%'
|
||||
|
||||
const changeText = change > 0 ? `+${change.toFixed(2)}%` : `${change.toFixed(2)}%`
|
||||
|
||||
@@ -2261,13 +2261,13 @@ function calculateActiveCallsArrow() {
|
||||
|
||||
// 计算active calls变化值
|
||||
function calculateActiveCallsChange() {
|
||||
if (imsRealtimeRawData.value.length < 2) return t('views.perfManage.voiceOverView.last') +' 1 Min'+' Smooth'
|
||||
if (imsRealtimeRawData.value.length < 2) return t('views.perfManage.voiceOverView.last') +' 1 Min'+' +0'
|
||||
|
||||
// 获取最新和上一个数据点
|
||||
const latestData = imsRealtimeRawData.value[imsRealtimeRawData.value.length - 1]
|
||||
const previousData = imsRealtimeRawData.value[imsRealtimeRawData.value.length - 2]
|
||||
|
||||
if (!latestData?.data || !previousData?.data) return t('views.perfManage.voiceOverView.last') +' 1 Min'+' Smooth'
|
||||
if (!latestData?.data || !previousData?.data) return t('views.perfManage.voiceOverView.last') +' 1 Min'+' +0'
|
||||
|
||||
const latestKpi = latestData.data
|
||||
const previousKpi = previousData.data
|
||||
@@ -2280,7 +2280,7 @@ function calculateActiveCallsChange() {
|
||||
const change = latestActiveCalls - previousActiveCalls
|
||||
|
||||
// 检查是否有变化
|
||||
if (change === 0) return t('views.perfManage.voiceOverView.last') +' 1 Min'+' Smooth'
|
||||
if (change === 0) return t('views.perfManage.voiceOverView.last') +' 1 Min'+' +0'
|
||||
|
||||
const changeText = change > 0 ? `+${change.toFixed(0)}` : `${change.toFixed(0)}`
|
||||
|
||||
@@ -2366,13 +2366,13 @@ function calculateFailedCallsArrow() {
|
||||
|
||||
// 计算failed calls变化值
|
||||
function calculateFailedCallsChange() {
|
||||
if (imsRealtimeRawData.value.length < 2) return t('views.perfManage.voiceOverView.last') +' 1 Min'+' Smooth'
|
||||
if (imsRealtimeRawData.value.length < 2) return t('views.perfManage.voiceOverView.last') +' 1 Min'+' +0'
|
||||
|
||||
// 获取最新和上一个数据点
|
||||
const latestData = imsRealtimeRawData.value[imsRealtimeRawData.value.length - 1]
|
||||
const previousData = imsRealtimeRawData.value[imsRealtimeRawData.value.length - 2]
|
||||
|
||||
if (!latestData?.data || !previousData?.data) return t('views.perfManage.voiceOverView.last') +' 1 Min'+' Smooth'
|
||||
if (!latestData?.data || !previousData?.data) return t('views.perfManage.voiceOverView.last') +' 1 Min'+' +0'
|
||||
|
||||
const latestKpi = latestData.data
|
||||
const previousKpi = previousData.data
|
||||
@@ -2389,7 +2389,7 @@ function calculateFailedCallsChange() {
|
||||
const change = latestFailedCalls - previousFailedCalls
|
||||
|
||||
// 检查是否有变化
|
||||
if (change === 0) return t('views.perfManage.voiceOverView.last') +' 1 Min'+' Smooth'
|
||||
if (change === 0) return t('views.perfManage.voiceOverView.last') +' 1 Min'+' +0'
|
||||
|
||||
const changeText = change > 0 ? `+${change.toFixed(0)}` : `${change.toFixed(0)}`
|
||||
|
||||
@@ -2465,13 +2465,13 @@ function calculateActiveRegistrationsArrow() {
|
||||
|
||||
// 计算active registrations变化值
|
||||
function calculateActiveRegistrationsChange() {
|
||||
if (imsRealtimeRawData.value.length < 2) return t('views.perfManage.voiceOverView.last') +' 1 Min'+' Smooth'
|
||||
if (imsRealtimeRawData.value.length < 2) return t('views.perfManage.voiceOverView.last') +' 1 Min'+' +0'
|
||||
|
||||
// 获取最新和上一个数据点
|
||||
const latestData = imsRealtimeRawData.value[imsRealtimeRawData.value.length - 1]
|
||||
const previousData = imsRealtimeRawData.value[imsRealtimeRawData.value.length - 2]
|
||||
|
||||
if (!latestData?.data || !previousData?.data) return t('views.perfManage.voiceOverView.last') +' 1 Min'+' Smooth'
|
||||
if (!latestData?.data || !previousData?.data) return t('views.perfManage.voiceOverView.last') +' 1 Min'+' +0'
|
||||
|
||||
const latestKpi = latestData.data
|
||||
const previousKpi = previousData.data
|
||||
@@ -2484,7 +2484,7 @@ function calculateActiveRegistrationsChange() {
|
||||
const change = latestActiveRegistrations - previousActiveRegistrations
|
||||
|
||||
// 检查是否有变化
|
||||
if (change === 0) return t('views.perfManage.voiceOverView.last') +' 1 Min'+' Smooth'
|
||||
if (change === 0) return t('views.perfManage.voiceOverView.last') +' 1 Min'+' +0'
|
||||
|
||||
const changeText = change > 0 ? `+${change.toFixed(0)}` : `${change.toFixed(0)}`
|
||||
|
||||
@@ -2570,13 +2570,13 @@ function calculateFailedRegistrationsArrow() {
|
||||
|
||||
// 计算failed registrations变化值
|
||||
function calculateFailedRegistrationsChange() {
|
||||
if (imsRealtimeRawData.value.length < 2) return t('views.perfManage.voiceOverView.last') +' 1 Min'+' Smooth'
|
||||
if (imsRealtimeRawData.value.length < 2) return t('views.perfManage.voiceOverView.last') +' 1 Min'+' +0'
|
||||
|
||||
// 获取最新和上一个数据点
|
||||
const latestData = imsRealtimeRawData.value[imsRealtimeRawData.value.length - 1]
|
||||
const previousData = imsRealtimeRawData.value[imsRealtimeRawData.value.length - 2]
|
||||
|
||||
if (!latestData?.data || !previousData?.data) return t('views.perfManage.voiceOverView.last') +' 1 Min'+' Smooth'
|
||||
if (!latestData?.data || !previousData?.data) return t('views.perfManage.voiceOverView.last') +' 1 Min'+' +0'
|
||||
|
||||
const latestKpi = latestData.data
|
||||
const previousKpi = previousData.data
|
||||
@@ -2593,7 +2593,7 @@ function calculateFailedRegistrationsChange() {
|
||||
const change = latestFailedRegistrations - previousFailedRegistrations
|
||||
|
||||
// 检查是否有变化
|
||||
if (change === 0) return t('views.perfManage.voiceOverView.last') +' 1 Min'+' Smooth'
|
||||
if (change === 0) return t('views.perfManage.voiceOverView.last') +' 1 Min'+' +0'
|
||||
|
||||
const changeText = change > 0 ? `+${change.toFixed(0)}` : `${change.toFixed(0)}`
|
||||
|
||||
@@ -2638,13 +2638,13 @@ function calculateCallAttemptsArrow() {
|
||||
}
|
||||
|
||||
function calculateCallAttemptsChange() {
|
||||
if (!busyHourData.value || busyHourData.value.length < 2) return t('views.perfManage.voiceOverView.last') +' 1 Hour'+' Smooth'
|
||||
if (!busyHourData.value || busyHourData.value.length < 2) return t('views.perfManage.voiceOverView.last') +' 1 Hour'+' +0'
|
||||
|
||||
const latestValue = Number(busyHourData.value[busyHourData.value.length - 1].callAttempts) || 0
|
||||
const previousValue = Number(busyHourData.value[busyHourData.value.length - 2].callAttempts) || 0
|
||||
|
||||
const change = latestValue - previousValue
|
||||
if (change === 0) return t('views.perfManage.voiceOverView.last') +' 1 Hour'+' Smooth'
|
||||
if (change === 0) return t('views.perfManage.voiceOverView.last') +' 1 Hour'+' +0'
|
||||
|
||||
const changeText = change > 0 ? `+${change}` : `${change}`
|
||||
return t('views.perfManage.voiceOverView.last') + ' 1 Hour'+ ` ${changeText}`
|
||||
@@ -2685,13 +2685,13 @@ function calculateCallCompletionsArrow() {
|
||||
}
|
||||
|
||||
function calculateCallCompletionsChange() {
|
||||
if (!busyHourData.value || busyHourData.value.length < 2) return t('views.perfManage.voiceOverView.last') +' 1 Hour'+' Smooth'
|
||||
if (!busyHourData.value || busyHourData.value.length < 2) return t('views.perfManage.voiceOverView.last') +' 1 Hour'+' +0'
|
||||
|
||||
const latestValue = Number(busyHourData.value[busyHourData.value.length - 1].callCompletions) || 0
|
||||
const previousValue = Number(busyHourData.value[busyHourData.value.length - 2].callCompletions) || 0
|
||||
|
||||
const change = latestValue - previousValue
|
||||
if (change === 0) return t('views.perfManage.voiceOverView.last') +' 1 Hour'+' Smooth'
|
||||
if (change === 0) return t('views.perfManage.voiceOverView.last') +' 1 Hour'+' +0'
|
||||
|
||||
const changeText = change > 0 ? `+${change}` : `${change}`
|
||||
return t('views.perfManage.voiceOverView.last') + ' 1 Hour' +` ${changeText}`
|
||||
@@ -2732,7 +2732,7 @@ function calculateMosArrow() {
|
||||
}
|
||||
|
||||
function calculateMosChange() {
|
||||
if (!mosData.value || mosData.value.length < 2) return t('views.perfManage.voiceOverView.last') +' 1 Hour'+' Smooth'
|
||||
if (!mosData.value || mosData.value.length < 2) return t('views.perfManage.voiceOverView.last') +' 1 Hour'+' +0'
|
||||
|
||||
const latestData = mosData.value[mosData.value.length - 1]
|
||||
const previousData = mosData.value[mosData.value.length - 2]
|
||||
@@ -2741,7 +2741,7 @@ function calculateMosChange() {
|
||||
const previousValue = Number(previousData.mosAvg) || 0
|
||||
|
||||
const change = latestValue - previousValue
|
||||
if (change === 0) return t('views.perfManage.voiceOverView.last') +' 1 Hour'+' Smooth'
|
||||
if (change === 0) return t('views.perfManage.voiceOverView.last') +' 1 Hour'+' +0'
|
||||
|
||||
const changeText = change > 0 ? `+${change.toFixed(2)}` : `${change.toFixed(2)}`
|
||||
|
||||
@@ -2786,7 +2786,7 @@ function calculateCctArrow() {
|
||||
}
|
||||
|
||||
function calculateCctChange() {
|
||||
if (!cctData.value || cctData.value.length < 2) return t('views.perfManage.voiceOverView.last') +' 1 Hour'+' Smooth'
|
||||
if (!cctData.value || cctData.value.length < 2) return t('views.perfManage.voiceOverView.last') +' 1 Hour'+' +0'
|
||||
|
||||
const latestData = cctData.value[cctData.value.length - 1]
|
||||
const previousData = cctData.value[cctData.value.length - 2]
|
||||
@@ -2795,7 +2795,7 @@ function calculateCctChange() {
|
||||
const previousValue = Number(previousData.cctAvg) || 0
|
||||
|
||||
const change = latestValue - previousValue
|
||||
if (change === 0) return t('views.perfManage.voiceOverView.last') +' 1 Hour'+' Smooth'
|
||||
if (change === 0) return t('views.perfManage.voiceOverView.last') +' 1 Hour'+' +0'
|
||||
|
||||
const changeText = change > 0 ? `+${change.toFixed(2)}` : `${change.toFixed(2)}`
|
||||
|
||||
|
||||
Reference in New Issue
Block a user