licp
2024-12-19 c32d4be6290ee261ac94b9878a32c5c388fc8129
完成站点工时统计优化
已修改4个文件
34 ■■■■ 文件已修改
src/components/view/b4-daily-business-statistics.vue 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/view/b4-inspection-item-statistics.vue 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/view/b4-site-hours-statistics.vue 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/view/index-index.vue 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/view/b4-daily-business-statistics.vue
@@ -263,10 +263,10 @@
          case '月':
            const year = new Date(this.time.month).getFullYear();
            const month = new Date(this.time.month).getMonth();
            const day = new Date(year, month + 1, 0).getDate(); //
            // 设置起始日期和结束日期
            this.startTime = new Date(year, month, 1).toISOString().slice(0, 10); // 月初
            this.endTime = new Date(year, month + 1, 0).toISOString().slice(0, 10); // 月末
            this.startTime = `${year}-${month + 1}-01`
            this.endTime = `${year}-${month + 1}-${day}` // 月末
            break;
          case '年':
            const year0 = new Date(this.time.year).getFullYear();
@@ -277,6 +277,7 @@
      }else{
        this.startTime = getYearAndMonthAndDays(new Date((new Date).getTime() - 24 * 60 * 60 * 1000))
        this.endTime = getYearAndMonthAndDays(new Date((new Date).getTime() + 24 * 60 * 60 * 1000 * 5))
        this.time.week = new Date()
      }
      this.init()
    },
src/components/view/b4-inspection-item-statistics.vue
@@ -310,10 +310,10 @@
            case '月':
              const year = new Date(this.time.month).getFullYear();
              const month = new Date(this.time.month).getMonth();
              const day = new Date(year, month + 1, 0).getDate(); //
              // 设置起始日期和结束日期
              this.startTime = new Date(year, month, 1).toISOString().slice(0, 10); // 月初
              this.endTime = new Date(year, month + 1, 0).toISOString().slice(0, 10); // 月末
              this.startTime = `${year}-${month + 1}-01`
              this.endTime = `${year}-${month + 1}-${day}` // 月末
              break;
            case '年':
              const year0 = new Date(this.time.year).getFullYear();
@@ -324,6 +324,7 @@
        }else{
          this.startTime = getYearAndMonthAndDays(new Date((new Date).getTime() - 24 * 60 * 60 * 1000))
          this.endTime = getYearAndMonthAndDays(new Date((new Date).getTime() + 24 * 60 * 60 * 1000 * 5))
          this.time.week = new Date()
        }
        this.init()
      }
src/components/view/b4-site-hours-statistics.vue
@@ -247,12 +247,8 @@
    }
  },
  mounted(){
    const year = new Date().getFullYear();
    const month = new Date().getMonth();
    // 设置起始日期和结束日期
    this.startTime = new Date(year, month, 1).toISOString().slice(0, 10); // 月初
    this.endTime = new Date(year, month + 1, 0).toISOString().slice(0, 10); // 月末
    this.init()
    this.month = new Date()
    this.changeTime()
  },
  methods:{
    init(){
@@ -298,9 +294,10 @@
    changeTime(){
      const year = new Date(this.month).getFullYear();
      const month = new Date(this.month).getMonth();
      const day = new Date(year, month + 1, 0).getDate(); //
      // 设置起始日期和结束日期
      this.startTime = new Date(year, month, 1).toISOString().slice(0, 10); // 月初
      this.endTime = new Date(year, month + 1, 0).toISOString().slice(0, 10); // 月末
      this.startTime = `${year}-${month + 1}-01`
      this.endTime = `${year}-${month + 1}-${day}` // 月末
      this.siteList.forEach(item=>{
        item.page.current = 1
      })
src/components/view/index-index.vue
@@ -889,10 +889,10 @@
            case '月':
              const year = new Date(this.time.month).getFullYear();
              const month = new Date(this.time.month).getMonth();
              const day = new Date(year, month + 1, 0).getDate(); //
              // 设置起始日期和结束日期
              this.startTime = new Date(year, month, 1).toISOString().slice(0, 10); // 月初
              this.endTime = new Date(year, month + 1, 0).toISOString().slice(0, 10); // 月末
              this.startTime = `${year}-${month + 1}-01`
              this.endTime = `${year}-${month + 1}-${day}` // 月末
              break;
            case '年':
              const year0 = new Date(this.time.year).getFullYear();
@@ -907,6 +907,7 @@
          // 设置起始日期和结束日期
          this.startTime = new Date(year, month, 1).toISOString().slice(0, 10); // 月初
          this.endTime = new Date(year, month + 1, 0).toISOString().slice(0, 10); // 月末
          this.time.month = new Date()
        }
        this.initEchart()
      },