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 + } } }