Pārlūkot izejas kodu

优化工作台筛选项时间

qinzhipeng_v@didiglobal.com 4 gadi atpakaļ
vecāks
revīzija
fa7a833a33

+ 1 - 1
src/views/workbench/components/listView.vue

@@ -217,7 +217,7 @@ export default {
     }
   },
   mounted() {
-    this.team_timeSelectVal = [dayjs().add(-1, 'month').format('YYYY.MM.DD'), dayjs().format('YYYY.MM.DD')]
+    this.team_timeSelectVal = [dayjs().format('YYYY.MM.DD'), dayjs().add(1, 'month').format('YYYY.MM.DD')]
   },
   methods: {
     radio_aelect() { // init 分页

+ 6 - 0
src/views/workbench/ganttOptions/teamGantt.js

@@ -1,5 +1,11 @@
 const options = {
   locale: {
+    Now: 'Now',
+    'X-Scale': 'Zoom-X',
+    'Y-Scale': 'Zoom-Y',
+    'Task list width': 'Task1 list',
+    'Before/After': 'Expand',
+    'Display task list': 'Task list',
     name: 'zh_cn',
     weekdays: ['周日', '周一', '周二', '周三', '周四', '周五', '周六'],
     months: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月']

+ 29 - 2
src/views/workbench/team/components/ganntViews.vue

@@ -22,12 +22,12 @@
     <div v-loading="loading">
       <div v-if="ganttShow">
         <gantt-elastic :tasks="tasks" :options="options">
-          <gantt-elastic-header v-show="false" slot="header" ref="ganttHeader" />
+          <gantt-elastic-header slot="header" ref="ganttHeader" />
         </gantt-elastic>
       </div>
       <div v-if="personal">
         <gantt-elastic v-if="personal" :tasks="tasks_personal" :options="options_personal">
-          <gantt-elastic-header v-show="false" slot="header" ref="ganttHeader" />
+          <gantt-elastic-header slot="header" ref="ganttHeader" />
         </gantt-elastic>
       </div>
     </div>
@@ -189,6 +189,7 @@ export default {
         }
       }
       this.personal = true
+      this.setOption()
     },
     createTasks(data) { // 按日程
       const today = new Date()
@@ -267,7 +268,20 @@ export default {
           }
         }
         this.ganttShow = true
+        this.setOption()
       }
+    },
+    setOption() {
+      this.$nextTick(() => {
+        const node = document.querySelectorAll('.gantt-elastic__header-label')
+        node[0].style = 'display: none'
+        node[1].style = 'display: none'
+        node[2].style = 'display: none'
+        node[3].removeChild(node[3].childNodes[0])
+        const span = document.createElement('span')
+        span.innerText = '列表区域 :'
+        node[3].insertBefore(span, node[3].childNodes[0])
+      })
     }
   }
 }
@@ -277,6 +291,19 @@ export default {
 .gantt-view-header{
   margin: 0 40px 20px 40px;
 }
+>>>.gantt-elastic__header {
+    display: block !important;
+    background: #FFF !important;
+  }
+>>>.gantt-elastic__header-title {
+    display: none;
+  }
+  >>>.gantt-elastic__header-btn-recenter {
+    display: none;
+ }
+ >>>.gantt-elastic__header-task-list-switch--wrapper {
+    display: none;
+ }
 .table-top {
   margin: 0 30px 20px;
   width: 95%;