From ced95d006af8d22567d8aaf3fab188b6bc63e33b Mon Sep 17 00:00:00 2001 From: claude_dev Date: Thu, 13 Aug 2026 20:33:49 +0800 Subject: [PATCH] =?UTF-8?q?feat(strategy):=20=E4=BB=A3=E7=A0=81=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E6=96=87=E4=BB=B6=E6=A0=91=E6=8C=89=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E5=88=86=E7=BB=84(=E7=BB=84=E5=90=88=E7=AD=96=E7=95=A5/?= =?UTF-8?q?=E4=B8=AA=E8=82=A1=E7=AD=96=E7=95=A5+=E6=95=B0=E9=87=8F?= =?UTF-8?q?=E5=BE=BD=E6=A0=87)=20[nas]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/strategy/Code.vue | 54 +++++++++++++++++++++------- 1 file changed, 41 insertions(+), 13 deletions(-) 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;