优化审批功能
This commit is contained in:
1 parent
184d5b0403
commit
395c7f717e
15 files changed
+2997
-16
No files matched your search
@@ -63,7 +63,7 @@ import { mpHeadPad } from '@/utils/mpHead.js'
|
||||
const headPad = mpHeadPad()
|
||||
import { onShow } from '@dcloudio/uni-app'
|
||||
import { isLoggedIn } from '@/utils/auth.js'
|
||||
import { openMenu } from '@/utils/nav.js'
|
||||
import { openMenu, WEB_RULES } from '@/utils/nav.js'
|
||||
import { useSubsystem } from '@/utils/subsystem.js'
|
||||
import AppTabbar from '@/components/AppTabbar.vue'
|
||||
|
||||
@@ -88,13 +88,25 @@ const fallbackIcon = computed(() => {
|
||||
return map[String(sub.module || '').toLowerCase()] || 'file-lines'
|
||||
})
|
||||
|
||||
/** 判断菜单项是否命中 WEB_RULES(小程序端不再展示,由 Web 端处理) */
|
||||
function isWebEntry(menu) {
|
||||
if (!menu) return false
|
||||
const title = String(menu.title || '')
|
||||
const path = String(menu.path || '')
|
||||
return WEB_RULES.some(kw => title.includes(kw) || path.includes(kw))
|
||||
}
|
||||
|
||||
/**
|
||||
* 按「一级分类目录」分组:
|
||||
* 菜单层级形如 模块根 → 个人办公 → 通讯录,分组取一级目录(个人办公 / 人事管理 …),
|
||||
* 组内为该目录下的全部可见功能。无分类归属的快捷功能不在功能页展示,由首页「常用功能」承载。
|
||||
*/
|
||||
const groups = computed(() => {
|
||||
const menus = allMenus.value.slice().sort((a, b) => (a.sort || 0) - (b.sort || 0))
|
||||
// 先把命中 WEB_RULES 的菜单项过滤掉(这些是 Web 端入口,小程序功能页不展示)
|
||||
const menus = allMenus.value
|
||||
.filter(m => !isWebEntry(m))
|
||||
.slice()
|
||||
.sort((a, b) => (a.sort || 0) - (b.sort || 0))
|
||||
const byId = {}
|
||||
menus.forEach((m) => { byId[m.id] = m })
|
||||
|
||||
|
||||
Reference in new issue
Block a user