|
楼主 |
发表于 2016-8-12 17:20:23
|
显示全部楼层
getFileUrl : function(realFileName,storeFileName,ownerID,operateType){
var url = "";
if(this.actionUrl.indexOf('?') == -1){
url = this.actionUrl + '?realFileName=' + realFileName + '&storeFileName='+storeFileName + '&ownerID='+ownerID + '&operateType=' + operateType;
}else{
url = this.actionUrl + '&realFileName=' + realFileName + '&storeFileName='+storeFileName + '&ownerID='+ownerID + '&operateType=' + operateType;
}
return require.toUrl(url);
},
getPictureUrl : function($object){
var realFileName = $object.realFileName.get();
var storeFileName = $object.storeFileName.get();
var ownerID = this.getOwnerID($object);
var operateType = "browse";
var imgFileType = ".jpg,.jpeg,.jpe,.png,.gif,.tiff,.tif,.svg,.svgz,.svg";
var url = "";
if(imgFileType.indexOf((String(/\.[^\.]+$/.exec(realFileName)).toLowerCase())) >= 0){
url = this.getFileUrl(realFileName,storeFileName,ownerID,operateType);
}else if(".mp3,.wav".indexOf((String(/\.[^\.]+$/.exec(realFileName)).toLowerCase())) >= 0){
url = require.toUrl('$UI/system/components/justep/attachment/css/mp3.png');
}else if(".mp4,.wmv,.mov,.MOV".indexOf((String(/\.[^\.]+$/.exec(realFileName)).toLowerCase())) >= 0){
url = require.toUrl('$UI/system/components/justep/attachment/css/mp4.png');
}else if(".avi".indexOf((String(/\.[^\.]+$/.exec(realFileName)).toLowerCase())) >= 0){
url = require.toUrl('$UI/system/components/justep/attachment/css/avi.png');
}else if(".doc,.docx".indexOf((String(/\.[^\.]+$/.exec(realFileName)).toLowerCase())) >= 0){
url = require.toUrl('$UI/system/components/justep/attachment/css/doc.png');
}else if(".ppt,.pptx".indexOf((String(/\.[^\.]+$/.exec(realFileName)).toLowerCase())) >= 0){
url = require.toUrl('$UI/system/components/justep/attachment/css/ppt.png');
}else if(".txt,.text".indexOf((String(/\.[^\.]+$/.exec(realFileName)).toLowerCase())) >= 0){
url = require.toUrl('$UI/system/components/justep/attachment/css/txt.png');
}else if(".pdf".indexOf((String(/\.[^\.]+$/.exec(realFileName)).toLowerCase())) >= 0){
url = require.toUrl('$UI/system/components/justep/attachment/css/pdf.png');
}else if(".xls,.xlsx".indexOf((String(/\.[^\.]+$/.exec(realFileName)).toLowerCase())) >= 0){
url = require.toUrl('$UI/system/components/justep/attachment/css/xlsx.png');
}else{
url = require.toUrl('$UI/system/components/justep/attachment/css/other.png');
}
return url;
}, 你好,你是指js文件中的上面这段代码吗:
我自己是这么写的,我可以拿到正确的路径啊,只是文件不是mp4的,上面这段代码是要转换成mp4吗:
var data = this.comp("videodata"); //存放图片的data;
if(data !== null || data !== undefined){ //如果数据不为空;
var row = data.getFirstRow();
var ownerID = row.getID();
var fVideo = row.val("fVideo");
var jsonList = eval("(" + fVideo +")"); //提取图片存放列的数据;
if(jsonList !== undefined){ //如果数据不为空;
var realFileName = jsonList[0]["realFileName"];
var storeFileName = jsonList[0]["storeFileName"];
var operateType = "browse";
var url = '/baas/justep/attachment/simpleFileStore?realFileName=' + realFileName + '&storeFileName='+storeFileName + '&ownerID='+ownerID + '&operateType=' + operateType;
this.video.set(url);
alert(url);
|
|