392 lines
8.8 KiB
Vue
Raw Normal View History

2025-04-14 10:57:27 +08:00
<template>
2025-07-30 17:29:08 +08:00
<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>
</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>
2025-04-14 10:57:27 +08:00
2025-07-30 17:29:08 +08:00
<view class="itemend">
2025-08-08 09:22:47 +08:00
<uni-icons type="gear" size="30" @click="handleSetting"></uni-icons>
<!-- <view class="classgzpz" @click="onClickWorkSet('工作配置')">
2025-07-30 17:29:08 +08:00
退出登录
2025-08-08 09:22:47 +08:00
</view> -->
2025-07-30 17:29:08 +08:00
</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` : ``"
>
<uni-icons
v-if="icon.customsrc"
custom-prefix="iconfont"
color="#1488f5"
:type="icon.customsrc"
size="28"
></uni-icons>
<uni-icons
v-else
color="#1488f5"
:type="icon.src ? icon.src : 'image'"
size="28"
></uni-icons>
</view>
<view class="classimgwz">
{{ icon.name }}
</view>
</view>
</view>
</view>
</view>
2025-04-14 10:57:27 +08:00
</template>
<script setup>
2025-07-30 17:29:08 +08:00
import { ref, onMounted } from "vue";
2025-08-08 09:22:47 +08:00
import navigator from "@/utils/navigator.js";
2025-07-30 17:29:08 +08:00
import { showModelMessage, getUrlParams } from "@/utils/tools.js";
import config from "@/utils/config";
const imgPath = config.imgPath;
const isSeleid = ref(-1);
const userInfo = ref(null);
const dataList = ref([]);
// 仓库板块图标
const btnList = [
{
key: "maintenance",
name: "运维模块",
children: [
{
key: "changebatteries",
name: "换电",
path: "/pages/devops/changebatteries/changebatteries",
customsrc: "icon-ebikedianchigenghuan",
},
{
key: "picking",
name: "领料",
path: "/pages/warehouse/component/picking",
customsrc: "icon-ebikedianchi1",
},
{
key: "checkdevice",
name: "设备检查",
path: "/pages/devops/checkDevice/checkDevice",
customsrc: "icon-ebikebtn_tongyong_shebeijiancha",
},
{
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",
},
{
key: "bikesite",
name: "站点地图",
path: "/pages/devops/bikesite/bikesite-list",
customsrc: "icon-ebikeditu2",
},
{
key: "dispatch",
name: "调度",
path: "/pages/warehouse/carDispatchByMine/carDispatchByMine",
2025-08-08 09:22:47 +08:00
customsrc: "icon-ebikeditu2",
2025-07-30 17:29:08 +08:00
},
],
},
{
key: "warehouse",
name: "仓库模块",
children: [
{
key: "ebikehouse",
name: "整车仓库",
path: "/pages/warehouse/ebikehouse/ebikehouse",
customsrc: "icon-ebikewode-wodecheku",
},
{
key: "wholebind",
name: "整车绑定",
path: "/pages/warehouse/wholebind/wholebind",
customsrc: "icon-ebikebangdingcheliang-01",
},
{
key: "detectionecu",
name: "测试中控",
path: "/pages/warehouse/detectionecu/detectionecu",
src: "settings",
},
{
key: "ecuunbindlist",
name: "解绑中控",
path: "/pages/warehouse/ecuunbind/ecuunbindlist",
src: "tune",
},
{
key: "bindhelmet",
name: "绑定头盔",
path: "/pages/warehouse/bindhelmet/bindhelmet",
customsrc: "icon-ebiketoukui",
},
{
key: "qrcodereplace",
name: "换二维码",
path: "/pages/warehouse/qrcodereplace/qrcodereplace",
src: "link",
},
{
key: "outlist",
name: "部件出库",
path: "/pages/warehouse/component/outlist",
customsrc: "icon-ebikeqitachuku",
},
{
key: "enterlist",
name: "部件入库",
path: "/pages/warehouse/component/enterlist",
customsrc: "icon-ebikeqitaruku",
},
],
},
{
key: "operate",
name: "运营模块",
children: [
{
key: "vehicleoperation",
name: "运营车辆",
path: "/pages/warehouse/ebikehouse/vehicleoperation",
src: "navigate",
},
],
},
];
2025-04-14 10:57:27 +08:00
2025-07-30 17:29:08 +08:00
onMounted(() => {
//获取用户信息
userInfo.value = uni.getStorageSync("userInfo");
const permcode = "maintenance.applet";
const permcodes = uni.getStorageSync("permCodes");
const menus = [];
if (permcodes.length > 0) {
btnList.forEach((item) => {
const menu = {
key: item.key,
name: item.name,
};
let ipermcode =
permcode + "." + item.key.toLowerCase().replace(/-/g, ".");
if (permcodes.some((item) => item.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.some((item) => item.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);
}
});
}
}
});
2025-04-14 10:57:27 +08:00
2025-07-30 17:29:08 +08:00
menus[0].children.push({
key: "dispatch",
name: "调度",
path: "/pages/warehouse/carDispatchByMine/carDispatchByMine",
customsrc: "icon-ebikeditu",
});
dataList.value = menus;
}
});
const onClikcList = (icon, item) => {
const ikey = item.key;
const ickey = icon.key;
const path = icon.path;
isSeleid.value = ikey + "-" + ickey;
if (path) {
setTimeout(() => {
uni.navigateTo({
url: path, //
});
}, 100); // 延迟100毫秒后执行
}
setTimeout(() => {
isSeleid.value = "";
}, 200); // 延迟100毫秒后执行
};
2025-08-08 09:22:47 +08:00
const handleSetting = () => {
navigator.to("/pages/personal/personalInfo");
2025-07-30 17:29:08 +08:00
};
2025-04-14 10:57:27 +08:00
</script>
<style scoped>
2025-07-30 17:29:08 +08:00
.container {
padding: 20px;
background: linear-gradient(
to bottom,
rgb(132, 212, 248),
rgb(247, 252, 255)
);
height: 100vh;
}
2025-04-14 10:57:27 +08:00
2025-07-30 17:29:08 +08:00
.topclass {
2025-08-08 09:22:47 +08:00
margin-top: 82px;
2025-07-30 17:29:08 +08:00
margin-bottom: 30px;
}
2025-04-14 10:57:27 +08:00
2025-07-30 17:29:08 +08:00
.class1 {
color: #55aaff;
border: solid 1px #55aaff;
padding: 3px;
border-radius: 5px;
margin-left: 10px;
font-size: 12px;
}
2025-04-14 10:57:27 +08:00
2025-07-30 17:29:08 +08:00
.classxx {
background-color: rgb(242, 242, 242);
color: #000305;
border-radius: 4px;
padding: 2px 10px;
font-size: 10px;
}
2025-04-14 10:57:27 +08:00
2025-07-30 17:29:08 +08:00
.section {
margin-bottom: 15px;
background: #fff;
border-radius: 10px;
padding: 15px 0px;
2025-08-08 09:22:47 +08:00
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
2025-07-30 17:29:08 +08:00
}
2025-04-14 10:57:27 +08:00
2025-07-30 17:29:08 +08:00
.section-title {
font-size: 18px;
font-weight: bold;
margin: 0px 20px;
}
2025-04-14 10:57:27 +08:00
2025-08-08 09:22:47 +08:00
.section-title ::before {
content: "";
display: inline-block;
width: 3px;
height: 15px;
top: 50%;
transform: translateY(10%);
background-color: #1488f5;
margin-right: 8px;
border-radius: 10rpx;
}
2025-07-30 17:29:08 +08:00
.icon-row {
display: flex;
justify-content: start;
flex-wrap: wrap;
}
2025-04-14 10:57:27 +08:00
2025-07-30 17:29:08 +08:00
.icon-item {
text-align: center;
width: 20%;
}
2025-04-14 10:57:27 +08:00
2025-07-30 17:29:08 +08:00
.icon-image {
width: 50px;
height: 50px;
margin-bottom: 5px;
}
2025-04-14 10:57:27 +08:00
2025-07-30 17:29:08 +08:00
.icon-label {
font-size: 14px;
}
2025-04-14 10:57:27 +08:00
2025-07-30 17:29:08 +08:00
.txImg {
width: 50px;
height: 50px;
margin: 0px 10px;
margin-top: -5px;
}
.txImg image {
width: 50px;
height: 50px;
}
2025-04-14 10:57:27 +08:00
2025-07-30 17:29:08 +08:00
.itemtwo {
2025-08-08 09:22:47 +08:00
width: 78%;
2025-07-30 17:29:08 +08:00
}
2025-04-14 10:57:27 +08:00
2025-07-30 17:29:08 +08:00
.classname {
line-height: 20px;
font-size: 20px;
font-weight: bold;
}
2025-04-14 10:57:27 +08:00
2025-07-30 17:29:08 +08:00
.classimg {
margin-top: 15px;
}
2025-04-14 10:57:27 +08:00
2025-07-30 17:29:08 +08:00
.classimgsm {
transform: scale(0.9);
/* 将元素缩小至原来的 0.9 倍 */
}
2025-04-14 10:57:27 +08:00
2025-07-30 17:29:08 +08:00
.classimg image {
height: 30px;
width: 30px;
}
2025-04-14 10:57:27 +08:00
2025-07-30 17:29:08 +08:00
.classimgwz {
2025-08-08 09:22:47 +08:00
font-size: 26rpx;
2025-07-30 17:29:08 +08:00
}
2025-04-14 10:57:27 +08:00
2025-07-30 17:29:08 +08:00
.classgzpz {
font-size: 12px;
border-bottom: solid 1px #000;
}
</style>