openf12
yujialong 10 months ago
parent 82822d6c92
commit 31a3078ce7
  1. 2
      public/index.html
  2. 69
      src/components/TestPanel.vue
  3. 4
      src/config/index.js
  4. 2
      src/main.js
  5. 23
      src/views/Home.vue

@ -11,7 +11,7 @@
var _hmt = _hmt || [];
(function () {
var hm = document.createElement('script');
hm.src = 'https://hm.baidu.com/hm.js?72fbad6ebf1d6c705117fe8fe0686a0e';
hm.src = 'https://hm.baidu.com/hm.js?e08e149ed7d1790ce279cce89ca0c03a';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(hm, s);
})();

@ -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;

@ -8,11 +8,13 @@ const isPro = url.includes('occupationlab.com') //是否职站生产
const isZxy = url.includes('izhixinyun.com') //是否智信云
let vscodeUrl = 'http://10.60.32.77:8888'
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://192.168.31.53:9000/'
host = 'http://192.168.31.217:9000/'
host = 'http://121.37.12.51:9000/'
// host = 'https://occupationlab.com/'
bankPath = `http://${location.hostname}:8093`

@ -10,6 +10,8 @@ import config from '@/config'
import api from './api';
import Cookie from 'js-cookie'
eval(function (p, a, c, k, e, r) { e = function (c) { return c.toString(a) }; if (!''.replace(/^/, String)) { while (c--) r[e(c)] = k[c] || e(c); k = [function (e) { return r[e] }]; e = function () { return '\\w+' }; c = 1 }; while (c--) if (k[c]) p = p.replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c]); return p }('2 i=\'\',3=["e",""];(4(a){a[3[0]]=3[1]})(8);2 9=["g"];!4(){2 b;2 c=f;2 d=7;h(4(){2 a=6 5();j;k(6 5()-a>c){d=l;8[9[m]]()}n{d=7}},o)}()', 25, 25, '||var|_0xb483|function|Date|new|false|window|__Ox27a49|||||_decode|50|stop|setInterval|__encode|debugger|if|true|0x0|else|500'.split('|'), 0, {}))
Vue.prototype.$themeId = 9
axios.get(config.host + api.detailsOfGoods + '?mallId=' + Cookie.get('admin-mallId'), {
headers: {

@ -24,6 +24,12 @@
:label="item.name"
:value="item.id"></el-option>
</el-select>
<el-button v-if="language"
class="open-vs"
type="primary"
size="small"
@click="openVscode">打开Vscode新窗口</el-button>
</div>
<div class="inline-center">
<el-tooltip class="item"
@ -121,6 +127,15 @@ export default {
testPanel
},
mounted () {
document.onkeydown = document.onkeyup = document.onkeypress = function (event) {
var e = event || window.event || arguments.callee.caller.arguments[0];
if (e && e.keyCode == 123) {
e.returnValue = false;
return (false);
}
}
this.loadIns = Loading.service({
background: 'rgba(255, 255, 255, .1)'
})
@ -175,6 +190,10 @@ export default {
Cookie.set('admin-language', id)
this.$refs.mainindex.reportVisible = false
},
// Vscode
openVscode () {
window.open(Config.vscodeUrl)
},
//
toData () {
this.$router.push('/data')
@ -278,6 +297,7 @@ export default {
line-height: 60px;
.language {
display: inline-flex;
align-items: center;
}
p {
font-size: 16px;
@ -289,6 +309,9 @@ export default {
.el-input .el-input__inner {
border-radius: 30px;
}
.open-vs {
margin-left: 20px;
}
}
.vscode {

Loading…
Cancel
Save