fix(系统设置):使编辑环境”模块启用条件“时,不可选择不同项目的模块

This commit is contained in:
黎龙鑫 2021-04-26 19:53:05 +08:00 committed by jianxing
parent 44b55e96c4
commit 5aae143fcd
2 changed files with 16 additions and 10 deletions

View File

@ -77,7 +77,7 @@
<script>
import {HttpConfig} from "../../model/EnvironmentModel";
import MsApiKeyValue from "../ApiKeyValue";
import {REQUEST_HEADERS} from "../../../../../../common/js/constants";
import {REQUEST_HEADERS} from "@/common/js/constants";
import MsSelectTree from "../../../../common/select-tree/SelectTree";
import MsTableOperatorButton from "@/business/components/common/components/MsTableOperatorButton";
import {getUUID} from "@/common/js/utils";
@ -211,12 +211,16 @@
}
},
list() {
let url = "/api/module/list/" + this.projectId + "/HTTP";
this.result = this.$get(url, (response) => {
if (response.data !== undefined && response.data !== null) {
this.moduleOptions = response.data;
}
});
if (this.projectId) {
let url = "/api/module/list/" + this.projectId + "/HTTP";
this.result = this.$get(url, (response) => {
if (response.data !== undefined && response.data !== null) {
this.moduleOptions = response.data;
}
});
} else { //projectId
this.moduleOptions = [];
}
},
setModule(id, data) {
if (data && data.length > 0) {
@ -259,7 +263,7 @@
},
add() {
if (this.condition.type === "NONE" && this.checkNode()) {
this.$warning("启用条件为 '无' 的域名已经存在请更新!");
this.$warning("启用条件为 '无' 的域名已经存在请更新!");
return;
}
this.validateSocket();

View File

@ -53,7 +53,7 @@
<div>
{{$t('project.select')}}
</div>
<el-select v-model="currentProjectId" filterable clearable>
<el-select @change="handleProjectChange" v-model="currentProjectId" filterable clearable>
<el-option v-for="item in projectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select>
</div>
@ -290,7 +290,6 @@
}
//idprojectId
const envs = JSON.parse(JSON.stringify(this.selectRows));
envs.map(env => { //idprojectId
if (env.config){ //config
let tempConfig = JSON.parse(env.config);
@ -305,6 +304,9 @@
downloadFile('MS_' + envs.length + '_Environments.json', JSON.stringify(envs));
},
handleProjectChange() { //,
this.currentEnvironment.config.httpConfig.conditions = [];
},
parseDomainName(environment) { //
if (environment.config) {
const config = JSON.parse(environment.config);