fix(用例管理): 用例关联文件列表未排除已关联数据

--bug=1035885 --user=王旭 【用例管理】功能用例-用例详情-关联文件-关联文件后选择关联文件处不应该继续显示该文件 https://www.tapd.cn/55049933/s/1482006
This commit is contained in:
WangXu10 2024-03-27 16:21:30 +08:00 committed by 刘瑞斌
parent fad9c92b20
commit 79543f69e6
1 changed files with 57 additions and 30 deletions

View File

@ -536,6 +536,23 @@
// //
async function deleteFileHandler(item: MsFileItem) { async function deleteFileHandler(item: MsFileItem) {
if (!item.local) {
try {
const params = {
id: item.uid,
local: item.local,
caseId: detailForm.value.id,
projectId: currentProjectId.value,
};
await deleteFileOrCancelAssociation(params);
Message.success(
item.local ? t('caseManagement.featureCase.deleteSuccess') : t('caseManagement.featureCase.cancelLinkSuccess')
);
emit('updateSuccess');
} catch (error) {
console.log(error);
}
} else {
openModal({ openModal({
type: 'error', type: 'error',
title: t('caseManagement.featureCase.deleteFile', { name: item?.name }), title: t('caseManagement.featureCase.deleteFile', { name: item?.name }),
@ -567,6 +584,7 @@
hideCancel: false, hideCancel: false,
}); });
} }
}
const transferVisible = ref<boolean>(false); const transferVisible = ref<boolean>(false);
// //
@ -662,6 +680,15 @@
} }
); );
//
watch(
() => fileList.value,
(arr) => {
getListFunParams.value.combine.hiddenIds = arr.filter((item) => !item.local).map((item) => item.uid);
},
{ deep: true, immediate: true }
);
async function startUpload(fileIds?: string[]) { async function startUpload(fileIds?: string[]) {
try { try {
const params = { const params = {