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(); },