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);
// 删除本地上传的附件
deleteLocalFile(request.getBugId(), null, request.getProjectId(), null, attachment.getId(), null);
} catch (MSException e) {
throw e;
} catch (Exception e) {
throw new MSException(Translator.get("file.transfer.failed"));
}

View File

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