From 9ccba5105700d7cdfbed92237baf41e17ac4a941 Mon Sep 17 00:00:00 2001 From: shiziyuan9527 Date: Fri, 19 Jun 2020 11:05:13 +0800 Subject: [PATCH 1/5] =?UTF-8?q?fix=20=E8=BF=9E=E7=BB=AD=E5=88=9B=E5=BB=BA?= =?UTF-8?q?=E7=94=A8=E4=BE=8B=E6=97=B6=E7=94=A8=E4=BE=8B=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E4=B8=8D=E5=88=B7=E6=96=B0=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../track/case/components/TestCaseEdit.vue | 80 ++++++++++--------- 1 file changed, 44 insertions(+), 36 deletions(-) diff --git a/frontend/src/business/components/track/case/components/TestCaseEdit.vue b/frontend/src/business/components/track/case/components/TestCaseEdit.vue index b2c5d97e64..811a5e328e 100644 --- a/frontend/src/business/components/track/case/components/TestCaseEdit.vue +++ b/frontend/src/business/components/track/case/components/TestCaseEdit.vue @@ -2,8 +2,9 @@
- + @@ -39,7 +40,8 @@ - + - + @@ -64,7 +67,8 @@ - + @@ -88,7 +92,8 @@ - + @@ -196,12 +201,12 @@ @@ -234,7 +239,7 @@ prerequisite: '', testId: '', steps: [{ - num: 1 , + num: 1, desc: '', result: '' }], @@ -245,19 +250,19 @@ methodOptions: [], testOptions: [], workspaceId: '', - rules:{ - name :[ + rules: { + name: [ {required: true, message: this.$t('test_track.case.input_name'), trigger: 'blur'}, - { max: 30, message: this.$t('test_track.length_less_than') + '30', trigger: 'blur' } + {max: 30, message: this.$t('test_track.length_less_than') + '30', trigger: 'blur'} ], - module :[{required: true, message: this.$t('test_track.case.input_module'), trigger: 'change'}], - maintainer :[{required: true, message: this.$t('test_track.case.input_maintainer'), trigger: 'change'}], - priority :[{required: true, message: this.$t('test_track.case.input_priority'), trigger: 'change'}], - type :[{required: true, message: this.$t('test_track.case.input_type'), trigger: 'change'}], - testId :[{required: true, message: '请选择测试', trigger: 'change'}], - method :[{required: true, message: this.$t('test_track.case.input_method'), trigger: 'change'}], - prerequisite :[{ max: 300, message: this.$t('test_track.length_less_than') + '300', trigger: 'blur'}], - remark :[{ max: 300, message: this.$t('test_track.length_less_than') + '300', trigger: 'blur'}] + module: [{required: true, message: this.$t('test_track.case.input_module'), trigger: 'change'}], + maintainer: [{required: true, message: this.$t('test_track.case.input_maintainer'), trigger: 'change'}], + priority: [{required: true, message: this.$t('test_track.case.input_priority'), trigger: 'change'}], + type: [{required: true, message: this.$t('test_track.case.input_type'), trigger: 'change'}], + testId: [{required: true, message: '请选择测试', trigger: 'change'}], + method: [{required: true, message: this.$t('test_track.case.input_method'), trigger: 'change'}], + prerequisite: [{max: 300, message: this.$t('test_track.length_less_than') + '300', trigger: 'blur'}], + remark: [{max: 300, message: this.$t('test_track.length_less_than') + '300', trigger: 'blur'}] }, formLabelWidth: "120px", operationType: '', @@ -327,8 +332,8 @@ step.desc = null; step.result = null; this.form.steps.forEach(step => { - if(step.num > data.num){ - step.num ++; + if (step.num > data.num) { + step.num++; } }); this.form.steps.splice(index + 1, 0, step); @@ -336,12 +341,12 @@ handleDeleteStep(index, data) { this.form.steps.splice(index, 1); this.form.steps.forEach(step => { - if(step.num > data.num){ - step.num --; + if (step.num > data.num) { + step.num--; } }); }, - saveCase(){ + saveCase() { this.$refs['caseFrom'].validate((valid) => { if (valid) { let param = this.buildParam(); @@ -350,6 +355,7 @@ this.$success(this.$t('commons.save_success')); if (this.operationType == 'add' && this.isCreateContinue) { this.form.name = ''; + this.$emit("refresh"); return; } this.dialogFormVisible = false; @@ -367,7 +373,7 @@ param.steps = JSON.stringify(this.form.steps); param.nodeId = this.form.module; this.moduleOptions.forEach(item => { - if(this.form.module === item.id){ + if (this.form.module === item.id) { param.nodePath = item.path; } }); @@ -381,11 +387,11 @@ return param; }, validate(param) { - for (let i = 0; i < param.steps.length; i++){ + for (let i = 0; i < param.steps.length; i++) { if ((param.steps[i].desc && param.steps[i].desc.length > 300) || (param.steps[i].result && param.steps[i].result.length > 300)) { this.$warning(this.$t('test_track.case.step_desc') + "," - + this.$t('test_track.case.expected_results') + this.$t('test_track.length_less_than') + '300'); + + this.$t('test_track.case.expected_results') + this.$t('test_track.length_less_than') + '300'); return false; } } @@ -409,7 +415,7 @@ }, getMaintainerOptions() { let workspaceId = localStorage.getItem(WORKSPACE_ID); - this.$post('/user/ws/member/tester/list', {workspaceId:workspaceId}, response => { + this.$post('/user/ws/member/tester/list', {workspaceId: workspaceId}, response => { this.maintainerOptions = response.data; }); }, @@ -444,8 +450,8 @@ option.path = option.path + '/' + node.name; moduleOptions.push(option); if (node.children) { - for (let i = 0; i < node.children.length; i++){ - this.buildNodePath(node.children[i], { path: option.path }, moduleOptions); + for (let i = 0; i < node.children.length; i++) { + this.buildNodePath(node.children[i], {path: option.path}, moduleOptions); } } }, @@ -464,7 +470,7 @@ this.form.remark = ''; this.form.testId = ''; this.form.steps = [{ - num: 1 , + num: 1, desc: '', result: '' }]; @@ -481,10 +487,12 @@ .tb-edit .el-textarea { display: none; } + .tb-edit .current-row .el-textarea { display: block; } - .tb-edit .current-row .el-textarea+span { + + .tb-edit .current-row .el-textarea + span { display: none; } From 20f59cad3a1204e30bbeffde6c377447a594d7b2 Mon Sep 17 00:00:00 2001 From: wenyann <64353056+wenyann@users.noreply.github.com> Date: Fri, 19 Jun 2020 14:03:16 +0800 Subject: [PATCH 2/5] =?UTF-8?q?'=E5=88=A0=E9=99=A4=E6=8F=90=E7=A4=BA'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../business/components/project/MsProject.vue | 20 ++++++++-- .../organization/OrganizationMember.vue | 2 +- .../organization/OrganizationWorkspace.vue | 39 +++++++++++++------ .../settings/system/Organization.vue | 31 ++++++++++----- .../settings/system/SystemWorkspace.vue | 38 ++++++++++++------ .../settings/system/TestResourcePool.vue | 2 +- .../settings/workspace/WorkspaceMember.vue | 2 +- frontend/src/i18n/en-US.js | 12 ++++-- frontend/src/i18n/zh-CN.js | 9 +++-- frontend/src/i18n/zh-TW.js | 10 +++-- 10 files changed, 116 insertions(+), 49 deletions(-) diff --git a/frontend/src/business/components/project/MsProject.vue b/frontend/src/business/components/project/MsProject.vue index e4249a72e4..f2640e214d 100644 --- a/frontend/src/business/components/project/MsProject.vue +++ b/frontend/src/business/components/project/MsProject.vue @@ -69,10 +69,11 @@ import MsTableHeader from "../common/components/MsTableHeader"; import MsTableOperator from "../common/components/MsTableOperator"; import MsDialogFooter from "../common/components/MsDialogFooter"; - import {_sort, getCurrentUser} from "../../../common/js/utils"; + import {_sort, getCurrentOrganizationId, getCurrentUser, refreshSessionAndCookies} from "../../../common/js/utils"; import MsContainer from "../common/components/MsContainer"; import MsMainContainer from "../common/components/MsMainContainer"; import MsDeleteConfirm from "../common/components/MsDeleteConfirm"; + import {DEFAULT} from "../../../common/js/constants"; export default { name: "MsProject", @@ -179,9 +180,20 @@ this.$refs.deleteConfirm.open(project); }, _handleDelete(project) { - this.$get('/project/delete/' + project.id, () => { - Message.success(this.$t('commons.delete_success')); - this.list(); + this.$confirm(this.$t('project.delete_tip'), '', { + confirmButtonText: this.$t('commons.confirm'), + cancelButtonText: this.$t('commons.cancel'), + type: 'warning' + }).then(() => { + this.$get('/project/delete/' + project.id, () => { + Message.success(this.$t('commons.delete_success')); + this.list(); + }); + }).catch(() => { + this.$message({ + type: 'info', + message: this.$t('commons.delete_cancelled') + }); }); }, search() { diff --git a/frontend/src/business/components/settings/organization/OrganizationMember.vue b/frontend/src/business/components/settings/organization/OrganizationMember.vue index aedd75c32b..2ec1d4d600 100644 --- a/frontend/src/business/components/settings/organization/OrganizationMember.vue +++ b/frontend/src/business/components/settings/organization/OrganizationMember.vue @@ -15,7 +15,7 @@ - + diff --git a/frontend/src/business/components/settings/organization/OrganizationWorkspace.vue b/frontend/src/business/components/settings/organization/OrganizationWorkspace.vue index 66b1c6489e..237e3d8e4f 100644 --- a/frontend/src/business/components/settings/organization/OrganizationWorkspace.vue +++ b/frontend/src/business/components/settings/organization/OrganizationWorkspace.vue @@ -14,7 +14,7 @@ - + @@ -159,7 +159,12 @@ import MsTableOperator from "../../common/components/MsTableOperator"; import MsTableOperatorButton from "../../common/components/MsTableOperatorButton"; import MsDialogFooter from "../../common/components/MsDialogFooter"; - import {getCurrentUser, getCurrentWorkspaceId, refreshSessionAndCookies} from "../../../../common/js/utils"; + import { + getCurrentOrganizationId, + getCurrentUser, + getCurrentWorkspaceId, + refreshSessionAndCookies + } from "../../../../common/js/utils"; import MsDeleteConfirm from "../../common/components/MsDeleteConfirm"; export default { @@ -212,16 +217,28 @@ this.$refs.deleteConfirm.open(workspace); }, _handleDelete(workspace) { - this.$get('/workspace/delete/' + workspace.id, () => { - let lastWorkspaceId = getCurrentWorkspaceId(); - let sourceId = workspace.id; - if (lastWorkspaceId === sourceId) { - let sign = DEFAULT; - refreshSessionAndCookies(sign, sourceId); - } - this.$success(this.$t('commons.delete_success')); - this.list(); + this.$confirm(this.$t('organization.delete_confirm'), '', { + confirmButtonText: this.$t('commons.confirm'), + cancelButtonText: this.$t('commons.cancel'), + type: 'warning' + }).then(() => { + this.$get('/workspace/delete/' + workspace.id, () => { + let lastWorkspaceId = getCurrentWorkspaceId(); + let sourceId = workspace.id; + if (lastWorkspaceId === sourceId) { + let sign = DEFAULT; + refreshSessionAndCookies(sign, sourceId); + } + this.$success(this.$t('commons.delete_success')); + this.list(); + }); + }).catch(() => { + this.$message({ + type: 'info', + message: this.$t('commons.delete_cancelled') + }); }); + }, list() { let url = '/workspace/list/' + this.currentPage + '/' + this.pageSize; diff --git a/frontend/src/business/components/settings/system/Organization.vue b/frontend/src/business/components/settings/system/Organization.vue index ccdba1a9b3..fdd26d5e5f 100644 --- a/frontend/src/business/components/settings/system/Organization.vue +++ b/frontend/src/business/components/settings/system/Organization.vue @@ -318,18 +318,29 @@ }); }, handleDelete(organization) { - this.$refs.deleteConfirm.open(organization); + this.$refs.deleteConfirm.open(organization); }, _handleDelete(organization) { - this.result = this.$get(this.deletePath + organization.id, () => { - let lastOrganizationId = getCurrentOrganizationId(); - let sourceId = organization.id; - if (lastOrganizationId === sourceId) { - let sign = DEFAULT; - refreshSessionAndCookies(sign, sourceId); - } - this.$success(this.$t('commons.delete_success')); - this.initTableData(); + this.$confirm(this.$t('organization.delete_confirm'), '', { + confirmButtonText: this.$t('commons.confirm'), + cancelButtonText: this.$t('commons.cancel'), + type: 'warning' + }).then(() => { + this.result = this.$get(this.deletePath + organization.id, () => { + let lastOrganizationId = getCurrentOrganizationId(); + let sourceId = organization.id; + if (lastOrganizationId === sourceId) { + let sign = DEFAULT; + refreshSessionAndCookies(sign, sourceId); + } + this.$success(this.$t('commons.delete_success')); + this.initTableData(); + }); + }).catch(() => { + this.$message({ + type: 'info', + message: this.$t('commons.delete_cancelled') + }); }); }, delMember(row) { diff --git a/frontend/src/business/components/settings/system/SystemWorkspace.vue b/frontend/src/business/components/settings/system/SystemWorkspace.vue index f3f6bac586..ce5f1ec08c 100644 --- a/frontend/src/business/components/settings/system/SystemWorkspace.vue +++ b/frontend/src/business/components/settings/system/SystemWorkspace.vue @@ -17,7 +17,7 @@ - + @@ -199,7 +199,12 @@ import MsTableOperator from "../../common/components/MsTableOperator"; import MsTableOperatorButton from "../../common/components/MsTableOperatorButton"; import MsDialogFooter from "../../common/components/MsDialogFooter"; - import {getCurrentUser, getCurrentWorkspaceId, refreshSessionAndCookies} from "../../../../common/js/utils"; + import { + getCurrentOrganizationId, + getCurrentUser, + getCurrentWorkspaceId, + refreshSessionAndCookies + } from "../../../../common/js/utils"; import {DEFAULT, WORKSPACE} from "../../../../common/js/constants"; import MsDeleteConfirm from "../../common/components/MsDeleteConfirm"; @@ -373,15 +378,26 @@ this.$refs.deleteConfirm.open(workspace); }, _handleDelete(workspace) { - this.$get('/workspace/special/delete/' + workspace.id, () => { - let lastWorkspaceId = getCurrentWorkspaceId(); - let sourceId = workspace.id; - if (lastWorkspaceId === sourceId) { - let sign = DEFAULT; - refreshSessionAndCookies(sign, sourceId); - } - Message.success(this.$t('commons.delete_success')); - this.list(); + this.$confirm(this.$t('workspace.delete_confirm'), '', { + confirmButtonText: this.$t('commons.confirm'), + cancelButtonText: this.$t('commons.cancel'), + type: 'warning' + }).then(() => { + this.$get('/workspace/special/delete/' + workspace.id, () => { + let lastWorkspaceId = getCurrentWorkspaceId(); + let sourceId = workspace.id; + if (lastWorkspaceId === sourceId) { + let sign = DEFAULT; + refreshSessionAndCookies(sign, sourceId); + } + Message.success(this.$t('commons.delete_success')); + this.list(); + }); + }).catch(() => { + this.$message({ + type: 'info', + message: this.$t('commons.delete_cancelled') + }); }); }, delMember(row) { diff --git a/frontend/src/business/components/settings/system/TestResourcePool.vue b/frontend/src/business/components/settings/system/TestResourcePool.vue index 4c50fc6b0b..56de2ecb33 100644 --- a/frontend/src/business/components/settings/system/TestResourcePool.vue +++ b/frontend/src/business/components/settings/system/TestResourcePool.vue @@ -34,7 +34,7 @@ {{ scope.row.updateTime | timestampFormatDate }} - + diff --git a/frontend/src/business/components/settings/workspace/WorkspaceMember.vue b/frontend/src/business/components/settings/workspace/WorkspaceMember.vue index 085218e99a..263095c986 100644 --- a/frontend/src/business/components/settings/workspace/WorkspaceMember.vue +++ b/frontend/src/business/components/settings/workspace/WorkspaceMember.vue @@ -15,7 +15,7 @@ - + - +