fix(项目设置): 导入环境默认为当前项目
--bug=1014832 --user=李玉号 【项目设置】项目下导入环境,不需要选择环境,默认为当前环境 https://www.tapd.cn/55049933/s/1204441
This commit is contained in:
parent
49e91e8f11
commit
dd3b126381
|
@ -1,11 +1,11 @@
|
|||
<template>
|
||||
<el-dialog :visible="dialogVisible" :title="dialogTitle"
|
||||
@close="close" :close-on-click-modal="false"
|
||||
width="50%">
|
||||
:width="!toImportProjectId ? `50%` : `25%`">
|
||||
<el-form>
|
||||
<el-row>
|
||||
<el-col :span="6">
|
||||
<div class="project-item">
|
||||
<div class="project-item" v-if="!toImportProjectId">
|
||||
<div style="margin-bottom: 10px">
|
||||
{{$t('project.select')}}
|
||||
</div>
|
||||
|
@ -52,6 +52,12 @@ export default {
|
|||
return [];
|
||||
}
|
||||
},
|
||||
toImportProjectId: {
|
||||
type: String,
|
||||
default() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
@ -92,7 +98,11 @@ export default {
|
|||
try {
|
||||
JSON.parse(fileString).map(env => {
|
||||
//projectId为空字符串要转换为null,空字符串会被认为有projectId
|
||||
env.projectId = this.currentProjectId === '' ? null : this.currentProjectId;
|
||||
if (this.toImportProjectId) {
|
||||
env.projectId = this.toImportProjectId;
|
||||
} else {
|
||||
env.projectId = this.currentProjectId === '' ? null : this.currentProjectId;
|
||||
}
|
||||
if (!env.projectId) {
|
||||
this.$warning(this.$t('api_test.environment.project_warning'));
|
||||
return;
|
||||
|
|
|
@ -68,7 +68,7 @@
|
|||
:project-id="currentProjectId" @refreshAfterSave="refresh">
|
||||
</environment-edit>
|
||||
</el-dialog>
|
||||
<environment-import :project-list="projectList" @refresh="refresh" ref="envImport"></environment-import>
|
||||
<environment-import :project-list="projectList" :to-import-project-id="currentProjectId" @refresh="refresh" ref="envImport"></environment-import>
|
||||
|
||||
<el-dialog title="域名列表" :visible.sync="domainVisible">
|
||||
<el-table :data="conditions">
|
||||
|
|
Loading…
Reference in New Issue