You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
444 lines
11 KiB
444 lines
11 KiB
<template>
|
|
<div :class="{ 'has-logo': showLogo }">
|
|
<logo v-if="showLogo" :collapse="isCollapse" />
|
|
<el-scrollbar wrap-class="scrollbar-wrapper">
|
|
<el-menu
|
|
:default-active="$route.path"
|
|
:background-color="variables.menuBg"
|
|
:text-color="variables.menuText"
|
|
:unique-opened="false"
|
|
:active-text-color="variables.menuActiveText"
|
|
:collapse-transition="false"
|
|
mode="vertical"
|
|
>
|
|
<sidebar-item v-for="route in routes" :key="route.path" :item="route" :base-path="route.path" />
|
|
</el-menu>
|
|
</el-scrollbar>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import {
|
|
mapGetters
|
|
} from 'vuex'
|
|
import Logo from './Logo'
|
|
import SidebarItem from './SidebarItem'
|
|
import variables from '@/styles/variables.scss'
|
|
import {
|
|
getrolemenus,
|
|
loginDetails
|
|
} from '@/api/system/Role/role.js'
|
|
import {
|
|
getStorage
|
|
} from '@/utils/auth'
|
|
export default {
|
|
components: {
|
|
SidebarItem,
|
|
Logo
|
|
},
|
|
data() {
|
|
return {
|
|
YongHuid: [],
|
|
// routes: [],
|
|
params: {
|
|
sourceSid: '9d048c07-7677-4774-9177-aa02b049ff06',
|
|
userSid: ''
|
|
},
|
|
routes: [{
|
|
alwaysShow: true,
|
|
component: 'supervise',
|
|
meta: {
|
|
icon: 'el-icon-menu',
|
|
title: '进销存管理'
|
|
},
|
|
name: 'supervise',
|
|
path: '/supervise',
|
|
children: [{
|
|
alwaysShow: true,
|
|
component: 'recordOilTank',
|
|
meta: {
|
|
icon: 'el-icon-help',
|
|
title: '出库申请'
|
|
},
|
|
name: 'oilTypeInBound',
|
|
path: '/oilTypeInBound',
|
|
children: [{
|
|
alwaysShow: true,
|
|
component: 'oilTypeInBound',
|
|
meta: {
|
|
icon: 'el-icon-help',
|
|
title: '出库申请'
|
|
},
|
|
name: '/supervise/oilTypeInBound',
|
|
path: '/supervise/oilTypeInBound'
|
|
},
|
|
{
|
|
alwaysShow: true,
|
|
component: 'oilTypeOutBound',
|
|
meta: {
|
|
icon: 'el-icon-help',
|
|
title: '出库记录列表'
|
|
},
|
|
name: '/supervise/oilTypeOutBound',
|
|
path: '/supervise/oilTypeOutBound'
|
|
}
|
|
]
|
|
},
|
|
{
|
|
alwaysShow: true,
|
|
component: 'index',
|
|
meta: {
|
|
icon: 'el-icon-help',
|
|
title: '入库申请'
|
|
},
|
|
name: 'recordOilTank',
|
|
path: '/recordOilTank',
|
|
children: [{
|
|
alwaysShow: true,
|
|
component: 'recordOilTank',
|
|
meta: {
|
|
icon: 'el-icon-help',
|
|
title: '入库申请'
|
|
},
|
|
name: '/supervise/recordOilTank',
|
|
path: '/supervise/recordOilTank'
|
|
},
|
|
{
|
|
alwaysShow: true,
|
|
component: 'rukujilu',
|
|
meta: {
|
|
icon: 'el-icon-help',
|
|
title: '入库记录列表'
|
|
},
|
|
name: '/supervise/rukujilu',
|
|
path: '/supervise/rukujilu'
|
|
}
|
|
]
|
|
},
|
|
{
|
|
alwaysShow: true,
|
|
component: 'churuku',
|
|
meta: {
|
|
icon: 'el-icon-help',
|
|
title: '出入库记录'
|
|
},
|
|
name: '/supervise/churuku',
|
|
path: '/supervise/churuku'
|
|
},
|
|
{
|
|
alwaysShow: true,
|
|
component: 'inventory',
|
|
meta: {
|
|
icon: 'el-icon-help',
|
|
title: '库存管理'
|
|
},
|
|
name: '/supervise/inventory',
|
|
path: '/supervise/inventory'
|
|
},
|
|
{
|
|
alwaysShow: true,
|
|
component: 'churukuHT',
|
|
meta: {
|
|
icon: 'el-icon-help',
|
|
title: '出入库合同管理'
|
|
},
|
|
name: '/supervise/churukuHT',
|
|
path: '/supervise/churukuHT'
|
|
}
|
|
]
|
|
},
|
|
{
|
|
alwaysShow: true,
|
|
component: 'MaterialBrand',
|
|
meta: {
|
|
icon: 'el-icon-menu',
|
|
title: '物料品牌'
|
|
},
|
|
name: '/MaterialBrand/index',
|
|
path: '/MaterialBrand/index'
|
|
},
|
|
{
|
|
alwaysShow: true,
|
|
component: 'materialManagement',
|
|
meta: {
|
|
icon: 'el-icon-menu',
|
|
title: '物料管理'
|
|
},
|
|
name: '/materialManagement/index',
|
|
path: '/materialManagement/index'
|
|
},
|
|
{
|
|
alwaysShow: true,
|
|
component: 'storeManagement',
|
|
meta: {
|
|
icon: 'el-icon-menu',
|
|
title: '仓库管理'
|
|
},
|
|
name: '/storeManagement/index',
|
|
path: '/storeManagement/index'
|
|
},
|
|
{
|
|
alwaysShow: true,
|
|
component: 'supplierManagement',
|
|
meta: {
|
|
icon: 'el-icon-menu',
|
|
title: '供应商管理'
|
|
},
|
|
name: '/supplierManagement/index',
|
|
path: '/supplierManagement/index'
|
|
},
|
|
// {
|
|
// alwaysShow: true,
|
|
// component: 'projectManagement',
|
|
// meta: {
|
|
// icon: 'el-icon-menu',
|
|
// title: '项目管理'
|
|
// },
|
|
// name: '/projectManagement/index',
|
|
// path: '/projectManagement/index'
|
|
// },
|
|
// {
|
|
// alwaysShow: true,
|
|
// component: 'inAndOutboundReports',
|
|
// meta: {
|
|
// icon: 'el-icon-menu',
|
|
// title: '出入库报表'
|
|
// },
|
|
// name: '',
|
|
// path: '/inAndOutboundReports',
|
|
// children: [{
|
|
// alwaysShow: true,
|
|
// component: 'index',
|
|
// meta: {
|
|
// icon: 'el-icon-help',
|
|
// title: '入库报表'
|
|
// },
|
|
// name: 'inAndOutboundReports/inBound/index',
|
|
// path: '/inAndOutboundReports/inBound/index'
|
|
// },
|
|
// {
|
|
// alwaysShow: true,
|
|
// component: 'index',
|
|
// meta: {
|
|
// icon: 'el-icon-help',
|
|
// title: '出库报表'
|
|
// },
|
|
// name: 'inAndOutboundReports/outBound/index',
|
|
// path: '/inAndOutboundReports/outBound/index'
|
|
// },
|
|
// {
|
|
// alwaysShow: true,
|
|
// component: 'index',
|
|
// meta: {
|
|
// icon: 'el-icon-help',
|
|
// title: '库存报表'
|
|
// },
|
|
// name: 'inAndOutboundReports/inventory/index',
|
|
// path: '/inAndOutboundReports/inventory/index'
|
|
// }
|
|
// ]
|
|
// },
|
|
{
|
|
alwaysShow: true,
|
|
component: 'expexcel',
|
|
meta: {
|
|
icon: 'el-icon-menu',
|
|
title: '数据导出'
|
|
},
|
|
name: '',
|
|
path: '/expexcel',
|
|
children: [{
|
|
alwaysShow: true,
|
|
component: 'yxdz',
|
|
meta: {
|
|
icon: 'el-icon-help',
|
|
title: '有效电站'
|
|
},
|
|
name: 'expexcel/yxdz',
|
|
path: '/expexcel/yxdz'
|
|
},
|
|
{
|
|
alwaysShow: true,
|
|
component: 'fdlb',
|
|
meta: {
|
|
icon: 'el-icon-help',
|
|
title: '发电列表'
|
|
},
|
|
name: 'expexcel/fdlb',
|
|
path: '/expexcel/fdlb'
|
|
}
|
|
]
|
|
},
|
|
{
|
|
alwaysShow: true,
|
|
component: 'systemOrder',
|
|
meta: {
|
|
icon: 'el-icon-menu',
|
|
title: '监管报表'
|
|
},
|
|
name: '',
|
|
path: '/systemOrder',
|
|
children: [{
|
|
alwaysShow: true,
|
|
component: 'index',
|
|
meta: {
|
|
icon: 'el-icon-help',
|
|
title: '电站列表'
|
|
},
|
|
name: 'systemOrder/index',
|
|
path: '/systemOrder/index'
|
|
},
|
|
{
|
|
alwaysShow: true,
|
|
component: 'index',
|
|
meta: {
|
|
icon: 'el-icon-help',
|
|
title: '项目流程数据'
|
|
},
|
|
name: 'systemOrder/proj',
|
|
path: '/systemOrder/proj'
|
|
},
|
|
{
|
|
alwaysShow: true,
|
|
component: 'index',
|
|
meta: {
|
|
icon: 'el-icon-help',
|
|
title: '监管工作日报'
|
|
},
|
|
name: 'systemOrder/jggzrb',
|
|
path: '/systemOrder/jggzrb'
|
|
},
|
|
{
|
|
alwaysShow: true,
|
|
component: 'index',
|
|
meta: {
|
|
icon: 'el-icon-help',
|
|
title: '库存日报'
|
|
},
|
|
name: 'systemOrder/kcrb',
|
|
path: '/systemOrder/kcrb'
|
|
}
|
|
// {
|
|
// alwaysShow: true,
|
|
// component: 'index',
|
|
// meta: {
|
|
// icon: 'el-icon-help',
|
|
// title: '出库记录'
|
|
// },
|
|
// name: 'systemOrder/kcck',
|
|
// path: '/systemOrder/kcck'
|
|
// },
|
|
// {
|
|
// alwaysShow: true,
|
|
// component: 'index',
|
|
// meta: {
|
|
// icon: 'el-icon-help',
|
|
// title: '入库记录'
|
|
// },
|
|
// name: 'systemOrder/kcrk',
|
|
// path: '/systemOrder/kcrk'
|
|
// }
|
|
]
|
|
},
|
|
{
|
|
alwaysShow: true,
|
|
component: 'engineeringReport',
|
|
meta: {
|
|
icon: 'el-icon-menu',
|
|
title: '仓库监控'
|
|
},
|
|
name: 'engineeringReport',
|
|
path: 'https://supervise.yxtsoft.com/map365/#/allData?projectSid=d8bf7556-6db4-46b1-87eb-f3e9f93d330f&projectName=%E5%B1%B1%E6%B5%B7%E8%83%BD%E6%BA%90%E5%85%89%E4%BC%8F%E5%8A%A8%E4%BA%A7%E8%B4%A8%E6%8A%BC%E9%A1%B9%E7%9B%AE&orderDate=2024-03-12'
|
|
}
|
|
]
|
|
}
|
|
},
|
|
computed: {
|
|
...mapGetters(['sidebar']),
|
|
// routes() {
|
|
// f4d2e507-c4ed-451c-b364-04c08f962045
|
|
// console.log('78979789', this.$router.options.routes)
|
|
// return this.$router.options.routes
|
|
// },
|
|
activeMenu() {
|
|
// const route = this.$route
|
|
// const {
|
|
// meta,
|
|
// path
|
|
// } = route
|
|
// // if set path, the sidebar will highlight the path you set
|
|
// if (meta.activeMenu) {
|
|
// return meta.activeMenu
|
|
// }
|
|
return '/index'
|
|
},
|
|
showLogo() {
|
|
return this.$store.state.settings.sidebarLogo
|
|
},
|
|
variables() {
|
|
return variables
|
|
},
|
|
isCollapse() {
|
|
return !this.sidebar.opened
|
|
}
|
|
},
|
|
created() {
|
|
this.postHuoquyonghu()
|
|
},
|
|
methods: {
|
|
// 获取用户信息
|
|
postHuoquyonghu() {
|
|
// var token = getStorage()
|
|
// loginDetails(token).then((response) => {
|
|
// console.log('resss', response)
|
|
// if (response.code === '200') {
|
|
// this.YongHuid = response.data
|
|
// this.params.userSid = this.YongHuid.sid
|
|
// getrolemenus(this.params).then((res) => {
|
|
// const userRoles = this.resRouter(res.data)
|
|
this.routes.push({
|
|
path: '*',
|
|
redirect: '/404',
|
|
hidden: true
|
|
})
|
|
console.log('左侧菜单', this.routes)
|
|
return this.routes
|
|
// })
|
|
// }
|
|
// })
|
|
},
|
|
resRouter(menus) {
|
|
// 递归,将后台传来数组
|
|
for (var i = 0; i < menus.length; i++) {
|
|
if (menus[i].children && menus[i].children.length != 0) {
|
|
this.resRouter(menus[i].children)
|
|
}
|
|
if (menus[i].children.length == 0) {
|
|
delete menus[i].children
|
|
delete menus[i].redirect
|
|
}
|
|
if (menus[i].component == '') {
|
|
console.log('55555', menus[i])
|
|
menus[i] = {
|
|
path: menus[i].path,
|
|
component: '',
|
|
redirect: menus[i].path,
|
|
children: [menus[i]]
|
|
}
|
|
} else {
|
|
// menus[i] = {
|
|
// path: menus[i].path,
|
|
// component: '',
|
|
// redirect: menus[i].path,
|
|
// children: [menus[i]],
|
|
// }
|
|
}
|
|
}
|
|
this.routes = menus
|
|
console.log('左侧菜单', this.routes)
|
|
return menus
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
|