diff --git a/frontend/src/api/faqs.ts b/frontend/src/api/faqs.ts new file mode 100644 index 00000000..ee4cb310 --- /dev/null +++ b/frontend/src/api/faqs.ts @@ -0,0 +1,47 @@ +import { apiGet, apiPatch, apiPost } from "./axios"; +import type { AxiosResponse } from "axios"; +import type { ApiListResponse } from "../types/api"; + +export interface FaqCategory { + id: string; + study_id?: string | null; + name: string; + description?: string | null; + sort_order: number; + is_active: boolean; + created_at: string; + updated_at: string; +} + +export interface FaqItem { + id: string; + study_id?: string | null; + category_id: string; + question: string; + answer: string; + keywords?: string | null; + version: number; + is_active: boolean; + created_by?: string; + created_at: string; + updated_at: string; +} + +export const fetchFaqCategories = (params?: Record): Promise>> => + apiGet("/api/v1/faqs/categories", { params }); + +export const createFaqCategory = (payload: Record) => + apiPost("/api/v1/faqs/categories", payload); + +export const updateFaqCategory = (categoryId: string, payload: Record) => + apiPatch(`/api/v1/faqs/categories/${categoryId}`, payload); + +export const fetchFaqItems = (params?: Record): Promise>> => + apiGet("/api/v1/faqs/items", { params }); + +export const fetchFaqItem = (itemId: string) => apiGet(`/api/v1/faqs/items/${itemId}`); + +export const createFaqItem = (payload: Record) => apiPost("/api/v1/faqs/items", payload); + +export const updateFaqItem = (itemId: string, payload: Record) => + apiPatch(`/api/v1/faqs/items/${itemId}`, payload); diff --git a/frontend/src/components/FaqCategoryForm.vue b/frontend/src/components/FaqCategoryForm.vue new file mode 100644 index 00000000..cf10bb7a --- /dev/null +++ b/frontend/src/components/FaqCategoryForm.vue @@ -0,0 +1,106 @@ + + + diff --git a/frontend/src/components/FaqCategoryPanel.vue b/frontend/src/components/FaqCategoryPanel.vue new file mode 100644 index 00000000..3dcd72c4 --- /dev/null +++ b/frontend/src/components/FaqCategoryPanel.vue @@ -0,0 +1,87 @@ + + + + + diff --git a/frontend/src/components/FaqItemForm.vue b/frontend/src/components/FaqItemForm.vue new file mode 100644 index 00000000..fdb12527 --- /dev/null +++ b/frontend/src/components/FaqItemForm.vue @@ -0,0 +1,114 @@ + + + diff --git a/frontend/src/components/FaqList.vue b/frontend/src/components/FaqList.vue new file mode 100644 index 00000000..882dc74c --- /dev/null +++ b/frontend/src/components/FaqList.vue @@ -0,0 +1,78 @@ + + + diff --git a/frontend/src/router/index.ts b/frontend/src/router/index.ts index a03f2df3..86d11fe5 100644 --- a/frontend/src/router/index.ts +++ b/frontend/src/router/index.ts @@ -22,6 +22,7 @@ import ImpTransactions from "../views/ImpTransactions.vue"; import Finance from "../views/Finance.vue"; import FinanceDetail from "../views/FinanceDetail.vue"; import Faq from "../views/Faq.vue"; +import FaqDetail from "../views/FaqDetail.vue"; import Issues from "../views/Issues.vue"; import IssueDetail from "../views/IssueDetail.vue"; import Verification from "../views/Verification.vue"; @@ -158,6 +159,12 @@ const routes: RouteRecordRaw[] = [ component: Faq, meta: { title: "FAQ", requiresStudy: true }, }, + { + path: "study/faq/:itemId", + name: "StudyFaqDetail", + component: FaqDetail, + meta: { title: "FAQ 详情", requiresStudy: true }, + }, { path: "study/verifications", name: "StudyVerifications", diff --git a/frontend/src/views/Faq.vue b/frontend/src/views/Faq.vue index de89b9a3..73430ad8 100644 --- a/frontend/src/views/Faq.vue +++ b/frontend/src/views/Faq.vue @@ -1,13 +1,163 @@ - + diff --git a/frontend/src/views/FaqDetail.vue b/frontend/src/views/FaqDetail.vue new file mode 100644 index 00000000..d4dab361 --- /dev/null +++ b/frontend/src/views/FaqDetail.vue @@ -0,0 +1,78 @@ + + + + + diff --git a/pg_data/base/16384/24576 b/pg_data/base/16384/24576 index 691daa8e..cc9392cf 100644 Binary files a/pg_data/base/16384/24576 and b/pg_data/base/16384/24576 differ diff --git a/pg_data/base/16384/24584 b/pg_data/base/16384/24584 index 026d272f..79d2388d 100644 Binary files a/pg_data/base/16384/24584 and b/pg_data/base/16384/24584 differ diff --git a/pg_data/base/16384/24653 b/pg_data/base/16384/24653 index aee0b989..29cfa397 100644 Binary files a/pg_data/base/16384/24653 and b/pg_data/base/16384/24653 differ diff --git a/pg_data/base/16384/24659 b/pg_data/base/16384/24659 index 9f306113..01d86bf7 100644 Binary files a/pg_data/base/16384/24659 and b/pg_data/base/16384/24659 differ diff --git a/pg_data/base/16384/24727 b/pg_data/base/16384/24727 index e69de29b..186d74ba 100644 Binary files a/pg_data/base/16384/24727 and b/pg_data/base/16384/24727 differ diff --git a/pg_data/base/16384/24734 b/pg_data/base/16384/24734 index fe032846..87857928 100644 Binary files a/pg_data/base/16384/24734 and b/pg_data/base/16384/24734 differ diff --git a/pg_data/base/16384/24736 b/pg_data/base/16384/24736 index 67504602..adb46673 100644 Binary files a/pg_data/base/16384/24736 and b/pg_data/base/16384/24736 differ diff --git a/pg_data/base/16384/24743 b/pg_data/base/16384/24743 index 3f5ee209..d399f8be 100644 Binary files a/pg_data/base/16384/24743 and b/pg_data/base/16384/24743 differ diff --git a/pg_data/base/16384/24818 b/pg_data/base/16384/24818 index e69de29b..0c5cbde3 100644 Binary files a/pg_data/base/16384/24818 and b/pg_data/base/16384/24818 differ diff --git a/pg_data/base/16384/24825 b/pg_data/base/16384/24825 index 2d6cac64..6bb9c161 100644 Binary files a/pg_data/base/16384/24825 and b/pg_data/base/16384/24825 differ diff --git a/pg_data/base/16384/24842 b/pg_data/base/16384/24842 index 6447b560..8c19f26c 100644 Binary files a/pg_data/base/16384/24842 and b/pg_data/base/16384/24842 differ diff --git a/pg_data/base/16384/24843 b/pg_data/base/16384/24843 index 8ce8442a..04bab2e8 100644 Binary files a/pg_data/base/16384/24843 and b/pg_data/base/16384/24843 differ diff --git a/pg_data/base/16384/2604 b/pg_data/base/16384/2604 index 1456965e..aade99f3 100644 Binary files a/pg_data/base/16384/2604 and b/pg_data/base/16384/2604 differ diff --git a/pg_data/global/pg_control b/pg_data/global/pg_control index d3aaf337..5f237d5a 100644 Binary files a/pg_data/global/pg_control and b/pg_data/global/pg_control differ diff --git a/pg_data/pg_wal/000000010000000000000001 b/pg_data/pg_wal/000000010000000000000001 index bff5effe..619a7624 100644 Binary files a/pg_data/pg_wal/000000010000000000000001 and b/pg_data/pg_wal/000000010000000000000001 differ diff --git a/pg_data/pg_xact/0000 b/pg_data/pg_xact/0000 index 6f73d0ee..1e1b817e 100644 Binary files a/pg_data/pg_xact/0000 and b/pg_data/pg_xact/0000 differ