|
|
@ -30,7 +30,7 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="code-right answer"> |
|
|
|
<div class="code-right answer"> |
|
|
|
<p :class="['text-wrapper', 'pic-num' + picSrcList.length]">{{ runResult }}</p> |
|
|
|
<p :class="['text-wrapper', 'pic-num' + picSrcList.length]">{{ runResult }}</p> |
|
|
|
<div class="pic-wrap" v-if="picSrcList.length"> |
|
|
|
<div :class="['pic-wrap', {wrong: isError === 0}]" v-if="picSrcList.length"> |
|
|
|
<div class="pic-item" v-for="(img, i) in picSrcList" :key="i"> |
|
|
|
<div class="pic-item" v-for="(img, i) in picSrcList" :key="i"> |
|
|
|
<el-image |
|
|
|
<el-image |
|
|
|
class="pic" |
|
|
|
class="pic" |
|
|
@ -442,10 +442,11 @@ export default { |
|
|
|
if (imgList && imgList.length) firtImg = imgList[0] |
|
|
|
if (imgList && imgList.length) firtImg = imgList[0] |
|
|
|
// 如果是下载图片的代码,则要显示图片和运行结果,不用显示对错,换成显示下载图片 |
|
|
|
// 如果是下载图片的代码,则要显示图片和运行结果,不用显示对错,换成显示下载图片 |
|
|
|
if (photo) { |
|
|
|
if (photo) { |
|
|
|
this.isError = '' // 对错隐藏 |
|
|
|
this.isError = data.retResult // 对错隐藏 |
|
|
|
const text = result.replace(photo, '') // 结果里包含了图片路径,所以要把图片路径给去掉 |
|
|
|
const text = result.replace(photo, '') // 结果里包含了图片路径,所以要把图片路径给去掉 |
|
|
|
this.runResult = text |
|
|
|
this.runResult = text |
|
|
|
this.picSrcList = photo.split(',') |
|
|
|
this.picSrcList = photo.split(',') |
|
|
|
|
|
|
|
this.errLine = parseInt(result.substring(result.indexOf("line") + 4, result.length)) |
|
|
|
} else if (imgList instanceof Array && imgList.length && typeof firtImg === 'string' && (firtImg.includes('.jpg') || firtImg.includes('.png') || firtImg.includes('img'))) { |
|
|
|
} else if (imgList instanceof Array && imgList.length && typeof firtImg === 'string' && (firtImg.includes('.jpg') || firtImg.includes('.png') || firtImg.includes('img'))) { |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 这段是为要下载图片的项目案例写的,后端会返回图片名称的数组,前端负责循环这个数组,然后下载下来 |
|
|
|
* 这段是为要下载图片的项目案例写的,后端会返回图片名称的数组,前端负责循环这个数组,然后下载下来 |
|
|
@ -637,6 +638,9 @@ export default { |
|
|
|
margin: 0 auto; |
|
|
|
margin: 0 auto; |
|
|
|
text-align: center; |
|
|
|
text-align: center; |
|
|
|
overflow: auto; |
|
|
|
overflow: auto; |
|
|
|
|
|
|
|
&.wrong { |
|
|
|
|
|
|
|
bottom: 60px; |
|
|
|
|
|
|
|
} |
|
|
|
.pic-item { |
|
|
|
.pic-item { |
|
|
|
margin: 0 5px 5px; |
|
|
|
margin: 0 5px 5px; |
|
|
|
&:only-child { |
|
|
|
&:only-child { |
|
|
|