소스 검색

需求选择,组列表收缩

wangziqian 4 년 전
부모
커밋
1c7c78621a
1개의 변경된 파일21개의 추가작업 그리고 1개의 파일을 삭제
  1. 21 1
      src/views/projectManage/projectList/components/modifySchedule.vue

+ 21 - 1
src/views/projectManage/projectList/components/modifySchedule.vue

@@ -83,8 +83,13 @@
                 :key="'task-group'+group.id"
                 :label="group.idString+group.name"
               >
+                <span v-if="group.taskInfoList.length > 0" class="group-expand">
+                  <i v-show="hiddenList.findIndex(item=>item === group.id) > -1" class="el-icon-arrow-down" @click="hiddenGroup(group.id)" />
+                  <i v-show="hiddenList.findIndex(item=>item === group.id) <= -1" class="el-icon-arrow-up" @click="hiddenGroup(group.id)" />
+                </span>
                 <el-option
                   v-for="item in group.taskInfoList"
+                  v-show="hiddenList.findIndex(item=>item === group.id) <= -1"
                   :key="'taskBy-option'+item.id"
                   :label="item.name"
                   :value="item.id"
@@ -234,7 +239,8 @@ export default {
       loading: false, // 正在加载
       peopleObjectList: [], // 参与人
       observer: null, // 滚动的观察类
-      nowQuery: null // 当前的筛选项
+      nowQuery: null, // 当前的筛选项
+      hiddenList: [] // 隐藏的需求列表
     }
   },
   watch: {
@@ -413,6 +419,14 @@ export default {
       }
       this.loading = false
     },
+    hiddenGroup(id) { // 隐藏需求选择组
+      const index = this.hiddenList.findIndex(item => item === id)
+      if (index > -1) {
+        this.hiddenList.splice(index, 1)
+      } else {
+        this.hiddenList.push(id)
+      }
+    },
     innerList(val, list) { // 判断是否在任务列表中
       const res = list.find(item => item.id === val.id)
       return !!res
@@ -536,6 +550,12 @@ article {
   justify-content: center;
   align-items: center;
 }
+.group-expand {
+  cursor: pointer;
+  position: absolute;
+  top: 5px;
+  left: 5px;
+}
 .task-option {  // 布局
   display: flex;
   align-items: center;