| | |
| | | //防抖 |
| | | import dayjs from "dayjs"; |
| | | |
| | | export function debounce(fn) { |
| | | console.log(1) |
| | | let t = null //只会执行一次 |
| | |
| | | 'aplication/zip': 'zpi', |
| | | } |
| | | } |
| | | |
| | | export const deepCopySameProperties = (source, target) =>{ |
| | | for (const key in source) { |
| | | if (target.hasOwnProperty(key)) { |
| | | if (typeof source[key] === 'object' && source[key] !== null && |
| | | typeof target[key] === 'object' && target[key] !== null) { |
| | | // 递归处理对象 |
| | | deepCopySameProperties(source[key], target[key]); |
| | | } else { |
| | | // 基本类型直接赋值 |
| | | target[key] = source[key]; |
| | | } |
| | | } |
| | | } |
| | | return target; |
| | | } |
| | | export function filterArr(arr) { |
| | | return arr.filter(item => item.flag !== false); |
| | | } |
| | | } |
| | | |
| | | export function getCurrentMonth () { |
| | | let month = dayjs().month() + 1 |
| | | if (month <= 3) { |
| | | return '1'; |
| | | } else if (month <= 6) { |
| | | return '2'; |
| | | } else if (month <= 9) { |
| | | return '3'; |
| | | } else if (month <= 12) { |
| | | return '4'; |
| | | } |
| | | } |