refactor(admin): 管理端组件库迁移 Element Plus
- App/ChatView 接入 ElConfigProvider 多语言(zh-CN/zh-TW/en),AdminLayout 间距壳层统一持有 - OrderProfile 全家 22 文件迁移:页头/按钮/徽标/自绘弹窗/表单控件统一 element-trial 范式 - schema/审计中心/字段资产/身份规则/库存源/连接器/调拨类型页面同步迁移,新增 __tests__ 回归 - 迁移遵循「业务脚本零改动」:事件内联适配保持原 handler 契约,焦点陷阱与关闭语义不变 - i18n admin/common 四语言补充组件文案,架构文档记录迁移范式
This commit is contained in:
1 parent
8102a1fe44
commit
bf3154033b
66 files changed
+10766
-5934
No files matched your search
@@ -53,8 +53,9 @@ const visibleModules = computed(() =>
|
||||
ADMIN_MODULE_METAS.filter((item) => config.admin.modules[item.configKey] !== false),
|
||||
);
|
||||
|
||||
// 调拨类型(transfer_types)已移入货代管理子菜单(路由规则之下),不再作为顶级入口渲染
|
||||
const standardModules = computed(() =>
|
||||
visibleModules.value.filter((item) => item.id !== 'wecom' && item.id !== 'shipping_inventory'),
|
||||
visibleModules.value.filter((item) => item.id !== 'wecom' && item.id !== 'shipping_inventory' && item.id !== 'transfer_types'),
|
||||
);
|
||||
|
||||
const isModuleActive = (moduleId: AdminModuleId): boolean =>
|
||||
@@ -62,11 +63,19 @@ 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 isShippingActive = computed(() => (
|
||||
route.meta.adminModule === 'shipping_inventory' || route.meta.adminModule === 'transfer_types'
|
||||
));
|
||||
|
||||
const shippingGroups = computed(() => [...new Set(SHIPPING_CONFIG_SUB_MODULE_METAS.map((item) => item.groupKey))]);
|
||||
const shippingExpanded = ref<Record<string, boolean>>({});
|
||||
|
||||
// 子菜单项可见性:调拨类型沿用自身的模块 config 开关,其余跟随货代管理父开关
|
||||
const visibleShippingSubMetas = computed(() =>
|
||||
SHIPPING_CONFIG_SUB_MODULE_METAS.filter((item) => item.id !== 'transfer_types' || config.admin.modules.transfer_types !== false),
|
||||
);
|
||||
|
||||
const isShippingSubActive = (sub: (typeof SHIPPING_CONFIG_SUB_MODULE_METAS)[number]): boolean => {
|
||||
if (route.name !== sub.routeName) return false;
|
||||
if (!sub.query) return true;
|
||||
@@ -224,7 +233,7 @@ watch(
|
||||
</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)"
|
||||
v-for="sub in visibleShippingSubMetas.filter((item) => item.groupKey === groupKey)"
|
||||
:key="sub.id"
|
||||
type="button"
|
||||
class="admin-nav-subitem text-left"
|
||||
|
||||
Reference in new issue
Block a user