|
|
@ -1,18 +1,37 @@ |
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<div class="code-wrap flex"> |
|
|
|
<div class="code-wrap flex"> |
|
|
|
<div class="left"> |
|
|
|
<div class="left"> |
|
|
|
<codemirror v-model="codeVal" :options="cmOption" class="code-mirror" @ready="ready" ref="codemirror"> |
|
|
|
<codemirror v-model="codeVal" |
|
|
|
</codemirror> |
|
|
|
:options="cmOption" |
|
|
|
<div v-if="isSubmit" class="code-mask"></div> |
|
|
|
class="code-mirror" |
|
|
|
|
|
|
|
@ready="ready" |
|
|
|
|
|
|
|
ref="codemirror"></codemirror> |
|
|
|
|
|
|
|
<div v-if="isSubmit" |
|
|
|
|
|
|
|
class="code-mask"></div> |
|
|
|
<div class="btns"> |
|
|
|
<div class="btns"> |
|
|
|
<template v-if="!pid"> |
|
|
|
<template v-if="!pid"> |
|
|
|
<span class="el-icon-delete del" @click="clearCode"></span> |
|
|
|
<span class="el-icon-delete del" |
|
|
|
<el-button v-if="isPrac" class="btn" type="danger" @click="myCode">我的代码</el-button> |
|
|
|
@click="clearCode"></span> |
|
|
|
<el-button v-if="modelIsShow" class="btn" type="warning" @click="importModel">导入模型</el-button> |
|
|
|
<el-button v-if="isPrac" |
|
|
|
<el-button class="run btn" type="primary" @click="runCode(false)" :disabled="runEnable">运行</el-button> |
|
|
|
class="btn" |
|
|
|
|
|
|
|
type="danger" |
|
|
|
|
|
|
|
@click="myCode">我的代码</el-button> |
|
|
|
|
|
|
|
<el-button v-if="modelIsShow" |
|
|
|
|
|
|
|
class="btn" |
|
|
|
|
|
|
|
type="warning" |
|
|
|
|
|
|
|
@click="importModel">导入模型</el-button> |
|
|
|
|
|
|
|
<el-button class="run btn" |
|
|
|
|
|
|
|
type="primary" |
|
|
|
|
|
|
|
@click="runCode(false)" |
|
|
|
|
|
|
|
:disabled="runEnable">运行</el-button> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
<el-popconfirm v-else title="确定终止运行本次代码?" @confirm="stopRunCode"> |
|
|
|
<el-popconfirm v-else |
|
|
|
<el-button slot="reference" class="run" type="danger" :disabled="runEnable">终止运行</el-button> |
|
|
|
title="确定终止运行本次代码?" |
|
|
|
|
|
|
|
@confirm="stopRunCode"> |
|
|
|
|
|
|
|
<el-button slot="reference" |
|
|
|
|
|
|
|
class="run" |
|
|
|
|
|
|
|
type="danger" |
|
|
|
|
|
|
|
:disabled="runEnable">终止运行</el-button> |
|
|
|
</el-popconfirm> |
|
|
|
</el-popconfirm> |
|
|
|
|
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -20,28 +39,50 @@ |
|
|
|
<div class="line"></div> |
|
|
|
<div class="line"></div> |
|
|
|
<div class="code-right answer"> |
|
|
|
<div class="code-right answer"> |
|
|
|
<p :class="['text-wrapper', 'pic-num' + picSrcList.length]">{{ runResult }}</p> |
|
|
|
<p :class="['text-wrapper', 'pic-num' + picSrcList.length]">{{ runResult }}</p> |
|
|
|
<div :class="['pic-wrap', { wrong: isError === 0 }]" v-if="picSrcList.length"> |
|
|
|
<div :class="['pic-wrap', {wrong: isError === 0}]" |
|
|
|
<div class="pic-item" v-for="(img, i) in picSrcList" :key="i"> |
|
|
|
v-if="picSrcList.length"> |
|
|
|
|
|
|
|
<div class="pic-item" |
|
|
|
|
|
|
|
v-for="(img, i) in picSrcList" |
|
|
|
|
|
|
|
:key="i"> |
|
|
|
<div class="pic-inner"> |
|
|
|
<div class="pic-inner"> |
|
|
|
<el-image class="pic" :src="img" :preview-src-list="picSrcList"> |
|
|
|
<el-image class="pic" |
|
|
|
|
|
|
|
:src="img" |
|
|
|
|
|
|
|
:preview-src-list="picSrcList"> |
|
|
|
</el-image> |
|
|
|
</el-image> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<el-button class="download-btn btn" type="primary" size="mini" @click="downloadPic(i)">下载图片</el-button> |
|
|
|
<el-button class="download-btn btn" |
|
|
|
<a :ref="'picLink' + i" style="display: none;" download="运行结果.png" :href="img">下载图片</a> |
|
|
|
type="primary" |
|
|
|
|
|
|
|
size="mini" |
|
|
|
|
|
|
|
@click="downloadPic(i)">下载图片</el-button> |
|
|
|
|
|
|
|
<a :ref="'picLink' + i" |
|
|
|
|
|
|
|
style="display: none;" |
|
|
|
|
|
|
|
download="运行结果.png" |
|
|
|
|
|
|
|
:href="img">下载图片</a> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="result-right t-color" v-show="isError"> |
|
|
|
<div class="result-right t-color" |
|
|
|
<img :src="require(`@/assets/images/system/${$themeId}/yes.png`)" alt />运行成功 |
|
|
|
v-show="isError"> |
|
|
|
<el-button class="tips-btn" @click="exportResult">导出结果</el-button> |
|
|
|
<img :src="require(`@/assets/images/system/${$themeId}/yes.png`)" |
|
|
|
|
|
|
|
alt />运行成功 |
|
|
|
|
|
|
|
<el-button class="tips-btn" |
|
|
|
|
|
|
|
@click="exportResult">导出结果</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="result-wrong" v-show="isError === 0"> |
|
|
|
<div class="result-wrong" |
|
|
|
<img src="@/assets/images/error.png" alt /> |
|
|
|
v-show="isError === 0"> |
|
|
|
|
|
|
|
<img src="@/assets/images/error.png" |
|
|
|
|
|
|
|
alt /> |
|
|
|
第{{errLine}}行出现错误 |
|
|
|
第{{errLine}}行出现错误 |
|
|
|
<el-button class="tips-btn" @click="getTips" v-show="isPrac">提示</el-button> |
|
|
|
<el-button class="tips-btn" |
|
|
|
<el-dialog title="答案提示" center :close-on-click-modal="false" :visible.sync="tipsVisible"> |
|
|
|
@click="getTips" |
|
|
|
|
|
|
|
v-show="isPrac">提示</el-button> |
|
|
|
|
|
|
|
<el-dialog title="答案提示" |
|
|
|
|
|
|
|
center |
|
|
|
|
|
|
|
:close-on-click-modal="false" |
|
|
|
|
|
|
|
:visible.sync="tipsVisible"> |
|
|
|
<el-tabs> |
|
|
|
<el-tabs> |
|
|
|
<el-tab-pane label="参考答案"> |
|
|
|
<el-tab-pane label="参考答案"> |
|
|
|
<div :class="['answer-wrap', { client: !fromManager }]" v-html="correctAnswer"></div> |
|
|
|
<div :class="['answer-wrap', {client: !fromManager}]" |
|
|
|
|
|
|
|
v-html="correctAnswer"></div> |
|
|
|
</el-tab-pane> |
|
|
|
</el-tab-pane> |
|
|
|
</el-tabs> |
|
|
|
</el-tabs> |
|
|
|
</el-dialog> |
|
|
|
</el-dialog> |
|
|
@ -49,10 +90,18 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<!-- 导入模型 --> |
|
|
|
<!-- 导入模型 --> |
|
|
|
<el-dialog title="请选择要导入的模型" :visible.sync="modelVisible" width="400px" :close-on-click-modal="false" |
|
|
|
<el-dialog title="请选择要导入的模型" |
|
|
|
|
|
|
|
:visible.sync="modelVisible" |
|
|
|
|
|
|
|
width="400px" |
|
|
|
|
|
|
|
:close-on-click-modal="false" |
|
|
|
custom-class="model-dia"> |
|
|
|
custom-class="model-dia"> |
|
|
|
<el-select class="w-100" v-model="modelType" size="mini"> |
|
|
|
<el-select class="w-100" |
|
|
|
<el-option v-for="item in modelOp" :key="item.id" :label="item.name" :value="item.id"> |
|
|
|
v-model="modelType" |
|
|
|
|
|
|
|
size="mini"> |
|
|
|
|
|
|
|
<el-option v-for="item in modelOp" |
|
|
|
|
|
|
|
:key="item.id" |
|
|
|
|
|
|
|
:label="item.name" |
|
|
|
|
|
|
|
:value="item.id"> |
|
|
|
</el-option> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</el-select> |
|
|
|
<!-- <el-radio-group v-model="modelType" |
|
|
|
<!-- <el-radio-group v-model="modelType" |
|
|
@ -66,80 +115,161 @@ |
|
|
|
</el-radio-group> --> |
|
|
|
</el-radio-group> --> |
|
|
|
<!-- <el-divider></el-divider> --> |
|
|
|
<!-- <el-divider></el-divider> --> |
|
|
|
<div class="model-wrap"> |
|
|
|
<div class="model-wrap"> |
|
|
|
<el-tree v-if="!modelType" :data="schoolModel" ref="tree" default-expand-all @check-change="treeCheckChange" |
|
|
|
<el-tree v-if="!modelType" |
|
|
|
show-checkbox :check-strictly="true" node-key="id" |
|
|
|
:data="schoolModel" |
|
|
|
:props="{ children: 'children', label: 'categoryName', isLeaf: 'leaf' }" v-loading="modelLoading"> |
|
|
|
ref="tree" |
|
|
|
|
|
|
|
default-expand-all |
|
|
|
|
|
|
|
@check-change="treeCheckChange" |
|
|
|
|
|
|
|
show-checkbox |
|
|
|
|
|
|
|
:check-strictly="true" |
|
|
|
|
|
|
|
node-key="id" |
|
|
|
|
|
|
|
:props="{children: 'children', label: 'categoryName', isLeaf: 'leaf'}" |
|
|
|
|
|
|
|
v-loading="modelLoading"> |
|
|
|
</el-tree> |
|
|
|
</el-tree> |
|
|
|
<el-tree v-if="modelType" :data="systemModel" ref="tree" default-expand-all @check-change="treeCheckChange" |
|
|
|
<el-tree v-if="modelType" |
|
|
|
show-checkbox :check-strictly="true" node-key="id" |
|
|
|
:data="systemModel" |
|
|
|
:props="{ children: 'children', label: 'categoryName', isLeaf: 'leaf' }" v-loading="modelLoading"> |
|
|
|
ref="tree" |
|
|
|
|
|
|
|
default-expand-all |
|
|
|
|
|
|
|
@check-change="treeCheckChange" |
|
|
|
|
|
|
|
show-checkbox |
|
|
|
|
|
|
|
:check-strictly="true" |
|
|
|
|
|
|
|
node-key="id" |
|
|
|
|
|
|
|
:props="{children: 'children', label: 'categoryName', isLeaf: 'leaf'}" |
|
|
|
|
|
|
|
v-loading="modelLoading"> |
|
|
|
</el-tree> |
|
|
|
</el-tree> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
<span slot="footer" |
|
|
|
<el-button size="small" @click="modelVisible = false">取消</el-button> |
|
|
|
class="dialog-footer"> |
|
|
|
<el-button size="small" type="primary" @click="submit">导入</el-button> |
|
|
|
<el-button size="small" |
|
|
|
|
|
|
|
@click="modelVisible = false">取消</el-button> |
|
|
|
|
|
|
|
<el-button size="small" |
|
|
|
|
|
|
|
type="primary" |
|
|
|
|
|
|
|
@click="submit">导入</el-button> |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
</el-dialog> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
|
|
|
<el-dialog title="我的代码" :visible.sync="codeVisible" width="1200px" :close-on-click-modal="false" |
|
|
|
<el-dialog title="我的代码" |
|
|
|
|
|
|
|
:visible.sync="codeVisible" |
|
|
|
|
|
|
|
width="1200px" |
|
|
|
|
|
|
|
:close-on-click-modal="false" |
|
|
|
custom-class="code-dia"> |
|
|
|
custom-class="code-dia"> |
|
|
|
<el-tooltip class="item" content="列表中展示当前课程已提交的实验代码" placement="right"> |
|
|
|
<el-tooltip class="item" |
|
|
|
<i class="info el-icon-warning" style="margin-right: 10px"></i> |
|
|
|
content="列表中展示当前课程已提交的实验代码" |
|
|
|
|
|
|
|
placement="right"> |
|
|
|
|
|
|
|
<i class="info el-icon-warning" |
|
|
|
|
|
|
|
style="margin-right: 10px"></i> |
|
|
|
</el-tooltip> |
|
|
|
</el-tooltip> |
|
|
|
<div class="tool"> |
|
|
|
<div class="tool"> |
|
|
|
<el-input style="width: 250px" placeholder="请输入项目名称、判分点名称" v-model="keyword" suffix-icon="el-icon-search" |
|
|
|
<el-input style="width: 250px" |
|
|
|
clearable size="small"></el-input> |
|
|
|
placeholder="请输入项目名称、判分点名称" |
|
|
|
|
|
|
|
v-model="keyword" |
|
|
|
|
|
|
|
suffix-icon="el-icon-search" |
|
|
|
|
|
|
|
clearable |
|
|
|
|
|
|
|
size="small"></el-input> |
|
|
|
<div class="action"> |
|
|
|
<div class="action"> |
|
|
|
<el-button class="cus-btn" type="primary" size="small" @click="delAll">批量删除</el-button> |
|
|
|
<el-button class="cus-btn" |
|
|
|
|
|
|
|
type="primary" |
|
|
|
|
|
|
|
size="small" |
|
|
|
|
|
|
|
@click="delAll">批量删除</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<el-table :data="codeList" class="cus-table" ref="table" stripe max-height="400" header-align="center" |
|
|
|
<el-table :data="codeList" |
|
|
|
|
|
|
|
class="cus-table" |
|
|
|
|
|
|
|
ref="table" |
|
|
|
|
|
|
|
stripe |
|
|
|
|
|
|
|
max-height="400" |
|
|
|
|
|
|
|
header-align="center" |
|
|
|
@selection-change="handleSelectionChange"> |
|
|
|
@selection-change="handleSelectionChange"> |
|
|
|
<el-table-column type="selection" width="60" align="center"></el-table-column> |
|
|
|
<el-table-column type="selection" |
|
|
|
<el-table-column type="index" label="序号" width="55" align="center"></el-table-column> |
|
|
|
width="60" |
|
|
|
<el-table-column prop="judgmentName" label="判分点" min-width="250" align="center" |
|
|
|
align="center"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column type="index" |
|
|
|
|
|
|
|
label="序号" |
|
|
|
|
|
|
|
width="55" |
|
|
|
|
|
|
|
align="center"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column prop="judgmentName" |
|
|
|
|
|
|
|
label="判分点" |
|
|
|
|
|
|
|
min-width="250" |
|
|
|
|
|
|
|
align="center" |
|
|
|
show-overflow-tooltip></el-table-column> |
|
|
|
show-overflow-tooltip></el-table-column> |
|
|
|
<el-table-column prop="projectName" label="项目名称" min-width="250" align="center" |
|
|
|
<el-table-column prop="projectName" |
|
|
|
|
|
|
|
label="项目名称" |
|
|
|
|
|
|
|
min-width="250" |
|
|
|
|
|
|
|
align="center" |
|
|
|
show-overflow-tooltip></el-table-column> |
|
|
|
show-overflow-tooltip></el-table-column> |
|
|
|
<el-table-column prop="submitTime" label="提交时间" width="140" align="center"></el-table-column> |
|
|
|
<el-table-column prop="submitTime" |
|
|
|
<el-table-column prop="score" label="是否得分" width="80" align="center"></el-table-column> |
|
|
|
label="提交时间" |
|
|
|
<el-table-column width="190" label="操作" align="center"> |
|
|
|
width="140" |
|
|
|
|
|
|
|
align="center"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column prop="score" |
|
|
|
|
|
|
|
label="是否得分" |
|
|
|
|
|
|
|
width="80" |
|
|
|
|
|
|
|
align="center"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column width="190" |
|
|
|
|
|
|
|
label="操作" |
|
|
|
|
|
|
|
align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-button type="text" @click="showCode(scope.row)">查看代码</el-button> |
|
|
|
<el-button type="text" |
|
|
|
<el-button type="text" @click="importCode(scope.row)">插入代码</el-button> |
|
|
|
@click="showCode(scope.row)">查看代码</el-button> |
|
|
|
<el-button type="text" @click="del(scope.row)">删除</el-button> |
|
|
|
<el-button type="text" |
|
|
|
|
|
|
|
@click="importCode(scope.row)">插入代码</el-button> |
|
|
|
|
|
|
|
<el-button type="text" |
|
|
|
|
|
|
|
@click="del(scope.row)">删除</el-button> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
</el-table> |
|
|
|
<div class="pagination"> |
|
|
|
<div class="pagination"> |
|
|
|
<el-pagination background layout="total,prev, pager, next" :current-page="page" |
|
|
|
<el-pagination background |
|
|
|
@current-change="handleCurrentChange" :total="total"></el-pagination> |
|
|
|
layout="total,prev, pager, next" |
|
|
|
|
|
|
|
:current-page="page" |
|
|
|
|
|
|
|
@current-change="handleCurrentChange" |
|
|
|
|
|
|
|
:total="total"></el-pagination> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
<span slot="footer" |
|
|
|
<el-button size="small" type="primary" @click="codeVisible = false">关闭</el-button> |
|
|
|
class="dialog-footer"> |
|
|
|
|
|
|
|
<el-button size="small" |
|
|
|
|
|
|
|
type="primary" |
|
|
|
|
|
|
|
@click="codeVisible = false">关闭</el-button> |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
</el-dialog> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
|
|
|
<el-dialog :title="curRow.judgmentName" :visible.sync="showVisible" width="700px" :close-on-click-modal="false" |
|
|
|
<el-dialog :title="curRow.judgmentName" |
|
|
|
|
|
|
|
:visible.sync="showVisible" |
|
|
|
|
|
|
|
width="700px" |
|
|
|
|
|
|
|
:close-on-click-modal="false" |
|
|
|
custom-class="code-dia"> |
|
|
|
custom-class="code-dia"> |
|
|
|
<el-tabs class="code-tab" v-model="showActive"> |
|
|
|
<el-tabs class="code-tab" |
|
|
|
<el-tab-pane label="代码" name="code"> |
|
|
|
v-model="showActive"> |
|
|
|
<codemirror class="code" v-model="curCode" :options="cmOptionDia"></codemirror> |
|
|
|
<el-tab-pane label="代码" |
|
|
|
|
|
|
|
name="code"> |
|
|
|
|
|
|
|
<codemirror class="code" |
|
|
|
|
|
|
|
v-model="curCode" |
|
|
|
|
|
|
|
:options="cmOptionDia"></codemirror> |
|
|
|
</el-tab-pane> |
|
|
|
</el-tab-pane> |
|
|
|
<el-tab-pane label="结果" name="result"> |
|
|
|
<el-tab-pane label="结果" |
|
|
|
|
|
|
|
name="result"> |
|
|
|
<div style="position: relative"> |
|
|
|
<div style="position: relative"> |
|
|
|
<div class="result" v-html="curRow.runResults"></div> |
|
|
|
<div class="result" |
|
|
|
<div v-if="curPhotoUrl.length" class="pics"> |
|
|
|
v-html="curRow.runResults"></div> |
|
|
|
<div class="pic-item" v-for="(img, i) in curPhotoUrl" :key="i"> |
|
|
|
<div v-if="curPhotoUrl.length" |
|
|
|
<el-image class="pic" :src="img" :preview-src-list="curPhotoUrl"> |
|
|
|
class="pics"> |
|
|
|
|
|
|
|
<div class="pic-item" |
|
|
|
|
|
|
|
v-for="(img, i) in curPhotoUrl" |
|
|
|
|
|
|
|
:key="i"> |
|
|
|
|
|
|
|
<el-image class="pic" |
|
|
|
|
|
|
|
:src="img" |
|
|
|
|
|
|
|
:preview-src-list="curPhotoUrl"> |
|
|
|
</el-image> |
|
|
|
</el-image> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-tab-pane> |
|
|
|
</el-tab-pane> |
|
|
|
</el-tabs> |
|
|
|
</el-tabs> |
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
<span slot="footer" |
|
|
|
<el-button size="small" type="primary" @click="showSubmit">插入代码</el-button> |
|
|
|
class="dialog-footer"> |
|
|
|
|
|
|
|
<el-button size="small" |
|
|
|
|
|
|
|
type="primary" |
|
|
|
|
|
|
|
@click="showSubmit">插入代码</el-button> |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
</el-dialog> |
|
|
|
</el-dialog> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -461,11 +591,8 @@ export default { |
|
|
|
// 终止运行 |
|
|
|
// 终止运行 |
|
|
|
async stopRunCode () { |
|
|
|
async stopRunCode () { |
|
|
|
this.isStopRunCode = 1 |
|
|
|
this.isStopRunCode = 1 |
|
|
|
if (this.pid) { |
|
|
|
if (this.pid) await this.$post(`${this.api.endRunningProcess}?pid=${this.pid}`) |
|
|
|
const { pid } = this |
|
|
|
|
|
|
|
this.pid = '' |
|
|
|
this.pid = '' |
|
|
|
await this.$post(`${this.api.endRunningProcess}?pid=${pid}`) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (this.loadIns) this.loadIns.close() |
|
|
|
if (this.loadIns) this.loadIns.close() |
|
|
|
}, |
|
|
|
}, |
|
|
|
inputRunCode (data) { |
|
|
|
inputRunCode (data) { |
|
|
@ -522,7 +649,7 @@ export default { |
|
|
|
bcId: this.judgmentId, |
|
|
|
bcId: this.judgmentId, |
|
|
|
cid: this.courseId, |
|
|
|
cid: this.courseId, |
|
|
|
projectId: this.projectId, |
|
|
|
projectId: this.projectId, |
|
|
|
type: Cookie.get('admin-language'), |
|
|
|
type: 0, |
|
|
|
sort: this.index |
|
|
|
sort: this.index |
|
|
|
}, { |
|
|
|
}, { |
|
|
|
headers: { |
|
|
|
headers: { |
|
|
@ -574,6 +701,7 @@ export default { |
|
|
|
if (data) { |
|
|
|
if (data) { |
|
|
|
const photo = data.photoUrl |
|
|
|
const photo = data.photoUrl |
|
|
|
const result = data.runResult || '' |
|
|
|
const result = data.runResult || '' |
|
|
|
|
|
|
|
// this.$emit('cache') // 每次运行代码都要把代码传给后端做缓存 |
|
|
|
if (this.loadIns) this.loadIns.close() |
|
|
|
if (this.loadIns) this.loadIns.close() |
|
|
|
this.picSrcList = [] |
|
|
|
this.picSrcList = [] |
|
|
|
this.$emit('update:photoUrl', '') |
|
|
|
this.$emit('update:photoUrl', '') |
|
|
@ -652,7 +780,7 @@ export default { |
|
|
|
bcId, |
|
|
|
bcId, |
|
|
|
cid, |
|
|
|
cid, |
|
|
|
projectId, |
|
|
|
projectId, |
|
|
|
type: Cookie.get('admin-language'), |
|
|
|
type: 0, |
|
|
|
sort: this.index |
|
|
|
sort: this.index |
|
|
|
}).then(res => { |
|
|
|
}).then(res => { |
|
|
|
this.$emit('update:finalCode', code) |
|
|
|
this.$emit('update:finalCode', code) |
|
|
@ -680,7 +808,7 @@ export default { |
|
|
|
bcId, |
|
|
|
bcId, |
|
|
|
cid, |
|
|
|
cid, |
|
|
|
projectId, |
|
|
|
projectId, |
|
|
|
type: Cookie.get('admin-language'), |
|
|
|
type: 0, |
|
|
|
sort: this.index |
|
|
|
sort: this.index |
|
|
|
}).then(res => { |
|
|
|
}).then(res => { |
|
|
|
this.$emit('update:finalCode', code) |
|
|
|
this.$emit('update:finalCode', code) |
|
|
@ -838,20 +966,16 @@ export default { |
|
|
|
.code-wrap { |
|
|
|
.code-wrap { |
|
|
|
position: relative; |
|
|
|
position: relative; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.left { |
|
|
|
.left { |
|
|
|
position: relative; |
|
|
|
position: relative; |
|
|
|
width: 60%; |
|
|
|
width: 60%; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.text-wrapper { |
|
|
|
.text-wrapper { |
|
|
|
white-space: pre-wrap; |
|
|
|
white-space: pre-wrap; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/deep/.CodeMirror-code { |
|
|
|
/deep/.CodeMirror-code { |
|
|
|
font-family: 'Microsoft Yahei'; |
|
|
|
font-family: 'Microsoft Yahei'; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/deep/.answer { |
|
|
|
/deep/.answer { |
|
|
|
.el-tab-pane { |
|
|
|
.el-tab-pane { |
|
|
|
padding: 0 10px; |
|
|
|
padding: 0 10px; |
|
|
@ -860,48 +984,38 @@ export default { |
|
|
|
overflow-y: auto; |
|
|
|
overflow-y: auto; |
|
|
|
white-space: pre-wrap; |
|
|
|
white-space: pre-wrap; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.el-dialog--center { |
|
|
|
.el-dialog--center { |
|
|
|
width: 500px; |
|
|
|
width: 500px; |
|
|
|
height: 500px; |
|
|
|
height: 500px; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.el-dialog__title { |
|
|
|
.el-dialog__title { |
|
|
|
font-size: 22px; |
|
|
|
font-size: 22px; |
|
|
|
font-weight: 500; |
|
|
|
font-weight: 500; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.el-tabs__nav-wrap::after { |
|
|
|
.el-tabs__nav-wrap::after { |
|
|
|
background-color: #333; |
|
|
|
background-color: #333; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.el-tabs__active-bar { |
|
|
|
.el-tabs__active-bar { |
|
|
|
height: 0; |
|
|
|
height: 0; |
|
|
|
background-color: #fff; |
|
|
|
background-color: #fff; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.el-tabs__header { |
|
|
|
.el-tabs__header { |
|
|
|
background-color: #333; |
|
|
|
background-color: #333; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.el-dialog--center .el-dialog__body { |
|
|
|
.el-dialog--center .el-dialog__body { |
|
|
|
padding: 0; |
|
|
|
padding: 0; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.el-tabs__item { |
|
|
|
.el-tabs__item { |
|
|
|
width: 80px; |
|
|
|
width: 80px; |
|
|
|
color: #fff; |
|
|
|
color: #fff; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.el-tabs--top .el-tabs__item.is-top:nth-child(2) { |
|
|
|
.el-tabs--top .el-tabs__item.is-top:nth-child(2) { |
|
|
|
padding-left: 20px; |
|
|
|
padding-left: 20px; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.el-tabs__item.is-active { |
|
|
|
.el-tabs__item.is-active { |
|
|
|
color: #fff !important; |
|
|
|
color: #fff !important; |
|
|
|
background-color: #333 !important; |
|
|
|
background-color: #333 !important; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.tips-btn { |
|
|
|
.tips-btn { |
|
|
|
margin-top: 10px; |
|
|
|
margin-top: 10px; |
|
|
|
height: 40px; |
|
|
|
height: 40px; |
|
|
@ -911,7 +1025,6 @@ export default { |
|
|
|
right: 0; |
|
|
|
right: 0; |
|
|
|
background: rgba(255, 49, 49, 1); |
|
|
|
background: rgba(255, 49, 49, 1); |
|
|
|
color: rgba(255, 255, 255, 1); |
|
|
|
color: rgba(255, 255, 255, 1); |
|
|
|
|
|
|
|
|
|
|
|
&:hover, |
|
|
|
&:hover, |
|
|
|
&:focus, |
|
|
|
&:focus, |
|
|
|
&:active { |
|
|
|
&:active { |
|
|
@ -920,7 +1033,6 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.del { |
|
|
|
.del { |
|
|
|
width: 40px; |
|
|
|
width: 40px; |
|
|
|
margin: 0 10px; |
|
|
|
margin: 0 10px; |
|
|
@ -930,21 +1042,17 @@ export default { |
|
|
|
border-radius: 50%; |
|
|
|
border-radius: 50%; |
|
|
|
background-color: #f00; |
|
|
|
background-color: #f00; |
|
|
|
cursor: pointer; |
|
|
|
cursor: pointer; |
|
|
|
|
|
|
|
|
|
|
|
&:hover { |
|
|
|
&:hover { |
|
|
|
opacity: 0.9; |
|
|
|
opacity: 0.9; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.result-right { |
|
|
|
.result-right { |
|
|
|
background-color: rgba(43, 40, 22, 1); |
|
|
|
background-color: rgba(43, 40, 22, 1); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.result-wrong { |
|
|
|
.result-wrong { |
|
|
|
background-color: rgba(43, 22, 22, 1); |
|
|
|
background-color: rgba(43, 22, 22, 1); |
|
|
|
color: #f00; |
|
|
|
color: #f00; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.result-wrong, |
|
|
|
.result-wrong, |
|
|
|
.result-right { |
|
|
|
.result-right { |
|
|
|
position: absolute; |
|
|
|
position: absolute; |
|
|
@ -953,7 +1061,6 @@ export default { |
|
|
|
display: flex; |
|
|
|
display: flex; |
|
|
|
bottom: 10px; |
|
|
|
bottom: 10px; |
|
|
|
padding: 0 10px; |
|
|
|
padding: 0 10px; |
|
|
|
|
|
|
|
|
|
|
|
img { |
|
|
|
img { |
|
|
|
width: 40px; |
|
|
|
width: 40px; |
|
|
|
height: 40px; |
|
|
|
height: 40px; |
|
|
@ -961,7 +1068,6 @@ export default { |
|
|
|
margin-right: 10px; |
|
|
|
margin-right: 10px; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.line { |
|
|
|
.line { |
|
|
|
z-index: 2; |
|
|
|
z-index: 2; |
|
|
|
position: absolute; |
|
|
|
position: absolute; |
|
|
@ -971,7 +1077,6 @@ export default { |
|
|
|
height: 100%; |
|
|
|
height: 100%; |
|
|
|
cursor: e-resize; |
|
|
|
cursor: e-resize; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.code-right { |
|
|
|
.code-right { |
|
|
|
width: 40%; |
|
|
|
width: 40%; |
|
|
|
color: #fff; |
|
|
|
color: #fff; |
|
|
@ -979,7 +1084,6 @@ export default { |
|
|
|
display: inline-block; |
|
|
|
display: inline-block; |
|
|
|
position: relative; |
|
|
|
position: relative; |
|
|
|
overflow-x: auto; |
|
|
|
overflow-x: auto; |
|
|
|
|
|
|
|
|
|
|
|
p { |
|
|
|
p { |
|
|
|
font-size: 18px; |
|
|
|
font-size: 18px; |
|
|
|
margin: 10px; |
|
|
|
margin: 10px; |
|
|
@ -988,16 +1092,13 @@ export default { |
|
|
|
height: calc(100vh - 387px); |
|
|
|
height: calc(100vh - 387px); |
|
|
|
overflow: auto; |
|
|
|
overflow: auto; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.pic-num0 { |
|
|
|
.pic-num0 { |
|
|
|
height: calc(100vh - 247px); |
|
|
|
height: calc(100vh - 247px); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.pic-num1 { |
|
|
|
.pic-num1 { |
|
|
|
height: calc(100vh - 520px); |
|
|
|
height: calc(100vh - 520px); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.pic-wrap { |
|
|
|
.pic-wrap { |
|
|
|
position: absolute; |
|
|
|
position: absolute; |
|
|
|
left: 0; |
|
|
|
left: 0; |
|
|
@ -1008,30 +1109,24 @@ export default { |
|
|
|
margin: 0 auto; |
|
|
|
margin: 0 auto; |
|
|
|
text-align: center; |
|
|
|
text-align: center; |
|
|
|
overflow: auto; |
|
|
|
overflow: auto; |
|
|
|
|
|
|
|
|
|
|
|
&.wrong { |
|
|
|
&.wrong { |
|
|
|
bottom: 60px; |
|
|
|
bottom: 60px; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.pic-item { |
|
|
|
.pic-item { |
|
|
|
margin: 0 5px 5px; |
|
|
|
margin: 0 5px 5px; |
|
|
|
|
|
|
|
|
|
|
|
.pic-inner { |
|
|
|
.pic-inner { |
|
|
|
height: 100px; |
|
|
|
height: 100px; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
&:only-child { |
|
|
|
&:only-child { |
|
|
|
.pic-inner { |
|
|
|
.pic-inner { |
|
|
|
height: auto; |
|
|
|
height: auto; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.pic { |
|
|
|
.pic { |
|
|
|
width: 50%; |
|
|
|
width: 50%; |
|
|
|
max-height: none; |
|
|
|
max-height: none; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.pic { |
|
|
|
.pic { |
|
|
|
display: block; |
|
|
|
display: block; |
|
|
|
width: 100px; |
|
|
|
width: 100px; |
|
|
@ -1040,7 +1135,6 @@ export default { |
|
|
|
margin: 0 auto 10px; |
|
|
|
margin: 0 auto 10px; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.code-mask { |
|
|
|
.code-mask { |
|
|
|
z-index: 2; |
|
|
|
z-index: 2; |
|
|
|
position: absolute; |
|
|
|
position: absolute; |
|
|
@ -1049,7 +1143,6 @@ export default { |
|
|
|
bottom: 0; |
|
|
|
bottom: 0; |
|
|
|
right: 0; |
|
|
|
right: 0; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.btns { |
|
|
|
.btns { |
|
|
|
z-index: 99; |
|
|
|
z-index: 99; |
|
|
|
position: absolute; |
|
|
|
position: absolute; |
|
|
@ -1057,78 +1150,63 @@ export default { |
|
|
|
bottom: 15px; |
|
|
|
bottom: 15px; |
|
|
|
display: flex; |
|
|
|
display: flex; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.run { |
|
|
|
.run { |
|
|
|
width: 100px; |
|
|
|
width: 100px; |
|
|
|
color: #fff; |
|
|
|
color: #fff; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.download-btn { |
|
|
|
.download-btn { |
|
|
|
color: #fff; |
|
|
|
color: #fff; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/deep/.answer-wrap { |
|
|
|
/deep/.answer-wrap { |
|
|
|
&.client { |
|
|
|
&.client { |
|
|
|
user-select: none; |
|
|
|
user-select: none; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
pre { |
|
|
|
pre { |
|
|
|
width: 100%; |
|
|
|
width: 100%; |
|
|
|
white-space: pre-wrap; |
|
|
|
white-space: pre-wrap; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
img { |
|
|
|
img { |
|
|
|
max-width: 100%; |
|
|
|
max-width: 100%; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/deep/.model-dia { |
|
|
|
/deep/.model-dia { |
|
|
|
.el-dialog__body { |
|
|
|
.el-dialog__body { |
|
|
|
padding: 0 20px; |
|
|
|
padding: 0 20px; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.el-divider--horizontal { |
|
|
|
.el-divider--horizontal { |
|
|
|
margin: 15px 0; |
|
|
|
margin: 15px 0; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.model-wrap { |
|
|
|
.model-wrap { |
|
|
|
max-height: 400px; |
|
|
|
max-height: 400px; |
|
|
|
overflow: auto; |
|
|
|
overflow: auto; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/deep/.code-dia { |
|
|
|
/deep/.code-dia { |
|
|
|
.el-dialog__header { |
|
|
|
.el-dialog__header { |
|
|
|
padding: 0 40px 0 20px; |
|
|
|
padding: 0 40px 0 20px; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.el-dialog__body { |
|
|
|
.el-dialog__body { |
|
|
|
padding: 0 20px; |
|
|
|
padding: 0 20px; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.info { |
|
|
|
.info { |
|
|
|
position: absolute; |
|
|
|
position: absolute; |
|
|
|
top: 18px; |
|
|
|
top: 18px; |
|
|
|
left: 100px; |
|
|
|
left: 100px; |
|
|
|
color: #88aef5; |
|
|
|
color: #88aef5; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.code-tab { |
|
|
|
.code-tab { |
|
|
|
.el-tabs__item.is-active { |
|
|
|
.el-tabs__item.is-active { |
|
|
|
color: #333 !important; |
|
|
|
color: #333 !important; |
|
|
|
background-color: transparent; |
|
|
|
background-color: transparent; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.tool { |
|
|
|
.tool { |
|
|
|
display: flex; |
|
|
|
display: flex; |
|
|
|
justify-content: space-between; |
|
|
|
justify-content: space-between; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.code { |
|
|
|
.code { |
|
|
|
margin-top: 10px; |
|
|
|
margin-top: 10px; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.result { |
|
|
|
.result { |
|
|
|
max-height: 300px; |
|
|
|
max-height: 300px; |
|
|
|
font-size: 18px; |
|
|
|
font-size: 18px; |
|
|
@ -1137,15 +1215,12 @@ export default { |
|
|
|
color: #333; |
|
|
|
color: #333; |
|
|
|
overflow: auto; |
|
|
|
overflow: auto; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.pics { |
|
|
|
.pics { |
|
|
|
display: flex; |
|
|
|
display: flex; |
|
|
|
margin-top: 20px; |
|
|
|
margin-top: 20px; |
|
|
|
overflow: auto; |
|
|
|
overflow: auto; |
|
|
|
|
|
|
|
|
|
|
|
.pic-item { |
|
|
|
.pic-item { |
|
|
|
margin: 0 5px 5px; |
|
|
|
margin: 0 5px 5px; |
|
|
|
|
|
|
|
|
|
|
|
&:only-child { |
|
|
|
&:only-child { |
|
|
|
.pic { |
|
|
|
.pic { |
|
|
|
width: 50%; |
|
|
|
width: 50%; |
|
|
@ -1153,7 +1228,6 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.pic { |
|
|
|
.pic { |
|
|
|
display: block; |
|
|
|
display: block; |
|
|
|
width: 100px; |
|
|
|
width: 100px; |
|
|
|