kuaifan 5 yıl önce
ebeveyn
işleme
5a6655282d

+ 3 - 3
app/Http/Controllers/Api/ProjectController.php

@@ -45,7 +45,7 @@ class ProjectController extends Controller
                 ['project_users.type', '成员'],
                 ['project_users.username', $user['username']]
             ])
-            ->orderByDesc('project_lists.id')->paginate(Min(Max(Base::nullShow(Request::input('pagesize'), 10), 1), 200));
+            ->orderByDesc('project_lists.id')->paginate(Min(Max(Base::nullShow(Request::input('pagesize'), 10), 1), 100));
         $lists = Base::getPageList($lists);
         if ($lists['total'] == 0) {
             return Base::retError('未找到任何相关的项目');
@@ -398,7 +398,7 @@ class ProjectController extends Controller
                 ['project_lists.delete', 0],
                 ['project_users.type', '成员'],
             ])
-            ->orderByDesc('project_lists.id')->paginate(Min(Max(Base::nullShow(Request::input('pagesize'), 10), 1), 200));
+            ->orderByDesc('project_lists.id')->paginate(Min(Max(Base::nullShow(Request::input('pagesize'), 10), 1), 100));
         $lists = Base::getPageList($lists);
         if ($lists['total'] == 0) {
             return Base::retError('未找到任何相关的成员');
@@ -438,7 +438,7 @@ class ProjectController extends Controller
             ->join('project_task', 'project_lists.id', '=', 'project_task.projectid')
             ->select(['project_task.*'])
             ->where($whereArray)
-            ->orderByDesc($orderBy)->paginate(Min(Max(Base::nullShow(Request::input('pagesize'), 10), 1), 200));
+            ->orderByDesc($orderBy)->paginate(Min(Max(Base::nullShow(Request::input('pagesize'), 10), 1), 100));
         $lists = Base::getPageList($lists);
         if ($lists['total'] == 0) {
             return Base::retError('未找到任何相关的任务');

+ 2 - 2
app/Http/Controllers/Api/UsersController.php

@@ -97,7 +97,7 @@ class UsersController extends Controller
             };
         }
         //
-        $lists = DB::table('users')->select(['id', 'username', 'nickname', 'userimg', 'profession'])->where($whereArr)->where($whereFunc)->orderBy('id')->paginate(Min(Max(Base::nullShow(Request::input('pagesize'), 10), 1), 200));
+        $lists = DB::table('users')->select(['id', 'username', 'nickname', 'userimg', 'profession'])->where($whereArr)->where($whereFunc)->orderBy('id')->paginate(Min(Max(Base::nullShow(Request::input('pagesize'), 10), 1), 100));
         $lists = Base::getPageList($lists);
         if ($lists['total'] == 0) {
             return Base::retError('未搜索到任何相关的会员');
@@ -207,7 +207,7 @@ class UsersController extends Controller
             $user = $user['data'];
         }
         //
-        $lists = DB::table('users')->select(['id', 'username', 'nickname', 'userimg', 'profession', 'regdate'])->orderByDesc('id')->paginate(Min(Max(Base::nullShow(Request::input('pagesize'), 10), 1), 200));
+        $lists = DB::table('users')->select(['id', 'username', 'nickname', 'userimg', 'profession', 'regdate'])->orderByDesc('id')->paginate(Min(Max(Base::nullShow(Request::input('pagesize'), 10), 1), 100));
         $lists = Base::getPageList($lists);
         if ($lists['total'] == 0) {
             return Base::retError('未找到任何相关的团队成员');

+ 24 - 5
resources/assets/js/main/components/project/complete.vue

@@ -21,9 +21,15 @@
             projectid: {
                 default: 0
             },
+            canload: {
+                type: Boolean,
+                default: true
+            },
         },
         data () {
             return {
+                loadYet: false,
+
                 loadIng: 0,
 
                 columns: [],
@@ -74,14 +80,24 @@
             }];
         },
         mounted() {
-            this.listPage = 1;
-            this.getLists();
+            if (this.canload) {
+                this.loadYet = true;
+                this.getLists(true);
+            }
         },
 
         watch: {
             projectid() {
-                this.listPage = 1;
-                this.getLists();
+                if (this.loadYet) {
+                    this.loadYet = true;
+                    this.getLists(true);
+                }
+            },
+            canload(val) {
+                if (val && !this.loadYet) {
+                    this.loadYet = true;
+                    this.getLists(true);
+                }
             }
         },
 
