From 537cb70a8998f1e54a079c8940a84b52ec877a02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Chuailei000=E2=80=9D?= <2280131253@qq.com> Date: Thu, 20 Oct 2022 14:47:50 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=88=9B=E5=BB=BA=E8=B5=84=E4=BA=A7?= =?UTF-8?q?=E6=97=B6=E5=A6=82=E6=9E=9C=E9=80=89=E6=8B=A9=E4=BA=86=E8=8A=82?= =?UTF-8?q?=E7=82=B9=E6=98=BE=E7=A4=BA=E9=BB=98=E8=AE=A4=E8=8A=82=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Asset/AssetCreateUpdate/BaseAssetCreateUpdate.vue | 2 +- .../assets/Asset/AssetList/components/PlatformDialog.vue | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/views/assets/Asset/AssetCreateUpdate/BaseAssetCreateUpdate.vue b/src/views/assets/Asset/AssetCreateUpdate/BaseAssetCreateUpdate.vue index e40df47a0..b556d885e 100644 --- a/src/views/assets/Asset/AssetCreateUpdate/BaseAssetCreateUpdate.vue +++ b/src/views/assets/Asset/AssetCreateUpdate/BaseAssetCreateUpdate.vue @@ -72,7 +72,7 @@ export default { async setInitial() { const { defaultConfig } = this const { node, platform } = this.$route?.query || {} - const nodesInitial = node || [] + const nodesInitial = node ? [node] : [] const platformId = platform || 1 const url = `/api/v1/assets/platforms/${platformId}/` this.platform = await this.$axios.get(url) diff --git a/src/views/assets/Asset/AssetList/components/PlatformDialog.vue b/src/views/assets/Asset/AssetList/components/PlatformDialog.vue index cd351fa6b..98d05e706 100644 --- a/src/views/assets/Asset/AssetList/components/PlatformDialog.vue +++ b/src/views/assets/Asset/AssetList/components/PlatformDialog.vue @@ -150,7 +150,12 @@ export default { const route = _.capitalize(platform.category.value) + 'Create' || 'HostCreate' this.addToRecentPlatforms(platform) this.iVisible = false - this.$router.push({ name: route, query: { platform: platform.id }}) + const query = { + node: this.$route.query?.node || '', + platform: platform.id + } + + this.$router.push({ name: route, query }) } } }