Browse Source

Merge branch 'master' of https://git.xxb.lttc.cn/yangshuangling/pmp_ui

moxiao 3 năm trước cách đây
mục cha
commit
2f34a14ce2

+ 2 - 2
src/components/GlobalHeader/index.vue

@@ -10,9 +10,9 @@
         <a-menu-item key="personal" style="top:0px;margin-top: 5px; line-height: 55px; padding-left: 10px; padding-right: 10px" >
             个人工作台
         </a-menu-item>
-        <a-menu-item key="project" style="top:0px;margin-top: 5px;line-height: 55px; padding-left: 10px; padding-right: 10px">
+        <!-- <a-menu-item key="project" style="top:0px;margin-top: 5px;line-height: 55px; padding-left: 10px; padding-right: 10px">
             项目管理
-        </a-menu-item>
+        </a-menu-item> -->
     </a-menu>
  </div>
 </template>

+ 17 - 1
src/components/LTTC/TaskList/MoveTaskList.vue

@@ -37,7 +37,7 @@
           <template slot="title">
             <span>添加到“我的一天”</span>
           </template>
-          <a-icon @click.stop="changeImportant(record)" type="plus" />
+          <a-icon @click.stop="addOneDayForMe(record)" type="plus" />
         </a-tooltip>
       </template>
     </a-table>
@@ -123,11 +123,27 @@ export default {
     }
   },
   methods:{
+
+    //添加到我的一天
+    addOneDayForMe(task){
+      //axios 添加到我的一天
+      console.log(task)
+    },
+
     //关闭右键菜单
     bodyClick() {
       this.menuVisible = false;
       document.body.removeEventListener("mousedown", this.bodyClick);
     },
+
+    //修改完成状态
+    changeFinish(task){  
+      let status = !task.finish
+      //axios 修改完成状态
+
+      //刷新数据
+      this.$emit('refreshData');
+    },
   },
 }
 </script>

+ 175 - 6
src/views/task/personal/Important.vue

@@ -1,26 +1,195 @@
 <template>
-    <div>
-       重要任务
-    </div>
+  <page-header-wrapper class="uodate">
+    <template v-slot:content>
+      <div class="page-header-content">
+        <div>
+          <!--添加任务表格-->
+          <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="importantTask" @getData="getImportantData" @refreshData="getImportantData" @openConfig="openConfig" />
+        </div>       
+      </div>
+    </template>
+
+    <template v-slot:extraContent v-if="taskconfig">
+      <div class="extra-content" style="text-align:left;width:340px;margin-left:-80px;">
+        <!-- 任务详情侧边栏 -->
+        <task-details ref="taskDetails" :taskInfo="taskInfo"></task-details>
+      </div>
+    </template>
+  </page-header-wrapper>
 </template>
 
 <script>
