feat: 删除资源池时提示哪些测试正在使用

This commit is contained in:
shiziyuan9527 2020-11-05 15:30:38 +08:00
parent ff6015754a
commit 6e287d6188
7 changed files with 16 additions and 8 deletions

View File

@ -73,8 +73,14 @@ public class TestResourcePoolService {
LoadTestExample example = new LoadTestExample(); LoadTestExample example = new LoadTestExample();
example.createCriteria() example.createCriteria()
.andTestResourcePoolIdEqualTo(testResourcePoolId); .andTestResourcePoolIdEqualTo(testResourcePoolId);
if (loadTestMapper.countByExample(example) > 0) { List<LoadTest> loadTests = loadTestMapper.selectByExample(example);
MSException.throwException(Translator.get("test_resource_pool_is_use")); StringBuilder loadTestNames = new StringBuilder();
if (loadTests.size() > 0) {
for (LoadTest loadTest : loadTests) {
loadTestNames = loadTestNames.append(loadTest.getName()).append(",");
}
String str = loadTestNames.substring(0, loadTestNames.length() - 1);
MSException.throwException(Translator.get("load_test") + " " + str + " " + Translator.get("test_resource_pool_is_use"));
} }
} }

View File

@ -546,7 +546,7 @@ public class TestCaseService {
for (TestCase testCase : testCases) { for (TestCase testCase : testCases) {
caseName = caseName.append(testCase.getName()).append(","); caseName = caseName.append(testCase.getName()).append(",");
} }
String str = caseName.toString().substring(0, caseName.length() - 1); String str = caseName.substring(0, caseName.length() - 1);
MSException.throwException(Translator.get("related_case_del_fail_prefix") + " " + str + " " + Translator.get("related_case_del_fail_suffix")); MSException.throwException(Translator.get("related_case_del_fail_prefix") + " " + str + " " + Translator.get("related_case_del_fail_suffix"));
} }
} }

View File

@ -57,7 +57,8 @@ workspace_not_exists=Workspace is not exists
test_resource_pool_id_is_null=Test Resource Pool ID cannot be null test_resource_pool_id_is_null=Test Resource Pool ID cannot be null
test_resource_pool_name_is_null=Test Resource Pool name cannot be null test_resource_pool_name_is_null=Test Resource Pool name cannot be null
test_resource_pool_name_already_exists=The test resource pool name already exists test_resource_pool_name_already_exists=The test resource pool name already exists
test_resource_pool_is_use=The test resource pool is in use and cannot be deleted load_test=Load Test
test_resource_pool_is_use=This resource pool is in use and cannot be deleted
#project #project
project_name_is_null=Project name cannot be null project_name_is_null=Project name cannot be null
project_name_already_exists=The project name already exists project_name_already_exists=The project name already exists

View File

@ -57,7 +57,8 @@ workspace_not_exists=工作空间不存在
test_resource_pool_id_is_null=资源池ID不能为空 test_resource_pool_id_is_null=资源池ID不能为空
test_resource_pool_name_is_null=资源池名称不能为空 test_resource_pool_name_is_null=资源池名称不能为空
test_resource_pool_name_already_exists=资源池名称已存在 test_resource_pool_name_already_exists=资源池名称已存在
test_resource_pool_is_use=资源池正在使用中,无法删除 load_test=性能测试
test_resource_pool_is_use=正在使用此资源池,无法删除
#project #project
project_name_is_null=项目名称不能为空 project_name_is_null=项目名称不能为空
project_name_already_exists=项目名称已存在 project_name_already_exists=项目名称已存在

View File

@ -57,7 +57,8 @@ workspace_not_exists=工作空間不存在
test_resource_pool_id_is_null=資源池ID不能為空 test_resource_pool_id_is_null=資源池ID不能為空
test_resource_pool_name_is_null=資源池名稱不能為空 test_resource_pool_name_is_null=資源池名稱不能為空
test_resource_pool_name_already_exists=資源池名稱已存在 test_resource_pool_name_already_exists=資源池名稱已存在
test_resource_pool_is_use=資源池正在使用中,無法刪除 load_test=性能測試
test_resource_pool_is_use=正在使用此資源池,無法刪除
#project #project
project_name_is_null=項目名稱不能為空 project_name_is_null=項目名稱不能為空
project_name_already_exists=項目名稱已存在 project_name_already_exists=項目名稱已存在

View File

@ -295,7 +295,6 @@ export default {
this.infoList = resources; this.infoList = resources;
}, },
del(row) { del(row) {
window.console.log(row);
this.$confirm(this.$t('test_resource_pool.delete_prompt'), this.$t('commons.prompt'), { this.$confirm(this.$t('test_resource_pool.delete_prompt'), this.$t('commons.prompt'), {
confirmButtonText: this.$t('commons.confirm'), confirmButtonText: this.$t('commons.confirm'),
cancelButtonText: this.$t('commons.cancel'), cancelButtonText: this.$t('commons.cancel'),

@ -1 +1 @@
Subproject commit f6f172c6451d0f9c51f5e3246a66dde9edcd7a5d Subproject commit b9091a47b197faef77c72b134b7cf604fe3209f0