diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanLoadCaseMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanLoadCaseMapper.xml
index b81d1c0aee..523b0446fa 100644
--- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanLoadCaseMapper.xml
+++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanLoadCaseMapper.xml
@@ -70,7 +70,12 @@
order by
- tplc.${order.name} ${order.type}
+
+ lt.${order.name} ${order.type}
+
+
+ tplc.${order.name} ${order.type}
+
@@ -145,4 +150,4 @@
-
\ No newline at end of file
+
diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanScenarioCaseMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanScenarioCaseMapper.xml
index beb2bdf02b..652d2fb42f 100644
--- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanScenarioCaseMapper.xml
+++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanScenarioCaseMapper.xml
@@ -60,20 +60,8 @@
#{nodeId}
-
-
-
-
-
- and c.priority in
-
- #{value}
-
-
-
-
-
-
+
+
order by
@@ -133,20 +121,7 @@
#{nodeId}
-
-
-
-
-
- and c.priority in
-
- #{value}
-
-
-
-
-
-
+
order by
@@ -162,6 +137,23 @@
+
+
+
+
+
+
+ and c.level in
+
+ #{value}
+
+
+
+
+
+
+
+
-
\ No newline at end of file
+
diff --git a/frontend/src/business/components/api/automation/scenario/ApiScenarioList.vue b/frontend/src/business/components/api/automation/scenario/ApiScenarioList.vue
index 2fdaa83c93..e6e2e60f96 100644
--- a/frontend/src/business/components/api/automation/scenario/ApiScenarioList.vue
+++ b/frontend/src/business/components/api/automation/scenario/ApiScenarioList.vue
@@ -1,10 +1,8 @@
-
-
@@ -73,7 +71,7 @@
@@ -113,7 +111,7 @@
show-overflow-tooltip :key="index"/>
@@ -219,6 +217,7 @@ import {
import {Api_Scenario_List} from "@/business/components/common/model/JsonData";
import HeaderCustom from "@/business/components/common/head/HeaderCustom";
import HeaderLabelOperate from "@/business/components/common/head/HeaderLabelOperate";
+import {API_SCENARIO_FILTERS} from "@/common/js/table-constants";
export default {
name: "MsApiScenarioList",
@@ -348,6 +347,7 @@ export default {
isSelectAllDate: false,
selectRows: new Set(),
selectDataCounts: 0,
+ ...API_SCENARIO_FILTERS,
typeArr: [
{id: 'level', name: this.$t('test_track.case.priority')},
{id: 'status', name: this.$t('test_track.plan.plan_status')},
@@ -359,22 +359,6 @@ export default {
// {id: 'environmentId', name: this.$t('api_test.definition.request.run_env'), optionMethod: this.getEnvsOptions},
{id: 'projectEnv', name: this.$t('api_test.definition.request.run_env')},
],
- statusFilters: [
- {text: this.$t('test_track.plan.plan_status_prepare'), value: 'Prepare'},
- {text: this.$t('test_track.plan.plan_status_running'), value: 'Underway'},
- {text: this.$t('test_track.plan.plan_status_completed'), value: 'Completed'},
- {text: this.$t('test_track.plan.plan_status_trash'), value: 'Trash'},
- ],
- levelFilters: [
- {text: 'P0', value: 'P0'},
- {text: 'P1', value: 'P1'},
- {text: 'P2', value: 'P2'},
- {text: 'P3', value: 'P3'}
- ],
- resultFilters: [
- {text: 'Fail', value: 'Fail'},
- {text: 'Success', value: 'Success'}
- ],
valueArr: {
level: [
{name: 'P0', id: 'P0'},
diff --git a/frontend/src/business/components/track/plan/view/comonents/api/RelevanceScenarioList.vue b/frontend/src/business/components/track/plan/view/comonents/api/RelevanceScenarioList.vue
index f54747f5cb..fbe1616f55 100644
--- a/frontend/src/business/components/track/plan/view/comonents/api/RelevanceScenarioList.vue
+++ b/frontend/src/business/components/track/plan/view/comonents/api/RelevanceScenarioList.vue
@@ -27,10 +27,7 @@
-
-
-
-
+
@@ -74,10 +71,12 @@
import TestPlanScenarioListHeader from "./TestPlanScenarioListHeader";
import {_handleSelect, _handleSelectAll} from "../../../../../../../common/js/tableUtils";
import EnvPopover from "@/business/components/track/common/EnvPopover";
+ import PriorityTableItem from "@/business/components/track/common/tableItems/planview/PriorityTableItem";
export default {
name: "RelevanceScenarioList",
components: {
+ PriorityTableItem,
EnvPopover,
TestPlanScenarioListHeader,
MsTablePagination, MsTableMoreBtn, ShowMoreBtn, MsTableHeader, MsTag, MsApiReportDetail, MsTestPlanList},
diff --git a/frontend/src/business/components/track/plan/view/comonents/api/TestPlanApiScenarioList.vue b/frontend/src/business/components/track/plan/view/comonents/api/TestPlanApiScenarioList.vue
index 3897c672a2..d76b4dafb9 100644
--- a/frontend/src/business/components/track/plan/view/comonents/api/TestPlanApiScenarioList.vue
+++ b/frontend/src/business/components/track/plan/view/comonents/api/TestPlanApiScenarioList.vue
@@ -10,6 +10,8 @@
@@ -26,6 +28,7 @@
-
-
-
-
+
@@ -51,7 +54,10 @@
-
{{ scope.row.updateTime | timestampFormatDate }}
@@ -60,6 +66,7 @@
@@ -114,7 +121,7 @@ import MsTableHeader from "@/business/components/common/components/MsTableHeader
import MsTablePagination from "@/business/components/common/pagination/TablePagination";
import ShowMoreBtn from "@/business/components/track/case/components/ShowMoreBtn";
import MsTag from "../../../../../common/components/MsTag";
-import {getCurrentProjectID, getUUID, strMapToObj} from "@/common/js/utils";
+import {getUUID, strMapToObj} from "@/common/js/utils";
import MsApiReportDetail from "../../../../../api/automation/report/ApiReportDetail";
import MsTableMoreBtn from "../../../../../api/automation/scenario/TableMoreBtn";
import MsScenarioExtendButtons from "@/business/components/api/automation/scenario/ScenarioExtendBtns";
@@ -141,10 +148,13 @@ import HeaderLabelOperate from "@/business/components/common/head/HeaderLabelOpe
import BatchEdit from "@/business/components/track/case/components/BatchEdit";
import MsPlanRunMode from "../../../common/PlanRunMode";
import MsTableHeaderSelectPopover from "@/business/components/common/components/table/MsTableHeaderSelectPopover";
+import PriorityTableItem from "@/business/components/track/common/tableItems/planview/PriorityTableItem";
+import {API_SCENARIO_FILTERS} from "@/common/js/table-constants";
export default {
name: "MsTestPlanApiScenarioList",
components: {
+ PriorityTableItem,
HeaderLabelOperate,
HeaderCustom,
MsTableOperatorButton,
@@ -192,6 +202,7 @@ export default {
infoDb: false,
runVisible: false,
runData: [],
+ ...API_SCENARIO_FILTERS,
buttons: [
{
name: this.$t('test_track.case.batch_unlink'), handleClick: this.handleDeleteBatch
@@ -368,6 +379,18 @@ export default {
this.infoDb = true;
this.reportId = row.reportId;
},
+ sort(column) {
+ // 每次只对一个字段排序
+ if (this.condition.orders) {
+ this.condition.orders = [];
+ }
+ _sort(column, this.condition);
+ this.search();
+ },
+ filter(filters) {
+ _filter(filters, this.condition);
+ this.search();
+ },
remove(row) {
if (this.planId) {
this.$get('/test/plan/scenario/case/delete/' + row.id, () => {
diff --git a/frontend/src/business/components/track/plan/view/comonents/load/TestPlanLoadCaseList.vue b/frontend/src/business/components/track/plan/view/comonents/load/TestPlanLoadCaseList.vue
index 35795aafbb..147775a8bf 100644
--- a/frontend/src/business/components/track/plan/view/comonents/load/TestPlanLoadCaseList.vue
+++ b/frontend/src/business/components/track/plan/view/comonents/load/TestPlanLoadCaseList.vue
@@ -29,7 +29,7 @@
-
+
-
-
-
-
+
@@ -58,10 +55,11 @@ import {_handleSelect, _handleSelectAll} from "@/common/js/tableUtils";
import MsTag from "@/business/components/common/components/MsTag";
import EnvPopover from "@/business/components/track/common/EnvPopover";
import MsTablePagination from "@/business/components/common/pagination/TablePagination";
+import PriorityTableItem from "@/business/components/track/common/tableItems/planview/PriorityTableItem";
export default {
name: "ReviewRelevanceScenarioList",
- components: {MsTablePagination, EnvPopover, MsTag},
+ components: {PriorityTableItem, MsTablePagination, EnvPopover, MsTag},
props: {
referenced: {
type: Boolean,
diff --git a/frontend/src/common/js/table-constants.js b/frontend/src/common/js/table-constants.js
index 6e4cbaa046..c8d71714f4 100644
--- a/frontend/src/common/js/table-constants.js
+++ b/frontend/src/common/js/table-constants.js
@@ -1,4 +1,6 @@
// 模板
+import i18n from "@/i18n/i18n";
+
export const CUSTOM_FIELD_TYPE_OPTION = [
{value: 'input',text: '输入框'},
{value: 'textarea',text: '文本框'},
@@ -69,6 +71,25 @@ export const ISSUE_STATUS_MAP = {
'delete': '已删除'
}
+export const API_SCENARIO_FILTERS = {
+ LEVEL_FILTERS: [
+ {text: 'P0', value: 'P0'},
+ {text: 'P1', value: 'P1'},
+ {text: 'P2', value: 'P2'},
+ {text: 'P3', value: 'P3'}
+ ],
+ RESULT_FILTERS: [
+ {text: 'Fail', value: 'Fail'},
+ {text: 'Success', value: 'Success'}
+ ],
+ STATUS_FILTERS: [
+ {text: i18n.t('test_track.plan.plan_status_prepare'), value: 'Prepare'},
+ {text: i18n.t('test_track.plan.plan_status_running'), value: 'Underway'},
+ {text: i18n.t('test_track.plan.plan_status_completed'), value: 'Completed'},
+ {text: i18n.t('test_track.plan.plan_status_trash'), value: 'Trash'},
+ ],
+}
+
export const USER_GROUP_SCOPE = {
// todo i18n
'SYSTEM': '系统',