no message

This commit is contained in:
kuaifan 2022-04-27 15:48:09 +08:00
parent 092506e9ab
commit 7b757d68b4
3 changed files with 31 additions and 31 deletions

View File

@ -384,7 +384,7 @@ export default {
return { return {
loadIng: 0, loadIng: 0,
routePath: this.$route.path, routeName: this.$route.name,
mateName: /macintosh|mac os x/i.test(navigator.userAgent) ? '⌘' : 'Ctrl', mateName: /macintosh|mac os x/i.test(navigator.userAgent) ? '⌘' : 'Ctrl',
addShow: false, addShow: false,
@ -423,7 +423,7 @@ export default {
natificationHidden: false, natificationHidden: false,
natificationReady: false, natificationReady: false,
notificationClass: null, notificationManage: null,
reportTabs: "my", reportTabs: "my",
reportUnreadNumber: 0, reportUnreadNumber: 0,
@ -625,7 +625,7 @@ export default {
watch: { watch: {
'$route' (route) { '$route' (route) {
this.routePath = route.path; this.routeName = route.name;
this.chackPass(); this.chackPass();
}, },
@ -652,9 +652,9 @@ export default {
natificationHidden(val) { natificationHidden(val) {
clearTimeout(this.notificationTimeout); clearTimeout(this.notificationTimeout);
if (!val && this.notificationClass) { if (!val && this.notificationManage) {
this.notificationTimeout = setTimeout(() => { this.notificationTimeout = setTimeout(() => {
this.notificationClass.close(); this.notificationManage.close();
}, 6000); }, 6000);
} }
}, },
@ -786,16 +786,14 @@ export default {
classNameRoute(path) { classNameRoute(path) {
return { return {
"active": $A.leftExists(this.routePath, '/manage/' + path), "active": this.routeName === `manage-${path}`,
}; };
}, },
classNameProject(item) { classNameProject(item) {
let path = 'project/' + item.id;
let openMenu = this.openMenu[item.id];
return { return {
"active": this.routePath === '/manage/' + path, "active": this.routeName === 'manage-project' && this.$route.params.projectId === item.id,
"open-menu": openMenu === true, "open-menu": this.openMenu[item.id] === true,
"operate": item.id == this.topOperateItem.id && this.topOperateVisible "operate": item.id == this.topOperateItem.id && this.topOperateVisible
}; };
}, },
@ -883,10 +881,12 @@ export default {
addDialogMsg(data) { addDialogMsg(data) {
if (!this.natificationReady) { if (!this.natificationReady) {
return; return; //
} }
if (!this.natificationHidden && $A.leftExists(this.routePath, "/manage/messenger") && this.$route.params.id == data.dialog_id) { if (!this.natificationHidden
return; && this.routeName === 'manage-messenger'
&& this.$route.params.dialogId == data.dialog_id) {
return; //
} }
// //
const {id, dialog_id, type, msg} = data; const {id, dialog_id, type, msg} = data;
@ -902,7 +902,7 @@ export default {
return; return;
} }
this._notificationId = id; this._notificationId = id;
this.notificationClass.replaceOptions({ this.notificationManage.replaceOptions({
icon: $A.originUrl('images/logo.png'), icon: $A.originUrl('images/logo.png'),
body: body, body: body,
data: data, data: data,
@ -911,13 +911,13 @@ export default {
}); });
let dialog = this.cacheDialogs.find((item) => item.id == dialog_id); let dialog = this.cacheDialogs.find((item) => item.id == dialog_id);
if (dialog) { if (dialog) {
this.notificationClass.replaceTitle(dialog.name); this.notificationManage.replaceTitle(dialog.name);
this.notificationClass.userAgreed(); this.notificationManage.userAgreed();
} else { } else {
this.$store.dispatch("getDialogOne", dialog_id).then(({data}) => { this.$store.dispatch("getDialogOne", dialog_id).then(({data}) => {
if (this._notificationId === id) { if (this._notificationId === id) {
this.notificationClass.replaceTitle(data.name); this.notificationManage.replaceTitle(data.name);
this.notificationClass.userAgreed(); this.notificationManage.userAgreed();
} }
}).catch(() => {}) }).catch(() => {})
} }
@ -1005,13 +1005,13 @@ export default {
}, },
notificationInit() { notificationInit() {
this.notificationClass = new notificationKoro(this.$L("打开通知成功")); this.notificationManage = new notificationKoro(this.$L("打开通知成功"));
if (this.notificationClass.support) { if (this.notificationManage.support) {
this.notificationClass.notificationEvent({ this.notificationManage.notificationEvent({
onclick: ({target}) => { onclick: ({target}) => {
console.log("[Notification] Click", target); console.log("[Notification] Click", target);
this.notificationClass.close(); this.notificationManage.close();
window.focus(); try {window.focus()}catch (e) {}
// //
const {tag, data} = target; const {tag, data} = target;
if (tag == 'dialog') { if (tag == 'dialog') {
@ -1040,7 +1040,7 @@ export default {
// //
case 'close': case 'close':
return this.notificationClass.initNotification(userSelectFn); return this.notificationManage.initNotification(userSelectFn);
// || // ||
case 'denied': case 'denied':
@ -1053,7 +1053,7 @@ export default {
break; break;
} }
}; };
this.notificationClass.initNotification(userSelectFn); this.notificationManage.initNotification(userSelectFn);
}, },
onVisibilityChange() { onVisibilityChange() {

View File

@ -82,7 +82,7 @@ export default {
align: 'center', align: 'center',
width: 100, width: 100,
render: (h, {index, row, column}) => { render: (h, {index, row, column}) => {
if (index === 0) { if (index === 0 && this.page === 1) {
return h('div', '-'); return h('div', '-');
} }
return h('TableAction', { return h('TableAction', {

View File

@ -46,7 +46,7 @@ import {Store} from "le5le-store";
export default { export default {
data() { data() {
return { return {
routePath: this.$route.path, routeName: this.$route.name,
show768Menu: true, show768Menu: true,
version: window.systemInfo.version version: window.systemInfo.version
@ -72,10 +72,10 @@ export default {
}, },
titleNameRoute() { titleNameRoute() {
const {routePath, menu} = this; const {routeName, menu} = this;
let name = ''; let name = '';
menu.some((item) => { menu.some((item) => {
if ($A.leftExists(routePath, '/manage/setting/' + item.path)) { if (routeName === `manage-setting-${item.path}`) {
name = item.name; name = item.name;
return true; return true;
} }
@ -85,7 +85,7 @@ export default {
}, },
watch: { watch: {
'$route' (route) { '$route' (route) {
this.routePath = route.path; this.routeName = route.name;
} }
}, },
methods: { methods: {
@ -100,7 +100,7 @@ export default {
classNameRoute(path, divided) { classNameRoute(path, divided) {
return { return {
"active": $A.leftExists(this.routePath, '/manage/setting/' + path), "active": this.routeName === `manage-setting-${path}`,
"divided": !!divided "divided": !!divided
}; };
}, },