Commit 0f4ec037 authored by zhengke's avatar zhengke

修改

parent 0b9cd057
......@@ -97,11 +97,25 @@
html += '<img src="' + e[i].fileUrl + '" style="max-width: 100%;">';
}
}
console.log(e,'文件');
if (this.uploadType == 2) {
for (let i in e) {
html +=
`<p><span contenteditable="false" style="display:-webkit-box;margin-top:10px;background: #F7F8FA;padding: 14px 16px;max-width: 572px;overflow: hidden;cursor:pointer;-webkit-box-align: center;text-align:left;cursor:pointer;" name="${e[i].fileName}" data="xls" data="996d63ec05ac942608319958a0fa3480">` +
`<img src="http://mooc2-ans.chaoxing.com/images/questionbank/icon/txt.png" style="width:42px; height:42px; overflow:hidden; margin-right:14px;border-radius:4px;">${e[i].fileName}</span></p>`
var type = e[i].fileName.split('.')[1];
if(type=='xlsx'||type=='xls'){
html +=
`<p><span contenteditable="false" style="display:-webkit-box;margin-top:10px;background: #F7F8FA;padding: 14px 16px;max-width: 572px;overflow: hidden;cursor:pointer;-webkit-box-align: center;text-align:left;cursor:pointer;" name="${e[i].fileName}" data="xls">` +
`<img src="http://mooc2-ans.chaoxing.com/images/questionbank/icon/excel.png" style="width:42px; height:42px; overflow:hidden; margin-right:14px;border-radius:4px;"><span style="font-size:14px; color:#181E33; line-height:20px; display:block; overflow:hidden; text-overflow:ellipsis;">${e[i].fileName}</span></span></p>`
}
if(type=='txt'){
html +=
`<p><span contenteditable="false" style="display:-webkit-box;margin-top:10px;background: #F7F8FA;padding: 14px 16px;max-width: 572px;overflow: hidden;cursor:pointer;-webkit-box-align: center;text-align:left;cursor:pointer;" name="${e[i].fileName}" data="xls">` +
`<img src="http://mooc2-ans.chaoxing.com/images/questionbank/icon/txt.png" style="width:42px; height:42px; overflow:hidden; margin-right:14px;border-radius:4px;"><span style="font-size:14px; color:#181E33; line-height:20px; display:block; overflow:hidden; text-overflow:ellipsis;">${e[i].fileName}</span></span></p>`
}
if(type=='ppt'||type=='pptx'){
html +=
`<p><span contenteditable="false" style="display:-webkit-box;margin-top:10px;background: #F7F8FA;padding: 14px 16px;max-width: 572px;overflow: hidden;cursor:pointer;-webkit-box-align: center;text-align:left;cursor:pointer;" name="${e[i].fileName}" data="xls">` +
`<img src="http://mooc2-ans.chaoxing.com/images/questionbank/icon/ppt.png" style="width:42px; height:42px; overflow:hidden; margin-right:14px;border-radius:4px;"><span style="font-size:14px; color:#181E33; line-height:20px; display:block; overflow:hidden; text-overflow:ellipsis;">${e[i].fileName}</span></span></p>`
}
}
}
this.ue.execCommand('inserthtml', html);
......
This diff is collapsed.
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