diff --git a/frontend/src/utils/index.ts b/frontend/src/utils/index.ts index 95af3c03e0..c5ee172d64 100644 --- a/frontend/src/utils/index.ts +++ b/frontend/src/utils/index.ts @@ -903,7 +903,7 @@ export function getCustomFieldIndex(field: CustomFieldItem) { // 表格自定义字段转column export function customFieldToColumns(customFields: CustomFieldItem[]) { return customFields.map((field) => { - const { fieldName, fieldKey, fieldId } = field; + const { fieldName, fieldKey, fieldId, options, platformOptionJson } = field; const column: MsTableColumnData = { title: fieldName, dataIndex: ['handleUser', 'status'].includes(fieldId) ? fieldKey : getCustomFieldIndex(field), @@ -911,6 +911,7 @@ export function customFieldToColumns(customFields: CustomFieldItem[]) { showDrag: true, showInTable: true, width: 200, + options: options || JSON.parse(platformOptionJson), }; return column; }); diff --git a/frontend/src/views/bug-management/index.vue b/frontend/src/views/bug-management/index.vue index 7e8f719761..0ca1310d56 100644 --- a/frontend/src/views/bug-management/index.vue +++ b/frontend/src/views/bug-management/index.vue @@ -167,7 +167,6 @@ import { useRoute } from 'vue-router'; import { useIntervalFn } from '@vueuse/core'; import { Message, TableData } from '@arco-design/web-vue'; - import { cloneDeep } from 'lodash-es'; import { MsAdvanceFilter, timeSelectOptions } from '@/components/pure/ms-advance-filter'; import { BackEndEnum, FilterFormItem, FilterResult, FilterType } from '@/components/pure/ms-advance-filter/type'; @@ -784,12 +783,14 @@ async function getColumnHeaders() { try { customColumns = await getCustomFieldColumns(); + console.log(customColumns); customColumns.forEach((item) => { + // 目前自定义字段的过滤只支持严重程度 if (item.title === '严重程度' || item.title === 'Bug Degree') { item.showInTable = true; item.slotName = 'severity'; item.filterConfig = { - options: cloneDeep(unref(severityFilterOptions.value)) || [], + options: item.options || [], labelKey: 'text', }; } else {