|
|
|
@ -201,7 +201,7 @@ |
|
|
|
|
<el-button type="text" |
|
|
|
|
@click="showCode(scope.row)">查看代码</el-button> |
|
|
|
|
<el-button type="text" |
|
|
|
|
@click="importCode(scope.row)">导入代码</el-button> |
|
|
|
|
@click="importCode(scope.row)">插入代码</el-button> |
|
|
|
|
<el-button type="text" |
|
|
|
|
@click="del(scope.row)">删除</el-button> |
|
|
|
|
</template> |
|
|
|
@ -222,7 +222,7 @@ |
|
|
|
|
</span> |
|
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
|
<el-dialog title="查看代码" |
|
|
|
|
<el-dialog :title="curRow.judgmentName" |
|
|
|
|
:visible.sync="showVisible" |
|
|
|
|
width="700px" |
|
|
|
|
:close-on-click-modal="false" |
|
|
|
@ -239,7 +239,7 @@ |
|
|
|
|
name="result"> |
|
|
|
|
<div style="position: relative"> |
|
|
|
|
<div class="result" |
|
|
|
|
v-html="curResult"></div> |
|
|
|
|
v-html="curRow.runResults"></div> |
|
|
|
|
<div v-if="curPhotoUrl.length" |
|
|
|
|
class="pics"> |
|
|
|
|
<div class="pic-item" |
|
|
|
@ -258,7 +258,7 @@ |
|
|
|
|
class="dialog-footer"> |
|
|
|
|
<el-button size="small" |
|
|
|
|
type="primary" |
|
|
|
|
@click="showSubmit">导入代码</el-button> |
|
|
|
|
@click="showSubmit">插入代码</el-button> |
|
|
|
|
</span> |
|
|
|
|
</el-dialog> |
|
|
|
|
</div> |
|
|
|
@ -314,7 +314,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', 'photoUrl', 'answer'], |
|
|
|
|
props: ['judgmentId', 'code', 'finalCode', 'codeId', 'projectId', 'systemId', 'retResult', 'modelIsShow', 'photoUrl', 'answer'], |
|
|
|
|
data () { |
|
|
|
|
return { |
|
|
|
|
token: Cookie.get('admin-token'), |
|
|
|
@ -417,8 +417,8 @@ export default { |
|
|
|
|
|
|
|
|
|
showVisible: false, |
|
|
|
|
showActive: 'code', |
|
|
|
|
curRow: {}, |
|
|
|
|
curCode: '', |
|
|
|
|
curResult: '', |
|
|
|
|
curPhotoUrl: [], |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
@ -471,12 +471,15 @@ export default { |
|
|
|
|
}, |
|
|
|
|
// 清屏 |
|
|
|
|
clearCode () { |
|
|
|
|
this.picSrcList = [] |
|
|
|
|
this.codeVal = '' |
|
|
|
|
this.isError = '' |
|
|
|
|
this.runResult = '' |
|
|
|
|
this.$emit('update:finalCode', '') |
|
|
|
|
this.$emit('update:codeId', '') // 更新coddeId |
|
|
|
|
this.$emit('update:answer', '') // 更新运行结果 |
|
|
|
|
this.$emit('update:retResult', '') // 更新返回结果 |
|
|
|
|
this.$emit('update:photoUrl', '') // 更新返回结果 |
|
|
|
|
}, |
|
|
|
|
// 导入模型 |
|
|
|
|
importModel () { |
|
|
|
@ -608,6 +611,7 @@ export default { |
|
|
|
|
this.isError = 1 |
|
|
|
|
this.runResult += result |
|
|
|
|
} |
|
|
|
|
this.$emit('update:finalCode', this.sourceCode) |
|
|
|
|
this.$emit('update:codeId', res.codeId) // 更新coddeId |
|
|
|
|
this.$emit('update:answer', this.runResult) // 更新运行结果 |
|
|
|
|
this.$emit('update:retResult', data.retResult) // 更新返回结果 |
|
|
|
@ -674,6 +678,7 @@ export default { |
|
|
|
|
this.isError = 1 |
|
|
|
|
this.confirmInput(result) |
|
|
|
|
} |
|
|
|
|
this.$emit('update:finalCode', code) |
|
|
|
|
this.$emit('update:codeId', res.codeId) // 更新coddeId |
|
|
|
|
this.$emit('update:answer', this.runResult) // 更新运行结果 |
|
|
|
|
this.$emit('update:retResult', data.retResult) // 更新返回结果 |
|
|
|
@ -710,6 +715,7 @@ export default { |
|
|
|
|
this.picSrcList = photo.split(',') |
|
|
|
|
this.$emit('update:photoUrl', photo) |
|
|
|
|
} |
|
|
|
|
this.$emit('update:finalCode', code) |
|
|
|
|
this.$emit('update:codeId', res.codeId) // 更新coddeId |
|
|
|
|
this.$emit('update:answer', result) // 更新运行结果 |
|
|
|
|
this.$emit('update:retResult', data.retResult) // 更新返回结果 |
|
|
|
@ -864,9 +870,10 @@ export default { |
|
|
|
|
}, |
|
|
|
|
// 查看代码 |
|
|
|
|
showCode (row) { |
|
|
|
|
this.curRow = row |
|
|
|
|
this.curCode = row.runCode |
|
|
|
|
this.curResult = row.runResults |
|
|
|
|
this.curPhotoUrl = row.photoUrl ? row.photoUrl.split(',') : [] |
|
|
|
|
this.showActive = 'code' |
|
|
|
|
this.showVisible = true |
|
|
|
|
}, |
|
|
|
|
// 导入代码 |
|
|
|
|