2f13682478e710e20c0a6c6b97a5dba387fc81b3.svn-base 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. $(function(){
  2. var userInfo=top.conditionJson;
  3. var ltsoVolLevelUrl = "/nwyj/ws/cockpit/CockpitService/queryVolLevel" ;
  4. $.post(ltsoVolLevelUrl,function(data){
  5. $("#ltsoVolLevel").data("data",data);
  6. $("#ltsoVolLevel").render();
  7. }, "json");
  8. //添加额外属性主要用于最初的初始节点
  9. // $("#AcceptUserTree").attr('params','{"deptId":"'+ deptId +'"}');
  10. var deptUrl="/nwyj/ws/orgInDeptService/OrgInDeptService/getDeptRootById";
  11. $("#AcceptUserTree").attr('params','{"id":"' + userInfo["dept_id"] + '"}');
  12. //异步加载请求地址
  13. $("#AcceptUserTree").attr('url',deptUrl);
  14. $.post(deptUrl, {"deptId" : userInfo["dept_id"]}, function(data) {
  15. $("#AcceptUserTree").data("data", data);
  16. $("#AcceptUserTree").render();
  17. }, "json");
  18. // console.log("+==="+JSON.stringify(userInfo));
  19. // alert(JSON.stringify(userInfo)) ;
  20. }) ;
  21. /**
  22. * 线路跳闸与变电站停运查询
  23. */
  24. function searchLtSo(){
  25. var lttParams = null ;
  26. var ltfParams = null ;
  27. var sotParams = null ;
  28. var sofParams = null ;
  29. var unitId = $("#AcceptUserTree").attr("relValue") ;
  30. var ltsoVolLevel = $("#ltsoVolLevel").attr("relText") ;
  31. var beginTime = $("#beginTimeLtso").attr("value") ;
  32. var endTime = $("#endTimeLtso").attr("value") ;
  33. if(ltsoVolLevel == "请选择")
  34. ltsoVolLevel = "" ;
  35. if(beginTime != "" && endTime == "")
  36. endTime = getNowFormatDate() ;
  37. if(beginTime == "" && endTime != "")
  38. alert("请选择开始时间") ;
  39. var statT = "" ;
  40. var statF = "" ;
  41. $("input:checkbox[name=ltsoState]").each(function(){
  42. if($(this).attr("checked")){
  43. if($(this).val() == 1){ statT = "1"; }
  44. if($(this).val() == 0){ statF = "0"; }
  45. }
  46. }) ;
  47. var flg = "" ;
  48. $("input:checkbox[name=ltsoType]").each(function(){
  49. if($(this).attr("checked")){
  50. flg += $(this.val()) ;
  51. if($(this).val() == 1){
  52. if(statT != ""){
  53. lttParams = {"voltageClass":ltsoVolLevel,"company":unitId,"status":"1","beginTime":beginTime,"endTime":endTime} ;
  54. }
  55. if(statF != ""){
  56. ltfParams = {"voltageClass":ltsoVolLevel,"company":unitId,"status":"0","beginTime":beginTime,"endTime":endTime} ;
  57. }
  58. }
  59. if($(this).val() == 0){
  60. if(statT != ""){
  61. sotParams = {"voltageClass":ltsoVolLevel,"company":unitId,"status":"1","beginTime":beginTime,"endTime":endTime} ;
  62. }
  63. if(statF != ""){
  64. sofParams = {"voltageClass":ltsoVolLevel,"company":unitId,"status":"0","beginTime":beginTime,"endTime":endTime} ;
  65. }
  66. }
  67. }
  68. }) ;
  69. if(flg==""){
  70. if(statT != ""){
  71. lttParams = {"voltageClass":ltsoVolLevel,"company":unitId,"status":"1","beginTime":beginTime,"endTime":endTime} ;
  72. sotParams = {"voltageClass":ltsoVolLevel,"company":unitId,"status":"1","beginTime":beginTime,"endTime":endTime} ;
  73. }
  74. if(statF != ""){
  75. ltfParams = {"voltageClass":ltsoVolLevel,"company":unitId,"status":"0","beginTime":beginTime,"endTime":endTime} ;
  76. sofParams = {"voltageClass":ltsoVolLevel,"company":unitId,"status":"0","beginTime":beginTime,"endTime":endTime} ;
  77. }
  78. if(statT == "" && statF == ""){
  79. ltfParams = {"voltageClass":ltsoVolLevel,"company":unitId,"beginTime":beginTime,"endTime":endTime} ;
  80. sofParams = {"voltageClass":ltsoVolLevel,"company":unitId,"beginTime":beginTime,"endTime":endTime} ;
  81. lttParams = {"voltageClass":ltsoVolLevel,"company":unitId,"beginTime":beginTime,"endTime":endTime} ;
  82. sotParams = {"voltageClass":ltsoVolLevel,"company":unitId,"beginTime":beginTime,"endTime":endTime} ;
  83. }
  84. }
  85. var reclose = statT + statF + "";
  86. if(reclose=="10")
  87. reclose = "" ;
  88. var gridParams = {"listId":'411',"vollevel":ltsoVolLevel,"dept":unitId,"BEGINTIME":beginTime,"ENDTIME":endTime} ;
  89. var lostParams = {"listId":'411',"vollevel":ltsoVolLevel,"dept":unitId,"BEGINTIME":beginTime,"ENDTIME":endTime,"RECLOSE":reclose} ;
  90. window.parent.window.searchLtSo(lttParams, ltfParams, sotParams, sofParams,gridParams,lostParams) ;
  91. } ;
  92. var dateSkin="blue";
  93. function initComplete(){
  94. //获取当前主题风格,用于设置日期控件的皮肤
  95. try {
  96. dateSkin=themeColor;
  97. }catch(e){}
  98. //自定义点击触发日期控件
  99. document.getElementById('beginTimeLtso').onfocus=function(){
  100. var endtimeTf=$dp.$('endTimeLtso');
  101. WdatePicker({
  102. skin:dateSkin,onpicked:function(){endtimeTf.focus();},maxDate:'#F{$dp.$D(\'endTimeLtso\')}'
  103. });
  104. } ;
  105. document.getElementById('endTimeLtso').onfocus=function(){
  106. //这里设置了最大日期为当前日期,如果不需要则把maxDate:'%y-%M-%d'去掉
  107. WdatePicker({skin:dateSkin,minDate:'#F{$dp.$D(\'beginTimeLtso\')}'});
  108. };
  109. } ;
  110. /**
  111. * 时间格式化
  112. * @returns {String}
  113. */
  114. function getNowFormatDate(){
  115. var date = allGetServerTime() ;
  116. return date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate() + " " +
  117. date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds() ;
  118. } ;
  119. /**
  120. *
  121. * @returns {___anonymous4966_4967}
  122. */
  123. function resolveUrl(){
  124. var encondeCondition=window.location.search;
  125. var condition= decodeURI(encondeCondition.substring(1,encondeCondition.length));
  126. var conditionArr=condition.split("&");
  127. var condJson={};
  128. for(var item in conditionArr){
  129. var temArr=conditionArr[item].split("=");
  130. condJson[temArr[0]]=temArr[1];
  131. }
  132. return condJson;
  133. } ;