wujingjing
2024-09-30 5e78e5bc69a8b7abf76663acaab6b7da63f35aa2
src/utils/util.ts
@@ -541,7 +541,8 @@
 * 最近 n 天的 startDate、endDate
 * @param dates
 */
export const getRecentDateRange = (dates: number) => {
export const getRecentDateRange = (dates: number, includesCurrent = true) => {
   dates = includesCurrent ? dates - 1 : dates;
   // 获取当前日期
   const endDate = new Date();
   const startDate = new Date();
@@ -722,3 +723,12 @@
   document.body.removeChild(spanEle);
   return width;
}
export function decodeFormData(formDataString) {
   const params = new URLSearchParams(formDataString);
   const decodedData = {};
   for (const [key, value] of params) {
      decodedData[key] = decodeURIComponent(value);
   }
   return decodedData;
}