lanan-repair-app/pages-internal/internalCom.vue

153 lines
3.1 KiB
Vue
Raw Normal View History

2025-08-11 17:42:50 +08:00
<template>
<view class="internal-management">
<!-- 内容区域 -->
<view class="content">
<view class="menu-box" v-for="(item, index) in filteredList" :key="index" @click="goManage(item.id)">
<view class="menu-content">
<image :src="item.icon" mode="aspectFit" style="width: 60rpx; height: 60rpx;"></image>
<text>{{ item.name }}</text>
</view>
<view class="action-button">去查看</view>
</view>
</view>
<!-- 固定底部 -->
<tabBarVue msg="3"></tabBarVue>
</view>
</template>
<script>
import {
getToken,
getUserInfo,
getJSONData,
} from '@/utils/auth'
import tabBarVue from "@/components/tabBar/tabBar.vue";
export default {
components: {
tabBarVue
},
data() {
return {
menuList: [{
id: 1,
name: '员工管理',
icon: '/static/icons/internal/staff.png'
},
{
id: 2,
name: '资料管理',
icon: '/static/icons/internal/database.png'
},
{
id: 3,
name: '工作汇报',
icon: '/static/icons/internal/workReport.png'
},
{
id: 4,
name: '设备管理',
icon: '/static/icons/internal/device.png',
requiredPermission: true
}
],
customInfo: null,
coachInfo: null,
staff: null,
filteredList: []
}
},
created() {
if (!getToken()) {
uni.reLaunch({
url: '/pages/login/loginSms'
});
return;
}
this.customInfo = getUserInfo();
console.log('customInfo', this.customInfo);
if (this.customInfo.roleCodes.includes('weixiu') || this.customInfo.roleCodes.includes('tenant_admin')) {
this.filteredList = this.menuList;
} else {
this.filteredList = this.menuList.filter(item => [2, 3].includes(item.id));
}
},
methods: {
goManage(id) {
const routes = {
1: '/pages-internal/staffManagement/NewstaffManagement',
2: '/pages-internal/dataManagement/deviceManage',
3: '/pages-internal/workReport/reportList',
4: '/pages-internal/deviceManagement/deviceManage',
}
if (routes[id]) {
uni.navigateTo({
url: routes[id]
});
}
}
}
}
</script>
<style lang="scss" scoped>
.internal-management {
display: flex;
flex-direction: column;
min-height: 100vh;
background: #F1F3F6;
padding-top: var(--status-bar-height);
}
.content {
flex: 1;
padding: 30rpx;
}
.menu-box {
width: 100%;
height: 128rpx;
background-image: url('/static/icons/internal/box_.png');
background-size: 100% 100%;
box-sizing: border-box;
padding: 0 24rpx;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 32rpx;
color: #000000;
margin-bottom: 30rpx;
border-radius: 12rpx;
.menu-content {
display: flex;
align-items: center;
image {
width: 80rpx;
height: 80rpx;
margin-right: 20rpx;
}
text {
font-weight: 500;
}
}
}
.action-button {
width: 144rpx;
height: 66rpx;
border: 2rpx solid #0174F6;
display: flex;
align-items: center;
justify-content: center;
color: #0174F6;
font-size: 28rpx;
border-radius: 30rpx 30rpx 30rpx 30rpx;
}
</style>