From a3946013f5a1d781b271861c6c4fc58154fb6a43 Mon Sep 17 00:00:00 2001 From: Nelson <1475262689@qq.com> Date: Fri, 31 Jul 2026 18:49:48 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E6=9D=83=E7=9B=8A?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=B9=B6=E5=AE=8C=E6=88=90=E4=B8=80=E6=9C=9F?= =?UTF-8?q?=E9=AA=8C=E6=94=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../apps/admin-web/src/App.vue | 161 +---- .../components/EntitlementManagementView.vue | 576 ++++++++++++++++++ .../apps/admin-web/src/styles.css | 72 --- .../0008_unique_knowledge_feishu_node.py | 10 +- .../0009_log_retention_storage_indexes.py | 11 +- .../versions/0013_question_insight_indexes.py | 11 +- .../versions/0014_entitlements_topics.py | 45 +- .../alembic/versions/0015_growth_profiles.py | 14 +- .../versions/0016_teacher_help_cards.py | 10 +- .../alembic/versions/0017_share_drafts.py | 10 +- .../alembic/versions/0018_ai_cost_tracking.py | 19 +- .../deployment/RELEASE_CHECKLIST.md | 7 + .../docs/qianwen_product_todo.md | 6 +- .../docs/一期全链路验收记录.md | 72 +++ 14 files changed, 740 insertions(+), 284 deletions(-) create mode 100644 ai_knowledge_base_v2/apps/admin-web/src/components/EntitlementManagementView.vue create mode 100644 ai_knowledge_base_v2/docs/一期全链路验收记录.md diff --git a/ai_knowledge_base_v2/apps/admin-web/src/App.vue b/ai_knowledge_base_v2/apps/admin-web/src/App.vue index 0c5f1f8..e301432 100644 --- a/ai_knowledge_base_v2/apps/admin-web/src/App.vue +++ b/ai_knowledge_base_v2/apps/admin-web/src/App.vue @@ -5,6 +5,7 @@ import { computed, nextTick, onMounted, reactive, ref, watch } from "vue"; import AdminLoginView from "./components/AdminLoginView.vue"; import AdminPagination from "./components/AdminPagination.vue"; import AgentManagementView from "./components/AgentManagementView.vue"; +import EntitlementManagementView from "./components/EntitlementManagementView.vue"; import KnowledgeManagementView from "./components/KnowledgeManagementView.vue"; import TableRowActions from "./components/TableRowActions.vue"; import { systemSettingDefinitions, systemSettingSections, type SystemSettingValue } from "./config/systemSettings"; @@ -48,7 +49,6 @@ const userDetailLoading = ref(false); const userReportGenerating = ref(""); const userKeyword = ref(""); const entitlementPlans = ref([]); -const editingEntitlementPlanId = ref(null); const models = ref([]); const configs = ref([]); const chats = ref([]); @@ -96,21 +96,6 @@ const studentImportFile = ref(null); const studentImportInput = ref(null); const studentImportResult = ref(null); -const entitlementPlanForm = reactive({ - name: "", - planType: "basic" as "basic" | "deep" | "addon", - description: "", - validityDays: null as number | null, - monthlyTopicLimit: 30 as number | null, - enableGrowthProfile: 0, - enablePeriodicReports: 0, - allowHelpCard: 1, - allowShareDraft: 1, - deductQuota: 1, - status: 1, - sortOrder: 10, -}); - const knowledgeForm = reactive({ name: "", feishuSpaceId: "", @@ -349,67 +334,6 @@ async function loadEntitlementPlans() { entitlementPlans.value = await api.entitlementPlans(true); } -function planTypeLabel(type: string) { - return { - basic: "基础版", - deep: "深度陪伴版", - addon: "高频加购包", - }[type] || type; -} - -async function saveEntitlementPlan() { - if (!entitlementPlanForm.name.trim()) { - ElMessage.warning("请填写权益版本名称"); - return; - } - const payload = { ...entitlementPlanForm }; - if (editingEntitlementPlanId.value) { - await api.updateEntitlementPlan(editingEntitlementPlanId.value, payload); - ElMessage.success("权益版本已更新"); - } else { - await api.createEntitlementPlan(payload); - ElMessage.success("权益版本已新增"); - } - resetEntitlementPlanForm(); - await loadEntitlementPlans(); -} - -function editEntitlementPlan(row: EntitlementPlan) { - editingEntitlementPlanId.value = row.id; - Object.assign(entitlementPlanForm, { - name: row.name, - planType: row.planType, - description: row.description ?? "", - validityDays: row.validityDays ?? null, - monthlyTopicLimit: row.monthlyTopicLimit ?? null, - enableGrowthProfile: row.enableGrowthProfile ? 1 : 0, - enablePeriodicReports: row.enablePeriodicReports ? 1 : 0, - allowHelpCard: row.allowHelpCard ? 1 : 0, - allowShareDraft: row.allowShareDraft ? 1 : 0, - deductQuota: row.deductQuota ? 1 : 0, - status: row.status, - sortOrder: row.sortOrder, - }); -} - -function resetEntitlementPlanForm() { - editingEntitlementPlanId.value = null; - Object.assign(entitlementPlanForm, { - name: "", - planType: "basic", - description: "", - validityDays: null, - monthlyTopicLimit: 30, - enableGrowthProfile: 0, - enablePeriodicReports: 0, - allowHelpCard: 1, - allowShareDraft: 1, - deductQuota: 1, - status: 1, - sortOrder: 10, - }); -} - async function assignUserEntitlement(row: AdminUser, planId: number) { const entitlement = await api.assignUserEntitlement(row.id, { planId }); row.entitlement = entitlement; @@ -1272,88 +1196,7 @@ function formatRecordDateTime(value: string, boundary: "start" | "end") {