| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095 | 
							- Namespace.register("U.MD.DK.VW"); //Disk视图操作命名空间
 
- //#region 追随设置
 
- /* 跟新追随信息
 
- * 
 
- * @param diskel {element}  网盘窗体元素
 
- * @param userid {string}   用户id
 
- **/
 
- U.MD.DK.VW.followState = function (diskel, userid) {
 
-     var _followbutton = $(".U_MD_DK_LIRS", diskel);
 
-     _followbutton.attr("user", userid);
 
-     if (userid == US.userInfo.userid) {
 
-         _followbutton[0].innerHTML = "本人";
 
-     }
 
-     else if (US.friend.friends && U.Json.select(US.friend.friends, { UserId: userid })[0]) {
 
-         _followbutton[0].innerHTML = "已追随";
 
-         _followbutton.addClass("U_MD_DK_LIRSED");
 
-     } else {
 
-         _followbutton[0].innerHTML = "追随";
 
-         _followbutton.removeClass("U_MD_DK_LIRSED");
 
-     }
 
- }
 
- /* 追随按钮点击事件
 
- * 
 
- **/
 
- U.MD.DK.VW.followState.click = function (button) {
 
-     var _userid = $(button).attr("user");
 
-     var _userinfo;
 
-     if (_userid == US.userInfo.userid) {
 
-         return;
 
-     } else if (US.friend.friends && (_userinfo = U.Json.select(US.friend.friends, { UserId: _userid })[0])) {
 
-         U.MD.F.M.deleteFriend(_userinfo, function () {
 
-             button.innerHTML = "追随";
 
-             $(button).removeClass("U_MD_DK_LIRSED");
 
-         });
 
-     } else {
 
-         U.A.Request(US.CD, [US.DB, "UseStudio_Users", "GetUserinfoByUserId", _userid], function (r) {//根据用户名获取用户信息
 
-             if (r.value && r.value[0]) {
 
-                 U.MD.F.M.addFriend(r.value[0], function () {
 
-                     button.innerHTML = "已追随";
 
-                     $(button).addClass("U_MD_DK_LIRSED");
 
-                 });
 
-             } else {
 
-                 U.Alert("用户信息有误,请稍后尝试...");
 
-             }
 
-         });
 
-     }
 
- }
 
- //#endregin
 
- //#region 目录文件打印
 
- /**
 
- * 打印网盘视图输出判断的地方 分为普通视图输出和详细视图输出
 
- * @param  {array}  需要输出的文件或者文件夹信息
 
- * @param  {element}  输出到那个区域
 
- **/
 
- U.MD.DK.VW.viewsSwitch = function (viewtype, diskinfo) {
 
-     var _contentel = $("#U_MD_DK_RZ", diskinfo.formel)[0], //内容元素
 
-         _viewnav = $(_contentel).prev()[0] //导航元素
 
-     ;
 
-     diskinfo.viewtype = _contentel.viewtype = viewtype; //视图
 
-     if (diskinfo.currentDirectoryFile.length) {
 
-         _contentel.innerHTML = ""; //先清空处理
 
-         U.MD.DK.VW.printContent(diskinfo.currentDirectoryFile, _contentel); //打印内容
 
-         //这里是普通视图处理
 
-         if (viewtype == "Normal") {
 
-             _contentel.style.width = ""; //普通视图不修改大小
 
-             _viewnav.style.display = "none";
 
-             _contentel.style.height = $(_contentel).Parent(2).offsetHeight - 79 + "px"
 
-         }
 
-         //详细视图处理
 
-         else {
 
-             U.MD.DK.VW.size(diskinfo); //详细视图的时候需要设置大小和样式,这里统一处理
 
-         }
 
-     }
 
- }
 
- /**
 
- * 根据时间排序
 
- * @param  {object}  用户网盘信息
 
- **/
 
- U.MD.DK.VW.SortView = function (diskinfo, type, cb) {
 
-     var _filesinfo = diskinfo.currentDirectoryFile, //用户展示在改文件夹下所有的文件
 
-         _contentel = $("#U_MD_DK_RZ", diskinfo.formel)[0]
 
-     ;
 
-     //判断文件是否存在,如果有打印文件,那么就进行文件的打印,否则不做任何处理
 
-     if (_filesinfo.length) {
 
-         //判断头两个文件的创建时间,进行排序处理
 
-         if (_filesinfo[0].UserDirectoryAddTime > _filesinfo[1].UserDirectoryAddTime) {
 
-             //文件降序处理
 
-             U.UF.Math.sequence(_filesinfo, type, cb, 1);
 
-         } else {
 
-             //文件升序处理
 
-             U.UF.Math.sequence(_filesinfo, type, cb, -1);
 
-         }
 
-         //重新打印内容
 
-         _contentel.innerHTML = "";
 
-         U.MD.DK.VW.printContent(_filesinfo, _contentel); //打印
 
-     }
 
- }
 
- /**
 
- * 打印网盘视图输出判断的地方 分为普通视图输出和详细视图输出
 
- * @param  {array}  需要输出的文件或者文件夹信息
 
- * @param  {element}  输出到那个区域
 
- **/
 
- U.MD.DK.VW.printContent = function (filesinfo, el) {
 
-     var _diskinfo = US.disk.UserDisk, //用户网盘的数据
 
-         _viewtype = el.viewtype || "Normal", //打印的格式
 
-         _viewnav = $(el).prev()[0] //视图导航
 
-     ;
 
-     //判断是否有需要输出的文件信息
 
-     if (filesinfo.length) {
 
-         //打印的模式 这里是普通视图输出
 
-         if (_viewtype == "Normal") {
 
-             U.MD.DK.VW.printNormalView(filesinfo, el); //输出
 
-         }
 
-         //详细视图输出
 
-         else {
 
-             U.MD.DK.VW.printDetailedView(filesinfo, el); //详细视图输出
 
-         }
 
-     }
 
-     //如果还有输出的信息在div上面那么不输出空文件的提示
 
-     else if (!$(el).Child().length) {
 
-         U.MD.DK.VW.printNullView(el); //没有文件的时候样式输出
 
-     }
 
- }
 
- /**
 
- * 空文件提示信息输出
 
- * @param  {element}  输出到那个区域
 
- **/
 
- U.MD.DK.VW.printNullView = function (el) {
 
-     var _viewel,
 
-         _infoel,
 
-         _promptel,
 
-     _viewel = $$("div", { "className": "U_MD_DK_RZF" }, el);
 
-     _infoel = $$("div", { "className": "U_MD_DK_RZFS" }, _viewel);
 
-     $$("div", { "className": "U_MD_DK_RZTSL U_MD_DK_RZFSL", "innerHTML": "!" }, _infoel);
 
-     _promptel = $$("div", { "className": "U_MD_DK_RZFSR" }, _infoel);
 
-     //提示信息
 
-     _infoel = $$("div", { "className": "U_MD_DK_RZFSRS" }, _promptel);
 
-     $$("div", { "className": "U_MD_DK_RZFSRS", "innerHTML": "这地方暂时" }, _infoel);
 
-     $$("div", { "className": "U_MD_DK_RZFSRS", "innerHTML": " 没有资源哦。" }, _infoel);
 
-     $$("div", { "className": "U_MD_DK_RZTSRX U_MD_DK_RZFSRX", "innerHTML": "Nothing!!" }, _promptel);
 
- }
 
- /**
 
- * 普通视图打印
 
- * @param  {array}  需要输出的文件或者文件夹信息
 
- * @param  {element}  输出到那个区域
 
- **/
 
