refactor(frontend): 重构前端第二版
This commit is contained in:
1 parent
2631f78b00
commit
4b562cfa82
205 files changed
+15399
-12015
No files matched your search
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
/**
|
||||
* features/admin/modules/agents/AgentsPage.vue
|
||||
*
|
||||
* Agent 管理独立页面(Phase 1 首个拆分模块)。
|
||||
@@ -9,7 +9,7 @@
|
||||
import { onMounted } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { Bot, Plus, Trash2, Users } from 'lucide-vue-next';
|
||||
import DeleteConfirmDialog from '@/components/DeleteConfirmDialog.vue';
|
||||
import DeleteConfirmDialog from '@/shared/components/DeleteConfirmDialog.vue';
|
||||
import AgentPermissionModal from './components/AgentPermissionModal.vue';
|
||||
import AgentTestModal from './components/AgentTestModal.vue';
|
||||
import { useAgentsAdmin } from './composables/useAgentsAdmin';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
/**
|
||||
* features/admin/modules/agents/composables/useAgentsAdmin.ts
|
||||
*
|
||||
* Agent 管理模块的业务逻辑:列表 CRUD、连通性测试、权限分配。
|
||||
@@ -15,8 +15,8 @@ import {
|
||||
saveAdminAgentPermissions,
|
||||
testAdminAgent,
|
||||
updateAdminAgent,
|
||||
} from '@/api/admin';
|
||||
import { useMessage } from '@/composables/useMessage';
|
||||
} from '@/features/admin/api/admin.api';
|
||||
import { useMessage } from '@/shared/composables/useMessage';
|
||||
import type { AdminUserRow } from '@/features/admin/types/admin.types';
|
||||
import type { AgentFormState, AgentRow, AgentSuggestedQuestionItem, AgentTestResult } from '@/features/admin/types/agent.types';
|
||||
import { createEmptyAgentForm } from '@/features/admin/types/agent.types';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
/**
|
||||
* features/admin/modules/announcements/AnnouncementsPage.vue
|
||||
* 公告管理独立页面。路由:/admin/announcements
|
||||
*/
|
||||
@@ -6,7 +6,7 @@
|
||||
import { onMounted } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { Trash2 } from 'lucide-vue-next';
|
||||
import DeleteConfirmDialog from '@/components/DeleteConfirmDialog.vue';
|
||||
import DeleteConfirmDialog from '@/shared/components/DeleteConfirmDialog.vue';
|
||||
import { useAnnouncementsAdmin } from './composables/useAnnouncementsAdmin';
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
+3
-3
@@ -1,11 +1,11 @@
|
||||
/**
|
||||
/**
|
||||
* features/admin/modules/announcements/composables/useAnnouncementsAdmin.ts
|
||||
* 公告管理:列表、发布、删除。
|
||||
*/
|
||||
import { ref } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { createAnnouncement, deleteAnnouncement, listAnnouncements } from '@/api/admin';
|
||||
import { useMessage } from '@/composables/useMessage';
|
||||
import { createAnnouncement, deleteAnnouncement, listAnnouncements } from '@/features/admin/api/admin.api';
|
||||
import { useMessage } from '@/shared/composables/useMessage';
|
||||
import type { AdminAnnouncementRow } from '@/features/admin/types/admin.types';
|
||||
import {
|
||||
createEmptyAnnouncementForm,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
/**
|
||||
* features/admin/modules/approvals/ApprovalsPage.vue
|
||||
* 用户注册审批独立页面。路由:/admin/approvals
|
||||
*/
|
||||
@@ -6,7 +6,7 @@
|
||||
import { onMounted } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { ShieldCheck, Trash2 } from 'lucide-vue-next';
|
||||
import DeleteConfirmDialog from '@/components/DeleteConfirmDialog.vue';
|
||||
import DeleteConfirmDialog from '@/shared/components/DeleteConfirmDialog.vue';
|
||||
import { useApprovalsAdmin } from './composables/useApprovalsAdmin';
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
/**
|
||||
/**
|
||||
* features/admin/modules/approvals/composables/useApprovalsAdmin.ts
|
||||
* 用户注册审批:待审列表、通过、拒绝。
|
||||
*/
|
||||
import { computed, ref } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { approveAdminUser, listAdminUsers, rejectAdminUser } from '@/api/admin';
|
||||
import { useMessage } from '@/composables/useMessage';
|
||||
import { approveAdminUser, listAdminUsers, rejectAdminUser } from '@/features/admin/api/admin.api';
|
||||
import { useMessage } from '@/shared/composables/useMessage';
|
||||
import { useAdminNavBadges } from '@/features/admin/composables/useAdminNavBadges';
|
||||
import type { AdminUserRow } from '@/features/admin/types/admin.types';
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/**
|
||||
/**
|
||||
* features/admin/modules/dashboard/composables/useDashboardAdmin.ts
|
||||
* 仪表盘概览:单次 summary 接口获取四个指标。
|
||||
*/
|
||||
import { ref } from 'vue';
|
||||
import { getAdminDashboardSummary } from '@/api/admin';
|
||||
import { getAdminDashboardSummary } from '@/features/admin/api/admin.api';
|
||||
|
||||
export function useDashboardAdmin() {
|
||||
const agentCount = ref(0);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
/**
|
||||
* features/admin/modules/departments/DepartmentsPage.vue
|
||||
* 部门管理独立页面。路由:/admin/departments
|
||||
*/
|
||||
@@ -6,7 +6,7 @@
|
||||
import { onMounted } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { Edit, Trash2 } from 'lucide-vue-next';
|
||||
import DeleteConfirmDialog from '@/components/DeleteConfirmDialog.vue';
|
||||
import DeleteConfirmDialog from '@/shared/components/DeleteConfirmDialog.vue';
|
||||
import { useDepartmentsAdmin } from './composables/useDepartmentsAdmin';
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
/**
|
||||
* features/admin/modules/departments/composables/useDepartmentsAdmin.ts
|
||||
* 部门管理:列表、创建、编辑、删除。
|
||||
*/
|
||||
@@ -9,8 +9,8 @@ import {
|
||||
deleteAdminDepartment,
|
||||
listAdminDepartments,
|
||||
updateAdminDepartment,
|
||||
} from '@/api/admin';
|
||||
import { useMessage } from '@/composables/useMessage';
|
||||
} from '@/features/admin/api/admin.api';
|
||||
import { useMessage } from '@/shared/composables/useMessage';
|
||||
import type { AdminDepartmentRow } from '@/features/admin/types/admin.types';
|
||||
import {
|
||||
createEmptyDepartmentForm,
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/**
|
||||
/**
|
||||
* features/admin/modules/knowledge-base/KnowledgeBasePage.vue
|
||||
* 知识库管理独立页面。路由:/admin/knowledge-base
|
||||
*/
|
||||
<script setup lang="ts">
|
||||
import KbAdminPanel from '@/components/kb/KbAdminPanel.vue';
|
||||
import KbAdminPanel from '@/shared/components/kb/KbAdminPanel.vue';
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
/**
|
||||
* features/admin/modules/permissions/composables/usePermissionsAdmin.ts
|
||||
* 用户权限矩阵:筛选、单格切换、批量分配、CSV 导入导出。
|
||||
*/
|
||||
@@ -11,8 +11,8 @@ import {
|
||||
listAdminAgents,
|
||||
listAdminUsers,
|
||||
updateAdminUserPermissions,
|
||||
} from '@/api/admin';
|
||||
import { useMessage } from '@/composables/useMessage';
|
||||
} from '@/features/admin/api/admin.api';
|
||||
import { useMessage } from '@/shared/composables/useMessage';
|
||||
import type { AdminAgentOption, AdminUserRow } from '@/features/admin/types/admin.types';
|
||||
import {
|
||||
createEmptyPermissionFilters,
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<script setup lang="ts">
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, computed } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { Plus, Trash2, Edit2, Play, FileText, Image as ImageIcon } from 'lucide-vue-next';
|
||||
import { listAdminAgents, listAdminAgentGuides, createAdminAgentGuide, updateAdminAgentGuide, deleteAdminAgentGuide, uploadAdminAgentGuideFile } from '@/api/admin';
|
||||
import { listAdminAgents, listAdminAgentGuides, createAdminAgentGuide, updateAdminAgentGuide, deleteAdminAgentGuide, uploadAdminAgentGuideFile } from '@/features/admin/api/admin.api';
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
/**
|
||||
* features/admin/modules/questions/QuestionsPage.vue
|
||||
* 常用问题管理独立页面。路由:/admin/questions
|
||||
*/
|
||||
@@ -6,7 +6,7 @@
|
||||
import { onMounted } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { Edit, Trash2 } from 'lucide-vue-next';
|
||||
import DeleteConfirmDialog from '@/components/DeleteConfirmDialog.vue';
|
||||
import DeleteConfirmDialog from '@/shared/components/DeleteConfirmDialog.vue';
|
||||
import { useQuestionsAdmin } from './composables/useQuestionsAdmin';
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
/**
|
||||
* features/admin/modules/questions/composables/useQuestionsAdmin.ts
|
||||
* 常用问题管理:列表、创建、编辑、删除。
|
||||
*/
|
||||
@@ -9,8 +9,8 @@ import {
|
||||
listAdminAgents,
|
||||
listAdminQuickQuestions,
|
||||
saveAdminQuickQuestion,
|
||||
} from '@/api/admin';
|
||||
import { useMessage } from '@/composables/useMessage';
|
||||
} from '@/features/admin/api/admin.api';
|
||||
import { useMessage } from '@/shared/composables/useMessage';
|
||||
import type { AdminAgentOption } from '@/features/admin/types/admin.types';
|
||||
import {
|
||||
createEmptyQuestionForm,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
/**
|
||||
* features/admin/modules/reports/ReportsPage.vue
|
||||
* 管理后台报表独立页面。路由:/admin/reports/:table?
|
||||
*/
|
||||
@@ -6,7 +6,7 @@
|
||||
import { onMounted } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { BarChart2, Download, Settings2 } from 'lucide-vue-next';
|
||||
import DeleteConfirmDialog from '@/components/DeleteConfirmDialog.vue';
|
||||
import DeleteConfirmDialog from '@/shared/components/DeleteConfirmDialog.vue';
|
||||
import { useReportsAdmin } from './composables/useReportsAdmin';
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
/**
|
||||
* features/admin/modules/reports/composables/useReportsAdmin.ts
|
||||
* 管理后台报表:多表浏览、筛选、排序、chat_logs 批量删除与用量图表。
|
||||
*/
|
||||
@@ -11,9 +11,9 @@ import {
|
||||
getAdminReportTable,
|
||||
getAdminReportTableCount,
|
||||
getAdminUsageReport,
|
||||
} from '@/api/admin';
|
||||
import { loadReportLayoutPref, saveReportLayoutPref } from '@/composables/useReportLayoutStorage';
|
||||
import { useMessage } from '@/composables/useMessage';
|
||||
} from '@/features/admin/api/admin.api';
|
||||
import { loadReportLayoutPref, saveReportLayoutPref } from '@/shared/composables/useReportLayoutStorage';
|
||||
import { useMessage } from '@/shared/composables/useMessage';
|
||||
import { ADMIN_REPORT_TABLES } from '@/features/admin/constants/modules';
|
||||
import type {
|
||||
ChatLogsLayoutPref,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
/**
|
||||
* features/admin/modules/requests/composables/useRequestsAdmin.ts
|
||||
* 权限申请管理:列表、通过、拒绝。
|
||||
*/
|
||||
@@ -8,8 +8,8 @@ import {
|
||||
approveAdminPermissionRequest,
|
||||
listAdminPermissionRequests,
|
||||
rejectAdminPermissionRequest,
|
||||
} from '@/api/admin';
|
||||
import { useMessage } from '@/composables/useMessage';
|
||||
} from '@/features/admin/api/admin.api';
|
||||
import { useMessage } from '@/shared/composables/useMessage';
|
||||
import { useAdminNavBadges } from '@/features/admin/composables/useAdminNavBadges';
|
||||
import type { AdminPermissionRequestRow } from '@/features/admin/types/request.types';
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
/**
|
||||
* features/admin/modules/schedules/SchedulesPage.vue
|
||||
* 定时任务管理独立页面。路由:/admin/schedules
|
||||
*/
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
ArrowLeft, ChevronDown, ChevronUp, Download, Edit3, Eye, FlaskConical,
|
||||
Plus, Power, PowerOff, RefreshCw, Rocket, Settings2, Trash2,
|
||||
} from 'lucide-vue-next';
|
||||
import DeleteConfirmDialog from '@/components/DeleteConfirmDialog.vue';
|
||||
import DeleteConfirmDialog from '@/shared/components/DeleteConfirmDialog.vue';
|
||||
import { useSchedulesAdmin } from './composables/useSchedulesAdmin';
|
||||
|
||||
const admin = useSchedulesAdmin();
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
/**
|
||||
/**
|
||||
* features/admin/modules/schedules/composables/useSchedulesAdmin.ts
|
||||
* 定时任务管理:概览、工作台、创建/编辑、试运行。
|
||||
*/
|
||||
import { computed, ref, watch } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { listAdminAgents, listAdminUsers } from '@/api/admin';
|
||||
import { listAdminAgents, listAdminUsers } from '@/features/admin/api/admin.api';
|
||||
import { getKbGroups, type KbGroup } from '@/api/kb';
|
||||
import {
|
||||
createAdminSchedule,
|
||||
@@ -21,9 +21,9 @@ import {
|
||||
type ScheduleRun,
|
||||
type ScheduleTask,
|
||||
type TestScheduleRunResult,
|
||||
} from '@/api/schedule';
|
||||
import { useMessage } from '@/composables/useMessage';
|
||||
import { getAuthHeaders } from '@/utils/auth';
|
||||
} from '@/features/admin/api/schedule.api';
|
||||
import { useMessage } from '@/shared/composables/useMessage';
|
||||
import { getAuthHeaders } from '@/shared/utils/auth';
|
||||
import type { AdminAgentOption, AdminUserRow } from '@/features/admin/types/admin.types';
|
||||
|
||||
export function useSchedulesAdmin() {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
/**
|
||||
* features/admin/modules/users/UsersPage.vue
|
||||
* 用户管理独立页面。路由:/admin/users
|
||||
*/
|
||||
@@ -6,7 +6,7 @@
|
||||
import { onMounted } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { Edit, Plus, Trash2, Users } from 'lucide-vue-next';
|
||||
import DeleteConfirmDialog from '@/components/DeleteConfirmDialog.vue';
|
||||
import DeleteConfirmDialog from '@/shared/components/DeleteConfirmDialog.vue';
|
||||
import BatchEditUserModal from './components/BatchEditUserModal.vue';
|
||||
import BatchPermissionModal from './components/BatchPermissionModal.vue';
|
||||
import UserFormModal from './components/UserFormModal.vue';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
/**
|
||||
* features/admin/modules/users/composables/useUsersAdmin.ts
|
||||
* 用户管理模块业务逻辑:CRUD、筛选、批量操作。
|
||||
*/
|
||||
@@ -14,8 +14,8 @@ import {
|
||||
listAdminDepartments,
|
||||
listAdminUsers,
|
||||
updateAdminUser,
|
||||
} from '@/api/admin';
|
||||
import { useMessage } from '@/composables/useMessage';
|
||||
} from '@/features/admin/api/admin.api';
|
||||
import { useMessage } from '@/shared/composables/useMessage';
|
||||
import type { AdminAgentOption, AdminDepartmentRow, AdminUserRow } from '@/features/admin/types/admin.types';
|
||||
import {
|
||||
createEmptyUserFilters,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
/**
|
||||
* features/admin/modules/wecom/WecomPage.vue
|
||||
* 企业微信管理独立页面。路由:/admin/wecom
|
||||
*/
|
||||
@@ -6,7 +6,7 @@
|
||||
import { onMounted } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { CircleHelp, Download, Link2, RefreshCw, Unlink2 } from 'lucide-vue-next';
|
||||
import DeleteConfirmDialog from '@/components/DeleteConfirmDialog.vue';
|
||||
import DeleteConfirmDialog from '@/shared/components/DeleteConfirmDialog.vue';
|
||||
import { useWecomAdmin } from './composables/useWecomAdmin';
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
/**
|
||||
* features/admin/modules/wecom/composables/useWecomAdmin.ts
|
||||
* 企业微信:绑定、系统配置、通知、登录审计。
|
||||
*/
|
||||
@@ -17,8 +17,8 @@ import {
|
||||
saveAdminWecomNotifySettings,
|
||||
saveAdminWecomSystemSettings,
|
||||
unbindAdminWecomUser,
|
||||
} from '@/api/admin';
|
||||
import { useMessage } from '@/composables/useMessage';
|
||||
} from '@/features/admin/api/admin.api';
|
||||
import { useMessage } from '@/shared/composables/useMessage';
|
||||
import type { AdminUserRow } from '@/features/admin/types/admin.types';
|
||||
import {
|
||||
createDefaultWecomSystemSettings,
|
||||
@@ -29,7 +29,7 @@ import {
|
||||
type WecomNotifySettings,
|
||||
type WecomSystemSettings,
|
||||
} from '@/features/admin/types/wecom.types';
|
||||
import { buildWecomAuditMeta, formatWecomAuditReason } from '@/utils/wecom';
|
||||
import { buildWecomAuditMeta, formatWecomAuditReason } from '@/shared/utils/wecom';
|
||||
|
||||
export function useWecomAdmin() {
|
||||
const { t } = useI18n();
|
||||
|
||||
Reference in new issue
Block a user