diff --git a/frontend/src/views/strategy/Code.vue b/frontend/src/views/strategy/Code.vue index 7cd522f..f3a8ee8 100644 --- a/frontend/src/views/strategy/Code.vue +++ b/frontend/src/views/strategy/Code.vue @@ -26,6 +26,12 @@ const syntaxOk = ref(null) const active = computed(() => files.value.find((f) => f.name === activeName.value)) +// 文件树按类型分组:组合策略在前(常用),个股策略在后 +const fileGroups = computed(() => [ + { label: '组合策略', items: files.value.filter((f) => f.type === 'portfolio') }, + { label: '个股策略', items: files.value.filter((f) => f.type !== 'portfolio') }, +].filter((g) => g.items.length)) + onMounted(async () => { try { const { data } = await apiClient.get<{ files: StrategyFile[] }>('/strategy/files') @@ -115,20 +121,26 @@ function runBacktest(): void {
策略文件
-
- -
- {{ f.name }} - {{ f.class_name }} +
@@ -200,6 +212,22 @@ function runBacktest(): void { background: var(--brand); box-shadow: 0 0 8px rgba(0, 229, 255, 0.6); } +.tree-group { + display: flex; + align-items: center; + gap: 6px; + padding: 8px 14px 4px; + font-size: 11px; + font-weight: 600; + color: var(--text-2); +} +.tree-count { + font-size: 10px; + color: var(--text-3); + background: var(--bg-hover); + border-radius: 8px; + padding: 0 6px; +} .tree-item { display: flex; align-items: center;