|
|
@ -12,12 +12,6 @@ |
|
|
|
ref="myCmGenerate" |
|
|
|
ref="myCmGenerate" |
|
|
|
></codemirror> |
|
|
|
></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 |
|
|
|
<el-button |
|
|
|
type="warning" |
|
|
|
type="warning" |
|
|
|
@click="AnswerTips()" |
|
|
|
@click="AnswerTips()" |
|
|
@ -27,16 +21,23 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="code-right answer"> |
|
|
|
<div class="code-right answer"> |
|
|
|
<p class="text-wrapper">{{modifys}}</p> |
|
|
|
<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"> |
|
|
|
<div class="code_yes" v-show="this.isError == 0"> |
|
|
|
<img src="../assets/img/yes.png" alt />运行成功 |
|
|
|
<img src="../assets/img/yes.png" alt />运行成功 |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="code_error" v-show="this.isError == 1"> |
|
|
|
<div class="code_error" v-show="this.isError == 1"> |
|
|
|
<img src="../assets/img/error.png" alt /> |
|
|
|
<img src="../assets/img/error.png" alt /> |
|
|
|
第{{num-1}}行出现错误 |
|
|
|
第{{num}}行出现错误 |
|
|
|
<!-- <el-button |
|
|
|
<!-- <el-button |
|
|
|
style="color:rgba(255,49,49,1);background:rgba(255,255,255,1);margin-left:80px" |
|
|
|
style="color:rgba(255,49,49,1);background:rgba(255,255,255,1);margin-left:80px" |
|
|
|
>求助</el-button>--> |
|
|
|
>求助</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-dialog title="答案提示" center :visible.sync="error"> |
|
|
|
<el-tabs> |
|
|
|
<el-tabs> |
|
|
|
<el-tab-pane label="参考答案">{{answer}}</el-tab-pane> |
|
|
|
<el-tab-pane label="参考答案">{{answer}}</el-tab-pane> |
|
|
@ -44,16 +45,6 @@ |
|
|
|
</el-dialog> |
|
|
|
</el-dialog> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</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> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
@ -210,7 +201,7 @@ export default { |
|
|
|
//新增编辑器代码 |
|
|
|
//新增编辑器代码 |
|
|
|
if (this.codeId == "") { |
|
|
|
if (this.codeId == "") { |
|
|
|
this.$post(this.api.AddCode, { |
|
|
|
this.$post(this.api.AddCode, { |
|
|
|
code: "#-*-coding:utf-8-*-" + "\n" + this.exampleData, |
|
|
|
code: this.exampleData, |
|
|
|
projectId: this.projectId, |
|
|
|
projectId: this.projectId, |
|
|
|
// projectId: 305, |
|
|
|
// projectId: 305, |
|
|
|
judgmentPointsId: this.workbench1, |
|
|
|
judgmentPointsId: this.workbench1, |
|
|
@ -251,7 +242,8 @@ export default { |
|
|
|
type: "warning" |
|
|
|
type: "warning" |
|
|
|
}); |
|
|
|
}); |
|
|
|
} else { |
|
|
|
} 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("请输入...", "提示", { |
|
|
|
this.$prompt("请输入...", "提示", { |
|
|
|
confirmButtonText: "确定" |
|
|
|
confirmButtonText: "确定" |
|
|
|
}).then(({ value }) => { |
|
|
|
}).then(({ value }) => { |
|
|
@ -259,7 +251,7 @@ export default { |
|
|
|
this.datas.push(value); |
|
|
|
this.datas.push(value); |
|
|
|
this.$post(this.api.ChangeCode, { |
|
|
|
this.$post(this.api.ChangeCode, { |
|
|
|
datas: this.datas, |
|
|
|
datas: this.datas, |
|
|
|
code: "#-*-coding:utf-8-*-" + "\n" + this.exampleData |
|
|
|
code: this.exampleData |
|
|
|
}) |
|
|
|
}) |
|
|
|
.then(res => { |
|
|
|
.then(res => { |
|
|
|
this.exampleData = res.message; |
|
|
|
this.exampleData = res.message; |
|
|
@ -267,12 +259,12 @@ export default { |
|
|
|
.catch(err => { |
|
|
|
.catch(err => { |
|
|
|
console.log(err); |
|
|
|
console.log(err); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}).catch(err => {}) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
this.loadIns = Loading.service() |
|
|
|
this.loadIns = Loading.service() |
|
|
|
//实时更新编辑器代码(修改代码) |
|
|
|
//实时更新编辑器代码(修改代码) |
|
|
|
this.$post(this.api.UpdateCode, { |
|
|
|
this.$post(this.api.UpdateCode, { |
|
|
|
code: "#-*-coding:utf-8-*-" + "\n" + this.exampleData, |
|
|
|
code: this.exampleData, |
|
|
|
codeId: this.codeId, |
|
|
|
codeId: this.codeId, |
|
|
|
submit: this.submit //是否点击运行(0未运行,1已运行) |
|
|
|
submit: this.submit //是否点击运行(0未运行,1已运行) |
|
|
|
}) |
|
|
|
}) |
|
|
@ -309,7 +301,7 @@ export default { |
|
|
|
UpdateCode() { |
|
|
|
UpdateCode() { |
|
|
|
//实时更新编辑器代码(修改代码) |
|
|
|
//实时更新编辑器代码(修改代码) |
|
|
|
this.$post(this.api.UpdateCode, { |
|
|
|
this.$post(this.api.UpdateCode, { |
|
|
|
code: "#-*-coding:utf-8-*-" + "\n" + this.exampleData, |
|
|
|
code: this.exampleData, |
|
|
|
codeId: this.codeId, |
|
|
|
codeId: this.codeId, |
|
|
|
submit: this.submit //是否点击运行(0未运行,1已运行) |
|
|
|
submit: this.submit //是否点击运行(0未运行,1已运行) |
|
|
|
}) |
|
|
|
}) |
|
|
@ -394,7 +386,7 @@ export default { |
|
|
|
height: 30px; |
|
|
|
height: 30px; |
|
|
|
line-height: 30px; |
|
|
|
line-height: 30px; |
|
|
|
} |
|
|
|
} |
|
|
|
.code-right ::v-deep .el-button { |
|
|
|
.code-right ::v-deep .tips-btn { |
|
|
|
margin-top: 10px; |
|
|
|
margin-top: 10px; |
|
|
|
height: 40px; |
|
|
|
height: 40px; |
|
|
|
width: 90px; |
|
|
|
width: 90px; |
|
|
@ -404,9 +396,9 @@ export default { |
|
|
|
background: rgba(255, 49, 49, 1); |
|
|
|
background: rgba(255, 49, 49, 1); |
|
|
|
color: rgba(255, 255, 255, 1); |
|
|
|
color: rgba(255, 255, 255, 1); |
|
|
|
} |
|
|
|
} |
|
|
|
.code-right ::v-deep .el-button:hover, |
|
|
|
.code-right ::v-deep .tips-btn:hover, |
|
|
|
.el-button:focus, |
|
|
|
.tips-btn:focus, |
|
|
|
.el-button:active { |
|
|
|
.tips-btn:active { |
|
|
|
background: rgba(255, 49, 49, 1); |
|
|
|
background: rgba(255, 49, 49, 1); |
|
|
|
color: rgba(255, 255, 255, 1); |
|
|
|
color: rgba(255, 255, 255, 1); |
|
|
|
} |
|
|
|
} |
|
|
@ -479,4 +471,15 @@ export default { |
|
|
|
border-radius: 0; |
|
|
|
border-radius: 0; |
|
|
|
background: #dddddd; |
|
|
|
background: #dddddd; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.pic-wrap{ |
|
|
|
|
|
|
|
position: absolute; |
|
|
|
|
|
|
|
left: 0; |
|
|
|
|
|
|
|
right: 0; |
|
|
|
|
|
|
|
bottom: 5px; |
|
|
|
|
|
|
|
text-align: center; |
|
|
|
|
|
|
|
.pic{ |
|
|
|
|
|
|
|
max-width: 80%; |
|
|
|
|
|
|
|
vertical-align: middle; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
</style> |
|
|
|
</style> |