- U.MD.DK.VW.printNormalView = function (filesinfo, el) {
 
-     //变量定义区域
 
-     var i, //用于循环
 
-         _isencryp, //判断文件夹是否加密处理
 
-         _date, //文件当前使用时间
 
-         _icon, //获取文件的icon样式,包含多种
 
-         _imgicon, //打印给用户看到的文件类型对应的图标的样式,上面的是
 
-         _iconel, //图标元素
 
-         _imgeel, //输入给用户看到的元素
 
-         _infoel, //信息输出元素
 
-         _userimg, //用户头像
 
-         _frag = $$("frag"), //临时panel
 
-         _diskinfo = US.disk.UserDisk, //用户网盘信息
 
-         _userid = _diskinfo.userInfo.UserId //当前使用用户的id
 
-     ;
 
-     //逻辑输出区域
 
-     for (i = 0; i < filesinfo.length; i++) {
 
-         //获取文件的信息
 
-         _isencryp = (filesinfo[i]["UserDirectoryEncrypt"] && filesinfo[i]["UserDirectoryEncrypt"] != _userid); //判断文件夹是否是加密属性
 
-         _date = U.UF.D.formatDateToArray(filesinfo[i]["UserDirectoryAddTime"], "Array"); //获取文件的创建时间数组 返回值包含 [年, 月, 日]
 
-         _icon = U.MD.DK.C.getIcon(filesinfo[i].UserDirectoryExtendType); //根据文件扩展名,得到图标的样式
 
-         //创建一个文件夹图标或者文件图标。
 
-         _viewel = $$("div", {
 
-             "title": filesinfo[i]["UserallDirectoryName"],
 
-             "className": "U_MD_DK_RZO",
 
-             "id": "R" + (filesinfo[i].UserDirectoryID),
 
-             "onmousedown": function () {
 
-                 var _isindex = _diskinfo.selectElement.indexOf(this); //元素是否在多选元素的位置
 
-                 if (_isindex > -1) {
 
-                     U.UF.EV.stopBubble(); //onmousedown设置阻止冒泡
 
-                 }
 
-             },
 
-             "oncontextmenu": U.UF.C.closure(function (fileinfo) {
 
-                 U.UF.EV.stopBubble();
 
-                 U.UF.EV.stopDefault();
 
-                 U.MD.DK.RM.rightMenu(this, fileinfo, US.disk.UserDisk); //右键菜单
 
-             }, [filesinfo[i]])
 
-         }, _frag);
 
-         //设置点击事件
 
-         if (filesinfo[i].filetype == "1") { //普通文件的处理
 
-             _viewel.onclick = U.UF.C.closure(function (fileinfo) {
 
-                 U.MD.DK.LE.openFileDirectory(fileinfo, _userid);
 
-             }, [filesinfo[i]]);
 
-         }
 
-         else { //文件夹的处理,文件夹的处理这里加一个前进后退的添加
 
-             _viewel.onclick = U.UF.C.closure(function (fileinfo) {
 
-                 U.MD.DK.LE.openFileDirectory(fileinfo, _userid);
 
-             }, [filesinfo[i]]);
 
-         }
 
-         //图标处理
 
-         _imgicon = "";
 
-         _iconel = $$("div", { "className": "U_MD_DK_RZOA" }, _viewel);
 
-         //文件夹处理
 
-         if (filesinfo[i].filetype != 1) {
 
-             //加密的处理
 
-             if (_isencryp) {
 
-                 _imgicon = "U_MD_DK_Img U_MD_DK_RZOM";
 
-             }
 
-             //未加密的处理
 
-             else {
 
-                 _imgicon = "U_MD_DK_Img U_MD_DK_RZOW";
 
-             }
 
-         }
 
-         //根据上面根据类型获取的图标输出图标样式
 
-         else if (_icon.classname[1]) {
 
-             _imgicon = "U_MD_DK_Img " + _icon.classname[1];
 
-         }
 
-         _imgeel = $$("div", { "className": "U_MD_DK_RZOS " + _imgicon }, _iconel);
 
-         //如果图标是空图标,给空图标写入后缀名
 
-         if (_icon.name == "文件") {
 
-             $$("div", { "className": "U_MD_DK_RZOSZ", "innerHTML": filesinfo[i].UserDirectoryExtendType || "" }, _imgeel);
 
-         }
 
-         else if (!_icon.classname[1]) {
 
-             $$("img", { "onerror": U.MD.C.imgError,
 
-                 "onerror": function () {
 
-                     U.MD.C.imgError(this, 1);
 
-                 },
 
-                 "title": "点击查看",
 
-                 "src": U.MD.C.getHeadImage(filesinfo[i].UserDirectoryUrl)
 
-             }, _imgeel);
 
-         }
 
-         //目录名输出
 
-         _infoel = $$("div", { "className": "U_MD_DK_RZOZO" }, _iconel);
 
-         $$("div", { "className": "U_MD_DK_RZOZ", "innerHTML": filesinfo[i]["UserallDirectoryName"] }, _infoel);
 
-         //大小
 
-         _infoel = $$("div", { "className": "U_MD_DK_RZOFXJ U_MD_D_Text_Abbreviation" }, _infoel);
 
-         $$("span", { "className": "U_MD_DK_RZOFXJO", "innerHTML": _date[0] + "-" + _date[1] + "-" + _date[2] }, _infoel);
 
-         $$("span", { "className": "U_MD_DK_RZOFXJT", "innerHTML": U.UF.UP.minUnitToMaxUnit(filesinfo[i]["UserDirectorySize"]) }, _infoel);
 
-         //线面输入文件归属用户的信息 头像和名字
 
-         _infoel = $$("div", { "className": "U_MD_DK_RZOF" }, _viewel);
 
-         _infoel = $$("div", { "className": "U_MD_DK_RZOFD" }, _infoel);
 
-         _userimg = $$("div", { "className": "U_MD_DK_RZOFDI" }, _infoel);
 
-         //用户头像输出
 
-         $$("img", { "onerror": U.MD.C.imgError,
 
-             "onerror": U.MD.C.imgError, "title": "点击查看",
 
-             "src": U.MD.C.getHeadImage(filesinfo[i].UserThumbnailImageHead),
 
-             "onclick": function () {
 
-                 U.UF.EV.stopBubble(); U.MD.U.V.ViewOtherUserInfo(filesinfo[i].UserId);
 
-             }
 
-         }, _userimg);
 
-         //归属用户名输出
 
-         $$("div", { "className": "U_MD_DK_RZOFDN U_MD_D_Text_Abbreviation", "innerHTML": filesinfo[i].UserNickName || filesinfo[i]["UserallDirectoryName"] }, _infoel);
 
-     }
 
-     //追加元素
 
-     $(el).append(_frag); // , 0, el.firstChild
 
- }
 
- /**
 
- * 详细视图输出
 
- * @param  {array}  需要输出的文件或者文件夹信息
 
- * @param  {element}  输出到那个区域
 
- **/
 
