123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414 |
- // 获取用户部门
- var dept_id = top.com.sinosoft.lz.system.user.LoginInfo.getDeptids();
- var user_id = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
- var user_name = top.com.sinosoft.lz.system.user.LoginInfo.getLogin_name();
- var parentId = top.com.sinosoft.lz.system.user.LoginInfo.getParent_ids();
- var dept_name = top.com.sinosoft.lz.system.user.LoginInfo.getDeptnames();
- var syMenu = [ {
- "menu_id" : "101",
- "isChecked" : "true",
- "menu_name" : "短信管理",
- "isJSC":false,
- "menu_img":"../images/index/icon1.png",
- "menu_url":"/nwyj/page/system/sms/msg_manage.html?id=90106&&imgclass=xtqt"
- }, {
- "menu_id" : "102",
- "isChecked" : "true",
- "menu_name" : "预警通知单管理",
- "isJSC":false,
- "menu_img":"../images/index/icon2.png",
- "menu_url":"/nwyj/page/business/em/alert/warning/Warning.jsp?id=40200&&imgclass=yjyjxy"
- }, {
- "menu_id" : "103",
- "isChecked" : "true",
- "menu_name" : "响应通知单管理",
- "isJSC":false,
- "menu_img":"../images/index/icon3.png",
- "menu_url":"/nwyj/page/business/em/response/emergencyResponse/Warning.jsp?id=40301&&imgclass=yjxygl"
- }, {
- "menu_id" : "104",
- "isChecked" : "true",
- "menu_name" : "报表汇总查询",
- "isJSC":false,
- "menu_img":"../images/index/icon4.png",
- "menu_url":"/nwyj/page/business/em/reporthang.jsp?id=40405&&imgclass=yjbb"
- }, {
- "menu_id" : "105",
- "isChecked" : "true",
- "isJSC":true,
- "menu_name" : "情报板展示",
- "menu_img":"../images/index/icon5.png",
- "menu_url":"/nwyj/page/cockpit/webgis/cockpitIndex.html?dept_id="
- +dept_id+"&&user_id="+user_id+"&&user_name="+encodeURI(user_name)+"&&dept_name="+encodeURI(dept_name)+
- "&&parentId="+parentId+"&&view_id=1031"
- }, {
- "menu_id" : "106",
- "isChecked" : "true",
- "isJSC":true,
- "menu_name" : "因灾损失表",
- "menu_img":"../images/index/icon6.png",
- "menu_url":"/nwyj/page/cockpit/webgis/cockpitIndex.html?dept_id="
- +dept_id+"&&user_id="+user_id+"&&user_name="+encodeURI(user_name)+"&&dept_name="+encodeURI(dept_name)+
- "&&parentId="+parentId+"&&view_id=1018"
- }, {
- "menu_id" : "107",
- "isJSC":true,
- "isChecked" : "true",
- "menu_name" : "现场视频和图片",
- "menu_img":"../images/index/icon7.png",
- "menu_url":"/nwyj/page/cockpit/webgis/cockpitIndex.html?dept_id="
- +dept_id+"&&user_id="+user_id+"&&user_name="+encodeURI(user_name)+"&&dept_name="+encodeURI(dept_name)+
- "&&parentId="+parentId+"&&view_id=1033"
- }, {
- "menu_id" : "108",
- "isChecked" : "false",
- "isJSC":false,
- "menu_name" : "应急组织机构管理11",
- "menu_img":"../images/index/icon8.png"
- }, {
- "menu_id" : "109",
- "isChecked" : "false",
- "isJSC":false,
- "menu_name" : "应急制度规范文件管理11",
- "menu_img":"../images/index/icon9.png"
- }, {
- "menu_id" : "110",
- "isChecked" : "false",
- "isJSC":false,
- "menu_name" : "应急预案管理11",
- "menu_img":"../images/index/icon10.png"
- }, {
- "menu_id" : "111",
- "isChecked" : "false",
- "isJSC":false,
- "menu_name" : "应急基地管理11",
- "menu_img":"../images/index/icon11.png"
- }, {
- "menu_id" : "112",
- "isChecked" : "false",
- "isJSC":false,
- "menu_name" : "应急培训演练管理11",
- "menu_img":"../images/index/icon12.png"
- }, {
- "menu_id" : "113",
- "isChecked" : "false",
- "isJSC":false,
- "menu_name" : "应急资源管理11",
- "menu_img":"../images/index/icon1.png"
- }, {
- "menu_id" : "114",
- "isChecked" : "false",
- "isJSC":false,
- "menu_name" : "应急新闻及展示11",
- "menu_img":"../images/index/icon4.png"
- }, {
- "menu_id" : "115",
- "isChecked" : "false",
- "isJSC":false,
- "menu_name" : "应急资源管理11",
- "menu_img":"../images/index/icon5.png"
- }, {
- "menu_id" : "116",
- "isChecked" : "false",
- "isJSC":false,
- "menu_name" : "应急新闻及展示11",
- "menu_img":"../images/index/icon8.png"
- }, {
- "menu_id" : "117",
- "isChecked" : "false",
- "isJSC":false,
- "menu_name" : "应急组织机构管理22",
- "menu_img":"../images/index/icon6.png"
- }, {
- "menu_id" : "118",
- "isChecked" : "false",
- "isJSC":false,
- "menu_name" : "应急制度规范文件管理22",
- "menu_img":"../images/index/icon11.png"
- }, {
- "menu_id" : "119",
- "isChecked" : "false",
- "isJSC":false,
- "menu_name" : "应急预案管理22",
- "menu_img":"../images/index/icon3.png"
- }, {
- "menu_id" : "120",
- "isChecked" : "false",
- "isJSC":false,
- "menu_name" : "应急基地管理22",
- "menu_img":"../images/index/icon7.png"
- }, {
- "menu_id" : "121",
- "isChecked" : "false",
- "isJSC":false,
- "menu_name" : "应急培训演练管理22",
- "menu_img":"../images/index/icon2.png"
- }, {
- "menu_id" : "122",
- "isChecked" : "false",
- "isJSC":false,
- "menu_name" : "应急资源管理22",
- "menu_img":"../images/index/icon9.png"
- }, {
- "menu_id" : "123",
- "isChecked" : "false",
- "isJSC":false,
- "menu_name" : "应急新闻及展示22",
- "menu_img":"../images/index/icon10.png"
- } ];
- $(function() {
- // 生成“个人工作台”和“更多”中的菜单
- createQuickMenu();
- // 点击添加按钮
- $(".nav_more_all").live("click", addToQuick);
- // 点击移除按钮
- $(".handle_button_remove").live("click", removeForQuick);
- // 点击“更多”
- $("#select_more").live("click", showMore);
- /* 更多选项中,鼠标移入,显示操作(增加)按钮 */
- $(".quick_nav_more").live("mouseover", function() {
- $(this).find(".handle_button_add").show();
- });
- /* 更多选项中,鼠标移出,隐藏操作(增加)按钮 */
- $(".quick_nav_more").live("mouseout", function() {
- $(this).find(".handle_button_add").hide();
- });
- $("#close_more").click(function() {
- $("#more_nav").hide();
- $("#left_area").show();
- $("#right_area").show();
- });
-
- // 切换工作台
- toggleWorkBentch();
- // alert("fa");
- $(".liContent").live("click",function(){
- var $self = $(this);
- var fd_id = $self.data("fd_id");
- var url = $self.data("url");
- });
-
- });
- $(document).ready(function(){
- $(".more_title").mousedown(function(e){
- $(".more_title").css("cursor","move");
- var offset = $(this).offset();
- var x = e.pageX - offset.left;
- var y = e.pageY - offset.top;
- $(document).bind("mousemove",function(ev){
- $(".more_nav").stop();
- var _x = ev.pageX - x;//获得X轴方向移动的值
- var _y = ev.pageY - y;//获得Y轴方向移动的值
- $(".more_nav").animate({left:_x+"px",top:_y+"px"},10);
- });
-
- });
- $(document).mouseup(function(){
- $(".more_title").css("cursor","default");
- $(this).unbind("mousemove");
- });
- });
- function showMore() {
- var flag = $("#more_nav").css("display");
- // alert("aa");
- if (flag == "none") {
- $("#more_nav").css("display", "inline-block");
- // 隐藏左侧区域
- $("#left_area").hide();
- // 隐藏右侧区域
- $("#right_area").hide();
- }
- if (flag == "inline-block") {
- $("#more_nav").css("display", "none");
- }
- }
- function createQuickMenu() {
- // 先还原
- $("#diy_area").html("");
- // 先还原
- $("#allMenu").html("<h4>所有菜单</h4><!-- 虚线 --><hr>");
- // 先还原
- $("#ytj").html("");
- var j = 0;
- for (var i = 0; i < syMenu.length; i++) {
- if (syMenu[i].isChecked == "true") {
- j++;
-
- // 生成个人工作台
- var $div = $('<a class="quick_nav" title="' + syMenu[i].menu_name + '">'
- + '<img src="'+syMenu[i].menu_img+'"/>'
- + '<div class="menu_data">'+syMenu[i].menu_id+'</div>'
- + '<div class="quick_nav_name">'
- + syMenu[i].menu_name + '</div>' + '</a>');
- $div.data("data-url",syMenu[i].menu_url);
- $div.data("data-isJSC",syMenu[i].isJSC);
- $div.bind("click",function(){
- var isJSC = $(this).data("data-isJSC");
- var url = $(this).data("data-url");
- if(isJSC){
- window.open(url,"_blank","");
- }else{
- $(top.document.body).find("#frmright").attr("src",url);
- }
- });
- $("#diy_area").append($div);
-
- // 生成"更多"中的"已添加"菜单
- $("#ytj").append(
- '<div class="quick_nav_more nav_more_ytj" title="'
- + syMenu[i].menu_name
- + '">'
- + '<img src="'+syMenu[i].menu_img+'"/>'
- + '<div class="menu_data">'+syMenu[i].menu_id+'</div>'
- + '<div class="quick_nav_name">'
- + syMenu[i].menu_name
- + '</div>'
- + '<div class="handle_button_remove" title="从工作台移除">'
- + '<a><img src="../images/index/remove.png"></a>'
- + '</div></div>');
- }
- // 生成“更多”中的所有菜单
- var all_menuID = "all_data"+i;
- $("#allMenu").append(
- '<a class="quick_nav_more nav_more_all" title="'
- + syMenu[i].menu_name
- + '">'
- + '<img src="'+syMenu[i].menu_img+'"/>'
- + '<div class="menu_data" id='+all_menuID+'>'+syMenu[i].menu_id+'</div>'
- + '<div class="quick_nav_name">'
- + syMenu[i].menu_name
- + '</div>'
- + '<div class="handle_button_add" title="添加到工作台" style="display:none">'
- + '<span>添加</span>' + '</div></a>');
- $("#"+all_menuID).data("menuData",syMenu[i]);
- }
- for (var k = 1; k <= 9 - j; k++) {
- $("#ytj").append(
- '<div class="quick_nav_more add_more">'
- + '<img src="../images/index/add_img.jpg"/></div>');
- }
- // "个人工作台中"加上"更多"框
- $("#diy_area").append('<div><a class="quick_nav select_more" id="select_more" title="编辑个人工作台"><img src="../images/index/icon_more.png"style="height: 22px; width: 22px;"/> <span>更多</span></a></div>');
- }
- function toggleWorkBentch() {
- // 默认选中“个人工作台“
- $("#diy_workbench").css("background",'url("../images/index/Tab.png")');
- $("#diy_workbench").css("color", "#fff");
- $("#diy_workbench").css("height", "52px");
- $(".work_button").click(function(){
- //改变当前背景
- $(this).css("background", 'url("../images/index/Tab.png")');
- $(this).css("color", "#fff");
- $(this).css("height", "52px");
- // 把其他选中状态(颜色)去掉
- $(this).siblings().eq(0).css("background", "#f7f7f7");
- $(this).siblings().eq(0).css("height", "42px");
- $(this).siblings().eq(0).css("color", "#000");
- var id = $(this).attr("id");
- // 当点击的是“个人工作台”时切换显示快捷菜单
- if (id == "diy_workbench") {
- //如果点击的是“个人工作台”,则切换个人工作台的显示隐藏
- $("#diy_area").toggle();
-
- if ($("#diy_area").css("display") == "none") {
- //若切换后,此时个人工作台处于隐藏状态,则修改“个人工作台”为非选中时背景
- $("#diy_workbench").css("background", "#f7f7f7");
- $("#diy_workbench").css("color", "#000");
- $("#diy_workbench").css("height", "42px");
- }
- } else {
- // 否则(当点击“GIS综合展示”时)隐藏个人工作台
- $("#diy_area").hide();
- }
- // alert("aa");
- });
- }
- // 点击添加按钮
- function addToQuick() {
- // 判断已添加中是否已满7个
- if ($(".nav_more_ytj").length >= 9) {
- alert("最多只能添加9个!");
- return;
- }
- //获取当前菜单div绑定的数据并改变其中的标识isChecked
- var menu_data = $(this).find(".menu_data").data('menuData');
- //判断是否已经添加
- if(menu_data.isChecked == "true"){
- alert("该项已经添加过了!");
- return;
- }
- menu_data.isChecked = "true";
- // alert(menu_data);
- //在已添加中添加上该菜单div,
- $("#ytj .add_more:first").before(
- '<div class="quick_nav_more nav_more_ytj" title="'
- + menu_data.menu_name
- + '">'
- + '<img src="'+menu_data.menu_img+'"/>'
- + '<div class="menu_data">'+menu_data.menu_id+'</div>'
- + '<div class="quick_nav_name">'
- + menu_data.menu_name
- + '</div>'
- + '<div class="handle_button_remove" title="从工作台移除">'
- + '<a><img src="../images/index/remove.png"></a>'
- + '</div></div>');
-
- //在个人工作台中添加上该菜单div,
- $("#select_more").before(
- '<a class="quick_nav" title="' + menu_data.menu_name + '">'
- + '<img src="'+menu_data.menu_img+'"/>'
- + '<div class="menu_data">'+menu_data.menu_id+'</div>'
- + '<div class="quick_nav_name">'
- + menu_data.menu_name + '</div>' + '</a>');
-
- //同时删除一个“十字”占位符号
- $("#ytj .add_more:first").remove();
-
- }
- // 点击移除按钮
- function removeForQuick() {
-
- //1,提出该项菜单id
- var menuId = $(this).parent().find(".menu_data").text();
- // //2,移除该项
- $(this).parent().remove();
-
- //3,移除工作台中相应菜单
- //3.1,通过menuId找到工作台中对应的菜单
- var currentDIYMenu = $("#diy_area .quick_nav:contains("+menuId+")");
- //3.2,移除
- currentDIYMenu.remove();
- //4,在后面添加一个“十字”占位符
- $("#ytj").append(
- '<div class="quick_nav_more add_more">'
- + '<img src="../images/index/add_img.jpg"/></div>');
- //5,在“更多”的“所有菜单”中找到响应菜单
- var currentAllMenu = $("#allMenu .quick_nav_more:contains("+menuId+")");
- //5.1,提出其中的数据
- var menuData = currentAllMenu.find(".menu_data").data("menuData");
- menuData.isChecked = "false";
- }
|