From 40b52d8f3b21fafbfac6737a281cdaee6a307057 Mon Sep 17 00:00:00 2001 From: kuaifan Date: Tue, 25 Jul 2023 14:12:51 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E6=B7=B1=E8=89=B2?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- resources/assets/js/App.vue | 16 ++++++++++------ resources/assets/js/functions/eeui.js | 5 +++++ resources/assets/js/functions/web.js | 15 +++++---------- .../js/pages/manage/components/TaskDetail.vue | 10 +++++----- resources/mobile | 2 +- 6 files changed, 27 insertions(+), 23 deletions(-) diff --git a/package.json b/package.json index 55b647ca1..7d0f82893 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "css-loader": "^6.7.2", "dexie": "^3.2.3", "echarts": "^5.2.2", - "element-sea": "^2.15.10-4", + "element-sea": "^2.15.10-5", "file-loader": "^6.2.0", "highlight.js": "^11.7.0", "inquirer": "^8.2.0", diff --git a/resources/assets/js/App.vue b/resources/assets/js/App.vue index c0f92ed05..c8ff93498 100755 --- a/resources/assets/js/App.vue +++ b/resources/assets/js/App.vue @@ -161,6 +161,7 @@ export default { windowActive(active) { if (active) { + this.autoTheme() this.__windowTimer && clearTimeout(this.__windowTimer) this.__windowTimer = setTimeout(_ => { this.$store.dispatch("call", { @@ -174,9 +175,6 @@ export default { }).catch(_ => { this.$store.dispatch("websocketConnection") }) - if (this.themeMode === "auto") { - this.$store.dispatch("synchTheme") - } }, 600) } else { this.$store.dispatch("audioStop", true) @@ -221,6 +219,12 @@ export default { }); }, + autoTheme() { + if (this.themeMode === "auto") { + this.$store.dispatch("synchTheme") + } + }, + synchThemeLanguage() { if (this.isSoftware) { this.iframes = this.iframes.filter(({key}) => key != 'synchThemeLanguage') @@ -298,9 +302,7 @@ export default { } // APP进入前台 window.__onAppActive = () => { - if (this.themeMode === "auto") { - this.$store.dispatch("synchTheme") - } + this.autoTheme() } // 页面失活 window.__onPagePause = () => { @@ -312,6 +314,8 @@ export default { this.$store.state.windowActive = true; if (num > 0) { this.$store.dispatch("getBasicData", 600) + } else { + this.autoTheme() } } // 会议事件 diff --git a/resources/assets/js/functions/eeui.js b/resources/assets/js/functions/eeui.js index dcbc214b9..272783373 100755 --- a/resources/assets/js/functions/eeui.js +++ b/resources/assets/js/functions/eeui.js @@ -83,6 +83,11 @@ } }); }, + + eeuiAppGetThemeName() { + if (!$A.isEEUiApp) return; + return requireModuleJs("eeui").getThemeName(); + }, }); window.$A = $; diff --git a/resources/assets/js/functions/web.js b/resources/assets/js/functions/web.js index b16d5d637..43607f3d8 100755 --- a/resources/assets/js/functions/web.js +++ b/resources/assets/js/functions/web.js @@ -1152,19 +1152,11 @@ }, defaultFilter() { - if (this.supportMode() === 'chrome') { - return '-webkit-filter: url(#dark-mode-filter) !important; filter: url(#dark-mode-filter) !important;'; - } else if (this.supportMode() === 'webkit') { - return '-webkit-filter: invert(0.92) hue-rotate(180deg) !important; filter: invert(0.92) hue-rotate(180deg) !important;'; - } + return '-webkit-filter: invert(0.92) hue-rotate(180deg) !important; filter: invert(0.92) hue-rotate(180deg) !important;'; }, reverseFilter() { - if (this.supportMode() === 'chrome') { - return '-webkit-filter: url(#dark-mode-reverse-filter) !important; filter: url(#dark-mode-reverse-filter) !important;'; - } else if (this.supportMode() === 'webkit') { - return '-webkit-filter: invert(0.92) hue-rotate(180deg) !important; filter: invert(0.92) hue-rotate(180deg) !important;'; - } + return '-webkit-filter: invert(0.92) hue-rotate(180deg) !important; filter: invert(0.92) hue-rotate(180deg) !important;'; }, noneFilter() { @@ -1322,6 +1314,9 @@ autoDarkMode() { let darkScheme = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches + if ($A.isEEUiApp) { + darkScheme = $A.eeuiAppGetThemeName() === "dark" + } if (darkScheme) { this.enableDarkMode() } else { diff --git a/resources/assets/js/pages/manage/components/TaskDetail.vue b/resources/assets/js/pages/manage/components/TaskDetail.vue index e40e0ee98..4ea0f471d 100644 --- a/resources/assets/js/pages/manage/components/TaskDetail.vue +++ b/resources/assets/js/pages/manage/components/TaskDetail.vue @@ -474,7 +474,7 @@ export default { components: { UserSelect, TaskExistTips, - ChatInput, + ChatInput, TaskMenu, ProjectLog, DialogWrapper, @@ -629,7 +629,7 @@ export default { 'taskContents', 'taskFiles', 'taskPriority', - + 'dialogId', ]), @@ -981,7 +981,7 @@ export default { && (Math.abs($A.Time(this.taskDetail.start_at) - $A.Time(params.start_at)) > 60 || Math.abs($A.Time(this.taskDetail.end_at) - $A.Time(params.end_at)) > 60) && typeof params.desc === "undefined") { $A.modalInput({ - title: `修改任务时间`, + title: `修改${this.taskDetail.parent_id > 0 ? '子任务' : '任务'}时间`, placeholder: `请输入修改备注`, okText: "确定", onOk: (desc) => { @@ -989,8 +989,8 @@ export default { return `请输入修改备注` } this.updateParams = Object.assign(params, { desc }) - if (params.start_at && params.end_at) { - this.$refs['taskExistTipsRef'].isExistTask({ + if (params.start_at && params.end_at && this.$refs.taskExistTipsRef) { + this.$refs.taskExistTipsRef.isExistTask({ taskid: this.taskDetail.id, userids: this.taskDetail.owner_userid, timerange: [params.start_at, params.end_at] diff --git a/resources/mobile b/resources/mobile index b95b0a9c4..0df0faf45 160000 --- a/resources/mobile +++ b/resources/mobile @@ -1 +1 @@ -Subproject commit b95b0a9c439f04f9f19648bb2159187eb2b936ea +Subproject commit 0df0faf4510aca0532784acfcc4feb54bdf37fd4