• 根据月份选择 生成这个月的每一天


    monthDayTotal: [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31],
    //月份选择  (例2020年4月 - 2020年5月)
        changeMonth(val) {
          if (this.ruleForm.monthRange && this.ruleForm.monthRange.length > 0) {
            let year = parseInt(this.ruleForm.monthRange[0].split("-")[0]);
            let month = parseInt(this.ruleForm.monthRange[0].split("-")[1]);
            // this.listNum = this.monthDayTotal[month - 1];
            this.listNum = [];
            this.listNum.data = this.monthDayTotal[month - 1];
            if (
              ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) &&
              month == 2
            ) {
              // this.listNum = this.listNum + 1;
              this.listNum.data = this.listNum + 1;
            }
            //循环出每一行项的值
            for (let i = 0; i < this.listNum.data; i++) {
              this.listNum.push({
                personId: "",
                name: "",
                workType: "",
                workTypeName: "",
                workDate:
                  this.ruleForm.monthRange[0] +
                  "-" +
                  (i >= 9 ? i + 1 : "0" + (i + 1))
              });
            }
            // console.log("this.listNum", this.listNum);
          }
        },
  • 相关阅读:
    linxu 网络管理
    Linux 命令2
    crontab命令
    Linux 命令
    Linux 命令
    Git命令
    GIT
    Python 修改文件内容
    logging模块
    CSS 选择器
  • 原文地址:https://www.cnblogs.com/Byme/p/12761871.html
Copyright © 2020-2023  润新知