From 4dde2afbf01239043617a9afcbfa9db5b5677e45 Mon Sep 17 00:00:00 2001 From: Jack <1638169491@qq.com> Date: Wed, 10 Aug 2022 16:06:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B9=96=E9=87=8C=E5=A4=A7=E5=B1=8F(=E8=BF=9B?= =?UTF-8?q?=E5=BA=A6=E8=AE=A1=E5=88=92)=EF=BC=9A=E5=AE=8C=E6=88=90?= =?UTF-8?q?=E7=94=98=E7=89=B9=E5=9B=BE=E6=97=A5=E6=9C=9F=E8=AE=A1=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jlw/planProgress/centerTop.vue | 23 +++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/src/views/projectAdmin/jlw/planProgress/centerTop.vue b/src/views/projectAdmin/jlw/planProgress/centerTop.vue index 34565a32..bc289a61 100644 --- a/src/views/projectAdmin/jlw/planProgress/centerTop.vue +++ b/src/views/projectAdmin/jlw/planProgress/centerTop.vue @@ -7,7 +7,7 @@
分部分项工程名称
开始日期
完成日期
-
+
{{ date }} @@ -25,7 +25,7 @@
{{ p.pName }}
{{ p.startTime }}
{{ p.endTime }}
-
+
@@ -37,7 +37,7 @@
{{ child.pName }}
{{ child.startTime }}
{{ child.endTime }}
-
+
@@ -70,7 +70,6 @@ export default { }, data() { return { - dates: ['2020/03', '2020/04', '2020/05', '2020/06', '2020/07', '2020/08'], projects: [ { pName: '地基与基础工程', @@ -180,6 +179,22 @@ export default { this.openedIndex = index } } + }, + computed: { + dateList() { + let dates = [] + const mapDates = data => { + data.map(p => { + dates.push(p.startTime) + dates.push(p.endTime) + p.children && mapDates(p.children) + }) + } + mapDates(this.projects) + dates = dates.map(date => date.slice(0, 7)).sort() + dates = [...new Set(dates)] + return dates + } } }