diff --git a/test-track/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseMapper.xml b/test-track/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseMapper.xml
index d6fbd3690f..0dc2b7f0d4 100644
--- a/test-track/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseMapper.xml
+++ b/test-track/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseMapper.xml
@@ -230,6 +230,12 @@
#{nodeId}
+
+ and test_case.id not in (select distinct test_case_test.test_case_id from test_case_test)
+
+
+ and test_case.id in (select distinct test_case_test.test_case_id from test_case_test)
+
diff --git a/test-track/frontend/src/business/case/TestCase.vue b/test-track/frontend/src/business/case/TestCase.vue
index e6e56a90a6..645318d45e 100644
--- a/test-track/frontend/src/business/case/TestCase.vue
+++ b/test-track/frontend/src/business/case/TestCase.vue
@@ -26,7 +26,7 @@
-
+
{{showPublicNode? $t('project.case_public') : $t('commons.trash')}}
@@ -102,7 +102,7 @@
@refreshAll="refreshAll"
@setCondition="setCondition"
@decrease="decrease"
- @search="refreshTreeByCaseFilter"
+ @refreshTree="refreshTreeByCaseFilter"
ref="testCaseList">
@@ -151,7 +151,7 @@
@refresh="refreshTrashNode"
@refreshAll="refreshAll"
@setCondition="setTrashCondition"
- @search="refreshTreeByCaseFilter"
+ @refreshTree="refreshTreeByCaseFilter"
ref="testCaseTrashList">
@@ -520,13 +520,21 @@ export default {
}
});
},
+ backDefault() {
+ // 回到默认列表页
+ this.activeName = 'default';
+ this.trashEnable = false;
+ this.publicEnable = false;
+ },
enableTrash(data) {
+ // 进入回收站列表
this.trashEnable = !data;
this.$nextTick(() => {
this.trashEnable = data;
})
},
enablePublic(data) {
+ //进入公共用例列表
this.publicEnable = !data;
this.$nextTick(() => {
this.publicEnable = data;
diff --git a/test-track/frontend/src/business/case/components/TestCaseList.vue b/test-track/frontend/src/business/case/components/TestCaseList.vue
index 177d821f50..af73c7a888 100644
--- a/test-track/frontend/src/business/case/components/TestCaseList.vue
+++ b/test-track/frontend/src/business/case/components/TestCaseList.vue
@@ -271,14 +271,16 @@ import {TEST_CASE_LIST} from "metersphere-frontend/src/utils/constants";
import MsSingleTag from "metersphere-frontend/src/components/new-ui/MsSingleTag";
import {
buildBatchParam,
- getCustomFieldBatchEditOption, getCustomFieldFilter,
+ getCustomFieldBatchEditOption,
+ getCustomFieldFilter,
getCustomTableHeader,
getCustomTableWidth,
getLastTableSortField,
getPageInfo,
getSelectDataCounts,
getTableHeaderWithCustomFields,
- initCondition, parseCustomFilesForList,
+ initCondition,
+ parseCustomFilesForList,
} from "metersphere-frontend/src/utils/tableUtils";
import PlanStatusTableItem from "@/business/common/tableItems/plan/PlanStatusTableItem";
import {getCurrentProjectID, getCurrentWorkspaceId, setCurrentProjectID} from "metersphere-frontend/src/utils/token";
@@ -296,11 +298,15 @@ import {
editTestCaseOrder,
getTestCase,
getTestCaseStep,
- getTestCaseVersions, testCaseBatchCopy,
+ getTestCaseVersions,
+ testCaseBatchCopy,
testCaseBatchDelete,
- testCaseBatchDeleteToGc, testCaseBatchEdit, testCaseBatchRelateDemand,
+ testCaseBatchDeleteToGc,
+ testCaseBatchEdit,
+ testCaseBatchRelateDemand,
testCaseDelete,
- testCaseDeleteToGc, testCaseList,
+ testCaseDeleteToGc,
+ testCaseList,
testCaseReduction
} from "@/api/testCase";
import {getGraphByCondition} from "@/api/graph";
@@ -549,7 +555,6 @@ export default {
this.userFilter = data;
});
this.getTemplateField();
- this.$emit('setCondition', this.condition);
this.initTableData();
let redirectParam = this.$route.query.dataSelectRange;
this.checkRedirectEditPage(redirectParam);
@@ -837,6 +842,7 @@ export default {
if (this.projectId) {
this.condition.projectId = this.projectId;
this.$emit('setCondition', this.condition);
+ this.$emit('refreshTree', this.currentVersion);
this.loading = true;
testCaseList({pageNum: this.page.currentPage, pageSize: this.page.pageSize}, this.condition)
.then(response => {
@@ -861,7 +867,6 @@ export default {
// 添加搜索条件时,当前页设置成第一页
this.page.currentPage = 1;
this.initTableData();
- this.$emit('search');
},
callBackSelect(selection) {
this.selectCounts = this.$refs.table.selectDataCounts;
@@ -871,7 +876,7 @@ export default {
},
changeVersion(currentVersion) {
this.currentVersion = currentVersion || null;
- this.$emit('search',currentVersion);
+ this.search();
},
toggleAdvanceSearch() {
this.$refs.advanceSearch.toggle();
diff --git a/test-track/frontend/src/business/case/components/common/CaseFunctionalRelevance.vue b/test-track/frontend/src/business/case/components/common/CaseFunctionalRelevance.vue
index 2ca58f14d0..b85269560f 100644
--- a/test-track/frontend/src/business/case/components/common/CaseFunctionalRelevance.vue
+++ b/test-track/frontend/src/business/case/components/common/CaseFunctionalRelevance.vue
@@ -190,11 +190,11 @@ import StatusTableItem from "@/business/common/tableItems/planview/StatusTableIt
import ReviewStatus from "@/business/case/components/ReviewStatus";
import TestCaseReviewStatusTableItem from "@/business/common/tableItems/TestCaseReviewStatusTableItem";
import TestPlanCaseStatusTableItem from "@/business/common/tableItems/TestPlanCaseStatusTableItem";
-import { TEST_CASE_CONFIGS } from "metersphere-frontend/src/components/search/search-components";
+import {TEST_CASE_CONFIGS} from "metersphere-frontend/src/components/search/search-components";
import MxVersionSelect from "metersphere-frontend/src/components/version/MxVersionSelect";
-import { getProjectApplicationConfig } from "@/api/project-application";
-import { getVersionFilters } from "@/business/utils/sdk-utils";
-import { getTestTemplate } from "@/api/custom-field-template";
+import {getProjectApplicationConfig} from "@/api/project-application";
+import {getVersionFilters} from "@/business/utils/sdk-utils";
+import {getTestTemplate} from "@/api/custom-field-template";
import {getTagToolTips, initTestCaseConditionComponents, parseColumnTag} from "@/business/case/test-case";
export default {
@@ -340,9 +340,14 @@ export default {
}
condition.projectId = this.projectId;
if (this.projectId) {
+ // 加载树
+ this.refreshTreeByCaseFilter();
this.getTableData();
}
},
+ refreshTreeByCaseFilter() {
+ this.$refs.nodeTree.list();
+ },
saveCaseRelevance(item) {
this.isSaving = true;
let param = {};
diff --git a/test-track/frontend/src/business/case/components/public/PublicTestCaseList.vue b/test-track/frontend/src/business/case/components/public/PublicTestCaseList.vue
index 375ba14399..06a5753207 100644
--- a/test-track/frontend/src/business/case/components/public/PublicTestCaseList.vue
+++ b/test-track/frontend/src/business/case/components/public/PublicTestCaseList.vue
@@ -226,7 +226,7 @@ import {
} from "metersphere-frontend/src/utils/tableUtils";
import PlanStatusTableItem from "@/business/common/tableItems/plan/PlanStatusTableItem";
import {getCurrentProjectID, getCurrentUserId, getCurrentWorkspaceId} from "metersphere-frontend/src/utils/token";
-import {getUUID, parseTag} from "metersphere-frontend/src/utils"
+import {parseTag} from "metersphere-frontend/src/utils"
import {hasLicense} from "metersphere-frontend/src/utils/permission"
import MsTable from "metersphere-frontend/src/components/new-ui/MsTable";
import MsTableColumn from "metersphere-frontend/src/components/table/MsTableColumn";
@@ -237,9 +237,14 @@ import TestCaseReviewStatusTableItem from "@/business/common/tableItems/TestCase
import BatchMove from "@/business/case/components/BatchMove";
import TestCasePreview from "@/business/case/components/TestCasePreview";
import {
- deletePublicTestCaseVersion, editTestCaseOrder, getEditSimpleTestCase,
- getTestCaseStep, getTestCaseVersions, testCasePublicBatchCopy,
- testCasePublicBatchDeleteToGc, testCasePublicList,
+ deletePublicTestCaseVersion,
+ editTestCaseOrder,
+ getEditSimpleTestCase,
+ getTestCaseStep,
+ getTestCaseVersions,
+ testCasePublicBatchCopy,
+ testCasePublicBatchDeleteToGc,
+ testCasePublicList,
} from "@/api/testCase";
import ListItemDeleteConfirm from "metersphere-frontend/src/components/ListItemDeleteConfirm";
import {TEST_CASE_STATUS_MAP} from "@/business/constants/table-constants";
@@ -433,6 +438,7 @@ export default {
// 公共用例暂不支持所属项目过滤
// this.condition.projectId = this.projectId;
this.$emit('setCondition', this.condition);
+ this.$emit('refreshTree');
this.condition.casePublic = true;
this.condition.workspaceId = getCurrentWorkspaceId();
this.loading = true;
@@ -450,7 +456,6 @@ export default {
// 添加搜索条件时,当前页设置成第一页
this.page.currentPage = 1;
this.initTableData();
- this.$emit('search');
},
clearTableSelect() {
this.$refs.table.clear();
diff --git a/test-track/frontend/src/business/module/TestCaseNodeTree.vue b/test-track/frontend/src/business/module/TestCaseNodeTree.vue
index d608733461..80bb74b7da 100644
--- a/test-track/frontend/src/business/module/TestCaseNodeTree.vue
+++ b/test-track/frontend/src/business/module/TestCaseNodeTree.vue
@@ -50,7 +50,7 @@ import MsNodeTree from "metersphere-frontend/src/components/new-ui/MsNodeTree";
import TestCaseCreate from "@/business/case/components/TestCaseCreate";
import TestCaseImport from "@/business/case/components/import/TestCaseImport";
import MsSearchBar from "metersphere-frontend/src/components/new-ui/MsSearchBar";
-import {buildTree, buildNodePath} from "metersphere-frontend/src/model/NodeTree";
+import {buildNodePath, buildTree} from "metersphere-frontend/src/model/NodeTree";
import {getCurrentProjectID} from "metersphere-frontend/src/utils/token";
import ModuleTrashButton from "metersphere-frontend/src/components/ModuleTrashButton";
import {getTestCaseNodesByCaseFilter, getTestCaseNodesCountMap} from "@/api/testCase";
@@ -129,15 +129,6 @@ export default {
},
'condition.filterText'() {
this.filter();
- },
- caseCondition: {
- handler() {
- this.$nextTick(() => {
- this.list();
- });
- },
- deep: true,
- immediate: true
}
},
mounted() {