@@ -75,16 +75,16 @@
trigger="click"
@popup-visible-change="handleFilterHidden"
>
-
+
{{ t(columnConfig.title as string) }}
-
+
@@ -108,7 +108,7 @@
-
+
@@ -271,6 +271,7 @@
class?: string;
activeModule: string;
offspringIds: string[];
+ protocol: string; // 查看的协议类型
readOnly?: boolean; // 是否是只读模式
}>();
const emit = defineEmits<{
@@ -346,12 +347,6 @@
titleSlotName: 'statusFilter',
width: 130,
},
- {
- title: 'apiTestManagement.responsiblePerson',
- dataIndex: 'createUserName',
- showTooltip: true,
- width: 120,
- },
{
title: 'apiTestManagement.path',
slotName: 'path',
@@ -474,6 +469,7 @@
projectId: appStore.currentProjectId,
moduleIds: moduleIds.value,
env: checkedEnv.value,
+ protocol: props.protocol,
filter: { status: statusFilters.value, type: methodFilters.value },
};
setLoadListParams(params);
@@ -495,6 +491,13 @@
}
);
+ watch(
+ () => props.protocol,
+ () => {
+ loadApiList();
+ }
+ );
+
function handleFilterHidden(val: boolean) {
if (!val) {
loadApiList();
diff --git a/frontend/src/views/api-test/management/components/management/api/index.vue b/frontend/src/views/api-test/management/components/management/api/index.vue
index 000757e0cd..6258c43188 100644
--- a/frontend/src/views/api-test/management/components/management/api/index.vue
+++ b/frontend/src/views/api-test/management/components/management/api/index.vue
@@ -9,7 +9,12 @@
@@ -68,7 +73,7 @@
-
+
@@ -178,6 +183,7 @@
activeModule: string;
offspringIds: string[];
moduleTree: ModuleTreeNode[]; // 模块树
+ protocol: string;
}>();
const emit = defineEmits(['addDone']);
diff --git a/frontend/src/views/api-test/management/components/management/index.vue b/frontend/src/views/api-test/management/components/management/index.vue
index 75649d2450..c0c4c65d30 100644
--- a/frontend/src/views/api-test/management/components/management/index.vue
+++ b/frontend/src/views/api-test/management/components/management/index.vue
@@ -7,6 +7,7 @@
:active-module="props.activeModule"
:all-count="props.allCount"
:offspring-ids="props.offspringIds"
+ :protocol="protocol"
/>
@@ -26,6 +27,7 @@
allCount: number;
activeModule: string;
offspringIds: string[];
+ protocol: string;
moduleTree: ModuleTreeNode[]; // 模块树
}>();
diff --git a/frontend/src/views/api-test/management/components/moduleTree.vue b/frontend/src/views/api-test/management/components/moduleTree.vue
index b0f6a42174..710c1a45c7 100644
--- a/frontend/src/views/api-test/management/components/moduleTree.vue
+++ b/frontend/src/views/api-test/management/components/moduleTree.vue
@@ -51,7 +51,13 @@
{{ t('apiTestManagement.addSubModule') }}
-
+
@@ -105,6 +111,7 @@
mode="add"
:all-names="(nodeData.children || []).map((e: ModuleTreeNode) => e.name || '')"
:parent-id="nodeData.id"
+ :add-module-api="addModule"
@close="resetFocusNodeKey"
@add-finish="() => initModules()"
>
@@ -119,6 +126,8 @@
:node-id="nodeData.id"
:field-config="{ field: renameFolderTitle }"
:all-names="(nodeData.children || []).map((e: ModuleTreeNode) => e.name || '')"
+ :update-module-api="updateModule"
+ :update-api-node-api="updateModule"
@close="resetFocusNodeKey"
@rename-finish="initModules"
>
@@ -144,11 +153,13 @@
import { getProtocolList } from '@/api/modules/api-test/common';
import {
+ addModule,
deleteModule,
getModuleCount,
getModuleTree,
getModuleTreeOnlyModules,
moveModule,
+ updateModule,
} from '@/api/modules/api-test/management';
import { useI18n } from '@/hooks/useI18n';
import useModal from '@/hooks/useModal';
@@ -168,7 +179,7 @@
activeModule: 'all',
}
);
- const emit = defineEmits(['init', 'newApi', 'import', 'folderNodeSelect', 'clickApiNode']);
+ const emit = defineEmits(['init', 'newApi', 'import', 'folderNodeSelect', 'clickApiNode', 'changeProtocol']);
const appStore = useAppStore();
const { t } = useI18n();
@@ -345,7 +356,7 @@
if (isSetDefaultKey) {
selectedKeys.value = [folderTree.value[0].id];
}
- emit('init', folderTree.value);
+ emit('init', folderTree.value, moduleProtocol.value);
} catch (error) {
// eslint-disable-next-line no-console
console.log(error);
@@ -377,6 +388,7 @@
}
async function handleProtocolChange() {
+ emit('changeProtocol', moduleProtocol.value);
await initModules();
initModuleCount();
}
diff --git a/frontend/src/views/api-test/management/index.vue b/frontend/src/views/api-test/management/index.vue
index f361d5ad5d..b0b5920d94 100644
--- a/frontend/src/views/api-test/management/index.vue
+++ b/frontend/src/views/api-test/management/index.vue
@@ -5,11 +5,12 @@
(folderTree = val)"
+ @init="handleModuleInit"
@new-api="newApi"
@import="importDrawerVisible = true"
@folder-node-select="handleNodeSelect"
@click-api-node="handleApiNodeClick"
+ @change-protocol="handleProtocolChange"
/>