- U.MD.DK.VW.printDetailedView = function (filesinfo, el) {
 
-     //变量定义区域
 
-     var i, //用于循环
 
-         _isencryp, //判断文件夹是否加密处理
 
-         _date, //文件当前使用时间
 
-         _icon, //获取文件的icon样式,包含多种
 
-         _iconandnameel, //图标和名字展示的区域
 
-         _ischecked = false, //判断文件是否给选中
 
-         _userimg, //用户头像
 
-         _frag = $$("frag"), //临时panel
 
-         _userid = US.disk.UserDisk.userInfo.UserId //当前使用用户的id
 
-     ;
 
-     //逻辑输出区域
 
-     for (i = 0; i < filesinfo.length; i++) {
 
-         //获取文件的信息
 
-         _isencryp = (filesinfo[i]["UserDirectoryEncrypt"] && filesinfo[i]["UserDirectoryEncrypt"] != _userid); //判断文件夹是否是加密属性
 
-         _date = U.UF.D.formatDateToArray(filesinfo[i]["UserDirectoryAddTime"]); //获取文件的创建时间数组 返回值包含 [年, 月, 日]
 
-         _icon = U.MD.DK.C.getIcon(filesinfo[i].UserDirectoryExtendType); //根据文件扩展名,得到图标的样式
 
-         //创建一个文件夹图标或者文件图标。
 
-         _viewel = $$("div", { "title": filesinfo[i]["UserallDirectoryName"], "className": "U_MD_DK_RZS U_MD_DK_RZXO", "id": "R" + (filesinfo[i].UserDirectoryID) }, _frag);
 
-         //设置右键按钮的处理
 
-         _viewel.oncontextmenu = function () {
 
-             U.UF.EV.stopBubble();
 
-             U.MD.DK.RM.rightMenu(_viewel, filesinfo[i], US.disk.UserDisk);
 
-         };
 
-         _viewel.onmousedown = function () {
 
-             var _isindex = _diskinfo.selectElement.indexOf(this); //元素是否在多选元素的位置
 
-             if (_isindex > -1) {
 
-                 U.UF.EV.stopBubble(); //onmousedown设置阻止冒泡
 
-             }
 
-         }
 
-         //设置点击事件
 
-         _viewel.onclick = U.UF.C.closure(function (fileinfo) {
 
-             U.MD.DK.LE.openFileDirectory(fileinfo, _userid);
 
-         }, [filesinfo[i]]);
 
-         _iconandnameel = $$("div", { "className": "U_MD_DK_RZSO", "style": { "marginLeft": "0px"} }, _viewel);
 
-         //多选的按钮设置
 
-         $$("input", { "className": "U_MD_DK_RZSOI",
 
-             "checked": _ischecked,
 
-             "type": "checkbox",
 
-             "onclick": function () {
 
-                 U.UF.EV.stopBubble();
 
-                 U.MD.DK.VW.checkFile(this);
 
-             }
 
-         }, _iconandnameel);
 
-         _iconandnameel = $$("div", { "className": "U_MD_DK_RZSM U_MD_D_Text_Abbreviation" }, _viewel);
 
-         //设置图标如果有图标设置图标,没有图标的是图片
 
-         if (_icon.classname[2]) {
 
-             $$("span", { "className": _icon.classname[2] + " U_MD_DK_RZSMI U_MD_DK_Img U_MD_D_Text_Abbreviation", "innerHTML": "      " }, _iconandnameel);
 
-         }
 
-         else {
 
-             $$("img", { "onerror": U.MD.C.imgError,
 
-                 "onerror": function () {
 
-                     U.MD.C.imgError(this, 1);
 
-                 },
 
-                 "title": "点击查看",
 
-                 "src": U.MD.C.getHeadImage(filesinfo[i].UserDirectoryUrl || (US.FILESYSTEMURL + filesinfo[i].UseFilesServerThumbnailName))
 
-             }, _iconandnameel);
 
-         }
 
-         //文件名 
 
-         $$("span", { "className": "U_MD_DK_RZSMN", "innerHTML": filesinfo[i]["UserallDirectoryName"] }, _iconandnameel);
 
-         //引用次数,暂时没有功能
 
-         $$("div", { "className": "U_MD_DK_RZSF U_MD_DK_RZSFO U_MD_D_Text_Abbreviation", "innerHTML": 0 }, _viewel);
 
-         //归属用户名字
 
-         $$("div", { "className": "U_MD_DK_RZSL U_MD_D_Text_Abbreviation", "innerHTML": filesinfo[i]["UserNickName"] }, _viewel);
 
-         //文件类别名字,如文件夹、图片等等
 
-         $$("div", { "className": "U_MD_DK_RZSX U_MD_D_Text_Abbreviation", "innerHTML": _icon.name }, _viewel);
 
-         //文件大小
 
-         $$("div", { "className": "U_MD_DK_RZSD U_MD_D_Text_Abbreviation", "innerHTML": U.UF.UP.minUnitToMaxUnit(filesinfo[i]["UserDirectorySize"]) }, _viewel);
 
-         //时间
 
-         $$("div", { "className": "U_MD_DK_RZST U_MD_D_Text_Abbreviation", "innerHTML": _date[0] + "-" + _date[1] + "-" + _date[2] + " " + _date[3] + ":" + _date[4] }, _viewel);
 
-     }
 
-     //追加元素
 
-     el.appendChild(_frag);
 
- }
 
- /**
 
- * 详细视图的大小变化使用
 
- * @param  {array}  需要输出的文件或者文件夹信息
 
- * @param  {element}  输出到那个区域
 
- **/
 
- U.MD.DK.VW.size = function (diskinfo) {
 
-     var i, j, k, //循环变量
 
-         _childel,
 
-         _size = [0.1, 0.2, 0.1, 0.15, 0.15, 0.15, 0.14], //详细视图每一格的大小
 
-         _contentel = $("#U_MD_DK_RZ", diskinfo.formel)[0], //内容元素
 
-         _contentchildel = $(_contentel).Child(), //内容的子元素
 
-         _navel = $(_contentel).prev()[0], //导航元素
 
-         _navchildel = $(_navel).Child(), //导航的子元素
 
-         _width = $(_contentel).width(), //获取编辑区域的长度
 
-         _height = $(_contentel).height() //获取编辑区域的高度
 
-     ;
 
-     _navel.style.display = "block"; //导航按钮出现
 
-     //视图格式处理,要满足有数据,没有数据不做任何处理
 
-     if (_contentel.viewtype === "Detailed" && diskinfo.currentDirectoryFile.length) {
 
-         for (i = 0; i < _size.length; i++) {
 
-             //导航按钮区域处理
 
-             for (j = 0; j < _navchildel.length; j += 2) {
 
-                 _navchildel[j].style.width = _width * _size[j / 2] + "px";  //导航按钮带下处理
 
-             }
 
-             //内容区域处理
 
-             for (j = 0; j < _contentchildel.length; j++) {
 
-                 _childel = $(_contentchildel).Child();
 
-                 for (k = 0; k < _childel.length; k++) {
 
-                     _childel[k].style.width = _width * _size[k] + "px";  //内容区域大小处理
 
-                 }
 
-             }
 
-         }
 
-         _navel.style.width = _width + "px"; //导航区域设置大小
 
-         _contentel.style.height = _height + "px";
 
-     }
 
- }
 
- /**
 
- * 全选文件
 
- * @param  {element}  输出到那个区域
 
- * @param  {string}  输出到那个区域
 
- **/
 
- U.MD.DK.VW.checkAllFile = function (el) {
 
-     var i,
 
-         _ischeck = el.checked, //选择的状态
 
-         _classname = "U_MD_DK_RZS U_MD_DK_RZXO" + (_ischeck ? " U_MD_DK_RZXOO" : ""), //选择或者取消选择的样式
 
-         _contentel = $($(el).Parent(2)).next()[0], //内容区域的元素
 
-         _childel = $(_contentel).Child() //所有输出的文件或者文件夹
 
-     ;
 
-     for (i = 0; i < _childel.length; i++) {
 
-         _childel[i].className = _classname; //样式处理
 
-         $("input", _childel[i])[0].checked = _ischeck; //选中状态
 
-     }
 
- }
 
- /**
 
- * 再详细视图下选择文件
 
- * @param  {element}  输出到那个区域
 
- * @param  {string}  输出到那个区域
 
- **/
 
- U.MD.DK.VW.checkFile = function (el) {
 
-     var _ischeck = el.checked; //获取文件是选择还是取消选择
 
-     //选择或者取消选择的处理
 
-     $(el).Parent(2).className = "U_MD_DK_RZS U_MD_DK_RZXO" + (_ischeck ? " U_MD_DK_RZXOO" : "");
 
- }
 
- //#endregion
 
- //#region 选择保存位置窗口
 
- /**
 
- * 选择文件保存位置窗口打印
 
- * @param postfix   {string} 文件后缀  文件类型
 
- * @param filename  {string} 文件名
 
- * @param callback  {function} 回调函数
 
- * @param formtitle {string} 窗体名称 
 
- * @param extendtype {string} 显示的文件属性
 
- **/
 
