更新前端
This commit is contained in:
192
erp_web/pages/common/menu.html
Normal file
192
erp_web/pages/common/menu.html
Normal file
@@ -0,0 +1,192 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<meta charset="utf-8">
|
||||
<!-- 指定以IE8的方式来渲染 -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
|
||||
<link rel="shortcut icon" href="/images/favicon.ico" type="image/x-icon"/>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/default/easyui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/icon.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="/css/common.css"/>
|
||||
<script type="text/javascript" src="/js/jquery-1.8.0.min.js"></script>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/outlook.js"></script>
|
||||
<script type="text/javascript" src="/js/common/common.js"></script>
|
||||
<script type="text/javascript">
|
||||
function NewTab(name, url, funId) {
|
||||
window.funId = funId;
|
||||
addTab(name, url, '');
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" style="overflow-y: hidden" scroll="no">
|
||||
<script>
|
||||
var pageid = getUrlParam('id'); //获取传值id
|
||||
var id =sessionStorage.getItem("userId");
|
||||
//alert(pageid);
|
||||
|
||||
var userBusinessList = null;
|
||||
var userBusinessID = null;
|
||||
var type = null;
|
||||
var options = "";
|
||||
var kid = null;
|
||||
var lei = null;
|
||||
var last = "";
|
||||
var functions = "";
|
||||
var btnStrList = []; //按钮权限列表
|
||||
|
||||
//初始化界面
|
||||
$(function () {
|
||||
//初始化系统基础信息
|
||||
initSystemData(id, 'UserRole');
|
||||
initSelectInfo(0);
|
||||
|
||||
initSelect();
|
||||
|
||||
});
|
||||
|
||||
//初始化系统基础信息
|
||||
function initSystemData(kid, type) {
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/userBusiness/getBasicData",
|
||||
data: ({
|
||||
KeyId: kid,
|
||||
Type: type
|
||||
}),
|
||||
//设置为同步
|
||||
async: false,
|
||||
dataType: "json",
|
||||
success: function (res) {
|
||||
if (res && res.code === 200) {
|
||||
userBusinessList = res.data.userBusinessList;
|
||||
}
|
||||
else {
|
||||
userBusinessList = null;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
//初始化页面选项卡
|
||||
function initSelectInfo(lei) {
|
||||
if (userBusinessList != null) {
|
||||
if (userBusinessList.length > 0) {
|
||||
options = userBusinessList[0].value;
|
||||
if (options != "") {
|
||||
options = options.substring(1, options.length - 1);
|
||||
}
|
||||
//app内列表赋值
|
||||
if (lei == 1) {
|
||||
last += options + '][';
|
||||
}
|
||||
//功能菜单列表
|
||||
else if (lei == 2) {
|
||||
functions += options + '][';
|
||||
}
|
||||
//按钮权限列表
|
||||
else if (lei == 3) {
|
||||
var btnStr = userBusinessList[0].btnStr;
|
||||
if (btnStr != null) {
|
||||
btnStr = JSON.parse(btnStr);
|
||||
for (var j = 0; j < btnStr.length; j++) {
|
||||
btnStrList.push(btnStr[j]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//初始化页面
|
||||
function initSelect() {
|
||||
var arr = options.split('][');
|
||||
for (var i in arr) {
|
||||
initSystemData(arr[i], 'RoleAPP'); //根据角色找app
|
||||
initSelectInfo(1);//app内列表赋值
|
||||
|
||||
initSystemData(arr[i], 'RoleFunctions'); //根据角色找functions
|
||||
initSelectInfo(2); //功能菜单列表
|
||||
initSelectInfo(3); //查询角色对应的按钮权限
|
||||
}
|
||||
if (last != "") {
|
||||
last = "[" + last.substring(0, last.length - 1);
|
||||
//alert(last);
|
||||
|
||||
if (last.indexOf("[" + pageid + "]") != -1) {
|
||||
//alert("存在");
|
||||
$("#west").show();
|
||||
$("#mainPanle").show();
|
||||
$("#mm").show();
|
||||
}
|
||||
else {
|
||||
//alert("不存在");
|
||||
$("div").remove();
|
||||
$("<div style='width:100%;text-align:center;padding-top:20px'><b>抱歉,您没有该权限!</b></div>").appendTo("body");
|
||||
}
|
||||
}
|
||||
if (functions != "") {
|
||||
functions = "[" + functions.substring(0, functions.length - 1);
|
||||
//alert(functions);
|
||||
}
|
||||
if (btnStrList.length > 0) {
|
||||
window.winBtnStrList = JSON.stringify(btnStrList); //将按钮功能列表存为全局变量
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<div region="west" hide="true" split="true" title="导航菜单" style="width:125px;" id="west">
|
||||
<div id="nav" fit="true" border="false">
|
||||
<!-- 导航内容 -->
|
||||
<div>
|
||||
<ul id="tt"></ul>
|
||||
<script>
|
||||
var pNumber = getUrlParam('appID'); //获取传值appid
|
||||
$(function () {
|
||||
$('#tt').tree({
|
||||
url: '/functions/findMenu?pNumber=' + pNumber + '&hasFunctions=' + functions,
|
||||
animate: true
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="mainPanle" region="center" style="background: #eee; overflow-y: hidden">
|
||||
<div id="tabs" class="easyui-tabs" fit="true" border="false"></div>
|
||||
</div>
|
||||
<div id="mm" class="easyui-menu" style="width: 120px;">
|
||||
<div id="mm-tabupdate">
|
||||
刷新
|
||||
</div>
|
||||
<div class="menu-sep">
|
||||
</div>
|
||||
<div id="mm-tabclose">
|
||||
关闭
|
||||
</div>
|
||||
<div id="mm-tabcloseall">
|
||||
全部关闭
|
||||
</div>
|
||||
<div id="mm-tabcloseother">
|
||||
关闭其他页
|
||||
</div>
|
||||
<div class="menu-sep">
|
||||
</div>
|
||||
<div id="mm-tabcloseright">
|
||||
关闭右侧页面
|
||||
</div>
|
||||
<div id="mm-tabcloseleft">
|
||||
关闭左侧页面
|
||||
</div>
|
||||
<div class="menu-sep">
|
||||
</div>
|
||||
<div id="mm-version">
|
||||
华夏ERP官网
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user