kuaifan 5 年 前
コミット
956317e39a

+ 6 - 1
resources/assets/js/main/components/project/archived.vue

@@ -19,6 +19,10 @@
 <script>
     import DrawerTabsContainer from "../DrawerTabsContainer";
     import Task from "../../mixins/task";
+
+    /**
+     * 项目已归档任务
+     */
     export default {
         name: 'ProjectArchived',
         components: {DrawerTabsContainer},
@@ -132,9 +136,10 @@
                 this.getLists(true);
             }
             $A.setOnTaskInfoListener('components/project/archived', (act, detail) => {
-                if (this.projectid > 0 && detail.projectid != this.projectid) {
+                if (detail.projectid != this.projectid) {
                     return;
                 }
+                //
                 this.lists.some((task, i) => {
                     if (task.id == detail.id) {
                         this.lists.splice(i, 1, detail);

+ 13 - 0
resources/assets/js/main/components/project/header/archived.vue

@@ -20,6 +20,9 @@
     import DrawerTabsContainer from "../../DrawerTabsContainer";
     import Task from "../../../mixins/task";
 
+    /**
+     * 我归档的任务
+     */
     export default {
         name: 'HeaderArchived',
         components: {DrawerTabsContainer},
@@ -130,6 +133,16 @@
                 this.getLists(true);
             }
             $A.setOnTaskInfoListener('components/project/header/archived', (act, detail) => {
+                if (detail.username != $A.getUserName()) {
+                    this.lists.some((task, i) => {
+                        if (task.id == detail.id) {
+                            this.lists.splice(i, 1);
+                            return true;
+                        }
+                    });
+                    return;
+                }
+                //
                 this.lists.some((task, i) => {
                     if (task.id == detail.id) {
                         this.lists.splice(i, 1, detail);

+ 7 - 0
resources/assets/js/main/components/project/header/create.vue

@@ -20,6 +20,9 @@
     import DrawerTabsContainer from "../../DrawerTabsContainer";
     import Task from "../../../mixins/task";
 
+    /**
+     * 我创建的任务
+     */
     export default {
         name: 'HeaderCreate',
         components: {DrawerTabsContainer},
@@ -86,6 +89,10 @@
                 this.getLists(true);
             }
             $A.setOnTaskInfoListener('components/project/header/create',(act, detail) => {
+                if (detail.createuser != $A.getUserName()) {
+                    return;
+                }
+                //
                 this.lists.some((task, i) => {
                     if (task.id == detail.id) {
                         this.lists.splice(i, 1, detail);

+ 6 - 1
resources/assets/js/main/components/project/statistics.vue

@@ -124,6 +124,10 @@
 <script>
     import DrawerTabsContainer from "../DrawerTabsContainer";
     import Task from "../../mixins/task";
+
+    /**
+     * 项目统计
+     */
     export default {
         name: 'ProjectStatistics',
         components: {DrawerTabsContainer},
@@ -196,9 +200,10 @@
                 this.getLists(true);
             }
             $A.setOnTaskInfoListener('components/project/statistics', (act, detail) => {
-                if (this.projectid > 0 && detail.projectid != this.projectid) {
+                if (detail.projectid != this.projectid) {
                     return;
                 }
+                //
                 this.lists.some((task, i) => {
                     if (task.id == detail.id) {
                         this.lists.splice(i, 1, detail);

+ 6 - 2
resources/assets/js/main/components/project/task/lists.vue

@@ -67,6 +67,9 @@
     import DrawerTabsContainer from "../../DrawerTabsContainer";
     import Task from "../../../mixins/task";
 
+    /**
+     * 项目任务列表
+     */
     export default {
         name: 'ProjectTaskLists',
         components: {DrawerTabsContainer},
@@ -218,10 +221,11 @@
                 this.loadYet = true;
                 this.getLists(true);
             }
-            $A.setOnTaskInfoListener('components/project/task/lists',(act, detail) => {
-                if (this.projectid > 0 && detail.projectid != this.projectid) {
+            $A.setOnTaskInfoListener('components/project/task/lists', (act, detail) => {
+                if (detail.projectid != this.projectid) {
                     return;
                 }
+                //
                 this.lists.some((task, i) => {
                     if (task.id == detail.id) {
                         this.lists.splice(i, 1, detail);

+ 14 - 1
resources/assets/js/main/components/project/todo/attention.vue

@@ -20,6 +20,9 @@
     import DrawerTabsContainer from "../../DrawerTabsContainer";
     import Task from "../../../mixins/task";
 
+    /**
+     * 我关注的任务
+     */
     export default {
         name: 'TodoAttention',
         components: {DrawerTabsContainer},
@@ -89,7 +92,17 @@
                 this.loadYet = true;
                 this.getLists(true);
             }
-            $A.setOnTaskInfoListener('components/project/todo/attention',(act, detail) => {
+            $A.setOnTaskInfoListener('components/project/todo/attention', (act, detail) => {
+                if (detail.follower.indexOf($A.getUserName()) === -1) {
+                    this.lists.some((task, i) => {
+                        if (task.id == detail.id) {
+                            this.lists.splice(i, 1);
+                            return true;
+                        }
+                    });
+                    return;
+                }
+                //
                 this.lists.some((task, i) => {
                     if (task.id == detail.id) {
                         this.lists.splice(i, 1, detail);

+ 14 - 0
resources/assets/js/main/components/project/todo/calendar.vue

@@ -13,6 +13,10 @@
 <script>
     import DrawerTabsContainer from "../../DrawerTabsContainer";
     import FullCalendar from "../../FullCalendar/FullCalendar";
+
+    /**
+     * 待办日程
+     */
     export default {
         name: 'TodoCalendar',
         components: {FullCalendar, DrawerTabsContainer},
@@ -34,6 +38,16 @@
         },
         mounted() {
             $A.setOnTaskInfoListener('components/project/todo/calendar',(act, detail) => {
+                if (detail.username != $A.getUserName()) {
+                    this.lists.some((task, i) => {
+                        if (task.id == detail.id) {
+                            this.lists.splice(i, 1);
+                            return true;
+                        }
+                    });
+                    return;
+                }
+                //
                 detail = this.formatTaskData(detail);
                 this.lists.some((task, i) => {
                     if (task.id == detail.id) {

+ 13 - 0
resources/assets/js/main/components/project/todo/complete.vue

@@ -20,6 +20,9 @@
     import DrawerTabsContainer from "../../DrawerTabsContainer";
     import Task from "../../../mixins/task";
 
+    /**
+     * 已完成的任务
+     */
     export default {
         name: 'TodoComplete',
         components: {DrawerTabsContainer},
@@ -76,6 +79,16 @@
                 this.getLists(true);
             }
             $A.setOnTaskInfoListener('components/project/todo/complete',(act, detail) => {
+                if (detail.username != $A.getUserName()) {
+                    this.lists.some((task, i) => {
+                        if (task.id == detail.id) {
+                            this.lists.splice(i, 1);
+                            return true;
+                        }
+                    });
+                    return;
+                }
+                //
                 this.lists.some((task, i) => {
                     if (task.id == detail.id) {
                         this.lists.splice(i, 1, detail);

+ 6 - 1
resources/assets/js/main/pages/project.vue

@@ -344,7 +344,12 @@
                 switch (act) {
                     case 'deleteproject':   // 删除项目
                     case 'deletelabel':     // 删除分类
-                        this.getLists(true);
+                        this.lists.some((item) => {
+                            if (item.id == detail.projectid) {
+                                this.getLists(true);
+                                return true;
+                            }
+                        });
                         break;
                     case "complete":        // 标记完成
                         this.lists.some((item) => {

+ 5 - 1
resources/assets/js/main/pages/project/panel.vue

@@ -348,6 +348,10 @@
         },
         mounted() {
             $A.setOnTaskInfoListener('pages/project-panel',(act, detail) => {
+                if (detail.projectid != this.projectid) {
+                    return;
+                }
+                //
                 switch (act) {
                     case 'deleteproject':   // 删除项目
                     case 'deletelabel':     // 删除分类
@@ -603,7 +607,7 @@
                                 setTimeout(() => {
                                     if (res.ret === 1) {
                                         this.$Message.success(res.msg);
-                                        $A.triggerTaskInfoListener('deletelabel', {labelid: item.id});
+                                        $A.triggerTaskInfoListener('deletelabel', {labelid: item.id, projectid: item.projectid});
                                     } else {
                                         this.$Modal.error({title: this.$L('温馨提示'), content: res.msg });
                                     }

+ 13 - 0
resources/assets/js/main/pages/todo.vue

@@ -346,6 +346,19 @@
             }, false);
             //
             $A.setOnTaskInfoListener('pages/todo',(act, detail) => {
+                if (detail.username != $A.getUserName()) {
+                    for (let level in this.taskDatas) {
+                        this.taskDatas[level].lists.some((task, i) => {
+                            if (task.id == detail.id) {
+                                this.taskDatas[level].lists.splice(i, 1);
+                                this.taskSortData = this.getTaskSort();
+                                return true;
+                            }
+                        });
+                    }
+                    return;
+                }
+                //
                 switch (act) {
                     case 'deleteproject':   // 删除项目
                     case 'deletelabel':     // 删除分类