Bläddra i källkod

🎉优化:任务详情合并成一个组件

moxiao 3 år sedan
förälder
incheckning
cbd2f0dbd5
3 ändrade filer med 490 tillägg och 129 borttagningar
  1. 6 3
      .eslintrc.js
  2. 349 0
      src/views/task/components/TaskDetails.vue
  3. 135 126
      src/views/task/personal/OneDayForMe.vue

+ 6 - 3
.eslintrc.js

@@ -12,7 +12,7 @@ module.exports = {
     'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
     'generator-star-spacing': 'off',
     'no-mixed-operators': 0,
-    'space-before-function-paren':0,
+    'space-before-function-paren': 0,
     'vue/max-attributes-per-line': [
       2,
       {
@@ -23,6 +23,7 @@ module.exports = {
         }
       }
     ],
+    'vue/max-attributes-per-line': 0,
     'vue/attribute-hyphenation': 0,
     'vue/html-self-closing': 0,
     'vue/component-name-in-template-casing': 0,
@@ -34,8 +35,9 @@ module.exports = {
     'vue/html-closing-bracket-newline': 0,
     'vue/no-parsing-error': 0,
     'no-tabs': 0,
+    'spaced-comment': 0,
     'quotes': [
-      2,
+      0,
       'single',
       {
         'avoidEscape': true,
@@ -43,12 +45,13 @@ module.exports = {
       }
     ],
     'semi': [
-      2,
+      0,
       'never',
       {
         'beforeStatementContinuationChars': 'never'
       }
     ],
+    'comma-dangle': 0,
     'no-delete-var': 2,
     'prefer-const': [
       2,

+ 349 - 0
src/views/task/components/TaskDetails.vue

@@ -0,0 +1,349 @@
+<template>
+  <div style="background-color:rgb(240,242,245);padding:10px;">
+    <a-space direction="vertical">
+      <!-- 任务步骤 -->
+      <a-card type="inner">
+        <a-row :gutter="16">
+          <div v-if="taskInfo.endDate != ''" style="margin-top:5px;">
+            <a-col :span="2">
+              <a-tooltip>
+                <template slot="title">
+                  标记为未完成
+                </template>
+                <a-button shape="circle" type="primary" icon="check" size="small" @click="completeTask" />
+              </a-tooltip>
+            </a-col>
+            <a-col :span="20">
+              <a-checkable-tag>
+                <del> <span style="font-size:15px">{{ taskInfo.title }}</span></del>
+              </a-checkable-tag>
+            </a-col>
+            <a-col :span="2">
+              <div v-if="taskInfo.starLevel == false">
+                <a-tooltip>
+                  <template slot="title">
+                    将任务标记为重要
+                  </template>
+                  <a-popconfirm :visible="false" @visibleChange="signImportance">
+                    <a-icon type="star" />
+                  </a-popconfirm>
+                </a-tooltip>
+              </div>
+              <div v-else>
+                <a-tooltip>
+                  <template slot="title">
+                    删除重要性
+                  </template>
+                  <a-popconfirm :visible="false" @visibleChange="signImportance">
+                    <a-icon style="color:#4169E1" type="star" theme="filled" />
+                  </a-popconfirm>
+                </a-tooltip>
+              </div>
+            </a-col>
+          </div>
+          <div v-else>
+            <a-col :span="2" style="margin-top:5px;">
+              <a-tooltip>
+                <template slot="title">
+                  标记为已完成
+                </template>
+                <a-button shape="circle" size="small" @click="completeTask" />
+              </a-tooltip>
+            </a-col>
+            <a-col :span="20">
+              <a-input v-model="taskInfo.title" @pressEnter="updateTask" />
+            </a-col>
+            <a-col :span="2" style="margin-top:5px;">
+              <div v-if="taskInfo.starLevel == false">
+                <a-tooltip>
+                  <template slot="title">
+                    将任务标记为重要
+                  </template>
+                  <a-popconfirm :visible="false" @visibleChange="signImportance">
+                    <a-icon type="star" />
+                  </a-popconfirm>
+                </a-tooltip>
+              </div>
+              <div v-else>
+                <a-tooltip>
+                  <template slot="title">
+                    删除重要性
+                  </template>
+                  <a-popconfirm :visible="false" @visibleChange="signImportance">
+                    <a-icon style="color:#4169E1" type="star" theme="filled" />
+                  </a-popconfirm>
+                </a-tooltip>
+              </div>
+            </a-col>
+          </div>
+        </a-row>
+        <a-row style="margin-top:15px">
+          <a-col>
+            <a-list v-show="isShowStepList" item-layout="horizontal" size="small" :data-source="taskStepData">
+              <a-list-item slot="renderItem" slot-scope="item, index" :key="index">
+                <div v-if="item.isStepComplete == true">
+                  <a-list-item-meta>
+                    <a slot="title"><del>{{ item.title }}</del></a>
+                    <div slot="avatar">
+                      <a-tooltip>
+                        <template slot="title">
+                          标记为未完成
+                        </template>
+                        <a-button shape="circle" type="primary" icon="check" size="small" @click="completeStep(index)" />
+                      </a-tooltip>
+                    </div>
+                  </a-list-item-meta>
+                </div>
+                <div v-else>
+                  <a-list-item-meta>
+                    <a slot="title">{{ item.title }}</a>
+                    <div slot="avatar">
+                      <a-tooltip>
+                        <template slot="title">
+                          标记为已完成
+                        </template>
+                        <a-button shape="circle" size="small" @click="completeStep(index)" />
+                      </a-tooltip>
+                    </div>
+                  </a-list-item-meta>
+                </div>
+                <a-tooltip>
+                  <template slot="title">
+                    删除步骤
+                  </template>
+                  <a-popconfirm title="是否确认删除步骤?" ok-text="是" cancel-text="否" @confirm="deleteStep">
+                    <a-icon type="close" />
+                  </a-popconfirm>
+                </a-tooltip>
+              </a-list-item>
+            </a-list>
+          </a-col>
+        </a-row>
+        <a-row>
+          <a-col>
+            <a-input v-model="stepContent" :placeholder="isShowStepList?' 下一步 ':' 添加步骤 '" @pressEnter="addStep">
+              <a-icon slot="prefix" type="plus" />
+            </a-input>
+          </a-col>
+        </a-row>
+      </a-card>
+      <!-- 添加到“我的一天” -->
+      <a-card type="inner">
+        <div v-if="isAddedMyDay==false">
+          <a-row>
+            <a-col :span="2">
+              <a-icon type="fire" style="fontSize:18px;margin-top:2px;margin-left:5px;" />
+            </a-col>
+            <a-col :span="22">
+              <a-checkable-tag style="fontSize:14px;margin-left:10px;" @change="addMyDay"> 添加到“我的一天” </a-checkable-tag>
+            </a-col>
+          </a-row>
+        </div>
+        <div v-else>
+          <a-row>
+            <a-col :span="2">
+              <a-icon type="fire" style="color:#4169E1;fontSize:18px;margin-top:2px;margin-left:5px;" />
+            </a-col>
+            <a-col :span="20">
+              <a-checkable-tag style="color:#4169E1;fontSize:14px;margin-left:10px;"> 已添加到“我的一天” </a-checkable-tag>
+            </a-col>
+            <a-col :span="2">
+              <a-tooltip>
+                <template slot="title">
+                  从“我的一天”中删除
+                </template>
+                <a-popconfirm :visible="false" @visibleChange="deleteMyDay">
+                  <a-icon type="close" />
+                </a-popconfirm>
+              </a-tooltip>
+            </a-col>
+          </a-row>
+        </div>
+      </a-card>
+      <!-- 任务详情 -->
+      <a-card type="inner">
+        <a-list item-layout="horizontal">
+          <a-list-item>
+            <a-row>
+              <a-col :span="2">
+                <a-icon type="bell" style="fontSize:18px;margin-top:2px;margin-left:5px;" />
+              </a-col>
+              <a-col :span="14" :offset="8">
+                <a-checkable-tag style="fontSize:14px" @change="remindMe"> 提醒我 </a-checkable-tag>
+              </a-col>
+            </a-row>
+          </a-list-item>
+          <a-list-item>
+            <a-row>
+              <a-col :span="2">
+                <a-icon type="calendar" style="fontSize:18px;margin-top:7px;margin-left:5px;" />
+              </a-col>
+              <a-col :span="21" :offset="1">
+                <a-range-picker :defaultValue="[moment(), moment()]" :ranges="{ '今天': [moment(), moment()], '本周': [moment(), moment().endOf('week')], '本月': [moment(), moment().endOf('month')] }" @change="updateDateRange" />
+              </a-col>
+            </a-row>
+          </a-list-item>
+          <a-list-item>
+            <a-list-item-meta>
+              <div slot="title">
+                <a-row>
+                  <a-col :span="2">
+                    <a-icon type="clock-circle" style="fontSize:18px;margin-top:7px;margin-left:5px;" />
+                  </a-col>
+                  <a-col :span="21" :offset="1">
+                    <a-input-number style="width: 100%" v-model="manhours" placeholder="工时(单位:小时)" :min="0" :step="0.1" @pressEnter="updateManhours" />
+                  </a-col>
+                </a-row>
+              </div>
+            </a-list-item-meta>
+          </a-list-item>
+          <a-list-item>
+            <a-row>
+              <a-col :span="2">
+                <a-icon type="sync" style="fontSize:18px;margin-top:2px;margin-left:5px;" />
+              </a-col>
+              <a-col :span="13" :offset="9">
+                <a-checkable-tag style="fontSize:14px" @change="repeatTask"> 重复 </a-checkable-tag>
+              </a-col>
+            </a-row>
+          </a-list-item>
+          <a-list-item>
+            <a-row>
+              <a-col :span="2">
+                <a-icon type="profile" style="fontSize:18px;margin-top:2px;margin-left:5px;" />
+              </a-col>
+              <a-col :span="16" :offset="6">
+                <a-checkable-tag style="fontSize:14px" @change="$refs.taskReport.init()"> 任务汇报 </a-checkable-tag>
+              </a-col>
+            </a-row>
+          </a-list-item>
+        </a-list>
+      </a-card>
+      <!-- 添加文件 -->
+      <a-card type="inner">
+        <a-row>
+          <a-col :span="2">
+            <a-icon type="paper-clip" style="fontSize:18px;margin-top:2px;margin-left:5px;" />
+          </a-col>
+          <a-col :span="22">
+            <a-upload name="file" :multiple="true" action="" @change="uploadFile">
+              <a-checkable-tag style="fontSize:14px;;margin-left:10px;"> 添加文件 </a-checkable-tag>
+            </a-upload>
+          </a-col>
+        </a-row>
+      </a-card>
+      <!-- 备注 -->
+      <a-card type="inner">
+        <a-textarea style="margin-left:5px;" :auto-size="{ minRows: 3, maxRows: 5 }" />
+      </a-card>
+    </a-space>
+
+    <!-- 任务汇报 -->
+    <task-report ref="taskReport" @ok="handleOk"></task-report>
+  </div>
+</template>
+
+<script>
+import moment from 'moment'
+import TaskReport from './TaskReport'
+
+export default {
+  components: {
+    TaskReport
+  },
+  props: {
+    taskInfo: {
+      type: Object,
+      required: true
+    }
+  },
+  data() {
+    return {
+      taskStepData: [], // 任务步骤数据
+      stepContent: '',
+      isAddedMyDay: false,
+      manhours: 0
+    }
+  },
+  computed: {
+    // 是否显示任务步骤列表
+    isShowStepList: function() {
+      return this.taskStepData.length > 0
+    }
+  },
+  created() {
+    console.log("任务步骤")
+    this.getTaskStep(this.taskInfo)
+  },
+  methods: {
+    getTaskStep(param) {
+      // todo:获取任务步骤数据
+      this.taskStepData = [
+        // {
+        //   title: '坐起来',
+        //   isStepComplete: true
+        // },
+        {
+          title: '穿衣服',
+          isStepComplete: true
+        },
+        {
+          title: '刷牙洗脸',
+          isStepComplete: false
+        }]
+    },
+    completeTask() {
+      if (this.taskInfo.endDate) {
+        this.taskInfo.endDate = ''
+      } else {
+        this.taskInfo.endDate = Date.now()
+      }
+    },
+    updateTask(e) {
+      this.$message.success('修改任务')
+    },
+    signImportance() {
+      this.taskInfo.starLevel = !this.taskInfo.starLevel
+    },
+    addStep() {
+      this.taskStepData.push({
+        'title': this.stepContent
+      })
+      this.stepContent = ''
+    },
+    completeStep(index) {
+      this.taskStepData[index].isStepComplete = !this.taskStepData[index].isStepComplete
+    },
+    deleteStep(e) {
+      this.$message.success('删除步骤')
+    },
+    addMyDay() {
+      this.isAddedMyDay = true
+    },
+    deleteMyDay() {
+      this.isAddedMyDay = false
+    },
+    moment,
+    remindMe() {
+      this.$message.success('点击提醒我')
+    },
+    updateDateRange(date, dateString) {
+      this.$message.success('更新日期范围:' + dateString)
+    },
+    updateManhours(e) {
+      this.$message.success('更新工时:' + this.manhours)
+      console.log(e)
+    },
+    repeatTask() {
+      this.$message.success('任务重复')
+    },
+    handleOk() {
+      this.$message.success('任务汇报')
+    },
+
+    uploadFile() {
+
+    }
+  }
+}
+</script>

+ 135 - 126
src/views/task/personal/OneDayForMe.vue

@@ -1,8 +1,8 @@
 <template>
-  <page-header-wrapper class ="uodate">
+  <page-header-wrapper class="uodate">
     <template v-slot:content>
       <div class="page-header-content">
-          {{nowDate}}
+        {{ nowDate }}
         <div style="display: inline-block;float: right;">
           <a-button type="link" icon="swap">
             排序
@@ -12,159 +12,149 @@
         <div style="margin-top:15px">
 
           <!--添加任务表格-->
-          <a-input
-            class="init_input"
-            style="border: none; box-shadow: none"
-            @pressEnter="addtask"
-            size="large"
-            placeholder="添加任务"
-            v-model="tasktitle"
-          >
+          <a-input class="init_input" style="border: none; box-shadow: none" @pressEnter="addtask" size="large" placeholder="添加任务" v-model="tasktitle">
             <a-icon slot="prefix" type="plus" />
           </a-input>
-          <task-list :taskdata="doingTask" @getData="getDoingData" @refreshData="refreshData" @openConfig="openConfig"/>
+          <task-list :taskdata="doingTask" @getData="getDoingData" @refreshData="refreshData" @openConfig="openConfig" />
         </div>
 
         <!--已完成表格-->
         <a-collapse v-model="activeKey" :bordered="false">
           <a-collapse-panel key="finished" :disabled="finished_disabled" class="panel-style">
-            <template slot="header"
-              ><h3>
+            <template slot="header">
+              <h3>
                 <strong>已完成 {{ finishedTask.length }}</strong>
               </h3>
             </template>
-            <task-list :taskdata="finishedTask" @getData="getFinishedData" @refreshData="refreshData" @openConfig="openConfig"/>
+            <task-list :taskdata="finishedTask" @getData="getFinishedData" @refreshData="refreshData" @openConfig="openConfig" />
           </a-collapse-panel>
-        </a-collapse>      
-      </div>   
+        </a-collapse>
+      </div>
     </template>
 
     <template v-slot:extraContent v-if="showright">
-      <div class="extra-content" style="text-align: left;width:340px;margin-left:-50px">
-        <a-card style="width: 340px" v-show="taskconfig"> 
-          <p>Card content</p>
-          <p>Card content</p>
-          <p>Card content</p>
-        </a-card>
-        <!-- 侧边栏 -->
-    <task-info-sider ref="taskInfoSlider" style="width: 340px" v-show="taskconfig"></task-info-sider>
+      <div class="extra-content" style="text-align:left;width:340px;margin-left:-80px;">
+        <!-- 任务详情侧边栏 -->
+        <task-details ref="taskDetails" v-show="taskconfig" :taskInfo="taskInfo"></task-details>
 
         <!--点击建议打开抽屉-->
-        <a-drawer
-          title="建议"
-          placement="right"
-          :width="400"
-          :visible="taskdrawer"
-          :mask="false"
-          @close="closeDrawer"
-          class="advise_drawer"
-          style="background-color: #faf9f8;"
-        > 
+        <a-drawer title="建议" placement="right" :width="350" :visible="taskdrawer" :mask="false" @close="closeDrawer" class="advise_drawer" style="background-color: #faf9f8;">
           <div v-if="yesterdayTask.length!=0">
             <h4><strong>昨天</strong></h4>
-            <move-task-list :taskdata="yesterdayTask"/>
+            <move-task-list :taskdata="yesterdayTask" />
           </div>
           <div v-if="beforeTask.length!=0">
             <h4><strong>先前</strong></h4>
-            <move-task-list :taskdata="beforeTask"/>
+            <move-task-list :taskdata="beforeTask" />
           </div>
           <div v-if="latelyTask.length!=0">
             <h4><strong>最近添加</strong></h4>
-            <move-task-list :taskdata="latelyTask"/>
+            <move-task-list :taskdata="latelyTask" />
           </div>
         </a-drawer>
       </div>
     </template>
-  
 
     <!--右键菜单-->
     <a-menu :style="menuStyle" v-if="menuVisible">
-      <a-menu-item key='1'><a-icon type="alert" theme="filled"/>从“我的一天” 中删除</a-menu-item>
-      <a-menu-item key='2' @click="changeImportant(menuData)"><a-icon type="star" theme="filled"/>{{menuData.important?'删除重要标记':'标记为重要'}}</a-menu-item>
-      <a-menu-item key='3' @click="changeFinish(menuData)"><a-icon type="check-circle" theme="filled"/>{{menuData.finish?'标记为未完成':'标记为已完成'}}</a-menu-item>
-      <a-menu-item key='4'><a-icon type="calendar" theme="filled"/>今天到期</a-menu-item>
-      <a-menu-item key='5'><a-icon type="calendar" theme="filled"/>明天到期</a-menu-item>
-      <a-menu-item key='6' style="color:red"><a-icon type="delete" theme="filled"/>删除任务</a-menu-item>
+      <a-menu-item key='1'>
+        <a-icon type="alert" theme="filled" />从“我的一天” 中删除
+      </a-menu-item>
+      <a-menu-item key='2' @click="changeImportant(menuData)">
+        <a-icon type="star" theme="filled" />{{menuData.important?'删除重要标记':'标记为重要'}}
+      </a-menu-item>
+      <a-menu-item key='3' @click="changeFinish(menuData)">
+        <a-icon type="check-circle" theme="filled" />{{menuData.finish?'标记为未完成':'标记为已完成'}}
+      </a-menu-item>
+      <a-menu-item key='4'>
+        <a-icon type="calendar" theme="filled" />今天到期
+      </a-menu-item>
+      <a-menu-item key='5'>
+        <a-icon type="calendar" theme="filled" />明天到期
+      </a-menu-item>
+      <a-menu-item key='6' style="color:red">
+        <a-icon type="delete" theme="filled" />删除任务
+      </a-menu-item>
     </a-menu>
 
   </page-header-wrapper>
 </template>
 
 <script>
-const columns=[
+import TaskList from '@/components/LTTC/TaskList/TaskList'
+import MoveTaskList from '@/components/LTTC/TaskList/MoveTaskList'
+import TaskDetails from '@/views/task/components/TaskDetails'
+const columns = [
   {
-    title:'mark',
-    dataIndex: 'mark', 
+    title: 'mark',
+    dataIndex: 'mark',
     scopedSlots: { customRender: 'mark' },
-    width: '5px',
+    width: '5px'
   },
   {
-    title:'task',
+    title: 'task',
     dataIndex: 'task',
     scopedSlots: { customRender: 'task' },
-    width: '90%',
+    width: '90%'
   },
   {
     title: 'operation',
     dataIndex: 'operation',
-    scopedSlots: { customRender: 'operation' },
+    scopedSlots: { customRender: 'operation' }
   }
-];
+]
 
-import TaskList from '@/components/LTTC/TaskList/TaskList'
-import MoveTaskList from '@/components/LTTC/TaskList/MoveTaskList'
-import TaskInfoSider from '../components/TaskInfoSider'
 export default {
   name: 'OneDayForMe',
   components: {
     TaskList,
     MoveTaskList,
-    TaskInfoSider
+    TaskDetails
   },
   data() {
     return {
-      //当前时间
-      nowDate:"",
-      yesterdayTask:[
+      // 当前时间
+      nowDate: "",
+      yesterdayTask: [
         {
-          finish:true,
-          important:true,
-          key:'5',
+          finish: true,
+          important: true,
+          key: '5',
           title: '去公园散步',
-          type:'任务'
+          type: '任务'
         },
         {
-          finish:false,
-          important:false,
-          key:'8',
+          finish: false,
+          important: false,
+          key: '8',
           title: '去看电影',
-          type:'任务'
+          type: '任务'
         }
       ],
-      beforeTask:[
+      beforeTask: [
         {
-          finish:false,
-          important:true,
-          key:'6',
+          finish: false,
+          important: true,
+          key: '6',
           title: '去楼下遛狗',
-          type:'任务'
+          type: '任务'
         }
       ],
-      latelyTask:[
+      latelyTask: [
         {
-          finish:false,
-          important:true,
-          key:'7',
+          finish: false,
+          important: true,
+          key: '7',
           title: '喂狗',
-          type:'任务'
+          type: '任务'
         }
       ],
       uuid: 20,
-      tasktitle:'',
-      doingTask:[],
-      finishedTask:[],
+      tasktitle: '',
+      doingTask: [],
+      finishedTask: [],
       columns,
-      task_icon:'',
+      task_icon: '',
 
       //右击菜单相关
       menuData: {},
@@ -188,8 +178,8 @@ export default {
             e.preventDefault();
             this.menuData = record;
             this.menuVisible = true;
-            this.menuStyle.top = e.clientY-90 + "px";
-            this.menuStyle.left = e.clientX-280 + "px";
+            this.menuStyle.top = e.clientY - 90 + "px";
+            this.menuStyle.left = e.clientX - 280 + "px";
             document.body.addEventListener("mousedown", this.bodyClick);
           }
         }
@@ -207,6 +197,7 @@ export default {
 
       //展开折叠面板的key
       activeKey: ['finished'],
+      taskInfo: {}
     }
   },
   watch: {
@@ -218,16 +209,16 @@ export default {
       }
     },
     activeKey(key) {
-      if(!key.length){
+      if (!key.length) {
         this.closeConfig()
       }
     },
   },
-  computed:{
+  computed: {
     showright: function() {
-      return this.taskdrawer||this.taskconfig
+      return this.taskdrawer || this.taskconfig
     },
-    finished_disabled: function () {
+    finished_disabled: function() {
       if (this.finishedTask.length == 0) {
         this.activeKey = []
         return true
@@ -236,12 +227,12 @@ export default {
       }
     },
   },
-  created (){
+  created() {
     this.currentTime();
     this.getDoingData();
     this.getFinishedData();
   },
-  beforeDestroy(){
+  beforeDestroy() {
     if (this.formatDate) {
       clearInterval(this.formatDate); // 在Vue实例销毁前,清除时间定时器
     }
@@ -256,7 +247,7 @@ export default {
       let month = date.getMonth() + 1; // 月
       let day = date.getDate(); // 日
       let week = date.getDay(); // 星期
-      let weekArr = [ "星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六" ];
+      let weekArr = ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"];
       let hour = date.getHours(); // 时
       hour = hour < 10 ? "0" + hour : hour; // 如果只有一位,则前面补零
       let minute = date.getMinutes(); // 分
@@ -283,66 +274,76 @@ export default {
       this.tasktitle = ''
     },
 
-    getDoingData(){
+    getDoingData() {
       //axios 获取今天正在进行的任务
       this.doingTask = [
         {
-          finish:false,
-          important:true,
-          key:'2',
+          endDate: '',
+          starLevel: true,
+          finish: false,
+          important: true,
+          key: '2',
           title: '吃饭',
-          type:'任务'
+          type: '任务'
         },
         {
-          finish:false,
-          important:true,
-          key:'3',
+          endDate: '',
+          starLevel: true,
+          finish: false,
+          important: true,
+          key: '3',
           title: '上班',
-          type:'任务'
+          type: '任务'
         },
         {
-          finish:false,
-          important:false,
-          key:'4',
+          endDate: '',
+          starLevel: false,
+          finish: false,
+          important: false,
+          key: '4',
           title: '下班',
-          type:'任务'
+          type: '任务'
         }
       ]
     },
 
-    getFinishedData(){
+    getFinishedData() {
       //axios 获取已经完成的任务
       this.finishedTask = [
         {
-          finish:true,
-          important:false,
-          key:'1',
+          endDate: '2021-09-17',
+          starLevel: false,
+          finish: true,
+          important: false,
+          key: '1',
           title: '起床',
-          type:'任务'      
+          type: '任务'
         },
         {
-          finish:true,
-          important:false,
-          key:'10',
+          endDate: '2021-09-17',
+          starLevel: false,
+          finish: true,
+          important: false,
+          key: '10',
           title: '回家',
-          type:'任务'
+          type: '任务'
         }
       ]
     },
 
-    refreshData(){
+    refreshData() {
       console.log("刷新完成和未完成列表")
       this.getDoingData();
       this.getFinishedData();
     },
 
     //修改完成状态
-    changeFinish(task){ 
+    changeFinish(task) {
       task.finish = !task.finish
     },
 
     //修改重要性
-    changeImportant(task){
+    changeImportant(task) {
       task.important = !task.important
     },
 
@@ -354,28 +355,37 @@ export default {
 
     //建议-抽屉相关
     showDrawer() {
-      this.taskdrawer = true;
+      this.taskdrawer = true
+
+      if (this.taskconfig) {
+        this.taskconfig = false
+      }
     },
     closeDrawer() {
-      this.taskdrawer = false;
+      this.taskdrawer = false
     },
 
     //任务配置相关
-    openConfig (param){
-      this.taskconfig = true;
+    openConfig(param) {
+      this.taskconfig = true
+      // this.$refs.taskDetails.init(param)
       console.log(param)
+      this.taskInfo = param
+
+      if (this.taskdrawer) {
+        this.taskdrawer = false
+      }
     },
-    closeConfig (){
-      this.taskconfig = false;  
+    closeConfig() {
+      this.taskconfig = false
     }
   }
 }
 </script>
 
 <style scoped>
-
-.advise_drawer >>> .ant-drawer-content-wrapper .ant-drawer-content{
-   background-color: #faf9f8;
+.advise_drawer >>> .ant-drawer-content-wrapper .ant-drawer-content {
+  background-color: #faf9f8;
 }
 
 .init_input >>> .ant-input {
@@ -385,7 +395,6 @@ export default {
 }
 
 .panel-style >>> .ant-collapse-content .ant-collapse-content-box {
-    padding: 0px;
+  padding: 0px;
 }
-
 </style>