nav优化

This commit is contained in:
13218645326 2023-12-11 17:38:05 +08:00
parent d4c1671039
commit fbdfdfc8ea
14 changed files with 470 additions and 505 deletions

View File

@ -1,8 +1,7 @@
<template> <template>
<!-- <h1>{{ navStore.topNavList }}</h1> -->
<subMenu :menuList="menuInfo.menuList" :collapse="menuInfo.collapse" :backgroundColor="menuInfo.backgroundColor" <subMenu :menuList="menuInfo.menuList" :collapse="menuInfo.collapse" :backgroundColor="menuInfo.backgroundColor"
:textColor="menuInfo.textColor" :activeTextColor="menuInfo.activeTextColor" :defaultActive="navStore.defaultActive" :textColor="menuInfo.textColor" :activeTextColor="menuInfo.activeTextColor" :defaultActive="navStore.defaultActive"
:defaultOpeneds="menuInfo.defaultOpeneds" :uniqueOpened="menuInfo.uniqueOpened" :menuTrigger="menuInfo.menuTrigger" :defaultOpeneds="menuInfo.defaultOpeneds" :menuTrigger="menuInfo.menuTrigger"
:router="menuInfo.router" :collapseTransition="menuInfo.collapseTransition" :popperEffect="menuInfo.popperEffect" :router="menuInfo.router" :collapseTransition="menuInfo.collapseTransition" :popperEffect="menuInfo.popperEffect"
:isCustomLink="menuInfo.isCustomLink" :customLinkCallBack="menuInfo.customLinkCallBack"></subMenu> :isCustomLink="menuInfo.isCustomLink" :customLinkCallBack="menuInfo.customLinkCallBack"></subMenu>
</template> </template>
@ -20,56 +19,41 @@ const menuInfo: any = reactive({
backgroundColor: '#fff', backgroundColor: '#fff',
textColor: "", textColor: "",
activeTextColor: '', activeTextColor: '',
defaultActive: "", defaultActive: '',
defaultOpeneds: ['staticDefault_PathParent&&配置管理'], defaultOpeneds:[],
router: false, router: false,
collapseTransition: true, collapseTransition: true,
menuList: list, menuList: list,
isCustomLink: true, isCustomLink: true,
customLinkCallBack: (ev: any) => { customLinkCallBack: (ev: any) => {
console.log("customLinkCallBack", ev) // console.log("customLinkCallBack", ev)
if (ev.title.startsWith('staticDefault')) { // if (ev.title.startsWith('staticDefault')) {
return // return
} // }
console.log("evevevevev",ev)
router.push({ router.push({
name: ev.path path: ev.path
}) })
navStore.setDefaultActive(ev) navStore.setDefaultActive(ev)
navStore.addNavTarget(ev) navStore.addNavTarget(ev)
} }
}) })
onMounted(() => { onBeforeMount(() => {
menuInfo.defaultActive = routes.path
console.log("routes", router.getRoutes()) console.log("routes", router.getRoutes())
initRouteList() // initRouteList()
console.log("menuInfomenuInfo",menuInfo)
navStore.setDefaultActive(routes.path)
}) })
const initRouteList = () => { // const initRouteList = () => {
// const routeList = router.getRoutes() // menuInfo.defaultActive = routes.path
// menuInfo.menuList = routeList.find(ele=>ele.meta.routeListRoot)?.children // menuInfo.defaultOpeneds.push()
// menuInfo.defaultOpeneds = menuInfo.menuList[0].path // }
// console.log("menuInfo.menuList",menuInfo.menuList)
menuInfo.defaultOpeneds.push()
const routes: any = list
console.log("routes", router)
const currentNav = routes.find((ele:any)=>ele.meta.folder).children[0]
// if (navStore.topNavList.length == 0) {
// let firstNav = {
// title: currentNav.meta.title,
// name: currentNav.name,
// path: currentNav.path
// }
// navStore.addNavTarget(firstNav)
// navStore.setCurrentNav(currentNav.path)
// }
console.log("currentNav", currentNav)
menuInfo.defaultActive = currentNav.name + '&&' + currentNav.meta.title
console.log("currentNav", menuInfo.defaultActive)
}
</script> </script>
<style scoped></style> <style scoped></style>

View File

