|
|
|
@ -33,10 +33,12 @@ |
|
|
|
|
<div class="pic-item" |
|
|
|
|
v-for="(img, i) in picSrcList" |
|
|
|
|
:key="i"> |
|
|
|
|
<el-image class="pic" |
|
|
|
|
:src="img" |
|
|
|
|
:preview-src-list="picSrcList"> |
|
|
|
|
</el-image> |
|
|
|
|
<div class="pic-inner"> |
|
|
|
|
<el-image class="pic" |
|
|
|
|
:src="img" |
|
|
|
|
:preview-src-list="picSrcList"> |
|
|
|
|
</el-image> |
|
|
|
|
</div> |
|
|
|
|
<el-button class="download-btn btn" |
|
|
|
|
type="primary" |
|
|
|
|
size="mini" |
|
|
|
@ -229,8 +231,21 @@ |
|
|
|
|
</el-tab-pane> |
|
|
|
|
<el-tab-pane label="结果" |
|
|
|
|
name="result"> |
|
|
|
|
<div class="result" |
|
|
|
|
v-html="curResult"></div> |
|
|
|
|
<div style="position: relative"> |
|
|
|
|
<div class="result" |
|
|
|
|
v-html="curResult"></div> |
|
|
|
|
<div v-if="curPhotoUrl.length" |
|
|
|
|
class="pics"> |
|
|
|
|
<div class="pic-item" |
|
|
|
|
v-for="(img, i) in curPhotoUrl" |
|
|
|
|
:key="i"> |
|
|
|
|
<el-image class="pic" |
|
|
|
|
:src="img" |
|
|
|
|
:preview-src-list="curPhotoUrl"> |
|
|
|
|
</el-image> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</el-tab-pane> |
|
|
|
|
</el-tabs> |
|
|
|
|
<span slot="footer" |
|
|
|
@ -293,7 +308,7 @@ import config from '@/config' |
|
|
|
|
import { saveAs } from 'file-saver' |
|
|
|
|
const CANCEL_TOKEN = axios.CancelToken // 用于input中中断请求 |
|
|
|
|
export default { |
|
|
|
|
props: ['judgmentId', 'code', 'codeId', 'projectId', 'systemId', 'retResult', 'modelIsShow'], |
|
|
|
|
props: ['judgmentId', 'code', 'codeId', 'projectId', 'systemId', 'retResult', 'modelIsShow', 'photoUrl'], |
|
|
|
|
data () { |
|
|
|
|
return { |
|
|
|
|
token: Cookie.get('admin-token'), |
|
|
|
@ -398,6 +413,7 @@ export default { |
|
|
|
|
showActive: 'code', |
|
|
|
|
curCode: '', |
|
|
|
|
curResult: '', |
|
|
|
|
curPhotoUrl: [], |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
components: { |
|
|
|
@ -673,7 +689,11 @@ export default { |
|
|
|
|
this.$emit('cache') // 每次运行代码都要把代码传给后端做缓存 |
|
|
|
|
this.loadIns.close() |
|
|
|
|
this.picSrcList = [] |
|
|
|
|
if (photo) this.picSrcList = photo.split(',') |
|
|
|
|
this.$emit('update:photoUrl', '') |
|
|
|
|
if (photo) { |
|
|
|
|
this.picSrcList = photo.split(',') |
|
|
|
|
this.$emit('update:photoUrl', photo) |
|
|
|
|
} |
|
|
|
|
this.$emit('update:codeId', res.codeId) // 更新coddeId |
|
|
|
|
this.$emit('update:answer', result) // 更新运行结果 |
|
|
|
|
this.$emit('update:retResult', data.retResult) // 更新返回结果 |
|
|
|
@ -830,6 +850,7 @@ export default { |
|
|
|
|
showCode (row) { |
|
|
|
|
this.curCode = row.runCode |
|
|
|
|
this.curResult = row.runResults |
|
|
|
|
this.curPhotoUrl = row.photoUrl ? row.photoUrl.split(',') : [] |
|
|
|
|
this.showVisible = true |
|
|
|
|
}, |
|
|
|
|
// 导入代码 |
|
|
|
@ -1009,7 +1030,13 @@ export default { |
|
|
|
|
} |
|
|
|
|
.pic-item { |
|
|
|
|
margin: 0 5px 5px; |
|
|
|
|
.pic-inner { |
|
|
|
|
height: 100px; |
|
|
|
|
} |
|
|
|
|
&:only-child { |
|
|
|
|
.pic-inner { |
|
|
|
|
height: auto; |
|
|
|
|
} |
|
|
|
|
.pic { |
|
|
|
|
width: 50%; |
|
|
|
|
max-height: none; |
|
|
|
@ -1020,6 +1047,7 @@ export default { |
|
|
|
|
display: block; |
|
|
|
|
width: 100px; |
|
|
|
|
max-height: 100px; |
|
|
|
|
object-fit: cover; |
|
|
|
|
margin: 0 auto 10px; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -1095,5 +1123,26 @@ export default { |
|
|
|
|
line-height: 50px; |
|
|
|
|
color: #333; |
|
|
|
|
} |
|
|
|
|
.pics { |
|
|
|
|
display: flex; |
|
|
|
|
margin-top: 20px; |
|
|
|
|
overflow: auto; |
|
|
|
|
.pic-item { |
|
|
|
|
margin: 0 5px 5px; |
|
|
|
|
&:only-child { |
|
|
|
|
.pic { |
|
|
|
|
width: 50%; |
|
|
|
|
max-height: none; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.pic { |
|
|
|
|
display: block; |
|
|
|
|
width: 100px; |
|
|
|
|
max-height: 100px; |
|
|
|
|
object-fit: cover; |
|
|
|
|
margin: 0 auto 10px; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
</style> |