feat(缺陷管理): 关联文件

This commit is contained in:
RubyLiu 2024-02-07 11:38:47 +08:00 committed by Craftsman
parent 58d90c3739
commit 1e026eebc0
2 changed files with 8 additions and 6 deletions

View File

@ -192,6 +192,7 @@
import { TableQueryParams } from '@/models/common'; import { TableQueryParams } from '@/models/common';
import { convertToFileByBug } from '@/views/bug-management/utils'; import { convertToFileByBug } from '@/views/bug-management/utils';
import { convertToFile } from '@/views/case-management/caseManagementFeature/components/utils';
const { t } = useI18n(); const { t } = useI18n();
@ -268,9 +269,9 @@
async function deleteFileHandler(item: MsFileItem) { async function deleteFileHandler(item: MsFileItem) {
try { try {
const params = { const params = {
id: item.uid, refId: item.uid,
local: item.local, associated: !item.local,
bugId, bugId: bugId.value,
projectId: currentProjectId.value, projectId: currentProjectId.value,
}; };
await deleteFileOrCancelAssociation(params); await deleteFileOrCancelAssociation(params);
@ -337,7 +338,7 @@
// //
function saveSelectAssociatedFile(fileData: AssociatedList[]) { function saveSelectAssociatedFile(fileData: AssociatedList[]) {
const fileResultList = fileData.map((fileInfo) => convertToFileByBug(fileInfo)); const fileResultList = fileData.map((fileInfo) => convertToFile(fileInfo));
fileList.value.push(...fileResultList); fileList.value.push(...fileResultList);
} }

View File

@ -230,6 +230,7 @@
import { SelectValue } from '@/models/projectManagement/menuManagement'; import { SelectValue } from '@/models/projectManagement/menuManagement';
import { BugManagementRouteEnum } from '@/enums/routeEnum'; import { BugManagementRouteEnum } from '@/enums/routeEnum';
import { convertToFile } from '../case-management/caseManagementFeature/components/utils';
import { convertToFileByBug } from './utils'; import { convertToFileByBug } from './utils';
defineOptions({ name: 'BugEditPage' }); defineOptions({ name: 'BugEditPage' });
@ -488,7 +489,7 @@
// //
function saveSelectAssociatedFile(fileData: AssociatedList[]) { function saveSelectAssociatedFile(fileData: AssociatedList[]) {
const fileResultList = fileData.map((fileInfo) => convertToFileByBug(fileInfo)); const fileResultList = fileData.map((fileInfo) => convertToFile(fileInfo));
fileList.value.push(...fileResultList); fileList.value.push(...fileResultList);
} }
@ -588,7 +589,7 @@
return { return {
...fileInfo, ...fileInfo,
name: fileInfo.fileName, name: fileInfo.fileName,
isUpdateFlag: checkUpdateFileIds.includes(fileInfo.id), isUpdateFlag: checkUpdateFileIds.includes(fileInfo.fileId),
}; };
}) })
.map((fileInfo: any) => { .map((fileInfo: any) => {