|
|
|
@ -12,12 +12,6 @@ |
|
|
|
|
ref="myCmGenerate" |
|
|
|
|
></codemirror> |
|
|
|
|
|
|
|
|
|
<el-button |
|
|
|
|
v-if="picSrc" |
|
|
|
|
type="warning" |
|
|
|
|
@click="picVisible = true" |
|
|
|
|
style="width:100px;position:absolute;z-index:99;background:#239685;color:#fff;right: 160px;bottom:15px;border-color: #239685" |
|
|
|
|
>查看图片</el-button> |
|
|
|
|
<el-button |
|
|
|
|
type="warning" |
|
|
|
|
@click="AnswerTips()" |
|
|
|
@ -27,16 +21,23 @@ |
|
|
|
|
</div> |
|
|
|
|
<div class="code-right answer"> |
|
|
|
|
<p class="text-wrapper">{{modifys}}</p> |
|
|
|
|
<div class="pic-wrap" v-if="picSrc"> |
|
|
|
|
<div style="margin-bottom: 5px;text-align: center"> |
|
|
|
|
<img class="pic" :src="picSrc" alt=""> |
|
|
|
|
</div> |
|
|
|
|
<el-button type="primary" size="mini" @click="$refs.picLink.click()" style="background:#239685;color:#fff;border-color: #239685">下载图片</el-button> |
|
|
|
|
<a ref="picLink" style="display: none;" download="运行结果.png" :href="picSrc">下载图片</a> |
|
|
|
|
</div> |
|
|
|
|
<div class="code_yes" v-show="this.isError == 0"> |
|
|
|
|
<img src="../assets/img/yes.png" alt />运行成功 |
|
|
|
|
</div> |
|
|
|
|
<div class="code_error" v-show="this.isError == 1"> |
|
|
|
|
<img src="../assets/img/error.png" alt /> |
|
|
|
|
第{{num-1}}行出现错误 |
|
|
|
|
第{{num}}行出现错误 |
|
|
|
|
<!-- <el-button |
|
|
|
|
style="color:rgba(255,49,49,1);background:rgba(255,255,255,1);margin-left:80px" |
|
|
|
|
>求助</el-button>--> |
|
|
|
|
<el-button @click="getQueryAnswer()" v-show="ShowAssessmentId">提示</el-button> |
|
|
|
|
<el-button class="tips-btn" @click="getQueryAnswer()" v-show="ShowAssessmentId">提示</el-button> |
|
|
|
|
<el-dialog title="答案提示" center :visible.sync="error"> |
|
|
|
|
<el-tabs> |
|
|
|
|
<el-tab-pane label="参考答案">{{answer}}</el-tab-pane> |
|
|
|
@ -44,16 +45,6 @@ |
|
|
|
|
</el-dialog> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<el-dialog title="查看结果" :visible.sync="picVisible" center class="dialog" :close-on-click-modal="false" :fullscreen="true" :append-to-body="true"> |
|
|
|
|
<div style="text-align: center"> |
|
|
|
|
<img class="pic" :src="picSrc" alt=""> |
|
|
|
|
</div> |
|
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
|
<el-button type="primary" @click="$refs.picLink.click()" style="background:#239685;color:#fff;border-color: #239685">下载图片</el-button> |
|
|
|
|
</span> |
|
|
|
|
<a ref="picLink" style="display: none;" download="运行结果.png" :href="picSrc">下载图片</a> |
|
|
|
|
</el-dialog> |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
@ -210,7 +201,7 @@ export default { |
|
|
|
|
//新增编辑器代码 |
|
|
|
|
if (this.codeId == "") { |
|
|
|
|
this.$post(this.api.AddCode, { |
|
|
|
|
code: "#-*-coding:utf-8-*-" + "\n" + this.exampleData, |
|
|
|
|
code: this.exampleData, |
|
|
|
|
projectId: this.projectId, |
|
|
|
|
// projectId: 305, |
|
|
|
|
judgmentPointsId: this.workbench1, |
|
|
|
@ -251,7 +242,8 @@ export default { |
|
|
|
|
type: "warning" |
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
|
if (this.exampleData.indexOf("input") != -1) { |
|
|
|
|
// return console.log(11,/^((?!#).*?(,|\(|\[|\{|\s)+)?input(?!\w)(,|\(|\)|\[|\]|\{|\}|\s)?/m.test(this.exampleData)) |
|
|
|
|
if (/^((?!#).*?(,|\(|\[|\{|\s)+)?input(?!\w)(,|\(|\)|\[|\]|\{|\}|\s)?/m.test(this.exampleData)) { |
|
|
|
|
this.$prompt("请输入...", "提示", { |
|
|
|
|
confirmButtonText: "确定" |
|
|
|
|
}).then(({ value }) => { |
|
|
|
@ -259,7 +251,7 @@ export default { |
|
|
|
|
this.datas.push(value); |
|
|
|
|
this.$post(this.api.ChangeCode, { |
|
|
|
|
datas: this.datas, |
|
|
|
|
code: "#-*-coding:utf-8-*-" + "\n" + this.exampleData |
|
|
|
|
code: this.exampleData |
|
|
|
|
}) |
|
|
|
|
.then(res => { |
|
|
|
|
this.exampleData = res.message; |
|
|
|
@ -267,12 +259,12 @@ export default { |
|
|
|
|
.catch(err => { |
|
|
|
|
console.log(err); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}).catch(err => {}) |
|
|
|
|
} else { |
|
|
|
|
this.loadIns = Loading.service() |
|
|
|
|
//实时更新编辑器代码(修改代码) |
|
|
|
|
this.$post(this.api.UpdateCode, { |
|
|
|
|
code: "#-*-coding:utf-8-*-" + "\n" + this.exampleData, |
|
|
|
|
code: this.exampleData, |
|
|
|
|
codeId: this.codeId, |
|
|
|
|
submit: this.submit //是否点击运行(0未运行,1已运行) |
|
|
|
|
}) |
|
|
|
@ -309,7 +301,7 @@ export default { |
|
|
|
|
UpdateCode() { |
|
|
|
|
//实时更新编辑器代码(修改代码) |
|
|
|
|
this.$post(this.api.UpdateCode, { |
|
|
|
|
code: "#-*-coding:utf-8-*-" + "\n" + this.exampleData, |
|
|
|
|
code: this.exampleData, |
|
|
|
|
codeId: this.codeId, |
|
|
|
|
submit: this.submit //是否点击运行(0未运行,1已运行) |
|
|
|
|
}) |
|
|
|
@ -394,7 +386,7 @@ export default { |
|
|
|
|
height: 30px; |
|
|
|
|
line-height: 30px; |
|
|
|
|
} |
|
|
|
|
.code-right ::v-deep .el-button { |
|
|
|
|
.code-right ::v-deep .tips-btn { |
|
|
|
|
margin-top: 10px; |
|
|
|
|
height: 40px; |
|
|
|
|
width: 90px; |
|
|
|
@ -404,9 +396,9 @@ export default { |
|
|
|
|
background: rgba(255, 49, 49, 1); |
|
|
|
|
color: rgba(255, 255, 255, 1); |
|
|
|
|
} |
|
|
|
|
.code-right ::v-deep .el-button:hover, |
|
|
|
|
.el-button:focus, |
|
|
|
|
.el-button:active { |
|
|
|
|
.code-right ::v-deep .tips-btn:hover, |
|
|
|
|
.tips-btn:focus, |
|
|
|
|
.tips-btn:active { |
|
|
|
|
background: rgba(255, 49, 49, 1); |
|
|
|
|
color: rgba(255, 255, 255, 1); |
|
|
|
|
} |
|
|
|
@ -479,4 +471,15 @@ export default { |
|
|
|
|
border-radius: 0; |
|
|
|
|
background: #dddddd; |
|
|
|
|
} |
|
|
|
|
.pic-wrap{ |
|
|
|
|
position: absolute; |
|
|
|
|
left: 0; |
|
|
|
|
right: 0; |
|
|
|
|
bottom: 5px; |
|
|
|
|
text-align: center; |
|
|
|
|
.pic{ |
|
|
|
|
max-width: 80%; |
|
|
|
|
vertical-align: middle; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
</style> |