import { newDate } from "./dateTimeStr";

/**
 * 对象快速复制：obj1复制到obj2
 * @param obj1 
 * @param obj2 
 */
export default function objCoppy(obj1: any, obj2: any) {
    Object.keys(obj2).forEach(key => {
        switch (key) {
            case 'startDate':
                obj2[key] = [newDate(obj1.startDate), newDate(obj1.endDate)]
                break;
            case 'beginDate':
                obj2[key] = [newDate(obj1.beginDate), newDate(obj1.endDate)]
                break;
            default:
                obj2[key] = obj1[key]
                break;
        }
    })
}