fix(接口管理):修复接口定义回收站不显示数据问题

--bug=1038414 --user=郭雨琦 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001038414
This commit is contained in:
guoyuqi 2024-04-08 10:04:24 +08:00 committed by 刘瑞斌
parent 0a548d6865
commit 693a2f9fef
3 changed files with 19 additions and 11 deletions

View File

@ -144,7 +144,6 @@
getDefinitionPage,
recoverDefinition,
} from '@/api/modules/api-test/management';
import { getProjectOptions } from '@/api/modules/project-management/projectMember';
import { useI18n } from '@/hooks/useI18n';
import useModal from '@/hooks/useModal';
import useTableStore from '@/hooks/useTableStore';
@ -161,6 +160,7 @@
offspringIds: string[];
protocol: string; //
readOnly?: boolean; //
memberOptions: { label: string; value: string }[];
}>();
const appStore = useAppStore();
@ -290,7 +290,6 @@
const statusFilters = ref<string[]>([]);
const deleteUserFilterVisible = ref(false);
const deleteUserFilters = ref<string[]>([]);
const memberOptions = ref<{ label: string; value: string }[]>([]);
const moduleIds = computed(() => {
if (props.activeModule === 'all') {
return [];
@ -299,10 +298,7 @@
});
const tableQueryParams = ref<any>();
async function loadApiList() {
memberOptions.value = await getProjectOptions(appStore.currentProjectId, keyword.value);
memberOptions.value = memberOptions.value.map((e: any) => ({ label: e.name, value: e.id }));
function loadApiList() {
const params = {
keyword: keyword.value,
projectId: appStore.currentProjectId,

View File

@ -230,12 +230,10 @@
recoverCase,
} from '@/api/modules/api-test/management';
import { getCaseDefaultFields } from '@/api/modules/case-management/featureCase';
import { getProjectOptions } from '@/api/modules/project-management/projectMember';
import { useI18n } from '@/hooks/useI18n';
import useModal from '@/hooks/useModal';
import useTableStore from '@/hooks/useTableStore';
import useAppStore from '@/store/modules/app';
import { hasAnyPermission } from '@/utils/permission';
import { ApiCaseBatchParams, ApiCaseDetail } from '@/models/apiTest/management';
import { RequestDefinitionStatus } from '@/enums/apiEnum';
@ -246,6 +244,7 @@
activeModule: string;
offspringIds: string[];
protocol: string; //
memberOptions: { label: string; value: string }[];
}>();
const appStore = useAppStore();
@ -458,15 +457,12 @@
const updateUserFilters = ref<string[]>([]);
const deleteUserFilterVisible = ref(false);
const deleteUserFilters = ref<string[]>([]);
const memberOptions = ref<{ label: string; value: string }[]>([]);
const moduleIds = computed(() => {
return props.activeModule === 'all' ? [] : [props.activeModule];
});
async function loadCaseList() {
memberOptions.value = await getProjectOptions(appStore.currentProjectId, keyword.value);
memberOptions.value = memberOptions.value.map((e: any) => ({ label: e.name, value: e.id }));
const params = {
keyword: keyword.value,
projectId: appStore.currentProjectId,

View File

@ -24,6 +24,7 @@
<api
v-show="currentTab === 'api'"
ref="apiRef"
:member-options="memberOptions"
:module-tree="props.moduleTree"
:active-module="props.activeModule"
:offspring-ids="props.offspringIds"
@ -31,6 +32,7 @@
/>
<api-case
v-show="currentTab === 'case'"
:member-options="memberOptions"
:active-module="props.activeModule"
:offspring-ids="props.offspringIds"
:protocol="protocol"
@ -44,7 +46,9 @@
import apiMethodName from '@/views/api-test/components/apiMethodName.vue';
import { RequestParam } from '@/views/api-test/components/requestComposition/index.vue';
import { getProjectOptions } from '@/api/modules/project-management/projectMember';
import { useI18n } from '@/hooks/useI18n';
import useAppStore from '@/store/modules/app';
import { ModuleTreeNode } from '@/models/common';
@ -56,6 +60,7 @@
}>();
const { t } = useI18n();
const appStore = useAppStore();
const currentTab = ref('api');
const tabOptions = [
@ -72,10 +77,21 @@
]);
const activeApiTab = ref<RequestParam>(apiTabs.value[0] as RequestParam);
const memberOptions = ref<{ label: string; value: string }[]>([]);
async function initMemberOptions() {
memberOptions.value = await getProjectOptions(appStore.currentProjectId);
memberOptions.value = memberOptions.value.map((e: any) => ({ label: e.name, value: e.id }));
}
//
function currentTabChange(val: any) {
apiTabs.value[0].label = val === 'api' ? t('apiTestManagement.allApi') : t('case.allCase');
}
onBeforeMount(() => {
initMemberOptions();
});
</script>
<style lang="less" scoped>