From f9d0e4bdff62701a97e1c620bd8dd9ac15f67896 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=AF=E5=B0=8F=E7=8E=8B=E5=91=80=5C24601?= <819653817@qq.com> Date: Fri, 2 Aug 2024 18:27:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=B6=E9=97=B4=E6=8C=89=E7=85=A7=E5=BD=93?= =?UTF-8?q?=E5=B9=B4=EF=BC=8C=E6=96=87=E5=AD=97=E4=B8=8D=E6=8D=A2=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/shequzhili/analysis/css/index.scss | 3 +++ src/views/modules/shequzhili/analysis/index.vue | 13 ++++++------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/views/modules/shequzhili/analysis/css/index.scss b/src/views/modules/shequzhili/analysis/css/index.scss index c368df410..16a8e38a8 100644 --- a/src/views/modules/shequzhili/analysis/css/index.scss +++ b/src/views/modules/shequzhili/analysis/css/index.scss @@ -136,6 +136,7 @@ border-left: #777 solid 1px; color: #333333; text-align: center; margin-left: 5px; + white-space: nowrap; } .text1{ font-size: 16px; @@ -179,6 +180,7 @@ border-left: #777 solid 1px; color: #666666; text-align: center; margin-left: 5px; + white-space: nowrap; } .row_right { @@ -345,6 +347,7 @@ border-left: #777 solid 1px; color: #333333; text-align: center; margin-left: 5px; + white-space: nowrap; } .row_right { diff --git a/src/views/modules/shequzhili/analysis/index.vue b/src/views/modules/shequzhili/analysis/index.vue index fd5a6eee0..b21a22bdb 100644 --- a/src/views/modules/shequzhili/analysis/index.vue +++ b/src/views/modules/shequzhili/analysis/index.vue @@ -914,15 +914,14 @@ export default { //获取前一个月的日期 getLastMonthRange() { const now = new Date(); - const firstDayOfCurrentMonth = new Date(now.getFullYear(), now.getMonth(), 1); - const lastDayOfLastMonth = new Date(firstDayOfCurrentMonth - 1); - const firstDayOfLastMonth = new Date(lastDayOfLastMonth.getFullYear(), lastDayOfLastMonth.getMonth(), 1); + const startOfYear = new Date(now.getFullYear(), 0, 1); // 当前年份的1月1日 + const endOfYear = new Date(now.getFullYear(), 11, 31); // 当前年份的12月31日 - firstDayOfLastMonth.setHours(0, 0, 0, 0); - lastDayOfLastMonth.setHours(23, 59, 59, 999); + startOfYear.setHours(0, 0, 0, 0); + endOfYear.setHours(23, 59, 59, 999); - this.formData.queryDateStart =this.formatDate1(firstDayOfLastMonth), - this.formData.queryDateEnd=this.formatDate1(lastDayOfLastMonth) + this.formData.queryDateStart =this.formatDate1(startOfYear), + this.formData.queryDateEnd=this.formatDate1(endOfYear) console.log(this.formData.queryDateEnd); }, //对部门进行统计