fix(系统设置): 导入环境没有选择项目时提示不友好

--bug=1013494 --user=李玉号 【系统设置】导入环境  项目没有选择时,点击导入,提示不友好;导入环境成功后,上传弹窗建议消失
https://www.tapd.cn/55049933/s/1170426
This commit is contained in:
shiziyuan9527 2022-05-31 17:49:28 +08:00 committed by shiziyuan9527
parent cd4afe085e
commit a5664441f4
5 changed files with 9 additions and 3 deletions

View File

@ -93,10 +93,15 @@ export default {
JSON.parse(fileString).map(env => {
//projectIdnullprojectId
env.projectId = this.currentProjectId === '' ? null : this.currentProjectId;
if (!env.projectId) {
this.$warning(this.$t('api_test.environment.project_warning'));
return;
}
this.$fileUpload('/api/environment/add', null,[], env, response => {
this.dialogVisible = false;
this.$emit('refresh');
this.$success(this.$t('commons.save_success'));
})
});
})
} catch (exception) {
this.$warning(this.$t('api_test.api_import.ms_env_import_file_limit'));

View File

@ -73,7 +73,6 @@ import EnvironmentEdit from "@/business/components/api/test/components/environme
import MsAsideItem from "@/business/components/common/components/MsAsideItem";
import MsAsideContainer from "@/business/components/common/components/MsAsideContainer";
import ProjectSwitch from "@/business/components/common/head/ProjectSwitch";
import EnvironmentImport from "@/business/components/project/menu/EnvironmentImport";
import EnvironmentGroupRow from "@/business/components/settings/workspace/environment/EnvironmentGroupRow";
import EditEnvironmentGroup from "@/business/components/settings/workspace/environment/EditEnvironmentGroup";
import MsDeleteConfirm from "@/business/components/common/components/MsDeleteConfirm";
@ -82,7 +81,6 @@ export default {
name: "EnvironmentGroup",
components: {
EditEnvironmentGroup,
EnvironmentImport,
ProjectSwitch,
MsAsideContainer,
MsAsideItem,

View File

@ -1454,6 +1454,7 @@ export default {
repeat_warning: "The domain name whose activation condition is'None' already exists!",
copy_warning: "Domain names whose enabling conditions are'none' do not support copying!",
path_warning: "The path cannot be empty",
project_warning: "project id cannot be empty",
module_warning: "The path cannot be empty"
},
scenario: {

View File

@ -1459,6 +1459,7 @@ export default {
repeat_warning: "启用条件为 '无' 的域名已经存在!",
copy_warning: "启用条件为 '无' 的域名不支持复制!",
path_warning: "路径不能为空",
project_warning: "项目不能为空",
module_warning: "模块不能为空"
},
scenario: {

View File

@ -1459,6 +1459,7 @@ export default {
repeat_warning: "啟用條件為 '無' 的域名已經存在!",
copy_warning: "啟用條件為 '無' 的域名不支持複製!",
path_warning: "路徑不能為空",
project_warning: "項目不能為空",
module_warning: "模塊不能為空"
},
scenario: {