Compare commits

..

16 Commits

  1. 10
      package-lock.json
  2. 2
      package.json
  3. 16
      src/App.vue
  4. 15
      src/api/http.js
  5. 2
      src/api/index.js
  6. 509
      src/components/TestPanel.vue
  7. 19
      src/components/breadcrumb/index.vue
  8. 328
      src/components/codemirror.vue
  9. 17
      src/components/tinymceConfig.js
  10. 32
      src/components/upload/config.js
  11. 11
      src/components/upload/upload.js
  12. 9
      src/config/index.js
  13. 18
      src/styles/common.scss
  14. 42
      src/util/index.js
  15. 227
      src/views/Home.vue
  16. 208
      src/views/Report.vue

10
package-lock.json generated

@ -4666,6 +4666,11 @@
"randomfill": "^1.0.3"
}
},
"crypto-js": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-4.2.0.tgz",
"integrity": "sha512-KALDyEYgpY+Rlob/iriUtjV6d5Eq+Y191A5g4UqLAi8CyGP9N1+FdVbkc1SxKc2r4YAYqG8JzO2KGL+AizD70Q=="
},
"css": {
"version": "2.2.4",
"resolved": "https://registry.npm.taobao.org/css/download/css-2.2.4.tgz",
@ -8912,6 +8917,11 @@
"integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=",
"dev": true
},
"jsencrypt": {
"version": "3.3.2",
"resolved": "https://registry.npmjs.org/jsencrypt/-/jsencrypt-3.3.2.tgz",
"integrity": "sha512-arQR1R1ESGdAxY7ZheWr12wCaF2yF47v5qpB76TtV64H1pyGudk9Hvw8Y9tb/FiTIaaTRUyaSnm5T/Y53Ghm/A=="
},
"jsesc": {
"version": "2.5.2",
"resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz",

@ -13,12 +13,14 @@
"axios": "^0.19.2",
"clipboard": "^2.0.10",
"core-js": "^3.19.3",
"crypto-js": "^4.2.0",
"element-ui": "^2.15.6",
"file-saver": "^2.0.5",
"html2canvas": "^1.4.1",
"image-webpack-loader": "^8.1.0",
"jquery": "^3.6.0",
"js-cookie": "^3.0.1",
"jsencrypt": "^3.3.2",
"jspdf": "^2.5.1",
"lib-flexible": "^0.3.2",
"mavon-editor": "^2.10.4",

@ -5,6 +5,7 @@
</template>
<script>
import Util from '@/util'
export default {
name: "App",
created () {
@ -17,10 +18,20 @@ export default {
JSON.parse(sessionStorage.getItem("store"))
)
);
} //vuexsessionStorage
}
//
if (!document.referrer) {
Util.exit()
return false
}
//vuexsessionStorage
window.addEventListener("beforeunload", () => {
localStorage.removeItem('opened')
sessionStorage.setItem("store", JSON.stringify(this.$store.state));
});
}
};
</script>
@ -32,9 +43,8 @@ export default {
-moz-osx-font-smoothing: grayscale;
color: #2c3e50;
}
body {
margin: 0;
}
</style>

