From 335829ef8c9db01d2615a967991c872b6c3c152c Mon Sep 17 00:00:00 2001 From: Jack <1638169491@qq.com> Date: Wed, 10 Aug 2022 11:37:39 +0800 Subject: [PATCH 01/10] =?UTF-8?q?=E6=B9=96=E9=87=8C=E5=A4=A7=E5=B1=8F(?= =?UTF-8?q?=E8=BF=9B=E5=BA=A6=E8=AE=A1=E5=88=92)=EF=BC=9A=E5=AE=8C?= =?UTF-8?q?=E6=88=90=E5=86=85=E5=B1=82=E7=94=98=E7=89=B9=E5=9B=BE=E8=BF=9B?= =?UTF-8?q?=E5=BA=A6=E6=9D=A1=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/projectAdmin/jlw/planProgress/centerTop.vue | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/views/projectAdmin/jlw/planProgress/centerTop.vue b/src/views/projectAdmin/jlw/planProgress/centerTop.vue index b20e8119..d2cd6282 100644 --- a/src/views/projectAdmin/jlw/planProgress/centerTop.vue +++ b/src/views/projectAdmin/jlw/planProgress/centerTop.vue @@ -234,6 +234,7 @@ export default { border-left: 1px solid #234d5f; .row-groups { position: relative; + height: 42px; &::before { content: ''; position: absolute; @@ -248,13 +249,11 @@ export default { z-index: 99; } &.open { + height: unset; &::before { border-left-color: transparent; border-top-color: #5be1f4; } - .children { - display: block; - } } > .row .td:first-child { user-select: none; @@ -306,7 +305,6 @@ export default { } } .children { - display: none; .td { height: 38px; line-height: 38px; From 1c1a01bbd8d0a6a18d47948eb679f3ef8997fcd0 Mon Sep 17 00:00:00 2001 From: Jack <1638169491@qq.com> Date: Wed, 10 Aug 2022 14:26:52 +0800 Subject: [PATCH 02/10] =?UTF-8?q?=E6=B9=96=E9=87=8C=E5=A4=A7=E5=B1=8F(?= =?UTF-8?q?=E8=BF=9B=E5=BA=A6=E8=AE=A1=E5=88=92)=EF=BC=9A=E5=AE=8C?= =?UTF-8?q?=E6=88=90=E7=94=98=E7=89=B9=E5=9B=BE=E9=98=B6=E6=AE=B5=E8=BF=9B?= =?UTF-8?q?=E5=BA=A6=E6=9D=A1=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jlw/planProgress/centerTop.vue | 25 ++++++++----------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/src/views/projectAdmin/jlw/planProgress/centerTop.vue b/src/views/projectAdmin/jlw/planProgress/centerTop.vue index d2cd6282..b33855b4 100644 --- a/src/views/projectAdmin/jlw/planProgress/centerTop.vue +++ b/src/views/projectAdmin/jlw/planProgress/centerTop.vue @@ -30,7 +30,7 @@
-
+
@@ -42,12 +42,7 @@
-
+
@@ -81,17 +76,19 @@ export default { pName: '地基与基础工程', startTime: '2020/04/06', endTime: '2020/05/09', + status: 0, gantts: [], // gantts: [{ left: '420px', width: '100px', status: '' }], children: [ - { pName: '无支护土方工程', startTime: '2020/04/06', endTime: '2020/04/09', gantts: [] }, - { pName: '有支护土方工程', startTime: '2020/04/10', endTime: '2020/05/08', gantts: [] } + { pName: '无支护土方工程', startTime: '2020/04/06', endTime: '2020/04/09', status: 1 }, + { pName: '有支护土方工程', startTime: '2020/04/10', endTime: '2020/05/08', status: 3 } ] }, - { pName: '主体结构', startTime: '2020/03/12', endTime: '2020/06/04' }, - { pName: '建筑装饰装修', startTime: '2020/04/21', endTime: '2020/07/30', gantts: [] } + { pName: '主体结构', startTime: '2020/03/12', endTime: '2020/06/04', status: 2 }, + { pName: '建筑装饰装修', startTime: '2020/04/21', endTime: '2020/07/30', status: 1 } ], - openedIndex: 9999 + openedIndex: 9999, + colors: ['#4C87FF', '#54CF8E', '#F2D026', '#FF6C7F'] } }, methods: { @@ -125,7 +122,7 @@ export default { const endLeft = endRef.offsetLeft const ganttWidth = endLeft - startLeft + endWidth - const gantt = { left: startLeft + 'px', width: ganttWidth + 'px' } + const gantt = { left: startLeft + 'px', width: ganttWidth + 'px', background: this.colors[project.status] } if (gantts) { gantts.push(gantt) } else { @@ -301,7 +298,7 @@ export default { top: calc(50% - 7px); width: 20px; height: 14px; - background: pink; + background: #557dee; } } .children { From 7905c4463e9b77d1359c4580b9c192336741dd6e Mon Sep 17 00:00:00 2001 From: Jack <1638169491@qq.com> Date: Wed, 10 Aug 2022 15:18:10 +0800 Subject: [PATCH 03/10] =?UTF-8?q?=E6=B9=96=E9=87=8C=E5=A4=A7=E5=B1=8F(?= =?UTF-8?q?=E8=BF=9B=E5=BA=A6=E8=AE=A1=E5=88=92)=EF=BC=9A=E6=9B=B4?= =?UTF-8?q?=E6=94=B9=E7=94=98=E7=89=B9=E5=9B=BE=E6=BB=9A=E5=8A=A8=E6=9D=A1?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/projectAdmin/jlw/planProgress/centerTop.vue | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/views/projectAdmin/jlw/planProgress/centerTop.vue b/src/views/projectAdmin/jlw/planProgress/centerTop.vue index b33855b4..34565a32 100644 --- a/src/views/projectAdmin/jlw/planProgress/centerTop.vue +++ b/src/views/projectAdmin/jlw/planProgress/centerTop.vue @@ -190,6 +190,16 @@ export default { .table { height: 100%; overflow-x: auto; + &::-webkit-scrollbar { + width: 10px; + height: 8px; + cursor: pointer; + } + &::-webkit-scrollbar-thumb { + border-radius: 10px; + background-color: skyblue; + } + .thead { border-bottom: 1px solid #234d5f; .row { 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 04/10] =?UTF-8?q?=E6=B9=96=E9=87=8C=E5=A4=A7=E5=B1=8F(?= =?UTF-8?q?=E8=BF=9B=E5=BA=A6=E8=AE=A1=E5=88=92)=EF=BC=9A=E5=AE=8C?= =?UTF-8?q?=E6=88=90=E7=94=98=E7=89=B9=E5=9B=BE=E6=97=A5=E6=9C=9F=E8=AE=A1?= =?UTF-8?q?=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 + } } } From 923aad5fefb97ebe62b15db2d034793eae0e0ab0 Mon Sep 17 00:00:00 2001 From: Jack <1638169491@qq.com> Date: Wed, 10 Aug 2022 17:18:03 +0800 Subject: [PATCH 05/10] =?UTF-8?q?=E6=B9=96=E9=87=8C=E5=A4=A7=E5=B1=8F(?= =?UTF-8?q?=E8=BF=9B=E5=BA=A6=E8=AE=A1=E5=88=92)=EF=BC=9A=E6=8A=BD?= =?UTF-8?q?=E7=A6=BB=E8=8E=B7=E5=8F=96=E8=BF=9B=E5=BA=A6=E6=9D=A1=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jlw/planProgress/centerTop.vue | 64 ++++++++++--------- 1 file changed, 34 insertions(+), 30 deletions(-) diff --git a/src/views/projectAdmin/jlw/planProgress/centerTop.vue b/src/views/projectAdmin/jlw/planProgress/centerTop.vue index bc289a61..acdf0164 100644 --- a/src/views/projectAdmin/jlw/planProgress/centerTop.vue +++ b/src/views/projectAdmin/jlw/planProgress/centerTop.vue @@ -75,6 +75,7 @@ export default { pName: '地基与基础工程', startTime: '2020/04/06', endTime: '2020/05/09', + delay: 5, status: 0, gantts: [], // gantts: [{ left: '420px', width: '100px', status: '' }], @@ -91,45 +92,48 @@ export default { } }, methods: { + getGanttStyle(project) { + let { startTime, endTime, pName } = project + const startArr = startTime.split('/') + const endArr = endTime.split('/') + let startRef = null + let endRef = null + + if (!(startArr[2] % 2)) { + const day = startArr[2] - 1 + startArr[2] = day < 10 ? '0' + day : day + startTime = startArr.join('/') + console.log(startTime, 'xxx') + } + if (!(endArr[2] % 2)) { + const day = endArr[2] - 1 + endArr[2] = day < 10 ? '0' + day : day + endTime = endArr.join('/') + console.log(endTime, 'xxx') + } + + startRef = this.$refs[`${pName}-${startTime}`][0] + const startLeft = startRef.offsetLeft + + endRef = this.$refs[`${pName}-${endTime}`][0] + const endWidth = endRef.offsetWidth + const endLeft = endRef.offsetLeft + const ganttWidth = endLeft - startLeft + endWidth + + return { left: startLeft + 'px', width: ganttWidth + 'px' } + }, setGantts() { const configGantts = projects => { projects.map(project => { - let { startTime, endTime, pName, gantts } = project - const startArr = startTime.split('/') - const endArr = endTime.split('/') - let startRef = null - let endRef = null - - if (!(startArr[2] % 2)) { - const day = startArr[2] - 1 - startArr[2] = day < 10 ? '0' + day : day - startTime = startArr.join('/') - console.log(startTime, 'xxx') - } - if (!(endArr[2] % 2)) { - const day = endArr[2] - 1 - endArr[2] = day < 10 ? '0' + day : day - endTime = endArr.join('/') - console.log(endTime, 'xxx') - } - - startRef = this.$refs[`${pName}-${startTime}`][0] - const startLeft = startRef.offsetLeft - - endRef = this.$refs[`${pName}-${endTime}`][0] - const endWidth = endRef.offsetWidth - const endLeft = endRef.offsetLeft - const ganttWidth = endLeft - startLeft + endWidth - - const gantt = { left: startLeft + 'px', width: ganttWidth + 'px', background: this.colors[project.status] } + let { gantts } = project + const gantt = this.getGanttStyle(project) + gantt.background = this.colors[project.status] if (gantts) { gantts.push(gantt) } else { project.gantts = [gantt] } - console.log(startLeft, ganttWidth, '丢雷', `${pName}-${endTime}`) - // debugger project.children && configGantts(project.children) }) From 812821f1060d5806804ac66ccac51935a47ddb69 Mon Sep 17 00:00:00 2001 From: Jack <1638169491@qq.com> Date: Wed, 10 Aug 2022 18:31:48 +0800 Subject: [PATCH 06/10] =?UTF-8?q?=E6=B9=96=E9=87=8C=E5=A4=A7=E5=B1=8F(?= =?UTF-8?q?=E8=BF=9B=E5=BA=A6=E8=AE=A1=E5=88=92)=EF=BC=9A=E5=AE=8C?= =?UTF-8?q?=E6=88=90=E7=94=98=E7=89=B9=E5=9B=BE=E5=BB=B6=E6=97=B6=E8=BF=9B?= =?UTF-8?q?=E5=BA=A6=E6=9D=A1=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jlw/planProgress/centerTop.vue | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/views/projectAdmin/jlw/planProgress/centerTop.vue b/src/views/projectAdmin/jlw/planProgress/centerTop.vue index acdf0164..3beee7ff 100644 --- a/src/views/projectAdmin/jlw/planProgress/centerTop.vue +++ b/src/views/projectAdmin/jlw/planProgress/centerTop.vue @@ -75,7 +75,7 @@ export default { pName: '地基与基础工程', startTime: '2020/04/06', endTime: '2020/05/09', - delay: 5, + delay: 10, status: 0, gantts: [], // gantts: [{ left: '420px', width: '100px', status: '' }], @@ -125,21 +125,38 @@ export default { setGantts() { const configGantts = projects => { projects.map(project => { - let { gantts } = project + let { endTime, pName, gantts } = project const gantt = this.getGanttStyle(project) gantt.background = this.colors[project.status] + if (gantts) { gantts.push(gantt) } else { project.gantts = [gantt] } + if (project.delay) { + const delayStartTime = this.increaseDate(endTime, 1) + const delayEndTime = this.increaseDate(endTime, project.delay) + const gantt = this.getGanttStyle({ startTime: delayStartTime, endTime: delayEndTime, pName }) + gantt.background = this.colors[3] + gantts.push(gantt) + console.log(gantt, '是的发生的范范') + } + // debugger project.children && configGantts(project.children) }) } configGantts(this.projects) }, + increaseDate(date, delay) { + const timestamp = new Date(date).getTime() + (delay + 1) * 1000 * 60 * 60 * 24 + return new Date(timestamp) + .toISOString() + .replace(/-/g, '/') + .slice(0, 10) + }, getDays(date) { const year = date.split('/')[0] const month = +date.split('/')[1] From 8f15a0a94cc86b59b8d48f186c5cc25112b1e601 Mon Sep 17 00:00:00 2001 From: Jack <1638169491@qq.com> Date: Thu, 11 Aug 2022 16:41:26 +0800 Subject: [PATCH 07/10] =?UTF-8?q?=E6=B9=96=E9=87=8C=E5=A4=A7=E5=B1=8F(?= =?UTF-8?q?=E8=BF=9B=E5=BA=A6=E8=AE=A1=E5=88=92)=EF=BC=9A=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E6=BB=9A=E5=8A=A8=E7=94=98=E7=89=B9=E5=9B=BE=E9=98=B2?= =?UTF-8?q?=E6=8A=96=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jlw/planProgress/centerTop.vue | 73 ++++++++++++++++++- 1 file changed, 70 insertions(+), 3 deletions(-) diff --git a/src/views/projectAdmin/jlw/planProgress/centerTop.vue b/src/views/projectAdmin/jlw/planProgress/centerTop.vue index 3beee7ff..9e17bcb3 100644 --- a/src/views/projectAdmin/jlw/planProgress/centerTop.vue +++ b/src/views/projectAdmin/jlw/planProgress/centerTop.vue @@ -1,7 +1,7 @@