openf12
yujialong 10 months ago
parent 82822d6c92
commit 31a3078ce7
  1. 2
      public/index.html
  2. 51
      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 || []; var _hmt = _hmt || [];
(function () { (function () {
var hm = document.createElement('script'); 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]; var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(hm, s); s.parentNode.insertBefore(hm, s);
})(); })();

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

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

@ -10,6 +10,8 @@ import config from '@/config'
import api from './api'; import api from './api';
import Cookie from 'js-cookie' 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 Vue.prototype.$themeId = 9
axios.get(config.host + api.detailsOfGoods + '?mallId=' + Cookie.get('admin-mallId'), { axios.get(config.host + api.detailsOfGoods + '?mallId=' + Cookie.get('admin-mallId'), {
headers: { headers: {

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

Loading…
Cancel
Save