123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127 |
- var deptName = resolveUrl().dept_id;
- function resolveUrl(){
- var encondeCondition=window.location.search;
- var condition= decodeURI(decodeURI(encondeCondition.substring(1,encondeCondition.length)));
- var conditionArr=condition.split("&");
- var condJson={};
- for(var item in conditionArr){
- var temArr=conditionArr[item].split("=");
- condJson[temArr[0]]=temArr[1];
- }
- userInfo = condJson;
- return condJson;
- };
- var myCols1 = [{
- display : '0-10kW(台)',
- "name" : 'content_min',
- minWidth : 60,
- width : "12%",render:showMsg
- }, {
- display : '11-50kW(台)',
- "name" : 'content_mid',
- minWidth : 60,
- width : "12%",render:showMsg
- }, {
- display : '51kW及以上(台)',
- "name" : 'content_max',
- minWidth : 60,
- width : "12%",render:showMsg
- }];
- var myCols2 = [{
- display : '可调用(台)',
- "name" : 'kused',
- minWidth : 60,
- width : "10%",render:showMsg
- }, {
- display : '不可调用(台)',
- "name" : 'bused',
- minWidth : 60,
- width : "10%",render:showMsg
- }];
- var columns = [
- { display : '供电局',"name" : 'name',id : 'name',width : "20%",dept_id:'dept_id',align : 'center',render: addStatus , frozen: true},
-
- { display : '按容量分类(台)',columns : myCols1,width : "40%",align : 'center' },
- { display : '按可否调用分类(台)',columns : myCols2,width : "40%",align : 'center' },
- { display: '总数量(台)', name: 'num', width: "10%", align: 'center' },
- { display: '总容量(kW)', name: 'sum', width: "10%", align: 'center' }
- ];
- var json ="";
- var loadData;
- /*************************************************** 初始化方法 **********************************************************/
- $(function(){
- $("body").eq(0).showLoading();
-
- $.post($.pathname()+ "/ws/generator/GeneratorService/getGeneratorStatistics",{id : deptName},function (data){
- json = data;
- //给表格数据赋值
- loadData= data;
- //初始化表格
- initCompletes(json);
- $("body").eq(0).hideLoading();
-
- },"json" );
-
- });
-
-
- function initCompletes(json){
- g = $("#maingrid").quiGrid({
- columns: columns,
- data:json,
- rownumbers : true,
- usePager : false
- });
-
- //重设高度
- // $(parent.document.body).find("iframe").height($(window.document.body).height()+30);
- // $(top.document.body).find("iframe").height($(window.document.body).height()+30);
-
- }
-
- function addStatus(rowdata, rowindex, value, column){
- var comp_id='"'+rowdata.dept_id+'"';
- var name = '"'+value+'"';
- return "<a href='javascript:newHtml("+comp_id+","+name+")'>" + value +" </a>";
- }
- function newHtml(comp_id,name){
- if(name=="总计"){
- return;
- }else if(deptName==comp_id){
- return;
- }else{
- window.open("/nwyj/page/business/am/resource/ledger/generator-poll1.jsp?"+comp_id);
- // window.location.href = "/nwyj/page/business/am/resource/expert/expert-poll.jsp?"+comp_id;
- // alert(comp_id);
- }
-
- }
- function showMsg(rowdata ,rowindex,value,column){
- return '<a href="javascript:void(0)" '
- + 'onclick=showDetail("'
- + rowdata.dept_id
- + '",'+'"'+column.name+ '",'+'"'+value+'")>'+value+'</a>';
- }
- function showDetail(index,name,val){
- if(index=="11111"){
- return;
- }
- return top.Dialog.open({URL:"/nwyj/page/business/am/resource/ledger/windowgenerator1.jsp?"+index+"?"+name,ID:"window1",Title:"发电机",ShowMaxButton:true,ShowMinButton:true,Width:1100,Height:500});
- }
- $.messager=top.Dialog;
|