
DcxDoc.suk=function(){if(DcxDoc.$divDocList==null)DcxDoc.$divDocList=$("#divDocList");var c="/WebServices/MyApp/Document.asmx/suk";$.ajax({type:"POST",contentType:"application/json; charset=utf-8",url:c,data:"{groupId:"+DcxDoc.GroupId+", pageSize:"+DcxDoc.PageSize+", parentId:"+DcxDoc.ParentId+"}",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);a.List=DcxDoc.nte(a.List);if(!ymr(a)){DcxDoc.goz(a.List,1);DcxDoc.AllCount=a.MsgCount;DcxDoc.tmc(1)}else{}}})}
DcxDoc.nte=function(a){if((DcxDoc.ParentId==0||(DcxDoc.ParentId<0&&DcxDoc.GroupId==5))&&DcxDoc.PageIndex<2){if(ymr(a))a=new Array();a.splice(0,0,{"FileId":6,"FilePath":"","FileName":"私信","FileExt":"folder","GroupId":5,"FileTypeId":1,"IsCollect":false,"IsTop":false,"FileSize":6724,"ParentId":0});a.splice(0,0,{"FileId":7,"FilePath":"","FileName":"流程审批","FileExt":"folder","GroupId":5,"FileTypeId":1,"IsCollect":false,"IsTop":false,"FileSize":6724,"ParentId":0});a.splice(0,0,{"FileId":5,"FilePath":"","FileName":"微邮","FileExt":"folder","GroupId":5,"FileTypeId":1,"IsCollect":false,"IsTop":false,"FileSize":6724,"ParentId":0});a.splice(0,0,{"FileId":2,"FilePath":"","FileName":"微IM","FileExt":"folder","GroupId":5,"FileTypeId":1,"IsCollect":false,"IsTop":false,"FileSize":6724,"ParentId":0});a.splice(0,0,{"FileId":3,"FilePath":"","FileName":"微日记","FileExt":"folder","GroupId":5,"FileTypeId":1,"IsCollect":false,"IsTop":false,"FileSize":6724,"ParentId":0});a.splice(0,0,{"FileId":9,"FilePath":"","FileName":"图片收藏","FileExt":"folder","GroupId":5,"FileTypeId":1,"IsCollect":false,"IsTop":false,"FileSize":6724,"ParentId":0});a.splice(0,0,{"FileId":8,"FilePath":"","FileName":"我的文档","FileExt":"folder","GroupId":5,"FileTypeId":1,"IsCollect":false,"IsTop":false,"FileSize":6724,"ParentId":0})}
return a}
DcxDoc.czp=function(){var c={"groupId":DcxDoc.GroupId,"pageIndex":DcxDoc.PageIndex,"pageSize":DcxDoc.PageSize,"parentId":DcxDoc.ParentId};var d="pLists"+"";if(DcxDoc.GroupId>0)d="tLists";var e="/WebServices/MyApp/Document.asmx/czpList";$.ajax({type:"POST",contentType:"application/json; charset=utf-8",url:e,data:JSON2.stringify(c),dataType:'json',beforeSend:function(a){},complete:function(a,b){},error:function(a){var b=JSON2.stringify(a);if(b.length>6000)b=b.substr(0,6000);alert("读取我的文档失败。详情："+b);return false},success:function(a){a=hmy(a);a=DcxDoc.nte(a);DcxDoc.DataList[d]=a;DcxDoc.goz(a,1)}})}
DcxDoc.oea=function(c,d){var e={groupId:0,"fromDate":c,"toDate":d};var f="D"+c.getFullYear()+"_"+c.getMonth()+"_"+c.getDate()+"_"+d.getFullYear()+"_"+d.getMonth()+"_"+d.getDate();DcxDoc.$dlGroup.children().removeClass("active");DcxDoc.$dlGroup.children(":first").addClass("active");DcxDoc.GroupId=0;DcxDoc.$divDocList.children("div[istopMsg=1]").html("");var g="/WebServices/MyApp/Document.asmx/czpList2";$.ajax({type:"POST",contentType:"application/json; charset=utf-8",url:g,data:JSON2.stringify(e),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);a=DcxDoc.nte(a);if(ymr(a))a=new Array();DcxDoc.DataList[f]=a;DcxDoc.goz(a,1)}})}
DcxDoc.fvs=function(d,e){if(!isNaN(d)&&d<6){art.VLdialog.tips("此文件夹不允许删除！",2.8);return}
art.VLdialog.confirm('确定要删除吗？',function(){if(isNaN(d)||d<1)d=parseInt(fokMsg.attr("curValue"),10);if(isNaN(d)||d<1)return null;var c="/WebServices/MyApp/Document.asmx/DeleteDocument";$.ajax({type:"POST",contentType:"application/json; charset=utf-8",url:c,data:"{\"fileId\":"+d+"}",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(r){r=hmy(r);if(r.IsOK){art.VLdialog.tips("删除成功！",0.8);DcxDoc.$divDocList.find("[FileId="+d+"][isfile=1]").remove();DcxDoc.twv(d,"IsDeleted",true);return false}else{art.VLdialog.alert("删除失败。原因："+r.ErrorMsg,function(){},12,"提示")}}})},function(){art.VLdialog.tips('你取消了删除',0.8)})}
DcxDoc.rbd=function(c){if(isNaN(c)||c<1)c=parseInt(fokMsg.attr("curValue"),10);var d=DcxDoc.hrk(c,"IsTop");if(d==undefined||d==null)d=true;if(d=="1")d=false;else d=true;if(isNaN(c)||c<1)return null;var e="/WebServices/MyApp/Document.asmx/SetTop";var f=0;$.ajax({type:"POST",contentType:"application/json; charset=utf-8",url:e,data:"{fileId:"+c+",IsTop:"+d+"}",dataType:'json',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(r){r=hmy(r);if(r){art.VLdialog.tips("设置成功！",0.8);var a=DcxDoc.$divDocList.find("[FileId="+c+"][isMsg=1]");var b=a;if(d){b.find("[isTopHtml=1]").show()}else{b.find("[isTopHtml=1]").hide()}
DcxDoc.twv(c,"IsTop",d);return false}else{art.VLdialog.alert("设置失败。",function(){},12,"提示")}}})}
DcxDoc.cow=function(d,e){if(ymr(DcxEditor.zcw)){art.VLdialog.alert("IM加载失败，请刷新页面重新发送。",function(){},12,"提示");return false}
var f={"msgContent":null,"divDocList":null};f.msgContent=DcxEditor.rtg();f.divDocList=DcxEditor.divDocList;if(ymr(f.msgContent)){if(!ymr(DcxEditor.divDocList)&&DcxEditor.divDocList.length>0){f.msgContent="";var g=false;var h=false;for(var i=0;i<DcxEditor.divDocList.length;i++){if(DcxEditor.divDocList[i].IsImg==true)g=true;else h=true}
if(g)f.msgContent=f.msgContent+"上传图片";if(h){if(g)f.msgContent=f.msgContent+",";f.msgContent=f.msgContent+"上传附件"}}else{var j=xfx(d,"Left")-200;var k=xfx(d,"Top")-200;art.VLdialog.tips("请输入内容！",1.8,j,k);return false}}
DcxEditor.sec("");var l="/WebServices/MyApp/Document.asmx/SendMsg";$.ajax({type:"POST",contentType:"application/json; charset=utf-8",url:l,data:JSON2.stringify(f),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(ymr(a)){art.VLdialog.tips("保存失败！",5);return}
if(!a.IsOK){art.VLdialog.tips(a.ErrorMsg,4);return}
var b=new Array();var c={};c.DyContent=f.msgContent;c.FileId=a.NewId;c.CreateDate=new Date();c.FileJson=a.ErrorMsg;b.push(c);DcxDoc.$divDocList.children("div[ismsglist=1]").prepend(DcxDoc.sly(b));DcxEditor.olh();if(DcxDoc.GroupId>0){DcxDoc.DataList["tLists"].splice(0,0,c)}else{DcxDoc.DataList["pLists"].splice(0,0,c)}
art.VLdialog.tips("保存成功！",1)}})}
DcxDoc.aka=function(){if(DcxEditor.jst==true)return;if(ymr(DcxEditor.FileList)||DcxEditor.FileList.length<1){art.VLdialog.alert("您还没上传文件。",function(){},12,"提示");return false}
var d=DcxDoc.ParentId;if(d<6)d=0-d;var e={"parentId":d,"fileList":null};e.fileList=DcxEditor.FileList;var f="/WebServices/MyApp/Document.asmx/AddDocuments";$.ajax({type:"POST",contentType:"application/json; charset=utf-8",url:f,data:JSON2.stringify(e),dataType:'json',beforeSend:function(a){DcxEditor.jst=true},complete:function(a,b){DcxEditor.jst=false},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(ymr(a)){art.VLdialog.tips("上传失败！",5);return}
var b=new nzy();if(ymr(DcxDoc.DataList["pLists"]))DcxDoc.DataList["pLists"]=new Array();for(var i=0;i<a.length;i++){DcxDoc.DataList["pLists"].push(a[i]);b.append(DcxDoc.sly2(a[i]))}
var c=DcxDoc.$divDocList.children("div[ismsglist=1]").find("ul[islist=1]");if(ymr(c)||c.length<1){DcxDoc.$divDocList.children("div[ismsglist=1]").html(DcxDoc.sly(DcxDoc.DataList["pLists"]))}else c.append(b.toString());art.VLdialog.tips("上传成功！",1);DcxEditor.olh()}})}
DcxDoc.mal=function(){if(ymr(DcxEditor.FileList)||DcxEditor.FileList.length<1){DcxEditor.olh();return false}
art.VLdialog.confirm('您已上传一些文件，确定要取消吗？',function(){var c={};var d="/WebServices/MyApp/Document.asmx/mal";$.ajax({type:"POST",contentType:"application/json; charset=utf-8",url:d,data:JSON2.stringify(c),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);DcxEditor.olh();if(ymr(a)){return}
if(!a){return}}})})}