From bd52da253561e68d9ab31a260a9c23c2745334a7 Mon Sep 17 00:00:00 2001
From: wujingjing <gersonwu@qq.com>
Date: 星期四, 12 十二月 2024 11:38:48 +0800
Subject: [PATCH] Merge branch 'test' of http://47.103.154.90:83/r/WI/Web.Admin.V1.0 into test

---
 src/utils/util.ts |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/utils/util.ts b/src/utils/util.ts
index 9370654..9c14200 100644
--- a/src/utils/util.ts
+++ b/src/utils/util.ts
@@ -110,8 +110,8 @@
 
 export const getImg = (name) => `src/assets/images/${name}`;
 
-export const downloadJSON = (jsonData: Object, fileName: String) => {
-	const dataStr = 'data:text/json;charset=utf-8,' + encodeURIComponent(JSON.stringify(jsonData));
+export const downloadJSON = (jsonData: string, fileName: String) => {
+	const dataStr = 'data:text/json;charset=utf-8,' + encodeURIComponent(jsonData);
 	const downloadAnchorNode = document.createElement('a');
 	downloadAnchorNode.setAttribute('href', dataStr);
 	downloadAnchorNode.setAttribute('download', fileName + '.json');
@@ -470,6 +470,7 @@
 	const startDate = new Date();
 	startDate.setTime(startDate.getTime() - 3600 * 1000 * 24 * dates);
 	startDate.setHours(0, 0, 0, 0);
+	endDate.setHours(23,59,59,59)
 	return [startDate, endDate];
 };
 
@@ -706,7 +707,9 @@
  */
 export const toMyFixed = (num, precision) => {
 	if (num == null) return '';
-	return num.toFixed(precision).replace(/\.?0+$/, '');
+	if (!precision) return num + '';
+	const factor = Math.pow(10, precision);
+	return Math.round(Number(num) * factor) / factor + '';
 };
 
 type GetTextWidthOption = {

--
Gitblit v1.9.3