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