fix(系统设置):使编辑环境”模块启用条件“时,不可选择不同项目的模块
This commit is contained in:
parent
44b55e96c4
commit
5aae143fcd
|
@ -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();
|
||||
|
|
|
@ -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 @@
|
|||
}
|
||||
//拷贝一份选中的数据,不然下面删除id和projectId的时候会影响原数据
|
||||
const envs = JSON.parse(JSON.stringify(this.selectRows));
|
||||
|
||||
envs.map(env => { //不导出id和projectId和启用条件
|
||||
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);
|
||||
|
|
Loading…
Reference in New Issue