no message

This commit is contained in:
kuaifan 2024-03-14 02:53:54 +09:00
parent b267863b58
commit c2dd15fca1
6 changed files with 62 additions and 40 deletions

View File

@ -53,23 +53,24 @@ export default {
}, },
created() { created() {
this.electronEvents(); this.electronEvents()
this.eeuiEvents(); this.eeuiEvents()
this.otherEvents(); this.otherEvents()
}, },
mounted() { mounted() {
window.addEventListener('resize', this.windowSizeListener); window.addEventListener('resize', this.windowSizeListener)
window.addEventListener('scroll', this.windowScrollListener); window.addEventListener('scroll', this.windowScrollListener)
window.addEventListener('message', this.windowHandleMessage) window.addEventListener('message', this.windowHandleMessage)
this.searchInter = setInterval(this.searchEnter, 1000); this.searchInter = setInterval(this.searchEnter, 1000)
$A.loadVConsole()
}, },
beforeDestroy() { beforeDestroy() {
window.removeEventListener('resize', this.windowSizeListener); window.removeEventListener('resize', this.windowSizeListener)
window.removeEventListener('scroll', this.windowScrollListener); window.removeEventListener('scroll', this.windowScrollListener)
window.removeEventListener('message', this.windowHandleMessage) window.removeEventListener('message', this.windowHandleMessage)
this.searchInter && clearInterval(this.searchInter); this.searchInter && clearInterval(this.searchInter)
}, },
computed: { computed: {
@ -112,24 +113,6 @@ export default {
}); });
}, 6000) }, 6000)
} }
//
$A.IDBString("logOpen").then(r => {
$A.openLog = r === "open"
if ($A.openLog) {
$A.loadScript('js/vconsole.min.js').then(_ => {
window.vConsole = new window.VConsole({
onReady: () => {
console.log('vConsole: onReady');
},
onClearLog: () => {
console.log('vConsole: onClearLog');
}
});
}).catch(_ => {
$A.modalError("vConsole 组件加载失败!");
})
}
})
} }
}, },
immediate: true immediate: true

View File

@ -1932,7 +1932,7 @@ const localforage = require("localforage");
/** /**
* ============================================================================= * =============================================================================
* ***************************** ajaxc **************************** * *********************************** ajaxc *******************************
* ============================================================================= * =============================================================================
*/ */
$.extend({ $.extend({

View File

@ -926,6 +926,49 @@ import {MarkdownPreview} from "../store/markdown";
} }
return false; return false;
}, },
/**
* 加载 VConsole 日志组件
* @param key
*/
loadVConsole(key = undefined) {
if (typeof key === "string") {
switch (key) {
case 'log.o':
$A.IDBSet("logOpen", "open").then(_ => {
$A.loadVConsole()
});
return true;
case 'log.c':
$A.IDBSet("logOpen", "close").then(_ => {
$A.loadVConsole()
});
return true;
}
return false
}
$A.IDBString("logOpen").then(r => {
if (typeof window.vConsole !== "undefined") {
window.vConsole.destroy();
window.vConsole = null;
}
$A.openLog = r === "open"
if ($A.openLog) {
$A.loadScript('js/vconsole.min.js').then(_ => {
window.vConsole = new window.VConsole({
onReady: () => {
console.log('VConsole: onReady');
},
onClearLog: () => {
console.log('VConsole: onClearLog');
}
});
}).catch(_ => {
$A.modalError("VConsole 组件加载失败!");
})
}
})
}
}); });
/** /**

View File

@ -123,6 +123,10 @@ export default {
if (val == '') { if (val == '') {
return; return;
} }
if ($A.loadVConsole(val)) {
this.projectKeyValue = '';
return;
}
this.projectKeyLoading++; this.projectKeyLoading++;
setTimeout(() => { setTimeout(() => {
if (this.projectKeyValue == val) { if (this.projectKeyValue == val) {

View File

@ -529,17 +529,9 @@ export default {
dialogSearchKey(val) { dialogSearchKey(val) {
this.$store.state.messengerSearchKey.dialog = val this.$store.state.messengerSearchKey.dialog = val
switch (val) { if ($A.loadVConsole(val)) {
case 'log.o': this.dialogSearchKey = '';
$A.IDBSet("logOpen", "open").then(_ => { return;
$A.reloadUrl()
});
break;
case 'log.c':
$A.IDBSet("logOpen", "close").then(_ => {
$A.reloadUrl()
});
break;
} }
// //
this.dialogSearchList = []; this.dialogSearchList = [];

View File

@ -257,7 +257,7 @@ export default {
setTimeout(_ => { setTimeout(_ => {
cloneParams.__networkFailureRetry = true cloneParams.__networkFailureRetry = true
dispatch("call", cloneParams).then(resolve).catch(reject) dispatch("call", cloneParams).then(resolve).catch(reject)
}, 300) }, 1000)
return return
} }
if (params.checkNetwork !== false) { if (params.checkNetwork !== false) {