|
|
|
@ -174,7 +174,7 @@ export default { |
|
|
|
|
showCursorWhenSelecting: true, |
|
|
|
|
theme: "monokai" // 主题 |
|
|
|
|
}, |
|
|
|
|
inputTextReg: /^((?!#).*?(,|\(|\[|\{|\s)+)?input(?!\w)\(['|"]([\s\S]+?)['|"]\)/m, // 匹配input() |
|
|
|
|
inputTextReg: /^((?!#).*?(,|\s?|\(|\[|\{)+)?input(?!\w)\(['|"]([\s\S]+?)['|"]\)/m, // 匹配input() |
|
|
|
|
requestList: [], // 有input的情况下,保存每个axios的对象,用于中断请求 |
|
|
|
|
sourceCode: '', // 把input替换成exit函数后的代码 |
|
|
|
|
requestTimer: null, // 用于中断请求的定时器 |
|
|
|
@ -362,7 +362,7 @@ export default { |
|
|
|
|
type: "warning" |
|
|
|
|
}) |
|
|
|
|
} else { |
|
|
|
|
const inputTextReg = this.inputTextReg |
|
|
|
|
const { inputTextReg } = this |
|
|
|
|
const inputFuncReg = /input\(['|"]/g |
|
|
|
|
const bcId = this.judgmentId |
|
|
|
|
const cid = this.courseId |
|
|
|
@ -389,7 +389,6 @@ export default { |
|
|
|
|
}).then(res => { |
|
|
|
|
const data = res.code |
|
|
|
|
const result = data.runResult |
|
|
|
|
debugger |
|
|
|
|
if(result.includes('File ')){ |
|
|
|
|
if (isWhile) { |
|
|
|
|
this.runResult += result |
|
|
|
@ -504,7 +503,7 @@ export default { |
|
|
|
|
<style lang="scss" scoped> |
|
|
|
|
.left{ |
|
|
|
|
position: relative; |
|
|
|
|
width: calc(100% - 400px); |
|
|
|
|
width: 60%; |
|
|
|
|
} |
|
|
|
|
.text-wrapper { |
|
|
|
|
white-space: pre-wrap; |
|
|
|
@ -607,7 +606,7 @@ export default { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.code-right { |
|
|
|
|
width: 500px; |
|
|
|
|
width: 40%; |
|
|
|
|
color: #fff; |
|
|
|
|
background: #1b1b1b; |
|
|
|
|
display: inline-block; |
|
|
|
|