From be0f0855ccbc7d989cbd079f78557f231a4dd223 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E9=BE=99=E9=91=AB?= Date: Wed, 28 Apr 2021 14:37:42 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E7=B3=BB=E7=BB=9F=E8=AE=BE=E7=BD=AE):?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=E7=8E=AF=E5=A2=83=E6=97=B6=E5=8F=AA=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E6=A8=A1=E5=9D=97=E5=90=AF=E7=94=A8=E6=9D=A1=E4=BB=B6?= =?UTF-8?q?=EF=BC=8C=E5=85=B6=E4=BB=96=E5=90=AF=E7=94=A8=E6=9D=A1=E4=BB=B6?= =?UTF-8?q?=E4=BF=9D=E7=95=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/settings/project/EnvironmentList.vue | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/frontend/src/business/components/settings/project/EnvironmentList.vue b/frontend/src/business/components/settings/project/EnvironmentList.vue index e78f6172b8..4f75473a97 100644 --- a/frontend/src/business/components/settings/project/EnvironmentList.vue +++ b/frontend/src/business/components/settings/project/EnvironmentList.vue @@ -294,11 +294,13 @@ } //拷贝一份选中的数据,不然下面删除id和projectId的时候会影响原数据 const envs = JSON.parse(JSON.stringify(this.selectRows)); - envs.map(env => { //不导出id和projectId和启用条件 + envs.map(env => { //不导出id和projectId和模块启用条件 if (env.config){ //旧环境可能没有config数据 let tempConfig = JSON.parse(env.config); - if (tempConfig.httpConfig.conditions) { - delete tempConfig.httpConfig.conditions; //删除”启用条件“,因为导入导出环境对应的项目不同,模块也就不同, + if (tempConfig.httpConfig.conditions && tempConfig.httpConfig.conditions.length > 0) { + tempConfig.httpConfig.conditions = tempConfig.httpConfig.conditions.filter(condition => { //删除”模块启用条件“,因为导入导出环境对应的项目不同,模块也就不同, + return condition.type !== 'MODULE'; + }); env.config = JSON.stringify(tempConfig); } } @@ -306,8 +308,8 @@ delete env.projectId; }) downloadFile('MS_' + envs.length + '_Environments.json', JSON.stringify(envs)); - }, + handleProjectChange() { //项目选择下拉框选择其他项目后清空“启用条件”,因为项目变了模块也就变了。 this.currentEnvironment.config.httpConfig.conditions = []; },