role1.0
fanluyan 1 year ago
parent ea73cb1a24
commit 8365e5bfea

@ -91,7 +91,7 @@
<el-button
type="primary"
@click="handlehistoryPic"
v-if="showhisButton('/realTimeSearch') && role !== 0"
v-if="showhisButton('/realTimeSearch')"
>
历史图片</el-button
>
@ -247,7 +247,8 @@ export default {
selectTowerId: "",
collectFlag: false, //
btnShowList: [],
menuList: [],
hisShowbtn: true,
menuShowList: [],
};
},
@ -263,24 +264,29 @@ export default {
return this.$store.state.currentData;
},
showButtonMap() {
return this.btnShowList.reduce((map, button) => {
map[button.key] = true; // key
return map;
}, {});
if (this.roleUser !== "0") {
return this.btnShowList.reduce((map, button) => {
map[button.key] = true; // key
return map;
}, {});
}
},
showButtonhisMap() {
return this.menuList.reduce((map, button) => {
map[button.key] = true; // key
return map;
}, {});
showhisButtonMap() {
if (this.roleUser !== "0") {
return this.menuShowList.reduce((map, button) => {
map[button.key] = true; // key
return map;
}, {});
}
},
},
created() {
this.roleUser = localStorage.getItem("role");
console.log("asdsaddddddddddddddddddddddddd", this.roleUser);
this.btnShowList = JSON.parse(localStorage.getItem("btnPermission"));
this.menuList = JSON.parse(localStorage.getItem("menuPermission"));
console.log(this.btnShowList);
this.menuShowList = JSON.parse(localStorage.getItem("menuPermission"));
console.log(this.btnShowList, this.menuShowList);
},
mounted() {
this.getDateTime();
@ -288,11 +294,18 @@ export default {
methods: {
//
showButton(key) {
return this.showButtonMap[key] || false;
if (this.roleUser !== "0") {
return this.showButtonMap[key] || false;
} else {
return true;
}
},
//
showhisButton(key) {
return this.showButtonhisMap[key] || false;
if (this.roleUser !== "0") {
return this.showhisButtonMap[key] || false;
} else {
return true;
}
},
//
handleDblClick(val) {

Loading…
Cancel
Save