diff --git a/test-track/frontend/src/business/case/components/TestCaseEdit.vue b/test-track/frontend/src/business/case/components/TestCaseEdit.vue index 7b4d667dd2..29926626dc 100644 --- a/test-track/frontend/src/business/case/components/TestCaseEdit.vue +++ b/test-track/frontend/src/business/case/components/TestCaseEdit.vue @@ -452,6 +452,7 @@ export default { nodeId: '', steps: [ { + id: this.newStepId(), num: 1, desc: "", result: "", @@ -1138,6 +1139,11 @@ export default { }, ]; } + tmp.steps.forEach(step => { + if (!step.id) { + step.id = this.newStepId(); + } + }); tmp.tags = JSON.parse(tmp.tags); Object.assign(this.form, tmp); if (!this.form.stepModel) { @@ -1167,6 +1173,9 @@ export default { // 重新渲染,显示自定义字段的必填校验 this.reloadForm(); }, + newStepId() { + return getUUID().substring(0, 8); + }, resetSystemField() { if (!this.caseId) { return; @@ -1458,6 +1467,7 @@ export default { this.form.testName = ""; this.form.steps = [ { + id: this.newStepId(), num: 1, desc: "", result: "", diff --git a/test-track/frontend/src/business/case/components/case/CaseStepItem.vue b/test-track/frontend/src/business/case/components/case/CaseStepItem.vue index 9916ba71e4..ca9a11f264 100644 --- a/test-track/frontend/src/business/case/components/case/CaseStepItem.vue +++ b/test-track/frontend/src/business/case/components/case/CaseStepItem.vue @@ -66,7 +66,7 @@