/**************get请求******************/
--菜单加载
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %>
<%@ taglib prefix="lwc" uri="http://www.paic.com.cn/tags-lwc" %>
<%@ taglib prefix="nets" uri="/WEB-INF/tlds/nets-tags.tld" %>
<script type="text/javascript" src="<c:url value='/js/common/menu.js'/>"></script>
<script type="text/javascript" >
function logOut(){
if (confirm('未处理完成的任务系统不会自动保存,是否确认退出?')){
window.open("about:blank","_self");
top.location='<c:url value='/logout.do'/>';
}
}
</script>
<%
String agentId = "";//(String) session.getAttribute(NetsConst.AGENT_ID);
if(agentId==null){
response.sendRedirect(request.getContextPath() + "/umlogon.jsp");
}
String contextPath = request.getContextPath();
%>
<input type="hidden" id="autoLogoutIsInUse" name="autoLogoutIsInUse" value="<c:out value='${sessionScope.AUTO_LOGOUT_IS_IN_USE}'/>" />
<input type="hidden" id="needAutoLogout" name="needAutoLogout" value="<c:out value='${sessionScope.NEED_AUTO_LOGOUT}'/>" />
<input type="hidden" id="autoClockingOut" name="autoClockingOut" value="<c:out value='${sessionScope.AUTO_CLOCKING_OUT_TIME}'/>" />
<input type="hidden" id="autoClockingIn" name="autoClockingIn" value="<c:out value='${sessionScope.AUTO_CLOCKING_IN_TIME}'/>" />
<input type="hidden" id="autoLogoutWarnMinutes" name="autoLogoutWarnMinutes" value="<c:out value='${sessionScope.AUTO_LOGOUT_WARN_MINUTES}'/>" />
<input type="hidden" id="autoLogoutAfterEndTime" name="autoLogoutAfterEndTime" value="<c:out value='${sessionScope.AUTO_LOGOUT_AFTER_END_TIME}'/>" />
<div align="right">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="headfoot_bg">
<tr height="10" id="titleTr">
<td style="text-align:left">
<input type=hidden id="menuFlag" name="menuFlag" value="1"/>
<input type=hidden id="logoutFlag" name="logoutFlag" value="1"/>
<span class="head_txt1">欢迎使用<c:out value='${sessionScope.netsUserdto.bizSeriesDes}'/>ITS电话销售系统,登录人员:<c:out value='${sessionScope.netsUserdto.umId}'/>,您的岗位是:<c:out value='${sessionScope.netsUserdto.positionDesc}'/>,现在您是:<c:choose><c:when test="${sessionScope.netsUserdto.overTime}">正常上班</c:when><c:otherwise>加班</c:otherwise></c:choose></td>
<td align="right"><a onclick="logOut()" href="#"><span class="head_txt1">退 出</span></a></td>
</tr>
</table>
</div>
<table width="100%" height="50" border="0" cellpadding="0" cellspacing="0" class="head_munebg">
<tr>
<td width="203"><img src="./images/index_logo.gif" width="165" height="36"></td>
<c:if test="${currentMenuList!=null}">
<c:forEach items="${currentMenuList}" varStatus="father_status" >
<c:if test="${father_status.last}">
<c:set var="menuSize" value="${father_status.count}"></c:set>
</c:if>
</c:forEach>
</c:if>
<td>
<c:if test="${currentMenuList!=null}">
<table cellpadding="0" cellspacing="0" id="menuTable">
<tr>
<td height="5"></td>
<c:forEach var="menuUnderFather" items="${currentMenuList}" varStatus="father_status" >
<c:forEach var="menudto" items="${menuUnderFather}" varStatus="status">
<c:if test="${status.index==0}">
<c:if test="${father_status.count==1}">
<td width="68" height="5"><a href="#" id="menu_id_<c:out value='${menudto.menuId}'/>" onclick="clickMenu('<c:out value="${father_status.count}"/>','<c:url value="${menudto.defaultIndex}"/>','<c:url value="${menudto.defaultUrl}"/>','<c:out value="${menuSize}"/>');">
<c:out value='${menudto.displayName}'/></a>
</td>
</c:if>
<c:if test="${father_status.count!=1}">
<td width="68" height="5"><a href="#" id="menu_id_<c:out value='${menudto.menuId}'/>" onclick="clickMenu('<c:out value='${father_status.count}'/>','<c:url value='${menudto.defaultIndex}'/>','<c:url value='${menudto.defaultUrl}'/>','<c:out value='${menuSize}'/>');">
<c:out value='${menudto.displayName}'/></a>
</td>
</c:if>
</c:if>
</c:forEach>
</c:forEach>
</tr>
</table>
</c:if>
<c:if test="${currentMenuList==null}">
<b>对不起,该角色没有被分配任何权限,如果需要权限,请联系管理员。</b>
</c:if>
</td>
</tr>
</table>
<script type="text/javascript">
<c:if test="${currentMenuList!=null}">
//getImgHoverOn('Image1');
</c:if>
function getContextPath(){
return "<%=contextPath%>";
}
</script>
<c:if test="${sessionScope.AUTO_LOGOUT_IS_IN_USE=='Y'}">
<script type="text/javascript" src="<c:url value='/js/common/autoLogout.js'/>"></script>
</c:if>
--菜单涉及js
var flag = 1;
var promotInfo="系统还在处理您刚才的请求,请稍候";
function MM_swapImgRestore(n) { // v3.0 onMouseOut
if (n == flag) {
return;
}
var i, x, a = document.MM_sr;
for (i = 0; a && i < a.length && (x = a[i]) && x.oSrc; i++) {
x.src = x.oSrc;
}
}
function MM_swapImage() { // v3.0 onMouseOver
var i, j = 0, x, a = MM_swapImage.arguments;
document.MM_sr = new Array;
for (i = 0; i < (a.length - 2); i += 3)
if ((x = MM_findObj(a[i])) != null) {
document.MM_sr[j++] = x;
if (!x.oSrc)
x.oSrc = x.src;
var imgSrc, imgSrc_pre, imgName;
imgSrc = x.src;
imgSrc_pre = imgSrc.substring(0, imgSrc.lastIndexOf('/'));
imgName = imgSrc.substring(imgSrc.lastIndexOf('/'), imgSrc
.indexOf('.gif'));
if (imgName.indexOf('_hover') == -1) {
x.src = imgSrc_pre + imgName + '_hover' + '.gif';
}
}
}
function getImgHoverOn(imageName) {
var imgSrc, imgSrc_pre, imgName;
imgSrc = document.getElementsByName(imageName)[0].src;
imgSrc_pre = imgSrc.substring(0, imgSrc.lastIndexOf('/'));
imgName = imgSrc.substring(imgSrc.lastIndexOf('/'), imgSrc.indexOf('.gif'));
if (imgName.indexOf('_hover') == -1) {
document.getElementsByName(imageName)[0].src = imgSrc_pre + imgName
+ '_hover' + '.gif';
}
}
function MM_findObj(n, d) { // v4.01
var p, i, x;
if (!d)
d = document;
if ((p = n.indexOf("?")) > 0 && parent.frames.length) {
d = parent.frames[n.substring(p + 1)].document;
n = n.substring(0, p);
}
if (!(x = d[n]) && d.all)
x = d.all[n];
for (i = 0; !x && i < d.forms.length; i++)
x = d.forms[i][n];
for (i = 0; !x && d.layers && i < d.layers.length; i++)
x = MM_findObj(n, d.layers[i].document);
if (!x && d.getElementById)
x = d.getElementById(n);
return x;
}
//点击菜单
function clickMenu(selectedMenu, defaultIndex, url, menuCount,flag) {
if (menuIsAble()) {
if (!judgeIfMenuCanbeClick(url)){
alert(promotInfo);
return;
}
document.getElementById("subMenuDiv" + selectedMenu).style.display = 'block';
//document.getElementById('innerContent').src = url;
for ( var i = 1; i <= menuCount; i++) {
if (i != selectedMenu) {
document.getElementById("subMenuDiv" + i).style.display = 'none';
} else {
// 更换click选中的图片为选中
//getImgHoverOn("Image" + i);
if (flag!=null && flag=='1') {
clickSubMenu(defaultIndex, url, selectedMenu);
} else {
if (defaultIndex.length>2) {
var di = defaultIndex.split(";")[0];
clickSubMenu1(di, url, selectedMenu);//点击一级菜单时默认显示第一个二级菜单
} else {
clickSubMenu1(defaultIndex, url, selectedMenu);//点击一级菜单时默认显示第一个二级菜单
}
}
}
}
// 更换前面选中的图片为没选中
/*var imgSrc, imgSrc_pre, imgName;
imgSrc = document.getElementsByName("Image" + flag)[0].src;
imgSrc_pre = imgSrc.substring(0, imgSrc.lastIndexOf('/'));
imgName = imgSrc.substring(imgSrc.lastIndexOf('/'), imgSrc.indexOf('.gif'));
if (imgName.indexOf('_hover') != -1 && flag != selectedMenu) {
imgName = imgName.substring(0, imgName.indexOf('_hover'));
}
document.getElementsByName("Image" + flag)[0].src = imgSrc_pre + imgName
+ '.gif';*/
// 将标志置为click
flag = selectedMenu;
}
}
function clickSubMenu(selectedMenu, url, belongto) {//直接点击二级菜单时,显示自己的url
if (menuIsAble()) {
var menuFlag = $("#menuFlag").val();
if (menuFlag == null||menuFlag == ""||typeof(menuFlag) ==" undefined") {
menuFlag="1";
}
if (menuFlag=="2") {
alert("请处理当前任务");
return;
}
var tabs = document.getElementById("tabs");
var div = document.getElementById("subMenuDiv" + belongto);
var tables = div.getElementsByTagName('table');
var t_size = tables.length;
var tds;
for ( var i = 0; i < t_size; i++) {
if (selectedMenu == i + 1) {
tds = tables[i].getElementsByTagName('td');
tds[0].className = 'tab_active_l';
tds[1].className = 'tab_active';
tds[2].className = 'tab_active_r';
} else {
tds = tables[i].getElementsByTagName('td');
tds[0].className = 'tab_deactive_l';
tds[1].className = 'tab_deactive';
tds[2].className = 'tab_deactive_r';
}
}
var ifFresh = true;
var oInnerContent = document.getElementById("innerContent");
if (oInnerContent != null) {
oInnerContent.style.display = "block";
if (ifFresh){
if(url.indexOf('?')==-1){
url = url + '?';
}else{
url = url + '&';
}
var currentDate = new Date();
url = url+'requestDate='+currentDate;
oInnerContent.src = url;
}
}
}
}
function clickSubMenu1(selectedMenu, url, belongto) {
if (menuIsAble()) {
var tabs = document.getElementById("tabs");
var div = document.getElementById("subMenuDiv" + belongto);
var tables = div.getElementsByTagName('table');
var t_size = tables.length;
var tds;
if (t_size>0) {
tds = tables[0].getElementsByTagName('td');
tds[0].className = 'tab_active_l';
tds[1].className = 'tab_active';
tds[2].className = 'tab_active_r';
}
url = $(tables).find("tbody").find("tr").eq(0).find("td").eq(1).find("input").eq(0).val();
for ( var i = 0; i < t_size; i++) {
if (i != 0) {
tds = tables[i].getElementsByTagName('td');
tds[0].className = 'tab_deactive_l';
tds[1].className = 'tab_deactive';
tds[2].className = 'tab_deactive_r';
}
}
var ifFresh = true;
var oInnerContent = document.getElementById("innerContent");
if (oInnerContent != null) {
oInnerContent.style.display = "block";
if (ifFresh){
if(url.indexOf('?')==-1){
url = url + '?';
}else{
url = url + '&';
}
var currentDate = new Date();
url = url+'requestDate='+currentDate;
oInnerContent.src = url;
}
}
}
}
function lockMenu(menuFlag){
$("#menuFlag").val(menuFlag);
}
function unlockMenu(){
$("#menuFlag").val("1");
}
function menuIsAble(){
var menuFlag = $("#menuFlag").val();
if (menuFlag == null||menuFlag == ""||typeof(menuFlag) =="undefined") {
menuFlag="1";
}
if (menuFlag!="1") {
alert(m.get(menuFlag));
return false;
} else {
return true;
}
}
/**
* 切换一级菜单及对应的二菜单
* 参数说明:
* menuId:一级菜单数据库对应的menu_id
* subMenuId:一级菜单下二级菜单数据库对应的menu_id
*
*/
function changeMenuBySubmenuMenuId(subMenuId,url) {
// 当前二级菜单
var currentSubMenuObj = $("#divTableMenuId_"+subMenuId);
// 当前二级菜单的父菜单(一级菜单)
var menuObj = currentSubMenuObj.parent();
// 一级菜单的的父菜单id
var parentMenuId = menuObj.parent().attr("id");
// 得到一级菜单总长度
var length = $("#"+parentMenuId).find("div").length;
if (length == 0) {
alert("该角色没有赋权");
return;
}
// 得到选中的一级菜单的index
var menuIndex = menuObj.prevAll().length + 1;
// 得到选中的二级菜单的index
var subMenuIndex = currentSubMenuObj.prevAll().length + 1;
//alert(menuIndex +'---'+ subMenuIndex +'---'+ url +'---'+length);
clickMenu(menuIndex,subMenuIndex,url,length,'1');
}
/**
*
*/
function judgeIfLoaded(iframeNameId) {
var iframeNameObject = document.getElementById(iframeNameId);
if (iframeNameObject!=null){
if (iframeNameObject.readyState!='complete')
return false;
}
return true;
}
function judgeIfMenuCanbeClick() {
if (!judgeIfLoaded("innerContent")) return false;
return true;
}
/**
*初始化菜单
*/
function initMenu(){
//初始化 菜单(根据不同的用户可能不同,需要手动修改)
$("#menuTable").find("td").eq(1).find("a").click();
}
/*创建map*/
function Map() {
this.elements = new Array();
// 获取Map元素个数
this.size = function() {
return this.elements.length;
},
// 判断Map是否为空
this.isEmpty = function() {
return (this.elements.length < 1);
},
// 删除Map所有元素
this.clear = function() {
this.elements = new Array();
},
// 向Map中增加元素(key, value)
this.put = function(_key, _value) {
if (this.containsKey(_key) == true) {
if (this.containsValue(_value)) {
if (this.remove(_key) == true) {
this.elements.push( {
key : _key,
value : _value
});
}
} else {
this.elements.push( {
key : _key,
value : _value
});
}
} else {
this.elements.push( {
key : _key,
value : _value
});
}
},
// 删除指定key的元素,成功返回true,失败返回false
this.remove = function(_key) {
var bln = false;
try {
for (i = 0; i < this.elements.length; i++) {
if (this.elements[i].key == _key) {
this.elements.splice(i, 1);
return true;
}
}
} catch (e) {
bln = false;
}
return bln;
},
// 获取指定key的元素值value,失败返回null
this.get = function(_key) {
try {
for (i = 0; i < this.elements.length; i++) {
if (this.elements[i].key == _key) {
return this.elements[i].value;
}
}
} catch (e) {
return null;
}
},
// 获取指定索引的元素(使用element.key,element.value获取key和value),失败返回null
this.element = function(_index) {
if (_index < 0 || _index >= this.elements.length) {
return null;
}
return this.elements[_index];
},
// 判断Map中是否含有指定key的元素
this.containsKey = function(_key) {
var bln = false;
try {
for (i = 0; i < this.elements.length; i++) {
if (this.elements[i].key == _key) {
bln = true;
}
}
} catch (e) {
bln = false;
}
return bln;
},
// 判断Map中是否含有指定value的元素
this.containsValue = function(_value) {
var bln = false;
try {
for (i = 0; i < this.elements.length; i++) {
if (this.elements[i].value == _value) {
bln = true;
}
}
} catch (e) {
bln = false;
}
return bln;
},
// 获取Map中所有key的数组(array)
this.keys = function() {
var arr = new Array();
for (i = 0; i < this.elements.length; i++) {
arr.push(this.elements[i].key);
}
return arr;
},
// 获取Map中所有value的数组(array)
this.values = function() {
var arr = new Array();
for (i = 0; i < this.elements.length; i++) {
arr.push(this.elements[i].value);
}
return arr;
};
}
var m = new Map();
m.put("2","请先提交当前跟进任务!");
m.put("3","请先提交当前客户意图 !");
/****************post请求********************/
$("#templetPreviewBnt").bind("click",function(){
if ($("#batchTempletTypeCode").val().length==0){
alert("模板类型必须填写");
$("#batchTempletTypeCode").focus();
return false;
}
auditWindow = window.open('',"上载模板预览"+(new Date()).valueOf(), "width=900,height=650,resizable=yes,scrollbars=yes",true);
$("#templetPreviewForm > input[name='batchTempletTypeCode']").val($("#batchTempletTypeCode").val());
$("#templetPreviewForm").attr("target",auditWindow.name);
$("#templetPreviewForm").submit();
});