fix(测试计划): 测试计划功能用例编辑实际结果富文本框时上传图片,一段时间后图片无法查看

This commit is contained in:
AgAngle 2024-04-10 18:33:43 +08:00 committed by Craftsman
parent 4e109fa045
commit d1758335f7
2 changed files with 10 additions and 5 deletions

View File

@ -4,6 +4,9 @@
* @returns {*[]}
*/
export function parseMdImage(text) {
if (!text) {
return [];
}
let regex = /\!\[.*?\]\(\/resource\/md\/get\?fileName=(.*?)\)/g;
let fileNames = [];
let match = regex.exec(text);

View File

@ -339,16 +339,17 @@ export default {
}
param.results = JSON.stringify(param.results);
param.actualResult = this.testCase.actualResult;
testPlanTestCaseEdit(param).then((response) => {
testPlanTestCaseEdit(param).then(() => {
this.$success(this.$t("commons.save_success"));
this.updateTestCases(param);
this.setPlanStatus(this.testCase.planId);
if (this.testCase.comment) {
this.handleMdImages({
id: response.data.id,
id: param.id,
actualResult: param.actualResult,
description: this.testCase.comment,
});
if (this.testCase.comment) {
this.$refs.comment.getComments();
this.testCase.comment = "";
}
@ -362,6 +363,7 @@ export default {
//
let mdImages = [];
mdImages.push(...parseMdImage(param.description));
mdImages.push(...parseMdImage(param.actualResult));
//
saveMarkDownImg({
projectId: getCurrentProjectID(),