yujialong 4 months ago
parent 9f816354a2
commit a7a04ff314
  1. 2
      src/App.vue
  2. 13
      src/components/TestPanel.vue
  3. 15
      src/views/Home.vue

@ -21,8 +21,6 @@ export default {
} }
//vuexsessionStorage //vuexsessionStorage
window.addEventListener("beforeunload", () => { window.addEventListener("beforeunload", () => {
console.log('beforeunload')
const opened = +localStorage.getItem('opened') const opened = +localStorage.getItem('opened')
if (opened) { if (opened) {
localStorage.setItem('opened', opened - 1) localStorage.setItem('opened', opened - 1)

@ -31,7 +31,8 @@
</div> </div>
</div> </div>
<div class="actions"> <div class="actions">
<el-button @click="toggleReport" v-if="$parent.language && !isSubmit && !competitionId">填写实验报告</el-button> <el-button @click="toggleReport"
v-if="$parent.language === 'vscode' && !isSubmit && !competitionId">填写实验报告</el-button>
<el-button @click="toReport" v-if="isSubmit && !competitionId">查看实验报告</el-button> <el-button @click="toReport" v-if="isSubmit && !competitionId">查看实验报告</el-button>
<el-button class="reload" @click="reloadConfirm" v-show="projectPermissions == 0">重新开始</el-button> <el-button class="reload" @click="reloadConfirm" v-show="projectPermissions == 0">重新开始</el-button>
<el-button type="primary" class="submit btn" @click="confirmSubmit" <el-button type="primary" class="submit btn" @click="confirmSubmit"
@ -150,9 +151,11 @@
</el-container> </el-container>
</el-container> </el-container>
<div :class="['toggle-panel', { active: pannelVisible }]"> <div :class="['toggle-panel', { active: pannelVisible, ai: isAI }]">
<!-- <div @click="togglePannel"> --> <!-- <div @click="togglePannel"> -->
<div>
<i class="el-icon-rank drag-icon" id="drag"></i> <i class="el-icon-rank drag-icon" id="drag"></i>
</div>
<img :src="require(`@/assets/images/system/${$themeId}/left.png`)" alt class="c-p" @click="togglePannel" <img :src="require(`@/assets/images/system/${$themeId}/left.png`)" alt class="c-p" @click="togglePannel"
v-if="pannelVisible" /> v-if="pannelVisible" />
<img :src="require(`@/assets/images/system/${$themeId}/right.png`)" alt class="c-p" @click="togglePannel" <img :src="require(`@/assets/images/system/${$themeId}/right.png`)" alt class="c-p" @click="togglePannel"
@ -218,6 +221,7 @@ import Stomp from 'stompjs'
export default { export default {
data () { data () {
return { return {
isAI: Cookie.get('admin-isAI') == 'true' ? true : false,
token: Cookie.get('admin-token'), token: Cookie.get('admin-token'),
systemId: Cookie.get('admin-systemId') || 1, systemId: Cookie.get('admin-systemId') || 1,
classId: Cookie.get('admin-classId'), classId: Cookie.get('admin-classId'),
@ -1448,6 +1452,11 @@ export default {
top: 60%; top: 60%;
text-align: center; text-align: center;
&.ai:not(.active) {
position: fixed;
top: 45%;
}
&.active { &.active {
left: 100%; left: 100%;
} }

@ -6,10 +6,9 @@
<p v-if="isAI">账号{{ account }}密码112233aa</p> <p v-if="isAI">账号{{ account }}密码112233aa</p>
<el-button class="back btn" type="primary" @click="back">退出实验</el-button> <el-button class="back btn" type="primary" @click="back">退出实验</el-button>
</div> </div>
<template v-if="isAI"> <template v-if="!notAllowed">
<iframe class="AI" src="https://ai.huorantech.cn/" frameborder="0" width="100%"></iframe> <iframe v-if="isAI" class="AI" src="https://ai.huorantech.cn/" frameborder="0" width="100%"></iframe>
</template> <template v-else>
<template v-else-if="!notAllowed">
<div class="top"> <div class="top">
<div class="language"> <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>
@ -42,6 +41,7 @@
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</div> </div>
</template>
<div class="menu"> <div class="menu">
<testPanel @tell="setPoints" @recoveryCode="recoveryCode" ref="mainindex" :workbench.sync="workbench"> <testPanel @tell="setPoints" @recoveryCode="recoveryCode" ref="mainindex" :workbench.sync="workbench">
@ -75,7 +75,7 @@ export default {
curriculumName: Cookie.get('admin-curriculumName') ? decodeURIComponent(Cookie.get('admin-curriculumName')) : 'python', // curriculumName: Cookie.get('admin-curriculumName') ? decodeURIComponent(Cookie.get('admin-curriculumName')) : 'python', //
assessmentId: Cookie.get('admin-assessmentId'), // id assessmentId: Cookie.get('admin-assessmentId'), // id
mallId: Cookie.get('admin-mallId'), mallId: Cookie.get('admin-mallId'),
language: Cookie.get('admin-language') || 'python3.10.9', // language: Cookie.get('admin-language') || 'python3.7.9', //
projectId: '', projectId: '',
systemId: '', systemId: '',
modelIsShow: false, // modelIsShow: false, //
@ -100,7 +100,7 @@ export default {
curTab: '', // curTab: '', //
workbench: [], // workbench: [], //
codeKey: 1, // codeKey: 1, //
notAllowed: 1, notAllowed: 0,
account: '', account: '',
}; };
}, },
@ -110,11 +110,12 @@ export default {
}, },
mounted () { mounted () {
if (this.isAI) { if (this.isAI) {
this.language = 'vscode'
this.handleAI() this.handleAI()
document.body.style.overflow = 'hidden' document.body.style.overflow = 'hidden'
this.loaded = true this.loaded = true
} else { } else {
Cookie.set('admin-language', 'python3.10.9') Cookie.set('admin-language', 'python3.7.9')
// const opened = +localStorage.getItem('opened') // const opened = +localStorage.getItem('opened')
// if (opened) { // if (opened) {
// localStorage.setItem('opened', opened + 1) // localStorage.setItem('opened', opened + 1)

Loading…
Cancel
Save