From 8263a1f9f12913f0869751e22fc5c570d1ed848c Mon Sep 17 00:00:00 2001 From: lee_neo Date: Tue, 12 Nov 2024 19:59:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=9C=AC=E5=9C=B0=E7=BC=93?= =?UTF-8?q?=E5=AD=98=EF=BC=8C=E4=BF=9D=E5=AD=98=E5=AE=A2=E6=88=B7=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E6=98=BE=E7=A4=BA=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/application/applicationCreate.vue | 11 ++++++++--- src/pages/runningState/components/fleet.vue | 19 +++++++++++++++++-- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/src/pages/application/applicationCreate.vue b/src/pages/application/applicationCreate.vue index 9340078..993c401 100644 --- a/src/pages/application/applicationCreate.vue +++ b/src/pages/application/applicationCreate.vue @@ -1142,8 +1142,12 @@ if (Object.keys(obj).length) { application.data = formatForm(obj) } - buildType.value = obj.buildType - creationMethod.value = obj.creationMethod + buildType.value = obj.buildType; + creationMethod.value = obj.creationMethod; + baseImage.value = obj.baseImage; + if (obj?.request?.vpc_id) { + vpcChange(obj.request.vpc_id) + } } } (e.target as HTMLInputElement).value = ''; @@ -1166,10 +1170,11 @@ const onDownload = () => { let link = document.createElement('a'); - link.download = 'fleet.json'; + link.download = 'applicationPackage.json'; const applicationClone = JSON.parse(JSON.stringify(application.data)); applicationClone.buildType = buildType.value; applicationClone.creationMethod = creationMethod.value; + applicationClone.baseImage = baseImage.value; link.href = 'data:text/plain,' + JSON.stringify(applicationClone) link.click() } diff --git a/src/pages/runningState/components/fleet.vue b/src/pages/runningState/components/fleet.vue index e239f39..d66e994 100644 --- a/src/pages/runningState/components/fleet.vue +++ b/src/pages/runningState/components/fleet.vue @@ -38,6 +38,7 @@ } } }) + const localStorageHides: Set = new Set(JSON.parse(localStorage.getItem('fleetColumnHides') || '[]')) const fleetColumn = reactive([ {show: true, key: 'name', label: i18n.global.t('fleet.name_id')}, {show: true, key: 'description', label: i18n.global.t('fleet.description')}, @@ -50,7 +51,10 @@ {show: true, key: 'state', label: i18n.global.t('fleet.state')}, {show: true, key: 'enable_auto_scaling', label: i18n.global.t('autoScaling.Auto_scaling_details')}, {show: true, key: 'creationTime', label: i18n.global.t('fleet.creation_time')}, - ]); + ].map(item => ({ + ...item, + show: !localStorageHides.has(item.key), + }))) const ys = { fleet_id: i18n.global.t('fleet.fleet_id'), @@ -127,6 +131,17 @@ emit('fupdate') } + const onSwitchChange = (switched: string | number | boolean, key: string): void => { + if(switched){ + // 剔除此项 + localStorageHides.delete(key); + } else { + // 新增此项 + localStorageHides.add(key); + } + localStorage.setItem('fleetColumnHides', JSON.stringify(Array.from(localStorageHides))); + } + const changeScalingStatus = (row: any, autoScaling: boolean) => { ElMessageBox.confirm(i18n.global.t('messageBox.saveModification'), i18n.global.t('messageBox.Warm_Tip'), { confirmButtonText: i18n.global.t('messageBox.confirm'), @@ -238,7 +253,7 @@ -- Gitee