<%@page language="java" import="java.util.*" pageEncoding="UTF-8" %>
|
<%@page import="com.yc.sdk.shopping.util.SettingKey" %>
|
<%@page import="java.net.URLDecoder" %>
|
<%
|
//用于控制导航
|
String navigation = request.getParameter("navi");
|
String URL = SettingKey.getHostUrl(request);
|
String str_menuid = request.getParameter("menuid");
|
String menuName = request.getParameter("menuname");
|
int menuid = (str_menuid != null ? Integer.parseInt(str_menuid) : 0);
|
%>
|
<!DOCTYPE HTML >
|
<html>
|
<head>
|
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
|
<title>佛山市盈晨科技有限公司</title>
|
|
<script type="text/javascript"
|
src="<%=URL%>/js/jquery-1.4.4.min.js?v=<%=com.yc.utils.FileUtil.getVerstion(request, "/js/jquery-1.4.4.min.js")%>"></script>
|
<script type="text/javascript"
|
src="<%=URL%>/js/encode.js?v=<%=com.yc.utils.FileUtil.getVerstion(request, "/js/encode.js")%>"></script>
|
<style type="text/css">
|
body {
|
ont-family: Arial, tahoma, Helvetica, sans-serif;
|
font-size: 12px;
|
margin: 0px;
|
}
|
|
.content {
|
float: left;
|
width: 100%
|
}
|
|
.item:hover {
|
width: 110px;
|
height: 105px;
|
border: 1px dashed;
|
border-radius: 5px;
|
text-align: center;
|
float: left;
|
margin: 14px;
|
cursor: pointer;
|
white-space: nowrap;
|
background: #FFFFBB;
|
}
|
|
.dis {
|
/*color: rgb(44, 141, 251);*/
|
font-size: 13px;
|
margin-top: 3px;
|
}
|
|
.item {
|
width: 110px;
|
height: 105px;
|
border: 0px dashed;
|
text-align: center;
|
float: left;
|
margin: 15px;
|
/*margin: 0px 15px 15px 15px;*/
|
cursor: pointer;
|
white-space: nowrap;
|
}
|
|
.items {
|
overflow: hidden;
|
width: 100%;
|
/*height: 25px;*/
|
/*border-bottom: 1px solid #CCCCCC;*/
|
}
|
|
.img {
|
width: 62px;
|
height: 62px;
|
margin-top: 5px;
|
}
|
|
.img img {
|
width: 100%;
|
height: 100%;
|
border: 0px;
|
}
|
|
#navigation {
|
padding: 20px 50px 10px 40px
|
}
|
|
#navigation a {
|
margin-left: 10px;
|
font-size: 11pt;
|
|
}
|
|
.buju {
|
float: right;
|
margin-right: 50px;
|
background-color: #2C8DFB;
|
cursor: pointer;
|
color: #fff;
|
padding: 20px;
|
border-radius: 10px;
|
line-height: 0;
|
}
|
|
a:link {
|
text-decoration: none; /* 指正常的未被访问过的链接*/
|
}
|
|
a:visited {
|
text-decoration: none; /*指已经访问过的链接*/
|
}
|
|
a:hover {
|
text-decoration: none; /*指鼠标在链接*/
|
}
|
|
a:active {
|
text-decoration: none; /* 指正在点的链接*/
|
}
|
|
.group {
|
padding: 10px 50px 10px 40px;
|
}
|
|
.fieldset {
|
margin: 0px !important;
|
}
|
|
.otherF {
|
width: 90%;
|
border-radius: 10px;
|
border: 1px dashed #a9c6f5;
|
margin-bottom: 10px !important;
|
}
|
|
legend {
|
width: auto;
|
margin-left: 5px;
|
}
|
|
.group-name {
|
font-size: 15px;
|
color: #223e67;
|
font-weight: 600;
|
}
|
</style>
|
</head>
|
<body>
|
<div class="content">
|
<!-- 导航 -->
|
|
<div id="navigation">
|
<%
|
if (null == navigation) {
|
%>
|
<a href="/general/home/iconMenuCenter.jsp">开始</a> <a
|
href="javascript:layout();" class="buju">布局设置</a>
|
<%
|
} else {
|
%>
|
<%=URLDecoder.decode(navigation, "utf-8")%>
|
<%
|
if (null != menuName) {
|
menuName = URLDecoder.decode(menuName, "utf-8");
|
%>
|
—— <a menuid="<%=str_menuid%>"
|
href="javascript:navi('<%=str_menuid%>');" style="margin-left: 1px;"><%=menuName%>
|
</a>
|
<%
|
}
|
}
|
%>
|
</div>
|
<div class="group">
|
|
</div>
|
</div>
|
</body>
|
<script type="text/javascript">
|
$(function () {
|
<%--$.post('/iconData.do',{'menuid':<%=menuid%>},function(data){--%>
|
$.ajax({
|
url: '/layout/iconGroup.do',
|
type: 'post',
|
data: JSON.stringify({'menuId': <%=menuid%>}),
|
contentType: "application/json",
|
success: function (res) {
|
if (res == null || res.code == -1) {
|
alert('加载失败');
|
return;
|
}
|
let data = res.data;
|
if (res.code == 0 && data != null && data.length > 0) {
|
var str = '';
|
var groupStr = '';
|
data.forEach(function (item, index) {
|
if (item.menuType && item.groups) {//有分组
|
if (str) {
|
groupStr = groupEleStr('', '', str);
|
$(".content .group").append(groupStr);
|
}
|
str = '';
|
item.groups.forEach(function (currentItem, index) {
|
str += elementStr(currentItem);
|
});
|
groupStr = groupEleStr(item.menuType, 'otherF', str);
|
$(".content .group").append(groupStr);
|
str = '';
|
} else {
|
str += elementStr(item);
|
}
|
});
|
if (str) {
|
groupStr = groupEleStr('', '', str);
|
$(".content .group").append(groupStr);
|
str = '';
|
}
|
clickItem();
|
}
|
}
|
}).error(function (e) {
|
console.log(e);
|
});
|
});
|
|
function clickItem() {
|
$(".item").click(function () {//点击图片标执行的函数
|
var formid = $(this).attr("formid");
|
var menuName = $(this).find(".dis").text();
|
var navi = $("#navigation").html();
|
if ("null" == formid || "" == formid) {
|
var t = $(this).attr("menuid");
|
var para = encodeURI(encodeURI("menuid=" + t + "&menuname=" + menuName + "&navi=" + navi));
|
para = ENCODE.encode(para);
|
location = "/general/home/iconMenuCenter.jsp?" + para;
|
} else {
|
var formtype = $(this).attr("formtype");
|
parent.addTab(menuName, formid, formtype, "");
|
}
|
});
|
}
|
|
function navi(id) {//点击导航栏执行的函数
|
var tempObje = $("#navigation").find("a[menuid='" + id + "']");
|
var navis = tempObje.prevAll();
|
var array = [];
|
var obj = $("<div>");
|
obj.append(tempObje.clone());
|
array.push(' —— ' + obj.html());
|
obj.remove();
|
navis.each(function () {
|
var obj = $("<div>");
|
obj.append($(this).clone());
|
array.push(obj.html());
|
obj.remove();
|
});
|
var t = "";
|
for (i = array.length - 1; i >= 0; i--) {
|
t += array[i];
|
}
|
var para = encodeURI(encodeURI("menuid=" + id + "&navi=" + t));
|
para = ENCODE.encode(para);
|
location = "/general/home/iconMenuCenter.jsp?" + para;
|
}
|
|
// 生成图标元素字符串
|
function elementStr(dataset) {
|
var cd = dataset.menuName.length;
|
var name = dataset.menuName;
|
return '<div class="item" id="' + dataset.menuId + '" menuid="' + dataset.menuId
|
+ '" formid="' + dataset.formId + '"formtype="' + dataset.formType + '">'
|
+ '<a title="' + name + '">' + '<img data-id="' + dataset.menuId
|
+ '" class="img" src="' + dataset.largImagePath + '"/>'
|
+ '<div class="dis">' + (cd > 6 ? name.substring(0, 6) + '<br>' + name.substring(6, cd) : name) + '</div>' + '</a>' + '</div>';
|
}
|
|
// 生成分组元素字符串
|
function groupEleStr(groupName, className, item) {
|
className = className ? className : '';
|
if (groupName) {
|
return '<fieldset class="fieldset ' + className + '">' + ' <legend>'
|
+ '<span class="group-name" data-name="' + groupName + '">'
|
+ groupName + '</span>' + '<span class="group-tree-bar">'
|
+ '<i class="iconfont icon-bianji" data-name="' + groupName
|
+ '"></i>' + '<i class="iconfont icon-lajixiang"></i>' + '</span>'
|
+ '</legend>' + ' <div class="items">' + item + '</div>' + '</fieldset>';
|
} else {
|
return '<div class="items">' + item + '</div>';
|
}
|
}
|
|
function layout() {
|
top.addTab('图标导航设置', '', '', '', '/general/layoutIcon/layoutIndex.jsp', '', '');
|
}
|
</script>
|
</html>
|