From 56bf97650c6b47d5278a1335275df18a19ce174b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=81=E7=AB=AD=E5=8A=9B?= Date: Tue, 26 Nov 2024 18:19:03 +0800 Subject: [PATCH] Fix the issue that the new tab cannot be removed after clicking. (#104) --- src/components/Apps/AppCard.vue | 16 ++++++++++++++-- src/components/Apps/AppSection.vue | 1 + src/main.ts | 2 +- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/components/Apps/AppCard.vue b/src/components/Apps/AppCard.vue index b7c07a3a..a948f417 100644 --- a/src/components/Apps/AppCard.vue +++ b/src/components/Apps/AppCard.vue @@ -211,6 +211,7 @@ import commonI18n, { ice_i18n } from "@/mixins/base/common-i18n"; import FileSaver from "file-saver"; import { MIRCO_APP_ACTION_ENUM } from "@/const"; import { vOnClickOutside } from "@vueuse/components"; +import { set } from "vue/types/umd"; export default { name: "app-card", @@ -347,6 +348,11 @@ export default { }, methods: { + + hasNewTagLabel(name) { + return this.appIds.includes(name) >= 0; + }, + /** * @description: Open app in new windows * @param {String} status App status @@ -355,6 +361,8 @@ export default { * @return {*} void */ openApp(item) { + + if (this.isContainerApp) { this.$emit("importApp", item, false); return false; @@ -374,10 +382,10 @@ export default { }); } } else if (this.isLinkApp) { - this.hasNewTag(item.name) && this.removeIdFromNewAppIds(item.name); + // this.hasNewTagLabel(item.name) && this.removeIdFromNewAppIds(item.name); window.open(item.hostname, "_blank"); } else if (item.requireGPU) { - this.hasNewTag(item.name) && this.removeIdFromNewAppIds(item.name); + console.log("enable GPU ::", item); let routeUrl = this.$router.resolve({ name: "AppDetection", @@ -395,6 +403,10 @@ export default { this.checkAndOpenThirdApp(item); } } + this.hasNewTagLabel(item.name) && this.removeIdFromNewAppIds(item.name); + setTimeout(() => { + this.$emit("updateAppIds"); + }, 200); }, openSystemApps(item) { diff --git a/src/components/Apps/AppSection.vue b/src/components/Apps/AppSection.vue index f603efad..84df36f5 100644 --- a/src/components/Apps/AppSection.vue +++ b/src/components/Apps/AppSection.vue @@ -55,6 +55,7 @@ @configApp="showConfigPanel" @importApp="showContainerPanel" @updateState="getList" + @updateAppIds="getNewAppIdsFromCustomStorage" > diff --git a/src/main.ts b/src/main.ts index 1e18a202..21fcdd3f 100644 --- a/src/main.ts +++ b/src/main.ts @@ -97,6 +97,7 @@ Vue.use(Vue2TouchEvents) Vue.use(VueSocketIOExt, socket); Vue.use(VueSocialSharing); + Vue.config.productionTip = false Vue.prototype.$api = api; Vue.prototype.$openAPI = openAPI; @@ -109,7 +110,6 @@ Vue.prototype.$wsProtocol = wsProtocol; Vue.prototype.$EventBus = new Vue(); Vue.prototype.$messageBus = messageBus; - new Vue({ router, // @ts-ignore