352 lines
7.7 KiB
Vue
Raw Normal View History

2025-04-14 10:57:27 +08:00
<template>
<view class="container">
<view class="topclass">
<view class="flex">
<view class="">
<view class="cu-item">
<view class="cu-avatar round txImg">
<image :src= "`${imgPath}static/image/tx.png`" mode=""></image>
2025-04-14 10:57:27 +08:00
</view>
</view>
</view>
<view class="itemtwo">
<view v-if="userInfo !=null" class="classname">
{{userInfo.username}}
</view>
<view style="margin-top: 5px;">
<span class="classxx">股东</span>
</view>
</view>
<view class="itemend">
<view class="classgzpz" @click="onClickWorkSet('工作配置')">
退出登录
</view>
</view>
</view>
</view>
<!-- 运维板块 -->
<view class="section" v-for="(item,index) in dataList" :key="index">
<text class="section-title">{{item.name}}</text>
<view class="icon-row">
<view class="icon-item" v-for="(icon, i) in item.children" :key="index" @click="onClikcList(icon, item)">
<view class="classimg" :class="item.key + '-' + icon.key ==isSeleid?`classimgsm`:``">
2025-04-14 10:57:27 +08:00
<!-- <image :src="icon.src" class="icon-image" /> -->
<uni-icons v-if="icon.customsrc" custom-prefix="iconfont" color="#1488f5" :type="icon.customsrc"
2025-04-28 11:40:00 +08:00
size="28"></uni-icons>
<uni-icons v-else color="#1488f5" :type="icon.src ? icon.src:'image'" size="28"></uni-icons>
2025-04-14 10:57:27 +08:00
</view>
<view class="classimgwz">
{{ icon.name }}
2025-04-14 10:57:27 +08:00
</view>
</view>
</view>
</view>
</view>
</template>
<script setup>
import {
ref,
onMounted
} from 'vue';
import {
showModelMessage,
getUrlParams
} from '@/utils/tools.js';
import config from '@/utils/config';
const imgPath = config.imgPath;
2025-04-14 10:57:27 +08:00
const isSeleid = ref(-1);
const userInfo = ref(null)
const dataList = ref([])
2025-04-14 10:57:27 +08:00
// 仓库板块图标
const btnList = [{
"key": "maintenance",
"name": "运维模块",
"children": [
{
"key": "changebatteries",
"name": "换电",
"path": "/pages/devops/changebatteries/changebatteries",
"customsrc": "icon-ebikedianchigenghuan",
2025-04-14 10:57:27 +08:00
},
{
"key": "picking",
"name": "领料",
"path": "/pages/warehouse/component/picking",
"customsrc": "icon-ebikedianchi1",
2025-04-14 10:57:27 +08:00
},
{
"key": "checkdevice",
"name": "设备检查",
"path": "/pages/devops/checkDevice/checkDevice",
"customsrc": "icon-ebikebtn_tongyong_shebeijiancha",
2025-04-14 10:57:27 +08:00
},
{
"key": "faultreport",
"name": "故障上报",
"path": "/pages/devops/faultreport/faultreport",
"customsrc": "icon-ebikeguzhangshangbao",
},
{
"key": "maintenancepage",
"name": "维修",
"path": "/pages/devops/maintenancepage/maintenancepage",
"customsrc": "icon-ebikeweixiu",
},
{
"key": "bluetoothscan",
"name": "蓝牙扫码",
"path": "/pages/warehouse/bluetooth/bluetoothscan",
"customsrc": "icon-ebikeBluetooth1"
2025-04-29 16:36:51 +08:00
},
{
"key": "bikesite",
"name": "站点地图",
"path": "/pages/devops/bikesite/bikesite-list",
"customsrc": "icon-ebikeditu2"
2025-04-14 10:57:27 +08:00
}
]
},
{
"key": "warehouse",
"name": "仓库模块",
"children": [
2025-04-14 10:57:27 +08:00
{
"key": "ebikehouse",
"name": "整车仓库",
"path": "/pages/warehouse/ebikehouse/ebikehouse",
2025-04-14 10:57:27 +08:00
"customsrc": "icon-ebikewode-wodecheku",
},
{
"key": "wholebind",
"name": "整车绑定",
"path": "/pages/warehouse/wholebind/wholebind",
2025-04-14 10:57:27 +08:00
"customsrc": "icon-ebikebangdingcheliang-01",
},{
"key": "detectionecu",
"name": "测试中控",
"path": "/pages/warehouse/detectionecu/detectionecu",
"src": "settings"
}, {
"key": "ecuunbindlist",
"name": "解绑中控",
"path": "/pages/warehouse/ecuunbind/ecuunbindlist",
"src": "tune",
2025-04-14 10:57:27 +08:00
},
{
"key": "bindhelmet",
"name": "绑定头盔",
"path": "/pages/warehouse/bindhelmet/bindhelmet",
"customsrc": "icon-ebiketoukui",
2025-04-14 10:57:27 +08:00
},
{
"key": "qrcodereplace",
"name": "换二维码",
"path": "/pages/warehouse/qrcodereplace/qrcodereplace",
"src": "link",
2025-04-14 10:57:27 +08:00
},
{
"key": "outlist",
"name": "部件出库",
"path": "/pages/warehouse/component/outlist",
2025-04-14 10:57:27 +08:00
"customsrc": "icon-ebikeqitachuku",
},
{
"key": "enterlist",
"name": "部件入库",
"path": "/pages/warehouse/component/enterlist",
2025-04-14 10:57:27 +08:00
"customsrc": "icon-ebikeqitaruku",
}
]
},
{
"key": "operate",
"name": "运营模块",
"children": [{
"key": "vehicleoperation",
"name": "运营车辆",
"path": "/pages/warehouse/ebikehouse/vehicleoperation",
2025-04-14 10:57:27 +08:00
"src": "navigate",
}]
}
];
onMounted(() => {
//获取用户信息
userInfo.value = uni.getStorageSync('userInfo');
const permcode = 'maintenance.applet';
const permcodes = uni.getStorageSync('permCodes');
const menus = [];
if (permcodes.length > 0 && permcodes.includes(permcode)) {
btnList.forEach((item) => {
const menu = {
key: item.key,
name: item.name
}
let ipermcode = permcode + '.' + item.key.toLowerCase().replace(/-/g, '.');
if (permcodes.includes(ipermcode)) {
menus.push(menu)
if (item.children) {
item.children.forEach((child) => {
menu.children = menu.children || [];
let cpermcode = ipermcode + '.' + child.key.toLowerCase().replace(/-/g, '.');
if (permcodes.includes(cpermcode)) {
const cmenu = {
key: child.key,
name: child.name,
path: child.path
}
if(child.customsrc) cmenu.customsrc = child.customsrc;
else cmenu.src = child.src;
menu.children.push(cmenu)
}
})
}
}
});
dataList.value = menus;
}
});
2025-04-14 10:57:27 +08:00
const onClikcList = (icon, item) => {
const ikey = item.key;
const ickey = icon.key;
const path = icon.path;
isSeleid.value = ikey + '-' + ickey;
2025-04-14 10:57:27 +08:00
if (path) {
setTimeout(() => {
uni.navigateTo({
url: path, //
});
}, 100); // 延迟100毫秒后执行
}
setTimeout(() => {
isSeleid.value = ""
2025-04-14 10:57:27 +08:00
}, 200); // 延迟100毫秒后执行
}
const onClickWorkSet = (res) => {
uni.showModal({
title: '确认退出',
content: '是否确认退出并清除缓存?',
success: function(res) {
if (res.confirm) {
uni.clearStorage();
uni.reLaunch({
url: "/pages/login/login"
});
} else if (res.cancel) {}
}
});
}
</script>
<style scoped>
.container {
padding: 20px;
background: linear-gradient(to bottom, rgb(132, 212, 248), rgb(247, 252, 255));
height: 100vh;
}
.topclass {
margin-top: 70px;
margin-bottom: 30px;
}
.class1 {
color: #55aaff;
border: solid 1px #55aaff;
padding: 3px;
border-radius: 5px;
margin-left: 10px;
font-size: 12px;
}
.classxx {
background-color: rgb(242, 242, 242);
color: #000305;
border-radius: 4px;
padding: 2px 10px;
font-size: 10px;
}
.section {
margin-bottom: 15px;
background: #fff;
border-radius: 10px;
padding: 15px 0px;
}
.section-title {
font-size: 18px;
font-weight: bold;
margin: 0px 20px;
}
.icon-row {
display: flex;
justify-content: start;
flex-wrap: wrap;
}
.icon-item {
text-align: center;
width: 20%;
}
.icon-image {
width: 50px;
height: 50px;
margin-bottom: 5px;
}
.icon-label {
font-size: 14px;
}
.txImg {
2025-04-14 10:57:27 +08:00
width: 50px;
height: 50px;
margin: 0px 10px;
margin-top: -5px;
}
.txImg image{
width: 50px;
height: 50px;
}
2025-04-14 10:57:27 +08:00
.itemtwo {
width: 60%;
}
.classname {
line-height: 20px;
font-size: 20px;
font-weight: bold;
}
.classimg {
margin-top: 15px;
}
.classimgsm {
transform: scale(0.9);
/* 将元素缩小至原来的 0.9 倍 */
}
.classimg image {
height: 30px;
width: 30px;
}
.classimgwz {
/* margin-top: -8px; */
font-size: 13px;
}
.classgzpz {
font-size: 12px;
border-bottom: solid 1px #000;
}
</style>