| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120 | 
							- import dayjs from 'dayjs'
 
- export const formatData = (times, keys, format = 'YYYY-MM-DD') => {
 
-   const data = {}
 
-   if (times && times.length) {
 
-     for (let i = 0; i < keys.length; i++) {
 
-       data[keys[i]] = dayjs(times[i]).format(format)
 
-     }
 
-   }
 
-   return data
 
- }
 
- export const getNowDateAndMonday=(time)=> {
 
-   let timestamp = new Date(time.replace(/-/g, "/")).getTime();
 
-   let serverDate = new Date(time);
 
-   if (serverDate.getDay() == 0) {
 
-     timestamp -= 7 * 24 * 60 * 60 * 1000;
 
-   }
 
-   let mondayTime =
 
-     timestamp - (serverDate.getDay() - 1) * 24 * 60 * 60 * 1000;
 
-   let mondayData = new Date(mondayTime);
 
-   //年
 
-   let mondayY = mondayData.getFullYear();
 
-   //月
 
-   let mondayM =
 
-     mondayData.getMonth() + 1 < 10
 
-       ? "0" + (mondayData.getMonth() + 1)
 
-       : mondayData.getMonth() + 1;
 
-   //日
 
-   let mondayD =
 
-     mondayData.getDate() < 10
 
-       ? "0" + mondayData.getDate()
 
-       : mondayData.getDate();
 
-   let str = mondayY + "-" + mondayM + "-" + mondayD;
 
-   return str;
 
- }
 
- export const getNowDateAndSunday=(time) =>{
 
-   let timestamp = new Date(time.replace(/-/g, "/")).getTime();
 
-   let serverDate = new Date(time);
 
-   let num = 7 - serverDate.getDay();
 
-   if (num == 7) {
 
-     num = 0;
 
-   }
 
-   let sundayTiem = timestamp + num * 24 * 60 * 60 * 1000;
 
-   let SundayData = new Date(sundayTiem);
 
-   //年
 
-   let tomorrowY = SundayData.getFullYear(); //月
 
-   let tomorrowM =
 
-     SundayData.getMonth() + 1 < 10
 
-       ? "0" + (SundayData.getMonth() + 1)
 
-       : SundayData.getMonth() + 1;
 
-   //日
 
-   let tomorrowD =
 
-     SundayData.getDate() < 10
 
-       ? "0" + SundayData.getDate()
 
-       : SundayData.getDate();
 
-   let str = tomorrowY + "-" + tomorrowM + "-" + tomorrowD;
 
-   return str;
 
- }
 
- export const getCourseType=(type)=>{
 
-   let arr = []
 
-   switch (type) {
 
-     case "NORMAL": {
 
-       arr = [
 
-         { value: "SINGLE", label: "声部课" },
 
-         { value: "TRAINING_SINGLE", label: "集训声部课" },
 
-         { value: "COMPREHENSIVE", label: "综合课" },
 
-         { value: "CLASSROOM", label: "课堂课" },
 
-       ];
 
-       break;
 
-     }
 
-     case "MIX": {
 
-       arr = [
 
-         { value: "MIX", label: "合奏课" },
 
-         { value: "TRAINING_MIX", label: "集训合奏课" },
 
-         { value: "COMPREHENSIVE", label: "综合课" },
 
-         { value: "CLASSROOM", label: "课堂课" },
 
-       ];
 
-       break;
 
-     }
 
-     case "HIGH": {
 
-       arr = [{ value: "HIGH", label: "基础技能课" }];
 
-       break;
 
-     }
 
-     case "HIGH_ONLINE": {
 
-       arr = [
 
-         { value: "HIGH_ONLINE", label: "线上基础技能课" },
 
-       ];
 
-       break;
 
-     }
 
-     case "MUSIC_NETWORK": {
 
-       arr = [
 
-         { value: "MUSIC_NETWORK", label: "乐团网管课" },
 
-       ];
 
-       break;
 
-     }
 
-     case "SNAP": {
 
-       arr = [
 
-         { value: "SINGLE", label: "声部课" },
 
-         { value: "MIX", label: "合奏课" },
 
-         { value: "TRAINING_SINGLE", label: "集训声部课" },
 
-         { value: "TRAINING_MIX", label: "集训合奏课" },
 
-         { value: "HIGH", label: "基础技能课" },
 
-         { value: "COMPREHENSIVE", label: "综合课" },
 
-         { value: "CLASSROOM", label: "课堂课" },
 
-       ];
 
-     }
 
-   }
 
-   return arr
 
- }
 
- // 保留2位小数的正整数 /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/
 
- // 清除路由链接
 
- export const resetQuery=(that,obj)=>{
 
-   that.$router.replace({query:{...that.$route.query,...obj}})
 
- }
 
 
  |