- U.MD.DK.VW.chosenSaveFile = function (postfix, fileid, filename, callback, formtitle, extendtype) {
 
-     if (!U.MD.U.L.isLogin()) {//是否登录
 
-         extendtype = extendtype || "folder"; //默认只显示文件夹
 
-         var _diskinfo = US.disk.Disks[US.userInfo.userid]; //获取当前登录用户的网盘信息
 
-         var _formel = $('#U_MD_DK_VW_ChosenSaveFile')[0]; //获取窗体元素
 
-         var _file; //定义变量
 
-         if (_formel) { //判断窗体是否存在
 
-             //存在则居中显示
 
-             U.UF.F.windowTopCenter(_formel);
 
-             //获取文件区域
 
-             _file = $('#U_MD_DK_VW_ChosenSaveFile_File')[0];
 
-             _file.innerHTML = "";
 
-             $('.U_MD_DK_VW_ChosenSaveFile button', _formel)[1].onclick = function () {
 
-                 U.MD.DK.VW.chosenSaveFile.ensure(_formel, $('.U_MD_DK_VW_ChosenSaveFile input', _formel)[0], postfix, fileid, callback);
 
-             }
 
-             $('.U_MD_DK_VW_ChosenSaveFile input', _formel)[0].value = "";
 
-         }
 
-         else {
 
-             var _box = $$('div', { style: { position: "relative", overflow: "hidden" }, "className": "U_MD_DK_VW_ChosenSaveFile" }); //创建文件区域容器
 
-             var _newfolder = $$('button', { style: { position: "absolute", right: "0", top: "2px" }, innerHTML: "新建文件夹" }, _box); //创建新建文件夹按钮
 
-             $$("div", { style: { "font-size": "16px", padding: "12px 10px 2px" }, innerHTML: "选择文件夹" }, _box); //创建标题
 
-             $$("hr", {}, _box); //创建分割线
 
-             _file = $$("div", { "className": "U_MD_DK_VW_ChosenSaveFile_File", id: "U_MD_DK_VW_ChosenSaveFile_File" }, _box); //创建文件区域
 
-             var _inputarea = $$('div', {}, _box); //创建填写文件名区域
 
-             $$('span', { 'innerHTML': '文件名:' }, _inputarea);  //标题
 
-             var _input = $$('input', { placeholder: filename || "请输入文件名...", style: { width: "89%", "text-indent": "5px", "line-height": "26px"} }, _inputarea); //文件名输入框
 
-             var _ensure = $$('button', { innerHTML: "确定" }, _box); //确定按钮
 
-             var _cancel = $$('button', { innerHTML: "取消" }, _box); //取消按钮
 
-             //创建窗体
 
-             _formel = new U.UF.UI.form(
 
-                                     "<span id='U_MD_DK_VW_ChosenSaveFile_Title'>" + (formtitle || "新建文件") + "</span>",
 
-                                      _box, {
 
-                                          "id": "U_MD_DK_VW_ChosenSaveFile",
 
-                                          "style": {
 
-                                              "width": "600px",
 
-                                              "height": "450px"
 
-                                          }
 
-                                      }).form;
 
-             //绑定新建文件夹事件
 
-             _newfolder.onclick = function () {
 
-                 U.MD.DK.VW.chosenSaveFile.newFolder();
 
-             }
 
-             //绑定确定按钮事件
 
-             _ensure.onclick = function () {
 
-                 U.MD.DK.VW.chosenSaveFile.ensure(_formel, _input, postfix, fileid, callback);
 
-             }
 
-             //取消函数
 
-             _cancel.onclick = function () {
 
-                 U.UF.F.windowMinimize(_formel);
 
-             }
 
-         }
 
-         //默认创建初始化目录
 
-         U.MD.DK.VW.chosenSaveFile.printFolder(_diskinfo.directoryOrFiles.slice(1, 8), _file, 0, ["U_MD_DK_LCD", "U_MD_DK_LCS", "U_MD_DK_LCD", "U_MD_DK_LCB", "U_MD_DK_LCF", "U_MD_DK_LCT", "U_MD_DK_LCP", "U_MD_DK_LCY"], _file, extendtype);
 
-     }
 
- }
 
- /**
 
- * 答应文件夹函数
 
- * @param data {array} 数据源
 
- * @param filearea {Element} 创建文件位置
 
- * @param deviant {int} 偏移值
 
- * @param iconclass {array} 文件图标class
 
- * @param extendtype {string} 显示的文件属性
 
- **/
 
- U.MD.DK.VW.chosenSaveFile.printFolder = function (data, filearea, deviant, iconclass, topfilearea, extendtype) {
 
-     extendtype = extendtype || "folder";
 
-     var i, //定义循环变量
 
-         _class; //定义样式记录属性
 
-     for (i = 0; i < data.length; i++) { //循环答应
 
-         _class = null;
 
-         if (extendtype == "*" || extendtype.indexOf(extendtype) > -1) { //判断文件类型为文件夹才打印
 
-             if ((iconclass || "").length) { //判断文件图片class是否有传入
 
-                 _class = iconclass[i] || iconclass; //设置样式名
 
-             } else if (data[i].UserDirectoryExtendType == extendtype || extendtype == "*") {  //判断其能否显示,是不是想要的文件类型
 
-                 switch (data[i].UserDirectoryExtendType) {
 
-                     case "folder":
 
-                         _class = "U_MD_DK_LCW"; //设置默样式名
 
-                         break;
 
-                     case "UW": case "txt": case "html": case "uw":
 
-                         _class = "U_MD_DK_LCB";
 
-                         break;
 
-                     case "jpg": case "png":
 
-                         _class = "U_MD_DK_LCT";
 
-                         break;
 
-                     case "mp4":
 
-                         _class = "U_MD_DK_LCP";
 
-                         break;
 
-                 }
 
-             }
 
-             if (_class) {     //判断其是否有样式,没有就不打印
 
-                 U.MD.DK.VW.chosenSaveFile.Print(data[i], filearea, deviant, _class, topfilearea, extendtype); //调用单个打印函数
 
-             }
 
-         }
 
-     }
 
- }
 
- /**
 
- * 打印文件夹函数
 
- * @param data {object} 数据源
 
- * @param filearea {Element} 创建文件位置
 
- * @param deviant {int} 偏移值
 
- * @param iconclass {string} 文件图标class
 
- * @param extendtype {string} 显示的文件属性
 
- **/
 
- U.MD.DK.VW.chosenSaveFile.Print = function (data, filearea, deviant, iconclass, topfilearea, extendtype) {
 
-     var _filediv, _fileel, _folder;  //设置变量
 
-     _folder = false;            //
 
-     if (data.UserDirectoryExtendType == "folder") {//判断文件是否是文件夹
 
-         _folder = true;
 
-     };
 
-     _filediv = $$('div', { "className": "U_MD_DK_VW_ChosenSaveFile_File_Box" }, filearea); //创建单个文件区域
 
-     _fileel = $$('div', {
 
-         id: data["UserDirectoryID"] ? "CS" + data["UserDirectoryID"] : "",
 
-         "className": "U_MD_DK_LTXOS",
 
-         style: { 'padding-left': deviant + 'px' },
 
-         onclick: U.UF.C.closure(function (directoryinfo, el) {  //设置点击事件
 
-             var _thisdate = data;
 
-             var _thisfolder = _folder;
 
-             U.UF.EV.stopBubble();
 
-             if (_thisfolder) {//判断点击的是否是文件夹
 
-                 //如果是文件夹,就打开文件夹
 
-                 U.MD.DK.VW.chosenSaveFile.forderClick(directoryinfo, el, topfilearea, extendtype);
 
-                 //并且在选择该文件夹
 
-                 if ($('.U_MD_DK_VW_ChosenSaveFileName')[0]) {
 
-                     $('.U_MD_DK_VW_ChosenSaveFileName')[0].value = data.UserallDirectoryName;
 
-                     $('.U_MD_DK_VW_ChosenSaveFileName')[0].data = data;
 
-                 }
 
-             } else {
 
-                 //不是文件夹就选择该文件
 
-                 if ($('.U_MD_DK_VW_ChosenSaveFileName')[0]) {
 
-                     $('.U_MD_DK_VW_ChosenSaveFileName')[0].value = data.UserallDirectoryName;
 
-                     $('.U_MD_DK_VW_ChosenSaveFileName')[0].data = data;
 
-                 }
 
-             }
 
-         }, [data, _filediv])
 
-     }, _filediv); //创建文件
 
-     if (_folder) {
 
-         $$('div', { className: "U_MD_DK_LTXOSI U_MD_DK_Img" }, _fileel); //创建文件角标
 
-     } else {
 
-         $$('div', { className: "U_MD_DK_LTXOSI" }, _fileel); //不创建文件角标
 
-     }
 
-     $$('div', { className: "U_MD_DK_LCOI U_MD_DK_LTXOST U_MD_DK_Img " + iconclass }, _fileel); //创建文件icon
 
-     $$('span', { innerHTML: data.UserallDirectoryName }, _fileel); //创建文件名
 
-     return _filediv; //返回创建的文件元素
 
- }
 
- /**
 
- * 文件夹展开关闭函数
 
- * @param directoryinfo {object} 文件夹信息
 
- * @param el {Element} 文件位置
 
- * @param extendtype {string} 显示的文件属性
 
- **/
 
