批量优化
This commit is contained in:
1 parent
e3db229f41
commit
aa92ca40a2
79 files changed
+7495
-1104
No files matched your search
@@ -0,0 +1,85 @@
|
||||
/**
|
||||
* 子系统注册表
|
||||
*
|
||||
* nav.vue(导航页,无 tabbar)按这里配置渲染子系统宫格;
|
||||
* 点击卡片进入 pages/{slug}/home.vue,该子系统拥有自己的页面组与 tabbar。
|
||||
*
|
||||
* module 对应后端 yz_system_modules.code(菜单归属靠 path 前缀匹配),
|
||||
* slug 是端上路由目录名,务必与 pages/{slug}/ 保持一致。
|
||||
*/
|
||||
export const SUBSYSTEMS = [
|
||||
{
|
||||
slug: 'crm',
|
||||
module: 'crm',
|
||||
name: '客户关系',
|
||||
title: '客户关系管理',
|
||||
icon: 'handshake',
|
||||
tint: 'tint-0',
|
||||
desc: '线索 · 客户 · 商机 · 合同 · 回款',
|
||||
// 该子系统在 Web 端有完整系统,概览页展示「进入完整系统」入口
|
||||
webEntry: true
|
||||
},
|
||||
{
|
||||
slug: 'erp',
|
||||
module: 'erp',
|
||||
name: '进销存',
|
||||
title: '进销存管理',
|
||||
icon: 'boxes-stacked',
|
||||
tint: 'tint-1',
|
||||
desc: '客户 · 供应商 · 账套 · 通讯录',
|
||||
webEntry: true
|
||||
},
|
||||
{
|
||||
slug: 'oa',
|
||||
module: 'oa',
|
||||
name: 'OA 办公',
|
||||
title: '协同办公',
|
||||
icon: 'clipboard-check',
|
||||
tint: 'tint-2',
|
||||
desc: '日程 · 通知 · 文档 · 报销 · 人事',
|
||||
webEntry: true
|
||||
},
|
||||
{
|
||||
slug: 'cms',
|
||||
module: 'cms',
|
||||
name: '网站管理',
|
||||
title: '网站内容管理',
|
||||
icon: 'globe',
|
||||
tint: 'tint-3',
|
||||
desc: '文章 · 产品 · 解决方案 · 站点',
|
||||
webEntry: true
|
||||
},
|
||||
{
|
||||
slug: 'toolbox',
|
||||
module: 'bianjiegongju',
|
||||
name: '便捷工具',
|
||||
title: '便捷工具',
|
||||
icon: 'wrench',
|
||||
tint: 'tint-4',
|
||||
desc: '记事本 · 日程 · 密码库',
|
||||
// 便捷工具的记事本 / 日程 / 密码库在端上都有原生页面,
|
||||
// Web 端没有对应系统,因此不展示「进入完整系统」入口
|
||||
webEntry: false
|
||||
}
|
||||
]
|
||||
|
||||
/** 按 slug 取子系统配置 */
|
||||
export function getSubsystem(slug) {
|
||||
return SUBSYSTEMS.find((s) => s.slug === slug) || null
|
||||
}
|
||||
|
||||
/** 按后端模块 code 取子系统配置(menus[].module 与 yz_system_modules.code 对应) */
|
||||
export function getSubsystemByModule(module) {
|
||||
const key = String(module || '').toLowerCase()
|
||||
return SUBSYSTEMS.find((s) => String(s.module).toLowerCase() === key) || null
|
||||
}
|
||||
|
||||
/**
|
||||
* 进入某子系统的概览页。
|
||||
* 后端模块没有对应端上页面时(未在 SUBSYSTEMS 注册),返回 false 让调用方自行降级。
|
||||
*/
|
||||
export function goSubsystem(slug) {
|
||||
if (!getSubsystem(slug)) return false
|
||||
uni.redirectTo({ url: `/pages/${slug}/home/home` })
|
||||
return true
|
||||
}
|
||||
Reference in new issue
Block a user