From 5d872fb19dbaca49a25f6de747347957a3078461 Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Wed, 23 Dec 2020 11:45:48 +0800 Subject: [PATCH] . --- src/components/TestPanel.vue | 4 +-- src/components/codemirror.vue | 59 ++++++++++++++++++----------------- src/views/Home.vue | 14 +++++---- 3 files changed, 40 insertions(+), 37 deletions(-) diff --git a/src/components/TestPanel.vue b/src/components/TestPanel.vue index ee088d2..b53707e 100644 --- a/src/components/TestPanel.vue +++ b/src/components/TestPanel.vue @@ -194,7 +194,7 @@ export default { startTime: '', stopTime: '', isSelected: false, - userId: '' + userId: '', }; }, watch: { @@ -262,7 +262,6 @@ export default { this.getQueryProject(); }else{ this.getProjects(); - } this.assessmentId && this.projectId && this.checkVer() this.codeId && this.codeIds.push(this.codeId) @@ -463,7 +462,6 @@ export default { } this.$get(`${this.api.queryTestProject}`,data).then(res => { this.handleData(res.message,2) - }).catch(res => {}); }, selectProject(){ diff --git a/src/components/codemirror.vue b/src/components/codemirror.vue index e50beec..b9637af 100644 --- a/src/components/codemirror.vue +++ b/src/components/codemirror.vue @@ -12,12 +12,6 @@ ref="myCmGenerate" > - 查看图片 {{modifys}} + + + + + 下载图片 + 下载图片 + 运行成功 - 第{{num-1}}行出现错误 + 第{{num}}行出现错误 - 提示 + 提示 {{answer}} @@ -44,16 +45,6 @@ - - - - - - - 下载图片 - - 下载图片 - @@ -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; + } +} \ No newline at end of file diff --git a/src/views/Home.vue b/src/views/Home.vue index eb9f142..d2edce9 100644 --- a/src/views/Home.vue +++ b/src/views/Home.vue @@ -1,7 +1,7 @@ - Python程序设计实验教学系统 + python可视化 退出实验 @@ -102,6 +102,7 @@ export default { autoStart: true, sendSync: true, entryTime: formatDate('yyyy-MM-dd hh:mm:ss'), + assessmentId: '', defaultVal: sessionStorage.getItem("timer") ? parseInt(sessionStorage.getItem("timer")) : 0 @@ -112,6 +113,7 @@ export default { testPanel }, mounted() { + this.assessmentId = this.getCookie("assessmentId"); this.addLeaveEvent() if (window.history && window.history.pushState) { // 向历史记录中插入了当前页 @@ -166,12 +168,12 @@ export default { if (item.code.codeId == 0) { item.code.codeId = ""; } - if (this.projectPermissions == "0") { - item.code.codeId = ""; - item.code.code = ""; - } + // if (this.projectPermissions == "0") { + // item.code.codeId = ""; + // item.code.code = ""; + // } }); - this.workbench[0].code.codeId && (this.codeId = this.workbench[0].code.codeId) + this.assessmentId && (this.codeId = this.workbench[0].code.codeId) }) .catch(err => { console.log(err);
{{modifys}}
Python程序设计实验教学系统
python可视化