среднее время не учитывает нули
This commit is contained in:
parent
e665ff6c4a
commit
b0ff595f5d
@ -1,3 +1,4 @@
|
||||
1.0.3 _ 2025-09-12 _ среднее время не учитывает нули
|
||||
1.0.2 _ 2025-09-07 _ добавлена автозапись в стейджинг
|
||||
1.0.1 Страница заявок корректно отображает мультиответ
|
||||
1.0.0 Добавлены фичи "мультиответ", "перенос строки в своём ответе", "свой ответ", "плейсхолдер своего ответа"
|
||||
@ -41,14 +41,20 @@ const GeneralItem = ({
|
||||
const data = Object.entries(general).sort(
|
||||
([nextValue], [currentValue]) => Number(nextValue) - Number(currentValue),
|
||||
);
|
||||
const days = data.map(([value]) => value);
|
||||
|
||||
const numberValue = calculateTime
|
||||
? Object.values(general).reduce((total, value) => total + value, 0) / Object.values(general).length
|
||||
: conversionValue
|
||||
|
||||
let numberValue = 0
|
||||
|
||||
numberValue = conversionValue
|
||||
? conversionValue
|
||||
: Object.values(general).reduce((total, item) => total + item, 0);
|
||||
|
||||
if (calculateTime) {
|
||||
const values = Object.values(general).filter(e => e);
|
||||
numberValue = values.reduce((total, value) => total + value, 0) / Object.values(values).length;
|
||||
}
|
||||
|
||||
|
||||
if (
|
||||
Object.keys(general).length === 0 ||
|
||||
Object.values(general).every((item) => item === 0)
|
||||
@ -150,7 +156,7 @@ export const General: FC<GeneralProps> = ({ data, day }) => {
|
||||
(total, item) => total + item,
|
||||
0,
|
||||
);
|
||||
const openSum = Object.values(generalResponse.Open).reduce(
|
||||
const openSum = Object.values(generalResponse.Open).filter(e => e).reduce(
|
||||
(total, item) => total + item,
|
||||
0,
|
||||
);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user