Browse Source

no message

kuaifan 5 years ago
parent
commit
0f513e268d

+ 6 - 0
app/Http/Controllers/Api/ProjectController.php

@@ -190,6 +190,9 @@ class ProjectController extends Controller
                 'inorder' => 0,
             ];
         }
+        if (count($insertLabels) > 100) {
+            return Base::retError(['项目流程最多不能超过%个!', 100]);
+        }
         //开始创建
         $projectid = DB::table('project_lists')->insertGetId([
             'title' => $title,
@@ -849,6 +852,9 @@ class ProjectController extends Controller
         if ($count > 0) {
             return Base::retError('列表名称已存在!');
         }
+        if (DB::table('project_label')->where('projectid', $projectid)->count() + 1 >= 100) {
+            return Base::retError(['列表最多不能超过%个!', 100]);
+        }
         //
         $id = DB::table('project_label')->insertGetId([
             'projectid' => $projectid,

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

@@ -352,7 +352,7 @@ class UsersController extends Controller
     /**
      * 添加团队成员
      *
-     * @apiParam {String} username              用户名
+     * @apiParam {String} username              用户名(多个用英文逗号分隔)
      * @apiParam {String} userpass              密码
      * @apiParam {Object} [userimg]             会员头像
      * @apiParam {String} [nickname]            昵称
@@ -395,7 +395,11 @@ class UsersController extends Controller
         }
         //开始注册
         $username = trim(Request::input('username'));
-        foreach (explode(",", $username) AS $item) {
+        $array = explode(",", $username);
+        if (count($array) > 500) {
+            return Base::retError(['一次最多只能添加%个账号!', 500]);
+        }
+        foreach ($array AS $item) {
             if ($item) {
                 $user = Users::reg(trim($item), trim(Request::input('userpass')), [
                     'userimg' => $userimg ?: '',

+ 16 - 1
resources/assets/js/main/components/chat/Index.vue

@@ -20,7 +20,7 @@
             <li class="sreach">
                 <Input :placeholder="$L('搜索')" prefix="ios-search" v-model="dialogSearch"/>
             </li>
-            <li class="lists">
+            <li ref="dialogLists" class="lists">
                 <ul>
                     <li v-for="(dialog, index) in dialogListsS"
                         :key="index"
@@ -1010,6 +1010,21 @@
                     this.$set(user, 'unread', 0);
                     $A.WSOB.sendTo('read', user.username);
                 }
+                if (autoAddDialog === true) {
+                    //自动滚到焦点
+                    this.$nextTick(() => {
+                        let dialogObj = $A(this.$refs.dialogLists);
+                        let activeObj = dialogObj.find("li.active");
+                        if (activeObj.length > 0) {
+                            let offsetTop = activeObj.offset().top;
+                            if (offsetTop < 0) {
+                                dialogObj.stop().scrollTop(activeObj[0].offsetTop)
+                            } else if (offsetTop > dialogObj.height()) {
+                                dialogObj.stop().scrollTop(activeObj[0].offsetTop + activeObj.height() - dialogObj.height())
+                            }
+                        }
+                    });
+                }
             },
 
             clickDialog(username) {

+ 2 - 2
resources/assets/js/main/main.js

@@ -195,7 +195,7 @@ import '../../sass/main.scss';
                 return;
             }
             //
-            let keyName = '__userName:' + username.substring(0, 1) + '__';
+            let keyName = '__userBasic:' + username.substring(0, 1) + '__';
             let localData = $A.jsonParse(window.localStorage[keyName]);
             if ($A.getObject(localData, username + '.success') === true) {
                 callback(localData[username].data, true);
@@ -249,7 +249,7 @@ import '../../sass/main.scss';
                 success: (res) => {
                     if (res.ret === 1) {
                         res.data.forEach((data) => {
-                            let keyName = '__userName:' + data.username.substring(0, 1) + '__';
+                            let keyName = '__userBasic:' + data.username.substring(0, 1) + '__';
                             let localData = $A.jsonParse(window.localStorage[keyName]);
                             localData[data.username] = {
                                 success: true,

+ 10 - 1
resources/assets/js/main/pages/docs.vue

@@ -30,7 +30,7 @@
                         </ul>
                     </div>
                     <div class="docs-container">
-                        <div v-if="selectBookData.id > 0">
+                        <div v-if="selectBookData.id > 0" class="docs-box">
                             <div class="docs-header">
                                 <div class="docs-h1">{{selectBookData.title}}</div>
                                 <div class="docs-setting">
@@ -152,6 +152,12 @@
                     flex: 1;
                     background-color: #ffffff;
                     border-radius: 0 3px 3px 0;
+                    .docs-box {
+                        width: 100%;
+                        height: 100%;
+                        display: flex;
+                        flex-direction: column;
+                    }
                     .docs-header {
                         display: flex;
                         align-items: center;
@@ -175,7 +181,10 @@
                         }
                     }
                     .docs-section {
+                        flex: 1;
                         margin: 0 26px;
+                        overflow: auto;
+                        transform: translateZ(0);
                         .none {
                             background-color: transparent;
                             text-align: center;

+ 1 - 1
resources/assets/js/main/pages/todo.vue

@@ -525,7 +525,7 @@
                         return;
                     }
                     currentPage = Math.max(1, $A.runNum(taskData['currentPage']));
-                    let tempLists = this.taskDatas[detail.level].lists.filter((item) => { return item.complete == 0; });
+                    let tempLists = this.taskDatas[index].lists.filter((item) => { return item.complete == 0; });
                     if (tempLists.length >= currentPage * pagesize) {
                         currentPage++;
                     } else {

+ 3 - 0
resources/lang/en/general.php

@@ -114,4 +114,7 @@ return [
     "成员不存在!" => "Member does not exist!",
     "操作成功!" => "Operation successful!",
     "一次最多只能获取%条数据!" => "A maximum of % data can be retrieved at one time!",
+    "一次最多只能添加%个账号!" => "Only % accounts can be added at a time!",
+    "项目流程最多不能超过%个!" => "The maximum number of project flows should not exceed %!",
+    "列表最多不能超过%个!" => "No more than % lists!",
 ];