
var cst=2035;var oxe="DefaultF_";var DcxPls={};var $PublishList=null;var Publish_TimeOut=null;var IsAuto=false;$(document).ready(function(){$PublishLish=$("select[fieldname='PublishList']");$(".tag2_menu").find("li.nowtag").next().remove()});$(window).load(function(){gwz();if(!IsAuto)sck(false);window.setTimeout(function(){ild()},10000)});function tgs(a){sck(false)}
DcxPls.ReloadPls=tgs;function ild(a){if(IsAuto)return;if($PublishLish.find("option").length<1||$PublishLish.find("option:selected").val()=="-1"||$PublishLish.find("option:selected").val()==""){sck(true);return}else window.setTimeout(function(){ild()},5000);return}
DcxPls.RefreshPlsSelf=ild;function uro(c){var d=2035;var e="DefaultF_";var f=false;if($(c).attr("checked"))f=true;var g="/WebServices/Publish/Publish.asmx/Seturo";$.ajax({type:"POST",contentType:"application/json; charset=utf-8",url:g,data:"{Auto:"+f+"}",dataType:'json',beforeSend:function(a){},complete:function(a,b){},error:function(a){alert("获取发布失败。详情："+JSON2.stringify(a));return false},success:function(a){a=hmy(a);IsAuto=f;if(IsAuto){art.VLdialog.Succeed("<span style=\"font-size:16px;\">已进入“自动处理”状态！ </span>",function(){},2,"提示");ujs(false)}else{art.VLdialog.Succeed("<span style=\"font-size:16px;\">已进入“手工”状态！ </span>",function(){},2,"提示");window.setTimeout(function(){ild()},3000)}}})}
DcxPls.AutoDealWith=uro;function gwz(){var c=2035;var d="DefaultF_";var e="/WebServices/Publish/Publish.asmx/gwz";$.ajax({type:"POST",contentType:"application/json; charset=utf-8",url:e,async:false,data:"{}",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(a){IsAuto=true;ujs(false);$("#ckb_uro").attr("checked",true);art.VLdialog.alert("<span style=\"font-size:16px;\">已处于“自动处理”状态！ </span>",function(){},2,"提示")}else{$("#ckb_uro").attr("checked",false);IsAuto=false}}})}
DcxPls.IsAutoPls=gwz;function sck(c){var d=2035;var e="DefaultF_";var f="/WebServices/Publish/Publish.asmx/sck_Simple";$.ajax({type:"POST",contentType:"application/json; charset=utf-8",url:f,data:"{}",dataType:'json',beforeSend:function(a){},complete:function(a,b){},error:function(a){alert("获取发布失败。详情："+JSON2.stringify(a));return false},success:function(a){a=hmy(a);var b=new nzy();if(a!=null&&a.length>0){for(var i=0;i<a.length;i++){b.append("<option value=\""+a[i].Value+"\">"+a[i].Text+"</option>")}}else b.append("<option value=\"-1\">无发布</option>");$PublishLish.html(b.toString());htv();if(c)window.setTimeout(function(){ild()},5000)}})}
DcxPls.GetPlsList=sck;function htv(){var c=2035;var d="DefaultF_";var v=$PublishLish.find("option:selected").val();if(ymr(v)||v=="-1"){yyr(c,d,true);var e=new nzy();e.append("<option value=\"-1\">无发布</option>");$PublishLish.html(e.toString());return}
v=v.split("&");var f=v[0];var g=v[1];var h=v[2];var i="/WebServices/Publish/Publish.asmx/htv";$.ajax({type:"POST",contentType:"application/json; charset=utf-8",url:i,data:"{PublishId:\""+f+"\",ModuleTypeId:"+g+"}",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)){a.EditTime=cwi(a.EditTime);a.PublishTime=cwi(a.PublishTime);a.ReceiveTime=cwi(a.ReceiveTime);lwg(c,d,a,null,false,true)}}})}
DcxPls.GetOnePls=htv;function tyw(c){var d=2035;var e="DefaultF_";if(ymr(c)||c!=true)c=false;var v=$PublishLish.find("option:selected").val();if(ymr(v)||v=="-1"){art.VLdialog.alert("<span style=\"font-size:16px;\">没有可发布的内容。请进入<a href=\"http://www.dcxCreator.com\" target=\"_blank\" style=\"margin-left:7px;color:green;\">在线开发平台</a>，创建并发布新功能。</span>",function(){},12,"提示");return}
v=v.split("&");var f=v[0];var g=v[1];var h=v[3];var i="/WebServices/Publish/Publish.asmx/Publish";$.ajax({type:"POST",contentType:"application/json; charset=utf-8",url:i,data:"{PublishId:\""+f+"\",EntId:"+h+",ModuleTypeId:"+g+",Cancel:"+c+"}",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)&&a.IsOK){if(c)art.VLdialog.Succeed("<span style=\"font-size:16px;\">取消成功！ </span>",function(){},1,"提示");else art.VLdialog.Succeed("<span style=\"font-size:16px;\">发布成功！ </span>",function(){},1,"提示");if(ymr($PublishLish)||$PublishLish.length<1)$PublishLish=$("select[fieldname='PublishList']");var b=$PublishLish.find("option:selected");if(!ymr(b)&&b.length>0)b.remove();if($PublishLish.find("option").length<1||$PublishLish.find("option:selected").val()=="-1"||$PublishLish.find("option:selected").val()=="")sck(false);else htv()}else art.VLdialog.alert("<span style=\"font-size:16px;\">操作失败！详细报告："+a.ErrorMsg+" </span>",function(){},12,"提示")}})}
DcxPls.SumbitPls=tyw;function feh(){tyw(true)}
DcxPls.CancelPls=feh;function ujs(f){var g=2035;var h="DefaultF_";if(ymr(f))f=false;if(!IsAuto)return;var i="/WebServices/Publish/Publish.asmx/Publish_Top";$.ajax({type:"POST",contentType:"application/json; charset=utf-8",url:i,data:"{Cancel:"+f+"}",dataType:'json',beforeSend:function(a){},complete:function(a,b){window.setTimeout(function(){ujs(false)},3000)},error:function(a){alert("自动发布失败。详情："+JSON2.stringify(a));return false},success:function(a){{a=hmy(a)}
if(typeof(a)=="string")a=eval("("+a+")");if(a==null){return false}
if(!a.IsOK)art.VLdialog.alert("<span style=\"font-size:13px;\">"+a.ErrorMsg+"</span>",function(){},1222,"提示");else if(!ymr(a.ErrorMsg)){var b=a.ErrorMsg.split(",");var c="";var d=0;var e=0;if(b.length>0&&parseInt(b[0],10)>0){c="成功发布"+b[0]+"个功能模块";d=b[0]}
if(b.length>0&&parseInt(b[1],10)>0){c=(c.length>0?c+"，":c)+"有"+b[1]+"个模块发布失败，"+b[2];e=b[1]}
if(c.length>0&&(d>0||d>0))art.VLdialog.alert("<span style=\"font-size:13px;\">"+c+"</span>",function(){},3,"提示")}}})}
DcxPls.AutoDoHandle=ujs;