From 64a8dccc8de279a8a8a5d998ede7705b455165a1 Mon Sep 17 00:00:00 2001 From: "xinxin.wu" Date: Wed, 13 Mar 2024 12:47:50 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E7=BC=BA=E9=99=B7=E7=AE=A1=E7=90=86):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=BC=BA=E9=99=B7=E7=B4=A7=E6=80=A5=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E9=A1=B5=E9=9D=A2=E7=A9=BA=E7=99=BDbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/bug-management/index.vue | 35 +++++++++++++-------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/frontend/src/views/bug-management/index.vue b/frontend/src/views/bug-management/index.vue index ac5847e378..0d443f5551 100644 --- a/frontend/src/views/bug-management/index.vue +++ b/frontend/src/views/bug-management/index.vue @@ -247,7 +247,7 @@ tableParamsToRequestParams, } from '@/utils'; - import { BugEditCustomField, BugListItem, BugOptionItem, BugOptionListItem } from '@/models/bug-management'; + import { BugEditCustomField, BugListItem, BugOptionItem } from '@/models/bug-management'; import { RouteEnum } from '@/enums/routeEnum'; import { TableKeyEnum } from '@/enums/tableEnum'; @@ -474,18 +474,6 @@ width: 158, }, ]; - const customColumns = await getCustomFieldColumns(); - - customColumns.forEach((item) => { - if (item.title === '严重程度' || item.title === 'Bug Degree') { - item.showInTable = true; - item.titleSlotName = 'severityFilter'; - item.slotName = 'severity'; - } else { - item.showInTable = false; - } - }); - await tableStore.initColumn(TableKeyEnum.BUG_MANAGEMENT, columns.concat(customColumns), 'drawer'); const { propsRes, propsEvent, setKeyword, setAdvanceFilter, setLoadListParams, setProps, resetSelector, loadList } = useTable( @@ -801,6 +789,27 @@ handleShowDetail(route.query.id as string, 0); } }); + + let customColumns: MsTableColumn = []; + async function getColumnHeaders() { + try { + customColumns = await getCustomFieldColumns(); + customColumns.forEach((item) => { + if (item.title === '严重程度' || item.title === 'Bug Degree') { + item.showInTable = true; + item.titleSlotName = 'severityFilter'; + item.slotName = 'severity'; + } else { + item.showInTable = false; + } + }); + } catch (error) { + console.log(error); + } + } + await getColumnHeaders(); + + await tableStore.initColumn(TableKeyEnum.BUG_MANAGEMENT, columns.concat(customColumns), 'drawer'); onUnmounted(() => { // 组件销毁时关闭轮询 pause();