
var cst=2035;var oxe="DefaultF_";var dcxCreatorUrl="http://localhost:88";var $PublishList=null;var Publish_TimeOut=null;var IsAuto=false;$(document).ready(function(){});$(window).load(function(){});var dcxObj=null;var timeObj=null;var $myIframe=null;var dfdfdfdf=6767;var IsCanUpdate=false;var $ckbAllObj=null;var IsCopyingApp=false;var IsDesigning=false;var searchIsFromTree=false;if(ymr(DcxTree["T2084_31"]))DcxTree["T2084_31"]={};DcxTree.ptq=function(a,b,c,d,e,f,g,h,i,j,k){if(a==2084){var a=2084;var b='ListR_';searchIsFromTree=true;IsCanUpdate=true;$("li[areaid=55]").show()}}
function tys(a,b,c,d,e){var f=2084;var g='ListR_';if(searchIsFromTree){if(ymr($ckbAllObj))$ckbAllObj=$("#ckb_CheckAll"+g+""+f+"");var h=xch(f,g);h.children().find("input[issyscheck=1]").attr("checked",true);searchIsFromTree=false}}
function fed(w,x,y){if(IsDesigning){art.VLdialog.alert("<span style=\"font-size:16px;\">正在发布，请等待！ </span>",function(){},12,"提示");return false}
var z=2084;var A='ListR_';var B=xch(z,A);var C=new Array();if(w<1&&y==2){C=vrh(z,A)}else{if(w<1){var D=mwu(x,z,A);w=parseInt($.trim(D.find("[isfield=1][fieldname='EntId']").text()),10);if(isNaN(w)||w<1){art.VLdialog.alert("<span style=\"font-size:16px;\">获取应用Id失败！ </span>",function(){},12,"提示");return false}}
C.push(w+"")}
if(ymr(C)||C.length<1){art.VLdialog.alert("<span style=\"font-size:16px;\">请选择需要设计的应用！ </span>",function(){},12,"提示");return false}
w=parseInt(C[0],10);if(isNaN(w)||w<1){art.VLdialog.alert("<span style=\"font-size:16px;\">请选择需要设计的应用！ </span>",function(){},12,"提示");return false}
if(y==3){var E=-1;var F=-1;var G=-1;var H=-1;w=parseInt(w,10);var I=null;var x=null;var J="/WebServices/Entity/Entity_Run.asmx/GetEntityAndMenuList";$.ajax({type:"POST",contentType:"application/json; charset=utf-8",url:J,async:false,data:"{EntId:"+w+"}",dataType:'json',beforeSend:function(a){},complete:function(a,b){},error:function(a){alert("获取应用失败。详情："+JSON2.stringify(a));return false},success:function(a){x=hmy(a)}});if(!ymr(x)){if(!ymr(x.entList)){for(var i=x.entList.length-1;i>-1;i--){if(w==x.entList[i].EntId){I=x.entList[i];break}}}
if(ymr(I)){art.VLdialog.alert("<span style=\"font-size:16px;\">无法找到本应用，编辑失败！ </span>",function(){},112,"提示");return false}
if(I.IsDesigning!=true||isNaN(I.SSystemId)||I.SSystemId<1||isNaN(I.SEntId)||I.SEntId<1){art.VLdialog.alert("<span style=\"font-size:16px;\">本应用还没加入开发平台，无法进入开发平台进行编辑，编辑失败！ </span>",function(){},112,"提示");return false}
E=I.SEntId;F=-1;G=I.SSystemId;H=I.MenuId;if(!ymr(x.menuList)&&x.menuList.length>0){for(var i=x.menuList.length-1;i>-1;i--){if(x.menuList[i].MenuId==H){F=x.menuList[i].SMenuId;break}}}
var K=window.open(dcxCreatorUrl+"/Designer/main.html?systemid="+G+"&entid="+E+"&menuid="+F,"dcxMain")}else art.VLdialog.alert("<span style=\"font-size:16px;\">获取应用时失败！详细报告："+x.ErrorMsg+" </span>",function(){},112,"提示");return true}
var L=0;var M=true;B.children().each(function(){var a=$(this).find("input[issyscheck=1]:first");if(a.attr("checked")==true){var b=parseInt($(this).find("span[isfield=1][fldid=170]").text(),10);if(L==0)L=b;if(L!=b){M=false;return false}}});if(!M){art.VLdialog.alert("<span style=\"font-size:16px;\">您一次只能发布一个网页内的应用，请重新选择！ </span>",function(){},12,"提示");B.children().find("input[issyscheck=1]").attr("checked",false);return false}
if(y==1)IsCopyingApp=false;else IsCopyingApp=true;var J="/WebServices/Entity/Entity_Run.asmx/GetEntityAndMenuList";$.ajax({type:"POST",contentType:"application/json; charset=utf-8",url:J,data:"{EntId:"+w+"}",dataType:'json',beforeSend:function(a){},complete:function(a,b){},error:function(a){alert("获取应用失败。详情："+JSON2.stringify(a));return false},success:function(a){a=hmy(a);if(!ymr(a)){var b="";var c="";var d=-1;var e=true;var f=-1;var g=a.entList;var h=a.entList[0].SSystemId;var j=-1;if(!ymr(a.entList)){for(var i=a.entList.length-1;i>-1;i--){var k=false;for(var l=a.entList.length-1;l>-1;l--){if(parseInt(C[l],10)==a.entList[i].EntId){k=true;break}}
if(k){if(a.entList[i].IsDesigning==true&&y==1){art.VLdialog.alert("<span style=\"font-size:16px;\">应用“"+a.entList[i].EntName+"”已经加入，无需重新加入！ </span>",function(){},12,"提示");return false}
if((a.entList[i].IsDesigning!=true||y==2)&&a.entList[i].ParentId<1){c=c+a.entList[i].EntId+",";f=a.entList[i].MenuId;j=a.entList[0].MenuId}}}}
if(ymr(c)||c.length<1){art.VLdialog.alert("<span style=\"font-size:16px;\">请选择应用！ </span>",function(){},12,"提示");return false}
var m=a.menuList;if(!ymr(a.menuList)&&a.menuList.length>0){for(var i=a.menuList.length-1;i>-1;i--){if(a.menuList[i].IsDesigning!=true||(y==2&&i==0)){b=b+a.menuList[i].MenuId+"#"+a.menuList[i].SystemId+","}else d=a.menuList[i].SMenuId;if(j<1)a.menuList[i].MenuId}}
if(ymr(b)||b.length<1){b="-1#"+h}else{b=b.substr(0,b.length-1);f=-1}
if(!ymr(c)&&c.length>0){c=c.substr(0,c.length-1)}
a={"MenuIds":b,"EntIds":c,"ParentMenuId":d,"CreatePrtCldMenu":true,"SMenuId":f,"IsCopyApp":IsCopyingApp};var a=escape(JSON2.stringify(a));var n=dcxCreatorUrl+"/Designer/Ajax/AddToDcxCreator.aspx?entId="+w;var o="dcxSumbitForm";var p="dcxSumbitIframe2";var q="<iframe src='javascript:false' name='"+p+"' id='"+p+"' style='width: 94%; height: 100%; border: 0px none;' frameborder='0' allowtransparency='true'></iframe>";dcxObj=art.VLdialog({title:'加入开发端',content:q,width:"640px",height:"350px",button:[{name:'关   闭',callback:function(){return true},focus:true}]});n=dcxCreatorUrl+"/Designer/Ajax/AddToDcxCreator.aspx?entId="+w;var r=$("#"+p);r.parent().css({"width":"100%","height":"100%"});var s=$('<form  action="" method="POST" name="'+o+'" id="'+o+'" enctype="multipart/form-data"></form>');s.attr('action',n);s.attr('method','POST');s.attr('target',p);s.css('position','absolute');s.css('top','-1200px');s.css('left','-1200px');s.attr('encoding','multipart/form-data');var t=$('<input type="hidden" name="dcxSumbitHide" id="dcxSumbitHide" value="" />');t.val(a).appendTo(s);var u=document.location.href;var v=u.replace("//","df021f(");v=v.split("/");if(v.length<2)v=u;else v=v[0];v=v.replace("df021f(","//");t=$('<input type="hidden" name="dcxSumbitHref" id="dcxSumbitHref" value="" />');t.val(escape(v)).appendTo(s);t=$("<input type='submit' value='确认' style='display:none;'>");t.appendTo(s);r.after(s);$myIframe=r;s.submit();IsDesigning=true;timeObj=setInterval(rjp,1000)}else art.VLdialog.alert("<span style=\"font-size:16px;\">获取内容失败！详细报告："+a.ErrorMsg+" </span>",function(){},12,"提示")}})}
function rjp(){try{if($myIframe!=null&&$myIframe.get(0).contentWindow.ReturnIsOk){clearInterval(timeObj);var c={};var d=$myIframe.get(0).contentWindow.reVal;d=d.split("&^&");c.MenuCount=-1;if(!isNaN(d[0]))c.MenuCount=parseInt(d[0],10);c.AppCount=-1;if(!isNaN(d[1]))c.AppCount=parseInt(d[1],10);c.DbTableCount=-1;if(!isNaN(d[2]))c.DbTableCount=parseInt(d[2],10);c.TreeCount=-1;if(!isNaN(d[3]))c.TreeCount=parseInt(d[3],10);c.NewMenu=null;if(!ymr(d[4]))c.NewMenu=eval("("+d[4]+")");c.NewEnt=null;if(!ymr(d[5]))c.NewEnt=eval("("+d[5]+")");c.NewDbTable=null;if(!ymr(d[6]))c.NewDbTable=eval("("+d[6]+")");c.NewTree=null;if(!ymr(d[7]))c.NewTree=eval("("+d[7]+")");var e={dcxObj:c,IsCopy:IsCopyingApp};var f="/WebServices/Publish/Publish.asmx/UpdateCopyedApps";$.ajax({type:"POST",contentType:"application/json; charset=utf-8",url:f,data:JSON2.stringify(e),dataType:'json',beforeSend:function(a){},complete:function(a,b){},error:function(a){alert("获取应用失败。详情："+JSON2.stringify(a));return false},success:function(a){IsDesigning=false;IsCopyingApp=false;a=hmy(a);if(a.IsOK){art.VLdialog.Succeed("成功加入！",function(){},499,"提示")}else{art.VLdialog.alert(a.ErrorMsg,function(){},499,"提示")}}})}}catch(ex){}}
function dpa(){window.top.open("/Designer/MyInformation/EditMyMsg.aspx?EntId=1903&mkfv=&optype=2&navindex=1",'dddsdsdsdsdd')}