- + - + From 2262f83c410470a0257594c3a1be710745ebb7b6 Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Sun, 26 Apr 2020 10:40:12 +0800 Subject: [PATCH 03/13] =?UTF-8?q?=E5=88=9B=E5=BB=BA=E7=94=A8=E4=BE=8B?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E9=BB=98=E8=AE=A4=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../business/components/track/case/TestCase.vue | 7 ++++++- .../track/case/components/TestCaseEdit.vue | 17 ++++++++++++++++- .../components/track/common/NodeTree.vue | 11 +++++++---- 3 files changed, 29 insertions(+), 6 deletions(-) diff --git a/frontend/src/business/components/track/case/TestCase.vue b/frontend/src/business/components/track/case/TestCase.vue index 731bcc3f63..7262e7ce39 100644 --- a/frontend/src/business/components/track/case/TestCase.vue +++ b/frontend/src/business/components/track/case/TestCase.vue @@ -14,6 +14,7 @@ @refresh="refresh" :tree-nodes="treeNodes" :type="'edit'" + :select-node.sync="selectNode" ref="nodeTree"/> @@ -35,6 +36,7 @@ @refresh="refresh" :read-only="testCaseReadOnly" :tree-nodes="treeNodes" + :select-node="selectNode" ref="testCaseEditDialog"> @@ -63,7 +65,8 @@ treeNodes: [], selectNodeIds: [], selectNodeNames: [], - testCaseReadOnly: true + testCaseReadOnly: true, + selectNode: {}, } }, mounted() { @@ -141,6 +144,7 @@ }, editTestCase(testCase) { this.testCaseReadOnly = false; + console.log(this.selectNode); this.$refs.testCaseEditDialog.open(testCase); }, copyTestCase(testCase) { @@ -162,6 +166,7 @@ refresh() { this.selectNodeIds = []; this.selectNodeNames = []; + this.selectNode = {}; this.$refs.testCaseList.initTableData(); this.getNodeTree(); }, diff --git a/frontend/src/business/components/track/case/components/TestCaseEdit.vue b/frontend/src/business/components/track/case/components/TestCaseEdit.vue index c95d95447c..7112654a8b 100644 --- a/frontend/src/business/components/track/case/components/TestCaseEdit.vue +++ b/frontend/src/business/components/track/case/components/TestCaseEdit.vue @@ -19,6 +19,7 @@ + - import {CURRENT_PROJECT, WORKSPACE_ID} from '../../../../../common/js/constants'; + import {CURRENT_PROJECT, WORKSPACE_ID, TokenKey} from '../../../../../common/js/constants'; import MsDialogFooter from '../../../common/components/MsDialogFooter' @@ -236,6 +237,9 @@ readOnly: { type: Boolean, default: true + }, + selectNode: { + type: Object } }, methods: { @@ -255,6 +259,17 @@ tmp.steps = JSON.parse(testCase.steps); Object.assign(this.form, tmp); this.form.module = testCase.nodeId; + } else { + if (this.selectNode.data) { + this.form.module = this.selectNode.data.id; + } else { + this.form.module = this.moduleOptions[0].id; + } + let user = JSON.parse(localStorage.getItem(TokenKey)); + this.form.priority = 'P3'; + this.form.type = 'functional'; + this.form.method = 'manual'; + this.form.maintainer = user.id; } this.dialogFormVisible = true; }, diff --git a/frontend/src/business/components/track/common/NodeTree.vue b/frontend/src/business/components/track/common/NodeTree.vue index 82007f9360..7334aff21f 100644 --- a/frontend/src/business/components/track/common/NodeTree.vue +++ b/frontend/src/business/components/track/common/NodeTree.vue @@ -21,7 +21,7 @@ @@ -67,7 +64,6 @@ }, methods: { handlePreview(file) { - console.log("init"); this.init(); }, handleExceed(files, fileList) { @@ -109,6 +105,9 @@ init() { this.fileList = []; this.errList = []; + }, + open() { + this.dialogVisible = true; } } } diff --git a/frontend/src/business/components/track/case/components/TestCaseList.vue b/frontend/src/business/components/track/case/components/TestCaseList.vue index bd3c0cfa1e..8382a857f3 100644 --- a/frontend/src/business/components/track/case/components/TestCaseList.vue +++ b/frontend/src/business/components/track/case/components/TestCaseList.vue @@ -10,17 +10,25 @@ + + + 0) { + this.tableData.forEach(item => { + this.selectIds.add(item.id); + }); + } else { + this.selectIds.clear(); + } + }, + handleSelectionChange(selection, row) { + if(this.selectIds.has(row.id)){ + this.selectIds.delete(row.id); + } else { + this.selectIds.add(row.id); + } + }, + importTestCase() { + this.$refs.testCaseImport.open(); } } } diff --git a/frontend/src/business/components/track/common/NodeEdit.vue b/frontend/src/business/components/track/common/NodeEdit.vue index 54a69c2a6f..813a8bfb4a 100644 --- a/frontend/src/business/components/track/common/NodeEdit.vue +++ b/frontend/src/business/components/track/common/NodeEdit.vue @@ -1,17 +1,18 @@ diff --git a/frontend/src/business/components/track/common/tableItems/planview/PriorityTableItem.vue b/frontend/src/business/components/track/common/tableItems/planview/PriorityTableItem.vue index 9a97255e29..4b52fd3b88 100644 --- a/frontend/src/business/components/track/common/tableItems/planview/PriorityTableItem.vue +++ b/frontend/src/business/components/track/common/tableItems/planview/PriorityTableItem.vue @@ -1,8 +1,8 @@ @@ -49,10 +53,11 @@ import {CURRENT_PROJECT} from '../../../../common/js/constants'; import TestCaseList from "./components/TestCaseList"; import SelectMenu from "../common/SelectMenu"; + import TestCaseMove from "./components/TestCaseMove"; export default { name: "TestCase", - components: {TestCaseList, NodeTree, TestCaseEdit, SelectMenu}, + components: {TestCaseMove, TestCaseList, NodeTree, TestCaseEdit, SelectMenu}, comments: {}, data() { return { @@ -144,7 +149,6 @@ }, editTestCase(testCase) { this.testCaseReadOnly = false; - console.log(this.selectNode); this.$refs.testCaseEditDialog.open(testCase); }, copyTestCase(testCase) { @@ -203,6 +207,14 @@ this.treeNodes = response.data; }); } + }, + moveToNode(selectIds) { + if (selectIds.size < 1) { + this.$warning(this.$t('test_track.plan_view.select_manipulate')); + return; + } + this.$refs.testCaseEditDialog.getModuleOptions(); + this.$refs.testCaseMove.open(this.$refs.testCaseEditDialog.moduleOptions, selectIds); } } } diff --git a/frontend/src/business/components/track/case/components/TestCaseEdit.vue b/frontend/src/business/components/track/case/components/TestCaseEdit.vue index 2b740a7ada..6f8d5101b7 100644 --- a/frontend/src/business/components/track/case/components/TestCaseEdit.vue +++ b/frontend/src/business/components/track/case/components/TestCaseEdit.vue @@ -242,6 +242,9 @@ type: Object } }, + mounted() { + this.getSelectOptions(); + }, methods: { open(testCase) { this.resetForm(); @@ -309,7 +312,7 @@ param.projectId = JSON.parse(localStorage.getItem(CURRENT_PROJECT)).id; } this.$post('/test/case/' + this.operationType, param, () => { - this.$message.success(this.$t('commons.save_success')); + this.$success(this.$t('commons.save_success')); this.dialogFormVisible = false; this.$emit("refresh"); }); diff --git a/frontend/src/business/components/track/case/components/TestCaseImport.vue b/frontend/src/business/components/track/case/components/TestCaseImport.vue index d659c794a6..2fafc562f7 100644 --- a/frontend/src/business/components/track/case/components/TestCaseImport.vue +++ b/frontend/src/business/components/track/case/components/TestCaseImport.vue @@ -67,23 +67,17 @@ this.init(); }, handleExceed(files, fileList) { - this.$message.warning(this.$t('test_track.case.import.upload_limit_count')); + this.$warning(this.$t('test_track.case.import.upload_limit_count')); }, UploadValidate(file) { var suffix =file.name.substring(file.name.lastIndexOf('.') + 1); if (suffix != 'xls' && suffix != 'xlsx') { - this.$message({ - message: this.$t('test_track.case.import.upload_limit_format'), - type: 'warning' - }); + this.$warning(this.$t('test_track.case.import.upload_limit_format')); return false; } if (file.size / 1024 / 1024 > 20) { - this.$message({ - message: this.$t('test_track.case.import.upload_limit_size'), - type: 'warning' - }); + this.$warning(this.$t('test_track.case.import.upload_limit_size')); return false; } return true; @@ -91,7 +85,7 @@ handleSuccess(response) { let res = response.data; if (res.success) { - this.$message.success(this.$t('test_track.case.import.success')); + this.$success(this.$t('test_track.case.import.success')); this.dialogVisible = false; this.$emit("refresh"); } else { @@ -100,7 +94,7 @@ this.fileList = []; }, handleError(err, file, fileList) { - this.$message.error(err.message); + this.$error(err.message); }, init() { this.fileList = []; diff --git a/frontend/src/business/components/track/case/components/TestCaseList.vue b/frontend/src/business/components/track/case/components/TestCaseList.vue index 8382a857f3..d6675c76a5 100644 --- a/frontend/src/business/components/track/case/components/TestCaseList.vue +++ b/frontend/src/business/components/track/case/components/TestCaseList.vue @@ -11,7 +11,7 @@ @@ -73,7 +73,8 @@ + :label="$t('commons.update_time')" + show-overflow-tooltip> @@ -213,10 +214,7 @@ let testCaseId = testCase.id; this.$post('/test/case/delete/' + testCaseId, {}, () => { this.initTableData(); - this.$message({ - message: this.$t('commons.delete_success'), - type: 'success' - }); + this.$success(this.$t('commons.delete_success')); }); }, refresh() { @@ -249,6 +247,9 @@ }, importTestCase() { this.$refs.testCaseImport.open(); + }, + moveToNode() { + this.$emit('moveToNode', this.selectIds); } } } diff --git a/frontend/src/business/components/track/case/components/TestCaseMove.vue b/frontend/src/business/components/track/case/components/TestCaseMove.vue new file mode 100644 index 0000000000..8d09f7ff1c --- /dev/null +++ b/frontend/src/business/components/track/case/components/TestCaseMove.vue @@ -0,0 +1,82 @@ + + + + + diff --git a/frontend/src/business/components/track/common/NodeEdit.vue b/frontend/src/business/components/track/common/NodeEdit.vue index 813a8bfb4a..1c0de65850 100644 --- a/frontend/src/business/components/track/common/NodeEdit.vue +++ b/frontend/src/business/components/track/common/NodeEdit.vue @@ -65,7 +65,7 @@ let param = {}; let url = this.buildParam(param); this.$post(url, param, () => { - this.$message.success(this.$t('commons.save_success')); + this.$success(this.$t('commons.save_success')); this.$emit('refresh'); this.close(); }); diff --git a/frontend/src/business/components/track/common/NodeTree.vue b/frontend/src/business/components/track/common/NodeTree.vue index 89dd1ae83a..d24d1d1491 100644 --- a/frontend/src/business/components/track/common/NodeTree.vue +++ b/frontend/src/business/components/track/common/NodeTree.vue @@ -118,7 +118,7 @@ const children = parent.data.children || parent.data; const index = children.findIndex(d => d.id === data.id); children.splice(index, 1); - this.$message.success(this.$t('commons.delete_success')); + this.$success(this.$t('commons.delete_success')); this.$emit("refresh"); }); } diff --git a/frontend/src/business/components/track/plan/components/TestPlanEdit.vue b/frontend/src/business/components/track/plan/components/TestPlanEdit.vue index 55524fd9bd..c2322c567c 100644 --- a/frontend/src/business/components/track/plan/components/TestPlanEdit.vue +++ b/frontend/src/business/components/track/plan/components/TestPlanEdit.vue @@ -151,7 +151,7 @@ Object.assign(param, this.form); param.workspaceId = localStorage.getItem(WORKSPACE_ID); this.$post('/test/plan/' + this.operationType, param, () => { - this.$message.success(this.$t('commons.save_success')); + this.$success(this.$t('commons.save_success')); this.dialogFormVisible = false; this.$emit("refresh"); }); @@ -165,10 +165,7 @@ if (response.success) { this.projects = response.data; } else { - this.$message()({ - type: 'warning', - message: response.message - }); + this.$warning()(response.message); } }); }, diff --git a/frontend/src/business/components/track/plan/components/TestPlanList.vue b/frontend/src/business/components/track/plan/components/TestPlanList.vue index db9b632f75..43ed79c494 100644 --- a/frontend/src/business/components/track/plan/components/TestPlanList.vue +++ b/frontend/src/business/components/track/plan/components/TestPlanList.vue @@ -48,13 +48,15 @@ show-overflow-tooltip> + :label="$t('commons.create_time')" + show-overflow-tooltip> + :label="$t('commons.update_time')" + show-overflow-tooltip> @@ -142,10 +144,7 @@ let testPlanId = testPlan.id; this.$post('/test/plan/delete/' + testPlanId, {}, () => { this.initTableData(); - this.$message({ - message: this.$t('commons.delete_success'), - type: 'success' - }); + this.$success(this.$t('commons.delete_success')); }); }, intoPlan(row, event, column) { diff --git a/frontend/src/business/components/track/plan/view/comonents/ExecutorEdit.vue b/frontend/src/business/components/track/plan/view/comonents/ExecutorEdit.vue index 29b1d02035..df639fd1f8 100644 --- a/frontend/src/business/components/track/plan/view/comonents/ExecutorEdit.vue +++ b/frontend/src/business/components/track/plan/view/comonents/ExecutorEdit.vue @@ -56,7 +56,7 @@ this.$post('/test/plan/case/batch/edit' , param, () => { this.executor = ''; this.selectIds.clear(); - this.$message.success(this.$t('commons.save_success')); + this.$success(this.$t('commons.save_success')); this.executorEditVisible = false; this.$emit('refresh'); }); diff --git a/frontend/src/business/components/track/plan/view/comonents/StatusEdit.vue b/frontend/src/business/components/track/plan/view/comonents/StatusEdit.vue index fb9f3f5404..2856a3da44 100644 --- a/frontend/src/business/components/track/plan/view/comonents/StatusEdit.vue +++ b/frontend/src/business/components/track/plan/view/comonents/StatusEdit.vue @@ -43,7 +43,7 @@ saveStatus() { let param = {}; if (this.status === '') { - this.$message.warning(this.$t('test_track.plan_view.select_execute_result')); + this.$warning(this.$t('test_track.plan_view.select_execute_result')); return; } param.status = this.status; @@ -51,7 +51,7 @@ this.$post('/test/plan/case/batch/edit' , param, () => { this.selectIds.clear(); this.status = ''; - this.$message.success(this.$t('commons.save_success')); + this.$success(this.$t('commons.save_success')); this.statusEditVisible = false; this.$emit('refresh'); }); diff --git a/frontend/src/business/components/track/plan/view/comonents/TestCaseRelevance.vue b/frontend/src/business/components/track/plan/view/comonents/TestCaseRelevance.vue index 3907d050ed..982f364708 100644 --- a/frontend/src/business/components/track/plan/view/comonents/TestCaseRelevance.vue +++ b/frontend/src/business/components/track/plan/view/comonents/TestCaseRelevance.vue @@ -96,7 +96,7 @@ param.testCaseIds = [...this.selectIds]; this.$post('/test/plan/relevance' , param, () => { this.selectIds.clear(); - this.$message.success("保存成功"); + this.$success("保存成功"); this.dialogFormVisible = false; this.$emit('refresh'); }); diff --git a/frontend/src/business/components/track/plan/view/comonents/TestPlanTestCaseEdit.vue b/frontend/src/business/components/track/plan/view/comonents/TestPlanTestCaseEdit.vue index 33a3b00d88..7b1ba02def 100644 --- a/frontend/src/business/components/track/plan/view/comonents/TestPlanTestCaseEdit.vue +++ b/frontend/src/business/components/track/plan/view/comonents/TestPlanTestCaseEdit.vue @@ -216,7 +216,7 @@ return; } this.$refs.drawer.closeDrawer(); - this.$message.success(this.$t('commons.save_success')); + this.$success(this.$t('commons.save_success')); this.$emit('refresh'); }); }, diff --git a/frontend/src/business/components/track/plan/view/comonents/TestPlanTestCaseList.vue b/frontend/src/business/components/track/plan/view/comonents/TestPlanTestCaseList.vue index 5444a9a4c8..3f28270253 100644 --- a/frontend/src/business/components/track/plan/view/comonents/TestPlanTestCaseList.vue +++ b/frontend/src/business/components/track/plan/view/comonents/TestPlanTestCaseList.vue @@ -29,7 +29,8 @@ + :label="$t('commons.name')" + show-overflow-tooltip> + :label="$t('commons.update_time')" + show-overflow-tooltip> @@ -230,10 +232,7 @@ let testCaseId = testCase.id; this.$post('/test/plan/case/delete/' + testCaseId, {}, () => { this.$emit("refresh"); - this.$message({ - message: this.$t('commons.delete_success'), - type: 'success' - }); + this.$success(this.$t('commons.delete_success')); }); }, handleSelectAll(selection) { @@ -254,7 +253,7 @@ }, handleBatch(type){ if (this.selectIds.size < 1) { - this.$message.warning(this.$t('test_track.plan_view.select_manipulate')); + this.$warning(this.$t('test_track.plan_view.select_manipulate')); return; } if (type === 'executor'){ diff --git a/frontend/src/i18n/en-US.js b/frontend/src/i18n/en-US.js index ed8b306484..02f6b7a3ff 100644 --- a/frontend/src/i18n/en-US.js +++ b/frontend/src/i18n/en-US.js @@ -185,10 +185,11 @@ export default { recent_plan: "Recent plan", recent_case: "Recent case", case: { - test_case: "Test Case", + test_case: "Test case", + move: "Move case", case_list: "Test Case List", create_case: "Create Case", - eitd_case: "Eidt Case", + edit_case: "Edit Case", no_project: "There is no project in this workspace, please create the project first", priority: "Priority", type: "Type", diff --git a/frontend/src/i18n/zh-CN.js b/frontend/src/i18n/zh-CN.js index 889731ee5b..895c2efb75 100644 --- a/frontend/src/i18n/zh-CN.js +++ b/frontend/src/i18n/zh-CN.js @@ -231,6 +231,7 @@ export default { recent_case: "最近的用例", case: { test_case: "测试用例", + move: "移动用例", case_list: "用例列表", create_case: "创建用例", edit_case: "编辑用例", From 25baf6f1331f778629faa469d2bd677c236bdcc9 Mon Sep 17 00:00:00 2001 From: shiziyuan9527 Date: Sun, 26 Apr 2020 17:42:26 +0800 Subject: [PATCH 09/13] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=97=A0=E7=94=A8?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../report/components/TestOverview.vue | 6 +++--- .../organization/OrganizationMember.vue | 5 ----- .../organization/OrganizationWorkspace.vue | 17 ----------------- .../components/settings/system/Organization.vue | 12 ------------ .../settings/system/SystemWorkspace.vue | 17 ----------------- .../settings/system/TestResourcePool.vue | 13 ------------- .../components/settings/system/User.vue | 8 -------- .../settings/workspace/WorkspaceMember.vue | 9 --------- 8 files changed, 3 insertions(+), 84 deletions(-) diff --git a/frontend/src/business/components/performance/report/components/TestOverview.vue b/frontend/src/business/components/performance/report/components/TestOverview.vue index 0ad89fcd56..8f04a363b4 100644 --- a/frontend/src/business/components/performance/report/components/TestOverview.vue +++ b/frontend/src/business/components/performance/report/components/TestOverview.vue @@ -305,9 +305,9 @@ const max = Math.max(...arr); return Math.ceil(max / 4.5) * 5; }, - _unique(arr){ - return Array.from(new Set(arr)); - } + _unique(arr) { + return Array.from(new Set(arr)); + } }, watch: { status() { diff --git a/frontend/src/business/components/settings/organization/OrganizationMember.vue b/frontend/src/business/components/settings/organization/OrganizationMember.vue index b9814fa6b4..7adee98ff6 100644 --- a/frontend/src/business/components/settings/organization/OrganizationMember.vue +++ b/frontend/src/business/components/settings/organization/OrganizationMember.vue @@ -246,11 +246,6 @@ diff --git a/frontend/src/business/components/settings/system/SystemWorkspace.vue b/frontend/src/business/components/settings/system/SystemWorkspace.vue index 5f51ee28b1..df8adc0939 100644 --- a/frontend/src/business/components/settings/system/SystemWorkspace.vue +++ b/frontend/src/business/components/settings/system/SystemWorkspace.vue @@ -458,24 +458,11 @@ diff --git a/frontend/src/business/components/settings/system/TestResourcePool.vue b/frontend/src/business/components/settings/system/TestResourcePool.vue index f10f2906f2..484aebda8c 100644 --- a/frontend/src/business/components/settings/system/TestResourcePool.vue +++ b/frontend/src/business/components/settings/system/TestResourcePool.vue @@ -422,19 +422,6 @@ diff --git a/frontend/src/business/components/settings/workspace/WorkspaceMember.vue b/frontend/src/business/components/settings/workspace/WorkspaceMember.vue index 715bff670c..3734d48a2f 100644 --- a/frontend/src/business/components/settings/workspace/WorkspaceMember.vue +++ b/frontend/src/business/components/settings/workspace/WorkspaceMember.vue @@ -255,20 +255,11 @@