- U.MD.DK.VW.chosenSaveFile.forderClick = function (directoryinfo, el, topfilearea, extendtype) {
 
-     var //_filearea = $('.U_MD_DK_VW_ChosenSaveFile_File')[0],  //获取文件区域
 
-         _folder = $(el).Child()[0], //获取每个文件
 
-         _deviant = parseInt(_folder.style.paddingLeft || 0) + 5; //计算偏移值
 
-     var _icon = $('.U_MD_DK_LTXOSI', _folder); //获取角标
 
-     $('.U_MD_DK_LTXOSO', topfilearea).removeClass('U_MD_DK_LTXOSO'); //清楚上一个选择的文件背景
 
-     $(_folder).addClass('U_MD_DK_LTXOSO'); //设置当前文件背景为选中
 
-     if (_icon.hasClass('U_MD_DK_LTXOSIO')) { //判断文件是否展开
 
-         //已展开
 
-         _icon.removeClass('U_MD_DK_LTXOSIO'); //清楚展开角标样式
 
-         var _nextlevel = $(_folder).next(); //判断是否加载了子文件夹
 
-         $(_nextlevel).remove(); //删除子文件夹
 
-     } else {
 
-         //未展开
 
-         _icon.addClass('U_MD_DK_LTXOSIO'); //添加角标打开class
 
-         if (directoryinfo.Child) { //判断是否已获取子文件数据
 
-             //已获取
 
-             U.MD.DK.VW.chosenSaveFile.printFolder(directoryinfo.Child, $$('div', {}, el), _deviant, null, null, extendtype); //打印子级文件夹
 
-         } else {
 
-             //未获取则去数据库获取
 
-             U.MD.DK.LE.getChildsByDirectoryId(US.userInfo.userid, directoryinfo, topfilearea, function () {
 
-                 //打印文件夹
 
-                 U.MD.DK.VW.chosenSaveFile.printFolder(directoryinfo.Child, $$('div', {}, el), _deviant, null, null, extendtype);
 
-             });
 
-         }
 
-     }
 
- }
 
- /**
 
- * 确定按钮函数
 
- * @param formel {object} 文件夹信息
 
- * @param input {Element} 文件名输入框
 
- * @param postfix {string} 文件后缀名
 
- * @param callback {function} 回调函数
 
- **/
 
- U.MD.DK.VW.chosenSaveFile.ensure = function (formel, input, postfix, fileid, callback) {
 
-     var _name = input.value; //获取文件名
 
-     if (_name.trim() == "") { //判断是否为空
 
-         return U.Alert('请填写文件名!');
 
-     }
 
-     //判断文件名是否符合规范
 
-     if (U.UF.S.ZWFileName.test(_name)) {
 
-         var _nowfile = $('.U_MD_DK_LTXOSO', formel)[0]; //获取当前选择的文件夹
 
-         if (!_nowfile) { //如果获取不到则为未选择
 
-             U.Alert('请选择文件夹新建的目录!'); //提示未选择文件
 
-         } else {
 
-             var _parentid = _nowfile.id.replace('CS', ''); //获取文件目录ID
 
-             var _userid = US.userInfo.userid; //获取用户ID
 
-             var _diskinfo = US.disk.Disks[_userid]; //获取用户网盘信息
 
-             var _dirinfo = U.Json.select(_diskinfo.directoryOrFiles, { UserDirectoryID: _parentid })[0]; //获取文件夹信息
 
-             if (!U.MD.DK.C.getDirectoryPermissions(_dirinfo.UserDirectoryID, _diskinfo).isnew) {
 
-                 return U.Alert(_dirinfo.Child.length ? '分类目录无法操作,请选择群文件或文件夹!' : '分类目录无法操作,请新建群或者选择其他群文件夹'); //提示未选择文件
 
-             }
 
-             //获取粘贴到制定目录的群id
 
-             _ancestors = U.MD.DK.C.getAncestors(_dirinfo, _diskinfo); //获取所有的祖先
 
-             //如果是ftp目录,那么groupid就是用户id
 
-             if (_ancestors[0].UserDirectoryID == US.FTPFOLDERID) {
 
-                 _groupid = _diskinfo.userInfo.UserId;
 
-             }
 
-             //否则就是对应的群id,如果不存在那么就是""
 
-             else {
 
-                 _groupid = _ancestors[0].GroupID || "";
 
-             }
 
-             var _newfileid = fileid || Guid.newGuid();
 
-             //去数据库添加文件
 
-             U.A.Request(US.DISK, ["CreateFile", _userid, _newfileid, _parentid, _name, "", "", "", postfix, _groupid], function (r) {
 
-                 //创建文件
 
-                 var _fileinfo = new U.MD.DK.M.entity(_newfileid, 0, _parentid, _name, _name, postfix, "", U.UF.D.toTimeStamp(), "", "9999", null, "", 1, "", _groupid, "", _userid, US.userInfo.UserNickName, US.userInfo.UserName, US.userInfo.UserThumbnailImageHead)
 
-                 U.MD.DK.RE.addFileOrFolder([_fileinfo], _diskinfo, _dirinfo); //添加到页面上中
 
-                 U.UF.F.windowMinimize(formel);
 
-                 //如果存在就执行
 
-                 if (U.UF.C.isFunction(callback)) {//判断是否有点击事件的方法,如果有,运行它
 
-                     callback(_fileinfo);
 
-                 }
 
-             }, []);
 
-         }
 
-     } else {
 
-         //不符合规范
 
-         U.Alert('请填写文件名符合规范!');
 
-     }
 
- }
 
- /**
 
- * 新建文件夹函数
 
- *
 
- **/
 
- U.MD.DK.VW.chosenSaveFile.newFolder = function () {
 
-     var _nowfile = $('.U_MD_DK_VW_ChosenSaveFile_File .U_MD_DK_LTXOSO')[0]; //获取当前选择的文件夹
 
-     if (!_nowfile) { //如果获取不到则为未选择
 
-         return U.Alert('请选择文件夹新建的目录!');  //提示未选择文件
 
-     }
 
-     var _userid = US.userInfo.userid;  //获取用户ID 
 
-     var _parentid = _nowfile.id.replace('CS', '');   //获取文件目录ID
 
-     var _diskinfo = US.disk.Disks[_userid]; //获取用户网盘信息
 
-     if (_diskinfo.directoryOrFiles[0].UserDirectoryID == _parentid || _diskinfo.directoryOrFiles[1].UserDirectoryID == _parentid || _diskinfo.directoryOrFiles[2].UserDirectoryID == _parentid) {//新建文件权限
 
-         U.Alert('该目录下无法新建文件夹,请重新选择目录!');
 
-     } else {
 
-         //创建新建文件名输入框
 
-         var _input = $$('input', { placeholder: "请输入文件夹名字...", style: { width: '180px', height: "25px", margin: "30px auto", display: "block", "text-indent": "5px"} });
 
-         //创建提示框
 
-         U.UF.UI.confirm(_input, function () {
 
-             //确定函数
 
-             var _name = _input.value; //获取输入文件夹名字
 
-             if (U.UF.S.ZWFileName.test(_name)) { //判断文件名是否符合规范
 
-                 var _dirinfo = U.Json.select(_diskinfo.directoryOrFiles, { UserDirectoryID: _parentid })[0]; //获取文件夹信息
 
-                 //获取粘贴到制定目录的群id
 
-                 _ancestors = U.MD.DK.C.getAncestors(_dirinfo, _diskinfo); //获取所有的祖先
 
-                 //如果是ftp目录,那么groupid就是用户id
 
-                 if (_ancestors[_ancestors.length - 1].UserDirectoryID == US.FTPFOLDERID) {
 
-                     _groupid = _diskinfo.userInfo.UserId;
 
-                 }
 
-                 //否则就是对应的群id,如果不存在那么就是""
 
-                 else {
 
-                     _groupid = _ancestors[_ancestors.length - 1].GroupID || "";
 
-                 }
 
-                 var _newfolderid = Guid.newGuid(); //随机生成文件夹ID
 
-                 //填写文件名符合规范  将文件夹以及文件夹名字保存到数据库
 
-                 U.A.Request(US.DISK, ["CreateDirectory", _userid, _newfolderid, _dirinfo.UserDirectoryDeep + 1, _name, _parentid, "", _groupid, ""], //保存到数据库
 
-                             function (r) {
 
-                                 //异步回调函数
 
-                                 var _nextlevel = $(_nowfile).next()[0] || $$('div', {}, $(_nowfile).Parent()); //获取或选择自己文件夹创建位置
 
-                                 var _fileinfo = new U.MD.DK.M.entity(_newfolderid, 0, _parentid, _name, _name, "folder", "", U.UF.D.toTimeStamp(), "", _dirinfo.UserDirectoryDeep + 1,
 
-                                                              null, "", 0, "", _groupid, "", _userid, US.userInfo.UserNickName, US.userInfo.UserName, US.userInfo.UserThumbnailImageHead); //创建本地文件信息
 
-                                 U.MD.DK.RE.addFileOrFolder([_fileinfo], _diskinfo, _dirinfo); //添加到页面上中
 
-                                 _filediv = U.MD.DK.VW.chosenSaveFile.Print(_fileinfo, _nextlevel, parseInt(_nowfile.style.paddingLeft || 0) + 6, "U_MD_DK_LCW"); //打印新建文件夹
 
-                                 _nextlevel.insertBefore(_filediv, $(_nextlevel).Child()[0]); //在最前方插入
 
-                             });
 
-             } else {
 
-                 //提示文件名不符合规范
 
-                 U.Alert('请填写文件名符合规范!');
 
-                 return false;
 
-             }
 
-         });
 
-     }
 
- }
 
