feat(项目管理): 文件管理关联资源列表增加场景步骤的资源类型

This commit is contained in:
Jianguo-Genius 2024-04-12 11:39:57 +08:00 committed by Craftsman
parent a42b9d9cbb
commit 5a57446616
4 changed files with 43 additions and 13 deletions

View File

@ -7,6 +7,7 @@ export const associateFileSourceLocaleMap = {
API_TEST_CASE: 'project.fileManagement.caseTypeApiCase', API_TEST_CASE: 'project.fileManagement.caseTypeApiCase',
API_DEFINITION: 'project.fileManagement.caseTypeApiDefine', API_DEFINITION: 'project.fileManagement.caseTypeApiDefine',
API_DEFINITION_MOCK: 'project.fileManagement.caseTypeApiMock', API_DEFINITION_MOCK: 'project.fileManagement.caseTypeApiMock',
API_SCENARIO_STEP: 'project.fileManagement.scenarioStep',
}; };
export default {}; export default {};

View File

@ -154,12 +154,12 @@
</div> </div>
<div class="file-relation"> <div class="file-relation">
<a-tabs v-model:active-key="activeTab" :disabled="loading" class="no-content" @change="() => loadTable()"> <a-tabs v-model:active-key="activeTab" :disabled="loading" class="no-content" @change="() => loadTable()">
<a-tab-pane key="case" :title="t('project.fileManagement.cases')" /> <a-tab-pane key="case" :title="t('project.fileManagement.resource')" />
<a-tab-pane key="version" :title="t('project.fileManagement.versionHistory')" /> <a-tab-pane key="version" :title="t('project.fileManagement.versionHistory')" />
</a-tabs> </a-tabs>
<div class="h-[16px] bg-[var(--color-text-n9)]"></div> <div class="h-[16px] bg-[var(--color-text-n9)]"></div>
<div v-if="activeTab === 'case'" class="flex items-center justify-between px-[16px] pt-[16px]"> <div v-if="activeTab === 'case'" class="flex items-center justify-between px-[16px] pt-[16px]">
<div class="text-[var(--color-text-1)]">{{ t('project.fileManagement.caseList') }}</div> <div class="text-[var(--color-text-1)]">{{ t('project.fileManagement.resourceList') }}</div>
<a-input-search <a-input-search
v-model:model-value="keyword" v-model:model-value="keyword"
:placeholder="t('project.fileManagement.search')" :placeholder="t('project.fileManagement.search')"
@ -180,7 +180,7 @@
> >
<template #id="{ record }"> <template #id="{ record }">
<a-tooltip :content="`${record.sourceNum}`"> <a-tooltip :content="`${record.sourceNum}`">
<a-button type="text" class="px-0" @click="goCaseDetail(record.sourceId)"> <a-button type="text" class="px-0" @click="goCaseDetail(record.redirectId, record.sourceType)">
<div class="one-line-text max-w-[168px]">{{ record.sourceNum }}</div> <div class="one-line-text max-w-[168px]">{{ record.sourceNum }}</div>
</a-button> </a-button>
</a-tooltip> </a-tooltip>
@ -253,7 +253,7 @@
import { hasAnyPermission } from '@/utils/permission'; import { hasAnyPermission } from '@/utils/permission';
import { AssociationItem, FileDetail } from '@/models/projectManagement/file'; import { AssociationItem, FileDetail } from '@/models/projectManagement/file';
import { CaseManagementRouteEnum } from '@/enums/routeEnum'; import { ApiTestRouteEnum, BugManagementRouteEnum, CaseManagementRouteEnum } from '@/enums/routeEnum';
import { UploadAcceptEnum } from '@/enums/uploadEnum'; import { UploadAcceptEnum } from '@/enums/uploadEnum';
const props = defineProps<{ const props = defineProps<{
@ -408,7 +408,7 @@
title: 'project.fileManagement.caseId', title: 'project.fileManagement.caseId',
dataIndex: 'sourceId', dataIndex: 'sourceId',
slotName: 'id', slotName: 'id',
showTooltip: true, showTooltip: false,
width: 150, width: 150,
}, },
{ {
@ -479,12 +479,35 @@
} }
} }
function goCaseDetail(id: string) { function goCaseDetail(id: string, type: string) {
let routerName = '';
const routeQuery = ref<{
id?: string;
dId?: string;
cId?: string;
}>();
routeQuery.value = { id };
if (type === 'FUNCTIONAL_CASE') {
routerName = CaseManagementRouteEnum.CASE_MANAGEMENT_CASE_DETAIL;
} else if (type === 'BUG') {
routerName = BugManagementRouteEnum.BUG_MANAGEMENT;
} else if (type === 'API_DEBUG') {
routerName = ApiTestRouteEnum.API_TEST;
} else if (type === 'API_SCENARIO') {
routerName = ApiTestRouteEnum.API_TEST_SCENARIO;
} else if (type === 'API_SCENARIO_STEP') {
routerName = ApiTestRouteEnum.API_TEST_SCENARIO;
} else if (type === 'API_DEFINITION') {
routerName = ApiTestRouteEnum.API_TEST_MANAGEMENT;
routeQuery.value = { dId: id };
} else if (type === 'API_TEST_CASE') {
routerName = ApiTestRouteEnum.API_TEST_MANAGEMENT;
routeQuery.value = { cId: id };
}
router.push({ router.push({
name: CaseManagementRouteEnum.CASE_MANAGEMENT_CASE_DETAIL, name: routerName,
query: { query: routeQuery.value,
id,
},
}); });
} }

