kuaifan 5 年 前
コミット
1f3df38987

+ 0 - 4
INSTALL-EN.md

@@ -50,7 +50,6 @@ DB_ROOT_PASSWORD=123456
 ......
 LARAVELS_LISTEN_IP=0.0.0.0
 LARAVELS_LISTEN_PORT=5200
-LARAVELS_PROXY_URL=
 ```
 
 #### 3. Build image & install
@@ -132,12 +131,9 @@ DB_PORT=3306
 DB_DATABASE=wookteam
 DB_USERNAME=root
 DB_PASSWORD=123456
-
 ......
-
 LARAVELS_LISTEN_IP=127.0.0.1
 LARAVELS_LISTEN_PORT=5200
-LARAVELS_PROXY_URL=ws://wookteam.com/ws
 ```
 
 #### 3. Setup application

+ 0 - 4
INSTALL.md

@@ -50,7 +50,6 @@ DB_ROOT_PASSWORD=123456
 ......
 LARAVELS_LISTEN_IP=0.0.0.0
 LARAVELS_LISTEN_PORT=5200
-LARAVELS_PROXY_URL=
 ```
 
 #### 3、构建项目
@@ -132,12 +131,9 @@ DB_PORT=3306
 DB_DATABASE=wookteam
 DB_USERNAME=root
 DB_PASSWORD=123456
-
 ......
-
 LARAVELS_LISTEN_IP=127.0.0.1
 LARAVELS_LISTEN_PORT=5200
-LARAVELS_PROXY_URL=ws://wookteam.com/ws
 ```
 
 #### 3、设置项目

+ 3 - 0
app/Http/Controllers/Api/SystemController.php

@@ -34,6 +34,9 @@ class SystemController extends Controller
     {
         $type = trim(Request::input('type'));
         if ($type == 'save') {
+            if (env("SYSTEM_SETTING") == 'disabled') {
+                return Base::retError('当前环境禁止修改!');
+            }
             $user = Users::authE();
             if (Base::isError($user)) {
                 return $user;

+ 4 - 1
resources/assets/js/main/components/UserView.vue

@@ -1,6 +1,6 @@
 <template>
     <div class="user-view-inline">
-        <Tooltip :disabled="nickname === null" :delay="delay" :transfer="transfer" :placement="placement" @on-popper-show="popperShow">
+        <Tooltip :disabled="loadIng" :delay="delay" :transfer="transfer" :placement="placement" @on-popper-show="popperShow">
             {{nickname || username}}
             <div slot="content">
                 <div>{{$L('用户名')}}: {{username}}</div>
@@ -37,6 +37,8 @@
         },
         data() {
             return {
+                loadIng: true,
+
                 nickname: null,
                 profession: ''
             }
@@ -63,6 +65,7 @@
                         this.nickname = '';
                         this.profession = '';
                     }
+                    this.loadIng = false;
                     this.$emit("on-result", data);
                 }, cacheTime);
             }

+ 13 - 3
resources/assets/js/main/components/chat/Index.vue

@@ -4,7 +4,7 @@
         <!--左边选项-->
         <ul class="chat-menu">
             <li class="self">
-                <img :src="userInfo.userimg">
+                <img :src="userInfo.userimg" onerror="this.src=window.location.origin+'/images/other/avatar.png'">
             </li>
             <li :class="{active:chatTap=='dialog'}" @click="chatTap='dialog'">
                 <Icon type="md-text" />
@@ -26,7 +26,7 @@
                         :key="index"
                         :class="{active:dialog.username==dialogTarget.username}"
                         @click="openDialog(dialog)">
-                        <img :src="dialog.userimg">
+                        <img :src="dialog.userimg" onerror="this.src=window.location.origin+'/images/other/avatar.png'">
                         <div class="user-msg-box">
                             <div class="user-msg-title">
                                 <span><user-view :username="dialog.username" placement="right" @on-result="userViewResult(dialog, $event)"/></span>
@@ -53,7 +53,7 @@
                         <div class="team-label">{{key}}</div>
                         <ul>
                             <li v-for="(item, index) in teamListsS(lists)" :key="index" @click="openDialog(item, true)">
-                                <img :src="item.userimg">
+                                <img :src="item.userimg" onerror="this.src=window.location.origin+'/images/other/avatar.png'">
                                 <div class="team-username"><user-view :username="item.username" placement="right" @on-result="userViewResult(item, $event)"/></div>
                             </li>
                         </ul>
