|
@ -2,197 +2,202 @@ |
|
|
<div :class="{ 'has-logo': showLogo }"> |
|
|
<div :class="{ 'has-logo': showLogo }"> |
|
|
<logo v-if="showLogo" :collapse="isCollapse" /> |
|
|
<logo v-if="showLogo" :collapse="isCollapse" /> |
|
|
<el-scrollbar wrap-class="scrollbar-wrapper"> |
|
|
<el-scrollbar wrap-class="scrollbar-wrapper"> |
|
|
<el-menu :default-active="activeMenu" :background-color="variables.menuBg" :text-color="variables.menuText" |
|
|
<el-menu |
|
|
:unique-opened="false" :active-text-color="variables.menuActiveText" :collapse-transition="false" |
|
|
:default-active="$route.path" |
|
|
mode="vertical"> |
|
|
:background-color="variables.menuBg" |
|
|
<sidebar-item v-for="route in routes" :key="route.path" :item="route" :base-path="route.path" /> |
|
|
: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-menu> |
|
|
</el-scrollbar> |
|
|
</el-scrollbar> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
import { |
|
|
import { mapGetters } from "vuex"; |
|
|
mapGetters |
|
|
import Logo from "./Logo"; |
|
|
} from 'vuex' |
|
|
import SidebarItem from "./SidebarItem"; |
|
|
import Logo from './Logo' |
|
|
import variables from "@/styles/variables.scss"; |
|
|
import SidebarItem from './SidebarItem' |
|
|
import { getrolemenus, loginDetails } from "@/api/system/Role/role.js"; |
|
|
import variables from '@/styles/variables.scss' |
|
|
import { getStorage } from "@/utils/auth"; |
|
|
import { |
|
|
|
|
|
getrolemenus, |
|
|
|
|
|
loginDetails |
|
|
|
|
|
} from '@/api/system/Role/role.js' |
|
|
|
|
|
import { |
|
|
|
|
|
getStorage |
|
|
|
|
|
} from '@/utils/auth' |
|
|
|
|
|
export default { |
|
|
export default { |
|
|
components: { |
|
|
components: { |
|
|
SidebarItem, |
|
|
SidebarItem, |
|
|
Logo |
|
|
Logo, |
|
|
}, |
|
|
}, |
|
|
data() { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
|
YongHuid: [], |
|
|
YongHuid: [], |
|
|
// routes: [], |
|
|
// routes: [], |
|
|
params: { |
|
|
params: { |
|
|
sourceSid: '9d048c07-7677-4774-9177-aa02b049ff06', |
|
|
sourceSid: "9d048c07-7677-4774-9177-aa02b049ff06", |
|
|
userSid: '', |
|
|
userSid: "", |
|
|
}, |
|
|
}, |
|
|
routes: [ |
|
|
routes: [ |
|
|
{ |
|
|
{ |
|
|
alwaysShow: true, |
|
|
alwaysShow: true, |
|
|
component: 'supervise', |
|
|
component: "supervise", |
|
|
meta: { |
|
|
meta: { |
|
|
icon: "el-icon-menu", |
|
|
icon: "el-icon-menu", |
|
|
title: "库房登记" |
|
|
title: "库房登记", |
|
|
}, |
|
|
}, |
|
|
name: "", |
|
|
name: "", |
|
|
path: "/supervise", |
|
|
path: "/supervise", |
|
|
children: [{ |
|
|
children: [ |
|
|
|
|
|
{ |
|
|
alwaysShow: true, |
|
|
alwaysShow: true, |
|
|
component: 'index', |
|
|
component: "index", |
|
|
meta: { |
|
|
meta: { |
|
|
icon: "el-icon-help", |
|
|
icon: "el-icon-help", |
|
|
title: "油罐库存登记" |
|
|
title: "油罐库存登记", |
|
|
}, |
|
|
}, |
|
|
name: "/supervise/recordOilTank", |
|
|
name: "/supervise/recordOilTank", |
|
|
path: "/supervise/recordOilTank", |
|
|
path: "/supervise/recordOilTank", |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
alwaysShow: true, |
|
|
alwaysShow: true, |
|
|
component: 'index', |
|
|
component: "index", |
|
|
meta: { |
|
|
meta: { |
|
|
icon: "el-icon-help", |
|
|
icon: "el-icon-help", |
|
|
title: "原油入库登记" |
|
|
title: "原油入库登记", |
|
|
}, |
|
|
}, |
|
|
name: "/supervise/oilTypeInBound", |
|
|
name: "/supervise/oilTypeInBound", |
|
|
path: "/supervise/oilTypeInBound", |
|
|
path: "/supervise/oilTypeInBound", |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
alwaysShow: true, |
|
|
alwaysShow: true, |
|
|
component: 'index', |
|
|
component: "index", |
|
|
meta: { |
|
|
meta: { |
|
|
icon: "el-icon-help", |
|
|
icon: "el-icon-help", |
|
|
title: "原油出库登记" |
|
|
title: "原油出库登记", |
|
|
}, |
|
|
}, |
|
|
name: "/supervise/oilTypeOutBound", |
|
|
name: "/supervise/oilTypeOutBound", |
|
|
path: "/supervise/oilTypeOutBound", |
|
|
path: "/supervise/oilTypeOutBound", |
|
|
}, |
|
|
}, |
|
|
] |
|
|
], |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
alwaysShow: true, |
|
|
alwaysShow: true, |
|
|
component: 'inventory', |
|
|
component: "inventory", |
|
|
meta: { |
|
|
meta: { |
|
|
icon: "el-icon-menu", |
|
|
icon: "el-icon-menu", |
|
|
title: "库存管理" |
|
|
title: "库存管理", |
|
|
}, |
|
|
}, |
|
|
name: "", |
|
|
name: "", |
|
|
path: "/inventory", |
|
|
path: "/inventory", |
|
|
children: [ |
|
|
children: [ |
|
|
{ |
|
|
{ |
|
|
alwaysShow: true, |
|
|
alwaysShow: true, |
|
|
component: 'index', |
|
|
component: "index", |
|
|
meta: { |
|
|
meta: { |
|
|
icon: "el-icon-help", |
|
|
icon: "el-icon-help", |
|
|
title: "油罐库存记录" |
|
|
title: "油罐库存记录", |
|
|
}, |
|
|
}, |
|
|
name: "/inventory/oilTankList", |
|
|
name: "/inventory/oilTankList", |
|
|
path: "/inventory/oilTankList", |
|
|
path: "/inventory/oilTankList", |
|
|
},{ |
|
|
}, |
|
|
|
|
|
{ |
|
|
alwaysShow: true, |
|
|
alwaysShow: true, |
|
|
component: 'index', |
|
|
component: "index", |
|
|
meta: { |
|
|
meta: { |
|
|
icon: "el-icon-help", |
|
|
icon: "el-icon-help", |
|
|
title: "原油入库记录" |
|
|
title: "原油入库记录", |
|
|
}, |
|
|
}, |
|
|
name: "/inventory/oilTypeInBoundList", |
|
|
name: "/inventory/oilTypeInBoundList", |
|
|
path: "/inventory/oilTypeInBoundList", |
|
|
path: "/inventory/oilTypeInBoundList", |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
alwaysShow: true, |
|
|
alwaysShow: true, |
|
|
component: 'index', |
|
|
component: "index", |
|
|
meta: { |
|
|
meta: { |
|
|
icon: "el-icon-help", |
|
|
icon: "el-icon-help", |
|
|
title: "原油出库记录" |
|
|
title: "原油出库记录", |
|
|
}, |
|
|
}, |
|
|
name: "/inventory/oilTypeOutBoundList", |
|
|
name: "/inventory/oilTypeOutBoundList", |
|
|
path: "/inventory/oilTypeOutBoundList", |
|
|
path: "/inventory/oilTypeOutBoundList", |
|
|
}, |
|
|
}, |
|
|
] |
|
|
], |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
alwaysShow: true, |
|
|
alwaysShow: true, |
|
|
component: 'baseInfo', |
|
|
component: "baseInfo", |
|
|
meta: { |
|
|
meta: { |
|
|
icon: "el-icon-menu", |
|
|
icon: "el-icon-menu", |
|
|
title: "基础信息" |
|
|
title: "基础信息", |
|
|
}, |
|
|
}, |
|
|
name: "", |
|
|
name: "", |
|
|
path: "/baseInfo", |
|
|
path: "/baseInfo", |
|
|
children: [{ |
|
|
children: [ |
|
|
|
|
|
{ |
|
|
alwaysShow: true, |
|
|
alwaysShow: true, |
|
|
component: 'index', |
|
|
component: "index", |
|
|
meta: { |
|
|
meta: { |
|
|
icon: "el-icon-help", |
|
|
icon: "el-icon-help", |
|
|
title: "物料类型" |
|
|
title: "物料类型", |
|
|
}, |
|
|
}, |
|
|
name: "/baseInfo/materialType", |
|
|
name: "/baseInfo/materialType", |
|
|
path: "/baseInfo/materialType", |
|
|
path: "/baseInfo/materialType", |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
alwaysShow: true, |
|
|
alwaysShow: true, |
|
|
component: 'index', |
|
|
component: "index", |
|
|
meta: { |
|
|
meta: { |
|
|
icon: "el-icon-help", |
|
|
icon: "el-icon-help", |
|
|
title: "物料信息" |
|
|
title: "物料信息", |
|
|
}, |
|
|
}, |
|
|
name: "/baseInfo/materialInfo", |
|
|
name: "/baseInfo/materialInfo", |
|
|
path: "/baseInfo/materialInfo", |
|
|
path: "/baseInfo/materialInfo", |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
alwaysShow: true, |
|
|
alwaysShow: true, |
|
|
component: 'index', |
|
|
component: "index", |
|
|
meta: { |
|
|
meta: { |
|
|
icon: "el-icon-help", |
|
|
icon: "el-icon-help", |
|
|
title: "原油类型" |
|
|
title: "原油类型", |
|
|
}, |
|
|
}, |
|
|
name: "/baseInfo/oilType", |
|
|
name: "/baseInfo/oilType", |
|
|
path: "/baseInfo/oilType", |
|
|
path: "/baseInfo/oilType", |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
alwaysShow: true, |
|
|
alwaysShow: true, |
|
|
component: 'index', |
|
|
component: "index", |
|
|
meta: { |
|
|
meta: { |
|
|
icon: "el-icon-help", |
|
|
icon: "el-icon-help", |
|
|
title: "油罐信息" |
|
|
title: "油罐信息", |
|
|
}, |
|
|
}, |
|
|
name: "/baseInfo/oilTank", |
|
|
name: "/baseInfo/oilTank", |
|
|
path: "/baseInfo/oilTank", |
|
|
path: "/baseInfo/oilTank", |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
alwaysShow: true, |
|
|
alwaysShow: true, |
|
|
component: 'index', |
|
|
component: "index", |
|
|
meta: { |
|
|
meta: { |
|
|
icon: "el-icon-help", |
|
|
icon: "el-icon-help", |
|
|
title: "流量仪器" |
|
|
title: "流量仪器", |
|
|
}, |
|
|
}, |
|
|
name: "/baseInfo/flowInstrument", |
|
|
name: "/baseInfo/flowInstrument", |
|
|
path: "/baseInfo/flowInstrument", |
|
|
path: "/baseInfo/flowInstrument", |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
alwaysShow: true, |
|
|
alwaysShow: true, |
|
|
component: 'index', |
|
|
component: "index", |
|
|
meta: { |
|
|
meta: { |
|
|
icon: "el-icon-help", |
|
|
icon: "el-icon-help", |
|
|
title: "供应商信息" |
|
|
title: "供应商信息", |
|
|
}, |
|
|
}, |
|
|
name: "/baseInfo/supplier", |
|
|
name: "/baseInfo/supplier", |
|
|
path: "/baseInfo/supplier", |
|
|
path: "/baseInfo/supplier", |
|
|
} |
|
|
}, |
|
|
] |
|
|
], |
|
|
}, |
|
|
}, |
|
|
// { |
|
|
// { |
|
|
// alwaysShow: true, |
|
|
// alwaysShow: true, |
|
@ -263,7 +268,6 @@ |
|
|
// path: "/rawMaterialInAndOutBound/index" |
|
|
// path: "/rawMaterialInAndOutBound/index" |
|
|
// }, |
|
|
// }, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// { |
|
|
// { |
|
|
// alwaysShow: true, |
|
|
// alwaysShow: true, |
|
|
// component: 'index', |
|
|
// component: 'index', |
|
@ -274,13 +278,11 @@ |
|
|
// name: "/project/index", |
|
|
// name: "/project/index", |
|
|
// path: "/project/index" |
|
|
// path: "/project/index" |
|
|
// }, |
|
|
// }, |
|
|
] |
|
|
], |
|
|
} |
|
|
}; |
|
|
}, |
|
|
}, |
|
|
computed: { |
|
|
computed: { |
|
|
...mapGetters([ |
|
|
...mapGetters(["sidebar"]), |
|
|
'sidebar' |
|
|
|
|
|
]), |
|
|
|
|
|
// routes() { |
|
|
// routes() { |
|
|
// f4d2e507-c4ed-451c-b364-04c08f962045 |
|
|
// f4d2e507-c4ed-451c-b364-04c08f962045 |
|
|
// console.log('78979789', this.$router.options.routes) |
|
|
// console.log('78979789', this.$router.options.routes) |
|
@ -296,20 +298,20 @@ |
|
|
// if (meta.activeMenu) { |
|
|
// if (meta.activeMenu) { |
|
|
// return meta.activeMenu |
|
|
// return meta.activeMenu |
|
|
// } |
|
|
// } |
|
|
return "/index" |
|
|
return "/index"; |
|
|
}, |
|
|
}, |
|
|
showLogo() { |
|
|
showLogo() { |
|
|
return this.$store.state.settings.sidebarLogo |
|
|
return this.$store.state.settings.sidebarLogo; |
|
|
}, |
|
|
}, |
|
|
variables() { |
|
|
variables() { |
|
|
return variables |
|
|
return variables; |
|
|
}, |
|
|
}, |
|
|
isCollapse() { |
|
|
isCollapse() { |
|
|
return !this.sidebar.opened |
|
|
return !this.sidebar.opened; |
|
|
} |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
created() { |
|
|
created() { |
|
|
this.postHuoquyonghu() |
|
|
this.postHuoquyonghu(); |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
// 获取用户信息 |
|
|
// 获取用户信息 |
|
@ -323,12 +325,12 @@ |
|
|
// getrolemenus(this.params).then((res) => { |
|
|
// getrolemenus(this.params).then((res) => { |
|
|
// const userRoles = this.resRouter(res.data) |
|
|
// const userRoles = this.resRouter(res.data) |
|
|
this.routes.push({ |
|
|
this.routes.push({ |
|
|
path: '*', |
|
|
path: "*", |
|
|
redirect: '/404', |
|
|
redirect: "/404", |
|
|
hidden: true |
|
|
hidden: true, |
|
|
}) |
|
|
}); |
|
|
console.log('左侧菜单', this.routes) |
|
|
console.log("左侧菜单", this.routes); |
|
|
return this.routes |
|
|
return this.routes; |
|
|
// }) |
|
|
// }) |
|
|
// } |
|
|
// } |
|
|
// }) |
|
|
// }) |
|
@ -337,20 +339,20 @@ |
|
|
// 递归,将后台传来数组 |
|
|
// 递归,将后台传来数组 |
|
|
for (var i = 0; i < menus.length; i++) { |
|
|
for (var i = 0; i < menus.length; i++) { |
|
|
if (menus[i].children && menus[i].children.length != 0) { |
|
|
if (menus[i].children && menus[i].children.length != 0) { |
|
|
this.resRouter(menus[i].children) |
|
|
this.resRouter(menus[i].children); |
|
|
} |
|
|
} |
|
|
if (menus[i].children.length == 0) { |
|
|
if (menus[i].children.length == 0) { |
|
|
delete menus[i].children |
|
|
delete menus[i].children; |
|
|
delete menus[i].redirect |
|
|
delete menus[i].redirect; |
|
|
} |
|
|
} |
|
|
if (menus[i].component == '') { |
|
|
if (menus[i].component == "") { |
|
|
console.log('55555', menus[i]) |
|
|
console.log("55555", menus[i]); |
|
|
menus[i] = { |
|
|
menus[i] = { |
|
|
path: menus[i].path, |
|
|
path: menus[i].path, |
|
|
component: '', |
|
|
component: "", |
|
|
redirect: menus[i].path, |
|
|
redirect: menus[i].path, |
|
|
children: [menus[i]], |
|
|
children: [menus[i]], |
|
|
} |
|
|
}; |
|
|
} else { |
|
|
} else { |
|
|
// menus[i] = { |
|
|
// menus[i] = { |
|
|
// path: menus[i].path, |
|
|
// path: menus[i].path, |
|
@ -360,10 +362,10 @@ |
|
|
// } |
|
|
// } |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
this.routes = menus |
|
|
this.routes = menus; |
|
|
console.log('左侧菜单', this.routes) |
|
|
console.log("左侧菜单", this.routes); |
|
|
return menus |
|
|
return menus; |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
} |
|
|
}; |
|
|
</script> |
|
|
</script> |
|
|