+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',
+    scopedSlots: { customRender: 'mark' },
+    width: '5px'
+  },
+  {
+    title: 'task',
+    dataIndex: 'task',
+    scopedSlots: { customRender: 'task' },
+    width: '90%'
+  },
+  {
+    title: 'operation',
+    dataIndex: 'operation',
+    scopedSlots: { customRender: 'operation' }
+  }
+]
 
 export default {
-  name: '',
+  name: 'OneDayForMe',
   components: {
+    TaskList,
+    MoveTaskList,
+    TaskDetails
   },
-  data () {
+  data() {
     return {
+      // 当前时间
+      nowDate: "",
+      uuid: 20,
+      tasktitle: '',
+      importantTask: [],
+      columns,
+      task_icon: '',
+
+      //任务-设置相关
+      taskconfig: false,
+
+      //添加任务相关
+      uuid: 5, //新任务id
+      tasktitle: '', //任务title
+
+      taskInfo: {}
     }
   },
-  mounted () {
+  created() {
+    this.getImportantData();
   },
   methods: {
+
+    //添加任务
+    addtask() {
+      let data = {
+        finish: false,
+        important: true,
+        key: (this.uuid = this.uuid + 1),
+        title: this.tasktitle,
+        type: '任务',
+      }
+
+      //axios 添加任务:到任务列表第一个
+
+      this.importantTask.unshift(data)
+
+      this.tasktitle = ''
+    },
+
+    getImportantData() {
+      //axios 获取今天正在进行的任务
+      this.importantTask = [
+        {
+          endDate: '',
+          starLevel: true,
+          finish: false,
+          important: true,
+          key: '1',
+          title: '吃早饭',
+          type: '任务'
+        },
+        {
+          endDate: '',
+          starLevel: true,
+          finish: false,
+          important: true,
+          key: '2',
+          title: '上班',
+          type: '任务'
+        },
+        {
+          endDate: '',
+          starLevel: false,
+          finish: false,
+          important: true,
+          key: '3',
+          title: '下班',
+          type: '任务'
+        },
+        {
+          endDate: '',
+          starLevel: true,
+          finish: false,
+          important: true,
+          key: '4',
+          title: '吃午饭',
+          type: '任务'
+        },
+        {
+          endDate: '',
+          starLevel: true,
+          finish: false,
+          important: true,
+          key: '5',
+          title: '去游乐园',
+          type: '任务'
+        },
+        {
+          endDate: '',
+          starLevel: false,
+          finish: false,
+          important: true,
+          key: '6',
+          title: '去抓娃娃',
+          type: '任务'
+        }
+      ]
+    },
+
+    //修改完成状态
+    changeFinish(task) {
+      task.finish = !task.finish
+    },
+
+    //修改重要性
+    changeImportant(task) {
+      task.important = !task.important
+    },
+
+    //任务配置相关
+    openConfig(param) {
+      this.taskconfig = true
+      // this.$refs.taskDetails.init(param)
+      console.log(param)
+      this.taskInfo = param
+    },
+    closeConfig() {
+      this.taskconfig = false
+    }
   }
 }
 </script>
 
 <style scoped>
+.advise_drawer >>> .ant-drawer-content-wrapper .ant-drawer-content {
+  background-color: #faf9f8;
+}
 
+.init_input >>> .ant-input {
+  border: none;
+  box-shadow: none;
+  border-bottom: 1px solid;
+}
+
+.panel-style >>> .ant-collapse-content .ant-collapse-content-box {
+  padding: 0px;
+}
 </style>

+ 6 - 60
src/views/task/personal/OneDayForMe.vue

@@ -23,7 +23,7 @@
         <!-- </div> -->
 
         <!--已完成表格-->
-        <a-collapse v-model="activeKey" :bordered="false">
+        <a-collapse v-model="activeKey" :bordered="false" class="init_collapse">
           <a-collapse-panel key="finished" :disabled="finished_disabled" class="panel-style">
             <template slot="header">
               <h3>
@@ -57,28 +57,6 @@
       </a-layout-sider>
     </a-layout>
 
-    <!--右键菜单-->
-    <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>
-
   </page-header-wrapper>
 </template>
 
@@ -158,35 +136,6 @@ export default {
       columns,
       task_icon: '',
 
-      //右击菜单相关
-      menuData: {},
-      menuVisible: false,
-      menuStyle: {
-        position: "absolute",
-        top: "0",
-        left: "0",
-        border: "1px solid #eee",
-        width: "200px"
-      },
-      customClick: record => ({
-        on: {
-          //点击
-          click: e => {
-            this.selectItem = record; // 存储点击行数据
-
-          },
-          // 右击
-          contextmenu: e => {
-            e.preventDefault();
-            this.menuData = record;
-            this.menuVisible = true;
-            this.menuStyle.top = e.clientY - 90 + "px";
-            this.menuStyle.left = e.clientX - 280 + "px";
-            document.body.addEventListener("mousedown", this.bodyClick);
-          }
-        }
-      }),
-
       //建议-抽屉相关
       taskdrawer: false,
 
@@ -241,7 +190,7 @@ export default {
   },
   methods: {
     currentTime() {
-      setInterval(this.formatDate, 500);
+      setInterval(this.formatDate, 0);
     },
     formatDate() {
       let date = new Date();
@@ -349,12 +298,6 @@ export default {
       task.important = !task.important
     },
 
-    //关闭右键菜单
-    bodyClick() {
-      this.menuVisible = false;
-      document.body.removeEventListener("mousedown", this.bodyClick);
-    },
-
     //建议-抽屉相关
     showDrawer() {
       this.taskdrawer = true
@@ -392,7 +335,10 @@ export default {
   border-bottom: 1px solid;
 }
 
-.panel-style >>> .ant-collapse-content .ant-collapse-content-box {
+.panel-style {
+  background-color: white;
+ } >>> .ant-collapse-content .ant-collapse-content-box {
   padding: 0px;
+ 
 }
 </style>