fix(缺陷管理): 修复缺陷管理创建和编辑时的交互,以及文件转存的正确报错提示

--bug=1036434 --user=宋天阳 【缺陷管理】创建缺陷,上传文件,多次转存文件,转存报错 https://www.tapd.cn/55049933/s/1471781
This commit is contained in:
song-tianyang 2024-03-08 11:35:27 +08:00 committed by 刘瑞斌
parent 23c9430bf1
commit 45929cd675
2 changed files with 8 additions and 1 deletions

View File

@ -221,6 +221,8 @@ public class BugAttachmentService {
fileId = fileAssociationService.transferAndAssociation(association); fileId = fileAssociationService.transferAndAssociation(association);
// 删除本地上传的附件 // 删除本地上传的附件
deleteLocalFile(request.getBugId(), null, request.getProjectId(), null, attachment.getId(), null); deleteLocalFile(request.getBugId(), null, request.getProjectId(), null, attachment.getId(), null);
} catch (MSException e) {
throw e;
} catch (Exception e) { } catch (Exception e) {
throw new MSException(Translator.get("file.transfer.failed")); throw new MSException(Translator.get("file.transfer.failed"));
} }

View File

@ -194,6 +194,7 @@
} from '@/api/modules/bug-management'; } from '@/api/modules/bug-management';
import { getModules, getModulesCount } from '@/api/modules/project-management/fileManagement'; import { getModules, getModulesCount } from '@/api/modules/project-management/fileManagement';
import { useI18n } from '@/hooks/useI18n'; import { useI18n } from '@/hooks/useI18n';
import useLeaveUnSaveTip from '@/hooks/useLeaveUnSaveTip';
import useVisit from '@/hooks/useVisit'; import useVisit from '@/hooks/useVisit';
import router from '@/router'; import router from '@/router';
import { useAppStore } from '@/store'; import { useAppStore } from '@/store';
@ -215,9 +216,10 @@
import { convertToFileByBug } from './utils'; import { convertToFileByBug } from './utils';
defineOptions({ name: 'BugEditPage' }); defineOptions({ name: 'BugEditPage' });
const { setState } = useLeaveUnSaveTip();
setState(false);
const { t } = useI18n(); const { t } = useI18n();
interface TemplateOption { interface TemplateOption {
label: string; label: string;
value: string; value: string;
@ -494,6 +496,7 @@
// //
const res = await createOrUpdateBug({ request: tmpObj, fileList: localFiles as unknown as File[] }); const res = await createOrUpdateBug({ request: tmpObj, fileList: localFiles as unknown as File[] });
if (isEdit.value) { if (isEdit.value) {
setState(true);
Message.success(t('common.updateSuccess')); Message.success(t('common.updateSuccess'));
router.push({ router.push({
name: BugManagementRouteEnum.BUG_MANAGEMENT_INDEX, name: BugManagementRouteEnum.BUG_MANAGEMENT_INDEX,
@ -501,6 +504,7 @@
} else { } else {
Message.success(t('common.createSuccess')); Message.success(t('common.createSuccess'));
if (isContinue) { if (isContinue) {
setState(false);
// //
const { templateId } = form.value; const { templateId } = form.value;
// //
@ -515,6 +519,7 @@
// //
fileList.value = []; fileList.value = [];
} else { } else {
setState(true);
// //
if (getIsVisited()) { if (getIsVisited()) {
router.push({ router.push({