- //#endregion
 
- //#region 保存到指定协同群窗口
 
- /**
 
- * 保存到指定协同群窗口
 
- *
 
- * @param postfix   {string}   文件后缀  文件类型
 
- * @param fileinfo  {object}   文件信息
 
- * @param filename  {string}   文件名
 
- * @param type      {string}   操作类型 move 移动 new 新建
 
- * @param callback  {function} 回调函数
 
- *
 
- **/
 
- U.MD.DK.VW.saveSynergy = function (postfix, fileinfo, filename, type, callback) {
 
-     if (!U.MD.U.L.isLogin()) {//是否登录
 
-         var _grouplistarr = US.disk.Disks[US.userInfo.userid]; //获取当前登录用户的网盘信息
 
-         var _formel = $('#U_MD_O_SaveSynergy')[0]; //获取窗体元素
 
-         var _grouplist; //定义变量
 
-         if (_formel) { //判断窗体是否存在
 
-             //存在则居中显示           
 
-             U.UF.F.windowTopCenter(_formel);
 
-             //获取文件区域
 
-             _grouplist = $('#U_MD_O_SaveSynergy_GroupList')[0];
 
-             _grouplist.innerHTML = "";
 
-             $('.U_MD_DK_VW_ChosenSaveFile button', _formel)[1].onclick = function () {
 
-                 U.MD.DK.VW.saveSynergy.ensure(_formel, $('.U_MD_DK_VW_ChosenSaveFile input', _formel)[0], postfix, fileinfo, type, callback);
 
-             }
 
-             $('.U_MD_DK_VW_ChosenSaveFile input', _formel)[0].value = "";
 
-         }
 
-         else {
 
-             var _box = $$('div', { style: { position: "relative", overflow: "hidden" }, "className": "U_MD_DK_VW_ChosenSaveFile" }); //创建文件区域容器
 
-             var _creategroup = $$('button', { style: { position: "absolute", right: "0", top: "-2px" }, innerHTML: "新建群", id: "U_MD_O_SaveSynergy_CreateGroup", onclick: 'U.MD.DK.VW.saveSynergy.swith()' }, _box); //创建新建文件夹按钮
 
-             $$("div", { style: { "font-size": "16px", padding: "6px 10px 7px" }, innerHTML: "群列表" }, _box); //创建标题
 
-             $$("hr", {}, _box); //创建分割线
 
-             var _newgroup = $$("div", { "className": "U_MD_DK_VW_ChosenSaveFile_File", id: "U_MD_O_SaveSynergy_NewGroup", style: { display: 'none', overflow: 'hidden'} }, _box); //创建文件区域
 
-             _grouplist = $$("div", { "className": "U_MD_DK_VW_ChosenSaveFile_File", id: "U_MD_O_SaveSynergy_GroupList" }, _box); //创建文件区域
 
-             var _inputarea = $$('div', {}, _box); //创建填写文件名区域
 
-             $$('span', { 'innerHTML': '文件名:' }, _inputarea);  //标题
 
-             var _input = $$('input', {
 
-                 placeholder: "请输入文件名...",
 
-                 value: filename == "未命名文档(点击编辑)..." ? "" : filename,
 
-                 //onfocus: "U.UF.MR.inputPlaceholder(this,'未命名文档(点击编辑)...','')",
 
-                 //onblur: "U.UF.MR.inputPlaceholder(this,'','未命名文档(点击编辑)...');",
 
-                 style: { width: "89%", "text-indent": "5px", "line-height": "26px" }
 
-             }, _inputarea); //文件名输入框
 
-             var _ensure = $$('button', { innerHTML: "确定" }, _box); //确定按钮
 
-             var _cancel = $$('button', { innerHTML: "取消" }, _box); //取消按钮
 
-             //创建窗体
 
-             _formel = new U.UF.UI.form(
 
-                                     "<span id='U_MD_O_SaveSynergy_Title'>" + (type == 'move' ? "将文档移动到" : "选择保存到") + "指定群</span>",
 
-                                      _box, {
 
-                                          "id": "U_MD_O_SaveSynergy",
 
-                                          "style": {
 
-                                              "width": "600px",
 
-                                              "height": "450px"
 
-                                          }
 
-                                      }).form;
 
-             //绑定确定按钮事件
 
-             _ensure.onclick = function () {
 
-                 U.MD.DK.VW.saveSynergy.ensure(_formel, _input, postfix, fileinfo, type, callback);
 
-             }
 
-             //取消函数
 
-             _cancel.onclick = function () {
 
-                 U.UF.F.windowMinimize(_formel);
 
-             }
 
-         }
 
-         //打印文件
 
-         U.MD.DK.VW.chosenSaveFile.printFolder(_grouplistarr.directoryOrFiles.slice(1, 3), _grouplist, 0, ["U_MD_DK_LCD", "U_MD_DK_LCS"]);
 
-         //默认切换 选择群状态
 
-         U.MD.DK.VW.saveSynergy.swith(true);
 
-     }
 
- };
 
- /**
 
- * 保存到指定协同群窗口 确定函数
 
- *
 
- * @param formel    {element}  窗体元素
 
- * @param input     {element}  文件名输入框
 
- * @param postfix   {string}   文件后缀  文件类型
 
- * @param fileinfo  {object}   文件信息
 
- * @param type      {string}   操作类型 move 移动 new 新建
 
- * @param callback  {function} 回调函数
 
- *
 
- **/
 
