fix: 编辑用例控制台报错
This commit is contained in:
parent
07dbb1ef23
commit
bfca311bfd
|
@ -1,7 +1,6 @@
|
|||
<template>
|
||||
<el-form-item :disable="true" :label="title" :prop="prop" :label-width="labelWidth">
|
||||
<!-- <test-case-rich-text :disabled="disabled" :content="data[prop]" @updateRichText="updateData"/>-->
|
||||
<mavon-editor :editable="!disabled" @imgAdd="imgAdd" :default-open="disabled ? 'preview' : null" class="mavon-editor"
|
||||
<mavon-editor v-if="active" :editable="!disabled" @imgAdd="imgAdd" :default-open="disabled ? 'preview' : null" class="mavon-editor"
|
||||
:subfield="disabled ? false : true" :toolbars="toolbars" @imgDel="imgDel" v-model="data[prop]" ref="md"/>
|
||||
</el-form-item>
|
||||
</template>
|
||||
|
@ -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)
|
||||
|
|
|
@ -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();
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue