From d1758335f7aa4792ba029aa403da57e29ac4f0f2 Mon Sep 17 00:00:00 2001 From: AgAngle <1323481023@qq.com> Date: Wed, 10 Apr 2024 18:33:43 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92):=20?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92=E5=8A=9F=E8=83=BD=E7=94=A8?= =?UTF-8?q?=E4=BE=8B=E7=BC=96=E8=BE=91=E5=AE=9E=E9=99=85=E7=BB=93=E6=9E=9C?= =?UTF-8?q?=E5=AF=8C=E6=96=87=E6=9C=AC=E6=A1=86=E6=97=B6=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E5=9B=BE=E7=89=87=EF=BC=8C=E4=B8=80=E6=AE=B5=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E5=90=8E=E5=9B=BE=E7=89=87=E6=97=A0=E6=B3=95=E6=9F=A5=E7=9C=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sdk-parent/frontend/src/utils/mdImgUtils.js | 3 +++ .../comonents/functional/FunctionalTestCaseEdit.vue | 12 +++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/framework/sdk-parent/frontend/src/utils/mdImgUtils.js b/framework/sdk-parent/frontend/src/utils/mdImgUtils.js index 445eebedf0..82389e285f 100644 --- a/framework/sdk-parent/frontend/src/utils/mdImgUtils.js +++ b/framework/sdk-parent/frontend/src/utils/mdImgUtils.js @@ -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); diff --git a/test-track/frontend/src/business/plan/view/comonents/functional/FunctionalTestCaseEdit.vue b/test-track/frontend/src/business/plan/view/comonents/functional/FunctionalTestCaseEdit.vue index dfb019ba1f..536b10d17f 100644 --- a/test-track/frontend/src/business/plan/view/comonents/functional/FunctionalTestCaseEdit.vue +++ b/test-track/frontend/src/business/plan/view/comonents/functional/FunctionalTestCaseEdit.vue @@ -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); + this.handleMdImages({ + id: param.id, + actualResult: param.actualResult, + description: this.testCase.comment, + }); if (this.testCase.comment) { - this.handleMdImages({ - id: response.data.id, - description: 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(),