From e58db1e5a8d5ade0075af23ed1517adaddada245 Mon Sep 17 00:00:00 2001 From: Lei OT Date: Thu, 25 Dec 2025 15:06:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B4=E7=90=86=20commons?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/commons.js | 26 +++----------------------- 1 file changed, 3 insertions(+), 23 deletions(-) diff --git a/src/utils/commons.js b/src/utils/commons.js index 1293a4b..5c63021 100644 --- a/src/utils/commons.js +++ b/src/utils/commons.js @@ -107,11 +107,11 @@ export function formatDate(date) { export function formatDateToStr(date) { if(date === ''){ return null; - } + } const year = date.getFullYear(); const month = date.getMonth(); const day = date.getDate(); - + const enMonthArr = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Spt","Oct","Nov","Dec"]; const formatted = enMonthArr[month] +'. '+ day +', '+ year; return formatted; @@ -216,17 +216,6 @@ export function prepareUrl(url) { return new UrlBuilder(url); } -// export function debounce(fn, delay = 500) { -// let timer -// return e => { -// e.persist() -// clearTimeout(timer) -// timer = setTimeout(() => { -// fn(e) -// }, delay) -// } -// } - export const debounce = (func, wait, immediate) => { var timeout; return function () { @@ -271,14 +260,6 @@ export function escape2Html(str) { return output; } -export function formatPrice(price) { - return Math.ceil(price).toLocaleString(); -} - -export function formatPercent(number) { - return Math.round(number * 100) + '%'; -} - /** * ! 不支持计算 Set 或 Map * @param {*} val @@ -582,8 +563,7 @@ export function objectMapper(input, keyMap, keep = true) { let value = input[key]; if (map.transform) value = map.transform(value); if (typeof map === 'string') mappedObj[map] = value; - mappedObj[map.key || map] = value; - // mappedObj[map.key || map] = value; + mappedObj[map.key || map] = value; // || key } } });