原型阶段

This commit is contained in:
2026-06-09 23:44:31 +08:00
parent ea1d0fb3bd
commit 01b3375395
22 changed files with 1077 additions and 27 deletions
+44 -2
View File
@@ -1,6 +1,12 @@
import { defineStore } from 'pinia'
import { ref } from 'vue'
import { projectsApi, type Phase, type Requirement, type Status } from '@/api/projects'
import {
projectsApi,
type Phase,
type Prototype,
type Requirement,
type Status,
} from '@/api/projects'
export const useRequirementsStore = defineStore('requirements', () => {
const items = ref<Requirement[]>([])
@@ -45,5 +51,41 @@ export const useRequirementsStore = defineStore('requirements', () => {
await refresh(forSlug)
}
return { items, slug, loading, filterPhase, filterStatus, refresh, create, changePhase, close, reopen }
async function listPrototypes(forSlug: string, number: number): Promise<Prototype[]> {
const out = await projectsApi.listPrototypes(forSlug, number)
return out.prototypes
}
async function createPrototype(
forSlug: string,
number: number,
body: { content: string; note?: string },
): Promise<Prototype> {
return await projectsApi.createPrototype(forSlug, number, body)
}
async function getPrototype(
forSlug: string,
number: number,
version: number,
): Promise<Prototype> {
const out = await projectsApi.getPrototype(forSlug, number, version)
return out.prototype
}
return {
items,
slug,
loading,
filterPhase,
filterStatus,
refresh,
create,
changePhase,
close,
reopen,
listPrototypes,
createPrototype,
getPrototype,
}
})