kuaifan 5 年 前
コミット
61ade82609

+ 4 - 0
resources/assets/js/main/app.js

@@ -30,6 +30,10 @@ Vue.prototype.taskDetail = TaskDetail;
 import ReportDetail from './components/report/detail'
 Vue.prototype.reportDetail = ReportDetail;
 
+const originalPush = VueRouter.prototype.push
+VueRouter.prototype.push = function push(location) {
+    return originalPush.call(this, location).catch(err => err)
+}
 const router = new VueRouter({routes});
 
 //进度条配置

+ 11 - 2
resources/assets/js/main/components/UserView.vue

@@ -55,9 +55,19 @@
             },
 
             getUserData(num, cacheTime) {
-                let keyName = '__name:' + this.username.substring(0, 1) + '__';
+                let keyName = '__userName:' + this.username.substring(0, 1) + '__';
                 let localData = $A.jsonParse(window.localStorage[keyName]);
+                //
                 if (window.__userViewNetworking === true) {
+                    if (num == 0) {
+                        if (typeof localData[this.username] !== "object") {
+                            localData[this.username] = {};
+                        }
+                        if (localData[this.username].success === true) {
+                            this.nickname = localData[this.username].data.nickname;
+                            this.profession = localData[this.username].data.profession;
+                        }
+                    }
                     if (num < 100) {
                         setTimeout(() => {
                             this.getUserData(num + 1, cacheTime)
@@ -69,7 +79,6 @@
                 if (typeof localData[this.username] !== "object") {
                     localData[this.username] = {};
                 }
-                //
                 if (localData[this.username].success === true) {
                     this.nickname = localData[this.username].data.nickname;
                     this.profession = localData[this.username].data.profession;

+ 5 - 5
resources/assets/js/main/components/WHeader.vue

@@ -272,11 +272,11 @@
     }
 </style>
 <script>
-    const ImgUpload = resolve => require(['./ImgUpload'], resolve);
-    const HeaderCreate = resolve => require(['./project/header/create'], resolve);
-    const HeaderArchived = resolve => require(['./project/header/archived'], resolve);
-    const ChatIndex = resolve => require(['./chat/Index'], resolve);
-    const WDrawer = resolve => require(['./iview/WDrawer'], resolve);
+    import ImgUpload from "./ImgUpload";
+    import HeaderCreate from "./project/header/create";
+    import HeaderArchived from "./project/header/archived";
+    import ChatIndex from "./chat/Index";
+    import WDrawer from "./iview/WDrawer";
 
     export default {
         name: 'WHeader',

+ 10 - 0
resources/assets/js/main/components/docs/flow/index.vue

@@ -1,6 +1,7 @@
 <template>
     <div class="flow-content">
         <iframe ref="myFlow" class="flow-iframe" :src="url"></iframe>
+        <div v-if="loadIng" class="flow-loading"><w-loading></w-loading></div>
     </div>
 </template>
 
@@ -25,6 +26,12 @@
             outline: 0;
             padding: 0;
         }
+        .flow-loading {
+            position: absolute;
+            top: 50%;
+            left: 50%;
+            transform: translate(-50%, -50%);
+        }
     }
 </style>
 <script>
@@ -38,6 +45,8 @@
         },
         data() {
             return {
+                loadIng: true,
+
                 flow: null,
                 url: window.location.origin + '/js/grapheditor/index.html',
             }
@@ -56,6 +65,7 @@
                 const data = event.data;
                 switch (data.act) {
                     case 'ready':
+                        this.loadIng = false;
                         this.flow.postMessage({
                             act: 'setXml',
                             params: {

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

@@ -292,6 +292,10 @@
         },
 
         methods: {
+            setTaskType(type) {
+                this.taskType = type;
+            },
+
             setPage(page) {
                 this.listPage = page;
                 this.getLists();

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

@@ -1,7 +1,7 @@
 export default {
     methods: {
-        openProject(projectid, otherParam) {
-            this.goForward({name: 'project-panel', params: {projectid:projectid, other:otherParam||{}}});
+        openProject(projectid, otherParam, statistics = '') {
+            this.goForward({name: 'project-panel', params: {projectid:projectid, statistics: statistics, other:otherParam||{}}});
         },
 
         outProject(projectid, successCallback) {

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

@@ -46,7 +46,7 @@
                             </div>
                         </div>
                         <div class="project-num" @click="handleProject('open', item)">
-                            <div class="project-complete"><em>{{item.complete}}</em>{{$L('已完成数')}}</div>
+                            <div class="project-complete" @click.stop="openComplete(item)"><em>{{item.complete}}</em>{{$L('已完成数')}}</div>
                             <div class="project-num-line"></div>
                             <div class="project-unfinished"><em>{{item.unfinished}}</em>{{$L('未完成数')}}</div>
                         </div>
@@ -486,6 +486,14 @@
                 });
             },
 
+            openComplete(item) {
+                if (item.complete > 0) {
+                    this.openProject(item.id, item, '已完成')
+                } else {
+                    this.handleProject('open', item);
+                }
+            },
+
             handleProject(event, item) {
                 if (item) {
                     this.handleProjectId = item.id;

+ 9 - 2
resources/assets/js/main/pages/project/panel.vue

@@ -106,7 +106,7 @@
                     <project-archived :canload="projectSettingDrawerShow && projectSettingDrawerTab == 'archived'" :projectid="projectid"></project-archived>
                 </TabPane>
                 <TabPane :label="$L('项目统计')" name="statistics">
-                    <project-statistics :canload="projectSettingDrawerShow && projectSettingDrawerTab == 'statistics'" :projectid="projectid"></project-statistics>
+                    <project-statistics ref="statistics" :canload="projectSettingDrawerShow && projectSettingDrawerTab == 'statistics'" :projectid="projectid"></project-statistics>
                 </TabPane>
                 <TabPane :label="$L('成员管理')" name="member">
                     <project-users :canload="projectSettingDrawerShow && projectSettingDrawerTab == 'member'" :projectid="projectid"></project-users>
@@ -403,7 +403,14 @@
         activated() {
             this.projectid = this.$route.params.projectid;
             if (typeof this.$route.params.other === "object") {
-                this.$set(this.projectDetail, 'title', $A.getObject(this.$route.params.other, 'title'))
+                this.$set(this.projectDetail, 'title', $A.getObject(this.$route.params.other, 'title'));
+            }
+            if (this.$route.params.statistics === '已完成') {
+                this.projectSettingDrawerTab = 'statistics';
+                this.projectSettingDrawerShow = true;
+                this.$nextTick(() => {
+                    this.$refs.statistics.setTaskType('已完成');
+                });
             }
         },
         deactivated() {

+ 6 - 4
resources/notify/chrome/js/popup.js

@@ -19,25 +19,27 @@ function onDelete(index) {
 
 function showLists(lists) {
     var html = '';
-    console.log(lists);
+    var j = 1;
+    var length = Object.keys(lists).length;
     for (var index in lists) {
         if (!lists.hasOwnProperty(index)) {
             continue;
         }
         const item = lists[index];
-        html+= '<li class="message_box" data-index="' + index + '" data-token="' + item.token + '">';
+        html+= '<li class="message_box' + (j == length ? ' last' : '') + '" data-index="' + index + '" data-token="' + item.token + '">';
         html+= '<div class="message_username">' + item.username + '</div>';
         html+= '<div class="message_host">' + index + '</div>';
-        html+= '<div class="message_unread">未读: ' + item.unread + '</div>';
+        html+= '<div class="message_unread' + (item.unread == 0 ? ' zero' : '') + '">未读: ' + item.unread + '</div>';
         html+= '<div class="message_delete">删除</div>';
         html+= '</li>';
+        j++;
     }
     if (!html) {
         html+= '<li class="message_box">';
         html+= '<div class="message_loading">没有相关的记录!</div>';
         html+= '</li>';
     }
-    $("#message_div").html('<ul>' + html + '</ul>');
+    $("#message_div").html('<ul class="message_lists">' + html + '</ul>');
     $("div.message_delete").click(function(){
         if (confirm("确定要删除此记录吗?")) {
             onDelete($(this).parents("li").attr("data-index"));

+ 39 - 9
resources/notify/chrome/popup.html

@@ -14,7 +14,7 @@
             border: 0;
         }
 
-        ul,li {
+        ul, li {
             list-style: none;
         }
 
@@ -27,29 +27,45 @@
             font-size: 14px;
         }
 
+        .message_lists {
+            max-height: 500px;
+            overflow: auto;
+        }
+
         .message_box {
-            margin: 6px;
-            padding: 6px 10px;
-            border-radius: 4px;
-            color: #ffffff;
-            background-color: #000000;
+            margin: 6px 16px;
+            padding: 6px 0;
+            color: #555555;
+            background-color: #ffffff;
+            border-bottom: 1px dashed #e5e5e5;
             position: relative;
         }
+
+        .message_box.last {
+            border-bottom: 0;
+        }
+
         .message_username {
             font-size: 16px;
             font-weight: 600;
             margin-bottom: 8px;
         }
+
         .message_host {
-            color: #888;
+            color: #888888;
             font-size: 12px;
             margin-bottom: 2px;
             cursor: pointer;
         }
+
+        .message_host:hover {
+            color: #555555;
+        }
+
         .message_unread {
             position: absolute;
             top: 6px;
-            right: 6px;
+            right: 0;
             height: 18px;
             line-height: 18px;
             color: #ffffff;
@@ -61,14 +77,28 @@
             transform: scale(0.9);
             z-index: 1;
             cursor: pointer;
+            transition: all 0.3s;
+        }
+
+        .message_unread:hover {
+            transform: scale(0.98);
+        }
+
+        .message_unread.zero {
+            background-color: #2196F3;
         }
+
         .message_delete {
             position: absolute;
             bottom: 6px;
-            right: 12px;
+            right: 6px;
             color: #cacaca;
             cursor: pointer;
         }
+
+        .message_delete:hover {
+            color: #ff3c11;
+        }
     </style>
 </head>
 <body>