feat(shipping-notice): 落地字段资产治理与唯一 Schema,自动建单随版本冻结

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
hugoandCursor committed 2026-07-29 16:23:15 +08:00
1 parent b7307fc573
commit 3a1dbf7ce5
144 files changed
+15167 -4480

No files matched your search

@@ -3,14 +3,15 @@
* features/workspace/components/WorkspaceSidebar.vue
* 工作台左侧导航:业务一级/二级目录、返回聊天与退出登录。
*/
import { computed, inject, ref, watch } from 'vue';
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,
ChevronDown, ChevronRight, ContactRound, ListChecks,
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';
const props = defineProps<{
collapsed?: boolean;
@@ -18,9 +19,10 @@ const props = defineProps<{
const ws = inject(WORKSPACE_KEY)! as any;
const route = useRoute();
const shippingRouteNames = ['workspace-shipping-customers', 'workspace-shipping-tasks'] as const;
const shippingRouteNames = ['workspace-shipping-customers', 'workspace-shipping-tasks', 'workspace-shipping-my-tasks'] as const;
const shippingExpanded = ref(false);
const isAdmin = computed(() => String(ws.currentUser?.role || '').trim().toLowerCase() === 'admin');
const { pendingBadge, startShippingTodoBadgePolling, stopShippingTodoBadgePolling } = useShippingTodoBadge();
const primaryLinkItems = [
{ path: WORKSPACE_PATHS.profile, labelKey: 'workspace.nav.profile', icon: User, match: ['workspace-profile'] },
@@ -48,14 +50,22 @@ watch(
{ immediate: true },
);
/** 展开或收起货代发货目录;侧栏折叠时图标直接进入发货任务。 */
/** 展开或收起货代发货目录;侧栏折叠时图标直接进入我的待办。 */
const toggleShippingMenu = (): void => {
if (props.collapsed) {
void ws.router.push(WORKSPACE_PATHS.shippingNoticeTasks);
void ws.router.push(WORKSPACE_PATHS.shippingNoticeMyTasks);
return;
}
shippingExpanded.value = !shippingExpanded.value;
};
onMounted(() => {
startShippingTodoBadgePolling();
});
onBeforeUnmount(() => {
stopShippingTodoBadgePolling();
});
</script>
<template>
@@ -130,6 +140,20 @@ const toggleShippingMenu = (): void => {
<component v-if="!collapsed" :is="shippingExpanded ? ChevronDown : ChevronRight" class="h-4 w-4" />
</button>
<div v-if="!collapsed && shippingExpanded" class="mt-1 space-y-1 pl-5">
<RouterLink
:to="WORKSPACE_PATHS.shippingNoticeMyTasks"
class="ws-nav-btn py-2.5 text-[13px]"
:class="{ 'ws-nav-btn--active': isActive(['workspace-shipping-my-tasks']) }"
>
<Inbox class="h-4 w-4" />
<span class="flex-1">{{ $t('workspace.nav.shippingMyTasks') }}</span>
<span
v-if="pendingBadge > 0"
class="inline-flex min-w-[1.25rem] items-center justify-center rounded-full bg-rose-500 px-1.5 text-[10px] font-semibold text-white"
>
{{ pendingBadge > 99 ? '99+' : pendingBadge }}
</span>
</RouterLink>
<RouterLink
v-if="isAdmin"
:to="WORKSPACE_PATHS.shippingNoticeCustomers"