@@ -98,7 +114,10 @@
                 }
             },
 
-            getLists() {
+            getLists(resetLoad) {
+                if (resetLoad === true) {
+                    this.listPage = 1;
+                }
                 if (this.projectid == 0) {
                     this.lists = [];
                     this.listTotal = 0;

+ 24 - 5
resources/assets/js/main/components/project/users.vue

@@ -21,9 +21,15 @@
             projectid: {
                 default: 0
             },
+            canload: {
+                type: Boolean,
+                default: true
+            },
         },
         data () {
             return {
+                loadYet: false,
+
                 loadIng: 0,
 
                 columns: [],
@@ -105,14 +111,24 @@
             }];
         },
         mounted() {
-            this.listPage = 1;
-            this.getLists();
+            if (this.canload) {
+                this.loadYet = true;
+                this.getLists(true);
+            }
         },
 
         watch: {
             projectid() {
-                this.listPage = 1;
-                this.getLists();
+                if (this.loadYet) {
+                    this.loadYet = true;
+                    this.getLists(true);
+                }
+            },
+            canload(val) {
+                if (val && !this.loadYet) {
+                    this.loadYet = true;
+                    this.getLists(true);
+                }
             }
         },
 
@@ -129,7 +145,10 @@
                 }
             },
 
-            getLists() {
+            getLists(resetLoad) {
+                if (resetLoad === true) {
+                    this.listPage = 1;
+                }
                 if (this.projectid == 0) {
                     this.lists = [];
                     this.listTotal = 0;

+ 8 - 7
resources/assets/js/main/pages/project.vue

@@ -104,10 +104,10 @@
         <Drawer v-model="projectDrawerShow" width="75%">
             <Tabs v-model="projectDrawerTab">
                 <TabPane :label="$L('已完成任务')" name="complete">
-                    <project-complete :projectid="handleProjectId"></project-complete>
+                    <project-complete :canload="projectDrawerShow && projectDrawerTab == 'complete'" :projectid="handleProjectId"></project-complete>
                 </TabPane>
                 <TabPane :label="$L('成员管理')" name="member">
-                    <project-users :projectid="handleProjectId"></project-users>
+                    <project-users :canload="projectDrawerShow && projectDrawerTab == 'member'" :projectid="handleProjectId"></project-users>
                 </TabPane>
                 <TabPane :label="$L('项目统计')" name="statistics"></TabPane>
                 <TabPane :label="$L('收藏的项目')" name="myfavor"></TabPane>
@@ -295,8 +295,7 @@
             };
         },
         mounted() {
-            this.listPage = 1;
-            this.getLists();
+            this.getLists(true);
         },
         computed: {
 
@@ -317,7 +316,10 @@
                 }
             },
 
-            getLists() {
+            getLists(resetLoad) {
+                if (resetLoad === true) {
+                    this.listPage = 1;
+                }
                 this.loadIng++;
                 $A.aAjax({
                     url: 'project/lists',
@@ -396,8 +398,7 @@
                                     this.$refs.add.resetFields();
                                     this.$set(this.formAdd, 'template', 0);
                                     //
-                                    this.listPage = 1;
-                                    this.getLists();
+                                    this.getLists(true);
                                 }else{
                                     this.$Modal.error({title: this.$L('温馨提示'), content: res.msg });
                                 }

+ 6 - 5
resources/assets/js/main/pages/team.vue

@@ -234,8 +234,7 @@
             };
         },
         mounted() {
-            this.listPage = 1;
-            this.getLists();
+            this.getLists(true);
         },
         computed: {
 
@@ -256,7 +255,10 @@
                 }
             },
 
-            getLists() {
+            getLists(resetLoad) {
+                if (resetLoad === true) {
+                    this.listPage = 1;
+                }
                 this.loadIng++;
                 $A.aAjax({
                     url: 'users/team/lists',
@@ -296,8 +298,7 @@
                                     this.$Message.success(res.msg);
                                     this.$refs.add.resetFields();
                                     //
-                                    this.listPage = 1;
-                                    this.getLists();
+                                    this.getLists(true);
                                 }else{
                                     this.$Modal.error({title: this.$L('温馨提示'), content: res.msg });
                                 }