diff --git a/resources/assets/js/pages/manage.vue b/resources/assets/js/pages/manage.vue
index a5606f0a..99aaacdb 100644
--- a/resources/assets/js/pages/manage.vue
+++ b/resources/assets/js/pages/manage.vue
@@ -155,6 +155,8 @@ export default {
archivedProjectShow: false,
+ titleInterval: null,
+
natificationHidden: false,
natificationReady: false,
notificationClass: null,
@@ -165,12 +167,14 @@ export default {
this.$store.dispatch("getUserInfo");
this.$store.dispatch("getTaskPriority");
//
+ this.startCountTitle();
this.notificationInit();
this.onVisibilityChange();
},
deactivated() {
this.addShow = false;
+ clearInterval(this.titleInterval);
},
computed: {
@@ -324,6 +328,38 @@ export default {
}
},
+ startCountTitle() {
+ this.titleInterval = setInterval(() => {
+ let {title} = document;
+ let newTitle = title.replace(/^(.*?)\((\d+)\)$/g, "$1")
+ if (this.userId) {
+ if (this.msgAllUnread > 0) {
+ newTitle+= " (" + this.msgAllUnread + ")"
+ }
+ }
+ if (title != newTitle) {
+ this.setPageTile(newTitle);
+ }
+ }, 500)
+ },
+
+ setPageTile(title) {
+ document.title = title;
+ let mobile = navigator.userAgent.toLowerCase();
+ if (/iphone|ipad|ipod/.test(mobile)) {
+ let iframe = document.createElement('iframe');
+ iframe.style.display = 'none';
+ let iframeCallback = function () {
+ setTimeout(function () {
+ iframe.removeEventListener('load', iframeCallback);
+ document.body.removeChild(iframe)
+ }, 0)
+ };
+ iframe.addEventListener('load', iframeCallback);
+ document.body.appendChild(iframe)
+ }
+ },
+
notificationInit() {
this.notificationClass = new notificationKoro(this.$L("打开通知成功"));
if (this.notificationClass.support) {
diff --git a/resources/assets/js/pages/manage/calendar.vue b/resources/assets/js/pages/manage/calendar.vue
index 52fd972b..7ef7e31c 100644
--- a/resources/assets/js/pages/manage/calendar.vue
+++ b/resources/assets/js/pages/manage/calendar.vue
@@ -1,6 +1,6 @@
-
{{$L('日历')}}
+
diff --git a/resources/assets/js/pages/manage/dashboard.vue b/resources/assets/js/pages/manage/dashboard.vue
index e9edbbce..10d9e1ac 100644
--- a/resources/assets/js/pages/manage/dashboard.vue
+++ b/resources/assets/js/pages/manage/dashboard.vue
@@ -1,6 +1,6 @@
-
{{$L('仪表盘')}}
+
{{$L('欢迎您,' + userInfo.nickname)}}
{{$L('以下是你当前的任务统计数据')}}
diff --git a/resources/assets/js/pages/manage/messenger.vue b/resources/assets/js/pages/manage/messenger.vue
index 0bdc3813..1d11c04d 100644
--- a/resources/assets/js/pages/manage/messenger.vue
+++ b/resources/assets/js/pages/manage/messenger.vue
@@ -1,6 +1,6 @@
-
{{$L('消息')}}
+
diff --git a/resources/assets/js/pages/manage/project.vue b/resources/assets/js/pages/manage/project.vue
index b2ea321b..7306fe71 100644
--- a/resources/assets/js/pages/manage/project.vue
+++ b/resources/assets/js/pages/manage/project.vue
@@ -1,6 +1,5 @@
diff --git a/resources/assets/js/pages/manage/setting/index.vue b/resources/assets/js/pages/manage/setting/index.vue
index f91d5d62..b9b7adbe 100644
--- a/resources/assets/js/pages/manage/setting/index.vue
+++ b/resources/assets/js/pages/manage/setting/index.vue
@@ -1,6 +1,6 @@
-
+
@@ -58,7 +58,7 @@ export default {
return true;
}
})
- return name;
+ return name || '设置';
}
},
watch: {