@ -5,6 +5,7 @@ import {
import router from '../router/index'
import Cookie from 'js-cookie'
import config from '@/config'
import Util from '@/util'
const service = axios.create({
baseURL: config.host,
@ -30,12 +31,22 @@ service.interceptors.request.use(config => {
return Promise.reject(err);
})
let logouted = 0;
// 响应拦截器
service.interceptors.response.use(
response => {
const res = response.data;
if (res.status == 200 || res.status == 10000 || res.status == 30001) {
return Promise.resolve(res).catch(e => { });
} else if (res.code === 401) {
// 账号互踢
if (!logouted) {
Message.error(res.msg.includes('顶') ? '您的账号已在其他设备登录,您已被迫下线!' : '登录过期,请重新登录!')
setTimeout(() => {
Util.exit()
}, 1500)
logouted = 1
}
} else if (!res.status) {
return Promise.resolve(res).catch(e => { });
} else {
@ -49,13 +60,15 @@ service.interceptors.response.use(
switch (error.response.status) {
// 401: 未登录
case 401:
if (!logouted) {
Message.error('登录过期,请重新登录')
setTimeout(() => {
history.back()
}, 1500)
logouted = 1
}
break;
default:
// Message.error(error.response.data.message)
Promise.reject(error.response);
}
return Promise.reject(error.response);

@ -1,5 +1,6 @@
import config from '@/config'
export default {
encrypt: `nakadai/data/encrypt`,
getCurrentTime: `competition/competition/management/getCurrentTime`,
getProjectDetail: 'occupationlab/occupationlab/projectManage/getProjectDetail',
submit: 'python/python/submit',
@ -46,4 +47,5 @@ export default {
createQueue: `python/rabbitMessage/createQueue`,
endRunningProcess: `python/python/endRunningProcess`,
sendMessageToUser: `python/rabbitMessage/sendMessageToUser`,
deleteTheLastUncommittedRecord: `python/python/deleteTheLastUncommittedRecord`,
}

File diff suppressed because it is too large Load Diff

@ -3,14 +3,11 @@
<div class="breadcrumb">
<el-breadcrumb separator=">">
<template v-for="(item, index) in pages">
<el-breadcrumb-item
v-if="index != pages.length - 1"
:key="index"
>
<el-breadcrumb-item v-if="index != pages.length - 1"
:key="index">
<span @click="toPath">{{item}}</span>
</el-breadcrumb-item>
<el-breadcrumb-item
v-else
<el-breadcrumb-item v-else
:key="index">
{{item}}
</el-breadcrumb-item>
@ -26,13 +23,6 @@ export default {
type: String,
required: true
},
route: {
type: String,
default: '/'
},
query: {
type: Object
}
},
data () {
return {
@ -44,7 +34,6 @@ export default {
this.pages = data.split('/')
},
toPath () {
console.log(33)
this.$router.back()
}
}
@ -63,7 +52,7 @@ export default {
}
&:last-child {
.is-link {
color: #0B1D30;
color: #0b1d30;
}
}
}

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

@ -4,7 +4,7 @@ export default {
//skin:'oxide-dark',
language: 'zh_CN',
language_url: './styles/tinymce/langs/zh_CN.js',
plugins: 'print preview searchreplace autolink directionality visualblocks visualchars fullscreen image link media template codesample table charmap hr pagebreak nonbreaking anchor insertdatetime advlist lists wordcount imagetools textpattern help emoticons autosave autoresize',
plugins: 'print preview searchreplace autolink directionality visualblocks visualchars fullscreen image link media template codesample table charmap hr pagebreak nonbreaking anchor insertdatetime advlist lists wordcount imagetools textpattern help emoticons autoresize',
toolbar: 'code undo redo restoredraft | cut copy pastetext | forecolor backcolor headings fontsize lineHeight bold italic underline strikethrough link anchor | alignleft aligncenter alignright alignjustify | \
styleselect fontselect fontsizeselect | bullist numlist | blockquote subscript superscript removeformat | \
table image media charmap emoticons hr pagebreak insertdatetime print preview | fullscreen | indent2em',
@ -212,7 +212,8 @@ export default {
},
//为内容模板插件提供预置模板
templates: [
{ title: '个股分析报告', description: '', content: `
{
title: '个股分析报告', description: '', content: `
<div class="tiny-report">
<h2>个股分析报告</h2>
<h6>1.引言</h6>
@ -271,7 +272,8 @@ export default {
`
},
{ title: '行业数据分析报告', description: '', content: `
{
title: '行业数据分析报告', description: '', content: `
<div class="tiny-report">
<h2>行业数据分析报告</h2>
<h6>1.引言</h6>
@ -344,7 +346,8 @@ export default {
`
},
{ title: '宏观数据分析报告', description: '', content: `
{
title: '宏观数据分析报告', description: '', content: `
<div class="tiny-report">
<h2>宏观数据分析报告</h2>
<h6>1.引言</h6>
@ -403,7 +406,8 @@ export default {
`
},
{ title: '可视化报告', description: '', content: `
{
title: '可视化报告', description: '', content: `
<div class="tiny-report">
<h2>可视化报告</h2>
<h6>1.封面</h6>
@ -474,7 +478,8 @@ export default {
`
},
{ title: '数据分析报告', description: '', content: `
{
title: '数据分析报告', description: '', content: `
<div class="tiny-report">
<h2>数据分析报告</h2>
<h6>1.引言</h6>

@ -1,15 +1,41 @@
/**
* 阿里云oss配置
* */
import { get } from '@/api/http'
import api from '@/api'
import CryptoJS from 'crypto-js'
import JSEncrypt from 'jsencrypt'
export default {
const A = (key, encryptedData) => {
const keyHex = CryptoJS.enc.Base64.parse(key)
const decrypted = CryptoJS.AES.decrypt(encryptedData, keyHex, {
mode: CryptoJS.mode.ECB,
padding: CryptoJS.pad.Pkcs7
})
return decrypted.toString(CryptoJS.enc.Utf8)
}
const R = (encryptedKey, privateKey) => {
const decrypt = new JSEncrypt()
decrypt.setPrivateKey(privateKey)
const decryptedKey = decrypt.decrypt(encryptedKey)
return decryptedKey
}
export default async function () {
try {
const res = await get(api.encrypt)
const RE = A(R(res.encryptedKey, res.privateKey), res.encryptedData).split('/')
return {
// oss账号信息
config: {
region: 'oss-cn-shenzhen',
accessKeyId: 'LTAI4FzqQHnk4rozqLZ8jCNj',
accessKeySecret: 'mveW7B1OyFoKUkHm8WsxmrjHmkJWHq',
accessKeyId: RE[0],
accessKeySecret: RE[1],
bucket: 'huoran'
},
// 上传成功url前置部分(成功回调没有返回url)
preUrl: 'https://huoran.oss-cn-shenzhen.aliyuncs.com/'
}
} catch (e) { }
}

@ -5,10 +5,13 @@ import OssConfig from './config'
import Util from '@/util'
let client = null
let Oss
// 初始化oss
const initOss = () => {
if (!client) client = new OSS(OssConfig.config)
const initOss = async () => {
Oss = await OssConfig()
if (!client) client = new OSS(Oss.config)
}
initOss()
export default {
// 上传文件
@ -21,7 +24,7 @@ export default {
resolve({
format: Util.getFileExt(file.name),
name: file.name,
url: OssConfig.preUrl + res.name,
url: Oss.preUrl + res.name,
size: file.size,
})
} catch (error) {
@ -32,6 +35,6 @@ export default {
// 删除文件(传完整url,不是没有https的name,因为很多接口没有存name,只存url,所以统一使用url)
async del (url) {
initOss()
await client.delete(url.replace(OssConfig.preUrl, ''));
await client.delete(url.replace(Oss.preUrl, ''));
}
}

@ -6,16 +6,17 @@ const isTest = url.includes('121.37.12.51') //测试服
const isHh = url.includes('10.196.131.73') //是否是河海版本
const isPro = url.includes('occupationlab.com') //是否职站生产
const isZxy = url.includes('izhixinyun.com') //是否智信云
let vscodeUrl = 'http://10.60.32.77:8888'
let vscodeUrl = 'http://172.16.40.56:8088/'
let host = location.origin + '/'
// let host = `https://izhixinyun.com/`
let bankPath = `${location.origin}/banksystem` // 银行系统
// 121.37.12.51 | 192.168.31.151
if (isDev) {
host = 'http://192.168.31.51:9000/'
// host = 'http://121.37.12.51:9000/'
// host = 'https://occupationlab.com/'
// host = 'http://192.168.31.51:9000/'
host = 'http://121.37.12.51/'
// host = 'https://izhixinyun.com/'
bankPath = `http://${location.hostname}:8093`
} else if (isPro) {
host = 'https://occupationlab.com/'

@ -103,3 +103,21 @@ body .cus-table.el-table {
.code-load {
bottom: 50px !important;
}
.markdown-body {
ul {
list-style: disc;
li {
list-style: inherit;
}
}
ol {
list-style: decimal;
li {
list-style: inherit;
}
}
}

@ -1,22 +1,7 @@
export default {
getCookie(cookie_name) {
//获取cookie中指定key的value
var allcookies = document.cookie; //索引长度,开始索引的位置
var cookie_pos = allcookies.indexOf(cookie_name); // 如果找到了索引,就代表cookie存在,否则不存在
if (cookie_pos != -1) {
// 把cookie_pos放在值的开始,只要给值加1即可
//计算取cookie值得开始索引,加的1为“=”
cookie_pos = cookie_pos + cookie_name.length + 1; //计算取cookie值得结束索引
var cookie_end = allcookies.indexOf(";", cookie_pos);
import Config from '@/config'
import Cookie from 'js-cookie'
if (cookie_end == -1) {
cookie_end = allcookies.length;
} //得到想要的cookie的值
var value = unescape(allcookies.substring(cookie_pos, cookie_end));
}
return value;
},
export default {
// 返回格式化时间,传参例如:"yyyy-MM-dd hh:mm:ss"
formatDate (fmt, date) {
var date = date ? date : new Date()
@ -114,5 +99,26 @@ export default {
// 小于0前面加上0
handleZero (num) {
return num < 10 ? '0' + num : num
},
// 退出实验
exit () {
let href = Config.isDev ?
`http://${location.hostname}:8082/#/` :
`${location.origin}${Cookie.get('admin-fromManager') ?
'/admin' :
(!Config.isTest) ?
'' :
'/student'}/#/`
// 考核
if (Cookie.get('admin-assessmentId')) {
href += `ass/list`
} else if (Cookie.get('admin-competitionId')) {
// 竞赛
href += `match/list`
} else {
// 练习
href += `station/preview?courseId=${Cookie.get('admin-courseId')}&curriculumName=${Cookie.get('admin-curriculumName') ? decodeURIComponent(Cookie.get('admin-curriculumName')) : 'python'}&mallId=${Cookie.get('admin-mallId')}`
}
location.href = href
}
}

@ -1,100 +1,63 @@
<template>
<div v-show="loaded">
<div class="header"
:class="{hh: $config.isHh}">
<img v-if="$config.isHh"
src="@/assets/images/logo-hh.png"
alt=""
class="logo">
<div class="header" :class="{ hh: $config.isHh }">
<img v-if="$config.isHh" src="@/assets/images/logo-hh.png" alt="" class="logo">
<p v-else>{{ curriculumName }}</p>
<el-button class="back btn"
type="primary"
@click="back">退出实验</el-button>
<p v-if="third === 'ai'">账号{{ account }}密码112233aa</p>
<el-button class="back btn" type="primary" @click="back">退出实验</el-button>
</div>
<template v-if="!notAllowed">
<iframe v-if="third" class="AI" :src="iframeSrc" frameborder="0" width="100%"></iframe>
<template v-else>
<div class="top">
<div class="language">
<p v-if="$config.isHh"
style="font-size: 18px">{{$config.title}}</p>
<p v-if="$config.isHh" style="font-size: 18px">{{ $config.title }}</p>
<p>编程语言</p>
<el-select v-model="language"
@change="languageChange">
<el-option v-for="(item, i) in languages"
:key="i"
:label="item.name"
:value="item.id"></el-option>
<el-select v-model="language" @change="languageChange">
<el-option v-for="(item, i) in languages" :key="i" :value="item.name"></el-option>
</el-select>
<el-button v-if="language"
class="open-vs"
type="primary"
size="small"
<el-button v-if="language === 'vscode'" class="open-vs" type="primary" size="small"
@click="openVscode">打开Vscode新窗口</el-button>
</div>
<div class="inline-center">
<el-tooltip class="item"
effect="dark"
content="支持导入其它数据用于实验,总上传的文件大小不可以超过10M"
placement="bottom">
<i class="info el-icon-warning"
style="margin-right: 10px"></i>
<el-tooltip class="item" effect="dark" content="支持导入其它数据用于实验,总上传的文件大小不可以超过10M" placement="bottom">
<i class="info el-icon-warning" style="margin-right: 10px"></i>
</el-tooltip>
<el-button type="primary"
size="small"
icon="el-icon-document"
@click="toData">我的数据</el-button>
<el-button type="primary" size="small" icon="el-icon-document" @click="toData">我的数据</el-button>
</div>
</div>
<div class="tab">
<el-tabs v-model="curTab"
type="card"
@tab-click="judChange">
<el-tab-pane v-for="(item, i) in workbench"
:key="item.judgmentId"
:label="item.name"
<el-tabs v-model="curTab" type="card" @tab-click="judChange">
<el-tab-pane v-for="(item, i) in workbench" :key="item.judgmentId" :label="item.name"
:value="item.judgmentId">
<codemirror v-if="!language"
:ref="'code' + i"
:key="codeKey"
:projectId.sync="projectId"
:systemId.sync="systemId"
:code.sync="item.code"
:finalCode.sync="item.finalCode"
:judgmentId="item.judgmentId"
:codeId.sync="item.codeId"
:answer.sync="item.answer"
:retResult.sync="item.retResult"
:photoUrl.sync="item.photoUrl"
:index="i"
:curTab.sync="curTab"
:modelIsShow.sync="modelIsShow"
@cache="leavePage"></codemirror>
<iframe v-else
class="vscode"
:src="Config.vscodeUrl"
frameborder="0"
width="100%"></iframe>
<codemirror v-if="language !== 'vscode'" :ref="'code' + i" :key="codeKey" :projectId.sync="projectId"
:systemId.sync="systemId" :code.sync="item.code" :finalCode.sync="item.finalCode"
:judgmentId="item.judgmentId" :codeId.sync="item.codeId" :answer.sync="item.answer"
:retResult.sync="item.retResult" :photoUrl.sync="item.photoUrl" :index="i" :curTab.sync="curTab"
:modelIsShow.sync="modelIsShow"></codemirror>
<iframe v-else class="vscode" :src="Config.vscodeUrl" frameborder="0" width="100%"></iframe>
</el-tab-pane>
</el-tabs>
</div>
</template>
<div class="menu">
<testPanel @tell="setPoints"
@recoveryCode="recoveryCode"
ref="mainindex"
:workbench.sync="workbench"></testPanel>
<testPanel @tell="setPoints" @recoveryCode="recoveryCode" ref="mainindex" :workbench.sync="workbench">
</testPanel>
</div>
<div v-if="isSubmit"
class="mask"></div>
<div v-if="isSubmit" class="mask"></div>
</template>
</div>
</template>
<script>
import newmain from "../util/newMain";
import testPanel from "../components/TestPanel";
import codemirror from "../components/codemirror";
import newmain from "../util/newMain"
import Util from '@/util'
import testPanel from "../components/TestPanel"
import codemirror from "../components/codemirror"
import Cookie from 'js-cookie'
import { Loading } from 'element-ui'
import Config from '@/config'
@ -102,6 +65,8 @@ export default {
data () {
return {
Config,
third: Cookie.get('admin-third'), // iframe
iframeSrc: '',
isSubmit: Cookie.get('admin-isSubmit') == 'true' ? true : false, //
loaded: false, //
loadIns: null, // loading
@ -111,24 +76,33 @@ export default {
curriculumName: Cookie.get('admin-curriculumName') ? decodeURIComponent(Cookie.get('admin-curriculumName')) : 'python', //
assessmentId: Cookie.get('admin-assessmentId'), // id
mallId: Cookie.get('admin-mallId'),
language: +Cookie.get('admin-language') || 0, //
language: Cookie.get('admin-language') || 'python3.7.9', //
projectId: '',
systemId: '',
modelIsShow: false, //
projectPermissions: 0, // (0 1 2)
languages: [
{
id: 0,
name: 'Python'
name: 'python3.7.9'
},
{
name: 'python3.9'
},
{
name: 'python3.10.9'
},
{
name: 'python3.12.4'
},
{
id: 1,
name: 'Vscode'
name: 'vscode'
},
],
curTab: '', //
workbench: [], //
codeKey: 1 //
codeKey: 1, //
notAllowed: 0,
account: '',
};
},
components: {
@ -136,6 +110,31 @@ export default {
testPanel
},
mounted () {
if (this.third) {
this.language = 'vscode'
this.third === 'ai' && this.handleAI()
this.iframeSrc = this.third === 'ai' ? 'https://ai.huorantech.cn/' : 'https://lowcode.izhixinyun.com/'
document.body.style.overflow = 'hidden'
this.loaded = true
} else {
Cookie.set('admin-language', 'python3.7.9')
// const opened = +localStorage.getItem('opened')
// if (opened) {
// localStorage.setItem('opened', opened + 1)
// this.$alert('', '', {
// confirmButtonText: '退',
// showClose: false,
// beforeClose: () => {
// Util.exit()
// },
// })
// } else {
// this.notAllowed = 0
// localStorage.setItem('opened', 1)
// }
this.notAllowed = 0
document.onkeydown = function (event) {
var e = event || window.event || arguments.callee.caller.arguments[0];
@ -152,30 +151,18 @@ export default {
newmain.$on("isSubmit", isSubmit => {
this.isSubmit = isSubmit
})
this.autoLogout()
//
window.onbeforeunload = () => {
this.leavePage()
}
},
beforeRouteLeave (to, from, next) {
next(this.leavePage())
this.autoLogout()
},
methods: {
//
leavePage () {
const list = this.workbench
//
if (!this.$refs.mainindex.isSubmit && list.length) {
const cache = {
projectId: Number(this.projectId),
judgmentIdList: this.workbench.map(e => e.judgmentId)
}
//
if (!list.some(e => e.code)) {
cache.empty = true //
}
localStorage.setItem('codeCache', JSON.stringify(cache)) // ididid
// ai
async handleAI () {
const res = await this.$get(`${this.api.getTheMostRecentlyRunProject}`, {
ai: 1,
cid: Cookie.get('admin-courseId')
})
if (res.account) {
this.account = res.account
}
},
//
@ -210,7 +197,7 @@ export default {
if ((new Date().getTime() - lastTime) > this.$config.autoLogoutTime) {
logout || this.$message.error('用户登录过期,请重新登录')
logout = true
setTimeout(this.back, 1500)
setTimeout(Util.exit, 1500)
}
}, 1000)
},
@ -229,24 +216,7 @@ export default {
},
// 退
back () {
let href = this.$config.isDev ?
`http://${location.hostname}:8082/#/` :
`${location.origin}${this.fromManager ?
'/admin' :
(!this.$config.isTest) ?
'' :
'/student'}/#/`
//
if (this.assessmentId) {
href += `ass/list`
} else if (this.competitionId) {
//
href += `match/list`
} else {
//
href += `station/preview?courseId=${this.courseId}&curriculumName=${this.curriculumName}&mallId=${this.mallId}`
}
location.href = href
Util.exit()
},
// id
setPoints (projectId, systemId, workbench) {
@ -262,31 +232,42 @@ export default {
[v-cloak] {
display: none;
}
.header {
display: flex;
justify-content: space-between;
height: 58px;
line-height: 58px;
background-color: #f8f8f8;
&.hh {
padding: 10px 0;
line-height: normal;
}
p {
margin-left: 18px;
font-size: 20px;
color: rgba(51, 51, 51, 1);
}
.logo {
width: 200px;
margin-left: 10px;
}
.back {
padding: 23px 50px;
border: none;
border-radius: 0;
}
}
.AI {
height: calc(100vh - 58px);
}
/deep/.top {
display: flex;
justify-content: space-between;
@ -294,20 +275,25 @@ export default {
height: 60px;
padding: 0 15px;
line-height: 60px;
.language {
display: inline-flex;
align-items: center;
}
p {
font-size: 16px;
margin-right: 15px;
}
.el-input {
width: 200px;
}
.el-input .el-input__inner {
border-radius: 30px;
}
.open-vs {
margin-left: 20px;
}
@ -316,47 +302,60 @@ export default {
.vscode {
height: calc(100vh - 186px);
}
.menu {
position: relative;
z-index: 1000;
}
::v-deep .el-dialog--center {
width: 400px;
}
::v-deep .el-dialog__headerbtn .el-icon-close:before {
padding: 3px;
border-radius: 50%;
}
/deep/.tab {
height: 50px;
line-height: 50px;
.el-tabs__header {
margin-bottom: 0;
}
.el-tabs__item.is-active {
color: #333;
}
.el-icon-circle-plus-outline:before {
font-size: 16px;
}
.el-tabs--card>.el-tabs__header {
border-bottom: none;
}
.el-tabs--card>.el-tabs__header .el-tabs__nav {
border: none;
}
.el-tabs--card>.el-tabs__header .el-tabs__item {
border-left: none;
border-bottom: none;
}
}
.info {
color: #bfbfbf;
cursor: pointer;
&:hover {
opacity: 0.9;
}
}
.mask {
z-index: 999;
position: absolute;

@ -2,165 +2,112 @@
<!-- 实验报告 -->
<div class="wrap">
<breadcrumb data="返回实验/我的数据"></breadcrumb>
<div class="content"
:class="{loading}"
id="pdfDom">
<div style="text-align: right"
v-if="!loading">
<el-button size="mini"
@click="editReport">
<div class="content" :class="{ loading }" id="pdfDom">
<div style="text-align: right" v-if="!loading">
<el-button size="mini" @click="editReport">
{{ editing ? "保存" : "编辑" }}
</el-button>
<el-button type="primary"
size="mini"
@click="exportPage">导出报告</el-button>
<el-button type="primary" size="mini" @click="exportPage">导出报告</el-button>
</div>
<h6 class="r-title">标准实验报告</h6>
<div class="info">
<h6 class="l-title">
<img src="@/assets/images/report1.png"
alt="">
<img src="@/assets/images/report1.png" alt="">
基本信息
</h6>
<ul :class="['info-list', { edit: editing }]">
<li>
<label>学生姓名</label>
<el-input v-if="editing"
v-model="infoData.userName"
disabled></el-input>
<el-input v-if="editing" v-model="infoData.userName" disabled></el-input>
<span v-else>{{ infoData.userName }}</span>
</li>
<li>
<label>学生学号</label>
<el-input v-if="editing"
v-model="infoData.workNumber"
disabled></el-input>
<el-input v-if="editing" v-model="infoData.workNumber" disabled></el-input>
<span v-else>{{ infoData.workNumber }}</span>
</li>
<li>
<label>实验时间</label>
<el-input v-if="editing"
v-model="infoData.submitTime"
disabled></el-input>
<el-input v-if="editing" v-model="infoData.submitTime" disabled></el-input>
<span v-else>{{ infoData.submitTime }}</span>
</li>
<li>
<label>实验成绩</label>
<el-input v-if="editing"
v-model="infoData.score"
disabled></el-input>
<div v-else
class="score-wrap">
<el-input v-if="editing" v-model="infoData.score" disabled></el-input>
<div v-else class="score-wrap">
<em>{{ infoData.score }}</em>
<img src="@/assets/images/point.png"
alt="">
<img src="@/assets/images/point.png" alt="">
</div>
</li>
<li>
<label>学生班级</label>
<el-input v-if="editing"
v-model="infoData.className"></el-input>
<el-input v-if="editing" v-model="infoData.className"></el-input>
<span v-else>{{ infoData.className }}</span>
</li>
<li>
<label>指导老师</label>
<el-input v-if="editing"
v-model="infoData.instructor"></el-input>
<el-input v-if="editing" v-model="infoData.instructor"></el-input>
<span v-else>{{ infoData.instructor }}</span>
</li>
<li>
<label>实验学时</label>
<el-input v-if="editing"
v-model="infoData.period"></el-input>
<el-input v-if="editing" v-model="infoData.period"></el-input>
<span v-else>{{ infoData.period }}</span>
</li>
</ul>
<div class="m-b-20">
<h6 class="l-title">
<img src="@/assets/images/report2.png"
alt="">
<img src="@/assets/images/report2.png" alt="">
实验项目名称
</h6>
<el-input v-if="editing"
v-model="infoData.projectName"
type="textarea"></el-input>
<div v-else
class="pre-wrap"
v-html="infoData.projectName"></div>
<el-input v-if="editing" v-model="infoData.projectName" type="textarea"></el-input>
<div v-else class="pre-wrap" v-html="infoData.projectName"></div>
</div>
<div class="m-b-20">
<h6 class="l-title">
<img src="@/assets/images/report3.png"
alt="">
<img src="@/assets/images/report3.png" alt="">
实验目的
</h6>
<quill v-if="editing"
:border="true"
v-model="infoData.purpose"
:height="150" />
<div v-else
:class="['pre-wrap', {edit: editing}]"
v-html="infoData.purpose"></div>
<quill v-if="editing" :border="true" v-model="infoData.purpose" :height="150" />
<div v-else :class="['pre-wrap', { edit: editing }]" v-html="infoData.purpose"></div>
</div>
<div class="m-b-20">
<h6 class="l-title">
<img src="@/assets/images/report4.png"
alt="">
<img src="@/assets/images/report4.png" alt="">
实验数据
</h6>
<el-table :data="expData"
class="table"
border
stripe
header-align="center">
<el-table-column type="index"
label="序号"
align="center"
width="60">
<el-table :data="expData" class="table" border stripe header-align="center">
<el-table-column type="index" label="序号" align="center" width="60">
<template slot-scope="scope">
{{ scope.$index + 1 }}
</template>
</el-table-column>
<el-table-column prop="judgmentName"
label="判分点"
width="200"
align="center"></el-table-column>
<el-table-column v-if='project'
prop="judgmentName"
label="考核点"
align="center"
width="150">
<el-table-column prop="judgmentName" label="判分点" width="200" align="center"></el-table-column>
<el-table-column v-if='project' prop="judgmentName" label="考核点" align="center" width="150">
<template slot-scope="scope">
<div v-for="(item, index) in scope.row.lcRuleRecords"
:key="index">
<div v-for="(item, index) in scope.row.lcRuleRecords" :key="index">
<span>
<span>{{ index + 1 }}. </span>{{ item.name }}
</span>
</div>
</template>
</el-table-column>
<el-table-column prop="ruleAnswer"
label="参考答案"
style='word-wrap: break-word'>
<el-table-column prop="ruleAnswer" label="参考答案" style='word-wrap: break-word'>
<template slot-scope="scope">
<div v-if='scope.row.lcRuleRecords'>
<div v-for="(item, index) in scope.row.lcRuleRecords"
:key="index">
<div v-for="(item, index) in scope.row.lcRuleRecords" :key="index">
<span>
<span>{{ index + 1 }}. </span>{{ item.ruleAnswer }}
</span>
</div>
</div>
<div v-else
v-html="scope.row.referenceAnswer"></div>
<div v-else v-html="scope.row.referenceAnswer"></div>
</template>
</el-table-column>
<el-table-column prop="userAnswer"
label="学生答案">
<el-table-column prop="userAnswer" label="学生答案">
<template slot-scope="scope">
<div v-if='scope.row.lcRuleRecords'>
<div v-for="(item, index) in scope.row.lcRuleRecords"
:key="index">
<div v-for="(item, index) in scope.row.lcRuleRecords" :key="index">
<span v-if='item.userAnswer'>
<span>{{ index + 1 }}. </span>{{ item.userAnswer }}
</span>
@ -169,51 +116,30 @@
</span>
</div>
</div>
<div v-else
v-html='scope.row.answer'
style='white-space: pre-wrap'></div>
<div v-else class="pre-code">{{ scope.row.answer }}</div>
</template>
</el-table-column>
<el-table-column prop="runResult"
label="学生运行结果"
align="center">
<el-table-column prop="runResult" label="学生运行结果" align="center">
<template slot-scope="scope">
<div class="m-b-20"
v-html='scope.row.runResult'
style='white-space: pre-wrap'></div>
<div class="m-b-20 pre-code">{{ scope.row.runResult }}</div>
<template v-if="scope.row.runThePictureList">
<img v-for="(img, i) in scope.row.runThePictureList"
:key="i"
width="200"
class="result-pic"
:src="img"
alt="">
<img v-for="(img, i) in scope.row.runThePictureList" :key="i" width="200" class="result-pic"
:src="img" alt="">
</template>
</template>
</el-table-column>
<el-table-column prop="quesScore"
label="分值"
width="80"
align="center"></el-table-column>
<el-table-column prop="score"
label="得分"
width="80"
align="center"></el-table-column>
<el-table-column prop="quesScore" label="分值" width="80" align="center"></el-table-column>
<el-table-column prop="score" label="得分" width="80" align="center"></el-table-column>
</el-table>
</div>
<div class="m-b-20">
<h6 class="l-title">
<img src="@/assets/images/report5.png"
alt="">
<img src="@/assets/images/report5.png" alt="">
实验总结与体会
</h6>
<Editor v-if="editing"
api-key='rnk6zw9v267xqz7pf98twt1vmrvltmd436je7a642pckltda'
v-model="infoData.summarize"
<Editor v-if="editing" api-key='rnk6zw9v267xqz7pf98twt1vmrvltmd436je7a642pckltda' v-model="infoData.summarize"
:init="editorConfig" />
<div v-show="!editing"
class="pre-wrap"
v-html="infoData.summarize"></div>
<div v-show="!editing" class="pre-wrap" v-html="infoData.summarize"></div>
</div>
</div>
</div>
@ -272,17 +198,18 @@ export default {
purpose: form.purpose,
summarize: form.summarize
}
const data = report.data
this.userScores = userScores
let { data } = report
// data使
if (!data) {
this.userScores = userScores
this.handleList(userScores)
this.$post(this.api.editExperimentalData, {
reportId,
data: JSON.stringify(userScores)
}).then(res => { }).catch(err => { })
} else {
this.handleList(userScores.find(e => e.lcRuleRecords) ? userScores : JSON.parse(data))
data = JSON.parse(data)
this.handleList(data)
}
}).catch(res => { })
},
@ -359,12 +286,19 @@ export default {
<style lang="scss" scoped>
@import '/styles/css/editor.css';
.m-b-20 {
margin-bottom: 20px;
}
.wrap {
padding: 12px 300px 20px;
}
.pre-code {
white-space: pre-wrap;
}
code,
kbd,
samp {
@ -373,12 +307,18 @@ samp {
word-wrap: break-word;
white-space: pre-wrap;
}
/deep/ pre {
white-space: pre-wrap; /* css-3 */
white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
white-space: pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */
word-wrap: break-word; /* Internet Explorer 5.5+ */
white-space: pre-wrap;
/* css-3 */
white-space: -moz-pre-wrap;
/* Mozilla, since 1999 */
white-space: pre-wrap;
/* Opera 4-6 */
white-space: -o-pre-wrap;
/* Opera 7 */
word-wrap: break-word;
/* Internet Explorer 5.5+ */
word-break: break-all;
overflow: hidden;
font-size: 12px;
@ -386,22 +326,27 @@ samp {
font-family: 'PingFang SC', 'Helvetica Neue', Helvetica, 'microsoft yahei',
arial, STHeiTi, sans-serif;
}
.content {
padding: 16px 0;
background: #fff;
&.loading {
padding-top: 30px;
}
.r-title {
margin-bottom: 40px;
font-size: 24px;
text-align: center;
color: #333;
}
.info {
padding: 20px 16px;
border: 1px solid #e1e6f2;
}
.l-title {
display: flex;
align-items: center;
@ -410,43 +355,52 @@ samp {
font-size: 14px;
color: #333;
background-color: #f7f9fc;
img {
margin-right: 5px;
}
}
.info-list {
display: flex;
flex-wrap: wrap;
padding: 10px 0 0 20px;
li {
display: inline-flex;
width: 25%;
padding: 0 10px;
margin-bottom: 34px;
}
&.edit {
li {
align-items: center;
}
}
label {
font-size: 14px;
color: #333;
white-space: nowrap;
}
span {
min-width: 150px;
padding: 0 10px 3px;
border-bottom: 1px solid #e1e6f2;
}
/deep/.el-input {
width: 174px;
}
}
.score-wrap {
position: relative;
min-width: 150px;
border-bottom: 1px solid #e1e6f2;
em {
position: absolute;
top: -12px;
@ -456,18 +410,21 @@ samp {
font-weight: 600;
color: #0b1d30;
}
img {
position: absolute;
bottom: -15px;
left: 0;
}
}
/deep/.el-textarea .el-textarea__inner,
.pre-wrap {
min-height: 72px;
padding: 10px 16px;
font-size: 14px;
color: #333;
&.edit {
color: #abb3c6;
border: 1px solid #cacfdb;
@ -475,22 +432,27 @@ samp {
background-color: #f6f7f9;
}
}
/deep/ .table th {
background-color: #e1eaff !important;
.cell {
line-height: 35px;
color: #555555;
}
}
}
.result-pic {
margin: 10px 0;
}
@media (max-width: 1650px) {
.wrap {
padding: 12px 200px 20px;
}
}
@media (max-width: 1430px) {
.wrap {
padding: 12px 100px 20px;

Loading…
Cancel
Save