PMCORE-3304

This commit is contained in:
Henry Jordan
2021-09-10 22:58:21 +00:00
parent 3a7332ca4b
commit 78bf39579d

21
resources/assets/js/home/Home.vue Normal file → Executable file
View File

@@ -59,6 +59,7 @@ import CustomCaseList from "./CustomCaseList/CustomCaseList.vue"
import api from "./../api/index";
import eventBus from './EventBus/eventBus'
import _ from "lodash";
export default {
name: "Home",
components: {
@@ -158,7 +159,8 @@ export default {
eventer(messageEvent, function(e) {
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(that.$refs["component"].updateView){
@@ -563,6 +565,23 @@ export default {
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;
}
}
};