- U.MD.DK.VW.saveSynergy.ensure = function (formel, input, postfix, fileinfo, type, callback) {
 
-     var _name = input.value; //获取文件名
 
-     if (_name.trim() == "") { //判断是否为空
 
-         return U.Alert('请填写文件名!');
 
-     }
 
-     //判断文件名是否符合规范
 
-     if (U.UF.S.ZWFileName.test(_name)) {
 
-         var _dirinfo;
 
-         var _userid = US.userInfo.userid; //获取用户ID
 
-         var _diskinfo = US.disk.Disks[_userid]; //获取用户网盘信息
 
-         if ($('#U_MD_O_SaveSynergy_GroupList').css('display') == 'none') {
 
-             var _groupName = '协同文档群--' + new Date().getHours() + ":" + new Date().getMinutes(), //默认群名/也是文档名
 
-                 _groupDesc = "由" + US.userInfo.UserName + "发起的互联办公群组。";
 
-             U.MD.F.J.determineCreateGroupAndAddGroupUser(false, null, null, false, _groupName, _groupDesc, function (groupid) {
 
-                 _dirinfo = U.Json.select(_diskinfo.directoryOrFiles, { UserDirectoryID: groupid })[0]; //获取文件夹信息
 
-                 U.MD.DK.VW.saveSynergy.ensure.operate(formel, _dirinfo, fileinfo, groupid, groupid, type, postfix, _name, callback);
 
-             });
 
-         } else {
 
-             var _groupid, _parentid;
 
-             var _nowfile = $('.U_MD_DK_LTXOSO', formel)[0]; //获取当前选择的文件夹
 
-             _parentid = _nowfile.id.replace('CS', ''); //获取文件目录ID
 
-             _dirinfo = U.Json.select(_diskinfo.directoryOrFiles, { UserDirectoryID: _parentid })[0]; //获取文件夹信息
 
-             if (!U.MD.DK.C.getDirectoryPermissions(_dirinfo.UserDirectoryID, _diskinfo).isnew) {
 
-                 return U.Alert(_dirinfo.Child.length ? '分类目录无法操作,请选择群文件或文件夹!' : '分类目录无法操作,请新建群或者选择其他群文件夹'); //提示未选择文件
 
-             }
 
-             //获取粘贴到制定目录的群id
 
-             _ancestors = U.MD.DK.C.getAncestors(_dirinfo, _diskinfo); //获取所有的祖先
 
-             //如果是ftp目录,那么groupid就是用户id
 
-             if (_ancestors[0].UserDirectoryID == US.FTPFOLDERID) {
 
-                 _groupid = _diskinfo.userInfo.UserId;
 
-             }
 
-             //否则就是对应的群id,如果不存在那么就是""
 
-             else {
 
-                 _groupid = _ancestors[0].GroupID || "";
 
-             }
 
-             U.MD.DK.VW.saveSynergy.ensure.operate(formel, _dirinfo, fileinfo, _parentid, _groupid, type, postfix, _name, callback);
 
-         }
 
-     } else {
 
-         U.Alert('请填写文件名符合规范!');
 
-     }
 
- }
 
- /**
 
- * 执行对应操作函数
 
- *
 
- * @param formel    {element}  窗体元素
 
- * @param dirinfo   {object}   文件夹信息
 
- * @param fileinfo  {object}   文件信息
 
- * @param parentid  {string}   文件目录ID
 
- * @param groupid   {string}   群ID
 
- * @param type      {string}   操作类型 move 移动 new 新建
 
- * @param postfix   {string}   文件后缀  文件类型
 
- * @param name      {string}   文件名
 
- * @param callback  {function} 回调函数
 
- *
 
- **/
 
- U.MD.DK.VW.saveSynergy.ensure.operate = function (formel, dirinfo, fileinfo, parentid, groupid, type, postfix, name, callback) {
 
-     var _fileid = fileinfo.UserDirectoryID;
 
-     var _userid = US.userInfo.userid; //获取用户ID
 
-     var _diskinfo = US.disk.Disks[_userid]; //获取用户网盘信息
 
-     if (type == "move") {
 
-         var _pastecontent = US.disk.Disks[_userid].pasteDirOrFile = {
 
-             "type": "shear", //复制或者剪切 "copy" || "shear"
 
-             "UserDirectoryID": groupid, //在哪个目录复制或者剪切
 
-             "dirorfile": fileinfo, //复制的内容
 
-             "userid": _userid //用户id
 
-         }
 
-         U.A.Request(US.DISK, ["CutAndPasteFiles", fileinfo.UserId, groupid, fileinfo.UserDirectoryID, groupid, groupid],
 
-                         top.U.MD.DK.RE.asynPaste, ["", dirinfo, groupid, _pastecontent, _diskinfo]);
 
-         U.A.Request(US.DISK, ["UpdateFileInfo", _fileid, name], function () {
 
-             fileinfo.UserallDirectoryName = name; //文件全写的名字
 
-             fileinfo.UserDirectoryName = name.addEllipsis(20); //文件的缩略名
 
-             fileinfo.GroupId = fileinfo.UserDirectoryEncrypt = groupid;
 
-             //如果存在就执行
 
-             if (U.UF.C.isFunction(callback)) {//判断是否有点击事件的方法,如果有,运行它
 
-                 callback(fileinfo);
 
-             }
 
-             U.UF.F.windowMinimize(formel);
 
-         });
 
-     } else {
 
-         //去数据库添加文件
 
-         U.A.Request(US.DISK, ["CreateFile", _userid, _fileid, parentid, name, "", "", "", postfix, groupid], function (r) {
 
-             //创建文件
 
-             var _fileinfo = new U.MD.DK.M.entity(_fileid, 0, parentid, name, name, postfix, "", U.UF.D.toTimeStamp(), "", "9999", null, "", 1, "", groupid, "", _userid, US.userInfo.UserNickName, US.userInfo.UserName, US.userInfo.UserThumbnailImageHead)
 
-             U.MD.DK.RE.addFileOrFolder([_fileinfo], _diskinfo, dirinfo); //添加到页面上中
 
-             U.UF.F.windowMinimize(formel);
 
-             //如果存在就执行
 
-             if (U.UF.C.isFunction(callback)) {//判断是否有点击事件的方法,如果有,运行它
 
-                 callback(_fileinfo);
 
-             }
 
-             U.UF.F.windowMinimize(formel);
 
-         }, []);
 
-     }
 
- }
 
- /**
 
- * 选择群、新建群方式切换
 
- *
 
- * @param init    {boole}  是否为默认状态 选择群状态
 
- *
 
- **/
 
- U.MD.DK.VW.saveSynergy.swith = function (init) {
 
-     var _newgroup = $('#U_MD_O_SaveSynergy_NewGroup'); //新建群元素
 
-     var _grouplist = $('#U_MD_O_SaveSynergy_GroupList'); //群列表
 
-     var _creategroup = $('#U_MD_O_SaveSynergy_CreateGroup'); //按钮
 
-     if (_newgroup.css('display') == 'none' && !init) { //是否为新建群状态
 
-         _newgroup.css('display', 'block'); //新建群元素显示
 
-         _grouplist.css('display', 'none'); //选择群元素影藏
 
-         _creategroup[0].innerHTML = "返回群列表"; //修改按钮提示字
 
-         _creategroup[0].nextElementSibling.innerHTML = "选择联系人"; //修改标题
 
-         if (_newgroup.Child().length == 0) {  //判断初始化窗体是否打印
 
-             U.MD.DK.VW.saveSynergy.createGroupInit(); //未打印则执行打印
 
-         }
 
-         U.MD.DK.VW.saveSynergy.Friends(); //打印可选好友
 
-     } else {
 
-         _newgroup.css('display', 'none'); //新建群元素显隐藏
 
-         _grouplist.css('display', 'block'); //选择群元素显示
 
-         _creategroup[0].innerHTML = "新建群";  //修改按钮提示字
 
-         _creategroup[0].nextElementSibling.innerHTML = "群列表"; //修改标题
 
-     }
 
- }
 
- /**
 
- * 新建群区域初始化
 
- *
 
- **/
 
- U.MD.DK.VW.saveSynergy.createGroupInit = function () {
 
-     var _newgroup = $('#U_MD_O_SaveSynergy_NewGroup')[0];
 
-     var _left = $$('div', { style: { borderRight: "1px solid #ccc", position: "relative"} }, _newgroup);
 
-     var _right = $$('div', { style: { overflow: "hidden"} }, _newgroup);
 
-     var _count = $$('div', { style: { lineHeight: '30px' }, innerHTML: '已选择联系人:<span>1</span>' }, _right);
 
-     var _select = $$('div', { id: "U_MD_O_SaveSynergy_NewGroup_Select", style: { height: '265px', overflow: 'auto'} }, _right);
 
-     var _box = $$('div', { "className": 'U_MD_O_SaveSynergy_NewGroup_Friend', style: { paddingLeft: '5px'} }, _select);
 
-     $$('img', { "onerror": U.MD.C.imgError, src: U.MD.C.getHeadImage(US.userInfo.UserThumbnailImageHead) }, _box);
 
-     $$('span', { innerHTML: US.userInfo.UserNickName || US.userInfo.UserName }, _box);
 
- }
 
- /**
 
- * 打印好友列表
 
- *
 
- **/
 
