From bfca311bfd70f4b3728ac1c7899c4818f3d0fa52 Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Wed, 26 May 2021 13:05:34 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=BC=96=E8=BE=91=E7=94=A8=E4=BE=8B?= =?UTF-8?q?=E6=8E=A7=E5=88=B6=E5=8F=B0=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../track/case/components/FormRichTextItem.vue | 14 +++++++++----- .../track/case/components/TestCaseEdit.vue | 16 +++++++++++++++- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/frontend/src/business/components/track/case/components/FormRichTextItem.vue b/frontend/src/business/components/track/case/components/FormRichTextItem.vue index 3edc55939c..bad7c71076 100644 --- a/frontend/src/business/components/track/case/components/FormRichTextItem.vue +++ b/frontend/src/business/components/track/case/components/FormRichTextItem.vue @@ -1,7 +1,6 @@ @@ -51,10 +50,15 @@ export default { } } }, + computed: { + active() { + if (this.data[this.prop] !== undefined) { + return true; + } + return false; + } + }, methods: { - updateData(value) { - this.data[this.prop] = value; - }, imgAdd(pos, file){ let param = { id: getUUID().substring(0, 8) diff --git a/frontend/src/business/components/track/case/components/TestCaseEdit.vue b/frontend/src/business/components/track/case/components/TestCaseEdit.vue index 4065dc113d..ef44c10cb4 100644 --- a/frontend/src/business/components/track/case/components/TestCaseEdit.vue +++ b/frontend/src/business/components/track/case/components/TestCaseEdit.vue @@ -367,7 +367,20 @@ } } }, - + setDefaultValue() { + if (!this.form.prerequisite) { + this.form.prerequisite = ""; + } + if (!this.form.stepDescription) { + this.form.stepDescription = ""; + } + if (!this.form.expectedResult) { + this.form.expectedResult = ""; + } + if (!this.form.remark) { + this.form.remark = ""; + } + }, handleCommand(e) { if (e === "ADD_AND_CREATE") { this.$refs['caseFrom'].validate((valid) => { @@ -524,6 +537,7 @@ this.form.module = testCase.nodeId; //设置自定义熟悉默认值 parseCustomField(this.form, this.testCaseTemplate, this.customFieldForm, this.customFieldRules, buildTestCaseOldFields(this.form)); + this.setDefaultValue(); // 重新渲染,显示自定义字段的必填校验 this.reloadForm(); },