123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535 |
- <!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>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <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/main.js"></script>
- <script type="text/javascript" src="/nwyj/scripts/jquery/plugins/jquery.extension.util.js"></script>
- <link href="/nwyj/scripts/qui/libs/skins/flatBlue/style.css" rel="stylesheet" type="text/css"/>
- <link rel="stylesheet" type="text/css" href="/nwyj/css/main_index.css" />
- <script type="text/javascript" src="/nwyj/scripts/qui/libs/js/table/quiGrid.js" ></script>
- <script type="text/javascript" src="/nwyj/scripts/freamwork/com/sinosoft/system/right/userClickNum.js"></script>
- <script type="text/javascript" src="/nwyj/scripts/freamwork/com/sinosoft/system/right/main_index_now.js"></script>
- <script type="text/javascript" src="/nwyj/scripts/qui/libs/js/drag/dragSort.js"></script>
- <script type="text/javascript">
- //配置首页模块函数JSON
- /* var idxFunJson = {"getUserData":getUserData,
- "getResourceData":getResourceData,
- "getdaibanData":getdaibanData,
- "getAlertResponseData":getAlertResponseData,
- "getUrlData":getUrlData,
- "getWorkMenuData":getWorkMenuData,
- "loadDuty":loadDuty,
- "getGongGaoData":getGongGaoData,
- "getStrendIframeData":getStrendIframeData,
- "getImportentUserOutageStrend":getImportentUserOutageStrend,
- "getLineTripSumStrend":getLineTripSumStrend,
- "getNwyjModuleData":getNwyjModuleData}; */
- var user_id = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
- var role_id = top.com.sinosoft.lz.system.user.LoginInfo.getRoleids();
- var comp_id = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
- var real_name = top.com.sinosoft.lz.system.user.LoginInfo.getReal_name();
- var corp_names = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_names();
- var rolenames = top.com.sinosoft.lz.system.user.LoginInfo.getRolenames();
- var logindate = top.com.sinosoft.lz.system.user.LoginInfo.getLogin_date();
- var logintime = top.com.sinosoft.lz.system.user.LoginInfo.getLogin_time();
- var dept_id = top.com.sinosoft.lz.system.user.LoginInfo.getDeptids();
- var deptnames = top.com.sinosoft.lz.system.user.LoginInfo.getDeptnames();
- var parent_ids = top.com.sinosoft.lz.system.user.LoginInfo.getParent_ids();
- var saphruserid = top.com.sinosoft.lz.system.user.LoginInfo.getSaphruserid();
- var user_menu_data = [{
- fd_id:"11111",
- li_id:"index_left_4",
- title:"个人信息",
- module_fun:"getUserData",
- ul_id:"left_list"
- },{
- fd_id:"11111",
- li_id:"index_left_1",
- title:"常用菜单管理",
- module_fun:"getWorkMenuData",
- ul_id:"left_list"
- /* },{
- fd_id:"11111",
- li_id:"index_left_3",
- title:"专业系统集成",
- module_fun:"getUrlData",
- ul_id:"left_list"
- },{
- fd_id:"11111",
- li_id:"index_right_6",
- title:"公告",
- module_fun:"getGongGaoData",
- ul_id:"right_list" */
- },{
- fd_id:"11111",
- li_id:"index_right_2",
- title:"值班信息",
- module_fun:"loadDuty",
- ul_id:"right_list"
- }];
-
- $(function(){
- /* 置顶图标固定位置 */
- $(top.window).scroll( function() {
- var _thisScroll = $(this);
- var scroH = _thisScroll.scrollTop();
- if(scroH>200){
- $(".fixItem").css({"top":scroH+200+"px"});
- $("#toTop").show();
- }else{
- $(".fixItem").css({"top":scroH+200+"px"});
- $("#toTop").hide();
- }
- scroH = null;
- _thisScroll = null;
- });
- /* 置顶图标固定位置 */
-
- //设置初始页面最小高度
- var parentHeightidx = window.screen.height;
- $(parent.document.body).find("#frmright").css("min-height",parentHeightidx-255);
- parentHeightidx = null;
-
- if(comp_id==null||comp_id==""){
- top.Dialog.alert("此用户未设置公司,不能访问首页!");
- return;
- }
- //设置高度
- resetpageheight();
- //initLiCont(user_menu_data,0);
- //取用户初始数据
- $.ajax({
- url : $.pathname() +'/ws/moduleobj/getModuleByUserId/',
- type : 'post',
- data : {
- user_id:user_id
- },
- dataType : 'json',
- async:false,
- success : function(data) {
- //console.log(data);
- if(data.state == "ok"&&data.length == 0){//如果为空,则初始话默认数据
- initLiCont(user_menu_data,0);
- }else{//加载内容
- initLiCont (data.resultData,1);
- }
- },
- error : function(e) {
- try{
- top.Dialog.alert('访问服务失败!');
- }catch(e){
- }
- }
- });
- });
-
-
- /**初始化左右li框架
- *idxType 分0、其他
- *0、代表用户没有模块数据 其他、代表用户有模块数据
- */
- function initLiCont (userModuleData,idxType) {
- //console.log(userModuleData);
- //储存用户模块为空时候初始值信息
- var moduleData = "";
- for(var i=0;i < userModuleData.length;i++){
- var data = userModuleData[i];
- var moduleFun = trim(data.module_fun);
- var ul_id = trim(data.ul_id);
- var li_id = trim(data.li_id);
- var li_title = trim(data.title);
- var module_url = trim(data.module_url);
- var moduleWidth = "";
- var moduleHeight = "";
- var $cont = $("#"+ul_id).last();
- //加载模块初始话数据
- moduleData += (li_id+"|"+(i<10?'0'+i:i)+"|0,");
- var lihtml = ('<li class="shedu_cont li_cont" id="'+li_id+'" >'
- + '<div class="content_title"><span class="title_text">'+li_title+'</span></div>'
- + '<div class = "content_btn" style="display: none;" >'
- + '<span class="freshing freshimg1" title="刷新" onclick="moduleFresh(\''+li_id+'\',\''+module_url+'\',\''+moduleFun+'\',\''+moduleWidth+'\',\''+moduleHeight+'\');" id="freshing'+li_id+'" ></span>'
- + '<span class="closeimg cont_close1 " title="删除" ></span>'
- + '</div>'
- + '<div class="content_cont" id="cont'+li_id+'" style="min-height:70px">'
- + '<div class="idxModule_content"></div>'
- + '<div class="idxModule-loading-bg" style="display: block;"></div>'
- + '<div class="idxModule-loading-box" style="display: block;"><span>正在加载...</span></div>'
- + '</div>'
- +'</li>');
- $cont.append(lihtml);
- var $liList = $cont.find(".li_cont").last();
-
- //储存数据
- $liList.data("li_id",li_id);
- $liList.data("module_url",module_url);
- $liList.data("module_fun",moduleFun);
- //加载函数,加载内容
- runSelectFun(li_id,module_url,moduleFun,moduleWidth,moduleHeight);
- /* var jsFun = idxFunJson[moduleFun];
- jsFun(li_id,module_url,moduleWidth,moduleHeight);
- jsFun = null; */
- liList = null;
- $liList = null;
- $cont = null;
-
- }
- //设置模块标题事件
- setTitleFun();
-
- //当新用户没有模块数据时,向服务器写入初始数据
- if(idxType==0){
- setModuleData(moduleData,0);
- moduleData=null;
- }
-
- //设置
- //$("#left_list").append($('<dt class="clear"></dt>'));
- //$("#rigth_list").append($('<dt class="clear"></dt>'));
-
- /*块拖拽 */
- $("#right_list ,#left_list").dragSort({
- itemSelector: ".li_cont",
- dragSelector: ".content_title",
- dragBetween: false,
- dragEnd: saveOrder,
- placeHolderTemplate: "<li class='placeHolder'><div></div></li>"
- });
- //设置高度
- //resetpageheight();
- }
- /**
- * 配置函数
- */
- function runSelectFun(idx,url,moduleFun,moduleWidth,moduleHeight){
- switch (moduleFun) {
- case "getUserData": getUserData(idx,url,moduleWidth,moduleHeight); break;
- case "getResourceData": getResourceData(idx,url,moduleWidth,moduleHeight); break;
- case "getdaibanData": getdaibanData(idx,url,moduleWidth,moduleHeight); break;
- case "getAlertResponseData":getAlertResponseData(idx,url,moduleWidth,moduleHeight);break;
- case "getUrlData": getUrlData(idx,url,moduleWidth,moduleHeight); break;
- case "getWorkMenuData": getWorkMenuData(idx,url,moduleWidth,moduleHeight);break;
- case "loadDuty": loadDuty(idx,url,moduleWidth,moduleHeight); break;
- case "getGongGaoData": getGongGaoData(idx,url,moduleWidth,moduleHeight); break;
- case "getStrendIframeData": getStrendIframeData(idx,url,moduleWidth,moduleHeight); break;
- case "getImportentUserOutageStrend":getImportentUserOutageStrend(idx,url,moduleWidth,moduleHeight);break;
- case "getLineTripSumStrend":getLineTripSumStrend(idx,url,moduleWidth,moduleHeight); break;
- case "getNwyjModuleData": getNwyjModuleData(idx,url,moduleWidth,moduleHeight); break;
- case "getAccessoryData": getAccessoryData(idx,url,moduleWidth,moduleHeight); break;
- }
- }
- /**
- * 模块刷新
- */
- function moduleFresh(idx,url,moduleFun,moduleWidth,moduleHeight){
- if("getdaibanData"!=moduleFun&&"loadDuty"!=moduleFun){
- $("#cont"+idx).find(".idxModule_content").last().html("");
- }
- showLoading(idx);
- setTimeout(function(){
- if(moduleFun=="getdaibanData"){
- getdaibanAjax();
- }else if(moduleFun=="loadDuty"){
- $(".changeDate").eq(1).click();
- }else{
- runSelectFun(idx,url,moduleFun,moduleWidth,moduleHeight);
- }
- },500);
- }
- /**
- * 隐藏加载动画
- */
- function hideLoading(idx){
- $("#cont"+idx).find(".idxModule-loading-box").css("display","none");
- $("#cont"+idx).find(".idxModule-loading-bg").css("display","none");
- }
- /**
- * 显示加载动画
- */
- function showLoading(idx){
- $("#cont"+idx).find(".idxModule-loading-box").css("display","block");
- $("#cont"+idx).find(".idxModule-loading-bg").css("display","block");
- }
- /**
- * 设置模块标题事件
- */
- function setTitleFun(){
- /*移除按钮的监听方法 */
- $(".closeimg").bind("mouseenter",function(){
- //console.log("closeimg=============>>>>进");
- $(this).removeClass("cont_close1").addClass("cont_close2");
- });
- $(".closeimg").bind("mouseleave",function(){
- //console.log("closeimg=============>>>>出");
- $(this).removeClass("cont_close2").addClass("cont_close1");
- });
- $(".closeimg").bind("click",function(){
- var title_li_id = $(this).parent().parent().attr("id");
- delectModule(title_li_id);
- title_li_id=null;
- });
- $(".freshing").bind("mouseenter",function(){
- //console.log("closeimg=============>>>>进");
- $(this).removeClass("freshimg1").addClass("freshimg2");
- });
- $(".freshing").bind("mouseleave",function(){
- //console.log("closeimg=============>>>>出");
- $(this).removeClass("freshimg2").addClass("freshimg1");
- });
- /*模块区域监听方法 */
- $(".li_cont").bind("mouseover",function(){
- $(this).find(".content_btn").show();
- });
- $(".li_cont").bind("mouseout",function(){
- $(this).find(".content_btn").hide();
- });
-
- }
- //删除模块数据
- function delectModule(li_id){
- li_id = trim(li_id);
- var $dom = $("#"+li_id);
- $.ajax({
- url : $.pathname() +'/ws/moduleobj/delectModult/',
- type : 'post',
- data : {
- user_id:user_id,
- li_id:li_id
- },
- dataType : 'text',
- async:false,
- success : function(data) {
- if(data=="error"){
- top.Dialog.alert('修改数据失败!');
- }else{
- $dom.remove();
- resetpageheight();
- }
- $dom = null;
- },
- error : function(e) {
- try{
- top.Dialog.alert('访问服务失败!');
- }catch(e){
- }
- $dom = null;
- }
- });
- }
- //高度处理
- function resetpageheight(){
- var leftHeight = $("#left_list").height();
- var rightHeight = $("#right_list").height()
- var height = leftHeight>rightHeight?leftHeight:rightHeight;
- $(window.document.body).height(height);
- $(parent.document.body).find("#frmright").css("height",$(window.document.body).height()+30);
- leftHeight = null;
- rightHeight = null;
- height = null;
- }
-
- //排序的方法
- function saveOrder() {
- //var serialStr = "";
- var sortData = "";
- $(".li_cont").each(function(item, elm) {
- //排序li
- //serialStr += (item > 0 ? "|" : "") +item/* $(elm).children().html()*/;
- //排序module
- sortData = trim($(elm).data("li_id"))+"|"+(item<10?'0'+item:item)+"|0,"+sortData;
- });
- //将排序的数据保存到服务器
- //console.log(serialStr);
- setModuleData(sortData,2);
- //$("input[name=listSortOrder]").val(serialStr);
- //serialStr = null;
- sortData=null;
- };
-
- //创建选择模块弹框
- function openDialog(){
- var diag = new top.Dialog();
- diag.Title = "所有模块";
- diag.ShowMaxButton=true;
- diag.ShowMinButton=false;
- diag.Width= 730;
- diag.Height=350;
- diag.ButtonAlign="center";
- diag.Drag=true;
- //点击确定按钮的监听方法
- diag.OKEvent = function(){
- var inputValue = diag.innerFrame.contentWindow.getDateToParent();
- var currentData = inputValue.current;
- var beforeData = inputValue.before;
- var modulelist = "";
- //排序计数
- var sort = 0;
- //解析需要删除的数据
- for(var j=0;j<beforeData.length;j++){
- modulelist = beforeData[j]+"|"+(sort<10?'0'+sort:sort)+"|1,"+modulelist;
- sort++;
- }
- //解析需要存入数据
- for(var i=0;i<currentData.length;i++){
- modulelist = currentData[i]+"|"+(sort<10?'0'+sort:sort)+"|0,"+modulelist;
- sort++;
- }
- //向服务器写入需要改变的数据
- setModuleData(modulelist,1);
- diag.close();
- inputValue = null;
- modulelist = null;
- sort = null;
- };
- diag.URL = "/nwyj/page/all_module.jsp";
- diag.ShowButtonRow=true;
- diag.show();
-
- }
-
- /**
- * 修改用户的模块信息
- * idxType的值有 0,1,其他,
- 0、代表用户没有数据时,初始数据
- 1、从左右模块中选择的数据
- 其他、排序的数据
- */
- function setModuleData (modulelist,idxType){
- $.ajax({
- url : $.pathname() +'/ws/moduleobj/addModuleByUserId/',
- type : 'post',
- async:false,
- data : {
- user_id:user_id,
- list_data:modulelist
- },
- dataType : 'text',
- success : function(data) {
- if(data=="error"){
- top.Dialog.alert('修改数据失败!');
- }else{
- if(idxType==0){//当没有数据时,初始数据
- //$.messager.show(0,"您还没有选择任何模块信息,系统已经初始化了一个模块!");
- }else if(idxType==1){//从左右模块中选择的数据
- window.location.reload();
- }else{//排序的数据
- resetpageheight();
- }
- }
- },
- error : function(e) {
- top.Dialog.alert('查询失败!');
- }
- });
- }
- function openQuestion(){
- var diag = new top.Dialog();
- diag.Title = "我的帮助";
- /* diag.Width= 730;
- diag.Height=390; */
- diag.Width = 510;
- diag.Height = 390;
- diag.Drag=true;
- diag.URL = "/nwyj/page/system/questionHuiZong/questionHuiZong_Add.jsp?diag="+diag;
- diag.show();
- diag.CancelEvent = function(){
- diag.close();
- diag=null;
- };
- }
- function openMsgBtn(){
- //blankopenNext("/nwyj/page/system/message/SendMsg.html");
- windowOpenNext("/nwyj/page/system/sms/addMsg.html");
- //alert("msg");
- /* var diag = new top.Dialog();
- diag.Title = "发送消息";
- diag.Width= 730;
- diag.Height=390;
- diag.Drag=true;
- diag.URL = "/nwyj/page/system/message/SendMsg.html";
- diag.show();
- diag.CancelEvent = function(){
- diag.close();
- diag=null;
- }; */
- }
-
- //删除左右两端的空格
- function trim(str){
- if(str!=null){
- return str.replace(/(^\s*)|(\s*$)/g, "");
- }
- return str;
- }
- </script>
- </head>
- <body>
- <div class="fixItem" id="idxfixItem">
- <div id="toTop" style="display: none;" onclick="script:top.window.scrollTo(0,0);">
- <!-- <a href="#indexTop"><img src="/nwyj/images/index/to_top.png" /></a> -->
- <a href="javascript:;"><img src="/nwyj/images/index/to_top.png" /></a>
- </div>
- <div id="" onclick="openDialog();">
- <a href="javascript:;"><img src="/nwyj/images/index/add_div.png" /></a>
- <span class="floating_left">自定义组件</span>
- </div>
- <div id="" onclick="openQuestion();">
- <a href="javascript:;"><img src="/nwyj/images/index/que_img.png" /></a>
- <span class="floating_left">BUG/提问</span>
- </div>
- <div id="" onclick="openMsgBtn();">
- <a href="javascript:;"><img src="/nwyj/images/index/fix_msg.png" /></a>
- <span class="floating_left">发送短信</span>
- </div>
- </div>
- <div class="module-content" id="indexTop">
- <ul id="left_list" class="ul_cont">
- <!-- <li class="shedu_cont li_cont" >
- <div class="content_title"><span class="title_text">测试模块</span></div>
- <div class="content_btn" style="display: none;" >
- <span class="freshing freshimg1" title="刷新" onclick="moduleFresh();" ></span>
- <span class="closeimg cont_close1 " title="删除" ></span>
- </div>
- <div class="content_cont" style="min-height:200px">
- <div class="idxModule_content"></div>
- <div class="idxModule-loading-bg" style="display: block;"></div>
- <div class="idxModule-loading-box" style="display: block;"><span>正在加载...</span></div>
- </div>
- </li> -->
- </ul>
- <ul id="right_list" class="ul_cont">
- </ul>
- <input name="listSortOrder" type="hidden" />
- </div>
- </body>
- </html>
|