12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007 |
- <%@page language="java" pageEncoding="UTF-8"%>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title></title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-
- <!--框架必需start 扁平风格-->
-
- <script type="text/javascript" src="/nwyj/scripts/qui/libs/js/jquery.js"></script>
- <script type="text/javascript" src="/nwyj/scripts/qui/libs/js/language/cn.js"></script>
- <script type="text/javascript" src="/nwyj/scripts/qui/libs/js/framework.js"></script>
- <script type="text/javascript" src="/nwyj/scripts/qui/libs/js/main.js"></script>
- <!--框架必需end-->
- <script type="text/javascript" src="/nwyj/scripts/jquery/plugins/jquery.extension.util.js"></script>
- <script type="text/javascript" src="/nwyj/scripts/qui/libs/js/form/selectTree.js"></script>
-
- <link rel="stylesheet" type="text/css" href="/nwyj/scripts/qui/libs/css/import_basic.css" />
- <link href="/nwyj/scripts/qui/libs/skins/flatBlue/style.css"
- rel="stylesheet" type="text/css" id="theme" themeColor="flatBlue"
- positionTarget="positionContent" selInputHeight="32"
- selButtonWidth="35" defaultSelWidth="200" fileBtnWidth="60"
- defaultFileInputWidth="200" defaultGridHeaderHeight="34"
- defaultGridRowHeight="38" defaultFontSize="12" defaultPageSelWidth="55"
- defaultFilterItemHeight="32" dialogWidthFix="0"
- defaultSelItemHeight="32" defaultFontFamily="宋体" />
- <!--用户使用菜单计数 start -->
- <script type="text/javascript" src="/nwyj/scripts/freamwork/com/sinosoft/system/right/userClickNum.js"></script>
- <!--用户使用菜单计数 end -->
- <!--菜单图标-->
- <link href="/nwyj/scripts/qui/libs/css/framework/icon_position.css" rel="stylesheet" type="text/css"/>
-
- <script type="text/javascript" src="/nwyj/scripts/qui/libs/js/popup/floatPanel.js"></script>
-
- <style>
- body {
-
- }
-
- .body_div{
- margin: 5px 10px 0px 10px;
- }
- .fixItem {
- position: fixed;
- top: 400px;
- right: 0;
- z-index: 999;
- display: none;
- }
- .fixItem div{
- margin-bottom: 3px;
- }
- .fixItem img{
- width:36px;
- height:36px;
- }
- .work_cont{
- border:1px solid #b1b0b0;
- background-color:#fff;
- padding:5px 5px 0 5px;
- }
- .menu_cont{
- border:1px solid #b1b0b0;
- background-color:#fff;
- }
- .selection_div{
- margin-top:15px;
- padding: 0px 10px;
- height: 40px;
- line-height: 40px;
- }
- .all_menu_content{
- min-height: 300px;
- }
- /*搜索区域开始*/
- .search_cont{
- position:relative;
- margin:5px 5px 5px 15px;
- float: left;
- }
- .search_img{
- position: absolute;
- top: 8px;
- left: 8px;
- }
- .search_input{
- height: 28px;
- width:330px;
- padding-left:30px;
-
- }
- /*搜索区域结束*/
- /*下拉框开始*/
- .select_cont{
- margin-top:5px;
- float:left;
- position: relative;
- }
- .select_text{
- position: absolute;
- line-height: 200%;
- left: 50px;
- }
- .select_opt{
-
- padding-left: 100px;
- width:330px;
- }
- /*下拉框结束*/
-
- .qiehuan_cont{
- margin-top: 0px;
- margin-right: 18px;
- float:right;
- position: relative;
- }
- .qiehuan_img{
-
- width: 20px;
- height: 20px;
- display:inline-block;
- margin-left:10px;
- line-height:20px;
- text-align:center;
- cursor: pointer;
-
- }
- .flag_class_1{
- background-image:url('/nwyj/images/index/idx_main/grid_img_2.png') !important;
- }
- .flag_class_2{
- background-image:url('/nwyj/images/index/idx_main/list_img_2.png') !important;
- }
-
- .menu_div{
-
- margin: 5px;
- }
- .div_contenter{
- min-height: 110px;
- }
- .cont_ul{
-
- margin:10px auto;
- width: 98% ;
- text-align: center;
- position: relative;
- }
-
- .li_cont_1{
- text-align:center;
- float: left;
- width: 10%;
- }
- .li_cont_2{
- text-align:center;
- float: left;
- width: 14.28%;
- }
- .work_menu_content{
- position: relative;
- }
-
- .menu_div_contents_1{
- position:relative;
- width:80%;
- height:100px;
- margin:0px auto;
- border: 1px solid #b1b0b0;
- }
- .menu_div_contents_2{
- width:90%;
- height:40px;
- margin:0px auto;
- border: 1px solid #b1b0b0;
- }
-
- .div_contenter li:hover{
- box-shadow: -1px -1px 4px rgba(0, 0, 0, 0.2), 1px 1px 4px
- rgba(0, 0, 0, 0.2);
- -webkit-box-shadow: -1px -1px 4px rgba(0, 0, 0, 0.2), 1px 1px 4px
- rgba(0, 0, 0, 0.2);
- -moz-box-shadow: -1px -1px 4px rgba(0, 0, 0, 0.2), 1px 1px 4px
- rgba(0, 0, 0, 0.2);
- -ms-box-shadow: -1px -1px 4px rgba(0, 0, 0, 0.2), 1px 1px 4px
- rgba(0, 0, 0, 0.2);
- -o-box-shadow: -1px -1px 4px rgba(0, 0, 0, 0.2), 1px 1px 4px
- rgba(0, 0, 0, 0.2);
- border: 1px solid #ccc;
- cursor:pointer;
- }
- .div_contenter li{
- list-style-type: none;
- }
- .text_img {
- position: relative;
- }
- .text_img_1 {
- height: 60px;
- width: 100%;
- }
- .text_img_2 {
- margin:5px;
- /*background-color:#000000;*/
- float:left;
- height: 30px;
- width: 30px;
- }
- .text_div{
- height:30px;
- line-height:30px;
- font-size: 14px;
- }
- .text_div_1{
- white-space: nowrap;
- background-color: #fff;
- /* border-bottom:1px solid #b1b0b0; */
- width: 99%;
- overflow: hidden;
- text-overflow: ellipsis;
- margin: 0.5px 0.5px 5px 0.5px;
- }
- .text_div_2{
- background-color: #efefef;
- margin:4.5px 0;
- float:left;
- white-space: nowrap;
- width: 65%;
- overflow: hidden;
- text-overflow: ellipsis;
-
- }
- .div_title {
- position:relative;
- height: 30px;
- }
- .ev_title {
- font-weight:bold;
- float:left;
- padding-left: 10px;
- margin-left: 5px;
- border-left: 2px solid #6aa725;
-
- }
- .line_point{
- float:left;
- height:1px;
- margin-top: 14px;
- margin-left: 10px;
- }
- .line_img{
- background-image:url("../images/index/line_point.png");
- width:100%;
- height:1px;
-
- }
- .sel-btn{
- position: absolute;
- border:1px solid #0091E7;
- cursor:pointer;
- right: 25px;
- top:-5px;
- color: #000000;
- width: 36px;
- height:18px;
- line-height: 18px;
- text-align: center;
- font-size: 14px;
- }
- .uhide{
- display:block;
- }
-
-
- .delete_menu_img{
- position: absolute;
- display: block;
- bottom: 3px;
- right:3px;
- }
- .delect_img_show{
- display: none;
- }
- .select_menu_img{
- position: absolute;
- display: block;
- bottom: 3px;
- right:3px;
- }
- .select_img_show{
- display: none;
- }
- .select_menu_img_flag{
- display: block !important;;
- }
-
- .selet_menu{
- border: 2px solid #016bc3 !important;
- color: #016bc3 !important;
-
- }
- .check_select {
-
- border: 0px none;
- background-image: url("/nwyj/images/index/module_img/select.png");
- background-repeat: no-repeat;
- background-position: 95% 95%;
- padding: 0px 0px 0px 0px;
- display: inline-block;
- white-space: nowrap;
- word-break: keep-all;
- word-wrap: normal;
- background-size: 18px 14px;
- }
-
-
-
- </style>
- <script type="text/javascript">
- var user_menu_data = "";
- var menutext = "添加";
- var menuId_arr = "";
- var user_id = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
- var roleids = top.com.sinosoft.lz.system.user.LoginInfo.getRoleids();
- $(function(){
- /* 置顶图标固定位置 */
- top.onscroll = function () {
- var scroH = $(this).scrollTop();
- if(scroH>200){
- $(".fixItem").css({"top":scroH+350+"px"});
- $(".fixItem").show();
- }else{
- $(".fixItem").css({"top":scroH+350+"px"});
- $(".fixItem").hide();
- }
- };
-
- /* 创建工作台中的菜单 */
- getWorkMenuData();
- /* 创建所有的菜单列表 */
- getAllMenuData();
-
- $(parent.document.body).find("#frmright").css("height",$(window.document.body).height()+30);
- $("#search_menu_btn").bind("click",searchMenu);
- /* $("#search_menu_btn").bind("input propertychange",function(){
- var length = document.getElementById("searchdata").value.length;
- if(length>10){
- top.Dialog.alert("");
- }
- }); */
- $("#search_menu_input").keyup(function(event){
- var value = document.getElementById("search_menu_input").value;
- if(value.length>10){
- document.getElementById("search_menu_input").value=value.substr(0,9);
- top.Dialog.alert("搜索内容不能超过10汉字!");
- }
- if(event.which == "13") {
- $("#search_menu_btn").click();
- }
- });
-
- $(".qiehuan_img").bind("click",function(){
- if($(this).attr("id")=="flag_class_1"){
- $(this).addClass("flag_class_1");
- $("#flag_class_2").removeClass("flag_class_2");
- createMenu1($("#all_menu_contents"),user_menu_data);
- }else{
- $(this).addClass("flag_class_2");
- $("#flag_class_1").removeClass("flag_class_1");
- createMenu2($("#all_menu_contents"),user_menu_data);
- };
- });
-
- })
-
- /**标记用户已经用过的menu*/
- function changeMenuStyle($menu){
- //var $menu = $cont.find(".div_contenter li");
- //console.log($menu);
- if($menu.data("select_data")=="2"){
- if($menu.hasClass("selet_menu")){
- $menu.removeClass("selet_menu");
- }else{
- $menu.addClass("selet_menu");
- }
- }else{
- var $lisdd = $menu.find(".select_menu_img");
- if($lisdd.hasClass("select_menu_img_flag")){
- $lisdd.removeClass("select_menu_img_flag");
- $lisdd.find("img").attr("src","/nwyj/images/index/idx_main/select_flag1.png");
- }else{
- $lisdd.addClass("select_menu_img_flag");
- $lisdd.find("img").attr("src","/nwyj/images/index/idx_main/select_flag.png");
- }
- }
- }
-
-
-
- /* 访问后台,创建工作台上的菜单 */
- function getWorkMenuData(){
- $.ajax({
- url : $.pathname() + '/ws/sys/SysCustomMenuService/queryIndexMenuByroleId/',
- type : 'post',
- async:false,
- data : {
- user_id:user_id
- },
- dataType : 'json',
- success : function(data) {
- if(data==null){
- top.Dialog.alert("查询失败!");
- }else{
- createWorkMenu($("#all_work_menu"),data.resultData);
-
- }
- },
- error : function(e) {
- top.Dialog.alert("查询失败!");
- }
- });
- }
- /* 访问后台查询该用户权限下所有菜单 */
- function getAllMenuData(){
- $.ajax({
- url : $.pathname() + '/ws/sys/SysCustomMenuService/getIndexMenuByRoleIds/',
- type : 'post',
- data : {
- roleids:roleids
- //roleids:'11111'
-
- },
- dataType : 'json',
- //async:false,
- success : function(data) {
- //console.log(data);
- if(data==null){
- top.Dialog.alert("查询失败!");
- }else{
- //储存菜单信息
- user_menu_data = data;
- setSelection($(".select_opt"),data);
- createMenu1($("#all_menu_contents"),data)
- }
- },
- error : function(e) {
- top.Dialog.alert("查询失败!");
- }
- });
- }
-
- /* 创建工作台中的菜单 */
- function createWorkMenu($dom,data){
- //console.log($dom.parent());
- //设置横线宽度
- var contWidth = $(window.document.body).width()-$("#work_1_title .ev_title").width()-100;
- //console.log($("#work_1_title .ev_title").width());
- $("#work_1_title .line_point").css("width",contWidth);
-
- menuId_arr="|";
- $dom.empty();
- var $contul = $('<ul class="cont_ul" style="height: 110px;"></ul>');
- $dom.append($contul);
- for (var i = 0; i < data.length; i++) {
- var menudata = data[i];
- var menu_fd_id = menudata.MENU_ID;//系统菜单表的主键id
- //把添加的菜单放入一个集合
- menuId_arr = menuId_arr + menu_fd_id +"|";
-
- var fd_id = menudata.FD_OBJECTID;//本表主键id
- var menu_img = menudata.IMAGE_URL;
- var img_class = menu_img.substring(menu_img.lastIndexOf("/")+1,menu_img.indexOf(".png"));
- img_class = img_class==""?"idx_sys_moren":img_class;
- //console.log(menu_img);
- //console.log(img_class);
- var title_name = menudata.TITLE_NAME =="统计表"?"保供电统计表":menudata.TITLE_NAME;
-
- var $liCont = $('<div class="li_cont_1"></div>');
- $contul.append($liCont);
- var $li = $('<li class="menu_div_contents_1 work_menu_content" title="'+title_name+'" id="workMenu'+menu_fd_id+'"></li>');
- $liCont.append($li);
- $li.bind("mouseenter",delectImgShow);
- $li.bind("mouseleave",delectImgShow);
- $li.append($('<div class="text_div text_div_1">'+title_name+'</div><div class="text_img text_img_1 '+img_class+'1" value="'+menu_img+'" ></div><a href="javascript:;" class="delete_menu_img delect_img_show" ><img src="/nwyj/images/index/idx_main/delect.png" style="width:18px;height:18px"/></a>'));
- $li.data("menu_fd_id",menu_fd_id);
- $li.data("fd_id",fd_id);
- $li.data("menu_url",menudata.BUSINESS_URL);
- $li.data("menu_name",menudata.TITLE_NAME);
- //$li.data("menu_fd_id",menu_fd_id);
- //绑定点击事件——跳转页面
- $li.find(".text_img").bind("click",toPage);
-
- menudata = null;
- menu_fd_id = null;
- fd_id = null;
- menu_img = null;
- img_class = null;
- $li = null;
- }
- $(".delete_menu_img").bind("click",deleteMenuForWorkById);
- $dom = null;
- $(parent.document.body).find("#frmright").css("height",$(window.document.body).height()+30);
-
- }
-
- function delectImgShow(){
- var $self = $(this).find(".delete_menu_img");
- if($self.hasClass("delect_img_show")){
- $self.removeClass("delect_img_show");
- }else{
- $self.addClass("delect_img_show");
- }
- }
-
-
- function setSelectFlag(menu_id){
- if($("#allMenu"+menu_id).data("select_data")=="2"){
- if(isContainer(menu_id)){
- $("#allMenu"+menu_id).addClass("selet_menu");
- }
- }else{
- var $lisdd = $("#allMenu"+menu_id).find(".select_menu_img").last();
- if(isContainer(menu_id)){
- //console.log($lisdd.hasClass("select_menu_img"));
- $lisdd.addClass("select_menu_img_flag");
- $lisdd.find("img").attr("src","/nwyj/images/index/idx_main/select_flag.png");
- //$("#allMenu"+menu_id).removeClass("select_menu_img_flag");
- //$lisdd.removeClass("select_img_show");
- //$lisdd.addClass("select_img_show");
- }else{
- //$("#allMenu"+menu_id).addClass("select_menu_img_flag");
- //$lisdd.addClass("select_img_show");
- }
- $lisdd = null;
- }
- }
- /* 创建所有的菜单列表2 */
- function createMenu2($dom,data){
- $dom.empty();
-
- for(var k=0;k<data.length;k++){
- //setSelection($(".select_opt"),data);
- var $content = $('<div class="menu_div" id="menu'+k+'"></div>');
- $dom.append($content);
- var $titltCont = $('<div class="div_title"></div>');
- var value = data[k].value;
- $content.append($titltCont);
- $titltCont.append($('<div class="ev_title">'+data[k].display+'</div><div class="line_point"><div class="line_img" alt="" src="../images/index/line_point.png"></div></div>'));
- var $cont_menu = $('<div class="div_contenter" ></div>');
- $content.append($cont_menu);
- var dataLength = Math.ceil((value.length)/7);
- for (var j = 0; j < dataLength; j++) {
- var $contul = $('<ul class="cont_ul" style="height: 50px;"></ul>');
- $cont_menu.append($contul);
- for (var i = j*7; i < (j+1)*7; i++) {
- if(i<value.length){
- var menu = value[i];
- createMenuLi(menu,$contul,"2");
- menu = null;
- }
- }
- $titltCont = null;
- }
- var contWidth = $(window.document.body).width()-$content.find(".ev_title").width()-100;
- $content.find(".line_point").css("width",contWidth);
- dataLength = null;
- $content = null;
- value = null;
- $cont_menu = null;
- }
- $dom = null;
- $(parent.document.body).find("#frmright").css("height",$(window.document.body).height()+30);
- }
- function createMenuLi(menudata,$dom,idx){
- var menu_url = menudata.menu_url;
- var menu_fd_id= menudata.menu_id;
- var menu_img = menudata.menu_img;
- var img_class = menu_img.substring(menu_img.lastIndexOf("/")+1,menu_img.indexOf(".png"));
- img_class = img_class==""?"idx_sys_moren":img_class;
- //console.log(img_class);
- //alert(menu_img);
- var $liCont = $('<div class="li_cont_'+idx+'"></div>');
- $dom.append($liCont);
- var menu_name = menudata.menu_name =="统计表"?"保供电统计表":menudata.menu_name;
- var $li = $('<li class="menu_div_contents_'+idx+'" id="allMenu'+menu_fd_id+'" title="'+menu_name+'"></li>');
- $liCont.append($li);
- //$li.append($('<div class="text_div">'+menudata.menu_name+'</div><img class="text_img" alt="" src="'+menudata.menu_img+'">'));
- var $title = $('<div class="text_div text_div_'+idx+'" >'+menu_name+'</div>');
- var $img = $('<div class="text_img text_img_'+idx+' '+img_class+idx+'" value="'+menu_img+'"></div>');
- //绑定点击事件——跳转页面
- $img.bind("click",toPage);
- if(idx=="2"){
- /* 绑定鼠标移入、移出事件,
- 先将其中文字保存在变量中,
- 移入时显示保存字样,
- 移出时恢复原来的文字 */
- $title.bind("mouseenter",toggleMenuState1);
- $title.bind("mouseleave",toggleMenuState2);
- $title.bind("click",addmenu);
- $li.append($img).append($title);
- }else{
- $li.append($title).append($img);
- var $selectBtn = $('<a href="javascript:;" class="select_menu_img " ><img src="/nwyj/images/index/idx_main/select_flag1.png" style="width:18px;height:18px"/></a>');
- $selectBtn.bind("click",addmenu);
- $li.append($selectBtn);
- //$li.bind("mouseenter",function(){$(this).find(".select_menu_img").removeClass("select_img_show");});
- //$li.bind("mouseleave",function(){$(this).find(".select_menu_img").addClass("select_img_show");});
- }
- $li.data("select_data",idx);
- $li.data("menu_url",menu_url);
- $li.data("menu_name",menudata.menu_name);
- $li.data("menu_fd_id",menu_fd_id);
- setSelectFlag(menu_fd_id);
-
- $img = null;
- $title = null;
- $li = null;
- menudata = null;
- menu_url = null;
- menu_fd_id= null;
- menu_img = null;
- img_class = null;
- $dom = null;
- idx = null;
-
- }
- /* 创建所有的菜单列表1 */
- function createMenu1($dom,data){
- $dom.empty();
-
- for(var k=0;k<data.length;k++){
- //setSelection($(".select_opt"),data);
- var $content = $('<div class="menu_div" id="menu'+k+'"></div>');
- $dom.append($content);
- var $titltCont = $('<div class="div_title"></div>');
- var value = data[k].value;
- $content.append($titltCont);
- $titltCont.append($('<div class="ev_title">'+data[k].display+'</div><div class="line_point"><div class="line_img" alt="" src="../images/index/line_point.png"></div></div><div class="sel-btn flag-class" id = "sel-btn'+k+'">展开</div>'));
- if(value.length<=9){
- $("#sel-btn"+k).remove();
- }else{
- $("#sel-btn"+k).bind("click",gotoshouqi);
- }
-
- var $cont_menu = $('<div class="div_contenter" ></div>');
-
- $content.append($cont_menu);
- var dataLength = Math.ceil((value.length)/10);
- for (var j = 0; j < dataLength; j++) {
- var $contul = $('<ul class="cont_ul" style="height: 110px;"></ul>');
- $cont_menu.append($contul);
- for (var i = j*10; i < (j+1)*10; i++) {
- if(i<value.length){
- var menu = value[i];
- createMenuLi(menu,$contul,"1");
- menu = null;
- }
- }
-
- if(j>0){
- $contul.hide();
- }
-
- }
- $titltCont = null;
- var contWidth = $(window.document.body).width()-$content.find(".ev_title").width()-100;
- $content.find(".line_point").css("width",contWidth);
- dataLength = null;
- $content = null;
- value = null;
- $cont_menu = null;
- }
- $dom = null;
- $(parent.document.body).find("#frmright").css("height",$(window.document.body).height()+30);
- }
- function gotoshouqi (){
- var _this = $(this);
- var $self = _this.parent();
- var $liArr = $self.parent().find("ul");
- if(_this.hasClass('flag-class')){
- _this.html("收缩");
- $.each($liArr, function(i, e) {
- if(i>0){
- $(e).show();
- }
- });
- _this.removeClass('flag-class');
- }else{
- _this.html("展开");
- $.each($liArr, function(i, e) {
- if(i>0){
- $(e).hide();
- }
- });
- _this.addClass('flag-class');
- }
- $(parent.document.body).find("#frmright").css("height",$(window.document.body).height()+30);
-
- }
-
- /* 通过menu_fd_id删除工作台中的菜单 */
- function deleteMenuForWorkById(){
- var $self = $(this);
- var fd_id = $self.parent().data("fd_id");
- //console.log($self.parent());
-
- deleteMenu($self.parent());
- $self = null;
- }
-
- function deleteMenu($self){
-
- var fd_id = $self.data("fd_id");
- var menu_id = $self.data("menu_fd_id");
- //刷新工作台中的menuId_arr字符串
- var _arr = menuId_arr.split("|");
- menuId_arr = "";
- for(var i=0;i<_arr.length-1;i++){
- if(menu_id!=_arr[i]){
- menuId_arr = menuId_arr + _arr[i] +"|";
- }
- }
-
-
- $.ajax({
- url : $.pathname() + '/ws/sys/SysCustomMenuService/deleteIndexMenu/',
- type : 'post',
- async:false,
- data : {
- fd_id:fd_id
- },
- dataType : 'text',
- success : function(data) {
- /* 移除该菜单div */
- //alert(data);
- if(data=="success"){
- changeMenuStyle($("#allMenu"+menu_id));
- removeDom($self);
- }else{
- top.Dialog.alert("删除失败!");
- }
- },
- error : function(e) {
- top.Dialog.alert("删除失败!");
- }
- });
- }
- /* 移除节点 */
- function removeDom($dom){
- $dom.remove();
- }
- /* 绑定鼠标移入、移出事件,
- 先将其中文字保存在变量中,
- 移入时显示保存字样,
- 移出时恢复原来的文字 */
- function toggleMenuState1(){
- var $self = $(this).parent();
- var text = $self.find(".text_div").text();
- //var state = $self.find(".text_div").attr("value");
- var is_state = $self.data("menu_fd_id");
- //console.log(state);
- //console.log(menutext);
- //console.log(menuId_arr);
- //console.log(is_state);
- if(!isContainer(is_state)){
- menutext="添加";
- }else {
- menutext="取消";
- }
-
- $self.find(".text_div").text(menutext);
- menutext = text;
- $self = null;
- }
- /*判断menuId_arr中是否有menuid*/
- function isContainer (menuid){
- if(menuId_arr.indexOf("|"+menuid+"|")>-1){
- return true;
- }
- return false;
- }
- /* 绑定鼠标移入、移出事件,
- 先将其中文字保存在变量中,
- 移入时显示保存字样,
- 移出时恢复原来的文字 */
- function toggleMenuState2(){
- var $self = $(this).parent();
- var text = $self.find(".text_div").text();
- //var state = $self.find(".text_div").attr("value");
- //console.log(state);
- //console.log(menutext);
- $self.find(".text_div").text(menutext);
- menutext = text;
- $self = null;
- }
-
-
- function addmenu(){
- var $self = $(this).parent();
- /* 通过匹配menu_id判断是否添加过 */
- var thisfdid = $self.data("menu_fd_id");
- if(isContainer(thisfdid)){
-
- //console.log(menuId_arr);
- deleteMenu($("#workMenu"+thisfdid));
- return;
- }
-
- var $workMenu = $("#all_work_menu").find(".work_menu_content");
- if($workMenu.length==10){
- top.Dialog.alert("最多只能添加10个菜单!");
- return;
- }
-
- $workMenu = null;
- var menu_url = $self.data("menu_url");
- var menu_name = $self.data("menu_name");
- var menu_img_url = $self.find(".text_img").attr("value");
- //console.log(menu_img_url);
- /* 访问后台,将该菜单保存到工作菜单表 */
- $.ajax({
- url : $.pathname() + '/ws/sys/SysCustomMenuService/addIndexMenu/',
- type : 'post',
- async:false,
- data : {
- menu_id:thisfdid,
- menu_url:menu_url,
- menu_name:menu_name,
- menu_img_url:menu_img_url,
- user_id:user_id
- },
- dataType : 'json',
- success : function(data) {
- changeMenuStyle($("#allMenu"+thisfdid));
- /* 保存成功后重新刷新工作菜单栏 */
- createWorkMenu($("#all_work_menu"),data);
- },
- error : function(e) {
- top.Dialog.alert("添加失败!");
- }
- });
- menu_url = null;
- menu_name = null;
- menu_img_url = null;
- $self = null;
- }
-
- function toPage(){
-
- var $self = $(this).parent();
- var thisfdid = $self.data("menu_fd_id");
-
- var menu_url = $self.data("menu_url");
- var menuId = $self.data("menuId");
- var imgclass = $self.find(".text_img").attr("value");
- imgclass = imgclass.substring(imgclass.lastIndexOf("/")+1,imgclass.indexOf(".png"));
- //alert(imgclass);
- var menu_name = $self.data("menu_name");
- /*根据用户运用情况,记录此菜单的使用次数
- */
- $.indexUserClickNum (user_id,thisfdid);
-
- $(top.document.body).find("#positionMsg").html("<div id='positionTitle1' class='"+imgclass+"'>"+menu_name+"</div>");
- $(top.document.body).find("#positionMsg #positionTitle1").data("menuid",menuId).data("imgclass",imgclass);
- $(top.document.body).find("#currPosition .changeYQ").remove();
- var curSrc = top.getTabMsg();
- menuUri = curSrc!="" && curSrc!=undefined?curSrc:menu_url;
- $.indexOpenSelfWindow(menuUri);
- // 隐藏二三极菜单框
- hideMenu();
- $(top.document.body).find("#currPosition").show();
-
-
- thisfdid = null;
- menu_url = null;
- //menuId = null;
- imgclass = null;
- menu_name = null;
- $self = null;
- }
-
-
- function searchMenu(){
- var searchCond = $("#search_menu_input").val();
- if(searchCond==null||searchCond==""){
- getAllMenuData();
- }else{
- $.ajax({
- url : $.pathname() + '/ws/sys/SysCustomMenuService/queryIndexMenu/',
- type : 'post',
- data : {
- roleids:roleids,
- menuName:searchCond
- },
- dataType : 'json',
- //async:false,
- success : function(data) {
- user_menu_data = data;
- setSelection($(".select_opt"),data);
- createMenu1($("#all_menu_contents"),data)
- },
- error : function(e) {
- top.Dialog.alert("查询失败!");
- }
- });
- }
- }
- function onchangeHandler(obj){
- var opt_value = $(obj).val();
- if(opt_value!="menu-1"){
- $("#menu0").css("display","none");
- $("#menu1").css("display","none");
- $("#menu2").css("display","none");
- $("#menu3").css("display","none");
- $("#"+opt_value).css("display","block");
- }else{
- $("#menu0").css("display","block");
- $("#menu1").css("display","block");
- $("#menu2").css("display","block");
- $("#menu3").css("display","block");
-
- }
- $(parent.document.body).find("#frmright").css("height",$(window.document.body).height()+30);
- }
-
- function setSelection($dom,data){
- $dom.empty();
- var $selbox = $('<select onchange="onchangeHandler(this)" ></select>');
- $dom.append($selbox);
- $selbox.append($('<option value="menu-1">全部</option>'));
- for(var i=0;i<data.length;i++){
- var $opt = $('<option value="menu'+i+'">'+data[i].display+'</option>')
- $selbox.append($opt);
- }
- $selbox.render(); //渲染下拉框
- }
- </script>
- </head>
- <body>
- <!-- 顶层图标:到顶部、添加 -->
- <div class="fixItem">
- <div id="toTop"><a href="#menutop"><img src="/nwyj/images/index/to_top.png" /></a></div>
- </div>
- <div class="work_cont body_div" id="menutop">
- <div class="div_title" id = "work_1_title">
- <div class="ev_title" >常用菜单管理</div>
- <div class="line_point">
- <div class="line_img" alt="" src="../images/index/line_point.png"></div>
- </div>
- </div>
- <div class="div_contenter" id="all_work_menu">
-
- <!-- 工作台菜单 -->
-
- </div>
- </div>
- <div class="menu_cont body_div">
- <div class="selection_div">
- <div class="search_cont" id="searchinput" >
- <a href="javascript:;" class="search_img" id="search_menu_btn"><img src="/nwyj/images/index/search_img.png"/></a>
- <input watermark="应用搜索" type="text" class="search_input" id="search_menu_input">
- </div>
- <div class="select_cont">
- <span class="select_text">类别:</span>
- <div class="select_opt">
- </div>
- </div>
- <div class="qiehuan_cont">
- <div id="flag_class_1" class="qiehuan_img flag_class_1" style = "background-image:url('/nwyj/images/index/idx_main/grid_img_1.png');" ></div>
- <div id="flag_class_2" class="qiehuan_img " style = "background-image:url('/nwyj/images/index/idx_main/list_img_1.png');"></div>
- </div>
- </div>
- <!-- 所有菜单容器 -->
- <div class="all_menu_content" id="all_menu_contents">
- </div>
- </div>
- </body>
- </html>
|