|
@@ -186,14 +186,21 @@ const getSummaries = (param: any) => {
|
|
|
return;
|
|
|
}
|
|
|
const values = data.map((item: { [x: string]: any }) => Number(item[column.property]));
|
|
|
- if (
|
|
|
- ['inAnsweredRate', 'outAnsweredRate', 'inAvailableAnswer', 'outDurationAvg', 'loginDuration', 'restDuration', 'workRate'].includes(
|
|
|
- column.property
|
|
|
- )
|
|
|
- ) {
|
|
|
+ if (['inAnsweredRate', 'outAnsweredRate', 'inAvailableAnswer', 'outDurationAvg', 'workRate'].includes(column.property)) {
|
|
|
//百分比不能计算
|
|
|
sums[index] = '';
|
|
|
return '';
|
|
|
+ } else if (['loginDuration', 'restDuration'].includes(column.property)) {
|
|
|
+ sums[index] = formatDurationDay(
|
|
|
+ values.reduce((prev: any, curr: any) => {
|
|
|
+ const value = Number(curr);
|
|
|
+ if (!Number.isNaN(value)) {
|
|
|
+ return prev + curr;
|
|
|
+ } else {
|
|
|
+ return prev;
|
|
|
+ }
|
|
|
+ }, 0)
|
|
|
+ );
|
|
|
} else if (!values.every((value: unknown) => Number.isNaN(value))) {
|
|
|
sums[index] = `${values.reduce((prev: any, curr: any) => {
|
|
|
const value = Number(curr);
|