|
发表于 2017-5-24 10:54:31
|
显示全部楼层
- var data = this.comp("mainData");
- var fFJ = data.getValue("fFJ");
- var jsonList = eval("(" + fFJ + ")");// 获取附件组件的json值
- var url = "";
- var name = "";
- if (jsonList.length > 0) {// 遍历json获取相关的信息
- for (var i = 0; i < jsonList.length; i++) {
- var docPath = jsonList[0]["docPath"];
- var fileID = jsonList[0]["fileID"];
- var docName = jsonList[0]["docName"];
- name = docName.split(".")[0];
- url = DocUtils.InnerUtils.getdocServerAction({
- "docPath" : docPath,
- urlPattern : "/repository/file/view/" + fileID + "/last/content",
- isFormAction : false,
- context : this.getContext(),
- useCookie : false
- });// 调用API获取url
- url = url.indexOf(window.location.protocol) < 1 ? url : window.location.protocol + "//" + window.location.host + url;// 拼接最终需要的
- }
- }
- fileApi.browse(url, name).done(function() {
- alert("成功打开");
- }).fail(function() {
- alert("打开出错");
- });
- };
复制代码
|
|