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,36 +536,54 @@
// //
async function deleteFileHandler(item: MsFileItem) { async function deleteFileHandler(item: MsFileItem) {
openModal({ if (!item.local) {
type: 'error', try {
title: t('caseManagement.featureCase.deleteFile', { name: item?.name }), const params = {
content: t('caseManagement.featureCase.deleteFileTip'), id: item.uid,
okText: t('common.confirmDelete'), local: item.local,
cancelText: t('common.cancel'), caseId: detailForm.value.id,
okButtonProps: { projectId: currentProjectId.value,
status: 'danger', };
}, await deleteFileOrCancelAssociation(params);
onBeforeOk: async () => { Message.success(
try { item.local ? t('caseManagement.featureCase.deleteSuccess') : t('caseManagement.featureCase.cancelLinkSuccess')
const params = { );
id: item.uid, emit('updateSuccess');
local: item.local, } catch (error) {
caseId: detailForm.value.id, console.log(error);
projectId: currentProjectId.value, }
}; } else {
await deleteFileOrCancelAssociation(params); openModal({
Message.success( type: 'error',
item.local title: t('caseManagement.featureCase.deleteFile', { name: item?.name }),
? t('caseManagement.featureCase.deleteSuccess') content: t('caseManagement.featureCase.deleteFileTip'),
: t('caseManagement.featureCase.cancelLinkSuccess') okText: t('common.confirmDelete'),
); cancelText: t('common.cancel'),
emit('updateSuccess'); okButtonProps: {
} catch (error) { status: 'danger',
console.log(error); },
} onBeforeOk: async () => {
}, try {
hideCancel: false, 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);
}
},
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 = {