|
|
@ -78,7 +78,7 @@ |
|
|
|
:options="cmOption" |
|
|
|
:options="cmOption" |
|
|
|
class="code-mirror" |
|
|
|
class="code-mirror" |
|
|
|
:ref="'codemirror' + scope.$index" |
|
|
|
:ref="'codemirror' + scope.$index" |
|
|
|
@ready="ready"></codemirror> |
|
|
|
@ready="() => ready(scope.$index)"></codemirror> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="score" |
|
|
|
<el-table-column prop="score" |
|
|
@ -249,22 +249,22 @@ |
|
|
|
</el-container> |
|
|
|
</el-container> |
|
|
|
</el-container> |
|
|
|
</el-container> |
|
|
|
|
|
|
|
|
|
|
|
<div :class="['toggle-panel', {active: pannelVisible}]" |
|
|
|
<div :class="['toggle-panel', {active: pannelVisible}]"> |
|
|
|
id="toggle" |
|
|
|
|
|
|
|
@click="togglePannel"> |
|
|
|
|
|
|
|
<!-- <div @click="togglePannel"> --> |
|
|
|
<!-- <div @click="togglePannel"> --> |
|
|
|
<div> |
|
|
|
<i class="el-icon-rank drag-icon" |
|
|
|
|
|
|
|
id="drag"></i> |
|
|
|
<img :src="require(`@/assets/images/system/${$themeId}/left.png`)" |
|
|
|
<img :src="require(`@/assets/images/system/${$themeId}/left.png`)" |
|
|
|
alt |
|
|
|
alt |
|
|
|
class="c-p" |
|
|
|
class="c-p" |
|
|
|
|
|
|
|
@click="togglePannel" |
|
|
|
v-if="pannelVisible" /> |
|
|
|
v-if="pannelVisible" /> |
|
|
|
<img :src="require(`@/assets/images/system/${$themeId}/right.png`)" |
|
|
|
<img :src="require(`@/assets/images/system/${$themeId}/right.png`)" |
|
|
|
alt |
|
|
|
alt |
|
|
|
class="c-p" |
|
|
|
class="c-p" |
|
|
|
|
|
|
|
@click="togglePannel" |
|
|
|
v-if="!pannelVisible" /> |
|
|
|
v-if="!pannelVisible" /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
<script> |
|
|
@ -433,7 +433,7 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
this.competitionId && this.getCompetitionStatus() // 查询竞赛信息 |
|
|
|
this.competitionId && this.getCompetitionStatus() // 查询竞赛信息 |
|
|
|
this.getUserDetail() |
|
|
|
this.getUserDetail() |
|
|
|
// this.drag() |
|
|
|
this.drag() |
|
|
|
this.tableHeight = window.innerHeight - 360 |
|
|
|
this.tableHeight = window.innerHeight - 360 |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
@ -625,7 +625,7 @@ export default { |
|
|
|
this.closeLoad() |
|
|
|
this.closeLoad() |
|
|
|
const code = res.getLastCache |
|
|
|
const code = res.getLastCache |
|
|
|
// 如果有缓存代码 |
|
|
|
// 如果有缓存代码 |
|
|
|
if (code && !e.code) { |
|
|
|
if (code) { |
|
|
|
hasCache = 1 |
|
|
|
hasCache = 1 |
|
|
|
if (newJudgmentId === '') newJudgmentId = i |
|
|
|
if (newJudgmentId === '') newJudgmentId = i |
|
|
|
e.code = code |
|
|
|
e.code = code |
|
|
@ -651,7 +651,7 @@ export default { |
|
|
|
this.getProDetail().then(() => { |
|
|
|
this.getProDetail().then(() => { |
|
|
|
this.points.map(e => { |
|
|
|
this.points.map(e => { |
|
|
|
const item = points.find(n => n.judgmentId === e.judgmentId) |
|
|
|
const item = points.find(n => n.judgmentId === e.judgmentId) |
|
|
|
if (item && item.code && !e.code) this.$set(e, 'code', item.code) |
|
|
|
if (item && item.code) this.$set(e, 'code', item.code) |
|
|
|
}) |
|
|
|
}) |
|
|
|
this.$emit('tell', projectId, this.curSystemId, this.points) |
|
|
|
this.$emit('tell', projectId, this.curSystemId, this.points) |
|
|
|
this.$emit('recoveryCode', newJudgmentId + '') // 切换为缓存的判分点,tab索引值要为字符串 |
|
|
|
this.$emit('recoveryCode', newJudgmentId + '') // 切换为缓存的判分点,tab索引值要为字符串 |
|
|
@ -755,6 +755,7 @@ export default { |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
let href = location.origin |
|
|
|
let href = location.origin |
|
|
|
if (this.$config.isTest) href += '/student' |
|
|
|
if (this.$config.isTest) href += '/student' |
|
|
|
|
|
|
|
if (this.$config.isDev) href = `http://${location.hostname}:8082` |
|
|
|
href += `/#/record/show?python=1&reportId=${reportId}` |
|
|
|
href += `/#/record/show?python=1&reportId=${reportId}` |
|
|
|
// 练习 |
|
|
|
// 练习 |
|
|
|
if (this.projectPermissions == 0) { |
|
|
|
if (this.projectPermissions == 0) { |
|
|
@ -784,12 +785,14 @@ export default { |
|
|
|
this.entryTime = await this.getNow() |
|
|
|
this.entryTime = await this.getNow() |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 页面加载完后重置编辑框大小 |
|
|
|
// 页面加载完后重置编辑框大小 |
|
|
|
ready () { |
|
|
|
ready (i) { |
|
|
|
for (let i = 0; i < this.points.length; i++) { |
|
|
|
if (this.$refs['codemirror' + i]) { |
|
|
|
const code = this.$refs['codemirror' + i][0].codemirror |
|
|
|
const code = this.$refs['codemirror' + i].codemirror |
|
|
|
|
|
|
|
if (code) { |
|
|
|
// code && code.setSize('auto', 'calc(100vh - 150px)') |
|
|
|
code.on('beforeChange', (istance, change) => { |
|
|
|
code && code.setSize('auto', '300px') |
|
|
|
change.origin === 'paste' && change.cancel() |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 提交询问 |
|
|
|
// 提交询问 |
|
|
@ -826,7 +829,7 @@ export default { |
|
|
|
cid: this.courseId, |
|
|
|
cid: this.courseId, |
|
|
|
projectId: this.projectId, |
|
|
|
projectId: this.projectId, |
|
|
|
userAnswer: e.codeResult || null, |
|
|
|
userAnswer: e.codeResult || null, |
|
|
|
type: 1 |
|
|
|
type: 0 |
|
|
|
}) |
|
|
|
}) |
|
|
|
this.$parent.workbench[i].codeId = codeId |
|
|
|
this.$parent.workbench[i].codeId = codeId |
|
|
|
this.$parent.workbench[i].answer = e.codeResult |
|
|
|
this.$parent.workbench[i].answer = e.codeResult |
|
|
@ -1047,7 +1050,7 @@ export default { |
|
|
|
// 拖拽面板 |
|
|
|
// 拖拽面板 |
|
|
|
drag () { |
|
|
|
drag () { |
|
|
|
document.querySelector('.scrollbar').onmousedown = null |
|
|
|
document.querySelector('.scrollbar').onmousedown = null |
|
|
|
document.querySelector('#toggle').onmousedown = null |
|
|
|
document.querySelector('#drag').onmousedown = null |
|
|
|
|
|
|
|
|
|
|
|
const el = document.querySelector('#panel') |
|
|
|
const el = document.querySelector('#panel') |
|
|
|
const drag = e => { |
|
|
|
const drag = e => { |
|
|
@ -1082,7 +1085,7 @@ export default { |
|
|
|
e.cancelBubble = true |
|
|
|
e.cancelBubble = true |
|
|
|
e.returnValue = false |
|
|
|
e.returnValue = false |
|
|
|
|
|
|
|
|
|
|
|
let timer = setTimeout(this.togglePannel, 200) |
|
|
|
// let timer = setTimeout(this.togglePannel, 200) |
|
|
|
|
|
|
|
|
|
|
|
let x = e.clientX - el.offsetLeft |
|
|
|
let x = e.clientX - el.offsetLeft |
|
|
|
let y = e.clientY - el.offsetTop |
|
|
|
let y = e.clientY - el.offsetTop |
|
|
@ -1091,7 +1094,7 @@ export default { |
|
|
|
let top = 0 |
|
|
|
let top = 0 |
|
|
|
|
|
|
|
|
|
|
|
document.onmousemove = function (eve) { |
|
|
|
document.onmousemove = function (eve) { |
|
|
|
clearTimeout(timer) |
|
|
|
// clearTimeout(timer) |
|
|
|
left = eve.clientX - x |
|
|
|
left = eve.clientX - x |
|
|
|
top = eve.clientY - y |
|
|
|
top = eve.clientY - y |
|
|
|
el.style.left = left + 'px' |
|
|
|
el.style.left = left + 'px' |
|
|
@ -1102,7 +1105,8 @@ export default { |
|
|
|
document.onmouseup = null |
|
|
|
document.onmouseup = null |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
document.querySelector('#toggle').onmousedown = this.pannelVisible ? this.togglePannel : drag1 |
|
|
|
// document.querySelector('#toggle').onmousedown = this.pannelVisible ? this.togglePannel : drag1 |
|
|
|
|
|
|
|
document.querySelector('#drag').onmousedown = drag1 |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// websocket获取考核及竞赛信息,用于自动提交 |
|
|
|
// websocket获取考核及竞赛信息,用于自动提交 |
|
|
@ -1365,12 +1369,19 @@ export default { |
|
|
|
.toggle-panel { |
|
|
|
.toggle-panel { |
|
|
|
position: absolute; |
|
|
|
position: absolute; |
|
|
|
top: 60%; |
|
|
|
top: 60%; |
|
|
|
|
|
|
|
text-align: center; |
|
|
|
&.active { |
|
|
|
&.active { |
|
|
|
left: 100%; |
|
|
|
left: 100%; |
|
|
|
} |
|
|
|
} |
|
|
|
img { |
|
|
|
img { |
|
|
|
height: 150px; |
|
|
|
height: 150px; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.drag-icon { |
|
|
|
|
|
|
|
font-size: 20px; |
|
|
|
|
|
|
|
line-height: 1; |
|
|
|
|
|
|
|
color: #fff; |
|
|
|
|
|
|
|
cursor: pointer; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
&.active { |
|
|
|
&.active { |
|
|
|
position: fixed; |
|
|
|
position: fixed; |
|
|
|