From f0456b36e9cc151eaa90752e78f922a04b56e524 Mon Sep 17 00:00:00 2001 From: "Captain.B" Date: Wed, 24 Mar 2021 17:01:19 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=8F=AA=E8=AF=BB?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=82=B9=E5=87=BB=E4=BF=9D=E5=AD=98=E7=94=A8?= =?UTF-8?q?=E4=BE=8B=E8=B7=B3=E8=BD=AC=E5=88=B0=E8=AE=BE=E7=BD=AE=E7=9A=84?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../track/case/components/TestCaseEdit.vue | 53 +++++++++++-------- 1 file changed, 30 insertions(+), 23 deletions(-) diff --git a/frontend/src/business/components/track/case/components/TestCaseEdit.vue b/frontend/src/business/components/track/case/components/TestCaseEdit.vue index 558840eba0..0262267dc1 100644 --- a/frontend/src/business/components/track/case/components/TestCaseEdit.vue +++ b/frontend/src/business/components/track/case/components/TestCaseEdit.vue @@ -5,9 +5,13 @@
- - {{ $t('commons.save') }} - + {{ $t('commons.save') }} @@ -297,10 +301,12 @@ import {ELEMENTS} from "@/business/components/api/automation/scenario/Setting"; import TestCaseComment from "@/business/components/track/case/components/TestCaseComment"; import ReviewCommentItem from "@/business/components/track/review/commom/ReviewCommentItem"; import {API_STATUS, REVIEW_STATUS, TEST} from "@/business/components/api/definition/model/JsonData"; +import MsTableButton from "@/business/components/common/components/MsTableButton"; export default { name: "TestCaseEdit", components: { + MsTableButton, ReviewCommentItem, TestCaseComment, MsPreviousNextButton, MsInputTag, CaseComment, MsDialogFooter, TestCaseAttachment @@ -311,8 +317,8 @@ export default { multiple: true, lazy: true, lazyLoad: ((node, resolve) => { - const { level } = node; - if(node.level==0){ + const {level} = node; + if (node.level == 0) { const nodes = TEST .map(item => ({ value: item.id, @@ -321,10 +327,10 @@ export default { })); resolve(nodes) } - if(node.level==1){ + if (node.level == 1) { this.testOptions = []; let url = ''; - this.form.type=node.data.value + this.form.type = node.data.value if (this.form.type === 'testcase' || this.form.type === 'automation') { url = '/api/' + this.form.type + '/list/' + this.projectId } else if (this.form.type === 'performance' || this.form.type === 'api') { @@ -347,7 +353,7 @@ export default { }), }, options: REVIEW_STATUS, - statuOptions:API_STATUS, + statuOptions: API_STATUS, comments: [], result: {}, dialogFormVisible: false, @@ -366,13 +372,13 @@ export default { desc: '', result: '' }], - selected: [], + selected: [], remark: '', tags: [], demandId: '', demandName: '', - status:'Prepare', - reviewStatus:'Prepare', + status: 'Prepare', + reviewStatus: 'Prepare', }, readOnly: false, moduleOptions: [], @@ -465,14 +471,15 @@ export default { this.saveCase(); } else { this.saveCase(); - let tab={} - tab.name='add' - this.$emit('addTab',tab)} + let tab = {} + tab.name = 'add' + this.$emit('addTab', tab) + } }) - }else { + } else { this.saveCase(); } - }, + }, openComment() { this.$refs.testCaseComment.open() }, @@ -649,9 +656,9 @@ export default { this.dialogFormVisible = false; }, saveCase() { -/* - document.getElementById("inputDelay").focus(); -*/ + /* + document.getElementById("inputDelay").focus(); + */ // 保存前在input框自动失焦,以免保存失败 this.$refs['caseFrom'].validate((valid) => { @@ -703,7 +710,7 @@ export default { if (this.form.tags instanceof Array) { this.form.tags = JSON.stringify(this.form.tags); } - param.testId=JSON.stringify(this.form.selected) + param.testId = JSON.stringify(this.form.selected) param.tags = this.form.tags; param.type = 'functional' return param; @@ -797,14 +804,14 @@ export default { }, getDemandOptions() { if (this.demandOptions.length === 0) { - this.result = {loading : true}; + this.result = {loading: true}; this.$get("demand/list/" + this.projectId).then(response => { this.demandOptions = response.data.data; this.demandOptions.unshift({id: 'other', name: this.$t('test_track.case.other'), platform: 'Other'}) - this.result = {loading : false}; + this.result = {loading: false}; }).catch(() => { this.demandOptions.unshift({id: 'other', name: this.$t('test_track.case.other'), platform: 'Other'}) - this.result = {loading : false}; + this.result = {loading: false}; }) } },