From a2ea71614fad20334c1f8e4cfed42b7250029d06 Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Fri, 23 Apr 2021 10:12:58 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=A4=8D=E5=88=B6=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E5=A4=8D=E5=88=B6=E5=85=B3=E8=81=94=E7=9A=84?= =?UTF-8?q?=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../settings/workspace/template/IssueTemplateEdit.vue | 9 ++++----- .../settings/workspace/template/IssuesTemplateList.vue | 3 +-- .../settings/workspace/template/TestCaseTemplateEdit.vue | 9 ++++----- .../settings/workspace/template/TestCaseTemplateList.vue | 3 +-- 4 files changed, 10 insertions(+), 14 deletions(-) diff --git a/frontend/src/business/components/settings/workspace/template/IssueTemplateEdit.vue b/frontend/src/business/components/settings/workspace/template/IssueTemplateEdit.vue index d4e6b7a0f7..dd094eb5bd 100644 --- a/frontend/src/business/components/settings/workspace/template/IssueTemplateEdit.vue +++ b/frontend/src/business/components/settings/workspace/template/IssueTemplateEdit.vue @@ -89,17 +89,16 @@ export default { } }, methods: { - open(data) { + open(data, isCopy) { if (data) { Object.assign(this.form, data); if (!(data.options instanceof Array)) { this.form.options = data.options ? JSON.parse(data.options) : []; } - if (data.id) { - this.url = 'field/template/issue/update'; - } else { - //copy + if (isCopy) { this.url = 'field/template/issue/add'; + } else { + this.url = 'field/template/issue/update'; } } else { this.form = { diff --git a/frontend/src/business/components/settings/workspace/template/IssuesTemplateList.vue b/frontend/src/business/components/settings/workspace/template/IssuesTemplateList.vue index d415c35bf9..ab1c7ad595 100644 --- a/frontend/src/business/components/settings/workspace/template/IssuesTemplateList.vue +++ b/frontend/src/business/components/settings/workspace/template/IssuesTemplateList.vue @@ -152,9 +152,8 @@ export default { handleCopy(data) { let copyData = {}; Object.assign(copyData, data); - copyData.id = null; copyData.name = data.name + '_copy'; - this.$refs.templateEdit.open(copyData); + this.$refs.templateEdit.open(copyData, true); }, handleDelete(data) { this.result = this.$get('field/template/issue/delete/' + data.id, () => { diff --git a/frontend/src/business/components/settings/workspace/template/TestCaseTemplateEdit.vue b/frontend/src/business/components/settings/workspace/template/TestCaseTemplateEdit.vue index a0c124ef19..71af6e5c84 100644 --- a/frontend/src/business/components/settings/workspace/template/TestCaseTemplateEdit.vue +++ b/frontend/src/business/components/settings/workspace/template/TestCaseTemplateEdit.vue @@ -93,17 +93,16 @@ export default { } }, methods: { - open(data) { + open(data, isCopy) { if (data) { Object.assign(this.form, data); if (!(data.options instanceof Array)) { this.form.options = data.options ? JSON.parse(data.options) : []; } - if (data.id) { - this.url = 'field/template/case/update'; - } else { - //copy + if (isCopy) { this.url = 'field/template/case/add'; + } else { + this.url = 'field/template/case/update'; } } else { this.form = { diff --git a/frontend/src/business/components/settings/workspace/template/TestCaseTemplateList.vue b/frontend/src/business/components/settings/workspace/template/TestCaseTemplateList.vue index 635aa8ba9d..5a6e4c352a 100644 --- a/frontend/src/business/components/settings/workspace/template/TestCaseTemplateList.vue +++ b/frontend/src/business/components/settings/workspace/template/TestCaseTemplateList.vue @@ -161,9 +161,8 @@ export default { handleCopy(data) { let copyData = {}; Object.assign(copyData, data); - copyData.id = null; copyData.name = data.name + '_copy'; - this.$refs.templateEdit.open(copyData); + this.$refs.templateEdit.open(copyData, true); }, handleDelete(data) { this.result = this.$get('field/template/case/delete/' + data.id, () => {