This commit is contained in:
2025-10-20 14:54:52 +08:00
parent c68dff6123
commit 96c36f9ce1
2 changed files with 11 additions and 11 deletions

View File

@@ -158,7 +158,7 @@ export default {
this.error = null;
try {
const response = await apiClient.plans.list();
const response = await apiClient.plans.getPlans(); // 更正此处
let fetchedPlans = response.data?.plans || [];
// Default sort by ID ascending
fetchedPlans.sort((a, b) => a.id - b.id);
@@ -262,7 +262,7 @@ export default {
type: 'warning'
});
await apiClient.plans.delete(plan.id);
await apiClient.plans.deletePlan(plan.id);
this.$message.success('删除成功');
await this.loadPlans();
} catch (err) {
@@ -275,7 +275,7 @@ export default {
async startPlan(plan) {
try {
this.startingPlanId = plan.id;
await apiClient.plans.start(plan.id);
await apiClient.plans.startPlan(plan.id);
this.$message.success('计划启动成功');
await this.loadPlans();
} catch (err) {
@@ -288,7 +288,7 @@ export default {
async stopPlan(plan) {
try {
this.stoppingPlanId = plan.id;
await apiClient.plans.stop(plan.id);
await apiClient.plans.stopPlan(plan.id);
this.$message.success('计划停止成功');
await this.loadPlans();
} catch (err) {
@@ -303,7 +303,7 @@ export default {
try {
if (this.isEdit) {
// 编辑计划
await apiClient.plans.update(planData.id, planData);
await apiClient.plans.updatePlan(planData.id, planData);
this.$message.success('计划更新成功');
} else {
// 添加新计划
@@ -312,7 +312,7 @@ export default {
content_type: 'tasks' // 默认使用任务类型
};
await apiClient.plans.create(planRequest);
await apiClient.plans.createPlan(planRequest);
this.$message.success('计划添加成功');
}