PMCORE-3304
This commit is contained in:
21
resources/assets/js/home/Home.vue
Normal file → Executable file
21
resources/assets/js/home/Home.vue
Normal file → Executable file
@@ -59,6 +59,7 @@ import CustomCaseList from "./CustomCaseList/CustomCaseList.vue"
|
|||||||
|
|
||||||
import api from "./../api/index";
|
import api from "./../api/index";
|
||||||
import eventBus from './EventBus/eventBus'
|
import eventBus from './EventBus/eventBus'
|
||||||
|
import _ from "lodash";
|
||||||
export default {
|
export default {
|
||||||
name: "Home",
|
name: "Home",
|
||||||
components: {
|
components: {
|
||||||
@@ -158,7 +159,8 @@ export default {
|
|||||||
|
|
||||||
eventer(messageEvent, function(e) {
|
eventer(messageEvent, function(e) {
|
||||||
if ( e.data === "redirect=todo" || e.message === "redirect=todo"){
|
if ( e.data === "redirect=todo" || e.message === "redirect=todo"){
|
||||||
that.page = "inbox";
|
console.log("JONN");
|
||||||
|
that.OnClickSidebarItem(that.getItemMenuByValue("page","inbox"));
|
||||||
}
|
}
|
||||||
if ( e.data === "update=debugger" || e.message === "update=debugger"){
|
if ( e.data === "update=debugger" || e.message === "update=debugger"){
|
||||||
if(that.$refs["component"].updateView){
|
if(that.$refs["component"].updateView){
|
||||||
@@ -563,6 +565,23 @@ export default {
|
|||||||
console.error(e);
|
console.error(e);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* Search in menu Items by value, return the item
|
||||||
|
* @param {string} key - Key for search in object
|
||||||
|
* @param {string} value - value for search in key
|
||||||
|
*/
|
||||||
|
getItemMenuByValue(key, value) {
|
||||||
|
let obj = _.find(this.menu, function(o) {
|
||||||
|
if(o.component){
|
||||||
|
return o.props.item[key] == value;
|
||||||
|
}
|
||||||
|
return o[key] == value;
|
||||||
|
});
|
||||||
|
if(obj.component){
|
||||||
|
return obj.props;
|
||||||
|
}
|
||||||
|
return obj;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user