Commit af175863 authored by 黄奎's avatar 黄奎

页面修改

parent 9fe07281
......@@ -89,32 +89,74 @@
this.attachmentDialogVisible = false;
},
//选择文件弹窗
attachmentSelected(e) {
if (e.length) {
attachmentSelected(fileArray) {
console.log("fileArray",fileArray);
if (fileArray&&fileArray.length) {
let html = '';
//图片
if (this.uploadType == 1) {
for (let i in e) {
html += '<img src="' + e[i].fileUrl + '" style="max-width: 100%;">';
}
}
if (this.uploadType == 2) {
//附件
if (this.uploadType == 2 || this.uploadType == 3 ) {
for (let i in e) {
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>`
var imgUrl = "";
var dataName = "";
if (type == 'xlsx' || type == 'xls') {
imgUrl = "http://imgfile.oytour.com/static/excel.png";
dataName = "xls";
}
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 == 'txt') {
imgUrl = "http://imgfile.oytour.com/static/txt.png";
dataName = "txt";
}
if (type == 'ppt' || type == 'pptx') {
imgUrl = "http://imgfile.oytour.com/static/ppt.png";
dataName = "ppt";
}
if (type == 'doc' || type == 'docx') {
imgUrl = "http://imgfile.oytour.com/static/word.png";
dataName = "doc";
}
if (type == 'mp3') {
imgUrl = "http://imgfile.oytour.com/static/video.png";
dataName = "mp3";
}
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>`
`<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].dataName}" data="${e[i].fileName}">` +
`<img src="${imgUrl}" 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(this.uploadType==3)
{
for (let i in e) {
var type = e[i].fileName.split('.')[1];
var imgUrl = "";
var dataName = "";
if (type == 'xlsx' || type == 'xls') {
imgUrl = "http://imgfile.oytour.com/static/excel.png";
dataName = "xls";
}
if (type == 'txt') {
imgUrl = "http://imgfile.oytour.com/static/txt.png";
dataName = "txt";
}
if (type == 'ppt' || type == 'pptx') {
imgUrl = "http://imgfile.oytour.com/static/ppt.png";
dataName = "ppt";
}
if (type == 'doc' || type == 'docx') {
imgUrl = "http://imgfile.oytour.com/static/word.png";
dataName = "doc";
}
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].dataName}" data="${e[i].fileName}">` +
`<img src="${imgUrl}" 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);
......
......@@ -52,12 +52,12 @@
<template>
<span>{{subIndex+1}}小题 {{subItem.SubTitle}}</span><br />
</template>
<template v-if="subItem.QuestionKey=='single'||subItem.QuestionKey=='multiple'"
<template v-if=" subItem.QuestionKey=='single'||subItem.QuestionKey=='multiple'|| subItem.QuestionKey=='single-number'"
v-for="childItem in subItem.SubAnwser">
<span>{{childItem.Name}}.{{childItem.Content}} </span><br />
</template>
</span>
<template v-if="subItem.QuestionKey=='single'||subItem.QuestionKey=='multiple'">
<template v-if="subItem.QuestionKey=='single'||subItem.QuestionKey=='multiple'|| subItem.QuestionKey=='single-number'">
<template v-for="childItem in subItem.SubAnwser">
<span v-if="childItem.IsAnswer">答案:{{childItem.Name}} </span>
<br v-if="childItem.IsAnswer" />
......
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