From 149f9857072b74f32fb9e9f8852cd42bbe3fef33 Mon Sep 17 00:00:00 2001 From: shijing Date: Tue, 26 Mar 2024 09:31:58 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E7=94=9F=E4=BA=A7=E7=AE=A1=E7=90=866?= =?UTF-8?q?=E3=80=817=E3=80=8110=E8=BD=A6=E9=97=B4gantt=E9=9A=8F=E7=9D=80?= =?UTF-8?q?=E4=B8=8A=E9=9D=A2=E7=9A=84=E8=A1=A8=E6=A0=BC=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=8F=98=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/GanttComponent.vue | 340 +++++++++++++++++------------- src/views/pm/utask_dept10.vue | 6 +- src/views/pm/utask_dept6.vue | 8 +- src/views/pm/utask_dept7.vue | 15 +- 4 files changed, 205 insertions(+), 164 deletions(-) diff --git a/src/components/GanttComponent.vue b/src/components/GanttComponent.vue index 587b7f6f..cc6b0865 100644 --- a/src/components/GanttComponent.vue +++ b/src/components/GanttComponent.vue @@ -1,164 +1,200 @@ \ No newline at end of file + diff --git a/src/views/pm/utask_dept10.vue b/src/views/pm/utask_dept10.vue index e2a1d8e9..9f56047c 100644 --- a/src/views/pm/utask_dept10.vue +++ b/src/views/pm/utask_dept10.vue @@ -201,6 +201,7 @@ class="left-container" v-if="ganntVisit" :tasks="tasks" + :key="timeStamp" :start_date="start_date" > @@ -247,6 +248,7 @@ export default { dateValue: "", apiUtask: null, apiObj: null, + timeStamp: "", ganntVisit: true, visibleRecord: false, currentDept: { id: 0 }, @@ -289,7 +291,8 @@ export default { let data = []; that.ganntVisit = false; that.tasks.data = []; - console.log("tableData", tableData); + let date = new Date(); + that.timeStamp = date.getTime(); if (tableData.length > 0) { tableData.forEach((item) => { let start_date = item.start_date; @@ -328,7 +331,6 @@ export default { that.tasks.data = data; that.ganntVisit = true; gantt.parse(that.tasks); - // 刷新数据 gantt.refreshData(); }, getGantt() { diff --git a/src/views/pm/utask_dept6.vue b/src/views/pm/utask_dept6.vue index 30d526c2..49f25b72 100644 --- a/src/views/pm/utask_dept6.vue +++ b/src/views/pm/utask_dept6.vue @@ -212,6 +212,7 @@ class="left-container" v-if="ganntVisit" :tasks="tasks" + :key="timeStamp" :start_date="start_date" > @@ -258,6 +259,7 @@ export default { start_date: "", end_date: "", }, + timeStamp: "", ganntVisit: true, dateValue: "", apiUtask: null, @@ -304,7 +306,8 @@ export default { let data = []; that.ganntVisit = false; that.tasks.data = []; - console.log("tableData", tableData); + let date = new Date(); + that.timeStamp = date.getTime(); if (tableData.length > 0) { tableData.forEach((item) => { let start_date = item.start_date; @@ -341,9 +344,8 @@ export default { }); } that.tasks.data = data; - that.ganntVisit = true; gantt.parse(that.tasks); - // 刷新数据 + that.ganntVisit = true; gantt.refreshData(); }, getGantt() { diff --git a/src/views/pm/utask_dept7.vue b/src/views/pm/utask_dept7.vue index d41a8c9a..52fe466a 100644 --- a/src/views/pm/utask_dept7.vue +++ b/src/views/pm/utask_dept7.vue @@ -45,7 +45,6 @@ stripe :params="paramsUtask" :query="queryUtask" - @row-click="rowclick" @selection-change="handleSelectionChange" @dataChange="updateCount" > @@ -233,6 +232,7 @@ @@ -277,6 +277,7 @@ export default { tasks: { data: [], }, + timeStamp: "", ganntVisit: true, dateValue: [], apiUtask: null, @@ -300,6 +301,8 @@ export default { }, mounted() { this.initDept(); + let date = new Date(); + this.timeStamp = date.getTime(); }, methods: { initDept() { @@ -310,9 +313,7 @@ export default { if (res.length == 1) { that.currentDept = res[0]; that.paramsUtask.belong_dept = that.currentDept.id; - // that.paramsObj.belong_dept = that.currentDept.id; that.apiUtask = that.$API.pm.utask.list; - // that.getGantt(); } else { that.$message.error("未找到车间"); } @@ -322,9 +323,10 @@ export default { let that = this; this.count = res.count; let data = []; - that.ganntVisit = false; that.tasks.data = []; - console.log("tableData", tableData); + that.ganntVisit = false; + let date = new Date(); + that.timeStamp = date.getTime(); if (tableData.length > 0) { tableData.forEach((item) => { let start_date = item.start_date; @@ -361,9 +363,8 @@ export default { }); } that.tasks.data = data; - that.ganntVisit = true; gantt.parse(that.tasks); - // 刷新数据 + that.ganntVisit = true; gantt.refreshData(); }, utaskDepuse() {