fix(web): 因子详情「查看完整 tears 报告」从裸跳老页改为带因子名预填——原占位跳转不带上下文,用户看到的像部署了旧页;现经 query.factor 预填老分析页因子选择器(排行榜深挖单因子的正路);npm run build 绿 [nas]
This commit is contained in:
@@ -34,7 +34,8 @@ function goBack() {
|
||||
}
|
||||
|
||||
function goToNewFactor() {
|
||||
router.push('/factor/new')
|
||||
// 桥接到老因子分析页(alphalens 完整 tears),带因子名预填
|
||||
router.push({ path: '/factor/new', query: { factor: detail.value?.factor || '' } })
|
||||
}
|
||||
|
||||
const currentMetrics = computed(() => {
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, computed, onMounted } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { getFactors, submitFactor, type FactorItem } from '@/api/factor'
|
||||
import { disableFutureDate } from '@/utils/dates'
|
||||
|
||||
const router = useRouter()
|
||||
const route = useRoute()
|
||||
const factors = ref<FactorItem[]>([])
|
||||
const loading = ref(false)
|
||||
const submitting = ref(false)
|
||||
@@ -35,6 +36,11 @@ onMounted(async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
factors.value = await getFactors()
|
||||
// 从排行榜详情「查看完整 tears 报告」跳入时预填该因子
|
||||
const qf = route.query.factor as string | undefined
|
||||
if (qf && factors.value.some((f) => f.name === qf)) {
|
||||
form.factor_names = [qf]
|
||||
}
|
||||
} catch {
|
||||
ElMessage.error('因子列表加载失败')
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user