Explorar o código

甘特图更新

wangziqian %!s(int64=5) %!d(string=hai) anos
pai
achega
a0ec09368e

+ 24 - 4
src/views/workbench/team/components/ganntViews.vue

@@ -70,6 +70,18 @@ export default {
     ganttElasticHeader: GanttHeader,
     ganttElastic: GanttElastic
   },
+  props: {
+    search: {
+      type: Object,
+      default: () => {
+        return {
+          teamId: null,
+          bizId: null
+        }
+      },
+      required: true
+    }
+  },
   data() {
     return {
       timeSelectVal: [moment().format('YYYY.MM.DD'), moment().add(1, 'month').format('YYYY.MM.DD')],
@@ -78,10 +90,7 @@ export default {
           return time.getTime() < Date.now() - 24 * 60 * 60 * 1000
         }
       },
-      searchForm: {
-        teamId: null,
-        bizId: null
-      },
+      searchForm: this.search,
       idleSearchForm: {
         startTime: null,
         endTime: null
@@ -106,6 +115,17 @@ export default {
       ganntOrigin: [0, 1] // 任务排期 0、个人日程1
     }
   },
+  watch: {
+    search: {
+      handler(newV, oldV) {
+        this.searchForm = newV
+        this.radio1 = '忙碌'
+        this.queryTeamWorkList()
+      },
+      deep: true,
+      immediate: true
+    }
+  },
   mounted() {
     this.queryTeamWorkList()
   },

+ 1 - 7
src/views/workbench/team/index.vue

@@ -71,7 +71,7 @@
             @edit="editSchedule"
             @delete="deleteSchedule"
           />
-          <gannt-views v-show="activeSchedule === '2'" ref="gannt-views" />
+          <gannt-views v-show="activeSchedule === '2'" ref="gannt-views" :search="searchForm" />
         </div>
       </section>
     </el-container>
@@ -128,7 +128,6 @@ export default {
     calendarDialog,
     modifySchedule,
     bugTableList
-
   },
   data() {
     return {
@@ -226,7 +225,6 @@ export default {
       this.teamName = res.teamName
       this.queryTeamWorkListByTime(this.calendarView)
       this.queryTeamMember()
-      this.updateGannt()
       this.handleClick()
     },
     handleBizId(e) { // 业务线变动
@@ -235,12 +233,8 @@ export default {
       this.bizName = res.name
       this.queryTeamWorkListByTime(this.calendarView)
       this.queryTeamMember()
-      this.updateGannt()
       this.handleClick()
     },
-    updateGannt() { // 更新子组件甘特图
-      this.$refs['gannt-views'].updateGannt(this.searchForm)
-    },
     showSchedule(e) { // 查看日程详情
       const res = this.calendarEvents.find(item => item.id === Number(e.event.id))
       this.nowDetailData = res.detailData