@@ -1180,6 +1180,16 @@
             },
 
             messageSubmit() {
+                let dialogUser = this.dialogLists.filter((item) => { return item.username == this.dialogTarget.username });
+                if (dialogUser.length > 0) {
+                    let user = dialogUser[0];
+                    if (typeof user.unread === "number" && user.unread > 0) {
+                        this.unreadTotal -= user.unread;
+                        this.$set(user, 'unread', 0);
+                        $A.WSOB.sendTo('read', user.username);
+                    }
+                }
+                //
                 let text = this.messageText.trim();
                 if ($A.count(text) > 0) {
                     let data = {

+ 18 - 9
resources/assets/js/main/components/chat/message.vue

@@ -16,15 +16,15 @@
                         <div class="item-text-view" v-html="textMsg(info.text)"></div>
                     </div>
                     <template v-if="info.type==='taskB'">
-                        <div v-if="info.other.type==='task'" class="item-link" @click="taskDetail(info.other.id)">{{$L('来自关注任务')}}:<a href="javascript:void(0)">{{info.other.title}}</a></div>
-                        <div v-if="info.other.type==='file'" class="item-link">{{$L('来自关注任务')}}:<a target="_blank" :href="fileDownUrl(info.other.id)">{{info.other.name}}</a></div>
+                        <div v-if="info.other.type==='task'" class="item-link" @click="taskDetail(info.other.id)"><span>{{$L('来自关注任务')}}:</span><a href="javascript:void(0)">{{info.other.title}}</a></div>
+                        <div v-if="info.other.type==='file'" class="item-link"><span>{{$L('来自关注任务')}}:</span><a target="_blank" :href="fileDownUrl(info.other.id)">{{info.other.name}}</a></div>
                     </template>
-                    <div v-else-if="info.type==='report'" class="item-link" @click="reportDetail(info.other.id, info.other.title)">{{$L('来自工作报告')}}:<a href="javascript:void(0)">{{info.other.title}}</a></div>
+                    <div v-else-if="info.type==='report'" class="item-link" @click="reportDetail(info.other.id, info.other.title)"><span>{{$L('来自工作报告')}}:</span><a href="javascript:void(0)">{{info.other.title}}</a></div>
                 </div>
-                <img class="item-userimg" @click="clickUser" :src="info.userimg"/>
+                <img class="item-userimg" @click="clickUser" :src="info.userimg" onerror="this.src=window.location.origin+'/images/other/avatar.png'"/>
             </div>
             <div v-else-if="info.self===false" class="list-item">
-                <img class="item-userimg" @click="clickUser" :src="info.userimg"/>
+                <img class="item-userimg" @click="clickUser" :src="info.userimg" onerror="this.src=window.location.origin+'/images/other/avatar.png'"/>
                 <div class="item-left">
                     <div class="item-username" @click="clickUser">
                         <em class="item-name"><user-view :username="info.username" placement="right"/></em>
@@ -35,10 +35,10 @@
                         <div class="item-text-view" v-html="textMsg(info.text)"></div>
                     </div>
                     <template v-if="info.type==='taskB'">
-                        <div v-if="info.other.type==='task'" class="item-link" @click="taskDetail(info.other.id)">{{$L('来自关注任务')}}:<a href="javascript:void(0)">{{info.other.title}}</a></div>
-                        <div v-if="info.other.type==='file'" class="item-link">{{$L('来自关注任务')}}:<a target="_blank" :href="fileDownUrl(info.other.id)">{{info.other.name}}</a></div>
+                        <div v-if="info.other.type==='task'" class="item-link" @click="taskDetail(info.other.id)"><span>{{$L('来自关注任务')}}:</span><a href="javascript:void(0)">{{info.other.title}}</a></div>
+                        <div v-if="info.other.type==='file'" class="item-link"><span>{{$L('来自关注任务')}}:</span><a target="_blank" :href="fileDownUrl(info.other.id)">{{info.other.name}}</a></div>
                     </template>
-                    <div v-else-if="info.type==='report'" class="item-link" @click="reportDetail(info.other.id, info.other.title)">{{$L('来自工作报告')}}:<a href="javascript:void(0)">{{info.other.title}}</a></div>
+                    <div v-else-if="info.type==='report'" class="item-link" @click="reportDetail(info.other.id, info.other.title)"><span>{{$L('来自工作报告')}}:</span><a href="javascript:void(0)">{{info.other.title}}</a></div>
                 </div>
             </div>
         </div>
@@ -181,7 +181,9 @@
 
     /*信息底标*/
     .item-link {
-        display: block;
+        display: flex;
+        align-items: center;
+        max-width: 100%;
         font-size: 12px;
         color: #ffffff;
         background-color: #cacaca;
@@ -193,9 +195,16 @@
         border-radius: 4px;
         transform: scale(0.96);
         transform-origin: left center;
+        > span {
+            white-space: nowrap;
+        }
         > a {
             color: #3D90E2;
             padding-left: 3px;
+            overflow: hidden;
+            text-overflow: ellipsis;
+            white-space: nowrap;
+            max-width: 100%;
         }
     }
 

+ 7 - 1
resources/assets/js/main/main.js

@@ -208,7 +208,12 @@ import '../../sass/main.scss';
                 username: username,
                 callback: callback
             });
-            $A.__userBasicEvent();
+            //
+            $A.__userBasicTimeout++;
+            let timeout = $A.__userBasicTimeout;
+            setTimeout(() => {
+                timeout === $A.__userBasicTimeout && $A.__userBasicEvent();
+            }, 100);
         },
         __userBasicEvent() {
             if ($A.__userBasicLoading === true) {
@@ -282,6 +287,7 @@ import '../../sass/main.scss';
                 }
             });
         },
