fix(测试计划): 测试计划功能用例编辑实际结果富文本框时上传图片,一段时间后图片无法查看
This commit is contained in:
parent
4e109fa045
commit
d1758335f7
|
@ -4,6 +4,9 @@
|
||||||
* @returns {*[]}
|
* @returns {*[]}
|
||||||
*/
|
*/
|
||||||
export function parseMdImage(text) {
|
export function parseMdImage(text) {
|
||||||
|
if (!text) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
let regex = /\!\[.*?\]\(\/resource\/md\/get\?fileName=(.*?)\)/g;
|
let regex = /\!\[.*?\]\(\/resource\/md\/get\?fileName=(.*?)\)/g;
|
||||||
let fileNames = [];
|
let fileNames = [];
|
||||||
let match = regex.exec(text);
|
let match = regex.exec(text);
|
||||||
|
|
|
@ -339,16 +339,17 @@ export default {
|
||||||
}
|
}
|
||||||
param.results = JSON.stringify(param.results);
|
param.results = JSON.stringify(param.results);
|
||||||
param.actualResult = this.testCase.actualResult;
|
param.actualResult = this.testCase.actualResult;
|
||||||
testPlanTestCaseEdit(param).then((response) => {
|
testPlanTestCaseEdit(param).then(() => {
|
||||||
this.$success(this.$t("commons.save_success"));
|
this.$success(this.$t("commons.save_success"));
|
||||||
this.updateTestCases(param);
|
this.updateTestCases(param);
|
||||||
this.setPlanStatus(this.testCase.planId);
|
this.setPlanStatus(this.testCase.planId);
|
||||||
|
this.handleMdImages({
|
||||||
|
id: param.id,
|
||||||
|
actualResult: param.actualResult,
|
||||||
|
description: this.testCase.comment,
|
||||||
|
});
|
||||||
|
|
||||||
if (this.testCase.comment) {
|
if (this.testCase.comment) {
|
||||||
this.handleMdImages({
|
|
||||||
id: response.data.id,
|
|
||||||
description: this.testCase.comment,
|
|
||||||
});
|
|
||||||
this.$refs.comment.getComments();
|
this.$refs.comment.getComments();
|
||||||
this.testCase.comment = "";
|
this.testCase.comment = "";
|
||||||
}
|
}
|
||||||
|
@ -362,6 +363,7 @@ export default {
|
||||||
// 解析富文本框中的图片
|
// 解析富文本框中的图片
|
||||||
let mdImages = [];
|
let mdImages = [];
|
||||||
mdImages.push(...parseMdImage(param.description));
|
mdImages.push(...parseMdImage(param.description));
|
||||||
|
mdImages.push(...parseMdImage(param.actualResult));
|
||||||
// 将图片从临时目录移入正式目录
|
// 将图片从临时目录移入正式目录
|
||||||
saveMarkDownImg({
|
saveMarkDownImg({
|
||||||
projectId: getCurrentProjectID(),
|
projectId: getCurrentProjectID(),
|
||||||
|
|
Loading…
Reference in New Issue