kpiplus
Version:
KPI+
114 lines (108 loc) • 4.4 kB
JavaScript
exports.menu=[
{
name:"kpis",
type:'1',
title:'Đánh giá nhân viên',
input: [
{path: 'phieudanhgia', type: 'L', module: 'phieudanhgia', header: 'Phiếu đánh giá', visible: true}
],
visible: true
},
{
name:"reports",
type:'1',
title:'Báo cáo',
input: [
//{path: 'kqdanhgianhanvien', header: 'Kết quả đánh giá nhân viên(pivot)', visible: false},
{path: 'ctdanhgianhanvien', header: 'CHI TIẾT ĐÁNH GIÁ XẾP LOẠI LAO ĐỘNG', visible: true},
{path: 'dsnhanviencm', header: 'DANH SÁCH NGƯỜI LAO ĐỘNG CHUẨN MỰC', visible: true},
{path: 'dsnhanvientb', header: 'DANH SÁCH NGƯỜI LAO ĐỘNG TIÊU BIỂU', visible: true},
{path: 'thdanhgianhanvien', header: 'TỔNG HỢP PHÂN LOẠI LAO ĐỘNG', visible: true},
],
visible: true
},
{
name:"lists",
type:'1',
title:'Danh mục',
input: [
{path: 'maudanhgia', type: 'L', module: 'maudanhgia', header: 'Mẫu đánh giá', visible: true},
{path: 'dmbp', type: 'L', module: 'dmbp', header: 'Bộ phận', visible: true},
{path: 'dmdoi', type: 'L', header: 'Đội', visible: true},
{path: 'dmto', type: 'L', header: 'Tổ', visible: true},
/*{path: 'loaidiem', type: 'L', header: 'Xếp loại', visible: false},*/
{path: 'dmdoituongdanhgia', type: 'L', header: 'Đối tượng đánh giá', visible: true},
{path: 'dmnhnv', type: 'L', header: 'Nhóm nhân viên', visible: true},
{path: 'dmnv', type: 'L', header: 'Nhân viên', visible: true},
{path: 'dmchucvu', type: 'L', header: 'Chức vụ', visible: true},
],
visible: true
},
{
name:"system",
type:'1',
title:'Hệ thống',
input: [
{path: 'app', type: 'L', header: 'Công ty', visible: true},
{path: 'usergroup', type: 'L', header: 'Nhóm người dùng', visible: true},
],
visible: true
},
]
exports.getModules = function(menu=null,sperate=".") {
var modules = {};
if(!menu){
menu = exports.menu;
}
menu.forEach(function(child_menu){
if(child_menu.type=='1'){
child_menu.input.forEach(function(path) {
if(path.path){
let m = path.module;
if (!m) m = path.path;
if (path.visible) {
modules[child_menu.name.toLowerCase() + sperate + m] = {name: m, path: path.path, group: child_menu.name, command: path};
}
}else{
if(path.items){
path.items.forEach(function(item) {
let m = item.module;
if (!m) m = item.path;
let key = child_menu.name.toLowerCase() + sperate + path.name + sperate + m;
if (item.visible && !modules[key]) {
modules[key] = {name: m, path: item.path, group: child_menu.name, command: item};
}
});
}
}
});
}
if(child_menu.type=='2'){
child_menu.input.forEach(function(module) {
module.items.forEach(function(path) {
var m = path.module;
if (!m) m = path.path;
var key = child_menu.name.toLowerCase() + sperate + module.name + sperate + m;
if (path.visible && !modules[key]) {
modules[key] = {name: m, path: path.path, group: child_menu.name, command: path};
}
});
});
}
if(child_menu.type=='3'){
child_menu.input.forEach(function(module) {
module.items.forEach(function(group) {
group.items.forEach(function(path) {
var m = path.module;
if (!m) m = path.path;
var key = child_menu.name.toLowerCase() + sperate + module.name + sperate + group.name + sperate + m;
if (path.visible && !modules[key]) {
modules[key] = {name: m, path: path.path, group: child_menu.name, command: path};
}
});
});
});
}
})
return modules;
}