+        __userBasicTimeout: 0,
         __userBasicLoading: false,
         __userBasicObject: [],
 

+ 5 - 4
resources/assets/js/main/pages/todo.vue

@@ -514,7 +514,7 @@
                 }
             },
 
-            getTaskLists(index, isNext) {
+            getTaskLists(index, isNext, withNextNum = 0) {
                 let taskData = this.taskDatas[index];
                 let currentPage = 1;
                 let pagesize = 20;
@@ -525,12 +525,13 @@
                         return;
                     }
                     currentPage = Math.max(1, $A.runNum(taskData['currentPage']));
-                    let tempLists = this.taskDatas[index].lists.filter((item) => { return item.complete == 0; });
+                    let tempLists = this.taskDatas[index].lists;
                     if (tempLists.length >= currentPage * pagesize) {
                         currentPage++;
                     } else {
                         withNextPage = true;
                     }
+                    withNextNum = $A.runNum(withNextNum);
                 }
                 this.$set(taskData, 'hasMorePages', false);
                 this.$set(taskData, 'loadIng', $A.runNum(taskData.loadIng) + 1);
@@ -567,8 +568,8 @@
                             this.taskSortData = this.getTaskSort();
                             this.$set(taskData, 'currentPage', res.data.currentPage);
                             this.$set(taskData, 'hasMorePages', res.data.hasMorePages);
-                            if (res.data.currentPage && withNextPage) {
-                                this.getTaskLists(index, true);
+                            if (res.data.currentPage && withNextPage && withNextNum < 5) {
+                                this.getTaskLists(index, true, withNextNum + 1);
                             }
                         } else {
                             this.$set(taskData, 'lists', []);

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

@@ -117,4 +117,5 @@ return [
     "一次最多只能添加%个账号!" => "Only % accounts can be added at a time!",
     "项目流程最多不能超过%个!" => "The maximum number of project flows should not exceed %!",
     "列表最多不能超过%个!" => "No more than % lists!",
+    "当前环境禁止修改!" => "No changes to the current environment!",
 ];

+ 10 - 0
resources/notify/chrome/js/notify.js

@@ -115,6 +115,16 @@ chrome.runtime.onMessage.addListener(function (request, sender, sendResponse) {
         }
     } else if (request.act === "getInstances") {
         sendResponse(instances);
+    } else if (request.act === "clickInstances") {
+        if (typeof instances[request.index] === "object") {
+            instances[request.index].ws.sendTo('unread', function (res) {
+                if (res.status === 1) {
+                    instances[request.index].unread = $A.runNum(res.message);
+                    updateBadgeNum();
+                }
+                sendResponse(res);
+            })
+        }
     } else if (request.act === "delInstances") {
         configLists = $A.jsonParse($A.getStorage("configLists"), {});
         if (typeof configLists[request.index] === "object") {

+ 10 - 1
resources/notify/chrome/js/popup.js

@@ -10,6 +10,13 @@ chrome.runtime.sendMessage({
     showLists(response);
 });
 
+function onClick(index) {
+    chrome.runtime.sendMessage({
+        act: 'clickInstances',
+        index: index,
+    });
+}
+
 function onDelete(index) {
     chrome.runtime.sendMessage({
         act: 'delInstances',
@@ -55,11 +62,13 @@ function showLists(lists) {
                     chrome.windows.update(item.windowId, {focused: true});
                     chrome.tabs.highlight({tabs: item.index, windowId: item.windowId});
                     chrome.tabs.update({url: $A.urlAddParams($A.removeURLParameter(item.url, ['open', 'rand']), {open: 'chat', rand: Math.round(new Date().getTime())})});
+                    onClick(index);
                     return has = true;
                 }
             });
             if (!has) {
-                chrome.tabs.create({ url: 'http://' + index + '/#/todo?token=' + token + '&open=chat' })
+                chrome.tabs.create({ url: 'http://' + index + '/#/todo?token=' + token + '&open=chat' });
+                onClick(index);
             }
         });
     })

+ 1 - 1
resources/notify/chrome/manifest.json

@@ -1,6 +1,6 @@
 {
     "manifest_version": 2,
-    "version": "1.0",
+    "version": "1.1",
     "name": "TEAM提醒",
     "description": "TEAM消息提醒",
     "icons": {