From 6901151b85bb2640d8ce9af3d27be23cd9bf48a2 Mon Sep 17 00:00:00 2001 From: yangyin <1850366751@qq.com> Date: 星期三, 20 十一月 2024 11:26:48 +0800 Subject: [PATCH] 修改页面数据消失问题 --- src/utils/util.ts | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/src/utils/util.ts b/src/utils/util.ts index 77895cf..d92279e 100644 --- a/src/utils/util.ts +++ b/src/utils/util.ts @@ -547,6 +547,7 @@ const endDate = new Date(); const startDate = new Date(); startDate.setTime(startDate.getTime() - 3600 * 1000 * 24 * dates); + endDate.setHours(23,59,59,59) startDate.setHours(0, 0, 0, 0); return [startDate, endDate]; }; @@ -629,6 +630,21 @@ return percent; }; + + +/** + * 淇濈暀鎸囧畾绮惧害灏忔暟浣嶏紝涓斾笉琛ラ浂 + * @param num + * @param precision + * @returns + */ +export const toMyFixed = (num, precision) => { + if (num == null) return ''; + if (!precision) return num + ''; + const factor = Math.pow(10, precision); + return Math.round(Number(num) * factor) / factor + ''; +}; + /** * * @param {*} func 闃叉姈鍑芥暟 -- Gitblit v1.9.3