From aa0dbb0a3c94bbce4a6d0314e1fb5dd5c3e504c2 Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Wed, 9 Jun 2021 11:24:52 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=88=97=E8=A1=A8=E5=B1=95=E7=A4=BA?= =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../scenario/api/RelevanceCaseList.vue | 130 +++++++----------- .../components/list/ApiCaseSimpleList.vue | 7 - .../components/table/Ms-table-column.vue | 2 +- .../track/case/components/TestCaseList.vue | 31 ++--- .../components/track/issue/IssueList.vue | 17 +-- frontend/src/common/js/custom_field.js | 14 ++ .../src/common/js/default-table-header.js | 13 +- 7 files changed, 94 insertions(+), 120 deletions(-) diff --git a/frontend/src/business/components/api/automation/scenario/api/RelevanceCaseList.vue b/frontend/src/business/components/api/automation/scenario/api/RelevanceCaseList.vue index 75036ec946..cf5342936e 100644 --- a/frontend/src/business/components/api/automation/scenario/api/RelevanceCaseList.vue +++ b/frontend/src/business/components/api/automation/scenario/api/RelevanceCaseList.vue @@ -17,87 +17,66 @@ operator-width="170px" ref="table" > - + + + @@ -121,12 +100,11 @@ import MsBottomContainer from "../../../definition/components/BottomContainer"; import ShowMoreBtn from "../../../../track/case/components/ShowMoreBtn"; import MsBatchEdit from "../../../definition/components/basis/BatchEdit"; import {API_METHOD_COLOUR, CASE_PRIORITY} from "../../../definition/model/JsonData"; -import {getCurrentProjectID} from "@/common/js/utils"; import ApiListContainer from "../../../definition/components/list/ApiListContainer"; import PriorityTableItem from "../../../../track/common/tableItems/planview/PriorityTableItem"; import MsEnvironmentSelect from "../../../definition/components/case/MsEnvironmentSelect"; import TableSelectCountBar from "./TableSelectCountBar"; -import {_filter, _handleSelect, _handleSelectAll, _sort, buildBatchParam, getLabel} from "@/common/js/tableUtils"; +import {_filter, _sort, buildBatchParam} from "@/common/js/tableUtils"; import {API_CASE_LIST} from "@/common/js/constants"; export default { @@ -152,7 +130,6 @@ export default { selectCase: {}, result: {}, moduleId: "", - tableLabel: [], typeArr: [ {id: 'priority', name: this.$t('test_track.case.priority')}, ], @@ -256,7 +233,6 @@ export default { } }); }); - getLabel(this, API_CASE_LIST); }, clear() { if (this.$refs.table) { diff --git a/frontend/src/business/components/api/definition/components/list/ApiCaseSimpleList.vue b/frontend/src/business/components/api/definition/components/list/ApiCaseSimpleList.vue index efd6d8af04..3ded0e6ac1 100644 --- a/frontend/src/business/components/api/definition/components/list/ApiCaseSimpleList.vue +++ b/frontend/src/business/components/api/definition/components/list/ApiCaseSimpleList.vue @@ -675,11 +675,4 @@ export default { top: -2px; } -/deep/ .el-table__fixed { - height: 100% !important; -} - -/deep/ .el-table__fixed-body-wrapper { - top: 60px !important; -} diff --git a/frontend/src/business/components/common/components/table/Ms-table-column.vue b/frontend/src/business/components/common/components/table/Ms-table-column.vue index 113fe4dd1c..1ff4370c44 100644 --- a/frontend/src/business/components/common/components/table/Ms-table-column.vue +++ b/frontend/src/business/components/common/components/table/Ms-table-column.vue @@ -25,7 +25,7 @@ export default { prop: String, label: String, width: String, - minWidth: String, + minWidth: [String, Number], fixed: String, // 排序列, 后端mapper处理filters filters: Array, diff --git a/frontend/src/business/components/track/case/components/TestCaseList.vue b/frontend/src/business/components/track/case/components/TestCaseList.vue index cd6b855acc..00661fa802 100644 --- a/frontend/src/business/components/track/case/components/TestCaseList.vue +++ b/frontend/src/business/components/track/case/components/TestCaseList.vue @@ -61,18 +61,6 @@ :label="$t('custom_field.case_maintainer')" min-width="120"/> - - - - + @@ -118,12 +107,19 @@ @@ -428,6 +424,7 @@ export default { this.condition.filters.reviewStatus = [this.selectDataRange]; break; } + this.condition.filters.priority = this.condition.filters['用例等级']; if (this.projectId) { this.condition.projectId = this.projectId; this.$emit('setCondition', this.condition); @@ -437,11 +434,11 @@ export default { this.page.data = data.listObject; // this.selectIds.clear(); this.$refs.table.clear(); - /*this.tableData.forEach(item => { - if (item.tags && item.tags.length > 0) { - item.tags = JSON.parse(item.tags); + this.page.data.forEach(item => { + if (item.customFields) { + item.customFields = JSON.parse(item.customFields); } - })*/ + }); this.page.data.forEach((item) => { item.tags = JSON.parse(item.tags); }); diff --git a/frontend/src/business/components/track/issue/IssueList.vue b/frontend/src/business/components/track/issue/IssueList.vue index 332b0c2391..d5941b0091 100644 --- a/frontend/src/business/components/track/issue/IssueList.vue +++ b/frontend/src/business/components/track/issue/IssueList.vue @@ -48,16 +48,6 @@ prop="title"> - - - - diff --git a/frontend/src/common/js/custom_field.js b/frontend/src/common/js/custom_field.js index eb2ff3fe1c..e3d9df2c26 100644 --- a/frontend/src/common/js/custom_field.js +++ b/frontend/src/common/js/custom_field.js @@ -86,6 +86,20 @@ export function buildCustomFields(data, param, template) { data.customFields = []; } let customFields = data.customFields; + + // 去重操作 + if (customFields) { + let nameSet = new Set(); + for(let i = customFields.length - 1; i >= 0; i--){ + let name = customFields[i].name; + if(nameSet.has(name)){ + customFields.splice(i,1); + } + nameSet.add(name); + } + + } + template.customFields.forEach(item => { let hasField = false; for (const index in customFields) { diff --git a/frontend/src/common/js/default-table-header.js b/frontend/src/common/js/default-table-header.js index 862a5bd0ca..61e649dd46 100644 --- a/frontend/src/common/js/default-table-header.js +++ b/frontend/src/common/js/default-table-header.js @@ -175,13 +175,12 @@ export const CUSTOM_TABLE_HEADER = { TRACK_TEST_CASE: [ {id: 'num', key: '1', label: i18n.t('commons.id')}, {id: 'name', key: '2', label: i18n.t('commons.name')}, - {id: 'priority', key: '3', label: i18n.t('test_track.case.priority')}, - {id: 'reviewStatus', key: '4', label: i18n.t('test_track.case.status')}, - {id: 'tags', key: '5', label: i18n.t('commons.tag')}, - {id: 'nodePath', key: '6', label: i18n.t('test_track.case.module')}, - {id: 'updateTime', key: '7', label: i18n.t('commons.update_time')}, - {id: 'createUser', key: '8', label: i18n.t('commons.create_user')}, - {id: 'maintainer', key: '9', label: i18n.t('custom_field.case_maintainer')}, + {id: 'reviewStatus', key: '3', label: i18n.t('test_track.case.status')}, + {id: 'tags', key: '4', label: i18n.t('commons.tag')}, + {id: 'nodePath', key: '5', label: i18n.t('test_track.case.module')}, + {id: 'updateTime', key: '6', label: i18n.t('commons.update_time')}, + {id: 'createUser', key: '7', label: i18n.t('commons.create_user')}, + {id: 'maintainer', key: '8', label: i18n.t('custom_field.case_maintainer')}, ], //缺陷列表 ISSUE_LIST: [