fix: 解决冲突
This commit is contained in:
commit
f09e7d27a6
124 files changed
+29220
-5809
No files matched your search
@@ -1,17 +1,20 @@
|
||||
<script setup lang="ts">
|
||||
/**
|
||||
* features/workspace/components/WorkspaceSidebar.vue
|
||||
* 工作台左侧导航:业务一级/二级目录、返回聊天与退出登录。
|
||||
* 工作台左侧导航:子路由链接、关联服务入口、返回聊天与退出登录。
|
||||
* 依赖:WORKSPACE_PATHS、workspace.context、ExternalSystemLinks。
|
||||
* 逻辑:底部关联服务复用 ws-nav-btn,与返回聊天/退出登录对齐。
|
||||
*/
|
||||
import { computed, inject, onBeforeUnmount, onMounted, ref, watch } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
import {
|
||||
LayoutGrid, Bot, FileText, User, LogOut, Edit, Megaphone, Clock, Package, PanelLeftClose, PanelLeftOpen,
|
||||
LayoutGrid, Bot, FileText, User, LogOut, Edit, Megaphone, Clock, Package, PanelLeftClose, PanelLeftOpen, ClipboardCheck,
|
||||
ChevronDown, ChevronRight, ContactRound, ListChecks, Inbox,
|
||||
} from 'lucide-vue-next';
|
||||
import { WORKSPACE_PATHS } from '../constants/routes';
|
||||
import { WORKSPACE_KEY } from '../composables/workspace.context';
|
||||
import { useShippingTodoBadge } from '../composables/useShippingTodoBadge';
|
||||
import { ExternalSystemLinks } from '@/features/sso';
|
||||
|
||||
const props = defineProps<{
|
||||
collapsed?: boolean;
|
||||
@@ -31,6 +34,7 @@ const primaryLinkItems = [
|
||||
] as const;
|
||||
|
||||
const secondaryLinkItems = [
|
||||
{ path: WORKSPACE_PATHS.accountingVoucherCheck, labelKey: 'workspace.nav.accountingVoucherCheck', icon: ClipboardCheck, match: ['workspace-accounting-voucher-check'] },
|
||||
{ path: WORKSPACE_PATHS.feedback, labelKey: 'workspace.nav.feedback', icon: Edit, match: ['workspace-feedback'] },
|
||||
{ path: WORKSPACE_PATHS.updates, labelKey: 'workspace.nav.updates', icon: Megaphone, match: ['workspace-updates'] },
|
||||
] as const;
|
||||
@@ -209,6 +213,12 @@ onBeforeUnmount(() => {
|
||||
|
||||
<div class="border-t border-subtle pt-4">
|
||||
<div class="space-y-2">
|
||||
<ExternalSystemLinks
|
||||
:compact="Boolean(collapsed)"
|
||||
:show-label="!collapsed"
|
||||
:button-class="collapsed ? 'ws-nav-btn justify-center px-0' : 'ws-nav-btn'"
|
||||
icon-class="h-[18px] w-[18px] shrink-0"
|
||||
/>
|
||||
<button
|
||||
type="button"
|
||||
@click="ws.navigateToGeneralChat"
|
||||
|
||||
@@ -51,7 +51,6 @@ export function useWorkspace() {
|
||||
const navigation = useWorkspaceNavigation(deps, {
|
||||
isLoggedIn: session.isLoggedIn,
|
||||
hasKnowledgeBaseAccess: session.hasKnowledgeBaseAccess,
|
||||
KB_ACCESS_DENIED_MESSAGE: session.KB_ACCESS_DENIED_MESSAGE,
|
||||
agents: home.agents,
|
||||
layoutSections: home.layoutSections,
|
||||
profileUserId: computed(() => profile.profileUser.value.id),
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* features/workspace/composables/useWorkspaceNavigation.ts
|
||||
* 用途:子路由导航、移动端 Tab、聊天跳转、企微 deeplink 与旧 view 参数兼容。
|
||||
* 依赖:vue-router、config、auth、requestJson、workspace routes/types。
|
||||
* 逻辑:由 useWorkspace 注入;知识库与立账凭证检核均按管理员权限控制入口和路由访问。
|
||||
* 逻辑:由 useWorkspace 注入;知识库无权限时 toast t('workspace.kb.accessDenied')。
|
||||
*/
|
||||
import { computed, nextTick, ref, watch, type ComputedRef, type Ref } from 'vue';
|
||||
import { config } from '@/config';
|
||||
@@ -31,7 +31,6 @@ const ROUTE_NAME_TO_SIDEBAR: Record<string, WorkspaceSidebarItem> = {
|
||||
interface NavigationOptions {
|
||||
isLoggedIn: ComputedRef<boolean>;
|
||||
hasKnowledgeBaseAccess: ComputedRef<boolean>;
|
||||
KB_ACCESS_DENIED_MESSAGE: string;
|
||||
agents: Ref<WorkspaceAgent[]>;
|
||||
layoutSections: Ref<WorkspaceLayoutSection[]>;
|
||||
profileUserId: ComputedRef<number>;
|
||||
@@ -41,12 +40,17 @@ interface NavigationOptions {
|
||||
loadWorkspaceScheduleRuns: () => Promise<void>;
|
||||
}
|
||||
|
||||
/**
|
||||
* 组装工作台侧栏/移动端导航与路由副作用。
|
||||
* 核心逻辑:映射 route.name → sidebar item;无知识库权限时本地化 toast 并拦截跳转。
|
||||
* @param deps - t/msg/router/route
|
||||
* @param options - 登录态、权限与各模块加载回调
|
||||
*/
|
||||
export function useWorkspaceNavigation(deps: WorkspaceDeps, options: NavigationOptions) {
|
||||
const { t, msg, router, route } = deps;
|
||||
const {
|
||||
isLoggedIn,
|
||||
hasKnowledgeBaseAccess,
|
||||
KB_ACCESS_DENIED_MESSAGE,
|
||||
agents,
|
||||
layoutSections,
|
||||
profileUserId,
|
||||
@@ -101,8 +105,11 @@ export function useWorkspaceNavigation(deps: WorkspaceDeps, options: NavigationO
|
||||
const navigateToApplications = () => router.push(WORKSPACE_PATHS.applications);
|
||||
const navigateToUpdates = () => router.push(WORKSPACE_PATHS.updates);
|
||||
|
||||
/**
|
||||
* 弹出知识库无权限提示(四语言)。
|
||||
*/
|
||||
const showKnowledgeBaseAccessDenied = () => {
|
||||
msg.warning(KB_ACCESS_DENIED_MESSAGE);
|
||||
msg.warning(t('workspace.kb.accessDenied'));
|
||||
};
|
||||
|
||||
const navigateToKnowledgeBase = () => {
|
||||
|
||||
@@ -13,6 +13,7 @@ export const WORKSPACE_PATHS = {
|
||||
shippingNoticeCustomers: '/workspace/shipping-notice/customers',
|
||||
shippingNoticeTasks: '/workspace/shipping-notice/tasks',
|
||||
shippingNoticeMyTasks: '/workspace/shipping-notice/my-tasks',
|
||||
accountingVoucherCheck: '/workspace/accounting-voucher-check',
|
||||
feedback: '/workspace/feedback',
|
||||
history: '/workspace/history',
|
||||
} as const;
|
||||
@@ -26,6 +27,7 @@ export const LEGACY_VIEW_TO_PATH: Record<string, string> = {
|
||||
knowledge_base: WORKSPACE_PATHS.knowledgeBase,
|
||||
schedule_runs: WORKSPACE_PATHS.scheduleRuns,
|
||||
shipping_notice: WORKSPACE_PATHS.shippingNotice,
|
||||
accounting_voucher_check: WORKSPACE_PATHS.accountingVoucherCheck,
|
||||
history: WORKSPACE_PATHS.history,
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user