kuaifan 5 jaren geleden
bovenliggende
commit
3e2a582e5e

+ 25 - 4
app/Http/Controllers/Api/ProjectController.php

@@ -124,6 +124,30 @@ class ProjectController extends Controller
     }
 
     /**
+     * 获取项目负责人
+     *
+     * @apiParam {Number} projectid     项目ID
+     */
+    public function leader()
+    {
+        $user = Users::authE();
+        if (Base::isError($user)) {
+            return $user;
+        } else {
+            $user = $user['data'];
+        }
+        //
+        $projectid = trim(Request::input('projectid'));
+        $projectDetail = Base::DBC2A(DB::table('project_lists')->select(['username'])->where('id', $projectid)->where('delete', 0)->first());
+        if (empty($projectDetail)) {
+            return Base::retError('项目不存在或已被删除!');
+        }
+        return Base::retSuccess('success', [
+            'username' => $projectDetail['username'],
+        ]);
+    }
+
+    /**
      * 添加项目
      *
      * @apiParam {String} title         项目名称
@@ -697,7 +721,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), 100));
+            ->orderByDesc('project_users.isowner')->orderByDesc('project_users.id')->paginate(Min(Max(Base::nullShow(Request::input('pagesize'), 10), 1), 100));
         $lists = Base::getPageList($lists);
         if ($lists['total'] == 0) {
             return Base::retError('未找到任何相关的成员');
@@ -734,9 +758,6 @@ class ProjectController extends Controller
         if (empty($projectDetail)) {
             return Base::retError('项目不存在或已被删除!');
         }
-        if ($projectDetail['username'] != $user['username']) {
-            return Base::retError('你是不是项目负责人!');
-        }
         $usernames = Request::input('username');
         if (empty($usernames)) {
             return Base::retError('参数错误!');

+ 6 - 2
resources/assets/js/main/components/UseridInput.vue

@@ -28,7 +28,7 @@
                        :columns="columns"
                        :data="userLists"
                        @on-current-change="userChange"
-                       :no-data-text="nodatatext"></Table>
+                       :no-data-text="noDataText"></Table>
             </div>
         </transition>
     </div>
@@ -188,7 +188,7 @@
                     },
                 ],
                 userLists: [],
-                nodatatext: "数据加载中.....",
+                noDataText: "数据加载中.....",
             }
         },
         watch: {
@@ -221,6 +221,7 @@
                         if (this.projectid) {
                             where['projectid'] = this.projectid;
                         }
+                        this.noDataText = "数据加载中.....";
                         $A.aAjax({
                             url: window.location.origin + '/api/users/searchinfo',
                             data: {
@@ -232,6 +233,7 @@
                             },
                             complete: () => {
                                 this.spinShow = false;
+                                this.noDataText = "没有相关的数据";
                             },
                             success: (res) => {
                                 if (res.ret === 1 && res.data.total > 0) {
@@ -352,6 +354,7 @@
                 if (this.projectid) {
                     where['projectid'] = this.projectid;
                 }
+                this.noDataText = "数据加载中.....";
                 $A.aAjax({
                     url: window.location.origin + '/api/users/searchinfo',
                     data: {
@@ -363,6 +366,7 @@
                     },
                     complete: () => {
                         this.spinShow = false;
+                        this.noDataText = "没有相关的数据";
                     },
                     success: (res) => {
                         if (res.ret === 1) {

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

@@ -206,6 +206,7 @@
                     return;
                 }
                 this.loadIng++;
+                this.noDataText = "数据加载中.....";
                 $A.aAjax({
                     url: 'project/task/lists',
                     data: {

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

@@ -190,6 +190,7 @@
                     this.listPage = 1;
                 }
                 this.loadIng++;
+                this.noDataText = "数据加载中.....";
                 $A.aAjax({
                     url: 'project/task/lists',
                     data: {

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

@@ -133,6 +133,7 @@
                     this.listPage = 1;
                 }
                 this.loadIng++;
+                this.noDataText = "数据加载中.....";
                 $A.aAjax({
                     url: 'project/task/lists',
                     data: {
@@ -148,6 +149,7 @@
                         if (res.ret === 1) {
                             this.lists = res.data.lists;
                             this.listTotal = res.data.total;
+                            this.noDataText = "没有相关的数据";
                         } else {
                             this.lists = [];
                             this.listTotal = 0;

+ 2 - 0
resources/assets/js/main/components/project/my/favor.vue

@@ -132,6 +132,7 @@
                     this.listPage = 1;
                 }
                 this.loadIng++;
+                this.noDataText = "数据加载中.....";
                 $A.aAjax({
                     url: 'project/lists',
                     data: {
@@ -146,6 +147,7 @@
                         if (res.ret === 1) {
                             this.lists = res.data.lists;
                             this.listTotal = res.data.total;
+                            this.noDataText = "没有相关的数据";
                         } else {
                             this.lists = [];
                             this.listTotal = 0;

+ 2 - 0
resources/assets/js/main/components/project/my/join.vue

@@ -125,6 +125,7 @@
                     this.listPage = 1;
                 }
                 this.loadIng++;
+                this.noDataText = "数据加载中.....";
                 $A.aAjax({
                     url: 'project/lists',
                     data: {
@@ -139,6 +140,7 @@
                         if (res.ret === 1) {
                             this.lists = res.data.lists;
                             this.listTotal = res.data.total;
+                            this.noDataText = "没有相关的数据";
                         } else {
                             this.lists = [];
                             this.listTotal = 0;

+ 2 - 0
resources/assets/js/main/components/project/my/manage.vue

@@ -125,6 +125,7 @@
                     this.listPage = 1;
                 }
                 this.loadIng++;
+                this.noDataText = "数据加载中.....";
                 $A.aAjax({
                     url: 'project/lists',
                     data: {
@@ -139,6 +140,7 @@
                         if (res.ret === 1) {
                             this.lists = res.data.lists;
                             this.listTotal = res.data.total;
+                            this.noDataText = "没有相关的数据";
                         } else {
                             this.lists = [];
                             this.listTotal = 0;

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

@@ -296,6 +296,7 @@
                 }
                 this.loadIng++;
                 let tempType = this.taskType;
+                this.noDataText = "数据加载中.....";
                 $A.aAjax({
                     url: 'project/task/lists',
                     data: {

+ 1 - 0
resources/assets/js/main/components/project/task/files.vue

@@ -344,6 +344,7 @@
                 whereData.projectid = this.projectid;
                 whereData.taskid = this.taskid;
                 whereData.sorts = this.sorts;
+                this.noDataText = "数据加载中.....";
                 $A.aAjax({
                     url: 'project/files/lists',
                     data: whereData,

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

@@ -311,6 +311,7 @@
                 whereData.pagesize = Math.max($A.runNum(this.listPageSize), 10);
                 whereData.projectid = this.projectid;
                 whereData.sorts = $A.cloneData(this.sorts);
+                this.noDataText = "数据加载中.....";
                 $A.aAjax({
                     url: 'project/task/lists',
                     data: whereData,
@@ -321,6 +322,7 @@
                         if (res.ret === 1) {
                             this.lists = res.data.lists;
                             this.listTotal = res.data.total;
+                            this.noDataText = "没有相关的数据";
                         } else {
                             this.lists = [];
                             this.listTotal = 0;

+ 2 - 0
resources/assets/js/main/components/project/todo/attention.vue

@@ -135,6 +135,7 @@
                     this.listPage = 1;
                 }
                 this.loadIng++;
+                this.noDataText = "数据加载中.....";
                 $A.aAjax({
                     url: 'project/task/lists',
                     data: {
@@ -150,6 +151,7 @@
                         if (res.ret === 1) {
                             this.lists = res.data.lists;
                             this.listTotal = res.data.total;
+                            this.noDataText = "没有相关的数据";
                         } else {
                             this.lists = [];
                             this.listTotal = 0;

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

@@ -137,6 +137,7 @@
                     this.listPage = 1;
                 }
                 this.loadIng++;
+                this.noDataText = "数据加载中.....";
                 $A.aAjax({
                     url: 'project/task/lists',
                     data: {
@@ -151,6 +152,7 @@
                         if (res.ret === 1) {
                             this.lists = res.data.lists;
                             this.listTotal = res.data.total;
+                            this.noDataText = "没有相关的数据";
                         } else {
                             this.lists = [];
                             this.listTotal = 0;

+ 2 - 0
resources/assets/js/main/components/project/users.vue

@@ -191,6 +191,7 @@
                     return;
                 }
                 this.loadIng++;
+                this.noDataText = "数据加载中.....";
                 $A.aAjax({
                     url: 'project/users/lists',
                     data: {
@@ -205,6 +206,7 @@
                         if (res.ret === 1) {
                             this.lists = res.data.lists;
                             this.listTotal = res.data.total;
+                            this.noDataText = "没有相关的数据";
                         } else {
                             this.lists = [];
                             this.listTotal = 0;

+ 2 - 0
resources/assets/js/main/pages/team.vue

@@ -260,6 +260,7 @@
                     this.listPage = 1;
                 }
                 this.loadIng++;
+                this.noDataText = "数据加载中.....";
                 $A.aAjax({
                     url: 'users/team/lists',
                     data: {
@@ -273,6 +274,7 @@
                         if (res.ret === 1) {
                             this.lists = res.data.lists;
                             this.listTotal = res.data.total;
+                            this.noDataText = "没有相关的数据";
                         }else{
                             this.lists = [];
                             this.listTotal = 0;