From cbd8c4ee49fcc47cc0f6764dea778bd3d6bef8d7 Mon Sep 17 00:00:00 2001 From: zhangdahai111 Date: Wed, 22 Dec 2021 18:35:32 +0800 Subject: [PATCH 1/3] =?UTF-8?q?fix:=20=E8=BF=9E=E7=BB=AD=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E7=BC=BA=E9=99=B7=E5=9B=BE=E7=89=87=E6=98=BE=E7=A4=BA=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/track/issue/IssueComment.vue | 2 +- .../components/track/issue/IssueEdit.vue | 4 +- .../track/issue/IssueEditDetail.vue | 15 +- .../components/track/issue/IssueList.vue | 6 +- .../track/review/commom/ReviewCommentItem.vue | 183 +++++++++++------- frontend/src/i18n/en-US.js | 5 +- frontend/src/i18n/zh-CN.js | 5 +- frontend/src/i18n/zh-TW.js | 5 +- 8 files changed, 138 insertions(+), 87 deletions(-) diff --git a/frontend/src/business/components/track/issue/IssueComment.vue b/frontend/src/business/components/track/issue/IssueComment.vue index c1a4a652dc..896e357bd3 100644 --- a/frontend/src/business/components/track/issue/IssueComment.vue +++ b/frontend/src/business/components/track/issue/IssueComment.vue @@ -88,7 +88,7 @@ export default { } this.result = this.$post('/issues/comment/save', comment, () => { this.$success(this.$t('test_track.comment.send_success')); - this.refresh(comment.IssueId); + this.refresh(comment.issuesId); this.from.description = ''; this.dialogTableVisible = false; }); diff --git a/frontend/src/business/components/track/issue/IssueEdit.vue b/frontend/src/business/components/track/issue/IssueEdit.vue index 1bd7133ddb..5212786997 100644 --- a/frontend/src/business/components/track/issue/IssueEdit.vue +++ b/frontend/src/business/components/track/issue/IssueEdit.vue @@ -29,10 +29,10 @@ export default { } }, methods: { - open(data) { + open(data, type) { this.visible = true; this.$nextTick(() => { - this.$refs.issueEditDetail.open(data); + this.$refs.issueEditDetail.open(data, type); }) }, handleClose() { diff --git a/frontend/src/business/components/track/issue/IssueEditDetail.vue b/frontend/src/business/components/track/issue/IssueEditDetail.vue index 235ac0b441..52a47518a8 100644 --- a/frontend/src/business/components/track/issue/IssueEditDetail.vue +++ b/frontend/src/business/components/track/issue/IssueEditDetail.vue @@ -235,8 +235,9 @@ export default { }, }, methods: { - open(data) { + open(data, type) { this.result.loading = true; + this.type = type; this.$nextTick(() => { getIssuePartTemplateWithProject((template, project) => { this.currentProject = project; @@ -244,17 +245,18 @@ export default { }); }); - if(data&&data.id){ + if (data && data.id) { this.$get('/issues/follow/' + data.id, response => { this.form.follows = response.data; for (let i = 0; i < response.data.length; i++) { - if(response.data[i]===this.currentUser().id){ + if (response.data[i] === this.currentUser().id) { this.showFollow = true; break; } } }) - }else { + } else { + this.issueId = null; this.form.follows = []; } }, @@ -325,6 +327,7 @@ export default { } } this.customFieldForm = parseCustomField(this.form, this.issueTemplate, this.customFieldRules); + this.comments = []; this.$nextTick(() => { if (this.$refs.testCaseIssueList) { this.$refs.testCaseIssueList.initTableData(); @@ -422,6 +425,10 @@ export default { } }, openComment() { + if (!this.issueId) { + this.$warning(this.$t('test_track.issue.save_before_open_comment')); + return; + } this.$refs.issueComment.open(); }, getComments() { diff --git a/frontend/src/business/components/track/issue/IssueList.vue b/frontend/src/business/components/track/issue/IssueList.vue index 07c24748f4..f75698944f 100644 --- a/frontend/src/business/components/track/issue/IssueList.vue +++ b/frontend/src/business/components/track/issue/IssueList.vue @@ -295,17 +295,17 @@ export default { }, handleEdit(data) { - this.$refs.issueEdit.open(data); + this.$refs.issueEdit.open(data, 'edit'); }, handleCreate() { - this.$refs.issueEdit.open(); + this.$refs.issueEdit.open(null, 'add'); }, handleCopy(data) { let copyData = {}; Object.assign(copyData, data); copyData.id = null; copyData.name = data.name + '_copy'; - this.$refs.issueEdit.open(copyData); + this.$refs.issueEdit.open(copyData, 'copy'); }, handleDelete(data) { this.page.result = this.$get('issues/delete/' + data.id, () => { diff --git a/frontend/src/business/components/track/review/commom/ReviewCommentItem.vue b/frontend/src/business/components/track/review/commom/ReviewCommentItem.vue index d0f5417515..f26b99ad1c 100644 --- a/frontend/src/business/components/track/review/commom/ReviewCommentItem.vue +++ b/frontend/src/business/components/track/review/commom/ReviewCommentItem.vue @@ -19,46 +19,45 @@ - +
- - - -
+ +
{{ comment.description }}
{{ imgDescription }}
+ :z-index="imageIndex" + style="width: 100px; height: 100px;" + fit="contain" + :src="src" + :preview-src-list="srcList">
- - - - - - + + +
+
+
+ +
+
+
+ + {{ $t('test_track.comment.send') }} + +
+
+
@@ -66,10 +65,11 @@