fix(web-admin): 项目业务类型下拉去掉中试服务可选 (#162)

新建不可选中试;旧项目已含 pilot_service 时编辑仍展示该选项。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
zlwuandCursor committed 2026-11-20 15:15:54 +08:00
1 parent f7890f5560
commit a598b17ab9
3 files changed
+48 -5

No files matched your search

+18
View File
@@ -1,5 +1,23 @@
import type { BizType, ProjectRecord } from '@/api/project-management'
/**
* 项目新建/编辑弹窗「业务类型」选项。
* 中试服务已下线:默认不可选;若旧项目已含 pilot_service 则保留展示。
*/
export function projectBizTypeSelectLabels(
allLabels: Record<string, string>,
selectedBizTypes?: string[] | null
): Record<string, string> {
const selected = new Set((selectedBizTypes || []).filter(Boolean))
return Object.fromEntries(
Object.entries(allLabels).filter(([key]) => {
if (key === 'presign') return false
if (key === 'pilot_service') return selected.has('pilot_service')
return true
})
)
}
/** Drill-down uses the last successful statistics query, never unsaved filter edits. */
export function buildDrillFilters(
applied: ProjectRecord,