- U.MD.DK.VW.saveSynergy.Friends = function () {
 
-     var i, _box, //定义变量
 
-         _friends = US.friend.friends;  //好友列表
 
-     var _child = $('#U_MD_O_SaveSynergy_NewGroup').Child();  //获取新建群区域的子级
 
-     var _friendel = _child[0]; //获取好友列表区域
 
-     var _countel = $('span', $(_child[1]).Child()[0])[0]; //获取选择计数元素
 
-     var _selectel = $("#U_MD_O_SaveSynergy_NewGroup_Select"); //获取选中好友列表
 
-     _friendel.innerHTML = ""; //清空好友列表
 
-     _countel.innerHTML = "1"; //设置默认选择人数为1 默认选择自己
 
-     U.MD.F.J.selectUserInfo.NeedUser = []; //清空选中全局
 
-     var _oldfriend = _selectel.Child(); //获取遗留选中好友
 
-     //清除遗留选中好友
 
-     for (i = 1; i < _oldfriend.length; i++) {
 
-         $(_oldfriend[i]).remove();
 
-     }
 
-     //如果存在好友
 
-     if (_friends.length > 0) {
 
-         //循环打印好友
 
-         for (i = 0; i < _friends.length; i++) {
 
-             //创建好友盒子
 
-             var _box = $$('div', { "className": 'U_MD_O_SaveSynergy_NewGroup_Friend', onclick: U.UF.C.closure(function (friendinfo) {
 
-                 U.MD.DK.VW.saveSynergy.Friends.Select(friendinfo, _selectel[0], _countel);
 
-             }, [_friends[i]]), friendid: _friends[i].FriendsID
 
-             }, _friendel);
 
-             //创建头像
 
-             $$('img', { "onerror": U.MD.C.imgError, src: U.MD.C.getHeadImage(_friends[i].UserThumbnailImageHead) }, _box);
 
-             //创建用户名 
 
-             $$('span', { innerHTML: _friends[i].UserNickName || _friends[i].UserName }, _box);
 
-         }
 
-     }
 
-     //如果不存在好友
 
-     else {
 
-         //创建提示字
 
-         $$('p', { style: { cssText: "font-weight: bold; font-size: 14px;padding-left:60px;padding-top:60px;" },
 
-             innerHTML: '您暂无添加好友,</br> 快去<span  style="cursor:pointer;color:rgb(41, 103, 167);" onclick="U.MD.F.S.popSearchFriendsOrGroupForm(0);">添加你的好友</span>吧。 </br>'
 
-         }, _friendel);
 
-         //创建刷新按钮
 
-         $$('span', { innerHTML: "已添加完好友点击刷新好友列表", onclick: function () {
 
-             U.UF.DL.loading(_friendel);
 
-             setTimeout(function () { U.MD.DK.VW.saveSynergy.Friends(); U.UF.DL.uploading(_friendel); }, 300);
 
-         }, style: { color: "red", cursor: "pointer", position: "absolute", bottom: "0px", fontSize: "12px" }
 
-         }, _friendel);
 
-     }
 
- }
 
- /**
 
- * 选择好友操作
 
- *
 
- * @param friendinfo  {object}   好友信息
 
- * @param selectel    {element}  选中好友列表区域
 
- * @param countel     {element}  计数元素
 
- *
 
- **/
 
- U.MD.DK.VW.saveSynergy.Friends.Select = function (friendinfo, selectel, countel) {
 
-     var i,  //定义变量
 
-         _isselect = U.Json.select(U.MD.F.J.selectUserInfo.NeedUser, { UserId: friendinfo.UserId })[0]; //判断是否已选中
 
-     if (!_isselect) { //如果未选中
 
-         countel.innerHTML = parseInt(countel.innerHTML) + 1; //计数+1
 
-         U.MD.F.J.selectUserInfo.NeedUser.push(friendinfo); //加入选中好友全局
 
-         //打印选择好友
 
-         var _box = $$('div', { "className": 'U_MD_O_SaveSynergy_NewGroup_Friend', style: { paddingLeft: '5px' }, onclick: function () {
 
-             $(this).remove();
 
-             U.Json.del(U.MD.F.J.selectUserInfo.NeedUser, { "UserId": friendinfo.UserId });
 
-             countel.innerHTML = parseInt(countel.innerHTML) - 1;
 
-         }
 
-         }, selectel);
 
-         //打印头像
 
-         $$('img', { "onerror": U.MD.C.imgError, src: U.MD.C.getHeadImage(friendinfo.UserThumbnailImageHead) }, _box);
 
-         //打印姓名
 
-         $$('span', { innerHTML: friendinfo.UserNickName || friendinfo.UserName }, _box);
 
-     }
 
- }
 
- /*  
 
- U.MD.DK.VW.choseFile
 
- 参数一:选择文件
 
- 参数二: 显示文件类型
 
-     
 
- */
 
- U.MD.DK.VW.choseFile = function (cb, type) {
 
-     var _diskinfo = US.disk.Disks[US.userInfo.userid]; //获取当前登录用户的网盘信息
 
-     var _formel = $('#U_MD_DK_VW_ChosenSaveFile')[0]; //获取窗体元素
 
-     var _file; //定义变量
 
-     type = type ? type : "*";       //默认为全部
 
-     if (_formel) { //判断窗体是否存在
 
-         //存在则居中显示
 
-         U.UF.F.windowTopCenter(_formel);
 
-         //获取文件区域
 
-         _file = $('#U_MD_DK_VW_ChosenSaveFile_File')[0];
 
-         _file.innerHTML = "";
 
-     }
 
-     else {
 
-         var _box = $$('div', { style: { position: "relative", overflow: "hidden" }, "className": "U_MD_DK_VW_ChosenSaveFile" }); //创建文件区域容器
 
-         var _newfolder = $$('button', { style: { position: "absolute", right: "0", top: "2px" }, innerHTML: "新建文件夹" }, _box); //创建新建文件夹按钮
 
-         $$("div", { style: { "font-size": "16px", padding: "12px 10px 2px" }, innerHTML: "文件名称" }, _box); //创建标题
 
-         $$("hr", {}, _box); //创建分割线
 
-         _file = $$("div", { "className": "U_MD_DK_VW_ChosenSaveFile_File", id: "U_MD_DK_VW_ChosenSaveFile_File" }, _box); //创建文件区域
 
-         var _inputarea = $$('div', {}, _box); //创建填写文件名区域
 
-         $$('span', { 'innerHTML': '文件名:' }, _inputarea);  //标题
 
-         var _input = $$('input', { "className": "U_MD_DK_VW_ChosenSaveFileName", placeholder: "请输入文件名...", style: { width: "89%", "text-indent": "5px", "line-height": "26px"} }, _inputarea); //文件名输入框
 
-         var _ensure = $$('button', { innerHTML: "确定" }, _box); //确定按钮
 
-         var _cancel = $$('button', { innerHTML: "取消" }, _box); //取消按钮
 
-         //创建窗体
 
-         _formel = new U.UF.UI.form(
 
-                                     "<span id='U_MD_DK_VW_ChosenSaveFile_Title'>选择文件</span>",
 
-                                      _box, {
 
-                                          "id": "U_MD_DK_VW_ChosenSaveFile",
 
-                                          "style": {
 
-                                              "width": "600px",
 
-                                              "height": "450px"
 
-                                          }
 
-                                      }).form;
 
-         //绑定新建文件夹事件
 
-         _newfolder.onclick = function () {
 
-             U.MD.DK.VW.chosenSaveFile.newFolder();
 
-         }
 
-         //绑定确定按钮事件
 
-         _ensure.onclick = function () {
 
-             cb($('.U_MD_DK_VW_ChosenSaveFileName')[0].data); //回调
 
-             U.UF.F.windowMinimize(_formel); //隐藏弹框
 
-             _input.value = "";          //清空显示
 
-             _input.data = null;         //清空数据
 
-         }
 
-         //取消函数
 
-         _cancel.onclick = function () {
 
-             U.UF.F.windowMinimize(_formel);
 
-         }
 
-     }
 
-     //默认创建初始化目录
 
-     U.MD.DK.VW.chosenSaveFile.printFolder(_diskinfo.directoryOrFiles.slice(1, 8), _file, 0, ["U_MD_DK_LCD", "U_MD_DK_LCS", "U_MD_DK_LCD", "U_MD_DK_LCB", "U_MD_DK_LCF", "U_MD_DK_LCT", "U_MD_DK_LCP", "U_MD_DK_LCY"], _file, type);
 
- }
 
- //#endregion
 
 
  |