Merge branch 'dev' into snow
# Conflicts: # backend/app/api/chat.py # backend/app/services/admin/permission_service.py # backend/app/services/knowledge_cleaning/dify_sync_service.py # backend/app/services/knowledge_cleaning/settings_service.py # backend/tests/test_dify_sync_process_rule.py # docker-compose.yml # docs/funclist.md # frontend/package-lock.json # frontend/src/config.ts # frontend/src/features/admin/components/AdminNav.vue # frontend/src/features/admin/constants/modules.ts # frontend/src/features/admin/stores/admin-nav.store.ts # frontend/src/features/chat/components/messages/ChatMessageBubble.vue # frontend/src/features/user/views/UserProfilePage.vue # frontend/src/locales/en/admin.json # frontend/src/locales/en/auth.json # frontend/src/locales/en/errors.json # frontend/src/locales/th/admin.json # frontend/src/locales/th/auth.json # frontend/src/locales/th/errors.json # frontend/src/locales/zh-CN/admin.json # frontend/src/locales/zh-CN/auth.json # frontend/src/locales/zh-CN/errors.json # frontend/src/locales/zh-TW/admin.json # frontend/src/locales/zh-TW/auth.json # frontend/src/locales/zh-TW/errors.json
This commit is contained in:
commit
ca9c174f29
2050 files changed
+511839
-42320
No files matched your search
@@ -5,16 +5,21 @@
|
||||
* 閫昏緫锛氭姤琛?浼佸井瀛愯彍鍗曢粯璁ゆ姌鍙狅紱褰撳墠璺敱钀藉湪瀵瑰簲妯″潡鏃惰嚜鍔ㄥ睍寮€浠ヤ究鐪嬪埌婵€娲婚」銆?
|
||||
*/
|
||||
<script setup lang="ts">
|
||||
import { computed, watch } from 'vue';
|
||||
import { computed, ref, watch } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import { LayoutDashboard, UserCog, Building, Bot, FileText,
|
||||
Settings2, Megaphone, MessageCircleQuestion, Link2, Users, BarChart2, AppWindow,
|
||||
ScrollText, ExternalLink,
|
||||
import {
|
||||
LayoutDashboard, UserPlus, UserCog, Building, Bot, FileText,
|
||||
Settings2, Megaphone, MessageCircleQuestion, Link2, Users, ShieldCheck, BarChart2, AppWindow,
|
||||
ScrollText, ExternalLink, PackageSearch, GraduationCap, Cable,
|
||||
} from 'lucide-vue-next';
|
||||
import type { Component } from 'vue';
|
||||
import { config } from '@/config';
|
||||
import { ADMIN_MODULE_METAS, ADMIN_REPORT_TABLES } from '../constants/modules';
|
||||
import {
|
||||
ADMIN_MODULE_METAS,
|
||||
ADMIN_REPORT_TABLES,
|
||||
SHIPPING_CONFIG_SUB_MODULE_METAS,
|
||||
} from '../constants/modules';
|
||||
import { useAdminNavStore } from '../stores/admin-nav.store';
|
||||
import type { AdminModuleId } from '../types/admin.types';
|
||||
|
||||
@@ -37,7 +42,11 @@ const iconMap: Record<AdminModuleId, Component> = {
|
||||
permissions: Users,
|
||||
platform_apps: AppWindow,
|
||||
procurement_contract: ScrollText,
|
||||
training_config: GraduationCap,
|
||||
integration_connector: Cable,
|
||||
requests: ShieldCheck,
|
||||
reports: BarChart2,
|
||||
shipping_inventory: PackageSearch,
|
||||
};
|
||||
|
||||
const visibleModules = computed(() =>
|
||||
@@ -45,7 +54,7 @@ const visibleModules = computed(() =>
|
||||
);
|
||||
|
||||
const standardModules = computed(() =>
|
||||
visibleModules.value.filter((item) => item.id !== 'wecom'),
|
||||
visibleModules.value.filter((item) => item.id !== 'wecom' && item.id !== 'shipping_inventory'),
|
||||
);
|
||||
|
||||
const isModuleActive = (moduleId: AdminModuleId): boolean =>
|
||||
@@ -53,6 +62,24 @@ const isModuleActive = (moduleId: AdminModuleId): boolean =>
|
||||
|
||||
const isReportsActive = computed(() => route.meta.adminModule === 'reports');
|
||||
const isWecomActive = computed(() => route.meta.adminModule === 'wecom');
|
||||
const isShippingActive = computed(() => route.meta.adminModule === 'shipping_inventory');
|
||||
|
||||
const shippingGroups = computed(() => [...new Set(SHIPPING_CONFIG_SUB_MODULE_METAS.map((item) => item.groupKey))]);
|
||||
const shippingExpanded = ref<Record<string, boolean>>({});
|
||||
|
||||
const isShippingSubActive = (sub: (typeof SHIPPING_CONFIG_SUB_MODULE_METAS)[number]): boolean => {
|
||||
if (route.name !== sub.routeName) return false;
|
||||
if (!sub.query) return true;
|
||||
return route.query.section === sub.query.section;
|
||||
};
|
||||
|
||||
const toggleShippingGroup = (groupKey: string): void => {
|
||||
shippingExpanded.value[groupKey] = !shippingExpanded.value[groupKey];
|
||||
};
|
||||
|
||||
const navigateShipping = (sub: (typeof SHIPPING_CONFIG_SUB_MODULE_METAS)[number]): void => {
|
||||
router.push({ name: sub.routeName, query: sub.query });
|
||||
};
|
||||
|
||||
const wecomSubRoutes = [
|
||||
{ name: 'AdminWecomSettings', labelKey: 'admin.wecom.nav.settings' },
|
||||
@@ -97,6 +124,25 @@ watch(
|
||||
},
|
||||
{ immediate: true },
|
||||
);
|
||||
|
||||
watch(
|
||||
isShippingActive,
|
||||
(active) => {
|
||||
if (!active) return;
|
||||
// 进入任一货代子路由时自动展开父菜单,保证当前子页可见。
|
||||
navStore.shippingMenuExpanded = true;
|
||||
let matched = false;
|
||||
for (const groupKey of shippingGroups.value) {
|
||||
const groupHasActiveSub = SHIPPING_CONFIG_SUB_MODULE_METAS.some(
|
||||
(item) => item.groupKey === groupKey && isShippingSubActive(item),
|
||||
);
|
||||
shippingExpanded.value[groupKey] = groupHasActiveSub;
|
||||
matched = matched || groupHasActiveSub;
|
||||
}
|
||||
if (!matched && shippingGroups.value[0]) shippingExpanded.value[shippingGroups.value[0]] = true;
|
||||
},
|
||||
{ immediate: true },
|
||||
);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -155,6 +201,43 @@ watch(
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="config.admin.modules.shipping_inventory !== false" class="flex flex-col flex-shrink-0">
|
||||
<button
|
||||
type="button"
|
||||
class="admin-nav-btn group justify-between"
|
||||
:class="{ 'admin-nav-btn--active': isShippingActive }"
|
||||
@click="navStore.shippingMenuExpanded = !navStore.shippingMenuExpanded"
|
||||
>
|
||||
<div class="flex items-center gap-3">
|
||||
<PackageSearch class="w-5 h-5 flex-shrink-0" :class="isShippingActive ? 'text-brand-600' : 'text-muted'" />
|
||||
<span :class="navStore.sidebarCollapsed ? 'md:hidden' : ''">{{ t('admin.nav.shippingConfig') }}</span>
|
||||
</div>
|
||||
</button>
|
||||
<div v-if="navStore.shippingMenuExpanded && !navStore.sidebarCollapsed" class="pl-4 space-y-1 mt-1 border-l-2 border-subtle ml-6">
|
||||
<div v-for="groupKey in shippingGroups" :key="groupKey" class="flex flex-col">
|
||||
<button
|
||||
type="button"
|
||||
class="admin-nav-subitem text-left font-medium"
|
||||
@click="toggleShippingGroup(groupKey)"
|
||||
>
|
||||
{{ t(groupKey) }}
|
||||
</button>
|
||||
<div v-if="shippingExpanded[groupKey]" class="pl-3 space-y-1">
|
||||
<button
|
||||
v-for="sub in SHIPPING_CONFIG_SUB_MODULE_METAS.filter((item) => item.groupKey === groupKey)"
|
||||
:key="sub.id"
|
||||
type="button"
|
||||
class="admin-nav-subitem text-left"
|
||||
:class="{ 'admin-nav-subitem--active': isShippingSubActive(sub) }"
|
||||
@click="navigateShipping(sub)"
|
||||
>
|
||||
{{ t(sub.labelKey) }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="config.admin.modules.reports !== false" class="flex flex-col flex-shrink-0">
|
||||
<button
|
||||
type="button"
|
||||
|
||||
Reference in new issue
Block a user