From b794ba7a6b6751e03167858d1693c6d755f07c4d Mon Sep 17 00:00:00 2001 From: kuaifan Date: Thu, 15 Jan 2026 09:09:58 +0000 Subject: [PATCH] =?UTF-8?q?refactor(ui):=20=E4=BC=98=E5=8C=96=E5=AE=A2?= =?UTF-8?q?=E6=88=B7=E7=AB=AF=E4=B8=8B=E8=BD=BD=E5=85=A5=E5=8F=A3=E4=BD=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将仪表盘页面的客户端下载链接移至右上角用户菜单 - 登录页保留右下角客户端下载链接 - 新增 clientDownloadUrl 全局状态,统一管理下载地址 - AI 浮动按钮在登录页不显示 --- .../components/AIAssistant/float-button.vue | 7 ++- .../assets/js/components/RightBottom.vue | 44 +++++++++---------- resources/assets/js/pages/manage.vue | 30 +++++++++++++ resources/assets/js/store/state.js | 3 ++ 4 files changed, 59 insertions(+), 25 deletions(-) diff --git a/resources/assets/js/components/AIAssistant/float-button.vue b/resources/assets/js/components/AIAssistant/float-button.vue index 8ab25d267..fc54e76da 100644 --- a/resources/assets/js/components/AIAssistant/float-button.vue +++ b/resources/assets/js/components/AIAssistant/float-button.vue @@ -2,7 +2,7 @@
@@ -36,7 +36,10 @@ export default { computed: { visible() { - return this.userId > 0 && this.positionLoaded && !this.windowPortrait; + return this.userId > 0 && + this.positionLoaded && + !this.windowPortrait && + this.routeName !== 'login'; }, // 计算实际的 left 值 diff --git a/resources/assets/js/components/RightBottom.vue b/resources/assets/js/components/RightBottom.vue index bb16c9952..7bd6e6a3b 100644 --- a/resources/assets/js/components/RightBottom.vue +++ b/resources/assets/js/components/RightBottom.vue @@ -3,16 +3,10 @@ - + + + {{ $L('客户端下载') }} + 《{{ $L('隐私政策') }}》 @@ -43,6 +37,7 @@ const VMPreview = () => import('./VMEditor/preview'); import axios from "axios"; import emitter from "../store/events"; +import {mapState} from "vuex"; export default { name: 'RightBottom', @@ -59,8 +54,6 @@ export default { updateShow: false, updateBottomShow: false, updateIng: false, - - downloadUrl: '', } }, @@ -77,10 +70,12 @@ export default { this.updateShow = !$A.strExists(this.updateNote, `[${this.updateVersion}-Silence]`); }) } + emitter.on('openDownloadClient', this.openDownloadClient); }, beforeDestroy() { emitter.off('updateNotification', this.onUpdateShow); + emitter.off('openDownloadClient', this.openDownloadClient); }, watch: { @@ -92,20 +87,17 @@ export default { }, computed: { + ...mapState(['clientDownloadUrl']), + showSSO() { return this.$isSoftware && ['login'].includes(this.routeName) }, showDown() { - if (this.$isEEUIApp || this.windowTouch) { - // app或者触摸屏不显示下载链接 - return false; + if (this.$Electron || this.$isEEUIApp || this.windowTouch) { + return false } - if (this.routeName == 'manage-dashboard' && this.windowPortrait) { - // 在仪表盘页面且竖屏不显示下载链接 - return false; - } - return ['login', 'index', 'manage-dashboard'].includes(this.routeName) + return this.routeName === 'login' }, showPrivacy() { @@ -118,6 +110,12 @@ export default { this.updateShow = true }, + openDownloadClient() { + if (this.clientDownloadUrl) { + window.open(this.clientDownloadUrl, '_blank'); + } + }, + isNotServer() { let apiHome = $A.getDomain(window.systemInfo.apiUrl) return this.$isSoftware && (apiHome == "" || apiHome == "public") @@ -187,7 +185,7 @@ export default { // switch (publish.provider) { case 'generic': - this.downloadUrl = `${publish.url}/latest` + this.$store.state.clientDownloadUrl = `${publish.url}/latest` break; case 'github': @@ -196,7 +194,7 @@ export default { let cache = await $A.IDBJson(key); let timeout = 600; if (cache.time && cache.time + timeout > $A.dayjs().unix()) { - this.downloadUrl = cache.data.html_url; + this.$store.state.clientDownloadUrl = cache.data.html_url; return; } // @@ -210,7 +208,7 @@ export default { cache.time = $A.dayjs().unix() cache.data = data.find(({tag_name}) => this.compareVersion(this.tagVersion(tag_name), this.apiVersion) === 0) || {} $A.IDBSave(key, cache); - this.downloadUrl = cache.data.html_url; + this.$store.state.clientDownloadUrl = cache.data.html_url; } }).catch(() => { this.loadIng--; diff --git a/resources/assets/js/pages/manage.vue b/resources/assets/js/pages/manage.vue index 88810a680..ca9b980af 100644 --- a/resources/assets/js/pages/manage.vue +++ b/resources/assets/js/pages/manage.vue @@ -605,6 +605,7 @@ export default { 'columnTemplate', 'clientNewVersion', + 'clientDownloadUrl', 'reportUnreadNumber', 'approveUnreadNumber', @@ -712,6 +713,18 @@ export default { } }, + /** + * 是否显示客户端下载 + * @returns {boolean} + */ + showDownloadClient() { + return !this.$Electron && !this.$isEEUIApp && !!this.clientDownloadUrl + }, + + /** + * 右上角菜单 + * @returns {Array} + */ menu() { const {userIsAdmin} = this; const array = [ @@ -726,6 +739,7 @@ export default { {path: 'system', name: '系统设置'}, {path: 'license', name: 'License Key'}, + {path: 'downloadClient', name: '客户端下载', divided: true, visible: this.showDownloadClient}, {path: 'version', name: '更新版本', divided: true, visible: !!this.clientNewVersion}, {path: 'allProject', name: '所有项目', divided: true}, @@ -736,6 +750,7 @@ export default { } else { array.push(...[ {path: 'personal', name: '个人设置', divided: true}, + {path: 'downloadClient', name: '客户端下载', divided: true, visible: this.showDownloadClient}, {path: 'version', name: '更新版本', divided: true, visible: !!this.clientNewVersion}, {path: 'workReport', name: '工作报告', divided: true}, @@ -749,6 +764,10 @@ export default { return array }, + /** + * 项目模板列表 + * @returns {Array} + */ columns() { const array = $A.cloneJSON(this.columnTemplate); array.unshift({ @@ -758,6 +777,10 @@ export default { return array }, + /** + * 项目列表 + * @returns {Array} + */ projectLists() { const {projectKeyValue, cacheProjects} = this; const data = $A.cloneJSON(cacheProjects).sort((a, b) => { @@ -778,6 +801,10 @@ export default { return data; }, + /** + * 最近打开的任务列表 + * @returns {Array} + */ taskBrowseLists() { // 直接使用组件内的响应式数据 return this.taskBrowseHistory.slice(0, 10); // 只显示前10个 @@ -933,6 +960,9 @@ export default { case 'version': emitter.emit('updateNotification', null); return; + case 'downloadClient': + emitter.emit('openDownloadClient'); + return; case 'clearCache': $A.IDBSet("clearCache", "handle").then(_ => { $A.reloadUrl() diff --git a/resources/assets/js/store/state.js b/resources/assets/js/store/state.js index 6aaf453c7..f05a36172 100644 --- a/resources/assets/js/store/state.js +++ b/resources/assets/js/store/state.js @@ -234,6 +234,9 @@ export default { // 客户端新版本号 clientNewVersion: null, + // 客户端下载地址(网页版) + clientDownloadUrl: '', + // 预览图片 previewImageIndex: 0, previewImageList: [],