主要更新uniapp相关功能
This commit is contained in:
1 parent
aa92ca40a2
commit
5b4dbb2b46
65 files changed
+8532
-1921
No files matched your search
@@ -0,0 +1,17 @@
|
||||
// 小程序自定义导航头部避让工具
|
||||
// env(safe-area-inset-top) 在开发者工具模拟器/部分安卓机返回 0,不可靠;
|
||||
// 改用胶囊按钮实测位置(getMenuButtonBoundingClientRect)计算顶部内边距。
|
||||
// 用法:const headPad = mpHeadPad(),绑定到头部元素 :style="headPad"
|
||||
export function mpHeadPad(extra = 8) {
|
||||
// #ifdef MP-WEIXIN
|
||||
try {
|
||||
const mb = uni.getMenuButtonBoundingClientRect()
|
||||
if (mb && mb.bottom > 0) {
|
||||
return { paddingTop: mb.bottom + extra + 'px' }
|
||||
}
|
||||
} catch (e) {
|
||||
// 取不到胶囊时回退 CSS 值
|
||||
}
|
||||
// #endif
|
||||
return {}
|
||||
}
|
||||
+10
-2
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
/**
|
||||
* 菜单 → 页面 的跳转分发
|
||||
*
|
||||
* 聚合平台里绝大多数业务功能(ERP / OA / CRM / CMS)目前只有 Web 端实现,
|
||||
@@ -10,7 +10,15 @@ import { createAppTicket } from '@/api/auth.js'
|
||||
/** 移动端已有原生页面的功能。匹配顺序即优先级。 */
|
||||
const NATIVE_RULES = [
|
||||
{ pattern: /记事本|笔记|便签|notebook/i, route: '/pages/tools/notepad/index' },
|
||||
{ pattern: /日程|提醒|待办|calendar|schedule/i, route: '/pages/tools/schedule/index' }
|
||||
// 「日程提醒」与「工作日程」是两个独立功能:提醒在前,命中"提醒"后即不再落到日历页
|
||||
{ pattern: /提醒|reminder/i, route: '/pages/tools/schedule/reminder' },
|
||||
{ pattern: /工作日程|日程|日历|待办|calendar|schedule/i, route: '/pages/tools/schedule/index' },
|
||||
// OA 协同办公
|
||||
{ pattern: /通知公告|公告|notice/i, route: '/pages/oa/notice/index' },
|
||||
{ pattern: /文档库|文档管理|文档图谱|document/i, route: '/pages/oa/document/index' },
|
||||
{ pattern: /薪酬|工资|薪资|compensation|payroll/i, route: '/pages/oa/compensation/index' },
|
||||
{ pattern: /员工档案|人事档案|档案|employeefile|employeeFile/i, route: '/pages/oa/employeefile/index' },
|
||||
{ pattern: /通讯录|联系人|contact/i, route: '/pages/oa/contact/index' }
|
||||
]
|
||||
|
||||
/** Web 端容器页 */
|
||||
|
||||
@@ -21,6 +21,8 @@ export function useSubsystem(slug) {
|
||||
const user = ref({})
|
||||
const menus = ref([])
|
||||
const moduleMeta = ref(null)
|
||||
// 用户自定义「常用功能」菜单 ID(有序);为空表示未自定义,前端回落默认
|
||||
const quickMenuIds = ref([])
|
||||
|
||||
/** 该子系统下所有菜单(含目录) */
|
||||
const allMenus = computed(() => menus.value.filter((m) => m.module === sub.module))
|
||||
@@ -42,6 +44,7 @@ export function useSubsystem(slug) {
|
||||
const data = await fetchHome(force)
|
||||
user.value = data.user || {}
|
||||
menus.value = Array.isArray(data.menus) ? data.menus : []
|
||||
quickMenuIds.value = Array.isArray(data.quick_menu_ids) ? data.quick_menu_ids : []
|
||||
const hit = (Array.isArray(data.modules) ? data.modules : []).find(
|
||||
(m) => String(m.code || '').toLowerCase() === String(sub.module).toLowerCase()
|
||||
)
|
||||
@@ -56,5 +59,5 @@ export function useSubsystem(slug) {
|
||||
}
|
||||
}
|
||||
|
||||
return { sub, loading, loadError, user, menus, moduleMeta, enabled, allMenus, leafMenus, dirMenus, load }
|
||||
return { sub, loading, loadError, user, menus, moduleMeta, enabled, allMenus, leafMenus, dirMenus, quickMenuIds, load }
|
||||
}
|
||||
Reference in new issue
Block a user