View File

@ -107,6 +107,7 @@ export default {
'project.fileManagement.gitPath': 'Git path', 'project.fileManagement.gitPath': 'Git path',
'project.fileManagement.gitVersion': 'Git version', 'project.fileManagement.gitVersion': 'Git version',
'project.fileManagement.cases': 'Related Use Cases', 'project.fileManagement.cases': 'Related Use Cases',
'project.fileManagement.resource': 'Related resource',
'project.fileManagement.versionHistory': 'Version history', 'project.fileManagement.versionHistory': 'Version history',
'project.fileManagement.updateCaseFile': 'Update use case file', 'project.fileManagement.updateCaseFile': 'Update use case file',
'project.fileManagement.updateCaseFileSuccess': 'Use case file updated successfully', 'project.fileManagement.updateCaseFileSuccess': 'Use case file updated successfully',
@ -116,6 +117,7 @@ export default {
'project.fileManagement.operator': 'Operator', 'project.fileManagement.operator': 'Operator',
'project.fileManagement.operatorTime': 'Operating time', 'project.fileManagement.operatorTime': 'Operating time',
'project.fileManagement.caseList': 'Use case list', 'project.fileManagement.caseList': 'Use case list',
'project.fileManagement.resourceList': 'Resource list',
'project.fileManagement.search': 'Enter name to search', 'project.fileManagement.search': 'Enter name to search',
'project.fileManagement.storagePlaceholder': 'Please select a repository', 'project.fileManagement.storagePlaceholder': 'Please select a repository',
'project.fileManagement.storageNotNull': 'Repository cannot be empty', 'project.fileManagement.storageNotNull': 'Repository cannot be empty',
@ -143,4 +145,5 @@ export default {
'project.fileManagement.caseTypeApiCase': 'Api case', 'project.fileManagement.caseTypeApiCase': 'Api case',
'project.fileManagement.caseTypeApiDefine': 'Api definition', 'project.fileManagement.caseTypeApiDefine': 'Api definition',
'project.fileManagement.caseTypeApiMock': 'Api Mock', 'project.fileManagement.caseTypeApiMock': 'Api Mock',
'project.fileManagement.scenarioStep': 'Scenario step',
}; };

View File

@ -99,6 +99,7 @@ export default {
'project.fileManagement.gitPath': 'git 路径', 'project.fileManagement.gitPath': 'git 路径',
'project.fileManagement.gitVersion': 'git 版本', 'project.fileManagement.gitVersion': 'git 版本',
'project.fileManagement.cases': '关联用例', 'project.fileManagement.cases': '关联用例',
'project.fileManagement.resource': '关联资源',
'project.fileManagement.versionHistory': '版本历史', 'project.fileManagement.versionHistory': '版本历史',
'project.fileManagement.updateCaseFile': '更新用例文件', 'project.fileManagement.updateCaseFile': '更新用例文件',
'project.fileManagement.updateCaseFileSuccess': '用例文件更新成功', 'project.fileManagement.updateCaseFileSuccess': '用例文件更新成功',
@ -108,6 +109,7 @@ export default {
'project.fileManagement.operator': '操作人', 'project.fileManagement.operator': '操作人',
'project.fileManagement.operatorTime': '操作时间', 'project.fileManagement.operatorTime': '操作时间',
'project.fileManagement.caseList': '用例列表', 'project.fileManagement.caseList': '用例列表',
'project.fileManagement.resourceList': '资源列表',
'project.fileManagement.search': '输入名称搜索', 'project.fileManagement.search': '输入名称搜索',
'project.fileManagement.storagePlaceholder': '请选择存储库', 'project.fileManagement.storagePlaceholder': '请选择存储库',
'project.fileManagement.storageNotNull': '存储库不能为空', 'project.fileManagement.storageNotNull': '存储库不能为空',
@ -124,9 +126,9 @@ export default {
'project.fileManagement.batchMoveConfirm': '移动至所选模块', 'project.fileManagement.batchMoveConfirm': '移动至所选模块',
'project.fileManagement.batchMoveSuccess': '文件移动成功', 'project.fileManagement.batchMoveSuccess': '文件移动成功',
'project.fileManagement.moduleMoveSuccess': '模块移动成功', 'project.fileManagement.moduleMoveSuccess': '模块移动成功',
'project.fileManagement.caseId': '用例 ID', 'project.fileManagement.caseId': '资源 ID',
'project.fileManagement.caseName': '用例名称', 'project.fileManagement.caseName': '资源名称',
'project.fileManagement.caseType': '用例类型', 'project.fileManagement.caseType': '资源类型',
'project.fileManagement.caseFileVersion': '关联的文件版本', 'project.fileManagement.caseFileVersion': '关联的文件版本',
'project.fileManagement.caseTypeBug': '缺陷', 'project.fileManagement.caseTypeBug': '缺陷',
'project.fileManagement.caseTypeFeature': '功能用例', 'project.fileManagement.caseTypeFeature': '功能用例',
@ -135,4 +137,5 @@ export default {
'project.fileManagement.caseTypeApiCase': '接口用例', 'project.fileManagement.caseTypeApiCase': '接口用例',
'project.fileManagement.caseTypeApiDefine': '接口定义', 'project.fileManagement.caseTypeApiDefine': '接口定义',
'project.fileManagement.caseTypeApiMock': '接口 Mock', 'project.fileManagement.caseTypeApiMock': '接口 Mock',
'project.fileManagement.scenarioStep': '场景步骤',
}; };