检查表手动添加检查项时根据部门类型展示不一样

This commit is contained in:
王利强
2026-08-03 11:51:07 +08:00
parent 088ff356f2
commit ec76d588e2
50 changed files with 826 additions and 428 deletions

View File

@@ -35,8 +35,8 @@
</view>
<view class="padding page-content">
<!-- 功能菜单approval 角色不展示 -->
<view v-if="!isApprovalRole" class="menu-card">
<!-- 功能菜单 -->
<view v-if="infoList.length > 0" class="menu-card">
<view class="menu-grid">
<view class="menu-item" v-for="(item, index) in infoList" :key="index" @click="handleMenuClick(item)">
<image class="menu-icon" :src="item.src"></image>
@@ -266,7 +266,7 @@
import { getProfileDetail } from '@/request/three_one_api/info.js';
import { onLoad, onShow, onReachBottom } from '@dcloudio/uni-app';
import { toImageUrl } from '@/request/request.js';
import { applyProfileToUserInfo, applyStoredUserInfo, resolveIdentityName, resolveUserRoleKey } from '@/utils/userInfo.js';
import { applyProfileToUserInfo, applyStoredUserInfo, resolveIdentityName, resolveUserIdentityRoleKey } from '@/utils/userInfo.js';
import {
buildRectificationUrl,
buildEditRectificationUrl,
@@ -298,8 +298,8 @@
userIdentity: null
});
// 当前身份角色(优先 userIdentity.roleKey
const currentRoleKey = computed(() => resolveUserRoleKey(userInfo));
// 当前身份角色(取 storage 中 userInfo.userIdentity.roleKey
const currentRoleKey = computed(() => resolveUserIdentityRoleKey(userInfo));
const isApprovalRole = computed(() => currentRoleKey.value === 'approval');
@@ -379,7 +379,7 @@
// 根据角色动态展示菜单
const infoList = computed(() => {
if (currentRoleKey.value === 'approval') {
return [];
return allMenuList.filter(item => item.name === '隐患排查');
}
if (currentRoleKey.value === 'common') {
return allMenuList.filter(item => commonMenuNames.includes(item.name));