隐藏装置升级

master
fanluyan 2 years ago
parent 0ca9e0620a
commit 8b5d09dbd2

@ -129,6 +129,73 @@ export default {
], ],
}, },
], ],
items2: [
// {
// icon: "el-icon-s-home",
// index: "stritl",
// title: "",
// },
{
icon: "el-icon-camera",
index: "/realTimeMonitor",
title: "实时监控",
},
{
icon: "el-icon-film",
index: "/pictureRotation",
title: "图片轮巡",
},
// {
// icon: "el-icon-bell",
// index: "photoAlarm",
// title: "",
// },
{
icon: "el-icon-search",
index: "/realTimeSearch",
title: "历史图片",
},
{
icon: "el-icon-files",
index: "/property",
title: "资产管理",
subs: [
{
index: "/lineInformation",
title: "线路信息管理",
},
{
index: "/towerInformation",
title: "杆塔信息管理",
},
{
index: "/cameraChannel",
title: "通道管理",
},
{
index: "/photographicDevice",
title: "拍照装置管理",
},
{
index: "/devicePhotoSchedule",
title: "拍照时间表设置",
},
// {
// index: "/deviceUpgrade",
// title: "",
// },
// {
// icon: "el-icon-picture-outline",
// index: "imageSettings",
// title: "",
// },
],
},
],
role: "",
}; };
}, },
watch: { watch: {
@ -143,6 +210,16 @@ export default {
}, },
created() { created() {
this.setCurrentRoute(); this.setCurrentRoute();
this.role = localStorage.getItem("role");
console.log("用户管理");
console.log(this.role);
if (this.role == 1) {
this.items = this.items;
} else {
this.items = this.items2;
}
console.log(this.items);
}, },
}; };
</script> </script>

@ -50,7 +50,7 @@ Viewer.setDefaults({
//使用钩子函数对路由进行权限跳转 //使用钩子函数对路由进行权限跳转
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
document.title = `${to.meta.title} | 视频监控可视化平台`; document.title = `${to.meta.title} | 视频监控可视化平台`;
const role = localStorage.getItem("userName"); const role = localStorage.getItem("role");
const token = localStorage.getItem("token"); const token = localStorage.getItem("token");
console.log(role, token); console.log(role, token);
if (!token && to.path !== "/login") { if (!token && to.path !== "/login") {

@ -8,15 +8,17 @@ export default new Vuex.Store({
//用户登录token 存储 //用户登录token 存储
token: "", token: "",
userName: "", userName: "",
userid:'', userid: "",
channelid: "", channelid: "",
termid: "", termid: "",
role: "",
}, },
getters: { getters: {
channelid: (state) => state.channelid, channelid: (state) => state.channelid,
token: (state) => state.token, token: (state) => state.token,
userName: (state) => state.userName, userName: (state) => state.userName,
role: (state) => state.role,
}, },
mutations: { mutations: {
//保存通道id //保存通道id
@ -39,9 +41,11 @@ export default new Vuex.Store({
}, },
SET_USERINFO(state, val) { SET_USERINFO(state, val) {
state.userName = val.userName; state.userName = val.userName;
state.userid = val.id state.userid = val.id;
state.role = val.role;
localStorage.setItem("userName", state.userName); localStorage.setItem("userName", state.userName);
localStorage.setItem("userid", state.userid); localStorage.setItem("userid", state.userid);
localStorage.setItem("role", state.role);
}, },
//退出清除locastorge //退出清除locastorge
REMOVE_INFO(state) { REMOVE_INFO(state) {

@ -70,8 +70,8 @@ export default {
data: function () { data: function () {
return { return {
userInfo: { userInfo: {
userName: "admin", userName: "",
password: "123456", password: "",
//verificationCode: "", //verificationCode: "",
}, },
rules: { rules: {

Loading…
Cancel
Save