From 404e7646535ee216af8fcfc48b16e21375901ddb Mon Sep 17 00:00:00 2001 From: Catouse Date: Tue, 2 Feb 2021 13:31:22 +0800 Subject: [PATCH] * refactor. --- module/index/js/index.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/module/index/js/index.js b/module/index/js/index.js index 01582f9c12..6a5d959bd9 100644 --- a/module/index/js/index.js +++ b/module/index/js/index.js @@ -49,7 +49,7 @@ /** * Get tab group from url * @param {String} urlOrModuleName Url string - * + * @return {String} */ function getGroupFromUrl(urlOrModuleName) { @@ -69,13 +69,10 @@ { if(link.prj) return 'project'; - if(methodLowerCase === 'objectlibs' && (link.params.from || link.params.$3) == 'product') return 'product'; - if(methodLowerCase === 'showfiles' && (link.params.from || link.params.$3) == 'product') return 'product'; - if(methodLowerCase === 'browse' && (link.params.from || link.params.$5) == 'product') return 'product'; - if(methodLowerCase === 'view' && (link.params.from || link.params.$3) == 'product') return 'product'; - if(methodLowerCase === 'edit' && (link.params.from || link.params.$3) == 'product') return 'product'; - if(methodLowerCase === 'delete' && (link.params.from || link.params.$3) == 'product') return 'product'; - if(methodLowerCase === 'create' && (link.params.from || link.params.$4) == 'product') return 'product'; + if((link.params.from || link.params.$3) == 'product') + { + if(['objectlibs', 'showfiles', 'browse', 'view', 'edit', 'delete', 'create'].includes(methodLowerCase)) return 'product'; + } return 'doc'; } if(moduleName === 'custom' && ['estimate', 'browsestoryconcept', 'configurescrum'].includes(methodLowerCase))