123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641 |
- <!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 rel="stylesheet" type="text/css" href="/nwyj/css/main_index.css" />
- <script type="text/javascript" src="/nwyj/scripts/freamwork/com/sinosoft/system/right/userClickNum.js"></script>
- <script type="text/javascript" src='/nwyj/scripts/business/em/report/addDo.js'></script>
- <script type="text/javascript" src="/nwyj/scripts/freamwork/com/sinosoft/system/right/main_index_iframe.js"></script>
- <script type="text/javascript" src="/nwyj/scripts/qui/libs/js/drag/dragSort.js"></script>
- <script type="text/javascript">
- 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 pcorp_ids = top.com.sinosoft.lz.system.user.LoginInfo.getPcorp_ids();
- var saphruserid = top.com.sinosoft.lz.system.user.LoginInfo.getSaphruserid();
- var dept_level = getThing($.pathname() + "/ws/xianlutingyun/XianlutingyunService/getDeptLevel", {"comp_id" : comp_id}, "text");
- var user_menu_data = [{
- fd_id:"11111",
- li_id:"index_left_2",
- title:"预警与响应",
- module_fun:"getAlertResponseData",
- 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_9",
- title:"预警/响应情况",
- module_fun:"getIndexNotice",
- ul_id:"right_list"
- },{
- fd_id:"11111",
- li_id:"index_right_6",
- title:"公告",
- module_fun:"getGongGaoData",
- ul_id:"right_list"
- },{
- fd_id:"11111",
- li_id:"index_right_4",
- title:"待办",
- module_fun:"getdaibanData",
- ul_id:"right_list"
- }];
-
- $(window).resize(function() {
- resetpageWidth();
- });
- function resetpageWidth(){
- if(document.getElementById("left_list").style.display != "none"){
- var bodyWidth = $(window.document.body).width();
- var rigthWidth = bodyWidth - 360;
- $("#right_list").width(rigthWidth);
- $("#right_list .li_cont").width(rigthWidth - 2);
- }else{
- var bodyWidth = $(window.document.body).width();
- $("#right_list").width(bodyWidth);
- $("#right_list .li_cont").width(bodyWidth - 3);
- }
- }
- $(function(){
- //getIndexNotice("","","","");
- /* 置顶图标固定位置 */
- $(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 rigthWidth = $(window.document.body).width() - 360;
- $("#main-index-div").append('<ul class="ul_cont" id="left_list" style="margin-left:10px; width:330px;float:left;"></ul><ul class="ul_cont" id="right_list" style="width:'+rigthWidth+'px;margin-left:350px;"></ul>');
- //过滤掉没有配置公司的用户
- 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){//如果为空,则初始话默认数据
- if("超高压输电公司"==corp_names){
- var resourseData = {
- fd_id:"11111",
- li_id:"index_right_1",
- title:"资源分布图",
- module_fun:"getResourceData",
- ul_id:"right_list"
- };
- user_menu_data.push(resourseData);
- }
- initLiCont(user_menu_data,0);
- setRunModuleFun(user_menu_data);
- }else{//加载内容
- initLiCont (data.resultData,1);
- setRunModuleFun(data.resultData);
- }
- },
- error : function(e) {
- try{
- top.Dialog.alert('访问服务失败!');
- }catch(e){
- }
- }
- });
- });
-
-
- /**初始化左右li框架
- *idxType 分0、其他
- *0、代表用户没有模块数据 其他、代表用户有模块数据
- */
- function initLiCont (userModuleData,idxType) {
- //var funArraylist = [];
- //console.log(userModuleData);
- 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();
- var liWidth = $cont.width()-2;
- //加载模块初始话数据
- //moduleData += (li_id+"|"+(i<10?'0'+i:i)+"|0,");
- var lihtml = ('<li class="shedu_cont li_cont" id="'+li_id+'" style="width:'+ liWidth +'px;">'
- + '<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:58px">'
- + '<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();
-
- //储存用户模块为空时候初始值信息
- var moduleData = "";
- $(".li_cont").each(function(item, elm) {
- moduleData += trim($(elm).data("li_id"))+"|"+(item<10?'0'+item:item)+"|0,";
- });
-
- $("input[name=listSortOrder]").val(moduleData);
-
- //当新用户没有模块数据时,向服务器写入初始数据
- if(idxType==0){
- setTimeout(function(){
- setModuleData(moduleData,0);
- },100);
- }
- //moduleData=null;
- /*块拖拽 */
- $("#right_list ,#left_list").dragSort({
- itemSelector: ".li_cont",
- dragSelector: ".content_title",
- dragBetween: false,
- dragEnd: saveOrder,
- placeHolderTemplate: "<li class='placeHolder'><div></div></li>"
- });
- }
- /**
- * 为框架加载数据
- */
- function setRunModuleFun(moduData){
- for(var i=0;i<moduData.length;i++){
- var data = moduData[i];
- runSelectFun(trim(data.li_id),trim(data.module_url),trim(data.module_fun),"","");
- if("getStrendIframeData"==trim(data.module_fun)||"getResourceData"==trim(data.module_fun)||"getNwyjModuleData"==trim(data.module_fun)||"getGZXTModuleData"==trim(data.module_fun)){
- //if("right_list"==trim(data.ul_id)){
- setFullScreen(trim(data.li_id));
- }
- data = null;
- }
- }
- /**
- * 配置函数
- */
- 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 "getGZXTModuleData": getGZXTModuleData(idx,url,moduleWidth,moduleHeight); break;
- case "getAccessoryData": getAccessoryData(idx,url,moduleWidth,moduleHeight); break;
- case "getIndexNotice": getIndexNotice(idx,url,moduleWidth,moduleHeight); break;
- }
- }
- /**
- * 模块刷新
- */
- function moduleFresh(idx,url,moduleFun,moduleWidth,moduleHeight){
- $("#cont"+idx).find(".idxModule_content").last().html("");
- showLoading(idx);
- setTimeout(function(){
- if(moduleFun=="loadDuty"){
- $(".changeDate").eq(1).click();
- } else if(moduleFun=="getIndexNotice"){
- $(".r9_tab_span").eq(0).click();
- }else{
- runSelectFun(idx,url,moduleFun,moduleWidth,moduleHeight);
- }
- },10);
- }
- /**
- * 隐藏加载动画
- */
- 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("click",function(){
- var title_li_id = $(this).parent().parent().attr("id");
- delectModule(title_li_id);
- title_li_id=null;
- });
- /*模块区域监听方法 */
- $(".li_cont").bind("mouseover",function(){
- $(this).find(".content_btn").show();
- });
- $(".li_cont").bind("mouseout",function(){
- $(this).find(".content_btn").hide();
- });
- }
- /**
- * 右侧个别模块放大功能
- */
- function setFullScreen(idx){
- //添加按钮功能
- var $content = $("#"+idx).find(".content_btn").last();
- var $fullBtn = $('<span class="full-text-span2" title="放大" ></span>');
- $fullBtn.prependTo($content);
- $fullBtn.data("fd_id",idx);
- $fullBtn.data("flagData",0);
- //添加点击事件
- $fullBtn.bind("click",function(){
- var bodyWidth = $(window.document.body).width();
- var $self = $(this);
- var liidx = $self.data("fd_id");
- if($self.data("flagData")==0){//放大
- $self.removeClass("full-text-span2").addClass("full-text-span4");
- var liheight = $("#"+liidx).height();
- $("#right_list").css({"margin-left":"0px","height":liheight+20,"position":"relative"});
- $("#left_list").hide();
- $("#"+liidx).siblings().hide();
- //重置高度
- $(window.document.body).height(liheight+10);
- $(top.parent.document.body).find("#frmright").css("height",liheight+20);
- $self.data("flagData",1);
- $self.attr("title","缩小");
- $self = null;
- }else{//缩小
- $self.removeClass("full-text-span4").addClass("full-text-span2");
- //$("#right_list").css({"margin-left":"350px","width":rigthWidth1+"px","height":"","position":""});
- $("#right_list").css({"margin-left":"350px","height":"","position":""});
- $("#left_list").show();
- $("#"+liidx).siblings().show();
- $self.data("flagData",0);
- $self.attr("title","放大");
- //重置高度
- resetpageheight();
- var position = $("#"+liidx).position();
- top.window.scrollTo(0, position.top+70);
- $self = null;
- }
- resetpageWidth();
- });
- $content = null;
- $fullBtn = null;
- }
- //删除模块数据
- 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{
- $("#right_list").css({"margin-left":"350px","height":"","position":""});
- $("#left_list").show();
- $("#"+li_id).siblings().show();
- $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 = document.getElementById("left_list").style.display == "none"||leftHeight<rightHeight?rightHeight:leftHeight;
- $(window.document.body).height(height);
- $(parent.document.body).find("#frmright").css("height",height+20);
- leftHeight = null;
- rightHeight = null;
- height = null;
- }
-
- //排序的方法
- function saveOrder() {
- var sortData = "";
- var resultData = "";
- var historyData = $("input[name=listSortOrder]").val();
- $(".li_cont").each(function(item, elm) {
- //排序module
- sortData += trim($(elm).data("li_id"))+"|"+(item<10?'0'+item:item)+"|0,";
- });
- //当顺序有变动时,向服务器写数据
- if (sortData != historyData) {
- var histArr = historyData.split(",");
- var currArr = sortData.split(",");
- for(var i=0;i<currArr.length-1;i++){
- if(histArr[i]!=currArr[i]){
- resultData += currArr[i]+",";
- }
- }
- //console.log(resultData);
- //console.log(sortData);
- //console.log(historyData);
- //将排序的数据保存到服务器,100毫秒后异步执行;
- setTimeout(function(){
- setModuleData(resultData,2);
- },100);
- }
- //保存此次模块顺序
- $("input[name=listSortOrder]").val(sortData);
- sortData=null;
- //resultData=null;
- historyData=null;
- };
- /*判断menuId_arr中是否有menuid*/
- /* function isIndexContainer (parent,child){
- if(parent.indexOf(child)>-1){
- return true;
- }
- return false;
- } */
-
- //创建选择模块弹框
- 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;
- };
- }
- /**测试Excel导出*/
- function exportclick(){
- var params = {
- "flag":"dept_flag"
- };
- //excelExport("",sql,"导出组织机构","","组织机构表","report");
- $.ajax({
- url :$.pathname() + '/ws/excel/ExcelService/CreateReportToExcelByClassId',
- type : 'post',
- timeout : 150000,
- data : params,
- async:false,
- dataType : 'text',
- success : function(data){
- var url = $.pathname() +"/page/common/getExcel.jsp?exportContent="
- + data + "&destFileName=" + encodeURI(encodeURI("组织机构表"));
- window.open(url);
- },
- error : function(e){
- top.Dialog.alert("导出Excel失败");
- }
-
- });
- }
- function openMsgBtn(){
- //blankopenNext("/nwyj/page/system/message/SendMsg.html");
- windowOpenNext("/nwyj/page/system/sms/addMsg.html");
- }
- /* function openMsgBtn1(){
- windowOpenNext("/nwyj/page/system/departmentXls/departmentXls.jsp");
- } */
-
- //删除左右两端的空格
- 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 id="" onclick="exportclick();">
- <a href="javascript:;"><img src="/nwyj/images/index/fix_msg.png" /></a>
- <span class="floating_left">测试</span>
- </div> -->
- </div>
- <div class="module-content" id="main-index-div">
- <!-- <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>
|