17613754660 3 лет назад
Родитель
Сommit
2e8cd0ac00

+ 42 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/project/gantt.vue

@@ -21,7 +21,8 @@ export default {
         return {data: [], links: []}
       }
     },
-    stafforpro: ''
+    stafforpro: '',
+    valueDate:[]
   },
  
   methods: {
@@ -93,13 +94,53 @@ export default {
     gantt.config.subscales = [
       {unit: "day", step: 1, date: "周%D,%d"}
     ];
+
+    // gantt.config.start_date = new Date(this.valueDate[0]);
+    // gantt.config.end_date = new Date(this.valueDate[0]);
+
+    gantt.config.layout = {
+        css: 'gantt_container',
+        cols: [
+          {
+            width: 500,
+            min_width: 300,
+            rows: [
+              {
+                view: 'grid',
+                scrollX: 'gridScroll',
+                scrollable: true,
+                scrollY: 'scrollVer'
+              },
+              { view: 'scrollbar', id: 'gridScroll', group: 'horizontal' }
+            ]
+          },
+          { resizer: true, width: 1 },
+          {
+            // width: 950,
+            // min_width: 600,
+            rows: [
+              {
+                view: 'timeline',
+                scrollX: 'scrollHor',
+                scrollable: true,
+                scrollY: 'scrollVer'
+              },
+              { view: 'scrollbar', id: 'scrollHor', group: 'horizontal' }
+            ]
+          },
+          { view: 'scrollbar', id: 'scrollVer' }
+        ]
+      }
+
     //设置任务条样式
     gantt.templates.task_class = function (start, end, item) {
       return item.parent == 0 ? "person_line" : ""
     };
 
     gantt.init(this.$refs.gantt);
+    // this.$props.tasks.data[31].render = "split"
     gantt.parse(this.$props.tasks);
+    console.log("tasks",this.$props.tasks.data);
     // gantt.groupBy({
     //     relation_property: "owner",
     //     groups: [{key:'seya', label: "seya"},{key:'tina', label: "tina"}],

+ 16 - 7
fhKeeper/formulahousekeeper/timesheet/src/views/project/project_gantt.vue

@@ -37,7 +37,10 @@
       </el-select>
       </div>
     </div>
-    <gantt v-if="isDataLoaded" ref="ganttTable" class="left-container" :tasks="tasks" :stafforpro="radio1" :key="updatakey"></gantt>
+    <gantt v-if="isDataLoaded" ref="ganttTable" class="left-container" :tasks="tasks" 
+    :stafforpro="radio1" 
+    :valueDate="valueDate"
+    :key="updatakey"></gantt>
   </div>
 </template>
  
@@ -63,9 +66,10 @@ export default {
       valuex:'全部',
 
       // 请求参数
-      reqpar1:"人员/项目",
-      reqpar2:"时间段",
-      reqpar3:"人员范围/项目范围"
+      reqpar1:0,
+      reqpar2:["2022-03-01","2022-03-10"],
+      reqpar3:"人员范围/项目范围",
+
     }
   },
 
@@ -76,7 +80,11 @@ export default {
       },
       // 人员/项目切换
       selChange(){
-        this.reqpar1 = this.radio1
+        if (this.radio1 == "人员") {
+          this.reqpar1 = 0
+        }else{
+          this.reqpar1 = 1
+        }
         // this.getList()
         this.updatakey += 1
       },
@@ -94,7 +102,8 @@ export default {
       },
 
       getList() {
-        this.http.post('/project/getGanttData',{},
+        this.http.post('/project/getGanttData', 
+        { type : 0 , startDate : this.reqpar2[0] , endDate : this.reqpar2[1] },
                         res => {
                             if (res.code == "ok") {
                                 this.tasks = {data:res.data};
@@ -136,7 +145,7 @@ export default {
   .left-container {
     overflow: hidden;
     position: relative;
-    height: 100%;
+    height: 90%;
   }
   .gantt_head{
     width: 100%;

+ 1 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue

@@ -709,7 +709,7 @@
       :visible.sync="monthWorkTimeDialog"
       :close-on-click-modal="false"
       customClass="customWidth selectworktime"
-      width="90%"
+      width="63%"
       title=""
     >
       <!-- <el-input style="width:100%" v-model="filterName" placeholder="请输入姓名搜索" @change="findUserInTree"></el-input> -->