feat: 优化排课管理

This commit is contained in:
richarjiang
2026-04-15 23:25:09 +08:00
parent 6ab16f508a
commit 4dacd908a6
14 changed files with 71 additions and 765 deletions

View File

@@ -2,8 +2,6 @@ import { defineStore } from 'pinia'
import { ref } from 'vue'
import { get, post, put, del } from '../utils/request'
import type {
WeekTemplate,
WeekTemplateInput,
CardType,
CreateCardTypeDto,
UpdateCardTypeDto,
@@ -86,21 +84,6 @@ export interface UserMembership {
}
export const useAdminStore = defineStore('admin', () => {
// ── Week templates ───────────────────────────────────────────────
const weekTemplates = ref<WeekTemplate[]>([])
async function fetchWeekTemplates(): Promise<WeekTemplate[]> {
const data = await get<WeekTemplate[]>('/admin/week-template')
weekTemplates.value = data
return data
}
async function saveWeekTemplates(templates: WeekTemplateInput[]): Promise<WeekTemplate[]> {
const data = await put<WeekTemplate[]>('/admin/week-template', { templates })
weekTemplates.value = data
return data
}
// ── Card types ───────────────────────────────────────────────────
const cardTypes = ref<CardType[]>([])
@@ -273,14 +256,10 @@ export const useAdminStore = defineStore('admin', () => {
return {
// State
weekTemplates,
cardTypes,
studioConfig,
schedulePreview,
scheduleLoading,
// Week templates
fetchWeekTemplates,
saveWeekTemplates,
// Card types
fetchCardTypes,
createCardType,