@ -1,7 +1,7 @@
<template> <template>
<template v-for="(item) in props.menuList" :key="item.path"> <template v-for="(item) in props.menuList" :key="item.path">
<el-sub-menu :index="item.name+'&&'+item.meta.title" v-if="item.children && item.children.length > 0"> <el-sub-menu :index="item.path" v-if="item.children && item.children.length > 0">
<template #title v-if="item.meta.icon"> <template #title v-if="item.meta.icon">
<el-icon> <el-icon>
<Edit /> <Edit />
@ -11,7 +11,7 @@
<template #title v-else>{{ item.meta.title }}</template> <template #title v-else>{{ item.meta.title }}</template>
<menuItem :menuList="(item.children as any)" /> <menuItem :menuList="(item.children as any)" />
</el-sub-menu> </el-sub-menu>
<el-menu-item :index="item.name+'&&'+item.meta.title" v-else @click="handleSelectItem(item)"> <el-menu-item :index="item.path" :id="'navItem'+item.path" v-else >
<template v-if="item.meta.icon"> <template v-if="item.meta.icon">
<el-icon > <el-icon >
<Search/> </el-icon> <Search/> </el-icon>
@ -26,11 +26,8 @@
<script lang="ts" setup> <script lang="ts" setup>
const emits = defineEmits(['selectItem'])
const menuInfo: any = reactive({
list: []
})
// //
const props = defineProps({ const props = defineProps({
menuList: { menuList: {
@ -43,9 +40,5 @@ const props = defineProps({
} }
}) })
const handleSelectItem =(ev:any)=>{
console.log("ev=========666",ev)
emits("selectItem",ev)
}
</script> </script>

View File

@ -2,13 +2,14 @@
<el-menu :collapse="props.collapse" :background-color="props.backgroundColor" :text-color="props.textColor" <el-menu :collapse="props.collapse" :background-color="props.backgroundColor" :text-color="props.textColor"
:active-text-color="props.activeTextColor" :default-active="props.defaultActive" :active-text-color="props.activeTextColor" :default-active="props.defaultActive"
:default-openeds="props.defaultOpeneds" :unique-opened="props.uniqueOpened" :menu-trigger="props.menuTrigger" :default-openeds="props.defaultOpeneds" :unique-opened="props.uniqueOpened" :menu-trigger="props.menuTrigger"
:router="props.router" :collapse-transition="props.collapseTransition" :popper-effect="props.popperEffect" @select="customLinkCallBackFn" > :router="props.router" :collapse-transition="props.collapseTransition" :popper-effect="props.popperEffect" @select="customLinkCallBackFn($event)" >
<menuItem :menuList="props.menuList" :isCustomLink="props.isCustomLink" > <menuItem :menuList="props.menuList" :isCustomLink="props.isCustomLink" >
</menuItem> </menuItem>
</el-menu> </el-menu>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { Console } from "console";
import menuItem from "./menuItem.vue" import menuItem from "./menuItem.vue"
const props: any = defineProps({ const props: any = defineProps({
@ -69,10 +70,13 @@ const props: any = defineProps({
const customLinkCallBackFn =(ev:any)=>{ const customLinkCallBackFn =(ev:any)=>{
console.log("2342423",ev) console.log("2342423",ev)
const current = ev.split("&&") let navItemStr ="navItem"+ev
const navDom = document.getElementById(navItemStr)
console.log("navDomnavDomnavDom",navDom)
const currentText = navDom?.innerText
let currentItem = { let currentItem = {
title:current[1], title:currentText,
path:current[0] path:ev
} }
props.customLinkCallBack(currentItem) props.customLinkCallBack(currentItem)
} }

View File

@ -1,6 +1,6 @@
<template> <template>
<div class="nav_out"> <div class="nav_out">
<el-tag v-for="(tag,index) in navStore.topNavList" :key="tag.name" size="large" :effect="navStore.currentNav==tag.path?'dark':'info'" closable @close="closeNavTagFn(index)" @click="TapNavTagFn(tag)" class="navItem"> <el-tag v-for="(tag,index) in navStore.topNavList" :key="tag.name" size="small" :effect="navStore.currentNav==tag.path?'dark':'info'" closable @close="closeNavTagFn(index)" @click="TapNavTagFn(tag)" class="navItem">
{{ tag.title }} {{ tag.title }}
</el-tag> </el-tag>
</div> </div>
@ -31,8 +31,12 @@ const TapNavTagFn=(tag:any)=>{
padding-left: 12px; padding-left: 12px;
background-color: #fff; background-color: #fff;
} }
.navItem{ :deep(.navItem) {
margin-right:8px; margin-right:8px;
padding: 8px 8px 8px 10px;
.el-tag__content{
font-size: 12px;
}
} }
</style> </style>

View File

@ -9,37 +9,59 @@
<div class="right_user_opert"> <div class="right_user_opert">
<div class="user_info"> <div class="user_info">
<div class="user_name"> <div class="user_name">
<!-- 何以解忧 --> <!-- 何以解忧 -->
</div> </div>
<div class="user_icon"> <div class="user_icon">
<img src="/src/assets/img/defaultUser.png" alt=""> <img src="/src/assets/img/defaultUser.png" alt="">
</div> </div>
</div> </div>
<div class="login_opert"> <div class="login_opert">
<el-button type="plain"> <el-button type="plain" @click="loginOutFn">
退出登录 退出登录
</el-button> </el-button>
</div> </div>
</div> </div>
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { apiLogout } from 'http/api/myInfo'
import {comNavStore} from "store/comNav"
import { ElConfirmBeforeOpert } from "utils/elementCom"
const navStore = comNavStore()
const router = useRouter()
const loginOutFn = async () => {
const res: any = await apiLogout({})
console.log("res===apiLogout", res)
if (res.code == 200) {
confirmLoginOut()
}
}
const loginOut = () => {
router.replace({
name: "login"
})
navStore.clearTarget()
}
const confirmLoginOut = () => {
ElConfirmBeforeOpert(
"操作确认",
'是否确定退出登录?',
loginOut,
"确定",
'取消',
""
)
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.header_top { .header_top {
height: 72px; height: 72px;
background-color:#fff; background-color: #fff;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
@ -47,29 +69,35 @@
box-sizing: border-box; box-sizing: border-box;
border-bottom: 1px solid #eee; border-bottom: 1px solid #eee;
} }
.header_top_left_title{
.header_top_left_title {
font-size: 32px; font-size: 32px;
color: #0960bd; color: #0960bd;
} }
.right_user_opert{
display: flex;
justify-content: flex-end;
align-items: center;
.user_info{
display: flex;
justify-content: flex-end;
align-items: center;
.user_icon{
width: 42px;
height: 42px;
border-radius:50%;
// border: 2px solid #ccc;
margin: 0 12px;
img{ width: 42px;
height: 42px;
.right_user_opert {
display: flex;
justify-content: flex-end;
align-items: center;
.user_info {
display: flex;
justify-content: flex-end;
align-items: center;
.user_icon {
width: 42px;
height: 42px;
border-radius: 50%;
// border: 2px solid #ccc;
margin: 0 12px;
img {
width: 42px;
height: 42px;
}
} }
} }
} }
}
</style> </style>

View File

@ -1,7 +1,13 @@
import { post } from '../index' import { get, post ,detele} from '../index'
// 登录接口 // 登录接口
export const loginApi = (data: any) => { export const loginApi = (data: any) => {
return post('/zlpt-auth/login', data) return post('/zlpt-auth/login', data)
} }
// 登录接口
export const apiLogout = (data: any) => {
return detele('/zlpt-auth/logout', data)
}

View File

@ -1,7 +1,6 @@
import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router' import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'
import {useStore} from "store/main" import {useStore} from "store/main"
const routes: Array<RouteRecordRaw> = [ const routes: Array<RouteRecordRaw> = [
{ {
path: '/', path: '/',
name: 'home', name: 'home',
@ -13,7 +12,7 @@ const routes: Array<RouteRecordRaw> = [
routeListRoot: true routeListRoot: true
}, },
children: [], children: [],
redirect: '/index/enterpriseType',
}, },
{ {
path: '/index', path: '/index',
@ -28,7 +27,7 @@ const routes: Array<RouteRecordRaw> = [
}, },
children: [ children: [
{ {
path: 'swiperConfig', path:'configManage/swiperConfig',
name: 'swiperConfig', name: 'swiperConfig',
component: () => import('views/configuration/swiperConfig/index.vue'), component: () => import('views/configuration/swiperConfig/index.vue'),
meta: { meta: {
@ -40,7 +39,7 @@ const routes: Array<RouteRecordRaw> = [
}, },
{ {
path: 'specialInformationConfiguration', path:'configManage/specialInformationConfiguration',
name: 'specialInformationConfiguration', name: 'specialInformationConfiguration',
component: () => import('views/configuration/specialInformationConfiguration/index.vue'), component: () => import('views/configuration/specialInformationConfiguration/index.vue'),
meta: { meta: {
@ -50,7 +49,7 @@ const routes: Array<RouteRecordRaw> = [
} }
}, },
{ {
path: 'privacyAgreement', path:'configManage/privacyAgreement',
name: 'privacyAgreement', name: 'privacyAgreement',
component: () => import('views/configuration/privacyAgreement/index.vue'), component: () => import('views/configuration/privacyAgreement/index.vue'),
meta: { meta: {
@ -61,7 +60,7 @@ const routes: Array<RouteRecordRaw> = [
}, },
{ {
path: 'enterpriseManagement', path:'enterpriseTypeManage',
name: 'enterpriseManagement', name: 'enterpriseManagement',
component: () => import('views/enterpriseManagement/index.vue'), component: () => import('views/enterpriseManagement/index.vue'),
meta: { meta: {
@ -72,7 +71,7 @@ const routes: Array<RouteRecordRaw> = [
}, },
{ {
path: 'enterpriseType', path:'enterpriseTypeManage/enterpriseType',
name: 'enterpriseType', name: 'enterpriseType',
component: () => import('views/enterpriseManagement/enterpriseType/index.vue'), component: () => import('views/enterpriseManagement/enterpriseType/index.vue'),
meta: { meta: {
@ -82,7 +81,7 @@ const routes: Array<RouteRecordRaw> = [
} }
}, },
{ {
path: 'enterpriseEntryReview', path:'enterpriseTypeManage/enterpriseEntryReview',
name: 'enterpriseEntryReview', name: 'enterpriseEntryReview',
component: () => import('views/enterpriseManagement/enterpriseEntryReview/index.vue'), component: () => import('views/enterpriseManagement/enterpriseEntryReview/index.vue'),
meta: { meta: {
@ -93,7 +92,7 @@ const routes: Array<RouteRecordRaw> = [
}, },
{ {
path: 'businessReview', path:'enterpriseTypeManage/businessReview',
name: 'businessReview', name: 'businessReview',
component: () => import('views/enterpriseManagement/businessReview/index.vue'), component: () => import('views/enterpriseManagement/businessReview/index.vue'),
meta: { meta: {
@ -103,7 +102,7 @@ const routes: Array<RouteRecordRaw> = [
} }
}, },
{ {
path: 'enterpriseInfo', path:'enterpriseTypeManage/enterpriseInfo',
name: 'enterpriseInfo', name: 'enterpriseInfo',
component: () => import('views/enterpriseManagement/enterpriseInfo/index.vue'), component: () => import('views/enterpriseManagement/enterpriseInfo/index.vue'),
meta: { meta: {
@ -114,7 +113,7 @@ const routes: Array<RouteRecordRaw> = [
}, },
// 企业装备管理 // 企业装备管理
{ {
path: 'equipmentTypeTemplate', path:'enterpriseEquipmentManage/equipmentTypeTemplate',
name: 'equipmentTypeTemplate', name: 'equipmentTypeTemplate',
component: () => import('views/enterpriseEquipmentManage/equipmentTypeTemplate/index.vue'), component: () => import('views/enterpriseEquipmentManage/equipmentTypeTemplate/index.vue'),
meta: { meta: {
@ -125,7 +124,7 @@ const routes: Array<RouteRecordRaw> = [
}, },
{ {
path: 'equipmentListingApproval', path:'enterpriseEquipmentManage/equipmentListingApproval',
name: 'equipmentListingApproval', name: 'equipmentListingApproval',
component: () => import('views/enterpriseEquipmentManage/equipmentListingApproval/index.vue'), component: () => import('views/enterpriseEquipmentManage/equipmentListingApproval/index.vue'),
meta: { meta: {
@ -135,7 +134,7 @@ const routes: Array<RouteRecordRaw> = [
} }
}, },
{ {
path: 'iotEquipmentManagement', path:'enterpriseEquipmentManage/iotEquipmentManagement',
name: 'iotEquipmentManagement', name: 'iotEquipmentManagement',
component: () => import('views/enterpriseEquipmentManage/iotEquipmentManagement/index.vue'), component: () => import('views/enterpriseEquipmentManage/iotEquipmentManagement/index.vue'),
meta: { meta: {
@ -144,19 +143,10 @@ const routes: Array<RouteRecordRaw> = [
AuthFlag: true AuthFlag: true
} }
}, },
{
path: 'orderManagement',
name: 'orderManagement',
component: () => import('views/enterpriseEquipmentManage/iotEquipmentManagement/index.vue'),
meta: {
title: 'iot设备管理',
keepAlive: true,
AuthFlag: true
}
},
{ {
name: "orderManagement", name: "orderManagement",
path: 'orderManagement', path:'orderManagement',
component: () => import('views/orderManagement/index.vue'), component: () => import('views/orderManagement/index.vue'),
meta: { meta: {
title: '订单管理', title: '订单管理',
@ -168,7 +158,7 @@ const routes: Array<RouteRecordRaw> = [
// 111 // 111
{ {
name: "systemVersion", name: "systemVersion",
path: 'systemVersion', path:'systemManage/systemVersion',
component: () => import('views/systemManage/systemVersion/index.vue'), component: () => import('views/systemManage/systemVersion/index.vue'),
meta: { meta: {
title: '系统版本管理', title: '系统版本管理',
@ -179,7 +169,7 @@ const routes: Array<RouteRecordRaw> = [
}, },
{ {
name: "userManage", name: "userManage",
path: 'userManage', path:'systemManage/userManage',
component: () => import('views/systemManage/userManage/index.vue'), component: () => import('views/systemManage/userManage/index.vue'),
meta: { meta: {
title: '用户管理', title: '用户管理',
@ -191,18 +181,7 @@ const routes: Array<RouteRecordRaw> = [
{ {
name: "systemLog", name: "systemLog",
path: 'systemLog', path:'systemManage/systemLog',
component: () => import('views/systemManage/systemLog/index.vue'),
meta: {
title: '系统日志',
keepAlive: true,
AuthFlag: true
},
children: []
},
{
name: "systemLog",
path: 'systemLog',
component: () => import('views/systemManage/systemLog/index.vue'), component: () => import('views/systemManage/systemLog/index.vue'),
meta: { meta: {
title: '系统日志', title: '系统日志',
@ -211,9 +190,10 @@ const routes: Array<RouteRecordRaw> = [
}, },
children: [] children: []
}, },
{ {
name: "entryAuditDetails", name: "entryAuditDetails",
path: 'entryAuditDetails', path: 'enterpriseManagement/entryAuditDetails',
component: () => import('views/enterpriseManagement/enterpriseEntryReview/details.vue'), component: () => import('views/enterpriseManagement/enterpriseEntryReview/details.vue'),
meta: { meta: {
title: '审批详情', title: '审批详情',
@ -224,7 +204,7 @@ const routes: Array<RouteRecordRaw> = [
}, },
{ {
name: "businessReviewDetails", name: "businessReviewDetails",
path: 'businessReviewDetails', path: 'enterpriseManagement/businessReviewDetails',
component: () => import('views/enterpriseManagement/businessReview/details.vue'), component: () => import('views/enterpriseManagement/businessReview/details.vue'),
meta: { meta: {
title: '审批详情', title: '审批详情',
@ -234,7 +214,7 @@ const routes: Array<RouteRecordRaw> = [
children: [] children: []
}, { }, {
name: "enterpriseInfoDetails", name: "enterpriseInfoDetails",
path: 'enterpriseInfoDetails', path: 'enterpriseManagement/enterpriseInfoDetails',
component: () => import('views/enterpriseManagement/enterpriseInfo/details.vue'), component: () => import('views/enterpriseManagement/enterpriseInfo/details.vue'),
meta: { meta: {
title: '审批详情', title: '审批详情',
@ -244,7 +224,7 @@ const routes: Array<RouteRecordRaw> = [
children: [] children: []
}, { }, {
name: "lonLatPick", name: "lonLatPick",
path: 'lonLatPick', path: 'systemManage/lonLatPick',
component: () => import('views/enterpriseManagement/lonLatPick/index.vue'), component: () => import('views/enterpriseManagement/lonLatPick/index.vue'),
meta: { meta: {
title: '经纬度拾取', title: '经纬度拾取',
@ -256,9 +236,9 @@ const routes: Array<RouteRecordRaw> = [
] ]
}, },
{ {
name: "Login", name: "login",
path: '/Login', path: '/login',
component: () => import('views/Login.vue'), component: () => import('views/login.vue'),
meta: { meta: {
title: '登录', title: '登录',
keepAlive: true, keepAlive: true,

View File

@ -1,204 +0,0 @@
export const list: any = [
{
name: "configManage",
path:'/index/configManage',
meta: {
title: '配置管理',
keepAlive: true,
AuthFlag: true
},
children: [
{
path:'/index/configManage/swiperConfig',
name: 'swiperConfig',
component: 'views/configuration/swiperConfig.vue',
meta: {
title: '轮播图配置',
keepAlive: true,
AuthFlag: true
}
},
{
path:'/index/configManage/specialInformationConfiguration',
name: 'specialInformationConfiguration',
component: 'views/configuration/specialInformationConfiguration/index.vue',
meta: {
title: '专题资讯配置',
keepAlive: true,
AuthFlag: true
}
},
{
path:'/index/configManage/privacyAgreement',
name: 'privacyAgreement',
component: 'views/configuration/privacyAgreement/index.vue',
meta: {
title: '隐私协议模板管理',
keepAlive: true,
AuthFlag: true
}
},
]
},
{
name: "企业管理",
path:'/index/enterpriseTypeManage',
meta: {
title: '企业管理',
keepAlive: true,
AuthFlag: true
},
children: [
{
path:'/index/enterpriseTypeManage/enterpriseType',
name: 'configuration',
component: 'views/enterpriseManagement/enterpriseType/index.vue',
meta: {
title: '企业类型',
keepAlive: true,
AuthFlag: true
}
},
{
path:'/index/enterpriseTypeManage/enterpriseEntryReview',
name: 'enterpriseEntryReview',
component: 'views/enterpriseManagement/enterpriseEntryReview/index.vue',
meta: {
title: '企业入驻审核',
keepAlive: true,
AuthFlag: true
},
},
{
path:'/index/enterpriseTypeManage/businessReview',
name: 'businessReview',
component: 'views/enterpriseManagement/businessReview/index.vue',
meta: {
title: '企业业务开通审核',
keepAlive: true,
AuthFlag: true
}
},
{
path:'/index/enterpriseTypeManage/enterpriseInfo',
name: 'enterpriseInfo',
component: 'views/enterpriseManagement/enterpriseInfo/index.vue',
meta: {
title: '企业信息',
keepAlive: true,
AuthFlag: true
}
},
]
},
{
name: "企业装备管理",
path:'/index/enterpriseEquipmentManage',
meta: {
title: '企业装备管理',
keepAlive: true,
AuthFlag: true
},
children: [
{
path:'/index/enterpriseEquipmentManage/equipmentTypeTemplate',
name: 'equipmentTypeTemplate',
component: 'views/enterpriseEquipmentManage/equipmentTypeTemplate/index.vue',
meta: {
title: '装备类型模板',
keepAlive: true,
AuthFlag: true
}
},
{
path:'/index/enterpriseEquipmentManage/equipmentListingApproval',
name: 'equipmentListingApproval',
component: 'views/enterpriseEquipmentManage/equipmentListingApproval/index.vue',
meta: {
title: '装备上架审批',
keepAlive: true,
AuthFlag: true
},
},
// iotEquipmentManagement
{
path:'/index/enterpriseEquipmentManage/iotEquipmentManagement',
name: 'iotEquipmentManagement',
component: 'views/enterpriseEquipmentManage/iotEquipmentManagement/index.vue',
meta: {
title: 'iot设备管理',
keepAlive: true,
AuthFlag: true
}
}
]
},
{
name: "orderManagement",
path:'/index/orderManagement',
component: 'views/orderManagement/index.vue',
meta: {
title: '订单管理',
keepAlive: true,
AuthFlag: true
},
children: []
},
{
name: "systemManage",
path:'/index/systemManage',
meta: {
title: '系统管理',
keepAlive: true,
AuthFlag: true
},
children: [
{
path:'/index/systemManage/systemVersion',
name: 'systemVersion',
component: 'views/systemManage/systemVersion/index.vue',
meta: {
title: '系统版本管理',
keepAlive: true,
AuthFlag: true
}
},
{
path:'/index/systemManage/userManage',
name: 'userManage',
component: 'views/systemManage/userManage/index.vue',
meta: {
title: '用户管理',
keepAlive: true,
AuthFlag: true
}
} ,
{
path:'/index/systemManage/systemLog',
name: 'systemLog',
component: 'views/systemManage/systemLog/index.vue',
meta: {
title: '系统日志',
keepAlive: true,
AuthFlag: true
}
} ,
{
name: "lonLatPick",
path: 'lonLatPick',
component: () => import('views/enterpriseManagement/lonLatPick/index.vue'),
meta: {
title: '经纬度拾取',
keepAlive: true,
AuthFlag: true
},
}
]
}
]

View File

@ -1,61 +1,57 @@
export const list: any = [ export const list: any = [
// {
// name: "configManage",
// path:'/index/configManage',
// meta: {
// title: '配置管理',
// keepAlive: true,
// AuthFlag: true
// },
// children: [
// {
// path:'/index/configManage/swiperConfig',
// name: 'swiperConfig',
// component: 'views/configuration/swiperConfig.vue',
// meta: {
// title: '轮播图配置',
// keepAlive: true,
// AuthFlag: true
// }
// },
// {
// path:'/index/configManage/specialInformationConfiguration',
// name: 'specialInformationConfiguration',
// component: 'views/configuration/specialInformationConfiguration/index.vue',
// meta: {
// title: '专题资讯配置',
// keepAlive: true,
// AuthFlag: true
// }
// },
// {
// path:'/index/configManage/privacyAgreement',
// name: 'privacyAgreement',
// component: 'views/configuration/privacyAgreement/index.vue',
// meta: {
// title: '隐私协议模板管理',
// keepAlive: true,
// AuthFlag: true
// }
// },
// ]
// },
{ {
name: "enterpriseTypeManage", name: "configManage",
path:'/index/enterpriseTypeManage', path: '/index/configManage/swiperConfig',
meta: {
title: '配置管理',
keepAlive: true,
AuthFlag: true,
folder: true
},
children: [
{
path: '/index/configManage/swiperConfig',
name: 'swiperConfig',
meta: {
title: '轮播图配置',
keepAlive: true,
AuthFlag: true
}
},
{
path: '/index/configManage/specialInformationConfiguration',
name: 'specialInformationConfiguration',
meta: {
title: '专题资讯配置',
keepAlive: true,
AuthFlag: true
}
},
{
path: '/index/configManage/privacyAgreement',
name: 'privacyAgreement',
meta: {
title: '隐私协议模板管理',
keepAlive: true,
AuthFlag: true
}
},
]
},
{
name: "企业管理",
path: '/index/enterpriseTypeManage/enterpriseType',
meta: { meta: {
title: '企业管理', title: '企业管理',
keepAlive: true, keepAlive: true,
AuthFlag: true, AuthFlag: true,
folder:true folder: true
}, },
children: [ children: [
{ {
path:'/index/enterpriseTypeManage/enterpriseType', path: '/index/enterpriseTypeManage/enterpriseType',
name: 'enterpriseType', name: 'enterpriseType',
component: 'views/enterpriseManagement/enterpriseType/index.vue',
meta: { meta: {
title: '企业类型', title: '企业类型',
keepAlive: true, keepAlive: true,
@ -63,9 +59,9 @@ export const list: any = [
} }
}, },
{ {
path:'/index/enterpriseTypeManage/enterpriseEntryReview', path: '/index/enterpriseTypeManage/enterpriseEntryReview',
name: 'enterpriseEntryReview', name: 'enterpriseEntryReview',
component: 'views/enterpriseManagement/enterpriseEntryReview/index.vue',
meta: { meta: {
title: '企业入驻审核', title: '企业入驻审核',
keepAlive: true, keepAlive: true,
@ -74,9 +70,9 @@ export const list: any = [
}, },
{ {
path:'/index/enterpriseTypeManage/businessReview', path: '/index/enterpriseTypeManage/businessReview',
name: 'businessReview', name: 'businessReview',
component: 'views/enterpriseManagement/businessReview/index.vue',
meta: { meta: {
title: '企业业务开通审核', title: '企业业务开通审核',
keepAlive: true, keepAlive: true,
@ -84,9 +80,8 @@ export const list: any = [
} }
}, },
{ {
path:'/index/enterpriseTypeManage/enterpriseInfo', path: '/index/enterpriseTypeManage/enterpriseInfo',
name: 'enterpriseInfo', name: 'enterpriseInfo',
component: 'views/enterpriseManagement/enterpriseInfo/index.vue',
meta: { meta: {
title: '企业信息', title: '企业信息',
keepAlive: true, keepAlive: true,
@ -97,29 +92,27 @@ export const list: any = [
}, },
{ {
name: "企业装备管理", name: "企业装备管理",
path:'/index/enterpriseEquipmentManage', path: '/index/enterpriseEquipmentManage/equipmentTypeTemplate',
meta: { meta: {
title: '企业装备管理', title: '企业装备管理',
keepAlive: true, keepAlive: true,
AuthFlag: true, AuthFlag: true,
folder:true folder: true
}, },
children: [ children: [
// {
// path:'/index/enterpriseEquipmentManage/equipmentTypeTemplate',
// name: 'equipmentTypeTemplate',
// component: 'views/enterpriseEquipmentManage/equipmentTypeTemplate/index.vue',
// meta: {
// title: '装备类型模板',
// keepAlive: true,
// AuthFlag: true
// }
// },
{ {
path:'/index/enterpriseEquipmentManage/equipmentListingApproval', path: '/index/enterpriseEquipmentManage/equipmentTypeTemplate',
name: 'equipmentTypeTemplate',
meta: {
title: '装备类型模板',
keepAlive: true,
AuthFlag: true
}
},
{
path: '/index/enterpriseEquipmentManage/equipmentListingApproval',
name: 'equipmentListingApproval', name: 'equipmentListingApproval',
component: 'views/enterpriseEquipmentManage/equipmentListingApproval/index.vue',
meta: { meta: {
title: '装备上架审批', title: '装备上架审批',
keepAlive: true, keepAlive: true,
@ -128,79 +121,75 @@ export const list: any = [
}, },
// iotEquipmentManagement // iotEquipmentManagement
// { {
// path:'/index/enterpriseEquipmentManage/iotEquipmentManagement', path: '/index/enterpriseEquipmentManage/iotEquipmentManagement',
// name: 'iotEquipmentManagement', name: 'iotEquipmentManagement',
// component: 'views/enterpriseEquipmentManage/iotEquipmentManagement/index.vue', meta: {
// meta: { title: 'iot设备管理',
// title: 'iot设备管理', keepAlive: true,
// keepAlive: true, AuthFlag: true
// AuthFlag: true }
// } }
// }
] ]
}, },
// { {
// name: "orderManagement", name: "orderManagement",
// path:'/index/orderManagement', path: '/index/orderManagement',
// component: 'views/orderManagement/index.vue', meta: {
// meta: { title: '订单管理',
// title: '订单管理', keepAlive: true,
// keepAlive: true, AuthFlag: true,
// AuthFlag: true folder: true
// }, },
// children: [] children: []
// }, },
// { {
// name: "systemManage", name: "systemManage",
// path:'/index/systemManage', path: '/index/systemManage/systemVersion',
// meta: { meta: {
// title: '系统管理', title: '系统管理',
// keepAlive: true, keepAlive: true,
// AuthFlag: true AuthFlag: true,
// }, folder: true
// children: [ },
// { children: [
// path:'/index/systemManage/systemVersion', {
// name: 'systemVersion', path: '/index/systemManage/systemVersion',
// component: 'views/systemManage/systemVersion/index.vue', name: 'systemVersion',
// meta: { meta: {
// title: '系统版本管理', title: '系统版本管理',
// keepAlive: true, keepAlive: true,
// AuthFlag: true AuthFlag: true
// } }
// }, },
// { {
// path:'/index/systemManage/userManage', path: '/index/systemManage/userManage',
// name: 'userManage', name: 'userManage',
// component: 'views/systemManage/userManage/index.vue', meta: {
// meta: { title: '用户管理',
// title: '用户管理', keepAlive: true,
// keepAlive: true, AuthFlag: true
// AuthFlag: true }
// } },
// } , {
// { path: '/index/systemManage/systemLog',
// path:'/index/systemManage/systemLog', name: 'systemLog',
// name: 'systemLog', meta: {
// component: 'views/systemManage/systemLog/index.vue', title: '系统日志',
// meta: { keepAlive: true,
// title: '系统日志', AuthFlag: true
// keepAlive: true, }
// AuthFlag: true },
// } {
// } , name: "lonLatPick",
// { path: '/index/systemManage/lonLatPick',
// name: "lonLatPick", meta: {
// path: 'lonLatPick', title: '经纬度拾取',
// component: () => import('views/enterpriseManagement/lonLatPick/index.vue'), keepAlive: true,
// meta: { AuthFlag: true
// title: '经纬度拾取', },
// keepAlive: true, }
// AuthFlag: true ]
// }, }
// }
// ]
// }
] ]

206
src/router/routerData1.ts Normal file
View File

@ -0,0 +1,206 @@
export const list: any = [
// {
// name: "configManage",
// path:'/index/configManage',
// meta: {
// title: '配置管理',
// keepAlive: true,
// AuthFlag: true
// },
// children: [
// {
// path:'/index/configManage/swiperConfig',
// name: 'swiperConfig',
// component: 'views/configuration/swiperConfig.vue',
// meta: {
// title: '轮播图配置',
// keepAlive: true,
// AuthFlag: true
// }
// },
// {
// path:'/index/configManage/specialInformationConfiguration',
// name: 'specialInformationConfiguration',
// component: 'views/configuration/specialInformationConfiguration/index.vue',
// meta: {
// title: '专题资讯配置',
// keepAlive: true,
// AuthFlag: true
// }
// },
// {
// path:'/index/configManage/privacyAgreement',
// name: 'privacyAgreement',
// component: 'views/configuration/privacyAgreement/index.vue',
// meta: {
// title: '隐私协议模板管理',
// keepAlive: true,
// AuthFlag: true
// }
// },
// ]
// },
{
name: "enterpriseTypeManage",
path:'/index/enterpriseTypeManage',
meta: {
title: '企业管理',
keepAlive: true,
AuthFlag: true,
folder:true
},
children: [
{
path:'/index/enterpriseTypeManage/enterpriseType',
name: 'enterpriseType',
component: 'views/enterpriseManagement/enterpriseType/index.vue',
meta: {
title: '企业类型',
keepAlive: true,
AuthFlag: true
}
},
{
path:'/index/enterpriseTypeManage/enterpriseEntryReview',
name: 'enterpriseEntryReview',
component: 'views/enterpriseManagement/enterpriseEntryReview/index.vue',
meta: {
title: '企业入驻审核',
keepAlive: true,
AuthFlag: true
},
},
{
path:'/index/enterpriseTypeManage/businessReview',
name: 'businessReview',
component: 'views/enterpriseManagement/businessReview/index.vue',
meta: {
title: '企业业务开通审核',
keepAlive: true,
AuthFlag: true
}
},
{
path:'/index/enterpriseTypeManage/enterpriseInfo',
name: 'enterpriseInfo',
component: 'views/enterpriseManagement/enterpriseInfo/index.vue',
meta: {
title: '企业信息',
keepAlive: true,
AuthFlag: true
}
},
]
},
{
name: "企业装备管理",
path:'/index/enterpriseEquipmentManage',
meta: {
title: '企业装备管理',
keepAlive: true,
AuthFlag: true,
folder:true
},
children: [
// {
// path:'/index/enterpriseEquipmentManage/equipmentTypeTemplate',
// name: 'equipmentTypeTemplate',
// component: 'views/enterpriseEquipmentManage/equipmentTypeTemplate/index.vue',
// meta: {
// title: '装备类型模板',
// keepAlive: true,
// AuthFlag: true
// }
// },
{
path:'/index/enterpriseEquipmentManage/equipmentListingApproval',
name: 'equipmentListingApproval',
component: 'views/enterpriseEquipmentManage/equipmentListingApproval/index.vue',
meta: {
title: '装备上架审批',
keepAlive: true,
AuthFlag: true
},
},
// iotEquipmentManagement
// {
// path:'/index/enterpriseEquipmentManage/iotEquipmentManagement',
// name: 'iotEquipmentManagement',
// component: 'views/enterpriseEquipmentManage/iotEquipmentManagement/index.vue',
// meta: {
// title: 'iot设备管理',
// keepAlive: true,
// AuthFlag: true
// }
// }
]
},
// {
// name: "orderManagement",
// path:'/index/orderManagement',
// component: 'views/orderManagement/index.vue',
// meta: {
// title: '订单管理',
// keepAlive: true,
// AuthFlag: true
// },
// children: []
// },
// {
// name: "systemManage",
// path:'/index/systemManage',
// meta: {
// title: '系统管理',
// keepAlive: true,
// AuthFlag: true
// },
// children: [
// {
// path:'/index/systemManage/systemVersion',
// name: 'systemVersion',
// component: 'views/systemManage/systemVersion/index.vue',
// meta: {
// title: '系统版本管理',
// keepAlive: true,
// AuthFlag: true
// }
// },
// {
// path:'/index/systemManage/userManage',
// name: 'userManage',
// component: 'views/systemManage/userManage/index.vue',
// meta: {
// title: '用户管理',
// keepAlive: true,
// AuthFlag: true
// }
// } ,
// {
// path:'/index/systemManage/systemLog',
// name: 'systemLog',
// component: 'views/systemManage/systemLog/index.vue',
// meta: {
// title: '系统日志',
// keepAlive: true,
// AuthFlag: true
// }
// } ,
// {
// name: "lonLatPick",
// path: 'lonLatPick',
// component: () => import('views/enterpriseManagement/lonLatPick/index.vue'),
// meta: {
// title: '经纬度拾取',
// keepAlive: true,
// AuthFlag: true
// },
// }
// ]
// }
]

View File

@ -26,16 +26,19 @@ export const comNavStore = defineStore('main_com_nav', {
} }
this.currentNav = this.topNavList[index] this.currentNav = this.topNavList[index]
}, },
clearTarget(val: any) { clearTarget() {
this.topNavList = [] this.topNavList = []
this.currentNav=''
this.defaultActive=""
}, },
setCurrentNav(ev:any){ setCurrentNav(ev:any){
console.log("setCurrentNav00",ev) console.log("setCurrentNav00",ev)
this.currentNav = ev this.currentNav = ev
} , } ,
setDefaultActive(ev:any){ setDefaultActive(ev:any){
console.log("setCurrentNav") console.log("setCurrentNav")
this.defaultActive = ev.path+'&&'+ev.title this.defaultActive = ev
} }

View File

@ -2,7 +2,8 @@ export const useStore = defineStore('main', {
state: () => { state: () => {
return { return {
loadingFlag: false, //loading控制, loadingFlag: false, //loading控制,
token: "" token: "",
userInfo:{}
} }
}, },
getters: {}, getters: {},

View File

@ -1,30 +0,0 @@
export const useStore = defineStore('myInfo', {
state: () => {
return {
userName: '99'
}
},
getters: {
textConbain: (state) => state.userName + '4444',
textEnd() {
return this.textConbain + '666'
}
},
actions: {
updateText() {
console.log('updateText')
}
},
persist: {
enabled: true, // 开启数据缓存
strategies: [
{
// 自定义存储的 key默认是 store.$id
key: 'userName',
storage: sessionStorage, //缓存模式 可选 localStorage sessionStorage
// state 中的字段名,按组打包储存
paths: ['userName'] //需要缓存的字段 与 state中相关联
}
]
}
})

View File

@ -65,9 +65,10 @@ import headerNav from "components/headerCom/headerNav.vue"
.view_out_c { .view_out_c {
width:calc(100% - 24px) ; width:calc(100% - 12px) ;
flex: 1; flex: 1;
margin: 12px; margin: 12px;
margin-left:0;
display:flex; display:flex;
flex-direction: column; flex-direction: column;
} }