
var Pls={};var cst=2036;var oxe="DefaultF_";var wmq=null;var $SystemKey=null;var $DcxUserName=null;var Dsg={};var isOvering=false;var $curmodl=null;$(window).load(function(){Dsg.Areas=null;if(Dcx.Utility.IsLogined("登陆到运行端","",true)){Dsg.DcxUrl=Dcx.Utility.dwf();Dsg.MenuId=jre("menuId",-1);Dsg.EntId=jre("EntId",-1);$SystemKey=$("input[FieldName='SystemKey']:first");$DcxUserName=$("input[FieldName='DcxUserName']:first");$("body",window.document);var m="dcxReturnMsg";var n="<iframe src='javascript:false' name='"+m+"' id='"+m+"' style='width:0; height:0; border: 0px none;display:none;position:absolute;left:-1111;top:-9999px;' frameborder='0' allowtransparency='true'></iframe>";var o=$(n);var p=o.get(0);if(p.attachevent){p.attachevent("onload",function(){Dsg.LoadIsOk=true})}else{p.onload=function(){Dsg.LoadIsOk=true}}
$("body",document).append(o);Dsg.$iframe=$("#"+m);var q="dcxSumbitForm";var r=$('<form  action="" method="POST" name="'+q+'" id="'+q+'" style="position:absolute;left:12px;top:809px;z-index:20002;display:none;" enctype="multipart/form-data"></form>');r.attr('method','post');r.attr('target',m);r.attr('encoding','multipart/form-data');$hide=$("<input type='submit' value='确认' style='display:none;'>");$hide.appendTo(r);Dsg.$iframe.after(r);Dsg.$form=r;var s="<div style=\"position: absolute;top:0px;left:0px;z-index:99999;width:840px;height:34px;display:none;padding:0px;\" class=\"dcxDesignerTool\" id=\"dcxDesignerTool\">\n";s=s+"<a style=\"float: left;clear:none;\" id=\"btn_ahy\" class=\"f_hot_op_bt f_hot_op_bt5 \" onclick=\"javascript:ahy(this);\" href=\"javascript:void(0);\"><span class=\"op_bt_i\">创建应用</span></a> \n";s=s+"<a style=\"float: left;clear:none;\" id=\"btn_zwb\" class=\"f_hot_op_bt f_hot_op_bt5 \" onclick=\"javascript:zwb(this);\" href=\"javascript:void(0);\"><span class=\"op_bt_i\">创建从应用</span></a> \n";s=s+"<a style=\"float: left;clear:none;\" id=\"btn_nny\" class=\"f_hot_op_bt f_hot_op_bt5 \" onclick=\"javascript:nny(this);\" href=\"javascript:void(0);\"><span class=\"op_bt_i\">创建同级应用</span></a> \n";s=s+"<a style=\"float: left;clear:none;\" id=\"btn_yac\" class=\"f_hot_op_bt f_hot_op_bt5\" onclick=\"javascript:yac(this);\" href=\"javascript:void(0);\"><span class=\"op_bt_i\">进入设计器</span></a>\n";s=s+"<a style=\"float: left;clear:none;\" id=\"btn_oyu\" class=\"f_hot_op_bt f_hot_op_bt5 \" onclick=\"javascript:oyu(this);\" href=\"javascript:void(0);\"><span class=\"op_bt_i\">表单设计器</span></a>\n";s=s+"<a style=\"float: left;clear:none;\" id=\"btn_aof\" class=\"f_hot_op_bt f_hot_op_bt5 \" onclick=\"javascript:aof(this);\" href=\"javascript:void(0);\"><span class=\"op_bt_i\">明细设计器</span></a>\n";s=s+"<a style=\"float: left;clear:none;\" id=\"btn_muq\" class=\"f_hot_op_bt f_hot_op_bt5 \" onclick=\"javascript:muq(this);\" href=\"javascript:void(0);\"><span class=\"op_bt_i\">导出设计器</span></a>\n";s=s+"</div>\n";$("body",document).append("<div id=\"bgOverlay\" style=\"display:none;filter:alpha(opacity=40);   opacity: 0.4; -webkit-animation: opacity_4 0.25s ease; position: fixed; top: 0px; left: 0px; width: 100%; height: 100%; background-color: rgb(0, 0, 0); z-index: 99998; background-position: ltoial ltoial; background-repeat: ltoial ltoial;\"></div>");$("body",document).append(s);Dsg.$bg=$("#bgOverlay");Dsg.$tool=$("#dcxDesignerTool");var t=$.browser.msie?"mouseover":"mouseover";var u=$.browser.msie?"mouseleave":"mouseout";var v=function(){isOvering=true};var w=function(){isOvering=false;setTimeout(function(){if(!isOvering){Dsg.$bg.hide();Dsg.$tool.hide()}},100)};Dsg.$bg.unbind(t).bind(t,function(){v()}).unbind(u).bind(u,function(){w()});Dsg.$tool.unbind(t).bind(t,function(){if(!$curmodl.hasClass("tmpl-container-hover"))$curmodl.addClass("tmpl-container-hover");v()}).unbind(u).bind(u,function(){if($curmodl.hasClass("tmpl-container-hover"))$curmodl.removeClass("tmpl-container-hover");w()});Dsg.$tmpls=$("div.tmpl-container");Dsg.$tmpls.each(function(){var l=$(this);l.unbind(t).bind(t,function(){v();$curmodl=$(this);if(!$curmodl.hasClass("tmpl-container-hover"))$curmodl.addClass("tmpl-container-hover");Dsg.$bg.width(l.width());Dsg.$bg.height(l.height());var a=xfx(l.get(0),"Left");var b=xfx(l.get(0),"Top");Dsg.$bg.css({"left":a+"px","top":b+"px"});var c=(b-14);if(c<1)c=2;Dsg.$tool.css({"left":a+"px","top":c+"px"});var d=parseInt(l.attr("menuId"),10);var e=parseInt(l.attr("entId"),10);var f=parseInt(l.attr("moduletypeId"),10);var g=parseInt(l.attr("tmplid"),10);var h=parseInt(l.attr("tplgroupid"),10);var i=parseInt(l.attr("tplareaid"),10);var j=lbj(f);if(ymr(e)||isNaN(e))e=-1;if(!isNaN(e)&&e>0&&(f==1||(f>5&&f<16))){Dsg.$tool.find("#btn_oyu").show();Dsg.$tool.find("#btn_aof").show();Dsg.$tool.find("#btn_muq").show()}else{Dsg.$tool.find("#btn_oyu").hide();Dsg.$tool.find("#btn_aof").hide();Dsg.$tool.find("#btn_muq").hide()}
if(isNaN(e)||e<1){Dsg.$tool.find("#btn_ahy").show();Dsg.$tool.find("#btn_zwb").hide();Dsg.$tool.find("#btn_nny").hide();Dsg.$tool.find("#btn_yac").hide()}else{Dsg.$tool.find("#btn_ahy").hide();Dsg.$tool.find("#btn_zwb").show();Dsg.$tool.find("#btn_nny").show();var k=Dsg.$tool.find("#btn_yac");k.show();k.find(".op_bt_i").html(j+"设计器")}
Dsg.$tool.attr("menuId",d).attr("entId",e).attr("moduletypeId",f).attr("tmplid",g).attr("tplgroupid",h).attr("tplareaid",i);Dsg.$tool.show()}).unbind(u).bind(u,function(){w();if($curmodl.hasClass("tmpl-container-hover"))$curmodl.removeClass("tmpl-container-hover")})})}});function nfq(a){var b=parseInt(a.attr("menuId"),10);var c=parseInt(a.attr("entId"),10);var d=parseInt(a.attr("moduletypeId"),10);var e=parseInt(a.attr("tmplid"),10);var f=parseInt(a.attr("tplgroupid"),10);var g=parseInt(a.attr("tplareaid"),10);if(ymr(c)||isNaN(c))c=-1;var h=parseInt(a.attr("ModuleId"),10);var i=parseInt(a.attr("MenuModuleId"),10);return{"menuId":b,"entId":c,"moduletypeId":d,"tmplid":e,"tplgroupid":f,"tplareaid":g,"moduleId":h,"menuModuleId":i}}
function zwb(a){var b=nfq(Dsg.$tool);window.open(Dsg.DcxUrl+"/Designer/SystemManage/CreateApp.aspx?lab="+b.menuId+"&mymentid="+b.entId+"&CurEntId="+b.entId+"&EntId=1837&mkfv=1&optype=1","dcx")}
function ahy(a){var b=nfq(Dsg.$tool);window.open(Dsg.DcxUrl+"/Designer/SystemManage/CreateApp.aspx?lab="+b.menuId+"&CurEntId="+b.entId+"&EntId=1837&mkfv=1&optype=1","dcx")}
function nny(a){var b=nfq(Dsg.$tool);window.open(Dsg.DcxUrl+"/Designer/SystemManage/CreateApp.aspx?lab="+b.menuId+"&CurEntId="+b.entId+"&EntId=1837&mkfv=1&optype=1","dcx")}
function oyu(a){var b=nfq(Dsg.$tool);var c=zly(b.moduletypeId);var d=nfn(b.entId,c);var e=xhj(b.menuId);if(!ymr(e)){var f=-1;var g=null;for(var i=0;i<e.length;i++){if(e[i].GroupId==b.tplgroupid){if(e[i].ModuleTypeId==3||e[i].ModuleTypeId==18){f=e[i].ModuleTypeId;g=e[i];break}}}
if(f>0){var h=lnz(-1,g.EntId,g.MenuId,-1,g.ModuleId,g.ModuleTypeId,d);window.open(Dsg.DcxUrl+h,"dcx")}}}
function aof(a){var b=nfq(Dsg.$tool);var c=zly(b.moduletypeId);var d=nfn(b.entId,c);var e=xhj(b.menuId);if(!ymr(e)){var f=-1;var g=null;for(var i=0;i<e.length;i++){if(e[i].GroupId==b.tplgroupid){if(e[i].ModuleTypeId==16||e[i].ModuleTypeId==19){f=e[i].ModuleTypeId;g=e[i];break}}}
if(f>0){var h=lnz(-1,g.EntId,g.MenuId,-1,g.ModuleId,g.ModuleTypeId,d);window.open(Dsg.DcxUrl+h,"dcx")}}}
function muq(a){var b=nfq(Dsg.$tool);var c=zly(b.moduletypeId);var d=nfn(b.entId,c);var e=lnz(-1,b.entId,b.menuId,-1,-1,22,d);window.open(Dsg.DcxUrl+e,"dcx")}
function yac(a){var b=nfq(Dsg.$tool);var c=zly(b.moduletypeId);var d=nfn(b.entId,c);var e=-1;if(b.moduletypeId==5){treeid=parseInt($curmodl.find("input[treeid]").attr("treeId"),10)}
var f=lnz(-1,b.entId,b.menuId,e,b.moduleId,b.moduletypeId,d);window.open(Dsg.DcxUrl+f,"dcx")}
function nfn(a,b){var c=null;try{c=col(a,b)}catch(err){c=ker(a,b)}
if(!ymr(c)){var d=c.EntMsg["E"+a];return d.EntName}
return""}
function zly(a){var b="";switch(a){case 1:b="ListR_";break;case 2:b="SearchF_";break;case 3:b="AjaxF_";break;case 4:b="View";break;case 5:b="Tree";break;case 6:b="GroupR_";break;case 7:b="CrossR_";break;case 8:b="GraphR_";break;case 9:b="TitleL_";break;case 10:b="SummaryL_";break;case 11:b="ImgSummyL_";break;case 12:b="BlockL_";break;case 13:b="GroupI_";break;case 16:b="MChildR_";break;case 17:b="ListF_";break;case 18:b="DefaultF_";break;case 19:b="DefaultR_";break};return b}
function lbj(a){var b="";switch(a){case 1:b="普通列表";break;case 2:b="搜索";break;case 3:b="高级表单";break;case 4:b="常用筛选";break;case 5:b="树";break;case 6:b="分组报表";break;case 7:b="交叉报表";break;case 8:b="图表报表";break;case 9:b="标题列表";break;case 10:b="摘要列表";break;case 11:b="图文列表";break;case 12:b="块列表";break;case 13:b="分组列表";break;case 16:b="明细报表";break;case 17:b="Excel式表单";break;case 18:b="标准表单";break;case 19:b="默认明细";break;case 22:b="导出";break};return b}
function lnz(a,b,c,d,e,f,g){var h="";if(!ymr(b)&&!isNaN(b))h+="&EntId="+b;if(!ymr(c)&&!isNaN(c))h+="&MenuId="+c;if(!ymr(d)&&!isNaN(d))h+="&TreeId="+d;if(!ymr(e)&&!isNaN(e))h+="&ModuleId="+e;if(!ymr(f)&&!isNaN(f))h+="&ModuleTypeId="+f;if(!ymr(a)&&!isNaN(a))h+="&TaskId="+a;if(!ymr(g))h+="&EntName="+escape(g);var i="";switch(f){case 19:i="/Designer/ReportDesigner/ReportDesigner.aspx?ListType=1"+h;break;case 16:i="/Designer/ReportDesigner/ReportDesigner.aspx?ListType=2"+h;break;case 1:i="/Designer/ReportDesigner/ReportDesigner.aspx?ListType=3"+h;break;case 9:i="/Designer/ReportDesigner/ReportDesigner.aspx?ListType=4"+h;break;case 12:i="/Designer/ReportDesigner/ReportDesigner.aspx?ListType=5"+h;break;case 10:i="/Designer/ReportDesigner/ReportDesigner.aspx?ListType=6"+h;break;case 11:i="/Designer/ReportDesigner/ReportDesigner.aspx?ListType=7"+h;break;case 18:i="/Designer/FormDesigner/FormDesigner.aspx?ListType=1"+h;break;case 3:i="/Designer/FormDesigner/FormDesigner.aspx?ListType=2"+h;break;case 17:i="/Designer/FormDesigner/FormDesigner.aspx?ListType=3"+h;break;case 2:i="/Designer/FormDesigner/FormDesigner.aspx?ListType=4"+h;break;case 4:i="/Designer/ReportDesigner/ViewDesigner.aspx?mkt=1"+h;break;case 5:i="/Designer/ReportDesigner/TreeDesigner.aspx?IsTree=1"+h;break;case 6:i="未开发";break;case 7:i="未开发";break;case 8:i="未开发";break;case 13:i="未开发";break;case 20:i="/Designer/SystemManage/CreateApp.aspx?lab="+c+"&CurEntId="+b+"&EntId=1837&mkfv=1&optype=1";break;case 21:i="未开发";break;case 22:i="/Designer/ReportDesigner/OutPutDesigner.aspx?ListType=4"+h;break;case 23:i="未开发";break;case 24:i="未开发";break}
return i}
function xhj(c){if(!ymr(Dsg.Areas))return Dsg.Areas;var d="/WebServices/Menu/MenuAppArea.asmx/GetArea_ByMenuId";$.ajax({type:"POST",contentType:"application/json; charset=utf-8",url:d,async:false,data:"{\"menuId\":"+c+"}",dataType:'json',success:function(a){a=hmy(a);Dsg.Areas=a},beforeSend:function(a){},complete:function(a,b){},error:function(a){var b=JSON2.stringify(a);if(b.length>600)b=b.substr(0,600);alert("操作失败。详情："+b);return false}});return Dsg.Areas}
function trl(){var c="/WebServices/Publish/Publish.asmx/htvSetMsg";$.ajax({type:"POST",contentType:"application/json; charset=utf-8",url:c,data:"{}",dataType:'json',success:function(a){a=hmy(a);$SystemKey.val(a[1]);$DcxUserName.val(a[0]);pet(cst,oxe,2)},beforeSend:function(a){},complete:function(a,b){},error:function(a){var b=JSON2.stringify(a);if(b.length>600)b=b.substr(0,600);alert("操作失败。详情："+b);return false}})}
Pls.GetPlsMsg=trl;function itz(){window.open("http://www.dcxCreator.com/Designer/main.html","_blank")}
Pls.GoToMyDcxCreator=itz;function fww(){var c=yci(cst,oxe);var d=null;var e=col(cst,oxe);d=e.$form;if(d==null){art.VLdialog.alert("获取表单的HTML对象失败。请确认代码正确。",function(){},4,"提示");return}
var f=sme(d,false,cst,oxe,true,cst,c,true);if(ymr(f)||f==false){art.VLdialog.alert("获取表单数据失败。请确认输入是否正确。",function(){},4,"提示");return}
var g="/WebServices/Publish/Publish.asmx/SetPublishSetMsg";$.ajax({type:"POST",contentType:"application/json; charset=utf-8",url:g,data:"{DcxUserName:\""+f.DcxUserName+"\",SystemKey:\""+f.SystemKey+"\"}",dataType:'json',beforeSend:function(a){},complete:function(a,b){},error:function(a){var b=JSON2.stringify(a);if(b.length>600)b=b.substr(0,600);alert("操作失败。详情："+b);return false},success:function(a){a=hmy(a);if(a.IsOK){art.VLdialog.Succeed("保存成功！",function(){},20,"提示")}else art.VLdialog.alert("保存失败。详细原因："+a.ErrorMsg,function(){},8,"提示")}});return}
Pls.UpdatePlsMsg=fww;function jev(){art.VLdialog.open.api.close()}
Pls.piv=jev;