You've already forked agentic-coding-workflow
原型阶段
This commit is contained in:
@@ -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,
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user