diff --git a/frontend/src/views/plan/components/PlanHeader.vue b/frontend/src/views/plan/components/PlanHeader.vue index cca3358..dbce777 100644 --- a/frontend/src/views/plan/components/PlanHeader.vue +++ b/frontend/src/views/plan/components/PlanHeader.vue @@ -24,11 +24,11 @@ --> - + - 新建计划 + {{ getPlanButtonText }} @@ -54,6 +54,7 @@ @@ -131,4 +153,4 @@ const handleMenuClick = ({ key }: { key: string }) => { justify-content: center; } } - + \ No newline at end of file diff --git a/frontend/src/views/plan/components/PlanSelector.vue b/frontend/src/views/plan/components/PlanSelector.vue index a81a6bb..b610633 100644 --- a/frontend/src/views/plan/components/PlanSelector.vue +++ b/frontend/src/views/plan/components/PlanSelector.vue @@ -22,7 +22,12 @@ class="plan-button" > {{ plan.name }} - + {{ getPlanTypeLabel(plan.type) }} @@ -33,7 +38,6 @@ diff --git a/frontend/src/views/plan/index.vue b/frontend/src/views/plan/index.vue index 5b84e62..ac8fdd9 100644 --- a/frontend/src/views/plan/index.vue +++ b/frontend/src/views/plan/index.vue @@ -1,63 +1,66 @@ @@ -103,9 +106,11 @@ const tableData = ref>({}) const currentTableComponent = computed(() => { const currentPlan = planList.value.find(plan => plan.id === activePlanId.value) - const planType = currentPlan?.type || 'MaaPlan' + // 统一使用 MaaPlanConfig 作为默认类型 + const planType = + currentPlan?.type === 'MaaPlan' ? 'MaaPlanConfig' : currentPlan?.type || 'MaaPlanConfig' switch (planType) { - case 'MaaPlan': + case 'MaaPlanConfig': return MaaPlanTable default: return MaaPlanTable @@ -121,7 +126,7 @@ const debounce = any>(func: T, wait: number): T = }) as T } -const handleAddPlan = async (planType: string = 'MaaPlan') => { +const handleAddPlan = async (planType: string = 'MaaPlanConfig') => { try { const response = await createPlan(planType) const defaultName = getDefaultPlanName(planType) @@ -176,7 +181,7 @@ const saveInBackground = async (planId: string) => { const savePromise = (async () => { try { const currentPlan = planList.value.find(plan => plan.id === planId) - const planType = currentPlan?.type || 'MaaPlan' + const planType = currentPlan?.type || 'MaaPlanConfig' // Start from existing tableData, then overwrite Info explicitly const planData: Record = { ...(tableData.value || {}) } @@ -287,7 +292,7 @@ const initPlans = async () => { planList.value = response.index.map((item: any) => { const planId = item.uid const planData = response.data[planId] - const planType = planData?.Info?.Type || 'MaaPlan' + const planType = item.type === 'MaaPlan' ? 'MaaPlanConfig' : item.type || 'MaaPlanConfig' const planName = planData?.Info?.Name || getDefaultPlanName(planType) return { id: planId, name: planName, type: planType } }) @@ -306,28 +311,10 @@ const initPlans = async () => { } } -const savePlanData = async (planId?: string) => { - const targetPlanId = planId || activePlanId.value - if (!targetPlanId) return - - try { - const currentPlan = planList.value.find(plan => plan.id === targetPlanId) - const planType = currentPlan?.type || 'MaaPlan' - - const planData: Record = { ...(tableData.value || {}) } - planData.Info = { Mode: currentMode.value, Name: currentPlanName.value, Type: planType } - - await updatePlan(targetPlanId, planData) - } catch (error) { - console.error('保存计划数据失败:', error) - throw error - } -} - const getDefaultPlanName = (planType: string) => ( ({ - MaaPlan: '新 MAA 计划表', + MaaPlanConfig: '新 MAA 计划表', GeneralPlan: '新通用计划表', CustomPlan: '新自定义计划表', }) as Record @@ -335,7 +322,7 @@ const getDefaultPlanName = (planType: string) => const getPlanTypeLabel = (planType: string) => ( ({ - MaaPlan: 'MAA计划表', + MaaPlanConfig: 'MAA计划表', GeneralPlan: '通用计划表', CustomPlan: '自定义计划表', }) as Record diff --git a/frontend/src/views/plan/tables/MaaPlanTable.vue b/frontend/src/views/plan/tables/MaaPlanTable.vue index 1401524..12e6847 100644 --- a/frontend/src/views/plan/tables/MaaPlanTable.vue +++ b/frontend/src/views/plan/tables/MaaPlanTable.vue @@ -178,7 +178,7 @@