|
@@ -109,25 +109,25 @@ export default {
|
|
|
},
|
|
|
created() {
|
|
|
// 获取屠宰批次 给后面下拉选择器使用
|
|
|
- this.$store.dispatch('getSlaughterBatchIdList')
|
|
|
+ this.$store.dispatch("getSlaughterBatchIdList");
|
|
|
|
|
|
this.defaultUnfoldedMenu = [
|
|
|
localStorage.getItem("defaultUnfoldedMenu")
|
|
|
];
|
|
|
this.menuCollapse = JSON.parse(localStorage.getItem("menuCollapse"));
|
|
|
/* 筛选菜单 */
|
|
|
- var target = this.$route.query.target
|
|
|
- if(target) {
|
|
|
- localStorage.setItem("target", target)
|
|
|
+ var target = this.$route.query.target;
|
|
|
+ if (target) {
|
|
|
+ localStorage.setItem("target", target);
|
|
|
} else {
|
|
|
- target = localStorage.getItem('target')
|
|
|
+ target = localStorage.getItem("target");
|
|
|
}
|
|
|
this.filterMenu(target);
|
|
|
},
|
|
|
watch: {
|
|
|
"$route.query.target"(v) {
|
|
|
- if(v){
|
|
|
- localStorage.setItem("target", v)
|
|
|
+ if (v) {
|
|
|
+ localStorage.setItem("target", v);
|
|
|
this.filterMenu(v);
|
|
|
}
|
|
|
}
|
|
@@ -139,12 +139,14 @@ export default {
|
|
|
http://hzsheep.ifarmcloud.com/butcher/#/home?target=鲜肉储运智能管控
|
|
|
http://hzsheep.ifarmcloud.com/yield
|
|
|
*/
|
|
|
- /* 筛选菜单 http://localhost:8080/#/home?target=定点屠宰智能管控 */
|
|
|
- /* http://localhost:8080/#/home?target=定点屠宰智能管控 */
|
|
|
- /* http://localhost:8080/#/home?target=产品制作智能监控 */
|
|
|
- /* http://localhost:8080/#/home?target=鲜肉储运智能管控 */
|
|
|
+ /* 筛选菜单 */
|
|
|
+ /*
|
|
|
+ http://localhost:8080/#/home?target=定点屠宰智能管控
|
|
|
+ http://localhost:8080/#/home?target=产品制作智能监控
|
|
|
+ http://localhost:8080/#/home?target=鲜肉储运智能管控
|
|
|
+ */
|
|
|
filterMenu(target) {
|
|
|
- console.log(target)
|
|
|
+ console.log(target);
|
|
|
let path;
|
|
|
switch (target) {
|
|
|
case "定点屠宰智能管控":
|
|
@@ -162,7 +164,7 @@ export default {
|
|
|
}
|
|
|
this.menuData = menuData.filter(func);
|
|
|
if (path && path != this.$route.name) {
|
|
|
- this.$router.push({name: path});
|
|
|
+ this.$router.push({ name: path });
|
|
|
}
|
|
|
},
|
|
|
// 收取菜单按钮
|