From da8c05c7f4637e21e683187d197c6dbd13fb8063 Mon Sep 17 00:00:00 2001
From: caofengbin <1050430934@qq.com>
Date: Wed, 20 Dec 2023 15:05:20 +0800
Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E4=BE=8B=E6=94=AF=E6=8C=81=E6=8C=89?=
=?UTF-8?q?=E4=BD=9C=E8=80=85=E8=BF=9B=E8=A1=8C=E7=AD=9B=E9=80=89=E7=9A=84?=
=?UTF-8?q?=E6=93=8D=E4=BD=9C?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/TestCaseList.vue | 42 +++++++++++++++++++++++----------
1 file changed, 30 insertions(+), 12 deletions(-)
diff --git a/src/components/TestCaseList.vue b/src/components/TestCaseList.vue
index 22efb9c7..2a30d245 100644
--- a/src/components/TestCaseList.vue
+++ b/src/components/TestCaseList.vue
@@ -24,6 +24,7 @@ const caseId = ref(0);
const dialogVisible = ref(false);
const tableLoading = ref(false);
const moduleIds = ref([]);
+const caseAuthorNames = ref([]);
const getTestCaseList = (pageNum, pSize) => {
tableLoading.value = true;
pageSize.value = pSize || pageSize.value;
@@ -33,12 +34,12 @@ const getTestCaseList = (pageNum, pSize) => {
params: {
projectId: props.projectId,
moduleIds: moduleIds.value.length > 0 ? moduleIds.value : undefined,
+ caseAuthorNames: caseAuthorNames.value.length > 0 ? caseAuthorNames.value : undefined,
platform: props.platform,
name: name.value,
page: pageCurrNum.value,
pageSize: pageSize.value,
idSort: sortingType.value.idSort,
- designerSort: sortingType.value.designerSort,
editTimeSort: sortingType.value.editTimeSort,
},
})
@@ -120,6 +121,23 @@ const getModuleList = () => {
}
});
};
+const caseAuthorList = ref([]);
+const getCaseAuthorList = () => {
+ axios
+ .get('/controller/testCases/listAllCaseAuthor', {
+ params: {
+ projectId: props.projectId,
+ platform: props.platform,
+ }
+ })
+ .then((resp) => {
+ if (resp.code === 2000) {
+ resp.data.map((item) => {
+ caseAuthorList.value.push({ text: item, value: item });
+ });
+ }
+ });
+};
let sortingType = ref({});
const sequence = (column) => {
sortingType.value = {};
@@ -127,9 +145,6 @@ const sequence = (column) => {
if (column.prop === 'id') {
sortingType.value.idSort = 'asc';
}
- if (column.prop === 'designer') {
- sortingType.value.designerSort = 'asc';
- }
if (column.prop === 'editTime') {
sortingType.value.editTimeSort = 'asc';
}
@@ -137,9 +152,6 @@ const sequence = (column) => {
if (column.prop === 'id') {
sortingType.value.idSort = 'desc';
}
- if (column.prop === 'designer') {
- sortingType.value.designerSort = 'desc';
- }
if (column.prop === 'editTime') {
sortingType.value.editTimeSort = 'desc';
}
@@ -147,13 +159,20 @@ const sequence = (column) => {
// 判断排序方式
getTestCaseList();
};
-const filter = (e) => {
- moduleIds.value = e.moduleId;
+const filter = (filters) => {
+ for (let key in filters) {
+ if (key === 'moduleId') {
+ moduleIds.value = filters.moduleId;
+ } else if (key === 'caseAuthorName') {
+ caseAuthorNames.value = filters.caseAuthorName;
+ }
+ }
getTestCaseList();
};
onMounted(() => {
getTestCaseList();
getModuleList();
+ getCaseAuthorList();
});
defineExpose({ open });
@@ -234,11 +253,10 @@ defineExpose({ open });