Namespace.register("U.Dk.LL"); //Disk导航命名空间 //#region 导航 //分类导航和信息的切换 U.Dk.LL.SXWPDH = function (UDOD, TF) { var i, _UDAD = $($(UDOD).Parent(3)).Child(); for (i = 0; i < _UDAD.length; i++) { _UDAD[i].style.display = TF[i]; } } //导航点击 默认导航 (其实导航 没有树形分类的) U.Dk.LL.MRHYHWP = function (UDOD, UIE, userid) { var _UDE = U.Dk.DiskOperatingSwitch(userid)[1][0]; //转到个人使用网盘 if (!UIE && US.userInfo.userid != _UDE.UserId) { U.Alert("他人的私密空间无法查看"); return; } //私密地方必须本人操作 U.Dk.LE.RecordNav[[U.Dk.LL.ZMRHYHWP, [UDOD, UIE, userid]]]; //前进后退执行 } //执行导航 U.Dk.LL.ZMRHYHWP = function (UDOD, UIE, userid) { var i = UIE, _UGE = [], _UAE = [], _UDE = U.Dk.DiskOperatingSwitch(userid) || US.Disk.UserDisk, _UDTD = $(((_UDE[2] ? "#UD_SYWOCRC" : "#UD_SYWRZ")), _UDE.pdiv)[0], _UDAD = $(UDOD.parentNode).Child(); for (i = 0; i < _UDAD.length; i++) { _UDAD[i].className = "UD_SYWLCO" + (_UDAD[i] == UDOD ? " UD_SYWLCOA" : ""); $(_UDAD[i]).Child()[1].className = "UD_SYWLCN" + (_UDAD[i] == UDOD ? " UD_SYWLCNA" : ""); }; //#error 这里错误需要修改 U.Dk.LE.OpenFileDirectory(_UDE[0][UIE], _UGE.length > 1 ? { "UserDirectoryID": "", "UserallDirectoryName": "所有分享"} : _UGE[0], userid); _UDTD.onscroll = null; } /** * 导航打印(树导航) * @param {object} 左边一级层级树目录的相关信息 * @param {element} 输出到那个区域 * @param {array} 树目录的class样式数组 * @param {element} 树目录区域 * @param {str} 当前用户ID **/ U.Dk.LL.XWPDH = function (directorys, el, classes, pel, userid) { _directory = el || $$("div", { "className": "UD_SYWLTXO", "id": pel.id == "UD_SYWLTX" ? "UD_SYWLTXO" : "" }, pel); var i, _Img, _dtorydiv, _namediv, _UDFD = $$("frag"), _UPD = $((pel || $(_directory).Parent())).Child()[0].style.paddingLeft || 0; _UPD = _UPD == "" ? 3 : parseInt(_UPD) + 5; for (i = 0; i < directorys.length; i++) { if ((classes || "").length) { if (classes[i] == null) { _Img = classes[0]; } else { _Img = classes[i]; } } else { if ((directorys[i]["UserDirectoryEncrypt"] && directorys[i]["UserDirectoryEncrypt"] != userid)) { _Img = "UD_SYWLCJ"; } else { _Img = "UD_SYWLCW"; } } _dtorydiv = $$("div", { "id": directorys[i]["UserDirectoryID"] ? "L" + directorys[i]["UserDirectoryID"] : "", "className": "UD_SYWLTXOA" }, _UDFD); // $(_dtorydiv).addAttrArray({ "clickon": [[U.Dk.LE.RecordNav, ([[[U.Dk.LL.DXWPDH, ([directorys[i], _dtorydiv, [null, null, "none"], userid])]]])]] }); _namediv = $$("div", { "className": "UD_SYWLTXOS", "style": { "paddingLeft": _UPD + "px" }, "onclick": [[U.M.StopBubble], [U.Dk.LE.RecordNav, ([[[U.Dk.LL.DXWPDH, ([directorys[i], _dtorydiv, null, userid])]]])]], "onmousedown": [[U.Dk.RM.WPYJCD, (["this", directorys[i], null, null, userid])]] }, _dtorydiv); $$("div", { "className": "UD_SYWLTXOSI UD_SYID", "onclick": [[U.M.StopBubble], [U.Dk.LE.RecordNav, ([[[U.Dk.LL.DXWPDH, ([directorys[i], _dtorydiv, [null, true], userid])]]])]] }, _namediv); $$("div", { "className": "UD_SYWLCOI UD_SYWLTXOST UD_SYID " + _Img }, _namediv); $$("div", { "className": "UD_SYWLTXOSN UTDF", "innerHTML": directorys[i].UserallDirectoryName, "ondblclick": (classes && classes.length) ? U.M.apply() : [[U.M.StopBubble], [U.Dk.RE.WPCMM, (["this", directorys[i]])]] }, _namediv); } _directory.appendChild(_UDFD); return _directory; } //设置点击前进后退 // //* @param {callback} 回调函数,用于记录目录或者导航条前进后退的函数。 //* @returns {} 无 // U.Dk.LE.RecordNav = function (cb) { //如果是文件,则直接执行函数,否则设置目录的前进后退再回调。 var userid; userid = US.Disk.UserDisk[1][2]; // U.AFB.RGoL("Disk" + userid); U.AFB.AddEvent(cb, "Disk" + userid); //前进执行 } //最近访问区域查看 U.Dk.LL.ZJFWDJ = function (UDE, userid, UDOD) { if (UDE[1].Time) { //#error 这里错误 需要修改 U.Dk.LE.OpenFileDirectory(UDE[1].Time, { "UserallDirectoryName": "最近访问区域" }, UDE[1][2], true) } else { U.A.Request(US.CD, [US.DB, "UseStudio_Disk", "DirectoryAndFileSortByTime", UDE[1][2], 0, 100], U.Dk.LL.AsynZJFWDJ, [[UDOD, true], UDE, userid, UDOD]); // U.A.Request(US.Auth,"UseStudioDisk.GetNewByTime", [UDE[1][2], 0, 100], U.Dk.LL.AsynZJFWDJ, [[UDOD, true], UDE, userid, UDOD]); } } //添加最新访问异步 U.Dk.LL.AsynZJFWDJ = function (r) { var context = r.context, _UDE = context[1], _userid = context[2], _UDOD = context[3], _UGE = U.Dk.DiskOperatingSwitch(_userid); _UGE[1].Time = r.value; U.Dk.LL.ZJFWDJ(_UGE, _userid, _UDOD); } //导航点击处理 U.Dk.LL.DXWPDH = function (UDE, UDOD, UTF, userid) { var _UST, _UDID = UDE.UserDirectoryID; var i, _UGE, _UDS, _UDID = UDE.UserDirectoryID, _UDE = U.Dk.DiskOperatingSwitch((userid = userid || US.userInfo.userid)); if (_UDID == "22222222-2222-2222-2222-222222222222" || _UDID == "11111111-1111-1111-1111-111111111111") { U.Dk.LL.FCKDXWPDH(_UDID) } else { var _UDJ = U.D.SY.ET["Disk"]["SY"], _UDPD = $(_UDE[2] ? "#UD_SYWOCRC" : "#UD_SYWRZ", _UDE.pdiv)[0], _UDAD = $(UDOD).Child(), _UCE = [[_UDJ["DJ"]], [_UDAD[0], true]], _UDTD = _UDAD[1], _UAE = UDE.Child || _$(_UDE[0]).Select({ "UserDirectoryParentID": userid }), _UDS = " UD_SYWLTXOSIO", _UDSD = $("div", _UDAD[0])[0]; if (userid != US.userInfo.userid) { if (UDE.UserDirectoryID == US.userInfo) { _UST = "他人群文件无法查看"; } else if (UDE.UserDirectoryID == US.SG) { _UST = "他人的私密空间无法查看"; } if (_UST) { U.Alert(_UST); return; } } for (i = 0; i < _UCE.length; i++) { (_UCE[i][0]) && ($(_UCE[i][0])[_UCE[i][1] ? "addClass" : "removeClass"]("UD_SYWLTXOSO")); }; _UDPD.onscroll = null; _UDJ["DJ"] = _UDAD[0]; if (UDE.Child || _UDID == US.NU || _UDID == userid) { //无需加载 if (!UTF || !UTF[0]) { _UDS = (_UDSD.className.indexOf("UD_SYWLTXOSIO") > -1 || (UTF && UTF[3] == "none")) ? ["none", ""] : ((_UDTD && !$(_UDTD).Child().length) && ($(_UDTD).remove(), _UDTD = null), (!_UDTD) && (_UGE = _$(_UAE).Select({ "filetype": 0 }), _UDTD = U.Dk.LL.XWPDH(_UGE, _UDTD, null, UDOD, userid)), ["block", _UDS]); _UDTD.style.display = _UDS[0]; _UDSD.className = "UD_SYWLTXOSI UD_SYID" + _UDS[1]; } //导航打印 if (!UTF || !UTF[1]) { if (_UDID == userid) { (userid == US.userInfo.userid) && (_UDPD.innerHTML = "", U.Dk.VW.XWPDYH(US.Friend[2])); } else if (_UDID == US.NU) { U.Dk.LL.ZJFWDJ(_UDE, userid, _UDPD); } else { U.Dk.LE.OpenFileDirectory(UDE, userid); } } //文件显示 } else { U.Dk.RE.GXWPCKXS(userid, UDE, ((!UTF || !UTF[1]) && (_UDPD.innerHTML = "", true)) ? [_UDPD, true] : null, U.M.apply(null, [[U.Dk.LL.DXWPDH, [UDE, UDOD, UTF, userid]]])); } //获取目录 } } //如果是我的协同或者是他人邀请的 U.Dk.LL.FCKDXWPDH = function (UDID) { if (UDID == "22222222-2222-2222-2222-222222222222") { U.A.Request(US.CD, [US.DB, "UseStudio_Office", "GetCollaborativeDocument", US.userInfo.userid, US.NU, US.NU, 0, 0, 100], function (r) { var _array = []; for (var i = 0; i < r.value.length; i++) { _array.push({ "UserDirectoryID": r.value[i].UserFilesID, //文件id "UserDirectorySize": r.value[i].UserFilesSize, //文件大小 "UserDirectoryParentID": null, "UserDirectoryName": null, "UserallDirectoryName": r.value[i].UserFilesName, //文件名 "UserDirectoryExtendType": r.value[i].UserFilesExtendName, //文件属性 "UserFilesServerName": null, "UserDirectoryAddTime": r.value[i].UserFilesAddTime, //文件创建时间 "UserDirectoryUrl": null, "UserDirectoryDeep": null, "UserDirectoryModifyTime": r.value[i].UserFilesModifyTime, //文件最后修改时间 "UserDirectoryEncrypt": r.value[i].UserDirectoryEncrypt, //加密 "filetype": "1", //文件类型 1文件 0文件夹 "Descript": null, "GroupID": r.value[i].UserDirectoryEncrypt, //群id "UsOffice": null, "UserId": r.value[i].UserID, "UserNickName": "", "UserName": "", "UserThumbnailImageHead": "" }); } //#error 这里有错误 需要修改 U.Dk.LE.OpenFileDirectory(_array, { UserallDirectoryName: "他人邀请", UserDirectoryID: "22222222-2222-2222-2222-222222222222" }); }); } else if (UDID == "11111111-1111-1111-1111-111111111111") { U.A.Request(US.CD, [US.DB, "UseStudio_Office", "GetCollaborativeDocument", US.userInfo.userid, "00000000-0000-0000-0000-000000000000", "", 0, 0, 100], function (r) { var _array = []; for (var i = 0; i < r.value.length; i++) { _array.push({ "UserDirectoryID": r.value[i].UserFilesID, //文件id "UserDirectorySize": r.value[i].UserFilesSize, //文件大小 "UserDirectoryParentID": null, "UserDirectoryName": null, "UserallDirectoryName": r.value[i].UserFilesName, //文件名 "UserDirectoryExtendType": r.value[i].UserFilesExtendName, //文件属性 "UserFilesServerName": null, "UserDirectoryAddTime": r.value[i].UserFilesAddTime, //文件创建时间 "UserDirectoryUrl": null, "UserDirectoryDeep": null, "UserDirectoryModifyTime": r.value[i].UserFilesModifyTime, //文件最后修改时间 "UserDirectoryEncrypt": r.value[i].UserDirectoryEncrypt, //加密 "filetype": "1", //文件类型 1文件 0文件夹 "Descript": null, "GroupID": r.value[i].UserDirectoryEncrypt, //群id "UsOffice": null, "UserId": r.value[i].UserID, "UserNickName": "", "UserName": "", "UserThumbnailImageHead": "" }); } // U.Dk.VW.XWPDY(_array, $("#" + (_UDE[2] ? "UD_SYWOCRC" : "UD_SYWRZ"), _UDE.pdiv)[0]); //#error 这里有错误 需要修改 U.Dk.LE.OpenFileDirectory(_array, { UserallDirectoryName: "我的协同", UserDirectoryID: "11111111-1111-1111-1111-111111111111" }); }); } } /** * 生成导航(面包屑导航) * @param {array} 所有要追加的导航元素 * @param {element} 导航的元素 * @param {string} 用户的id */ U.Dk.LL.SCDXWPDH = function (navarray, el, userid) { var i, //用于循环 _frag = $$("frag"), //临时的panel _click //导航点击事件处理 ; el.innerText = ""; //清空导航区域 for (i = navarray.length - 1; i > -1; i--) { //如果导航是目录的导航,则点击的时候可以跳到指定的导航中 if (navarray[i].UserDirectoryID) { _click = [[U.Dk.LE.RecordNav, [[[U.Dk.LE.OpenFileDirectory, [navarray[i], userid]]]]]] } else { _click = null; } //创建一个导航 $$("div", { "className": "UD_SYWRYBO", "innerHTML": navarray[i]["UserallDirectoryName"], "onclick": _click }, _frag); } el.appendChild(_frag); //添加导航 //每一次导航追加的时候需要如果超过了大小则需要隐藏前面的导航 setTimeout(function () { var _navchild = $(el).Child(); //导航元素 while (el.scrollHeight > 30) { _navchild[i].style.display = "none"; } }, 0); } //#endregion