Commit a15e2609 authored by 黄奎's avatar 黄奎

页面修改

parent 72f0d618
......@@ -64,6 +64,7 @@
uploadType: "1", //1-上传图片,2-上传附件,3-上传音频
//默认图片域名
defaultImgDomain: "http://imgfile.oytour.com/static/",
ViewDomain: "http://192.168.1.36:8140",
};
},
watch: {
......@@ -104,7 +105,6 @@
},
//选择文件弹窗
attachmentSelected(fileArray) {
console.log("this.uploadType", this.uploadType)
if (fileArray && fileArray.length) {
let html = '';
//图片
......@@ -114,18 +114,16 @@
})
}
//附件
else if (this.uploadType == 2) {
fileArray.forEach(item => {
html += this.getIconContent(item);
})
}
//音频
else if (this.uploadType == 3) {
else {
fileArray.forEach(item => {
var obj = this.getIcon(item.fileName);
html += this.getIconContent(item);
if (obj.fileType == 4) {
html += this.audioIframeStr(item);
} else if (obj.fileType == 1 || obj.fileType == 2 || obj.fileType == 3) {
html += this.fileIframeList(item,obj.fileType);
}
})
}
if (html && html != '') {
this.ue.execCommand('inserthtml', html);
......@@ -143,7 +141,8 @@
getIcon(fileName) {
var obj = {
iconUrl: "",
dataType: ""
dataType: "",
fileType: 0, //1视频,2-pdf,3-word、ppt、xls,4-mp3
}
if (!fileName) {
obj.iconUrl = this.defaultImgDomain + "file.png";
......@@ -155,63 +154,53 @@
obj.dataType = type;
if (type === 'video' || type === 'svideo') {
obj.iconUrl = this.defaultImgDomain + "video.png";
obj.fileType = 1;
} else if (type === 'txt' || type === 'text') {
obj.iconUrl = this.defaultImgDomain + "txt.png";
} else if (type === 'xls' || type === 'xlsx') {
obj.iconUrl = this.defaultImgDomain + "excel.png";
obj.fileType = 3;
} else if (type === 'doc' || type === 'docx') {
obj.iconUrl = this.defaultImgDomain + "word.png";
obj.fileType = 3;
} else if (type === 'zip' || type === 'rar' || type === 'gz') {
obj.iconUrl = this.defaultImgDomain + "zip.png";
} else if (type === 'mp3') {
obj.iconUrl = this.defaultImgDomain + "sound.png";
obj.fileType = 4;
} else if (type === 'pdf') {
obj.iconUrl = this.defaultImgDomain + "pdf.png";
obj.fileType = 2;
} else if (type === 'ppt' || type === 'pptx') {
obj.iconUrl = this.defaultImgDomain + "ppt.png";
obj.fileType = 3;
} else if (type === 'avi' || type === 'rmvb' || type === '3gp' || type === 'mpg' ||
type === 'mpeg' || type === 'mov' || type === 'wmv' || type === 'asf' ||
type === 'mkv' || type === 'mp4' || type === 'vob' || type === 'f4v' ||
type === 'flv') {
obj.iconUrl = this.defaultImgDomain + "movie.png";
obj.fileType = 1;
} else {
obj.iconUrl = this.defaultImgDomain + "unknown.png";
}
return obj;
},
//音频[MP3]
audioIframeStr(data) {
var fileUrl = encodeURIComponent(data.fileUrl);
return '<p><iframe height="62px" width="auto" frameborder="0" allowtransparency="true" ' +
' style="background-color:transparent;border-radius: 3px;overflow: hidden;z-index: 0;" scrolling="no" ' +
' src="http://192.168.1.36:8140/index.html?fileName='+data.fileName+'&url='+ fileUrl +
' src="' + this.ViewDomain + '/index.html?fileName=' + data.fileName + '&url=' + fileUrl +
'" class="ans-insertaudio-module" module="_insertaudio">' + ' </iframe></p>';
},
//其他方法
getTypeList(data){
//视频、PDF、WORD、PPT、EXCEL
fileIframeList(data,fileType) {
//视频1 音频 2 ppt/word 3
if(this.uploadType==3){
var fileUrl = encodeURIComponent(data.fileUrl);
return '<p><iframe height="62px" width="auto" frameborder="0" allowtransparency="true" ' +
' style="background-color:transparent;border-radius: 3px;overflow: hidden;z-index: 0;" scrolling="no" ' +
' src="http://192.168.1.36:8140/read.html?fileName='+data.fileName+'&url='+ fileUrl +'&fileType='+2+ '" class="ans-insertaudio-module" module="_insertaudio">' + ' </iframe></p>';
}
if(this.uploadType==2){
'<p class="attachNew" ><em style="font-style:normal; display:block;min-height:2px;"></em>' +
'<span data="' + objId + '" type="' + dataType + '" name="' + fileName + '" contenteditable="false" style="margin-top:10px;background:#F7F8FA;padding:14px 16px;max-width:572px;zoom:1;overflow:hidden;cursor:pointer;display:block;position: relative;" >' +
'<img src="http://mooc2-ans.chaoxing.com/images/questionbank/icon/' + iconName + '" style=" width:42px; height:42px; overflow:hidden; margin-right:14px; display:block; border-radius:4px;float:left;">' +
'<span style=" display:block;min-height:42px; display:table-cell; vertical-align:middle;display:-webkit-box; -webkit-box-pack:center; -webkit-box-orient:vertical; display:-moz-box; -moz-box-pack:center; -moz-box-orient:vertical;">\n' +
'\t\t<span style=" -webkit-box-flex:1; width:510px\\0; display:block; display:-webkit-box; -webkit-box-pack:center; -webkit-box-orient:vertical; display:-moz-box; -moz-box-pack:center; -moz-box-orient:vertical;">\n' +
'\t\t\t<span style=" padding-right:72px; padding-right:0\\9; font-size:14px; color:#181E33; line-height:20px; display:block; overflow:hidden; white-space:nowrap; text-overflow:ellipsis;">' + fileName + '</span>\n' +
'\t\t\t<span style=" display:block; padding-right:72px; padding-right:0\\9; line-height:18px; margin-top:4px; font-size:12px; color:#A8A8B3; overflow:hidden; white-space:nowrap; text-overflow:ellipsis;">' + size + '</span>\n' +
'\t\t</span>\n' +
'\t</span>\n' +
'</span></p>';
}
' src="' + this.ViewDomain + '/read.html?fileName=' + data.fileName + '&url=' + fileUrl + '&fileType=' + fileType+
'" class="ans-insertaudio-module" module="_insertaudio">' + ' </iframe></p>';
},
loadUe() {
const _this = this;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment